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

/**
 * Set/unset the Ramping Version of a Worker Deployment and its ramp percentage.
 *
 * Generated from protobuf message <code>temporal.api.workflowservice.v1.SetWorkerDeploymentRampingVersionRequest</code>
 */
class SetWorkerDeploymentRampingVersionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     */
    protected $namespace = '';
    /**
     * Generated from protobuf field <code>string deployment_name = 2;</code>
     */
    protected $deployment_name = '';
    /**
     * Deprecated. Use `build_id`.
     *
     * Generated from protobuf field <code>string version = 3 [deprecated = true];</code>
     * @deprecated
     */
    protected $version = '';
    /**
     * The build id of the Version that you want to ramp traffic to.
     * Pass an empty value to set the Ramping Version to nil.
     * A nil Ramping Version represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
     *
     * Generated from protobuf field <code>string build_id = 8;</code>
     */
    protected $build_id = '';
    /**
     * Ramp percentage to set. Valid range: [0,100].
     *
     * Generated from protobuf field <code>float percentage = 4;</code>
     */
    protected $percentage = 0.0;
    /**
     * Optional. This can be the value of conflict_token from a Describe, or another Worker
     * Deployment API. Passing a non-nil conflict token will cause this request to fail if the
     * Deployment's configuration has been modified between the API call that generated the
     * token and this one.
     *
     * Generated from protobuf field <code>bytes conflict_token = 5;</code>
     */
    protected $conflict_token = '';
    /**
     * Optional. The identity of the client who initiated this request.
     *
     * Generated from protobuf field <code>string identity = 6;</code>
     */
    protected $identity = '';
    /**
     * Optional. By default this request would be rejected if not all the expected Task Queues are
     * being polled by the new Version, to protect against accidental removal of Task Queues, or
     * worker health issues. Pass `true` here to bypass this protection.
     * The set of expected Task Queues equals to all the Task Queues ever polled from the existing
     * Current Version of the Deployment, with the following exclusions:
     *   - Task Queues that are not used anymore (inferred by having empty backlog and a task
     *     add_rate of 0.)
     *   - Task Queues that are moved to another Worker Deployment (inferred by the Task Queue
     *     having a different Current Version than the Current Version of this deployment.)
     * WARNING: Do not set this flag unless you are sure that the missing task queue poller are not
     * needed. If the request is unexpectedly rejected due to missing pollers, then that means the
     * pollers have not reached to the server yet. Only set this if you expect those pollers to
     * never arrive.
     * Note: this check only happens when the ramping version is about to change, not every time
     * that the percentage changes. Also note that the check is against the deployment's Current
     * Version, not the previous Ramping Version.
     *
     * Generated from protobuf field <code>bool ignore_missing_task_queues = 7;</code>
     */
    protected $ignore_missing_task_queues = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $namespace
     *     @type string $deployment_name
     *     @type string $version
     *           Deprecated. Use `build_id`.
     *     @type string $build_id
     *           The build id of the Version that you want to ramp traffic to.
     *           Pass an empty value to set the Ramping Version to nil.
     *           A nil Ramping Version represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
     *     @type float $percentage
     *           Ramp percentage to set. Valid range: [0,100].
     *     @type string $conflict_token
     *           Optional. This can be the value of conflict_token from a Describe, or another Worker
     *           Deployment API. Passing a non-nil conflict token will cause this request to fail if the
     *           Deployment's configuration has been modified between the API call that generated the
     *           token and this one.
     *     @type string $identity
     *           Optional. The identity of the client who initiated this request.
     *     @type bool $ignore_missing_task_queues
     *           Optional. By default this request would be rejected if not all the expected Task Queues are
     *           being polled by the new Version, to protect against accidental removal of Task Queues, or
     *           worker health issues. Pass `true` here to bypass this protection.
     *           The set of expected Task Queues equals to all the Task Queues ever polled from the existing
     *           Current Version of the Deployment, with the following exclusions:
     *             - Task Queues that are not used anymore (inferred by having empty backlog and a task
     *               add_rate of 0.)
     *             - Task Queues that are moved to another Worker Deployment (inferred by the Task Queue
     *               having a different Current Version than the Current Version of this deployment.)
     *           WARNING: Do not set this flag unless you are sure that the missing task queue poller are not
     *           needed. If the request is unexpectedly rejected due to missing pollers, then that means the
     *           pollers have not reached to the server yet. Only set this if you expect those pollers to
     *           never arrive.
     *           Note: this check only happens when the ramping version is about to change, not every time
     *           that the percentage changes. Also note that the check is against the deployment's Current
     *           Version, not the previous Ramping Version.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflowservice\V1\RequestResponse::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     * @return string
     */
    public function getNamespace()
    {
        return $this->namespace;
    }

    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setNamespace($var)
    {
        GPBUtil::checkString($var, True);
        $this->namespace = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string deployment_name = 2;</code>
     * @return string
     */
    public function getDeploymentName()
    {
        return $this->deployment_name;
    }

    /**
     * Generated from protobuf field <code>string deployment_name = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDeploymentName($var)
    {
        GPBUtil::checkString($var, True);
        $this->deployment_name = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * The build id of the Version that you want to ramp traffic to.
     * Pass an empty value to set the Ramping Version to nil.
     * A nil Ramping Version represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
     *
     * Generated from protobuf field <code>string build_id = 8;</code>
     * @return string
     */
    public function getBuildId()
    {
        return $this->build_id;
    }

    /**
     * The build id of the Version that you want to ramp traffic to.
     * Pass an empty value to set the Ramping Version to nil.
     * A nil Ramping Version represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
     *
     * Generated from protobuf field <code>string build_id = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setBuildId($var)
    {
        GPBUtil::checkString($var, True);
        $this->build_id = $var;

        return $this;
    }

    /**
     * Ramp percentage to set. Valid range: [0,100].
     *
     * Generated from protobuf field <code>float percentage = 4;</code>
     * @return float
     */
    public function getPercentage()
    {
        return $this->percentage;
    }

    /**
     * Ramp percentage to set. Valid range: [0,100].
     *
     * Generated from protobuf field <code>float percentage = 4;</code>
     * @param float $var
     * @return $this
     */
    public function setPercentage($var)
    {
        GPBUtil::checkFloat($var);
        $this->percentage = $var;

        return $this;
    }

    /**
     * Optional. This can be the value of conflict_token from a Describe, or another Worker
     * Deployment API. Passing a non-nil conflict token will cause this request to fail if the
     * Deployment's configuration has been modified between the API call that generated the
     * token and this one.
     *
     * Generated from protobuf field <code>bytes conflict_token = 5;</code>
     * @return string
     */
    public function getConflictToken()
    {
        return $this->conflict_token;
    }

    /**
     * Optional. This can be the value of conflict_token from a Describe, or another Worker
     * Deployment API. Passing a non-nil conflict token will cause this request to fail if the
     * Deployment's configuration has been modified between the API call that generated the
     * token and this one.
     *
     * Generated from protobuf field <code>bytes conflict_token = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setConflictToken($var)
    {
        GPBUtil::checkString($var, False);
        $this->conflict_token = $var;

        return $this;
    }

    /**
     * Optional. The identity of the client who initiated this request.
     *
     * Generated from protobuf field <code>string identity = 6;</code>
     * @return string
     */
    public function getIdentity()
    {
        return $this->identity;
    }

    /**
     * Optional. The identity of the client who initiated this request.
     *
     * Generated from protobuf field <code>string identity = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setIdentity($var)
    {
        GPBUtil::checkString($var, True);
        $this->identity = $var;

        return $this;
    }

    /**
     * Optional. By default this request would be rejected if not all the expected Task Queues are
     * being polled by the new Version, to protect against accidental removal of Task Queues, or
     * worker health issues. Pass `true` here to bypass this protection.
     * The set of expected Task Queues equals to all the Task Queues ever polled from the existing
     * Current Version of the Deployment, with the following exclusions:
     *   - Task Queues that are not used anymore (inferred by having empty backlog and a task
     *     add_rate of 0.)
     *   - Task Queues that are moved to another Worker Deployment (inferred by the Task Queue
     *     having a different Current Version than the Current Version of this deployment.)
     * WARNING: Do not set this flag unless you are sure that the missing task queue poller are not
     * needed. If the request is unexpectedly rejected due to missing pollers, then that means the
     * pollers have not reached to the server yet. Only set this if you expect those pollers to
     * never arrive.
     * Note: this check only happens when the ramping version is about to change, not every time
     * that the percentage changes. Also note that the check is against the deployment's Current
     * Version, not the previous Ramping Version.
     *
     * Generated from protobuf field <code>bool ignore_missing_task_queues = 7;</code>
     * @return bool
     */
    public function getIgnoreMissingTaskQueues()
    {
        return $this->ignore_missing_task_queues;
    }

    /**
     * Optional. By default this request would be rejected if not all the expected Task Queues are
     * being polled by the new Version, to protect against accidental removal of Task Queues, or
     * worker health issues. Pass `true` here to bypass this protection.
     * The set of expected Task Queues equals to all the Task Queues ever polled from the existing
     * Current Version of the Deployment, with the following exclusions:
     *   - Task Queues that are not used anymore (inferred by having empty backlog and a task
     *     add_rate of 0.)
     *   - Task Queues that are moved to another Worker Deployment (inferred by the Task Queue
     *     having a different Current Version than the Current Version of this deployment.)
     * WARNING: Do not set this flag unless you are sure that the missing task queue poller are not
     * needed. If the request is unexpectedly rejected due to missing pollers, then that means the
     * pollers have not reached to the server yet. Only set this if you expect those pollers to
     * never arrive.
     * Note: this check only happens when the ramping version is about to change, not every time
     * that the percentage changes. Also note that the check is against the deployment's Current
     * Version, not the previous Ramping Version.
     *
     * Generated from protobuf field <code>bool ignore_missing_task_queues = 7;</code>
     * @param bool $var
     * @return $this
     */
    public function setIgnoreMissingTaskQueues($var)
    {
        GPBUtil::checkBool($var);
        $this->ignore_missing_task_queues = $var;

        return $this;
    }

}

