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

namespace Google\Cloud\Retail\V2;

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

/**
 * Request for BatchUpdateGenerativeQuestionConfig method.
 *
 * Generated from protobuf message <code>google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsRequest</code>
 */
class BatchUpdateGenerativeQuestionConfigsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Resource name of the parent catalog.
     * Format: projects/{project}/locations/{location}/catalogs/{catalog}
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The updates question configs.
     *
     * Generated from protobuf field <code>repeated .google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $requests;

    /**
     * @param string                                                          $parent   Optional. Resource name of the parent catalog.
     *                                                                                  Format: projects/{project}/locations/{location}/catalogs/{catalog}
     * @param \Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest[] $requests Required. The updates question configs.
     *
     * @return \Google\Cloud\Retail\V2\BatchUpdateGenerativeQuestionConfigsRequest
     *
     * @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
     *           Optional. Resource name of the parent catalog.
     *           Format: projects/{project}/locations/{location}/catalogs/{catalog}
     *     @type array<\Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest>|\Google\Protobuf\Internal\RepeatedField $requests
     *           Required. The updates question configs.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Resource name of the parent catalog.
     * Format: projects/{project}/locations/{location}/catalogs/{catalog}
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Optional. Resource name of the parent catalog.
     * Format: projects/{project}/locations/{location}/catalogs/{catalog}
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = OPTIONAL, (.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 updates question configs.
     *
     * Generated from protobuf field <code>repeated .google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRequests()
    {
        return $this->requests;
    }

    /**
     * Required. The updates question configs.
     *
     * Generated from protobuf field <code>repeated .google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<\Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRequests($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest::class);
        $this->requests = $arr;

        return $this;
    }

}

