<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/run/v2/k8s.min.proto

namespace Google\Cloud\Run\V2;

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

/**
 * SecretEnvVarSource represents a source for the value of an EnvVar.
 *
 * Generated from protobuf message <code>google.cloud.run.v2.SecretKeySelector</code>
 */
class SecretKeySelector extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The name of the secret in Cloud Secret Manager.
     * Format: {secret_name} if the secret is in the same project.
     * projects/{project}/secrets/{secret_name} if the secret is
     * in a different project.
     *
     * Generated from protobuf field <code>string secret = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $secret = '';
    /**
     * The Cloud Secret Manager secret version.
     * Can be 'latest' for the latest version, an integer for a specific version,
     * or a version alias.
     *
     * Generated from protobuf field <code>string version = 2 [(.google.api.resource_reference) = {</code>
     */
    private $version = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $secret
     *           Required. The name of the secret in Cloud Secret Manager.
     *           Format: {secret_name} if the secret is in the same project.
     *           projects/{project}/secrets/{secret_name} if the secret is
     *           in a different project.
     *     @type string $version
     *           The Cloud Secret Manager secret version.
     *           Can be 'latest' for the latest version, an integer for a specific version,
     *           or a version alias.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The name of the secret in Cloud Secret Manager.
     * Format: {secret_name} if the secret is in the same project.
     * projects/{project}/secrets/{secret_name} if the secret is
     * in a different project.
     *
     * Generated from protobuf field <code>string secret = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getSecret()
    {
        return $this->secret;
    }

    /**
     * Required. The name of the secret in Cloud Secret Manager.
     * Format: {secret_name} if the secret is in the same project.
     * projects/{project}/secrets/{secret_name} if the secret is
     * in a different project.
     *
     * Generated from protobuf field <code>string secret = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setSecret($var)
    {
        GPBUtil::checkString($var, True);
        $this->secret = $var;

        return $this;
    }

    /**
     * The Cloud Secret Manager secret version.
     * Can be 'latest' for the latest version, an integer for a specific version,
     * or a version alias.
     *
     * Generated from protobuf field <code>string version = 2 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getVersion()
    {
        return $this->version;
    }

    /**
     * The Cloud Secret Manager secret version.
     * Can be 'latest' for the latest version, an integer for a specific version,
     * or a version alias.
     *
     * Generated from protobuf field <code>string version = 2 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->version = $var;

        return $this;
    }

}

