<?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 and the corresponding resources.
 *
 * Generated from protobuf message <code>google.cloud.bigquery.migration.v2.ResourceErrorDetail</code>
 */
class ResourceErrorDetail extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Information about the resource where the error is located.
     *
     * Generated from protobuf field <code>.google.rpc.ResourceInfo resource_info = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $resource_info = null;
    /**
     * Required. The error details for the resource.
     *
     * Generated from protobuf field <code>repeated .google.cloud.bigquery.migration.v2.ErrorDetail error_details = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $error_details;
    /**
     * Required. How many errors there are in total for the resource. Truncation can be
     * indicated by having an `error_count` that is higher than the size of
     * `error_details`.
     *
     * Generated from protobuf field <code>int32 error_count = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $error_count = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Rpc\ResourceInfo $resource_info
     *           Required. Information about the resource where the error is located.
     *     @type array<\Google\Cloud\BigQuery\Migration\V2\ErrorDetail>|\Google\Protobuf\Internal\RepeatedField $error_details
     *           Required. The error details for the resource.
     *     @type int $error_count
     *           Required. How many errors there are in total for the resource. Truncation can be
     *           indicated by having an `error_count` that is higher than the size of
     *           `error_details`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationErrorDetails::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Information about the resource where the error is located.
     *
     * Generated from protobuf field <code>.google.rpc.ResourceInfo resource_info = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Rpc\ResourceInfo|null
     */
    public function getResourceInfo()
    {
        return $this->resource_info;
    }

    public function hasResourceInfo()
    {
        return isset($this->resource_info);
    }

    public function clearResourceInfo()
    {
        unset($this->resource_info);
    }

    /**
     * Required. Information about the resource where the error is located.
     *
     * Generated from protobuf field <code>.google.rpc.ResourceInfo resource_info = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Rpc\ResourceInfo $var
     * @return $this
     */
    public function setResourceInfo($var)
    {
        GPBUtil::checkMessage($var, \Google\Rpc\ResourceInfo::class);
        $this->resource_info = $var;

        return $this;
    }

    /**
     * Required. The error details for the resource.
     *
     * Generated from protobuf field <code>repeated .google.cloud.bigquery.migration.v2.ErrorDetail error_details = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getErrorDetails()
    {
        return $this->error_details;
    }

    /**
     * Required. The error details for the resource.
     *
     * Generated from protobuf field <code>repeated .google.cloud.bigquery.migration.v2.ErrorDetail error_details = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<\Google\Cloud\BigQuery\Migration\V2\ErrorDetail>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setErrorDetails($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\ErrorDetail::class);
        $this->error_details = $arr;

        return $this;
    }

    /**
     * Required. How many errors there are in total for the resource. Truncation can be
     * indicated by having an `error_count` that is higher than the size of
     * `error_details`.
     *
     * Generated from protobuf field <code>int32 error_count = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getErrorCount()
    {
        return $this->error_count;
    }

    /**
     * Required. How many errors there are in total for the resource. Truncation can be
     * indicated by having an `error_count` that is higher than the size of
     * `error_details`.
     *
     * Generated from protobuf field <code>int32 error_count = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setErrorCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->error_count = $var;

        return $this;
    }

}

