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

/**
 * Used for manual deletion of Versions. User can delete a Version only when all the
 * following conditions are met:
 *  - It is not the Current or Ramping Version of its Deployment.
 *  - It has no active pollers (none of the task queues in the Version have pollers)
 *  - It is not draining (see WorkerDeploymentVersionInfo.drainage_info). This condition
 *    can be skipped by passing `skip-drainage=true`.
 *
 * Generated from protobuf message <code>temporal.api.workflowservice.v1.DeleteWorkerDeploymentVersionRequest</code>
 */
class DeleteWorkerDeploymentVersionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     */
    protected $namespace = '';
    /**
     * Deprecated. Use `deployment_version`.
     *
     * Generated from protobuf field <code>string version = 2 [deprecated = true];</code>
     * @deprecated
     */
    protected $version = '';
    /**
     * Required.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 5;</code>
     */
    protected $deployment_version = null;
    /**
     * Pass to force deletion even if the Version is draining. In this case the open pinned
     * workflows will be stuck until manually moved to another version by UpdateWorkflowExecutionOptions.
     *
     * Generated from protobuf field <code>bool skip_drainage = 3;</code>
     */
    protected $skip_drainage = false;
    /**
     * Optional. The identity of the client who initiated this request.
     *
     * Generated from protobuf field <code>string identity = 4;</code>
     */
    protected $identity = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $namespace
     *     @type string $version
     *           Deprecated. Use `deployment_version`.
     *     @type \Temporal\Api\Deployment\V1\WorkerDeploymentVersion $deployment_version
     *           Required.
     *     @type bool $skip_drainage
     *           Pass to force deletion even if the Version is draining. In this case the open pinned
     *           workflows will be stuck until manually moved to another version by UpdateWorkflowExecutionOptions.
     *     @type string $identity
     *           Optional. The identity of the client who initiated this request.
     * }
     */
    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;
    }

    /**
     * Deprecated. Use `deployment_version`.
     *
     * Generated from protobuf field <code>string version = 2 [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 `deployment_version`.
     *
     * Generated from protobuf field <code>string version = 2 [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;
    }

    /**
     * Required.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 5;</code>
     * @return \Temporal\Api\Deployment\V1\WorkerDeploymentVersion|null
     */
    public function getDeploymentVersion()
    {
        return $this->deployment_version;
    }

    public function hasDeploymentVersion()
    {
        return isset($this->deployment_version);
    }

    public function clearDeploymentVersion()
    {
        unset($this->deployment_version);
    }

    /**
     * Required.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 5;</code>
     * @param \Temporal\Api\Deployment\V1\WorkerDeploymentVersion $var
     * @return $this
     */
    public function setDeploymentVersion($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Deployment\V1\WorkerDeploymentVersion::class);
        $this->deployment_version = $var;

        return $this;
    }

    /**
     * Pass to force deletion even if the Version is draining. In this case the open pinned
     * workflows will be stuck until manually moved to another version by UpdateWorkflowExecutionOptions.
     *
     * Generated from protobuf field <code>bool skip_drainage = 3;</code>
     * @return bool
     */
    public function getSkipDrainage()
    {
        return $this->skip_drainage;
    }

    /**
     * Pass to force deletion even if the Version is draining. In this case the open pinned
     * workflows will be stuck until manually moved to another version by UpdateWorkflowExecutionOptions.
     *
     * Generated from protobuf field <code>bool skip_drainage = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setSkipDrainage($var)
    {
        GPBUtil::checkBool($var);
        $this->skip_drainage = $var;

        return $this;
    }

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

        return $this;
    }

}

