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

/**
 * Hold basic information about a workflow execution.
 * This structure is a part of visibility, and thus contain a limited subset of information.
 *
 * Generated from protobuf message <code>temporal.api.workflow.v1.WorkflowExecutionInfo</code>
 */
class WorkflowExecutionInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution execution = 1;</code>
     */
    protected $execution = null;
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowType type = 2;</code>
     */
    protected $type = null;
    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 3;</code>
     */
    protected $start_time = null;
    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp close_time = 4;</code>
     */
    protected $close_time = null;
    /**
     * Generated from protobuf field <code>.temporal.api.enums.v1.WorkflowExecutionStatus status = 5;</code>
     */
    protected $status = 0;
    /**
     * Generated from protobuf field <code>int64 history_length = 6;</code>
     */
    protected $history_length = 0;
    /**
     * Generated from protobuf field <code>string parent_namespace_id = 7;</code>
     */
    protected $parent_namespace_id = '';
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution parent_execution = 8;</code>
     */
    protected $parent_execution = null;
    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp execution_time = 9;</code>
     */
    protected $execution_time = null;
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Memo memo = 10;</code>
     */
    protected $memo = null;
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.SearchAttributes search_attributes = 11;</code>
     */
    protected $search_attributes = null;
    /**
     * Generated from protobuf field <code>.temporal.api.workflow.v1.ResetPoints auto_reset_points = 12;</code>
     */
    protected $auto_reset_points = null;
    /**
     * Generated from protobuf field <code>string task_queue = 13;</code>
     */
    protected $task_queue = '';
    /**
     * Generated from protobuf field <code>int64 state_transition_count = 14;</code>
     */
    protected $state_transition_count = 0;
    /**
     * Generated from protobuf field <code>int64 history_size_bytes = 15;</code>
     */
    protected $history_size_bytes = 0;
    /**
     * If set, the most recent worker version stamp that appeared in a workflow task completion
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkerVersionStamp most_recent_worker_version_stamp = 16 [deprecated = true];</code>
     * @deprecated
     */
    protected $most_recent_worker_version_stamp = null;
    /**
     * Workflow execution duration is defined as difference between close time and execution time.
     * This field is only populated if the workflow is closed.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration execution_duration = 17;</code>
     */
    protected $execution_duration = null;
    /**
     * Contains information about the root workflow execution.
     * The root workflow execution is defined as follows:
     * 1. A workflow without parent workflow is its own root workflow.
     * 2. A workflow that has a parent workflow has the same root workflow as its parent workflow.
     * Note: workflows continued as new or reseted may or may not have parents, check examples below.
     * Examples:
     *   Scenario 1: Workflow W1 starts child workflow W2, and W2 starts child workflow W3.
     *     - The root workflow of all three workflows is W1.
     *   Scenario 2: Workflow W1 starts child workflow W2, and W2 continued as new W3.
     *     - The root workflow of all three workflows is W1.
     *   Scenario 3: Workflow W1 continued as new W2.
     *     - The root workflow of W1 is W1 and the root workflow of W2 is W2.
     *   Scenario 4: Workflow W1 starts child workflow W2, and W2 is reseted, creating W3
     *     - The root workflow of all three workflows is W1.
     *   Scenario 5: Workflow W1 is reseted, creating W2.
     *     - The root workflow of W1 is W1 and the root workflow of W2 is W2.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution root_execution = 18;</code>
     */
    protected $root_execution = null;
    /**
     * The currently assigned build ID for this execution. Presence of this value means worker versioning is used
     * for this execution. Assigned build ID is selected based on Worker Versioning Assignment Rules
     * when the first workflow task of the execution is scheduled. If the first workflow task fails and is scheduled
     * again, the assigned build ID may change according to the latest versioning rules.
     * Assigned build ID can also change in the middle of a execution if Compatible Redirect Rules are applied to
     * this execution.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>string assigned_build_id = 19 [deprecated = true];</code>
     * @deprecated
     */
    protected $assigned_build_id = '';
    /**
     * Build ID inherited from a previous/parent execution. If present, assigned_build_id will be set to this, instead
     * of using the assignment rules.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>string inherited_build_id = 20 [deprecated = true];</code>
     * @deprecated
     */
    protected $inherited_build_id = '';
    /**
     * The first run ID in the execution chain.
     * Executions created via the following operations are considered to be in the same chain
     * - ContinueAsNew
     * - Workflow Retry
     * - Workflow Reset
     * - Cron Schedule
     *
     * Generated from protobuf field <code>string first_run_id = 21;</code>
     */
    protected $first_run_id = '';
    /**
     * Absent value means the workflow execution is not versioned. When present, the execution might
     * be versioned or unversioned, depending on `versioning_info.behavior` and `versioning_info.versioning_override`.
     * Experimental. Versioning info is experimental and might change in the future.
     *
     * Generated from protobuf field <code>.temporal.api.workflow.v1.WorkflowExecutionVersioningInfo versioning_info = 22;</code>
     */
    protected $versioning_info = null;
    /**
     * The name of Worker Deployment that completed the most recent workflow task.
     * Experimental. Worker Deployments are experimental and might change in the future.
     *
     * Generated from protobuf field <code>string worker_deployment_name = 23;</code>
     */
    protected $worker_deployment_name = '';
    /**
     * Priority metadata
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Priority priority = 24;</code>
     */
    protected $priority = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Temporal\Api\Common\V1\WorkflowExecution $execution
     *     @type \Temporal\Api\Common\V1\WorkflowType $type
     *     @type \Google\Protobuf\Timestamp $start_time
     *     @type \Google\Protobuf\Timestamp $close_time
     *     @type int $status
     *     @type int|string $history_length
     *     @type string $parent_namespace_id
     *     @type \Temporal\Api\Common\V1\WorkflowExecution $parent_execution
     *     @type \Google\Protobuf\Timestamp $execution_time
     *     @type \Temporal\Api\Common\V1\Memo $memo
     *     @type \Temporal\Api\Common\V1\SearchAttributes $search_attributes
     *     @type \Temporal\Api\Workflow\V1\ResetPoints $auto_reset_points
     *     @type string $task_queue
     *     @type int|string $state_transition_count
     *     @type int|string $history_size_bytes
     *     @type \Temporal\Api\Common\V1\WorkerVersionStamp $most_recent_worker_version_stamp
     *           If set, the most recent worker version stamp that appeared in a workflow task completion
     *           Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *     @type \Google\Protobuf\Duration $execution_duration
     *           Workflow execution duration is defined as difference between close time and execution time.
     *           This field is only populated if the workflow is closed.
     *     @type \Temporal\Api\Common\V1\WorkflowExecution $root_execution
     *           Contains information about the root workflow execution.
     *           The root workflow execution is defined as follows:
     *           1. A workflow without parent workflow is its own root workflow.
     *           2. A workflow that has a parent workflow has the same root workflow as its parent workflow.
     *           Note: workflows continued as new or reseted may or may not have parents, check examples below.
     *           Examples:
     *             Scenario 1: Workflow W1 starts child workflow W2, and W2 starts child workflow W3.
     *               - The root workflow of all three workflows is W1.
     *             Scenario 2: Workflow W1 starts child workflow W2, and W2 continued as new W3.
     *               - The root workflow of all three workflows is W1.
     *             Scenario 3: Workflow W1 continued as new W2.
     *               - The root workflow of W1 is W1 and the root workflow of W2 is W2.
     *             Scenario 4: Workflow W1 starts child workflow W2, and W2 is reseted, creating W3
     *               - The root workflow of all three workflows is W1.
     *             Scenario 5: Workflow W1 is reseted, creating W2.
     *               - The root workflow of W1 is W1 and the root workflow of W2 is W2.
     *     @type string $assigned_build_id
     *           The currently assigned build ID for this execution. Presence of this value means worker versioning is used
     *           for this execution. Assigned build ID is selected based on Worker Versioning Assignment Rules
     *           when the first workflow task of the execution is scheduled. If the first workflow task fails and is scheduled
     *           again, the assigned build ID may change according to the latest versioning rules.
     *           Assigned build ID can also change in the middle of a execution if Compatible Redirect Rules are applied to
     *           this execution.
     *           Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *     @type string $inherited_build_id
     *           Build ID inherited from a previous/parent execution. If present, assigned_build_id will be set to this, instead
     *           of using the assignment rules.
     *           Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *     @type string $first_run_id
     *           The first run ID in the execution chain.
     *           Executions created via the following operations are considered to be in the same chain
     *           - ContinueAsNew
     *           - Workflow Retry
     *           - Workflow Reset
     *           - Cron Schedule
     *     @type \Temporal\Api\Workflow\V1\WorkflowExecutionVersioningInfo $versioning_info
     *           Absent value means the workflow execution is not versioned. When present, the execution might
     *           be versioned or unversioned, depending on `versioning_info.behavior` and `versioning_info.versioning_override`.
     *           Experimental. Versioning info is experimental and might change in the future.
     *     @type string $worker_deployment_name
     *           The name of Worker Deployment that completed the most recent workflow task.
     *           Experimental. Worker Deployments are experimental and might change in the future.
     *     @type \Temporal\Api\Common\V1\Priority $priority
     *           Priority metadata
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflow\V1\Message::initOnce();
        parent::__construct($data);
    }

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

    public function hasExecution()
    {
        return isset($this->execution);
    }

    public function clearExecution()
    {
        unset($this->execution);
    }

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

        return $this;
    }

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

    public function hasType()
    {
        return isset($this->type);
    }

    public function clearType()
    {
        unset($this->type);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 3;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getStartTime()
    {
        return $this->start_time;
    }

    public function hasStartTime()
    {
        return isset($this->start_time);
    }

    public function clearStartTime()
    {
        unset($this->start_time);
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 3;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->start_time = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp close_time = 4;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCloseTime()
    {
        return $this->close_time;
    }

    public function hasCloseTime()
    {
        return isset($this->close_time);
    }

    public function clearCloseTime()
    {
        unset($this->close_time);
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp close_time = 4;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCloseTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->close_time = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.enums.v1.WorkflowExecutionStatus status = 5;</code>
     * @return int
     */
    public function getStatus()
    {
        return $this->status;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 history_length = 6;</code>
     * @return int|string
     */
    public function getHistoryLength()
    {
        return $this->history_length;
    }

    /**
     * Generated from protobuf field <code>int64 history_length = 6;</code>
     * @param int|string $var
     * @return $this
     */
    public function setHistoryLength($var)
    {
        GPBUtil::checkInt64($var);
        $this->history_length = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string parent_namespace_id = 7;</code>
     * @return string
     */
    public function getParentNamespaceId()
    {
        return $this->parent_namespace_id;
    }

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

        return $this;
    }

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

    public function hasParentExecution()
    {
        return isset($this->parent_execution);
    }

    public function clearParentExecution()
    {
        unset($this->parent_execution);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp execution_time = 9;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getExecutionTime()
    {
        return $this->execution_time;
    }

    public function hasExecutionTime()
    {
        return isset($this->execution_time);
    }

    public function clearExecutionTime()
    {
        unset($this->execution_time);
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp execution_time = 9;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setExecutionTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->execution_time = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Memo memo = 10;</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 = 10;</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 = 11;</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 = 11;</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;
    }

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

    public function hasAutoResetPoints()
    {
        return isset($this->auto_reset_points);
    }

    public function clearAutoResetPoints()
    {
        unset($this->auto_reset_points);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>string task_queue = 13;</code>
     * @return string
     */
    public function getTaskQueue()
    {
        return $this->task_queue;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 state_transition_count = 14;</code>
     * @return int|string
     */
    public function getStateTransitionCount()
    {
        return $this->state_transition_count;
    }

    /**
     * Generated from protobuf field <code>int64 state_transition_count = 14;</code>
     * @param int|string $var
     * @return $this
     */
    public function setStateTransitionCount($var)
    {
        GPBUtil::checkInt64($var);
        $this->state_transition_count = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 history_size_bytes = 15;</code>
     * @return int|string
     */
    public function getHistorySizeBytes()
    {
        return $this->history_size_bytes;
    }

    /**
     * Generated from protobuf field <code>int64 history_size_bytes = 15;</code>
     * @param int|string $var
     * @return $this
     */
    public function setHistorySizeBytes($var)
    {
        GPBUtil::checkInt64($var);
        $this->history_size_bytes = $var;

        return $this;
    }

    /**
     * If set, the most recent worker version stamp that appeared in a workflow task completion
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkerVersionStamp most_recent_worker_version_stamp = 16 [deprecated = true];</code>
     * @return \Temporal\Api\Common\V1\WorkerVersionStamp|null
     * @deprecated
     */
    public function getMostRecentWorkerVersionStamp()
    {
        if (isset($this->most_recent_worker_version_stamp)) {
            @trigger_error('most_recent_worker_version_stamp is deprecated.', E_USER_DEPRECATED);
        }
        return $this->most_recent_worker_version_stamp;
    }

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

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

    /**
     * If set, the most recent worker version stamp that appeared in a workflow task completion
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkerVersionStamp most_recent_worker_version_stamp = 16 [deprecated = true];</code>
     * @param \Temporal\Api\Common\V1\WorkerVersionStamp $var
     * @return $this
     * @deprecated
     */
    public function setMostRecentWorkerVersionStamp($var)
    {
        @trigger_error('most_recent_worker_version_stamp is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\WorkerVersionStamp::class);
        $this->most_recent_worker_version_stamp = $var;

        return $this;
    }

    /**
     * Workflow execution duration is defined as difference between close time and execution time.
     * This field is only populated if the workflow is closed.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration execution_duration = 17;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getExecutionDuration()
    {
        return $this->execution_duration;
    }

    public function hasExecutionDuration()
    {
        return isset($this->execution_duration);
    }

    public function clearExecutionDuration()
    {
        unset($this->execution_duration);
    }

    /**
     * Workflow execution duration is defined as difference between close time and execution time.
     * This field is only populated if the workflow is closed.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration execution_duration = 17;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setExecutionDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->execution_duration = $var;

        return $this;
    }

    /**
     * Contains information about the root workflow execution.
     * The root workflow execution is defined as follows:
     * 1. A workflow without parent workflow is its own root workflow.
     * 2. A workflow that has a parent workflow has the same root workflow as its parent workflow.
     * Note: workflows continued as new or reseted may or may not have parents, check examples below.
     * Examples:
     *   Scenario 1: Workflow W1 starts child workflow W2, and W2 starts child workflow W3.
     *     - The root workflow of all three workflows is W1.
     *   Scenario 2: Workflow W1 starts child workflow W2, and W2 continued as new W3.
     *     - The root workflow of all three workflows is W1.
     *   Scenario 3: Workflow W1 continued as new W2.
     *     - The root workflow of W1 is W1 and the root workflow of W2 is W2.
     *   Scenario 4: Workflow W1 starts child workflow W2, and W2 is reseted, creating W3
     *     - The root workflow of all three workflows is W1.
     *   Scenario 5: Workflow W1 is reseted, creating W2.
     *     - The root workflow of W1 is W1 and the root workflow of W2 is W2.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution root_execution = 18;</code>
     * @return \Temporal\Api\Common\V1\WorkflowExecution|null
     */
    public function getRootExecution()
    {
        return $this->root_execution;
    }

    public function hasRootExecution()
    {
        return isset($this->root_execution);
    }

    public function clearRootExecution()
    {
        unset($this->root_execution);
    }

    /**
     * Contains information about the root workflow execution.
     * The root workflow execution is defined as follows:
     * 1. A workflow without parent workflow is its own root workflow.
     * 2. A workflow that has a parent workflow has the same root workflow as its parent workflow.
     * Note: workflows continued as new or reseted may or may not have parents, check examples below.
     * Examples:
     *   Scenario 1: Workflow W1 starts child workflow W2, and W2 starts child workflow W3.
     *     - The root workflow of all three workflows is W1.
     *   Scenario 2: Workflow W1 starts child workflow W2, and W2 continued as new W3.
     *     - The root workflow of all three workflows is W1.
     *   Scenario 3: Workflow W1 continued as new W2.
     *     - The root workflow of W1 is W1 and the root workflow of W2 is W2.
     *   Scenario 4: Workflow W1 starts child workflow W2, and W2 is reseted, creating W3
     *     - The root workflow of all three workflows is W1.
     *   Scenario 5: Workflow W1 is reseted, creating W2.
     *     - The root workflow of W1 is W1 and the root workflow of W2 is W2.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution root_execution = 18;</code>
     * @param \Temporal\Api\Common\V1\WorkflowExecution $var
     * @return $this
     */
    public function setRootExecution($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\WorkflowExecution::class);
        $this->root_execution = $var;

        return $this;
    }

    /**
     * The currently assigned build ID for this execution. Presence of this value means worker versioning is used
     * for this execution. Assigned build ID is selected based on Worker Versioning Assignment Rules
     * when the first workflow task of the execution is scheduled. If the first workflow task fails and is scheduled
     * again, the assigned build ID may change according to the latest versioning rules.
     * Assigned build ID can also change in the middle of a execution if Compatible Redirect Rules are applied to
     * this execution.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>string assigned_build_id = 19 [deprecated = true];</code>
     * @return string
     * @deprecated
     */
    public function getAssignedBuildId()
    {
        if ($this->assigned_build_id !== '') {
            @trigger_error('assigned_build_id is deprecated.', E_USER_DEPRECATED);
        }
        return $this->assigned_build_id;
    }

    /**
     * The currently assigned build ID for this execution. Presence of this value means worker versioning is used
     * for this execution. Assigned build ID is selected based on Worker Versioning Assignment Rules
     * when the first workflow task of the execution is scheduled. If the first workflow task fails and is scheduled
     * again, the assigned build ID may change according to the latest versioning rules.
     * Assigned build ID can also change in the middle of a execution if Compatible Redirect Rules are applied to
     * this execution.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>string assigned_build_id = 19 [deprecated = true];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setAssignedBuildId($var)
    {
        @trigger_error('assigned_build_id is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, True);
        $this->assigned_build_id = $var;

        return $this;
    }

    /**
     * Build ID inherited from a previous/parent execution. If present, assigned_build_id will be set to this, instead
     * of using the assignment rules.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>string inherited_build_id = 20 [deprecated = true];</code>
     * @return string
     * @deprecated
     */
    public function getInheritedBuildId()
    {
        if ($this->inherited_build_id !== '') {
            @trigger_error('inherited_build_id is deprecated.', E_USER_DEPRECATED);
        }
        return $this->inherited_build_id;
    }

    /**
     * Build ID inherited from a previous/parent execution. If present, assigned_build_id will be set to this, instead
     * of using the assignment rules.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>string inherited_build_id = 20 [deprecated = true];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setInheritedBuildId($var)
    {
        @trigger_error('inherited_build_id is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, True);
        $this->inherited_build_id = $var;

        return $this;
    }

    /**
     * The first run ID in the execution chain.
     * Executions created via the following operations are considered to be in the same chain
     * - ContinueAsNew
     * - Workflow Retry
     * - Workflow Reset
     * - Cron Schedule
     *
     * Generated from protobuf field <code>string first_run_id = 21;</code>
     * @return string
     */
    public function getFirstRunId()
    {
        return $this->first_run_id;
    }

    /**
     * The first run ID in the execution chain.
     * Executions created via the following operations are considered to be in the same chain
     * - ContinueAsNew
     * - Workflow Retry
     * - Workflow Reset
     * - Cron Schedule
     *
     * Generated from protobuf field <code>string first_run_id = 21;</code>
     * @param string $var
     * @return $this
     */
    public function setFirstRunId($var)
    {
        GPBUtil::checkString($var, True);
        $this->first_run_id = $var;

        return $this;
    }

    /**
     * Absent value means the workflow execution is not versioned. When present, the execution might
     * be versioned or unversioned, depending on `versioning_info.behavior` and `versioning_info.versioning_override`.
     * Experimental. Versioning info is experimental and might change in the future.
     *
     * Generated from protobuf field <code>.temporal.api.workflow.v1.WorkflowExecutionVersioningInfo versioning_info = 22;</code>
     * @return \Temporal\Api\Workflow\V1\WorkflowExecutionVersioningInfo|null
     */
    public function getVersioningInfo()
    {
        return $this->versioning_info;
    }

    public function hasVersioningInfo()
    {
        return isset($this->versioning_info);
    }

    public function clearVersioningInfo()
    {
        unset($this->versioning_info);
    }

    /**
     * Absent value means the workflow execution is not versioned. When present, the execution might
     * be versioned or unversioned, depending on `versioning_info.behavior` and `versioning_info.versioning_override`.
     * Experimental. Versioning info is experimental and might change in the future.
     *
     * Generated from protobuf field <code>.temporal.api.workflow.v1.WorkflowExecutionVersioningInfo versioning_info = 22;</code>
     * @param \Temporal\Api\Workflow\V1\WorkflowExecutionVersioningInfo $var
     * @return $this
     */
    public function setVersioningInfo($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Workflow\V1\WorkflowExecutionVersioningInfo::class);
        $this->versioning_info = $var;

        return $this;
    }

    /**
     * The name of Worker Deployment that completed the most recent workflow task.
     * Experimental. Worker Deployments are experimental and might change in the future.
     *
     * Generated from protobuf field <code>string worker_deployment_name = 23;</code>
     * @return string
     */
    public function getWorkerDeploymentName()
    {
        return $this->worker_deployment_name;
    }

    /**
     * The name of Worker Deployment that completed the most recent workflow task.
     * Experimental. Worker Deployments are experimental and might change in the future.
     *
     * Generated from protobuf field <code>string worker_deployment_name = 23;</code>
     * @param string $var
     * @return $this
     */
    public function setWorkerDeploymentName($var)
    {
        GPBUtil::checkString($var, True);
        $this->worker_deployment_name = $var;

        return $this;
    }

    /**
     * Priority metadata
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Priority priority = 24;</code>
     * @return \Temporal\Api\Common\V1\Priority|null
     */
    public function getPriority()
    {
        return $this->priority;
    }

    public function hasPriority()
    {
        return isset($this->priority);
    }

    public function clearPriority()
    {
        unset($this->priority);
    }

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

        return $this;
    }

}

