<?php
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v23/errors/errors.proto

namespace Google\Ads\GoogleAds\V23\Errors;

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

/**
 * Describes how a GoogleAds API call failed. It's returned inside
 * google.rpc.Status.details when a call fails.
 *
 * Generated from protobuf message <code>google.ads.googleads.v23.errors.GoogleAdsFailure</code>
 */
class GoogleAdsFailure extends \Google\Protobuf\Internal\Message
{
    /**
     * The list of errors that occurred.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.errors.GoogleAdsError errors = 1;</code>
     */
    private $errors;
    /**
     * The unique ID of the request that is used for debugging purposes.
     *
     * Generated from protobuf field <code>string request_id = 2;</code>
     */
    protected $request_id = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *                    Optional. Data for populating the Message object.
     *
     * @type \Google\Ads\GoogleAds\V23\Errors\GoogleAdsError[] $errors
     *           The list of errors that occurred.
     * @type string $request_id
     *           The unique ID of the request that is used for debugging purposes.
     * }
     */
    public function __construct($data = null)
    {
        \GPBMetadata\Google\Ads\GoogleAds\V23\Errors\Errors::initOnce();
        parent::__construct($data);
    }

    /**
     * The list of errors that occurred.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.errors.GoogleAdsError errors = 1;</code>
     *
     * @return RepeatedField<\Google\Ads\GoogleAds\V23\Errors\GoogleAdsError>
     */
    public function getErrors()
    {
        return $this->errors;
    }

    /**
     * The list of errors that occurred.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.errors.GoogleAdsError errors = 1;</code>
     *
     * @param  \Google\Ads\GoogleAds\V23\Errors\GoogleAdsError[] $var
     * @return $this
     */
    public function setErrors($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\GoogleAds\V23\Errors\GoogleAdsError::class);
        $this->errors = $arr;

        return $this;
    }

    /**
     * The unique ID of the request that is used for debugging purposes.
     *
     * Generated from protobuf field <code>string request_id = 2;</code>
     *
     * @return string
     */
    public function getRequestId()
    {
        return $this->request_id;
    }

    /**
     * The unique ID of the request that is used for debugging purposes.
     *
     * Generated from protobuf field <code>string request_id = 2;</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setRequestId($var)
    {
        GPBUtil::checkString($var, true);
        $this->request_id = $var;

        return $this;
    }

}

