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

namespace Google\Cloud\DataCatalog\V1;

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

/**
 * Request message for
 * [UpdateTag][google.cloud.datacatalog.v1.DataCatalog.UpdateTag].
 *
 * Generated from protobuf message <code>google.cloud.datacatalog.v1.UpdateTagRequest</code>
 */
class UpdateTagRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The updated tag. The "name" field must be set.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.Tag tag = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $tag = null;
    /**
     * Names of fields whose values to overwrite on a tag. Currently, a tag has
     * the only modifiable field with the name `fields`.
     * In general, if this parameter is absent or empty, all modifiable fields
     * are overwritten. If such fields are non-required and omitted in the
     * request body, their values are emptied.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code>
     */
    protected $update_mask = null;

    /**
     * @param \Google\Cloud\DataCatalog\V1\Tag $tag Required. The updated tag. The "name" field must be set.
     *
     * @return \Google\Cloud\DataCatalog\V1\UpdateTagRequest
     *
     * @experimental
     */
    public static function build(\Google\Cloud\DataCatalog\V1\Tag $tag): self
    {
        return (new self())
            ->setTag($tag);
    }

    /**
     * @param \Google\Cloud\DataCatalog\V1\Tag $tag        Required. The updated tag. The "name" field must be set.
     * @param \Google\Protobuf\FieldMask       $updateMask Names of fields whose values to overwrite on a tag. Currently, a tag has
     *                                                     the only modifiable field with the name `fields`.
     *
     *                                                     In general, if this parameter is absent or empty, all modifiable fields
     *                                                     are overwritten. If such fields are non-required and omitted in the
     *                                                     request body, their values are emptied.
     *
     * @return \Google\Cloud\DataCatalog\V1\UpdateTagRequest
     *
     * @experimental
     */
    public static function buildFromTagUpdateMask(\Google\Cloud\DataCatalog\V1\Tag $tag, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setTag($tag)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DataCatalog\V1\Tag $tag
     *           Required. The updated tag. The "name" field must be set.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Names of fields whose values to overwrite on a tag. Currently, a tag has
     *           the only modifiable field with the name `fields`.
     *           In general, if this parameter is absent or empty, all modifiable fields
     *           are overwritten. If such fields are non-required and omitted in the
     *           request body, their values are emptied.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The updated tag. The "name" field must be set.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.Tag tag = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\DataCatalog\V1\Tag|null
     */
    public function getTag()
    {
        return $this->tag;
    }

    public function hasTag()
    {
        return isset($this->tag);
    }

    public function clearTag()
    {
        unset($this->tag);
    }

    /**
     * Required. The updated tag. The "name" field must be set.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.Tag tag = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\DataCatalog\V1\Tag $var
     * @return $this
     */
    public function setTag($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\Tag::class);
        $this->tag = $var;

        return $this;
    }

    /**
     * Names of fields whose values to overwrite on a tag. Currently, a tag has
     * the only modifiable field with the name `fields`.
     * In general, if this parameter is absent or empty, all modifiable fields
     * are overwritten. If such fields are non-required and omitted in the
     * request body, their values are emptied.
     *
     * 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);
    }

    /**
     * Names of fields whose values to overwrite on a tag. Currently, a tag has
     * the only modifiable field with the name `fields`.
     * In general, if this parameter is absent or empty, all modifiable fields
     * are overwritten. If such fields are non-required and omitted in the
     * request body, their values are emptied.
     *
     * 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;
    }

}

