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

namespace Google\Cloud\Dlp\V2;

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

/**
 * A single tag to filter against.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.TagFilter</code>
 */
class TagFilter extends \Google\Protobuf\Internal\Message
{
    protected $format;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $namespaced_tag_value
     *           The namespaced name for the tag value. Must be in the format
     *           `{parent_id}/{tag_key_short_name}/{short_name}`, for example,
     *           "123456/environment/prod" for an organization parent, or
     *           "my-project/environment/prod" for a project parent.
     *     @type string $namespaced_tag_key
     *           The namespaced name for the tag key. Must be in the format
     *           `{parent_id}/{tag_key_short_name}`, for example, "123456/sensitive" for
     *           an organization parent, or "my-project/sensitive" for a project parent.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * The namespaced name for the tag value. Must be in the format
     * `{parent_id}/{tag_key_short_name}/{short_name}`, for example,
     * "123456/environment/prod" for an organization parent, or
     * "my-project/environment/prod" for a project parent.
     *
     * Generated from protobuf field <code>string namespaced_tag_value = 1;</code>
     * @return string
     */
    public function getNamespacedTagValue()
    {
        return $this->readOneof(1);
    }

    public function hasNamespacedTagValue()
    {
        return $this->hasOneof(1);
    }

    /**
     * The namespaced name for the tag value. Must be in the format
     * `{parent_id}/{tag_key_short_name}/{short_name}`, for example,
     * "123456/environment/prod" for an organization parent, or
     * "my-project/environment/prod" for a project parent.
     *
     * Generated from protobuf field <code>string namespaced_tag_value = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setNamespacedTagValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The namespaced name for the tag key. Must be in the format
     * `{parent_id}/{tag_key_short_name}`, for example, "123456/sensitive" for
     * an organization parent, or "my-project/sensitive" for a project parent.
     *
     * Generated from protobuf field <code>string namespaced_tag_key = 2;</code>
     * @return string
     */
    public function getNamespacedTagKey()
    {
        return $this->readOneof(2);
    }

    public function hasNamespacedTagKey()
    {
        return $this->hasOneof(2);
    }

    /**
     * The namespaced name for the tag key. Must be in the format
     * `{parent_id}/{tag_key_short_name}`, for example, "123456/sensitive" for
     * an organization parent, or "my-project/sensitive" for a project parent.
     *
     * Generated from protobuf field <code>string namespaced_tag_key = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setNamespacedTagKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getFormat()
    {
        return $this->whichOneof("format");
    }

}

