<?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 Current Version of a Worker Deployment.
 *
 * Generated from protobuf message <code>temporal.api.workflowservice.v1.SetWorkerDeploymentCurrentVersionRequest</code>
 */
class SetWorkerDeploymentCurrentVersionRequest 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 set as Current.
     * Pass an empty value to set the Current Version to nil.
     * A nil Current Version represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
     *
     * Generated from protobuf field <code>string build_id = 7;</code>
     */
    protected $build_id = '';
    /**
     * 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 = 4;</code>
     */
    protected $conflict_token = '';
    /**
     * Optional. The identity of the client who initiated this request.
     *
     * Generated from protobuf field <code>string identity = 5;</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 is the set of all the Task Queues that were ever poller by
     * 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 pollers 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.
     *
     * Generated from protobuf field <code>bool ignore_missing_task_queues = 6;</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 set as Current.
     *           Pass an empty value to set the Current Version to nil.
     *           A nil Current Version represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
     *     @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 is the set of all the Task Queues that were ever poller by
     *           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 pollers 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.
     * }
     */
    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 set as Current.
     * Pass an empty value to set the Current Version to nil.
     * A nil Current Version represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
     *
     * Generated from protobuf field <code>string build_id = 7;</code>
     * @return string
     */
    public function getBuildId()
    {
        return $this->build_id;
    }

    /**
     * The build id of the Version that you want to set as Current.
     * Pass an empty value to set the Current Version to nil.
     * A nil Current Version represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
     *
     * Generated from protobuf field <code>string build_id = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setBuildId($var)
    {
        GPBUtil::checkString($var, True);
        $this->build_id = $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 = 4;</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 = 4;</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 = 5;</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 = 5;</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 is the set of all the Task Queues that were ever poller by
     * 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 pollers 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.
     *
     * Generated from protobuf field <code>bool ignore_missing_task_queues = 6;</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 is the set of all the Task Queues that were ever poller by
     * 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 pollers 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.
     *
     * Generated from protobuf field <code>bool ignore_missing_task_queues = 6;</code>
     * @param bool $var
     * @return $this
     */
    public function setIgnoreMissingTaskQueues($var)
    {
        GPBUtil::checkBool($var);
        $this->ignore_missing_task_queues = $var;

        return $this;
    }

}

