<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: temporal/api/workflowservice/v1/request_response.proto

namespace Temporal\Api\Workflowservice\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.workflowservice.v1.SetWorkerDeploymentRampingVersionResponse</code>
 */
class SetWorkerDeploymentRampingVersionResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * This value is returned so that it can be optionally passed to APIs
     * that write to the Worker Deployment state to ensure that the state
     * did not change between this API call and a future write.
     *
     * Generated from protobuf field <code>bytes conflict_token = 1;</code>
     */
    protected $conflict_token = '';
    /**
     * Deprecated. Use `previous_deployment_version`.
     *
     * Generated from protobuf field <code>string previous_version = 2 [deprecated = true];</code>
     * @deprecated
     */
    protected $previous_version = '';
    /**
     * The version that was ramping before executing this operation.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion previous_deployment_version = 4;</code>
     */
    protected $previous_deployment_version = null;
    /**
     * The ramping version percentage before executing this operation.
     *
     * Generated from protobuf field <code>float previous_percentage = 3;</code>
     */
    protected $previous_percentage = 0.0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $conflict_token
     *           This value is returned so that it can be optionally passed to APIs
     *           that write to the Worker Deployment state to ensure that the state
     *           did not change between this API call and a future write.
     *     @type string $previous_version
     *           Deprecated. Use `previous_deployment_version`.
     *     @type \Temporal\Api\Deployment\V1\WorkerDeploymentVersion $previous_deployment_version
     *           The version that was ramping before executing this operation.
     *     @type float $previous_percentage
     *           The ramping version percentage before executing this operation.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflowservice\V1\RequestResponse::initOnce();
        parent::__construct($data);
    }

    /**
     * This value is returned so that it can be optionally passed to APIs
     * that write to the Worker Deployment state to ensure that the state
     * did not change between this API call and a future write.
     *
     * Generated from protobuf field <code>bytes conflict_token = 1;</code>
     * @return string
     */
    public function getConflictToken()
    {
        return $this->conflict_token;
    }

    /**
     * This value is returned so that it can be optionally passed to APIs
     * that write to the Worker Deployment state to ensure that the state
     * did not change between this API call and a future write.
     *
     * Generated from protobuf field <code>bytes conflict_token = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setConflictToken($var)
    {
        GPBUtil::checkString($var, False);
        $this->conflict_token = $var;

        return $this;
    }

    /**
     * Deprecated. Use `previous_deployment_version`.
     *
     * Generated from protobuf field <code>string previous_version = 2 [deprecated = true];</code>
     * @return string
     * @deprecated
     */
    public function getPreviousVersion()
    {
        if ($this->previous_version !== '') {
            @trigger_error('previous_version is deprecated.', E_USER_DEPRECATED);
        }
        return $this->previous_version;
    }

    /**
     * Deprecated. Use `previous_deployment_version`.
     *
     * Generated from protobuf field <code>string previous_version = 2 [deprecated = true];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setPreviousVersion($var)
    {
        @trigger_error('previous_version is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, True);
        $this->previous_version = $var;

        return $this;
    }

    /**
     * The version that was ramping before executing this operation.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion previous_deployment_version = 4;</code>
     * @return \Temporal\Api\Deployment\V1\WorkerDeploymentVersion|null
     */
    public function getPreviousDeploymentVersion()
    {
        return $this->previous_deployment_version;
    }

    public function hasPreviousDeploymentVersion()
    {
        return isset($this->previous_deployment_version);
    }

    public function clearPreviousDeploymentVersion()
    {
        unset($this->previous_deployment_version);
    }

    /**
     * The version that was ramping before executing this operation.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion previous_deployment_version = 4;</code>
     * @param \Temporal\Api\Deployment\V1\WorkerDeploymentVersion $var
     * @return $this
     */
    public function setPreviousDeploymentVersion($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Deployment\V1\WorkerDeploymentVersion::class);
        $this->previous_deployment_version = $var;

        return $this;
    }

    /**
     * The ramping version percentage before executing this operation.
     *
     * Generated from protobuf field <code>float previous_percentage = 3;</code>
     * @return float
     */
    public function getPreviousPercentage()
    {
        return $this->previous_percentage;
    }

    /**
     * The ramping version percentage before executing this operation.
     *
     * Generated from protobuf field <code>float previous_percentage = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setPreviousPercentage($var)
    {
        GPBUtil::checkFloat($var);
        $this->previous_percentage = $var;

        return $this;
    }

}

