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

namespace Temporal\Api\Batch\V1;

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

/**
 * BatchOperationReset sends reset requests to batch workflows.
 * Keep the parameter in sync with temporal.api.workflowservice.v1.ResetWorkflowExecutionRequest.
 *
 * Generated from protobuf message <code>temporal.api.batch.v1.BatchOperationReset</code>
 */
class BatchOperationReset extends \Google\Protobuf\Internal\Message
{
    /**
     * The identity of the worker/client.
     *
     * Generated from protobuf field <code>string identity = 3;</code>
     */
    protected $identity = '';
    /**
     * Describes what to reset to and how. If set, `reset_type` and `reset_reapply_type` are ignored.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.ResetOptions options = 4;</code>
     */
    protected $options = null;
    /**
     * Deprecated. Use `options`.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.ResetType reset_type = 1 [deprecated = true];</code>
     * @deprecated
     */
    protected $reset_type = 0;
    /**
     * Deprecated. Use `options`.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 2 [deprecated = true];</code>
     * @deprecated
     */
    protected $reset_reapply_type = 0;
    /**
     * 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 = 5;</code>
     */
    private $post_reset_operations;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $identity
     *           The identity of the worker/client.
     *     @type \Temporal\Api\Common\V1\ResetOptions $options
     *           Describes what to reset to and how. If set, `reset_type` and `reset_reapply_type` are ignored.
     *     @type int $reset_type
     *           Deprecated. Use `options`.
     *     @type int $reset_reapply_type
     *           Deprecated. Use `options`.
     *     @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
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Batch\V1\Message::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

    /**
     * Describes what to reset to and how. If set, `reset_type` and `reset_reapply_type` are ignored.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.ResetOptions options = 4;</code>
     * @return \Temporal\Api\Common\V1\ResetOptions|null
     */
    public function getOptions()
    {
        return $this->options;
    }

    public function hasOptions()
    {
        return isset($this->options);
    }

    public function clearOptions()
    {
        unset($this->options);
    }

    /**
     * Describes what to reset to and how. If set, `reset_type` and `reset_reapply_type` are ignored.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.ResetOptions options = 4;</code>
     * @param \Temporal\Api\Common\V1\ResetOptions $var
     * @return $this
     */
    public function setOptions($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\ResetOptions::class);
        $this->options = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Deprecated. Use `options`.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 2 [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`.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 2 [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;
    }

    /**
     * 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 = 5;</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 = 5;</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;
    }

}

