<?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,
     * `FAILED_PRECONDITION` will be returned.
     *
     * Generated from protobuf field <code>.google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $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>
     */
    private $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>
     */
    private $validate_only = false;

    /**
     * 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,
     *           `FAILED_PRECONDITION` 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,
     * `FAILED_PRECONDITION` 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 isset($this->tag_key) ? $this->tag_key : null;
    }

    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,
     * `FAILED_PRECONDITION` 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 isset($this->update_mask) ? $this->update_mask : null;
    }

    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;
    }

}

