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

namespace Google\Cloud\Build\V1;

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

/**
 * Pairs a secret environment variable with a SecretVersion in Secret Manager.
 *
 * Generated from protobuf message <code>google.devtools.cloudbuild.v1.SecretManagerSecret</code>
 */
class SecretManagerSecret extends \Google\Protobuf\Internal\Message
{
    /**
     * Resource name of the SecretVersion. In format:
     * projects/&#42;&#47;secrets/&#42;&#47;versions/&#42;
     *
     * Generated from protobuf field <code>string version_name = 1 [(.google.api.resource_reference) = {</code>
     */
    private $version_name = '';
    /**
     * Environment variable name to associate with the secret.
     * Secret environment variables must be unique across all of a build's
     * secrets, and must be used by at least one build step.
     *
     * Generated from protobuf field <code>string env = 2;</code>
     */
    private $env = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $version_name
     *           Resource name of the SecretVersion. In format:
     *           projects/&#42;&#47;secrets/&#42;&#47;versions/&#42;
     *     @type string $env
     *           Environment variable name to associate with the secret.
     *           Secret environment variables must be unique across all of a build's
     *           secrets, and must be used by at least one build step.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce();
        parent::__construct($data);
    }

    /**
     * Resource name of the SecretVersion. In format:
     * projects/&#42;&#47;secrets/&#42;&#47;versions/&#42;
     *
     * Generated from protobuf field <code>string version_name = 1 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getVersionName()
    {
        return $this->version_name;
    }

    /**
     * Resource name of the SecretVersion. In format:
     * projects/&#42;&#47;secrets/&#42;&#47;versions/&#42;
     *
     * Generated from protobuf field <code>string version_name = 1 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setVersionName($var)
    {
        GPBUtil::checkString($var, True);
        $this->version_name = $var;

        return $this;
    }

    /**
     * Environment variable name to associate with the secret.
     * Secret environment variables must be unique across all of a build's
     * secrets, and must be used by at least one build step.
     *
     * Generated from protobuf field <code>string env = 2;</code>
     * @return string
     */
    public function getEnv()
    {
        return $this->env;
    }

    /**
     * Environment variable name to associate with the secret.
     * Secret environment variables must be unique across all of a build's
     * secrets, and must be used by at least one build step.
     *
     * Generated from protobuf field <code>string env = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setEnv($var)
    {
        GPBUtil::checkString($var, True);
        $this->env = $var;

        return $this;
    }

}

