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

namespace Google\Cloud\SecurityCenter\V2;

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

/**
 * Request message to create multiple resource value configs
 *
 * Generated from protobuf message <code>google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest</code>
 */
class BatchCreateResourceValueConfigsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Resource name of the new ResourceValueConfig's parent.
     * The parent field in the CreateResourceValueConfigRequest
     * messages must either be empty or 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 resource value configs to be created.
     *
     * Generated from protobuf field <code>repeated .google.cloud.securitycenter.v2.CreateResourceValueConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $requests;

    /**
     * @param string                                                             $parent   Required. Resource name of the new ResourceValueConfig's parent.
     *                                                                                     The parent field in the CreateResourceValueConfigRequest
     *                                                                                     messages must either be empty or match this field. Please see
     *                                                                                     {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
     * @param \Google\Cloud\SecurityCenter\V2\CreateResourceValueConfigRequest[] $requests Required. The resource value configs to be created.
     *
     * @return \Google\Cloud\SecurityCenter\V2\BatchCreateResourceValueConfigsRequest
     *
     * @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. Resource name of the new ResourceValueConfig's parent.
     *           The parent field in the CreateResourceValueConfigRequest
     *           messages must either be empty or match this field.
     *     @type array<\Google\Cloud\SecurityCenter\V2\CreateResourceValueConfigRequest>|\Google\Protobuf\Internal\RepeatedField $requests
     *           Required. The resource value configs to be created.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Securitycenter\V2\SecuritycenterService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Resource name of the new ResourceValueConfig's parent.
     * The parent field in the CreateResourceValueConfigRequest
     * messages must either be empty or 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. Resource name of the new ResourceValueConfig's parent.
     * The parent field in the CreateResourceValueConfigRequest
     * messages must either be empty or 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 resource value configs to be created.
     *
     * Generated from protobuf field <code>repeated .google.cloud.securitycenter.v2.CreateResourceValueConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRequests()
    {
        return $this->requests;
    }

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

        return $this;
    }

}

