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

namespace Temporal\Api\History\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.history.v1.WorkflowExecutionContinuedAsNewEventAttributes</code>
 */
class WorkflowExecutionContinuedAsNewEventAttributes extends \Google\Protobuf\Internal\Message
{
    /**
     * The run ID of the new workflow started by this continue-as-new
     *
     * Generated from protobuf field <code>string new_execution_run_id = 1;</code>
     */
    protected $new_execution_run_id = '';
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowType workflow_type = 2;</code>
     */
    protected $workflow_type = null;
    /**
     * Generated from protobuf field <code>.temporal.api.taskqueue.v1.TaskQueue task_queue = 3;</code>
     */
    protected $task_queue = null;
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads input = 4;</code>
     */
    protected $input = null;
    /**
     * Timeout of a single workflow run.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration workflow_run_timeout = 5;</code>
     */
    protected $workflow_run_timeout = null;
    /**
     * Timeout of a single workflow task.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration workflow_task_timeout = 6;</code>
     */
    protected $workflow_task_timeout = null;
    /**
     * The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *
     * Generated from protobuf field <code>int64 workflow_task_completed_event_id = 7;</code>
     */
    protected $workflow_task_completed_event_id = 0;
    /**
     * TODO: How and is this used?
     *
     * Generated from protobuf field <code>.google.protobuf.Duration backoff_start_interval = 8;</code>
     */
    protected $backoff_start_interval = null;
    /**
     * Generated from protobuf field <code>.temporal.api.enums.v1.ContinueAsNewInitiator initiator = 9;</code>
     */
    protected $initiator = 0;
    /**
     * TODO: David are these right?
     * Deprecated. If a workflow's retry policy would cause a new run to start when the current one
     * has failed, this field would be populated with that failure. Now (when supported by server
     * and sdk) the final event will be `WORKFLOW_EXECUTION_FAILED` with `new_execution_run_id` set.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 10 [deprecated = true];</code>
     * @deprecated
     */
    protected $failure = null;
    /**
     * TODO: Is this the result of *this* workflow as it continued-as-new?
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads last_completion_result = 11;</code>
     */
    protected $last_completion_result = null;
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Header header = 12;</code>
     */
    protected $header = null;
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Memo memo = 13;</code>
     */
    protected $memo = null;
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.SearchAttributes search_attributes = 14;</code>
     */
    protected $search_attributes = null;
    /**
     * If this is set, the new execution inherits the Build ID of the current execution. Otherwise,
     * the assignment rules will be used to independently assign a Build ID to the new execution.
     * Deprecated. Only considered for versioning v0.2.
     *
     * Generated from protobuf field <code>bool inherit_build_id = 15 [deprecated = true];</code>
     * @deprecated
     */
    protected $inherit_build_id = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $new_execution_run_id
     *           The run ID of the new workflow started by this continue-as-new
     *     @type \Temporal\Api\Common\V1\WorkflowType $workflow_type
     *     @type \Temporal\Api\Taskqueue\V1\TaskQueue $task_queue
     *     @type \Temporal\Api\Common\V1\Payloads $input
     *     @type \Google\Protobuf\Duration $workflow_run_timeout
     *           Timeout of a single workflow run.
     *     @type \Google\Protobuf\Duration $workflow_task_timeout
     *           Timeout of a single workflow task.
     *     @type int|string $workflow_task_completed_event_id
     *           The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *     @type \Google\Protobuf\Duration $backoff_start_interval
     *           TODO: How and is this used?
     *     @type int $initiator
     *     @type \Temporal\Api\Failure\V1\Failure $failure
     *           TODO: David are these right?
     *           Deprecated. If a workflow's retry policy would cause a new run to start when the current one
     *           has failed, this field would be populated with that failure. Now (when supported by server
     *           and sdk) the final event will be `WORKFLOW_EXECUTION_FAILED` with `new_execution_run_id` set.
     *     @type \Temporal\Api\Common\V1\Payloads $last_completion_result
     *           TODO: Is this the result of *this* workflow as it continued-as-new?
     *     @type \Temporal\Api\Common\V1\Header $header
     *     @type \Temporal\Api\Common\V1\Memo $memo
     *     @type \Temporal\Api\Common\V1\SearchAttributes $search_attributes
     *     @type bool $inherit_build_id
     *           If this is set, the new execution inherits the Build ID of the current execution. Otherwise,
     *           the assignment rules will be used to independently assign a Build ID to the new execution.
     *           Deprecated. Only considered for versioning v0.2.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\History\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * The run ID of the new workflow started by this continue-as-new
     *
     * Generated from protobuf field <code>string new_execution_run_id = 1;</code>
     * @return string
     */
    public function getNewExecutionRunId()
    {
        return $this->new_execution_run_id;
    }

    /**
     * The run ID of the new workflow started by this continue-as-new
     *
     * Generated from protobuf field <code>string new_execution_run_id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setNewExecutionRunId($var)
    {
        GPBUtil::checkString($var, True);
        $this->new_execution_run_id = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowType workflow_type = 2;</code>
     * @return \Temporal\Api\Common\V1\WorkflowType|null
     */
    public function getWorkflowType()
    {
        return $this->workflow_type;
    }

    public function hasWorkflowType()
    {
        return isset($this->workflow_type);
    }

    public function clearWorkflowType()
    {
        unset($this->workflow_type);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowType workflow_type = 2;</code>
     * @param \Temporal\Api\Common\V1\WorkflowType $var
     * @return $this
     */
    public function setWorkflowType($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\WorkflowType::class);
        $this->workflow_type = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.taskqueue.v1.TaskQueue task_queue = 3;</code>
     * @return \Temporal\Api\Taskqueue\V1\TaskQueue|null
     */
    public function getTaskQueue()
    {
        return $this->task_queue;
    }

    public function hasTaskQueue()
    {
        return isset($this->task_queue);
    }

    public function clearTaskQueue()
    {
        unset($this->task_queue);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads input = 4;</code>
     * @return \Temporal\Api\Common\V1\Payloads|null
     */
    public function getInput()
    {
        return $this->input;
    }

    public function hasInput()
    {
        return isset($this->input);
    }

    public function clearInput()
    {
        unset($this->input);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads input = 4;</code>
     * @param \Temporal\Api\Common\V1\Payloads $var
     * @return $this
     */
    public function setInput($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\Payloads::class);
        $this->input = $var;

        return $this;
    }

    /**
     * Timeout of a single workflow run.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration workflow_run_timeout = 5;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getWorkflowRunTimeout()
    {
        return $this->workflow_run_timeout;
    }

    public function hasWorkflowRunTimeout()
    {
        return isset($this->workflow_run_timeout);
    }

    public function clearWorkflowRunTimeout()
    {
        unset($this->workflow_run_timeout);
    }

    /**
     * Timeout of a single workflow run.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration workflow_run_timeout = 5;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setWorkflowRunTimeout($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->workflow_run_timeout = $var;

        return $this;
    }

    /**
     * Timeout of a single workflow task.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration workflow_task_timeout = 6;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getWorkflowTaskTimeout()
    {
        return $this->workflow_task_timeout;
    }

    public function hasWorkflowTaskTimeout()
    {
        return isset($this->workflow_task_timeout);
    }

    public function clearWorkflowTaskTimeout()
    {
        unset($this->workflow_task_timeout);
    }

    /**
     * Timeout of a single workflow task.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration workflow_task_timeout = 6;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setWorkflowTaskTimeout($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->workflow_task_timeout = $var;

        return $this;
    }

    /**
     * The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *
     * Generated from protobuf field <code>int64 workflow_task_completed_event_id = 7;</code>
     * @return int|string
     */
    public function getWorkflowTaskCompletedEventId()
    {
        return $this->workflow_task_completed_event_id;
    }

    /**
     * The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *
     * Generated from protobuf field <code>int64 workflow_task_completed_event_id = 7;</code>
     * @param int|string $var
     * @return $this
     */
    public function setWorkflowTaskCompletedEventId($var)
    {
        GPBUtil::checkInt64($var);
        $this->workflow_task_completed_event_id = $var;

        return $this;
    }

    /**
     * TODO: How and is this used?
     *
     * Generated from protobuf field <code>.google.protobuf.Duration backoff_start_interval = 8;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getBackoffStartInterval()
    {
        return $this->backoff_start_interval;
    }

    public function hasBackoffStartInterval()
    {
        return isset($this->backoff_start_interval);
    }

    public function clearBackoffStartInterval()
    {
        unset($this->backoff_start_interval);
    }

    /**
     * TODO: How and is this used?
     *
     * Generated from protobuf field <code>.google.protobuf.Duration backoff_start_interval = 8;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setBackoffStartInterval($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->backoff_start_interval = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.enums.v1.ContinueAsNewInitiator initiator = 9;</code>
     * @return int
     */
    public function getInitiator()
    {
        return $this->initiator;
    }

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

        return $this;
    }

    /**
     * TODO: David are these right?
     * Deprecated. If a workflow's retry policy would cause a new run to start when the current one
     * has failed, this field would be populated with that failure. Now (when supported by server
     * and sdk) the final event will be `WORKFLOW_EXECUTION_FAILED` with `new_execution_run_id` set.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 10 [deprecated = true];</code>
     * @return \Temporal\Api\Failure\V1\Failure|null
     * @deprecated
     */
    public function getFailure()
    {
        if (isset($this->failure)) {
            @trigger_error('failure is deprecated.', E_USER_DEPRECATED);
        }
        return $this->failure;
    }

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

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

    /**
     * TODO: David are these right?
     * Deprecated. If a workflow's retry policy would cause a new run to start when the current one
     * has failed, this field would be populated with that failure. Now (when supported by server
     * and sdk) the final event will be `WORKFLOW_EXECUTION_FAILED` with `new_execution_run_id` set.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 10 [deprecated = true];</code>
     * @param \Temporal\Api\Failure\V1\Failure $var
     * @return $this
     * @deprecated
     */
    public function setFailure($var)
    {
        @trigger_error('failure is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkMessage($var, \Temporal\Api\Failure\V1\Failure::class);
        $this->failure = $var;

        return $this;
    }

    /**
     * TODO: Is this the result of *this* workflow as it continued-as-new?
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads last_completion_result = 11;</code>
     * @return \Temporal\Api\Common\V1\Payloads|null
     */
    public function getLastCompletionResult()
    {
        return $this->last_completion_result;
    }

    public function hasLastCompletionResult()
    {
        return isset($this->last_completion_result);
    }

    public function clearLastCompletionResult()
    {
        unset($this->last_completion_result);
    }

    /**
     * TODO: Is this the result of *this* workflow as it continued-as-new?
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads last_completion_result = 11;</code>
     * @param \Temporal\Api\Common\V1\Payloads $var
     * @return $this
     */
    public function setLastCompletionResult($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\Payloads::class);
        $this->last_completion_result = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Header header = 12;</code>
     * @return \Temporal\Api\Common\V1\Header|null
     */
    public function getHeader()
    {
        return $this->header;
    }

    public function hasHeader()
    {
        return isset($this->header);
    }

    public function clearHeader()
    {
        unset($this->header);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Header header = 12;</code>
     * @param \Temporal\Api\Common\V1\Header $var
     * @return $this
     */
    public function setHeader($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\Header::class);
        $this->header = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Memo memo = 13;</code>
     * @return \Temporal\Api\Common\V1\Memo|null
     */
    public function getMemo()
    {
        return $this->memo;
    }

    public function hasMemo()
    {
        return isset($this->memo);
    }

    public function clearMemo()
    {
        unset($this->memo);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Memo memo = 13;</code>
     * @param \Temporal\Api\Common\V1\Memo $var
     * @return $this
     */
    public function setMemo($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\Memo::class);
        $this->memo = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.SearchAttributes search_attributes = 14;</code>
     * @return \Temporal\Api\Common\V1\SearchAttributes|null
     */
    public function getSearchAttributes()
    {
        return $this->search_attributes;
    }

    public function hasSearchAttributes()
    {
        return isset($this->search_attributes);
    }

    public function clearSearchAttributes()
    {
        unset($this->search_attributes);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.SearchAttributes search_attributes = 14;</code>
     * @param \Temporal\Api\Common\V1\SearchAttributes $var
     * @return $this
     */
    public function setSearchAttributes($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\SearchAttributes::class);
        $this->search_attributes = $var;

        return $this;
    }

    /**
     * If this is set, the new execution inherits the Build ID of the current execution. Otherwise,
     * the assignment rules will be used to independently assign a Build ID to the new execution.
     * Deprecated. Only considered for versioning v0.2.
     *
     * Generated from protobuf field <code>bool inherit_build_id = 15 [deprecated = true];</code>
     * @return bool
     * @deprecated
     */
    public function getInheritBuildId()
    {
        if ($this->inherit_build_id !== false) {
            @trigger_error('inherit_build_id is deprecated.', E_USER_DEPRECATED);
        }
        return $this->inherit_build_id;
    }

    /**
     * If this is set, the new execution inherits the Build ID of the current execution. Otherwise,
     * the assignment rules will be used to independently assign a Build ID to the new execution.
     * Deprecated. Only considered for versioning v0.2.
     *
     * Generated from protobuf field <code>bool inherit_build_id = 15 [deprecated = true];</code>
     * @param bool $var
     * @return $this
     * @deprecated
     */
    public function setInheritBuildId($var)
    {
        @trigger_error('inherit_build_id is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkBool($var);
        $this->inherit_build_id = $var;

        return $this;
    }

}

