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

namespace Google\Cloud\Functions\V2;

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

/**
 * Request for the `GetFunction` method.
 *
 * Generated from protobuf message <code>google.cloud.functions.v2.GetFunctionRequest</code>
 */
class GetFunctionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The name of the function which details should be obtained.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $name = '';
    /**
     * Optional. The optional version of the 1st gen function whose details should
     * be obtained. The version of a 1st gen function is an integer that starts
     * from 1 and gets incremented on redeployments. GCF may keep historical
     * configs for old versions of 1st gen function. This field can be specified
     * to fetch the historical configs. This field is valid only for GCF 1st gen
     * function.
     *
     * Generated from protobuf field <code>string revision = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $revision = '';

    /**
     * @param string $name Required. The name of the function which details should be obtained. Please see
     *                     {@see FunctionServiceClient::functionName()} for help formatting this field.
     *
     * @return \Google\Cloud\Functions\V2\GetFunctionRequest
     *
     * @experimental
     */
    public static function build(string $name): self
    {
        return (new self())
            ->setName($name);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. The name of the function which details should be obtained.
     *     @type string $revision
     *           Optional. The optional version of the 1st gen function whose details should
     *           be obtained. The version of a 1st gen function is an integer that starts
     *           from 1 and gets incremented on redeployments. GCF may keep historical
     *           configs for old versions of 1st gen function. This field can be specified
     *           to fetch the historical configs. This field is valid only for GCF 1st gen
     *           function.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Functions\V2\Functions::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The name of the function which details should be obtained.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. The name of the function which details should be obtained.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. The optional version of the 1st gen function whose details should
     * be obtained. The version of a 1st gen function is an integer that starts
     * from 1 and gets incremented on redeployments. GCF may keep historical
     * configs for old versions of 1st gen function. This field can be specified
     * to fetch the historical configs. This field is valid only for GCF 1st gen
     * function.
     *
     * Generated from protobuf field <code>string revision = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getRevision()
    {
        return $this->revision;
    }

    /**
     * Optional. The optional version of the 1st gen function whose details should
     * be obtained. The version of a 1st gen function is an integer that starts
     * from 1 and gets incremented on redeployments. GCF may keep historical
     * configs for old versions of 1st gen function. This field can be specified
     * to fetch the historical configs. This field is valid only for GCF 1st gen
     * function.
     *
     * Generated from protobuf field <code>string revision = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setRevision($var)
    {
        GPBUtil::checkString($var, True);
        $this->revision = $var;

        return $this;
    }

}

