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

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

/**
 * Generated from protobuf message <code>temporal.api.workflow.v1.PendingActivityInfo.PauseInfo</code>
 */
class PauseInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * The time when the activity was paused.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp pause_time = 1;</code>
     */
    protected $pause_time = null;
    protected $paused_by;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $pause_time
     *           The time when the activity was paused.
     *     @type \Temporal\Api\Workflow\V1\PendingActivityInfo\PauseInfo\Manual $manual
     *           activity was paused by the manual intervention
     *     @type \Temporal\Api\Workflow\V1\PendingActivityInfo\PauseInfo\Rule $rule
     *           activity was paused by the rule
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflow\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * The time when the activity was paused.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp pause_time = 1;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getPauseTime()
    {
        return $this->pause_time;
    }

    public function hasPauseTime()
    {
        return isset($this->pause_time);
    }

    public function clearPauseTime()
    {
        unset($this->pause_time);
    }

    /**
     * The time when the activity was paused.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp pause_time = 1;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setPauseTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->pause_time = $var;

        return $this;
    }

    /**
     * activity was paused by the manual intervention
     *
     * Generated from protobuf field <code>.temporal.api.workflow.v1.PendingActivityInfo.PauseInfo.Manual manual = 2;</code>
     * @return \Temporal\Api\Workflow\V1\PendingActivityInfo\PauseInfo\Manual|null
     */
    public function getManual()
    {
        return $this->readOneof(2);
    }

    public function hasManual()
    {
        return $this->hasOneof(2);
    }

    /**
     * activity was paused by the manual intervention
     *
     * Generated from protobuf field <code>.temporal.api.workflow.v1.PendingActivityInfo.PauseInfo.Manual manual = 2;</code>
     * @param \Temporal\Api\Workflow\V1\PendingActivityInfo\PauseInfo\Manual $var
     * @return $this
     */
    public function setManual($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Workflow\V1\PendingActivityInfo\PauseInfo\Manual::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * activity was paused by the rule
     *
     * Generated from protobuf field <code>.temporal.api.workflow.v1.PendingActivityInfo.PauseInfo.Rule rule = 4;</code>
     * @return \Temporal\Api\Workflow\V1\PendingActivityInfo\PauseInfo\Rule|null
     */
    public function getRule()
    {
        return $this->readOneof(4);
    }

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

    /**
     * activity was paused by the rule
     *
     * Generated from protobuf field <code>.temporal.api.workflow.v1.PendingActivityInfo.PauseInfo.Rule rule = 4;</code>
     * @param \Temporal\Api\Workflow\V1\PendingActivityInfo\PauseInfo\Rule $var
     * @return $this
     */
    public function setRule($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Workflow\V1\PendingActivityInfo\PauseInfo\Rule::class);
        $this->writeOneof(4, $var);

        return $this;
    }

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

}

