<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/bigquery/migration/v2/migration_error_details.proto

namespace Google\Cloud\BigQuery\Migration\V2;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Provides details for errors, e.g. issues that where encountered when
 * processing a subtask.
 *
 * Generated from protobuf message <code>google.cloud.bigquery.migration.v2.ErrorDetail</code>
 */
class ErrorDetail extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The exact location within the resource (if applicable).
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.migration.v2.ErrorLocation location = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $location = null;
    /**
     * Required. Describes the cause of the error with structured detail.
     *
     * Generated from protobuf field <code>.google.rpc.ErrorInfo error_info = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $error_info = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\BigQuery\Migration\V2\ErrorLocation $location
     *           Optional. The exact location within the resource (if applicable).
     *     @type \Google\Rpc\ErrorInfo $error_info
     *           Required. Describes the cause of the error with structured detail.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationErrorDetails::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The exact location within the resource (if applicable).
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.migration.v2.ErrorLocation location = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\BigQuery\Migration\V2\ErrorLocation|null
     */
    public function getLocation()
    {
        return $this->location;
    }

    public function hasLocation()
    {
        return isset($this->location);
    }

    public function clearLocation()
    {
        unset($this->location);
    }

    /**
     * Optional. The exact location within the resource (if applicable).
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.migration.v2.ErrorLocation location = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\BigQuery\Migration\V2\ErrorLocation $var
     * @return $this
     */
    public function setLocation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\ErrorLocation::class);
        $this->location = $var;

        return $this;
    }

    /**
     * Required. Describes the cause of the error with structured detail.
     *
     * Generated from protobuf field <code>.google.rpc.ErrorInfo error_info = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Rpc\ErrorInfo|null
     */
    public function getErrorInfo()
    {
        return $this->error_info;
    }

    public function hasErrorInfo()
    {
        return isset($this->error_info);
    }

    public function clearErrorInfo()
    {
        unset($this->error_info);
    }

    /**
     * Required. Describes the cause of the error with structured detail.
     *
     * Generated from protobuf field <code>.google.rpc.ErrorInfo error_info = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Rpc\ErrorInfo $var
     * @return $this
     */
    public function setErrorInfo($var)
    {
        GPBUtil::checkMessage($var, \Google\Rpc\ErrorInfo::class);
        $this->error_info = $var;

        return $this;
    }

}

