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

namespace Google\Ads\AdManager\V1;

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

/**
 * Request object for `BatchUpdateCustomFields` method.
 *
 * Generated from protobuf message <code>google.ads.admanager.v1.BatchUpdateCustomFieldsRequest</code>
 */
class BatchUpdateCustomFieldsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent resource where `CustomFields` will be updated.
     * Format: `networks/{network_code}`
     * The parent field in the UpdateCustomFieldRequest 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 `CustomField` objects to update.
     * A maximum of 100 objects can be updated in a batch.
     *
     * Generated from protobuf field <code>repeated .google.ads.admanager.v1.UpdateCustomFieldRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $requests;

    /**
     * @param string                                              $parent   Required. The parent resource where `CustomFields` will be updated.
     *                                                                      Format: `networks/{network_code}`
     *                                                                      The parent field in the UpdateCustomFieldRequest must match this
     *                                                                      field. Please see
     *                                                                      {@see CustomFieldServiceClient::networkName()} for help formatting this field.
     * @param \Google\Ads\AdManager\V1\UpdateCustomFieldRequest[] $requests Required. The `CustomField` objects to update.
     *                                                                      A maximum of 100 objects can be updated in a batch.
     *
     * @return \Google\Ads\AdManager\V1\BatchUpdateCustomFieldsRequest
     *
     * @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 `CustomFields` will be updated.
     *           Format: `networks/{network_code}`
     *           The parent field in the UpdateCustomFieldRequest must match this
     *           field.
     *     @type \Google\Ads\AdManager\V1\UpdateCustomFieldRequest[] $requests
     *           Required. The `CustomField` objects to update.
     *           A maximum of 100 objects can be updated in a batch.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\Admanager\V1\CustomFieldService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent resource where `CustomFields` will be updated.
     * Format: `networks/{network_code}`
     * The parent field in the UpdateCustomFieldRequest 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 `CustomFields` will be updated.
     * Format: `networks/{network_code}`
     * The parent field in the UpdateCustomFieldRequest 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 `CustomField` objects to update.
     * A maximum of 100 objects can be updated in a batch.
     *
     * Generated from protobuf field <code>repeated .google.ads.admanager.v1.UpdateCustomFieldRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return RepeatedField<\Google\Ads\AdManager\V1\UpdateCustomFieldRequest>
     */
    public function getRequests()
    {
        return $this->requests;
    }

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

        return $this;
    }

}

