<?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.RespondNexusTaskFailedRequest</code>
 */
class RespondNexusTaskFailedRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     */
    protected $namespace = '';
    /**
     * The identity of the client who initiated this request.
     *
     * Generated from protobuf field <code>string identity = 2;</code>
     */
    protected $identity = '';
    /**
     * A unique identifier for this task.
     *
     * Generated from protobuf field <code>bytes task_token = 3;</code>
     */
    protected $task_token = '';
    /**
     * The error the handler failed with.
     *
     * Generated from protobuf field <code>.temporal.api.nexus.v1.HandlerError error = 4;</code>
     */
    protected $error = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $namespace
     *     @type string $identity
     *           The identity of the client who initiated this request.
     *     @type string $task_token
     *           A unique identifier for this task.
     *     @type \Temporal\Api\Nexus\V1\HandlerError $error
     *           The error the handler failed with.
     * }
     */
    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;
    }

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

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

        return $this;
    }

    /**
     * A unique identifier for this task.
     *
     * Generated from protobuf field <code>bytes task_token = 3;</code>
     * @return string
     */
    public function getTaskToken()
    {
        return $this->task_token;
    }

    /**
     * A unique identifier for this task.
     *
     * Generated from protobuf field <code>bytes task_token = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setTaskToken($var)
    {
        GPBUtil::checkString($var, False);
        $this->task_token = $var;

        return $this;
    }

    /**
     * The error the handler failed with.
     *
     * Generated from protobuf field <code>.temporal.api.nexus.v1.HandlerError error = 4;</code>
     * @return \Temporal\Api\Nexus\V1\HandlerError|null
     */
    public function getError()
    {
        return $this->error;
    }

    public function hasError()
    {
        return isset($this->error);
    }

    public function clearError()
    {
        unset($this->error);
    }

    /**
     * The error the handler failed with.
     *
     * Generated from protobuf field <code>.temporal.api.nexus.v1.HandlerError error = 4;</code>
     * @param \Temporal\Api\Nexus\V1\HandlerError $var
     * @return $this
     */
    public function setError($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Nexus\V1\HandlerError::class);
        $this->error = $var;

        return $this;
    }

}

