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

namespace Temporal\Api\Deployment\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.deployment.v1.RoutingConfig</code>
 */
class RoutingConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Specifies which Deployment Version should receive new workflow executions and tasks of
     * existing unversioned or AutoUpgrade workflows.
     * Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set)  goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). 
     * Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage
     * is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`).
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion current_deployment_version = 7;</code>
     */
    protected $current_deployment_version = null;
    /**
     * Deprecated. Use `current_deployment_version`.
     *
     * Generated from protobuf field <code>string current_version = 1 [deprecated = true];</code>
     * @deprecated
     */
    protected $current_version = '';
    /**
     * When ramp percentage is non-zero, that portion of traffic is shifted from the Current Version to the Ramping Version.
     * Must always be different from `current_deployment_version` unless both are nil.
     * Nil value represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
     * Note that it is possible to ramp from one Version to another Version, or from unversioned
     * workers to a particular Version, or from a particular Version to unversioned workers.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion ramping_deployment_version = 9;</code>
     */
    protected $ramping_deployment_version = null;
    /**
     * Deprecated. Use `ramping_deployment_version`.
     *
     * Generated from protobuf field <code>string ramping_version = 2 [deprecated = true];</code>
     * @deprecated
     */
    protected $ramping_version = '';
    /**
     * Percentage of tasks that are routed to the Ramping Version instead of the Current Version.
     * Valid range: [0, 100]. A 100% value means the Ramping Version is receiving full traffic but
     * not yet "promoted" to be the Current Version, likely due to pending validations.
     * A 0% value means the Ramping Version is receiving no traffic.
     *
     * Generated from protobuf field <code>float ramping_version_percentage = 3;</code>
     */
    protected $ramping_version_percentage = 0.0;
    /**
     * Last time current version was changed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp current_version_changed_time = 4;</code>
     */
    protected $current_version_changed_time = null;
    /**
     * Last time ramping version was changed. Not updated if only the ramp percentage changes.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp ramping_version_changed_time = 5;</code>
     */
    protected $ramping_version_changed_time = null;
    /**
     * Last time ramping version percentage was changed.
     * If ramping version is changed, this is also updated, even if the percentage stays the same.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp ramping_version_percentage_changed_time = 6;</code>
     */
    protected $ramping_version_percentage_changed_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Temporal\Api\Deployment\V1\WorkerDeploymentVersion $current_deployment_version
     *           Specifies which Deployment Version should receive new workflow executions and tasks of
     *           existing unversioned or AutoUpgrade workflows.
     *           Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set)  goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). 
     *           Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage
     *           is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`).
     *     @type string $current_version
     *           Deprecated. Use `current_deployment_version`.
     *     @type \Temporal\Api\Deployment\V1\WorkerDeploymentVersion $ramping_deployment_version
     *           When ramp percentage is non-zero, that portion of traffic is shifted from the Current Version to the Ramping Version.
     *           Must always be different from `current_deployment_version` unless both are nil.
     *           Nil value represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
     *           Note that it is possible to ramp from one Version to another Version, or from unversioned
     *           workers to a particular Version, or from a particular Version to unversioned workers.
     *     @type string $ramping_version
     *           Deprecated. Use `ramping_deployment_version`.
     *     @type float $ramping_version_percentage
     *           Percentage of tasks that are routed to the Ramping Version instead of the Current Version.
     *           Valid range: [0, 100]. A 100% value means the Ramping Version is receiving full traffic but
     *           not yet "promoted" to be the Current Version, likely due to pending validations.
     *           A 0% value means the Ramping Version is receiving no traffic.
     *     @type \Google\Protobuf\Timestamp $current_version_changed_time
     *           Last time current version was changed.
     *     @type \Google\Protobuf\Timestamp $ramping_version_changed_time
     *           Last time ramping version was changed. Not updated if only the ramp percentage changes.
     *     @type \Google\Protobuf\Timestamp $ramping_version_percentage_changed_time
     *           Last time ramping version percentage was changed.
     *           If ramping version is changed, this is also updated, even if the percentage stays the same.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Deployment\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Specifies which Deployment Version should receive new workflow executions and tasks of
     * existing unversioned or AutoUpgrade workflows.
     * Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set)  goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). 
     * Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage
     * is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`).
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion current_deployment_version = 7;</code>
     * @return \Temporal\Api\Deployment\V1\WorkerDeploymentVersion|null
     */
    public function getCurrentDeploymentVersion()
    {
        return $this->current_deployment_version;
    }

    public function hasCurrentDeploymentVersion()
    {
        return isset($this->current_deployment_version);
    }

    public function clearCurrentDeploymentVersion()
    {
        unset($this->current_deployment_version);
    }

    /**
     * Specifies which Deployment Version should receive new workflow executions and tasks of
     * existing unversioned or AutoUpgrade workflows.
     * Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set)  goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). 
     * Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage
     * is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`).
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion current_deployment_version = 7;</code>
     * @param \Temporal\Api\Deployment\V1\WorkerDeploymentVersion $var
     * @return $this
     */
    public function setCurrentDeploymentVersion($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Deployment\V1\WorkerDeploymentVersion::class);
        $this->current_deployment_version = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * When ramp percentage is non-zero, that portion of traffic is shifted from the Current Version to the Ramping Version.
     * Must always be different from `current_deployment_version` unless both are nil.
     * Nil value represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
     * Note that it is possible to ramp from one Version to another Version, or from unversioned
     * workers to a particular Version, or from a particular Version to unversioned workers.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion ramping_deployment_version = 9;</code>
     * @return \Temporal\Api\Deployment\V1\WorkerDeploymentVersion|null
     */
    public function getRampingDeploymentVersion()
    {
        return $this->ramping_deployment_version;
    }

    public function hasRampingDeploymentVersion()
    {
        return isset($this->ramping_deployment_version);
    }

    public function clearRampingDeploymentVersion()
    {
        unset($this->ramping_deployment_version);
    }

    /**
     * When ramp percentage is non-zero, that portion of traffic is shifted from the Current Version to the Ramping Version.
     * Must always be different from `current_deployment_version` unless both are nil.
     * Nil value represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
     * Note that it is possible to ramp from one Version to another Version, or from unversioned
     * workers to a particular Version, or from a particular Version to unversioned workers.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion ramping_deployment_version = 9;</code>
     * @param \Temporal\Api\Deployment\V1\WorkerDeploymentVersion $var
     * @return $this
     */
    public function setRampingDeploymentVersion($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Deployment\V1\WorkerDeploymentVersion::class);
        $this->ramping_deployment_version = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Percentage of tasks that are routed to the Ramping Version instead of the Current Version.
     * Valid range: [0, 100]. A 100% value means the Ramping Version is receiving full traffic but
     * not yet "promoted" to be the Current Version, likely due to pending validations.
     * A 0% value means the Ramping Version is receiving no traffic.
     *
     * Generated from protobuf field <code>float ramping_version_percentage = 3;</code>
     * @return float
     */
    public function getRampingVersionPercentage()
    {
        return $this->ramping_version_percentage;
    }

    /**
     * Percentage of tasks that are routed to the Ramping Version instead of the Current Version.
     * Valid range: [0, 100]. A 100% value means the Ramping Version is receiving full traffic but
     * not yet "promoted" to be the Current Version, likely due to pending validations.
     * A 0% value means the Ramping Version is receiving no traffic.
     *
     * Generated from protobuf field <code>float ramping_version_percentage = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setRampingVersionPercentage($var)
    {
        GPBUtil::checkFloat($var);
        $this->ramping_version_percentage = $var;

        return $this;
    }

    /**
     * Last time current version was changed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp current_version_changed_time = 4;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCurrentVersionChangedTime()
    {
        return $this->current_version_changed_time;
    }

    public function hasCurrentVersionChangedTime()
    {
        return isset($this->current_version_changed_time);
    }

    public function clearCurrentVersionChangedTime()
    {
        unset($this->current_version_changed_time);
    }

    /**
     * Last time current version was changed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp current_version_changed_time = 4;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCurrentVersionChangedTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->current_version_changed_time = $var;

        return $this;
    }

    /**
     * Last time ramping version was changed. Not updated if only the ramp percentage changes.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp ramping_version_changed_time = 5;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getRampingVersionChangedTime()
    {
        return $this->ramping_version_changed_time;
    }

    public function hasRampingVersionChangedTime()
    {
        return isset($this->ramping_version_changed_time);
    }

    public function clearRampingVersionChangedTime()
    {
        unset($this->ramping_version_changed_time);
    }

    /**
     * Last time ramping version was changed. Not updated if only the ramp percentage changes.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp ramping_version_changed_time = 5;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setRampingVersionChangedTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->ramping_version_changed_time = $var;

        return $this;
    }

    /**
     * Last time ramping version percentage was changed.
     * If ramping version is changed, this is also updated, even if the percentage stays the same.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp ramping_version_percentage_changed_time = 6;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getRampingVersionPercentageChangedTime()
    {
        return $this->ramping_version_percentage_changed_time;
    }

    public function hasRampingVersionPercentageChangedTime()
    {
        return isset($this->ramping_version_percentage_changed_time);
    }

    public function clearRampingVersionPercentageChangedTime()
    {
        unset($this->ramping_version_percentage_changed_time);
    }

    /**
     * Last time ramping version percentage was changed.
     * If ramping version is changed, this is also updated, even if the percentage stays the same.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp ramping_version_percentage_changed_time = 6;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setRampingVersionPercentageChangedTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->ramping_version_percentage_changed_time = $var;

        return $this;
    }

}

