<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/admanager/v1/custom_targeting_key_service.proto

namespace Google\Ads\AdManager\V1;

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

/**
 * Request object for `BatchUpdateCustomTargetingKeys` method.
 *
 * Generated from protobuf message <code>google.ads.admanager.v1.BatchUpdateCustomTargetingKeysRequest</code>
 */
class BatchUpdateCustomTargetingKeysRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent resource where `CustomTargetingKeys` will be updated.
     * Format: `networks/{network_code}`
     * The parent field in the UpdateCustomTargetingKeyRequest must match this
     * field.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The `CustomTargetingKey` objects to update.
     * A maximum of 100 objects can be updated in a batch.
     *
     * Generated from protobuf field <code>repeated .google.ads.admanager.v1.UpdateCustomTargetingKeyRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $requests;

    /**
     * @param string                                                     $parent   Required. The parent resource where `CustomTargetingKeys` will be updated.
     *                                                                             Format: `networks/{network_code}`
     *                                                                             The parent field in the UpdateCustomTargetingKeyRequest must match this
     *                                                                             field. Please see
     *                                                                             {@see CustomTargetingKeyServiceClient::networkName()} for help formatting this field.
     * @param \Google\Ads\AdManager\V1\UpdateCustomTargetingKeyRequest[] $requests Required. The `CustomTargetingKey` objects to update.
     *                                                                             A maximum of 100 objects can be updated in a batch.
     *
     * @return \Google\Ads\AdManager\V1\BatchUpdateCustomTargetingKeysRequest
     *
     * @experimental
     */
    public static function build(string $parent, array $requests): self
    {
        return (new self())
            ->setParent($parent)
            ->setRequests($requests);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The parent resource where `CustomTargetingKeys` will be updated.
     *           Format: `networks/{network_code}`
     *           The parent field in the UpdateCustomTargetingKeyRequest must match this
     *           field.
     *     @type \Google\Ads\AdManager\V1\UpdateCustomTargetingKeyRequest[] $requests
     *           Required. The `CustomTargetingKey` objects to update.
     *           A maximum of 100 objects can be updated in a batch.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingKeyService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent resource where `CustomTargetingKeys` will be updated.
     * Format: `networks/{network_code}`
     * The parent field in the UpdateCustomTargetingKeyRequest must match this
     * field.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The parent resource where `CustomTargetingKeys` will be updated.
     * Format: `networks/{network_code}`
     * The parent field in the UpdateCustomTargetingKeyRequest must match this
     * field.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The `CustomTargetingKey` objects to update.
     * A maximum of 100 objects can be updated in a batch.
     *
     * Generated from protobuf field <code>repeated .google.ads.admanager.v1.UpdateCustomTargetingKeyRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return RepeatedField<\Google\Ads\AdManager\V1\UpdateCustomTargetingKeyRequest>
     */
    public function getRequests()
    {
        return $this->requests;
    }

    /**
     * Required. The `CustomTargetingKey` objects to update.
     * A maximum of 100 objects can be updated in a batch.
     *
     * Generated from protobuf field <code>repeated .google.ads.admanager.v1.UpdateCustomTargetingKeyRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Ads\AdManager\V1\UpdateCustomTargetingKeyRequest[] $var
     * @return $this
     */
    public function setRequests($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\UpdateCustomTargetingKeyRequest::class);
        $this->requests = $arr;

        return $this;
    }

}

