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

namespace Google\Cloud\MigrationCenter\V1;

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

/**
 * A request to update a list of assets.
 *
 * Generated from protobuf message <code>google.cloud.migrationcenter.v1.BatchUpdateAssetsRequest</code>
 */
class BatchUpdateAssetsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Parent value for batch asset update.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The request message specifying the resources to update.
     * A maximum of 1000 assets can be modified in a batch.
     *
     * Generated from protobuf field <code>repeated .google.cloud.migrationcenter.v1.UpdateAssetRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $requests;

    /**
     * @param string                                                $parent   Required. Parent value for batch asset update. Please see
     *                                                                        {@see MigrationCenterClient::locationName()} for help formatting this field.
     * @param \Google\Cloud\MigrationCenter\V1\UpdateAssetRequest[] $requests Required. The request message specifying the resources to update.
     *                                                                        A maximum of 1000 assets can be modified in a batch.
     *
     * @return \Google\Cloud\MigrationCenter\V1\BatchUpdateAssetsRequest
     *
     * @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. Parent value for batch asset update.
     *     @type array<\Google\Cloud\MigrationCenter\V1\UpdateAssetRequest>|\Google\Protobuf\Internal\RepeatedField $requests
     *           Required. The request message specifying the resources to update.
     *           A maximum of 1000 assets can be modified in a batch.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Migrationcenter\V1\Migrationcenter::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Parent value for batch asset update.
     *
     * 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. Parent value for batch asset update.
     *
     * 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 request message specifying the resources to update.
     * A maximum of 1000 assets can be modified in a batch.
     *
     * Generated from protobuf field <code>repeated .google.cloud.migrationcenter.v1.UpdateAssetRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRequests()
    {
        return $this->requests;
    }

    /**
     * Required. The request message specifying the resources to update.
     * A maximum of 1000 assets can be modified in a batch.
     *
     * Generated from protobuf field <code>repeated .google.cloud.migrationcenter.v1.UpdateAssetRequest requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<\Google\Cloud\MigrationCenter\V1\UpdateAssetRequest>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRequests($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\MigrationCenter\V1\UpdateAssetRequest::class);
        $this->requests = $arr;

        return $this;
    }

}

