<?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.RespondWorkflowTaskFailedRequest</code>
 */
class RespondWorkflowTaskFailedRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * The task token as received in `PollWorkflowTaskQueueResponse`
     *
     * Generated from protobuf field <code>bytes task_token = 1;</code>
     */
    protected $task_token = '';
    /**
     * Why did the task fail? It's important to note that many of the variants in this enum cannot
     * apply to worker responses. See the type's doc for more.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.WorkflowTaskFailedCause cause = 2;</code>
     */
    protected $cause = 0;
    /**
     * Failure details
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 3;</code>
     */
    protected $failure = null;
    /**
     * The identity of the worker/client
     *
     * Generated from protobuf field <code>string identity = 4;</code>
     */
    protected $identity = '';
    /**
     * Deprecated. Use `deployment_options` instead.
     * Worker process' unique binary id
     *
     * Generated from protobuf field <code>string binary_checksum = 5 [deprecated = true];</code>
     * @deprecated
     */
    protected $binary_checksum = '';
    /**
     * Generated from protobuf field <code>string namespace = 6;</code>
     */
    protected $namespace = '';
    /**
     * Protocol messages piggybacking on a WFT as a transport
     *
     * Generated from protobuf field <code>repeated .temporal.api.protocol.v1.Message messages = 7;</code>
     */
    private $messages;
    /**
     * Version info of the worker who processed this task. This message's `build_id` field should
     * always be set by SDKs. Workers opting into versioning will also set the `use_versioning`
     * field to true. See message docstrings for more.
     * Deprecated. Use `deployment_options` instead.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkerVersionStamp worker_version = 8 [deprecated = true];</code>
     * @deprecated
     */
    protected $worker_version = null;
    /**
     * Deployment info of the worker that completed this task. Must be present if user has set
     * `WorkerDeploymentOptions` regardless of versioning being enabled or not.
     * Deprecated. Replaced with `deployment_options`.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.Deployment deployment = 9 [deprecated = true];</code>
     * @deprecated
     */
    protected $deployment = null;
    /**
     * Worker deployment options that user has set in the worker.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentOptions deployment_options = 10;</code>
     */
    protected $deployment_options = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $task_token
     *           The task token as received in `PollWorkflowTaskQueueResponse`
     *     @type int $cause
     *           Why did the task fail? It's important to note that many of the variants in this enum cannot
     *           apply to worker responses. See the type's doc for more.
     *     @type \Temporal\Api\Failure\V1\Failure $failure
     *           Failure details
     *     @type string $identity
     *           The identity of the worker/client
     *     @type string $binary_checksum
     *           Deprecated. Use `deployment_options` instead.
     *           Worker process' unique binary id
     *     @type string $namespace
     *     @type \Temporal\Api\Protocol\V1\Message[] $messages
     *           Protocol messages piggybacking on a WFT as a transport
     *     @type \Temporal\Api\Common\V1\WorkerVersionStamp $worker_version
     *           Version info of the worker who processed this task. This message's `build_id` field should
     *           always be set by SDKs. Workers opting into versioning will also set the `use_versioning`
     *           field to true. See message docstrings for more.
     *           Deprecated. Use `deployment_options` instead.
     *     @type \Temporal\Api\Deployment\V1\Deployment $deployment
     *           Deployment info of the worker that completed this task. Must be present if user has set
     *           `WorkerDeploymentOptions` regardless of versioning being enabled or not.
     *           Deprecated. Replaced with `deployment_options`.
     *     @type \Temporal\Api\Deployment\V1\WorkerDeploymentOptions $deployment_options
     *           Worker deployment options that user has set in the worker.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflowservice\V1\RequestResponse::initOnce();
        parent::__construct($data);
    }

    /**
     * The task token as received in `PollWorkflowTaskQueueResponse`
     *
     * Generated from protobuf field <code>bytes task_token = 1;</code>
     * @return string
     */
    public function getTaskToken()
    {
        return $this->task_token;
    }

    /**
     * The task token as received in `PollWorkflowTaskQueueResponse`
     *
     * Generated from protobuf field <code>bytes task_token = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setTaskToken($var)
    {
        GPBUtil::checkString($var, False);
        $this->task_token = $var;

        return $this;
    }

    /**
     * Why did the task fail? It's important to note that many of the variants in this enum cannot
     * apply to worker responses. See the type's doc for more.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.WorkflowTaskFailedCause cause = 2;</code>
     * @return int
     */
    public function getCause()
    {
        return $this->cause;
    }

    /**
     * Why did the task fail? It's important to note that many of the variants in this enum cannot
     * apply to worker responses. See the type's doc for more.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.WorkflowTaskFailedCause cause = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setCause($var)
    {
        GPBUtil::checkEnum($var, \Temporal\Api\Enums\V1\WorkflowTaskFailedCause::class);
        $this->cause = $var;

        return $this;
    }

    /**
     * Failure details
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 3;</code>
     * @return \Temporal\Api\Failure\V1\Failure|null
     */
    public function getFailure()
    {
        return $this->failure;
    }

    public function hasFailure()
    {
        return isset($this->failure);
    }

    public function clearFailure()
    {
        unset($this->failure);
    }

    /**
     * Failure details
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 3;</code>
     * @param \Temporal\Api\Failure\V1\Failure $var
     * @return $this
     */
    public function setFailure($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Failure\V1\Failure::class);
        $this->failure = $var;

        return $this;
    }

    /**
     * The identity of the worker/client
     *
     * Generated from protobuf field <code>string identity = 4;</code>
     * @return string
     */
    public function getIdentity()
    {
        return $this->identity;
    }

    /**
     * The identity of the worker/client
     *
     * 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;
    }

    /**
     * Deprecated. Use `deployment_options` instead.
     * Worker process' unique binary id
     *
     * Generated from protobuf field <code>string binary_checksum = 5 [deprecated = true];</code>
     * @return string
     * @deprecated
     */
    public function getBinaryChecksum()
    {
        if ($this->binary_checksum !== '') {
            @trigger_error('binary_checksum is deprecated.', E_USER_DEPRECATED);
        }
        return $this->binary_checksum;
    }

    /**
     * Deprecated. Use `deployment_options` instead.
     * Worker process' unique binary id
     *
     * Generated from protobuf field <code>string binary_checksum = 5 [deprecated = true];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setBinaryChecksum($var)
    {
        @trigger_error('binary_checksum is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, True);
        $this->binary_checksum = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Protocol messages piggybacking on a WFT as a transport
     *
     * Generated from protobuf field <code>repeated .temporal.api.protocol.v1.Message messages = 7;</code>
     * @return RepeatedField<\Temporal\Api\Protocol\V1\Message>
     */
    public function getMessages()
    {
        return $this->messages;
    }

    /**
     * Protocol messages piggybacking on a WFT as a transport
     *
     * Generated from protobuf field <code>repeated .temporal.api.protocol.v1.Message messages = 7;</code>
     * @param \Temporal\Api\Protocol\V1\Message[] $var
     * @return $this
     */
    public function setMessages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Temporal\Api\Protocol\V1\Message::class);
        $this->messages = $arr;

        return $this;
    }

    /**
     * Version info of the worker who processed this task. This message's `build_id` field should
     * always be set by SDKs. Workers opting into versioning will also set the `use_versioning`
     * field to true. See message docstrings for more.
     * Deprecated. Use `deployment_options` instead.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkerVersionStamp worker_version = 8 [deprecated = true];</code>
     * @return \Temporal\Api\Common\V1\WorkerVersionStamp|null
     * @deprecated
     */
    public function getWorkerVersion()
    {
        if (isset($this->worker_version)) {
            @trigger_error('worker_version is deprecated.', E_USER_DEPRECATED);
        }
        return $this->worker_version;
    }

    public function hasWorkerVersion()
    {
        if (isset($this->worker_version)) {
            @trigger_error('worker_version is deprecated.', E_USER_DEPRECATED);
        }
        return isset($this->worker_version);
    }

    public function clearWorkerVersion()
    {
        @trigger_error('worker_version is deprecated.', E_USER_DEPRECATED);
        unset($this->worker_version);
    }

    /**
     * Version info of the worker who processed this task. This message's `build_id` field should
     * always be set by SDKs. Workers opting into versioning will also set the `use_versioning`
     * field to true. See message docstrings for more.
     * Deprecated. Use `deployment_options` instead.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkerVersionStamp worker_version = 8 [deprecated = true];</code>
     * @param \Temporal\Api\Common\V1\WorkerVersionStamp $var
     * @return $this
     * @deprecated
     */
    public function setWorkerVersion($var)
    {
        @trigger_error('worker_version is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\WorkerVersionStamp::class);
        $this->worker_version = $var;

        return $this;
    }

    /**
     * Deployment info of the worker that completed this task. Must be present if user has set
     * `WorkerDeploymentOptions` regardless of versioning being enabled or not.
     * Deprecated. Replaced with `deployment_options`.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.Deployment deployment = 9 [deprecated = true];</code>
     * @return \Temporal\Api\Deployment\V1\Deployment|null
     * @deprecated
     */
    public function getDeployment()
    {
        if (isset($this->deployment)) {
            @trigger_error('deployment is deprecated.', E_USER_DEPRECATED);
        }
        return $this->deployment;
    }

    public function hasDeployment()
    {
        if (isset($this->deployment)) {
            @trigger_error('deployment is deprecated.', E_USER_DEPRECATED);
        }
        return isset($this->deployment);
    }

    public function clearDeployment()
    {
        @trigger_error('deployment is deprecated.', E_USER_DEPRECATED);
        unset($this->deployment);
    }

    /**
     * Deployment info of the worker that completed this task. Must be present if user has set
     * `WorkerDeploymentOptions` regardless of versioning being enabled or not.
     * Deprecated. Replaced with `deployment_options`.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.Deployment deployment = 9 [deprecated = true];</code>
     * @param \Temporal\Api\Deployment\V1\Deployment $var
     * @return $this
     * @deprecated
     */
    public function setDeployment($var)
    {
        @trigger_error('deployment is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkMessage($var, \Temporal\Api\Deployment\V1\Deployment::class);
        $this->deployment = $var;

        return $this;
    }

    /**
     * Worker deployment options that user has set in the worker.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentOptions deployment_options = 10;</code>
     * @return \Temporal\Api\Deployment\V1\WorkerDeploymentOptions|null
     */
    public function getDeploymentOptions()
    {
        return $this->deployment_options;
    }

    public function hasDeploymentOptions()
    {
        return isset($this->deployment_options);
    }

    public function clearDeploymentOptions()
    {
        unset($this->deployment_options);
    }

    /**
     * Worker deployment options that user has set in the worker.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentOptions deployment_options = 10;</code>
     * @param \Temporal\Api\Deployment\V1\WorkerDeploymentOptions $var
     * @return $this
     */
    public function setDeploymentOptions($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Deployment\V1\WorkerDeploymentOptions::class);
        $this->deployment_options = $var;

        return $this;
    }

}

