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

namespace Google\Cloud\ParameterManager\V1;

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

/**
 * Message describing Parameter resource
 *
 * Generated from protobuf message <code>google.cloud.parametermanager.v1.Parameter</code>
 */
class Parameter extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. [Output only] The resource name of the Parameter in the format
     * `projects/&#42;&#47;locations/&#42;&#47;parameters/&#42;`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Output only. [Output only] Create time stamp
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. [Output only] Update time stamp
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Optional. Labels as key value pairs
     *
     * Generated from protobuf field <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $labels;
    /**
     * Optional. Specifies the format of a Parameter.
     *
     * Generated from protobuf field <code>.google.cloud.parametermanager.v1.ParameterFormat format = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $format = 0;
    /**
     * Output only. [Output-only] policy member strings of a Google Cloud
     * resource.
     *
     * Generated from protobuf field <code>.google.iam.v1.ResourcePolicyMember policy_member = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $policy_member = null;
    /**
     * Optional. Customer managed encryption key (CMEK) to use for encrypting the
     * Parameter Versions. If not set, the default Google-managed encryption key
     * will be used. Cloud KMS CryptoKeys must reside in the same location as the
     * Parameter. The expected format is
     * `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
     *
     * Generated from protobuf field <code>optional string kms_key = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $kms_key = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. [Output only] The resource name of the Parameter in the format
     *           `projects/&#42;&#47;locations/&#42;&#47;parameters/&#42;`.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. [Output only] Create time stamp
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. [Output only] Update time stamp
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Optional. Labels as key value pairs
     *     @type int $format
     *           Optional. Specifies the format of a Parameter.
     *     @type \Google\Cloud\Iam\V1\ResourcePolicyMember $policy_member
     *           Output only. [Output-only] policy member strings of a Google Cloud
     *           resource.
     *     @type string $kms_key
     *           Optional. Customer managed encryption key (CMEK) to use for encrypting the
     *           Parameter Versions. If not set, the default Google-managed encryption key
     *           will be used. Cloud KMS CryptoKeys must reside in the same location as the
     *           Parameter. The expected format is
     *           `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Parametermanager\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. [Output only] The resource name of the Parameter in the format
     * `projects/&#42;&#47;locations/&#42;&#47;parameters/&#42;`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. [Output only] The resource name of the Parameter in the format
     * `projects/&#42;&#47;locations/&#42;&#47;parameters/&#42;`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. [Output only] Create time stamp
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. [Output only] Create time stamp
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. [Output only] Update time stamp
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. [Output only] Update time stamp
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Optional. Labels as key value pairs
     *
     * Generated from protobuf field <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Optional. Labels as key value pairs
     *
     * Generated from protobuf field <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setLabels($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->labels = $arr;

        return $this;
    }

    /**
     * Optional. Specifies the format of a Parameter.
     *
     * Generated from protobuf field <code>.google.cloud.parametermanager.v1.ParameterFormat format = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getFormat()
    {
        return $this->format;
    }

    /**
     * Optional. Specifies the format of a Parameter.
     *
     * Generated from protobuf field <code>.google.cloud.parametermanager.v1.ParameterFormat format = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setFormat($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\ParameterManager\V1\ParameterFormat::class);
        $this->format = $var;

        return $this;
    }

    /**
     * Output only. [Output-only] policy member strings of a Google Cloud
     * resource.
     *
     * Generated from protobuf field <code>.google.iam.v1.ResourcePolicyMember policy_member = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\Iam\V1\ResourcePolicyMember|null
     */
    public function getPolicyMember()
    {
        return $this->policy_member;
    }

    public function hasPolicyMember()
    {
        return isset($this->policy_member);
    }

    public function clearPolicyMember()
    {
        unset($this->policy_member);
    }

    /**
     * Output only. [Output-only] policy member strings of a Google Cloud
     * resource.
     *
     * Generated from protobuf field <code>.google.iam.v1.ResourcePolicyMember policy_member = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Iam\V1\ResourcePolicyMember $var
     * @return $this
     */
    public function setPolicyMember($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Iam\V1\ResourcePolicyMember::class);
        $this->policy_member = $var;

        return $this;
    }

    /**
     * Optional. Customer managed encryption key (CMEK) to use for encrypting the
     * Parameter Versions. If not set, the default Google-managed encryption key
     * will be used. Cloud KMS CryptoKeys must reside in the same location as the
     * Parameter. The expected format is
     * `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
     *
     * Generated from protobuf field <code>optional string kms_key = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getKmsKey()
    {
        return isset($this->kms_key) ? $this->kms_key : '';
    }

    public function hasKmsKey()
    {
        return isset($this->kms_key);
    }

    public function clearKmsKey()
    {
        unset($this->kms_key);
    }

    /**
     * Optional. Customer managed encryption key (CMEK) to use for encrypting the
     * Parameter Versions. If not set, the default Google-managed encryption key
     * will be used. Cloud KMS CryptoKeys must reside in the same location as the
     * Parameter. The expected format is
     * `projects/&#42;&#47;locations/&#42;&#47;keyRings/&#42;&#47;cryptoKeys/&#42;`.
     *
     * Generated from protobuf field <code>optional string kms_key = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setKmsKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->kms_key = $var;

        return $this;
    }

}

