<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: temporal/api/workflow/v1/message.proto

namespace Temporal\Api\Workflow\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * PendingNexusOperationInfo contains the state of a pending Nexus operation.
 *
 * Generated from protobuf message <code>temporal.api.workflow.v1.PendingNexusOperationInfo</code>
 */
class PendingNexusOperationInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Endpoint name.
     * Resolved to a URL via the cluster's endpoint registry.
     *
     * Generated from protobuf field <code>string endpoint = 1;</code>
     */
    protected $endpoint = '';
    /**
     * Service name.
     *
     * Generated from protobuf field <code>string service = 2;</code>
     */
    protected $service = '';
    /**
     * Operation name.
     *
     * Generated from protobuf field <code>string operation = 3;</code>
     */
    protected $operation = '';
    /**
     * Operation ID. Only set for asynchronous operations after a successful StartOperation call.
     * Deprecated. Renamed to operation_token.
     *
     * Generated from protobuf field <code>string operation_id = 4 [deprecated = true];</code>
     * @deprecated
     */
    protected $operation_id = '';
    /**
     * Schedule-to-close timeout for this operation.
     * This is the only timeout settable by a workflow.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: "to" is used to indicate interval. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration schedule_to_close_timeout = 5;</code>
     */
    protected $schedule_to_close_timeout = null;
    /**
     * The time when the operation was scheduled.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp scheduled_time = 6;</code>
     */
    protected $scheduled_time = null;
    /**
     * Generated from protobuf field <code>.temporal.api.enums.v1.PendingNexusOperationState state = 7;</code>
     */
    protected $state = 0;
    /**
     * The number of attempts made to deliver the start operation request.
     * This number represents a minimum bound since the attempt is incremented after the request completes.
     *
     * Generated from protobuf field <code>int32 attempt = 8;</code>
     */
    protected $attempt = 0;
    /**
     * The time when the last attempt completed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_attempt_complete_time = 9;</code>
     */
    protected $last_attempt_complete_time = null;
    /**
     * The last attempt's failure, if any.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure last_attempt_failure = 10;</code>
     */
    protected $last_attempt_failure = null;
    /**
     * The time when the next attempt is scheduled.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp next_attempt_schedule_time = 11;</code>
     */
    protected $next_attempt_schedule_time = null;
    /**
     * Generated from protobuf field <code>.temporal.api.workflow.v1.NexusOperationCancellationInfo cancellation_info = 12;</code>
     */
    protected $cancellation_info = null;
    /**
     * The event ID of the NexusOperationScheduled event. Can be used to correlate an operation in the
     * DescribeWorkflowExecution response with workflow history.
     *
     * Generated from protobuf field <code>int64 scheduled_event_id = 13;</code>
     */
    protected $scheduled_event_id = 0;
    /**
     * If the state is BLOCKED, blocked reason provides additional information.
     *
     * Generated from protobuf field <code>string blocked_reason = 14;</code>
     */
    protected $blocked_reason = '';
    /**
     * Operation token. Only set for asynchronous operations after a successful StartOperation call.
     *
     * Generated from protobuf field <code>string operation_token = 15;</code>
     */
    protected $operation_token = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $endpoint
     *           Endpoint name.
     *           Resolved to a URL via the cluster's endpoint registry.
     *     @type string $service
     *           Service name.
     *     @type string $operation
     *           Operation name.
     *     @type string $operation_id
     *           Operation ID. Only set for asynchronous operations after a successful StartOperation call.
     *           Deprecated. Renamed to operation_token.
     *     @type \Google\Protobuf\Duration $schedule_to_close_timeout
     *           Schedule-to-close timeout for this operation.
     *           This is the only timeout settable by a workflow.
     *           (-- api-linter: core::0140::prepositions=disabled
     *               aip.dev/not-precedent: "to" is used to indicate interval. --)
     *     @type \Google\Protobuf\Timestamp $scheduled_time
     *           The time when the operation was scheduled.
     *     @type int $state
     *     @type int $attempt
     *           The number of attempts made to deliver the start operation request.
     *           This number represents a minimum bound since the attempt is incremented after the request completes.
     *     @type \Google\Protobuf\Timestamp $last_attempt_complete_time
     *           The time when the last attempt completed.
     *     @type \Temporal\Api\Failure\V1\Failure $last_attempt_failure
     *           The last attempt's failure, if any.
     *     @type \Google\Protobuf\Timestamp $next_attempt_schedule_time
     *           The time when the next attempt is scheduled.
     *     @type \Temporal\Api\Workflow\V1\NexusOperationCancellationInfo $cancellation_info
     *     @type int|string $scheduled_event_id
     *           The event ID of the NexusOperationScheduled event. Can be used to correlate an operation in the
     *           DescribeWorkflowExecution response with workflow history.
     *     @type string $blocked_reason
     *           If the state is BLOCKED, blocked reason provides additional information.
     *     @type string $operation_token
     *           Operation token. Only set for asynchronous operations after a successful StartOperation call.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflow\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Endpoint name.
     * Resolved to a URL via the cluster's endpoint registry.
     *
     * Generated from protobuf field <code>string endpoint = 1;</code>
     * @return string
     */
    public function getEndpoint()
    {
        return $this->endpoint;
    }

    /**
     * Endpoint name.
     * Resolved to a URL via the cluster's endpoint registry.
     *
     * Generated from protobuf field <code>string endpoint = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setEndpoint($var)
    {
        GPBUtil::checkString($var, True);
        $this->endpoint = $var;

        return $this;
    }

    /**
     * Service name.
     *
     * Generated from protobuf field <code>string service = 2;</code>
     * @return string
     */
    public function getService()
    {
        return $this->service;
    }

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

        return $this;
    }

    /**
     * Operation name.
     *
     * Generated from protobuf field <code>string operation = 3;</code>
     * @return string
     */
    public function getOperation()
    {
        return $this->operation;
    }

    /**
     * Operation name.
     *
     * Generated from protobuf field <code>string operation = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setOperation($var)
    {
        GPBUtil::checkString($var, True);
        $this->operation = $var;

        return $this;
    }

    /**
     * Operation ID. Only set for asynchronous operations after a successful StartOperation call.
     * Deprecated. Renamed to operation_token.
     *
     * Generated from protobuf field <code>string operation_id = 4 [deprecated = true];</code>
     * @return string
     * @deprecated
     */
    public function getOperationId()
    {
        if ($this->operation_id !== '') {
            @trigger_error('operation_id is deprecated.', E_USER_DEPRECATED);
        }
        return $this->operation_id;
    }

    /**
     * Operation ID. Only set for asynchronous operations after a successful StartOperation call.
     * Deprecated. Renamed to operation_token.
     *
     * Generated from protobuf field <code>string operation_id = 4 [deprecated = true];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setOperationId($var)
    {
        @trigger_error('operation_id is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, True);
        $this->operation_id = $var;

        return $this;
    }

    /**
     * Schedule-to-close timeout for this operation.
     * This is the only timeout settable by a workflow.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: "to" is used to indicate interval. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration schedule_to_close_timeout = 5;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getScheduleToCloseTimeout()
    {
        return $this->schedule_to_close_timeout;
    }

    public function hasScheduleToCloseTimeout()
    {
        return isset($this->schedule_to_close_timeout);
    }

    public function clearScheduleToCloseTimeout()
    {
        unset($this->schedule_to_close_timeout);
    }

    /**
     * Schedule-to-close timeout for this operation.
     * This is the only timeout settable by a workflow.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: "to" is used to indicate interval. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration schedule_to_close_timeout = 5;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setScheduleToCloseTimeout($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->schedule_to_close_timeout = $var;

        return $this;
    }

    /**
     * The time when the operation was scheduled.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp scheduled_time = 6;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getScheduledTime()
    {
        return $this->scheduled_time;
    }

    public function hasScheduledTime()
    {
        return isset($this->scheduled_time);
    }

    public function clearScheduledTime()
    {
        unset($this->scheduled_time);
    }

    /**
     * The time when the operation was scheduled.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp scheduled_time = 6;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setScheduledTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->scheduled_time = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.enums.v1.PendingNexusOperationState state = 7;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.enums.v1.PendingNexusOperationState state = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Temporal\Api\Enums\V1\PendingNexusOperationState::class);
        $this->state = $var;

        return $this;
    }

    /**
     * The number of attempts made to deliver the start operation request.
     * This number represents a minimum bound since the attempt is incremented after the request completes.
     *
     * Generated from protobuf field <code>int32 attempt = 8;</code>
     * @return int
     */
    public function getAttempt()
    {
        return $this->attempt;
    }

    /**
     * The number of attempts made to deliver the start operation request.
     * This number represents a minimum bound since the attempt is incremented after the request completes.
     *
     * Generated from protobuf field <code>int32 attempt = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setAttempt($var)
    {
        GPBUtil::checkInt32($var);
        $this->attempt = $var;

        return $this;
    }

    /**
     * The time when the last attempt completed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_attempt_complete_time = 9;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getLastAttemptCompleteTime()
    {
        return $this->last_attempt_complete_time;
    }

    public function hasLastAttemptCompleteTime()
    {
        return isset($this->last_attempt_complete_time);
    }

    public function clearLastAttemptCompleteTime()
    {
        unset($this->last_attempt_complete_time);
    }

    /**
     * The time when the last attempt completed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_attempt_complete_time = 9;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setLastAttemptCompleteTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->last_attempt_complete_time = $var;

        return $this;
    }

    /**
     * The last attempt's failure, if any.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure last_attempt_failure = 10;</code>
     * @return \Temporal\Api\Failure\V1\Failure|null
     */
    public function getLastAttemptFailure()
    {
        return $this->last_attempt_failure;
    }

    public function hasLastAttemptFailure()
    {
        return isset($this->last_attempt_failure);
    }

    public function clearLastAttemptFailure()
    {
        unset($this->last_attempt_failure);
    }

    /**
     * The last attempt's failure, if any.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure last_attempt_failure = 10;</code>
     * @param \Temporal\Api\Failure\V1\Failure $var
     * @return $this
     */
    public function setLastAttemptFailure($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Failure\V1\Failure::class);
        $this->last_attempt_failure = $var;

        return $this;
    }

    /**
     * The time when the next attempt is scheduled.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp next_attempt_schedule_time = 11;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getNextAttemptScheduleTime()
    {
        return $this->next_attempt_schedule_time;
    }

    public function hasNextAttemptScheduleTime()
    {
        return isset($this->next_attempt_schedule_time);
    }

    public function clearNextAttemptScheduleTime()
    {
        unset($this->next_attempt_schedule_time);
    }

    /**
     * The time when the next attempt is scheduled.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp next_attempt_schedule_time = 11;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setNextAttemptScheduleTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->next_attempt_schedule_time = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.workflow.v1.NexusOperationCancellationInfo cancellation_info = 12;</code>
     * @return \Temporal\Api\Workflow\V1\NexusOperationCancellationInfo|null
     */
    public function getCancellationInfo()
    {
        return $this->cancellation_info;
    }

    public function hasCancellationInfo()
    {
        return isset($this->cancellation_info);
    }

    public function clearCancellationInfo()
    {
        unset($this->cancellation_info);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.workflow.v1.NexusOperationCancellationInfo cancellation_info = 12;</code>
     * @param \Temporal\Api\Workflow\V1\NexusOperationCancellationInfo $var
     * @return $this
     */
    public function setCancellationInfo($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Workflow\V1\NexusOperationCancellationInfo::class);
        $this->cancellation_info = $var;

        return $this;
    }

    /**
     * The event ID of the NexusOperationScheduled event. Can be used to correlate an operation in the
     * DescribeWorkflowExecution response with workflow history.
     *
     * Generated from protobuf field <code>int64 scheduled_event_id = 13;</code>
     * @return int|string
     */
    public function getScheduledEventId()
    {
        return $this->scheduled_event_id;
    }

    /**
     * The event ID of the NexusOperationScheduled event. Can be used to correlate an operation in the
     * DescribeWorkflowExecution response with workflow history.
     *
     * Generated from protobuf field <code>int64 scheduled_event_id = 13;</code>
     * @param int|string $var
     * @return $this
     */
    public function setScheduledEventId($var)
    {
        GPBUtil::checkInt64($var);
        $this->scheduled_event_id = $var;

        return $this;
    }

    /**
     * If the state is BLOCKED, blocked reason provides additional information.
     *
     * Generated from protobuf field <code>string blocked_reason = 14;</code>
     * @return string
     */
    public function getBlockedReason()
    {
        return $this->blocked_reason;
    }

    /**
     * If the state is BLOCKED, blocked reason provides additional information.
     *
     * Generated from protobuf field <code>string blocked_reason = 14;</code>
     * @param string $var
     * @return $this
     */
    public function setBlockedReason($var)
    {
        GPBUtil::checkString($var, True);
        $this->blocked_reason = $var;

        return $this;
    }

    /**
     * Operation token. Only set for asynchronous operations after a successful StartOperation call.
     *
     * Generated from protobuf field <code>string operation_token = 15;</code>
     * @return string
     */
    public function getOperationToken()
    {
        return $this->operation_token;
    }

    /**
     * Operation token. Only set for asynchronous operations after a successful StartOperation call.
     *
     * Generated from protobuf field <code>string operation_token = 15;</code>
     * @param string $var
     * @return $this
     */
    public function setOperationToken($var)
    {
        GPBUtil::checkString($var, True);
        $this->operation_token = $var;

        return $this;
    }

}

