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

/**
 * NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities
 *
 * Generated from protobuf message <code>temporal.api.workflowservice.v1.ResetActivityRequest</code>
 */
class ResetActivityRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Namespace of the workflow which scheduled this activity.
     *
     * Generated from protobuf field <code>string namespace = 1;</code>
     */
    protected $namespace = '';
    /**
     * Execution info of the workflow which scheduled this activity
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution execution = 2;</code>
     */
    protected $execution = null;
    /**
     * The identity of the client who initiated this request.
     *
     * Generated from protobuf field <code>string identity = 3;</code>
     */
    protected $identity = '';
    /**
     * Indicates that activity should reset heartbeat details.
     * This flag will be applied only to the new instance of the activity.
     *
     * Generated from protobuf field <code>bool reset_heartbeat = 6;</code>
     */
    protected $reset_heartbeat = false;
    /**
     * If activity is paused, it will remain paused after reset
     *
     * Generated from protobuf field <code>bool keep_paused = 7;</code>
     */
    protected $keep_paused = false;
    /**
     * If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.
     * (unless it is paused and keep_paused is set)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration jitter = 8;</code>
     */
    protected $jitter = null;
    /**
     * If set, the activity options will be restored to the defaults.
     * Default options are then options activity was created with.
     * They are part of the first SCHEDULE event.
     *
     * Generated from protobuf field <code>bool restore_original_options = 9;</code>
     */
    protected $restore_original_options = false;
    protected $activity;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $namespace
     *           Namespace of the workflow which scheduled this activity.
     *     @type \Temporal\Api\Common\V1\WorkflowExecution $execution
     *           Execution info of the workflow which scheduled this activity
     *     @type string $identity
     *           The identity of the client who initiated this request.
     *     @type string $id
     *           Only activity with this ID will be reset.
     *     @type string $type
     *           Reset all running activities with of this type.
     *     @type bool $match_all
     *           Reset all running activities.
     *     @type bool $reset_heartbeat
     *           Indicates that activity should reset heartbeat details.
     *           This flag will be applied only to the new instance of the activity.
     *     @type bool $keep_paused
     *           If activity is paused, it will remain paused after reset
     *     @type \Google\Protobuf\Duration $jitter
     *           If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.
     *           (unless it is paused and keep_paused is set)
     *     @type bool $restore_original_options
     *           If set, the activity options will be restored to the defaults.
     *           Default options are then options activity was created with.
     *           They are part of the first SCHEDULE event.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflowservice\V1\RequestResponse::initOnce();
        parent::__construct($data);
    }

    /**
     * Namespace of the workflow which scheduled this activity.
     *
     * Generated from protobuf field <code>string namespace = 1;</code>
     * @return string
     */
    public function getNamespace()
    {
        return $this->namespace;
    }

    /**
     * Namespace of the workflow which scheduled this activity.
     *
     * 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;
    }

    /**
     * Execution info of the workflow which scheduled this activity
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution execution = 2;</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);
    }

    /**
     * Execution info of the workflow which scheduled this activity
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution execution = 2;</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;
    }

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

    /**
     * The identity of the client who initiated this request.
     *
     * 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;
    }

    /**
     * Only activity with this ID will be reset.
     *
     * Generated from protobuf field <code>string id = 4;</code>
     * @return string
     */
    public function getId()
    {
        return $this->readOneof(4);
    }

    public function hasId()
    {
        return $this->hasOneof(4);
    }

    /**
     * Only activity with this ID will be reset.
     *
     * Generated from protobuf field <code>string id = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Reset all running activities with of this type.
     *
     * Generated from protobuf field <code>string type = 5;</code>
     * @return string
     */
    public function getType()
    {
        return $this->readOneof(5);
    }

    public function hasType()
    {
        return $this->hasOneof(5);
    }

    /**
     * Reset all running activities with of this type.
     *
     * Generated from protobuf field <code>string type = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Reset all running activities.
     *
     * Generated from protobuf field <code>bool match_all = 10;</code>
     * @return bool
     */
    public function getMatchAll()
    {
        return $this->readOneof(10);
    }

    public function hasMatchAll()
    {
        return $this->hasOneof(10);
    }

    /**
     * Reset all running activities.
     *
     * Generated from protobuf field <code>bool match_all = 10;</code>
     * @param bool $var
     * @return $this
     */
    public function setMatchAll($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(10, $var);

        return $this;
    }

    /**
     * Indicates that activity should reset heartbeat details.
     * This flag will be applied only to the new instance of the activity.
     *
     * Generated from protobuf field <code>bool reset_heartbeat = 6;</code>
     * @return bool
     */
    public function getResetHeartbeat()
    {
        return $this->reset_heartbeat;
    }

    /**
     * Indicates that activity should reset heartbeat details.
     * This flag will be applied only to the new instance of the activity.
     *
     * Generated from protobuf field <code>bool reset_heartbeat = 6;</code>
     * @param bool $var
     * @return $this
     */
    public function setResetHeartbeat($var)
    {
        GPBUtil::checkBool($var);
        $this->reset_heartbeat = $var;

        return $this;
    }

    /**
     * If activity is paused, it will remain paused after reset
     *
     * Generated from protobuf field <code>bool keep_paused = 7;</code>
     * @return bool
     */
    public function getKeepPaused()
    {
        return $this->keep_paused;
    }

    /**
     * If activity is paused, it will remain paused after reset
     *
     * Generated from protobuf field <code>bool keep_paused = 7;</code>
     * @param bool $var
     * @return $this
     */
    public function setKeepPaused($var)
    {
        GPBUtil::checkBool($var);
        $this->keep_paused = $var;

        return $this;
    }

    /**
     * If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.
     * (unless it is paused and keep_paused is set)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration jitter = 8;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getJitter()
    {
        return $this->jitter;
    }

    public function hasJitter()
    {
        return isset($this->jitter);
    }

    public function clearJitter()
    {
        unset($this->jitter);
    }

    /**
     * If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.
     * (unless it is paused and keep_paused is set)
     *
     * Generated from protobuf field <code>.google.protobuf.Duration jitter = 8;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setJitter($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->jitter = $var;

        return $this;
    }

    /**
     * If set, the activity options will be restored to the defaults.
     * Default options are then options activity was created with.
     * They are part of the first SCHEDULE event.
     *
     * Generated from protobuf field <code>bool restore_original_options = 9;</code>
     * @return bool
     */
    public function getRestoreOriginalOptions()
    {
        return $this->restore_original_options;
    }

    /**
     * If set, the activity options will be restored to the defaults.
     * Default options are then options activity was created with.
     * They are part of the first SCHEDULE event.
     *
     * Generated from protobuf field <code>bool restore_original_options = 9;</code>
     * @param bool $var
     * @return $this
     */
    public function setRestoreOriginalOptions($var)
    {
        GPBUtil::checkBool($var);
        $this->restore_original_options = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getActivity()
    {
        return $this->whichOneof("activity");
    }

}

