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

namespace Google\Cloud\ResourceManager\V3;

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

/**
 * The request message for updating a TagKey.
 *
 * Generated from protobuf message <code>google.cloud.resourcemanager.v3.UpdateTagKeyRequest</code>
 */
class UpdateTagKeyRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The new definition of the TagKey. Only the `description` and
     * `etag` fields can be updated by this request. If the `etag` field is not
     * empty, it must match the `etag` field of the existing tag key. Otherwise,
     * `ABORTED` will be returned.
     *
     * Generated from protobuf field <code>.google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $tag_key = null;
    /**
     * Fields to be updated. The mask may only contain `description` or
     * `etag`. If omitted entirely, both `description` and `etag` are assumed to
     * be significant.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code>
     */
    protected $update_mask = null;
    /**
     * Set as true to perform validations necessary for updating the resource, but
     * not actually perform the action.
     *
     * Generated from protobuf field <code>bool validate_only = 3;</code>
     */
    protected $validate_only = false;

    /**
     * @param \Google\Cloud\ResourceManager\V3\TagKey $tagKey     Required. The new definition of the TagKey. Only the `description` and
     *                                                            `etag` fields can be updated by this request. If the `etag` field is not
     *                                                            empty, it must match the `etag` field of the existing tag key. Otherwise,
     *                                                            `ABORTED` will be returned.
     * @param \Google\Protobuf\FieldMask              $updateMask Fields to be updated. The mask may only contain `description` or
     *                                                            `etag`. If omitted entirely, both `description` and `etag` are assumed to
     *                                                            be significant.
     *
     * @return \Google\Cloud\ResourceManager\V3\UpdateTagKeyRequest
     *
     * @experimental
     */
    public static function build(\Google\Cloud\ResourceManager\V3\TagKey $tagKey, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setTagKey($tagKey)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\ResourceManager\V3\TagKey $tag_key
     *           Required. The new definition of the TagKey. Only the `description` and
     *           `etag` fields can be updated by this request. If the `etag` field is not
     *           empty, it must match the `etag` field of the existing tag key. Otherwise,
     *           `ABORTED` will be returned.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Fields to be updated. The mask may only contain `description` or
     *           `etag`. If omitted entirely, both `description` and `etag` are assumed to
     *           be significant.
     *     @type bool $validate_only
     *           Set as true to perform validations necessary for updating the resource, but
     *           not actually perform the action.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Resourcemanager\V3\TagKeys::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The new definition of the TagKey. Only the `description` and
     * `etag` fields can be updated by this request. If the `etag` field is not
     * empty, it must match the `etag` field of the existing tag key. Otherwise,
     * `ABORTED` will be returned.
     *
     * Generated from protobuf field <code>.google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\ResourceManager\V3\TagKey|null
     */
    public function getTagKey()
    {
        return $this->tag_key;
    }

    public function hasTagKey()
    {
        return isset($this->tag_key);
    }

    public function clearTagKey()
    {
        unset($this->tag_key);
    }

    /**
     * Required. The new definition of the TagKey. Only the `description` and
     * `etag` fields can be updated by this request. If the `etag` field is not
     * empty, it must match the `etag` field of the existing tag key. Otherwise,
     * `ABORTED` will be returned.
     *
     * Generated from protobuf field <code>.google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\ResourceManager\V3\TagKey $var
     * @return $this
     */
    public function setTagKey($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ResourceManager\V3\TagKey::class);
        $this->tag_key = $var;

        return $this;
    }

    /**
     * Fields to be updated. The mask may only contain `description` or
     * `etag`. If omitted entirely, both `description` and `etag` are assumed to
     * be significant.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code>
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * Fields to be updated. The mask may only contain `description` or
     * `etag`. If omitted entirely, both `description` and `etag` are assumed to
     * be significant.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code>
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

    /**
     * Set as true to perform validations necessary for updating the resource, but
     * not actually perform the action.
     *
     * Generated from protobuf field <code>bool validate_only = 3;</code>
     * @return bool
     */
    public function getValidateOnly()
    {
        return $this->validate_only;
    }

    /**
     * Set as true to perform validations necessary for updating the resource, but
     * not actually perform the action.
     *
     * Generated from protobuf field <code>bool validate_only = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setValidateOnly($var)
    {
        GPBUtil::checkBool($var);
        $this->validate_only = $var;

        return $this;
    }

}

