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

namespace Google\Cloud\DatabaseCenter\V1beta;

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

/**
 * Tag is a key value pair attached to a resource.
 *
 * Generated from protobuf message <code>google.cloud.databasecenter.v1beta.Tag</code>
 */
class Tag extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string key = 1;</code>
     */
    protected $key = '';
    /**
     * The value part of the tag.
     *
     * Generated from protobuf field <code>string value = 2;</code>
     */
    protected $value = '';
    /**
     * The source of the tag. According to
     * https://cloud.google.com/resource-manager/docs/tags/tags-overview#tags_and_labels,
     * tags can be created only at the project or organization level. Tags can be
     * inherited from different project as well not just the current project where
     * the database resource is present.
     * Format:
     * "projects/{PROJECT_ID}",
     * "projects/{PROJECT_NUMBER}",
     * "organizations/{ORGANIZATION_ID}"
     *
     * Generated from protobuf field <code>string source = 3;</code>
     */
    protected $source = '';
    /**
     * Indicates the inheritance status of a tag value
     * attached to the given resource. If the tag value is inherited from one of
     * the resource's ancestors, inherited will be true. If false, then the tag
     * value is directly attached to the resource.
     *
     * Generated from protobuf field <code>bool inherited = 4;</code>
     */
    protected $inherited = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $key
     *     @type string $value
     *           The value part of the tag.
     *     @type string $source
     *           The source of the tag. According to
     *           https://cloud.google.com/resource-manager/docs/tags/tags-overview#tags_and_labels,
     *           tags can be created only at the project or organization level. Tags can be
     *           inherited from different project as well not just the current project where
     *           the database resource is present.
     *           Format:
     *           "projects/{PROJECT_ID}",
     *           "projects/{PROJECT_NUMBER}",
     *           "organizations/{ORGANIZATION_ID}"
     *     @type bool $inherited
     *           Indicates the inheritance status of a tag value
     *           attached to the given resource. If the tag value is inherited from one of
     *           the resource's ancestors, inherited will be true. If false, then the tag
     *           value is directly attached to the resource.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Databasecenter\V1Beta\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>string key = 1;</code>
     * @return string
     */
    public function getKey()
    {
        return $this->key;
    }

    /**
     * Generated from protobuf field <code>string key = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->key = $var;

        return $this;
    }

    /**
     * The value part of the tag.
     *
     * Generated from protobuf field <code>string value = 2;</code>
     * @return string
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * The value part of the tag.
     *
     * Generated from protobuf field <code>string value = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->value = $var;

        return $this;
    }

    /**
     * The source of the tag. According to
     * https://cloud.google.com/resource-manager/docs/tags/tags-overview#tags_and_labels,
     * tags can be created only at the project or organization level. Tags can be
     * inherited from different project as well not just the current project where
     * the database resource is present.
     * Format:
     * "projects/{PROJECT_ID}",
     * "projects/{PROJECT_NUMBER}",
     * "organizations/{ORGANIZATION_ID}"
     *
     * Generated from protobuf field <code>string source = 3;</code>
     * @return string
     */
    public function getSource()
    {
        return $this->source;
    }

    /**
     * The source of the tag. According to
     * https://cloud.google.com/resource-manager/docs/tags/tags-overview#tags_and_labels,
     * tags can be created only at the project or organization level. Tags can be
     * inherited from different project as well not just the current project where
     * the database resource is present.
     * Format:
     * "projects/{PROJECT_ID}",
     * "projects/{PROJECT_NUMBER}",
     * "organizations/{ORGANIZATION_ID}"
     *
     * Generated from protobuf field <code>string source = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setSource($var)
    {
        GPBUtil::checkString($var, True);
        $this->source = $var;

        return $this;
    }

    /**
     * Indicates the inheritance status of a tag value
     * attached to the given resource. If the tag value is inherited from one of
     * the resource's ancestors, inherited will be true. If false, then the tag
     * value is directly attached to the resource.
     *
     * Generated from protobuf field <code>bool inherited = 4;</code>
     * @return bool
     */
    public function getInherited()
    {
        return $this->inherited;
    }

    /**
     * Indicates the inheritance status of a tag value
     * attached to the given resource. If the tag value is inherited from one of
     * the resource's ancestors, inherited will be true. If false, then the tag
     * value is directly attached to the resource.
     *
     * Generated from protobuf field <code>bool inherited = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setInherited($var)
    {
        GPBUtil::checkBool($var);
        $this->inherited = $var;

        return $this;
    }

}

