<?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;

/**
 * Each Stage of the deployment process
 *
 * Generated from protobuf message <code>google.cloud.functions.v2.Stage</code>
 */
class Stage extends \Google\Protobuf\Internal\Message
{
    /**
     * Name of the Stage. This will be unique for each Stage.
     *
     * Generated from protobuf field <code>.google.cloud.functions.v2.Stage.Name name = 1;</code>
     */
    private $name = 0;
    /**
     * Message describing the Stage
     *
     * Generated from protobuf field <code>string message = 2;</code>
     */
    private $message = '';
    /**
     * Current state of the Stage
     *
     * Generated from protobuf field <code>.google.cloud.functions.v2.Stage.State state = 3;</code>
     */
    private $state = 0;
    /**
     * Resource of the Stage
     *
     * Generated from protobuf field <code>string resource = 4;</code>
     */
    private $resource = '';
    /**
     * Link to the current Stage resource
     *
     * Generated from protobuf field <code>string resource_uri = 5;</code>
     */
    private $resource_uri = '';
    /**
     * State messages from the current Stage.
     *
     * Generated from protobuf field <code>repeated .google.cloud.functions.v2.StateMessage state_messages = 6;</code>
     */
    private $state_messages;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $name
     *           Name of the Stage. This will be unique for each Stage.
     *     @type string $message
     *           Message describing the Stage
     *     @type int $state
     *           Current state of the Stage
     *     @type string $resource
     *           Resource of the Stage
     *     @type string $resource_uri
     *           Link to the current Stage resource
     *     @type array<\Google\Cloud\Functions\V2\StateMessage>|\Google\Protobuf\Internal\RepeatedField $state_messages
     *           State messages from the current Stage.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Functions\V2\Functions::initOnce();
        parent::__construct($data);
    }

    /**
     * Name of the Stage. This will be unique for each Stage.
     *
     * Generated from protobuf field <code>.google.cloud.functions.v2.Stage.Name name = 1;</code>
     * @return int
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Name of the Stage. This will be unique for each Stage.
     *
     * Generated from protobuf field <code>.google.cloud.functions.v2.Stage.Name name = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Functions\V2\Stage\Name::class);
        $this->name = $var;

        return $this;
    }

    /**
     * Message describing the Stage
     *
     * Generated from protobuf field <code>string message = 2;</code>
     * @return string
     */
    public function getMessage()
    {
        return $this->message;
    }

    /**
     * Message describing the Stage
     *
     * Generated from protobuf field <code>string message = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->message = $var;

        return $this;
    }

    /**
     * Current state of the Stage
     *
     * Generated from protobuf field <code>.google.cloud.functions.v2.Stage.State state = 3;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Current state of the Stage
     *
     * Generated from protobuf field <code>.google.cloud.functions.v2.Stage.State state = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Functions\V2\Stage\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Resource of the Stage
     *
     * Generated from protobuf field <code>string resource = 4;</code>
     * @return string
     */
    public function getResource()
    {
        return $this->resource;
    }

    /**
     * Resource of the Stage
     *
     * Generated from protobuf field <code>string resource = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setResource($var)
    {
        GPBUtil::checkString($var, True);
        $this->resource = $var;

        return $this;
    }

    /**
     * Link to the current Stage resource
     *
     * Generated from protobuf field <code>string resource_uri = 5;</code>
     * @return string
     */
    public function getResourceUri()
    {
        return $this->resource_uri;
    }

    /**
     * Link to the current Stage resource
     *
     * Generated from protobuf field <code>string resource_uri = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setResourceUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->resource_uri = $var;

        return $this;
    }

    /**
     * State messages from the current Stage.
     *
     * Generated from protobuf field <code>repeated .google.cloud.functions.v2.StateMessage state_messages = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getStateMessages()
    {
        return $this->state_messages;
    }

    /**
     * State messages from the current Stage.
     *
     * Generated from protobuf field <code>repeated .google.cloud.functions.v2.StateMessage state_messages = 6;</code>
     * @param array<\Google\Cloud\Functions\V2\StateMessage>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setStateMessages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Functions\V2\StateMessage::class);
        $this->state_messages = $arr;

        return $this;
    }

}

