<?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.ResetWorkflowExecutionRequest</code>
 */
class ResetWorkflowExecutionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     */
    protected $namespace = '';
    /**
     * The workflow to reset. If this contains a run ID then the workflow will be reset back to the
     * provided event ID in that run. Otherwise it will be reset to the provided event ID in the
     * current run. In all cases the current run will be terminated and a new run started.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution workflow_execution = 2;</code>
     */
    protected $workflow_execution = null;
    /**
     * Generated from protobuf field <code>string reason = 3;</code>
     */
    protected $reason = '';
    /**
     * The id of a `WORKFLOW_TASK_COMPLETED`,`WORKFLOW_TASK_TIMED_OUT`, `WORKFLOW_TASK_FAILED`, or
     * `WORKFLOW_TASK_STARTED` event to reset to.
     *
     * Generated from protobuf field <code>int64 workflow_task_finish_event_id = 4;</code>
     */
    protected $workflow_task_finish_event_id = 0;
    /**
     * Used to de-dupe reset requests
     *
     * Generated from protobuf field <code>string request_id = 5;</code>
     */
    protected $request_id = '';
    /**
     * Deprecated. Use `options`.
     * Default: RESET_REAPPLY_TYPE_SIGNAL
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 6 [deprecated = true];</code>
     * @deprecated
     */
    protected $reset_reapply_type = 0;
    /**
     * Event types not to be reapplied
     *
     * Generated from protobuf field <code>repeated .temporal.api.enums.v1.ResetReapplyExcludeType reset_reapply_exclude_types = 7;</code>
     */
    private $reset_reapply_exclude_types;
    /**
     * Operations to perform after the workflow has been reset. These operations will be applied
     * to the *new* run of the workflow execution in the order they are provided.
     * All operations are applied to the workflow before the first new workflow task is generated
     *
     * Generated from protobuf field <code>repeated .temporal.api.workflow.v1.PostResetOperation post_reset_operations = 8;</code>
     */
    private $post_reset_operations;
    /**
     * The identity of the worker/client
     *
     * Generated from protobuf field <code>string identity = 9;</code>
     */
    protected $identity = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $namespace
     *     @type \Temporal\Api\Common\V1\WorkflowExecution $workflow_execution
     *           The workflow to reset. If this contains a run ID then the workflow will be reset back to the
     *           provided event ID in that run. Otherwise it will be reset to the provided event ID in the
     *           current run. In all cases the current run will be terminated and a new run started.
     *     @type string $reason
     *     @type int|string $workflow_task_finish_event_id
     *           The id of a `WORKFLOW_TASK_COMPLETED`,`WORKFLOW_TASK_TIMED_OUT`, `WORKFLOW_TASK_FAILED`, or
     *           `WORKFLOW_TASK_STARTED` event to reset to.
     *     @type string $request_id
     *           Used to de-dupe reset requests
     *     @type int $reset_reapply_type
     *           Deprecated. Use `options`.
     *           Default: RESET_REAPPLY_TYPE_SIGNAL
     *     @type int[] $reset_reapply_exclude_types
     *           Event types not to be reapplied
     *     @type \Temporal\Api\Workflow\V1\PostResetOperation[] $post_reset_operations
     *           Operations to perform after the workflow has been reset. These operations will be applied
     *           to the *new* run of the workflow execution in the order they are provided.
     *           All operations are applied to the workflow before the first new workflow task is generated
     *     @type string $identity
     *           The identity of the worker/client
     * }
     */
    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 workflow to reset. If this contains a run ID then the workflow will be reset back to the
     * provided event ID in that run. Otherwise it will be reset to the provided event ID in the
     * current run. In all cases the current run will be terminated and a new run started.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution workflow_execution = 2;</code>
     * @return \Temporal\Api\Common\V1\WorkflowExecution|null
     */
    public function getWorkflowExecution()
    {
        return $this->workflow_execution;
    }

    public function hasWorkflowExecution()
    {
        return isset($this->workflow_execution);
    }

    public function clearWorkflowExecution()
    {
        unset($this->workflow_execution);
    }

    /**
     * The workflow to reset. If this contains a run ID then the workflow will be reset back to the
     * provided event ID in that run. Otherwise it will be reset to the provided event ID in the
     * current run. In all cases the current run will be terminated and a new run started.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution workflow_execution = 2;</code>
     * @param \Temporal\Api\Common\V1\WorkflowExecution $var
     * @return $this
     */
    public function setWorkflowExecution($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\WorkflowExecution::class);
        $this->workflow_execution = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string reason = 3;</code>
     * @return string
     */
    public function getReason()
    {
        return $this->reason;
    }

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

        return $this;
    }

    /**
     * The id of a `WORKFLOW_TASK_COMPLETED`,`WORKFLOW_TASK_TIMED_OUT`, `WORKFLOW_TASK_FAILED`, or
     * `WORKFLOW_TASK_STARTED` event to reset to.
     *
     * Generated from protobuf field <code>int64 workflow_task_finish_event_id = 4;</code>
     * @return int|string
     */
    public function getWorkflowTaskFinishEventId()
    {
        return $this->workflow_task_finish_event_id;
    }

    /**
     * The id of a `WORKFLOW_TASK_COMPLETED`,`WORKFLOW_TASK_TIMED_OUT`, `WORKFLOW_TASK_FAILED`, or
     * `WORKFLOW_TASK_STARTED` event to reset to.
     *
     * Generated from protobuf field <code>int64 workflow_task_finish_event_id = 4;</code>
     * @param int|string $var
     * @return $this
     */
    public function setWorkflowTaskFinishEventId($var)
    {
        GPBUtil::checkInt64($var);
        $this->workflow_task_finish_event_id = $var;

        return $this;
    }

    /**
     * Used to de-dupe reset requests
     *
     * Generated from protobuf field <code>string request_id = 5;</code>
     * @return string
     */
    public function getRequestId()
    {
        return $this->request_id;
    }

    /**
     * Used to de-dupe reset requests
     *
     * Generated from protobuf field <code>string request_id = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setRequestId($var)
    {
        GPBUtil::checkString($var, True);
        $this->request_id = $var;

        return $this;
    }

    /**
     * Deprecated. Use `options`.
     * Default: RESET_REAPPLY_TYPE_SIGNAL
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 6 [deprecated = true];</code>
     * @return int
     * @deprecated
     */
    public function getResetReapplyType()
    {
        if ($this->reset_reapply_type !== 0) {
            @trigger_error('reset_reapply_type is deprecated.', E_USER_DEPRECATED);
        }
        return $this->reset_reapply_type;
    }

    /**
     * Deprecated. Use `options`.
     * Default: RESET_REAPPLY_TYPE_SIGNAL
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 6 [deprecated = true];</code>
     * @param int $var
     * @return $this
     * @deprecated
     */
    public function setResetReapplyType($var)
    {
        @trigger_error('reset_reapply_type is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkEnum($var, \Temporal\Api\Enums\V1\ResetReapplyType::class);
        $this->reset_reapply_type = $var;

        return $this;
    }

    /**
     * Event types not to be reapplied
     *
     * Generated from protobuf field <code>repeated .temporal.api.enums.v1.ResetReapplyExcludeType reset_reapply_exclude_types = 7;</code>
     * @return RepeatedField<int>
     */
    public function getResetReapplyExcludeTypes()
    {
        return $this->reset_reapply_exclude_types;
    }

    /**
     * Event types not to be reapplied
     *
     * Generated from protobuf field <code>repeated .temporal.api.enums.v1.ResetReapplyExcludeType reset_reapply_exclude_types = 7;</code>
     * @param int[] $var
     * @return $this
     */
    public function setResetReapplyExcludeTypes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Temporal\Api\Enums\V1\ResetReapplyExcludeType::class);
        $this->reset_reapply_exclude_types = $arr;

        return $this;
    }

    /**
     * Operations to perform after the workflow has been reset. These operations will be applied
     * to the *new* run of the workflow execution in the order they are provided.
     * All operations are applied to the workflow before the first new workflow task is generated
     *
     * Generated from protobuf field <code>repeated .temporal.api.workflow.v1.PostResetOperation post_reset_operations = 8;</code>
     * @return RepeatedField<\Temporal\Api\Workflow\V1\PostResetOperation>
     */
    public function getPostResetOperations()
    {
        return $this->post_reset_operations;
    }

    /**
     * Operations to perform after the workflow has been reset. These operations will be applied
     * to the *new* run of the workflow execution in the order they are provided.
     * All operations are applied to the workflow before the first new workflow task is generated
     *
     * Generated from protobuf field <code>repeated .temporal.api.workflow.v1.PostResetOperation post_reset_operations = 8;</code>
     * @param \Temporal\Api\Workflow\V1\PostResetOperation[] $var
     * @return $this
     */
    public function setPostResetOperations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Temporal\Api\Workflow\V1\PostResetOperation::class);
        $this->post_reset_operations = $arr;

        return $this;
    }

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

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

        return $this;
    }

}

