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

namespace RoadRunner\Temporal\DTO\V1;

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

/**
 * Single communication message.
 *
 * Generated from protobuf message <code>temporal.v1.Message</code>
 */
class Message extends \Google\Protobuf\Internal\Message
{
    /**
     * unique ID of the message (counter)
     *
     * Generated from protobuf field <code>uint64 id = 1;</code>
     */
    protected $id = 0;
    /**
     * command name (if any)
     *
     * Generated from protobuf field <code>string command = 2;</code>
     */
    protected $command = '';
    /**
     * command options in json format.
     *
     * Generated from protobuf field <code>bytes options = 3;</code>
     */
    protected $options = '';
    /**
     * error response.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 4;</code>
     */
    protected $failure = null;
    /**
     * invocation or result payloads.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads payloads = 5;</code>
     */
    protected $payloads = null;
    /**
     * invocation or result payloads.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Header header = 6;</code>
     */
    protected $header = null;
    /**
     * workflow history length
     *
     * Generated from protobuf field <code>int64 history_length = 7;</code>
     */
    protected $history_length = 0;
    /**
     * rr_run id
     *
     * Generated from protobuf field <code>string run_id = 8;</code>
     */
    protected $run_id = '';
    /**
     * task queue name
     *
     * Generated from protobuf field <code>string task_queue = 9;</code>
     */
    protected $task_queue = '';
    /**
     * tick time
     *
     * Generated from protobuf field <code>string tick_time = 10;</code>
     */
    protected $tick_time = '';
    /**
     * replay flag
     *
     * Generated from protobuf field <code>bool replay = 11;</code>
     */
    protected $replay = false;
    /**
     * continue as new flag
     *
     * Generated from protobuf field <code>bool continue_as_new_suggested = 12;</code>
     */
    protected $continue_as_new_suggested = false;
    /**
     * returns the current length of history when called.
     * This value may change throughout the life of the workflow.
     *
     * Generated from protobuf field <code>int64 history_size = 13;</code>
     */
    protected $history_size = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $id
     *           unique ID of the message (counter)
     *     @type string $command
     *           command name (if any)
     *     @type string $options
     *           command options in json format.
     *     @type \Temporal\Api\Failure\V1\Failure $failure
     *           error response.
     *     @type \Temporal\Api\Common\V1\Payloads $payloads
     *           invocation or result payloads.
     *     @type \Temporal\Api\Common\V1\Header $header
     *           invocation or result payloads.
     *     @type int|string $history_length
     *           workflow history length
     *     @type string $run_id
     *           rr_run id
     *     @type string $task_queue
     *           task queue name
     *     @type string $tick_time
     *           tick time
     *     @type bool $replay
     *           replay flag
     *     @type bool $continue_as_new_suggested
     *           continue as new flag
     *     @type int|string $history_size
     *           returns the current length of history when called.
     *           This value may change throughout the life of the workflow.
     * }
     */
    public function __construct($data = NULL) {
        \RoadRunner\Temporal\DTO\V1\GPBMetadata\Temporal::initOnce();
        parent::__construct($data);
    }

    /**
     * unique ID of the message (counter)
     *
     * Generated from protobuf field <code>uint64 id = 1;</code>
     * @return int|string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * unique ID of the message (counter)
     *
     * Generated from protobuf field <code>uint64 id = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkUint64($var);
        $this->id = $var;

        return $this;
    }

    /**
     * command name (if any)
     *
     * Generated from protobuf field <code>string command = 2;</code>
     * @return string
     */
    public function getCommand()
    {
        return $this->command;
    }

    /**
     * command name (if any)
     *
     * Generated from protobuf field <code>string command = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setCommand($var)
    {
        GPBUtil::checkString($var, True);
        $this->command = $var;

        return $this;
    }

    /**
     * command options in json format.
     *
     * Generated from protobuf field <code>bytes options = 3;</code>
     * @return string
     */
    public function getOptions()
    {
        return $this->options;
    }

    /**
     * command options in json format.
     *
     * Generated from protobuf field <code>bytes options = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setOptions($var)
    {
        GPBUtil::checkString($var, False);
        $this->options = $var;

        return $this;
    }

    /**
     * error response.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 4;</code>
     * @return \Temporal\Api\Failure\V1\Failure|null
     */
    public function getFailure()
    {
        return $this->failure;
    }

    public function hasFailure()
    {
        return isset($this->failure);
    }

    public function clearFailure()
    {
        unset($this->failure);
    }

    /**
     * error response.
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 4;</code>
     * @param \Temporal\Api\Failure\V1\Failure $var
     * @return $this
     */
    public function setFailure($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Failure\V1\Failure::class);
        $this->failure = $var;

        return $this;
    }

    /**
     * invocation or result payloads.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads payloads = 5;</code>
     * @return \Temporal\Api\Common\V1\Payloads|null
     */
    public function getPayloads()
    {
        return $this->payloads;
    }

    public function hasPayloads()
    {
        return isset($this->payloads);
    }

    public function clearPayloads()
    {
        unset($this->payloads);
    }

    /**
     * invocation or result payloads.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads payloads = 5;</code>
     * @param \Temporal\Api\Common\V1\Payloads $var
     * @return $this
     */
    public function setPayloads($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\Payloads::class);
        $this->payloads = $var;

        return $this;
    }

    /**
     * invocation or result payloads.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Header header = 6;</code>
     * @return \Temporal\Api\Common\V1\Header|null
     */
    public function getHeader()
    {
        return $this->header;
    }

    public function hasHeader()
    {
        return isset($this->header);
    }

    public function clearHeader()
    {
        unset($this->header);
    }

    /**
     * invocation or result payloads.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Header header = 6;</code>
     * @param \Temporal\Api\Common\V1\Header $var
     * @return $this
     */
    public function setHeader($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\Header::class);
        $this->header = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * rr_run id
     *
     * Generated from protobuf field <code>string run_id = 8;</code>
     * @return string
     */
    public function getRunId()
    {
        return $this->run_id;
    }

    /**
     * rr_run id
     *
     * Generated from protobuf field <code>string run_id = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setRunId($var)
    {
        GPBUtil::checkString($var, True);
        $this->run_id = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * tick time
     *
     * Generated from protobuf field <code>string tick_time = 10;</code>
     * @return string
     */
    public function getTickTime()
    {
        return $this->tick_time;
    }

    /**
     * tick time
     *
     * Generated from protobuf field <code>string tick_time = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setTickTime($var)
    {
        GPBUtil::checkString($var, True);
        $this->tick_time = $var;

        return $this;
    }

    /**
     * replay flag
     *
     * Generated from protobuf field <code>bool replay = 11;</code>
     * @return bool
     */
    public function getReplay()
    {
        return $this->replay;
    }

    /**
     * replay flag
     *
     * Generated from protobuf field <code>bool replay = 11;</code>
     * @param bool $var
     * @return $this
     */
    public function setReplay($var)
    {
        GPBUtil::checkBool($var);
        $this->replay = $var;

        return $this;
    }

    /**
     * continue as new flag
     *
     * Generated from protobuf field <code>bool continue_as_new_suggested = 12;</code>
     * @return bool
     */
    public function getContinueAsNewSuggested()
    {
        return $this->continue_as_new_suggested;
    }

    /**
     * continue as new flag
     *
     * Generated from protobuf field <code>bool continue_as_new_suggested = 12;</code>
     * @param bool $var
     * @return $this
     */
    public function setContinueAsNewSuggested($var)
    {
        GPBUtil::checkBool($var);
        $this->continue_as_new_suggested = $var;

        return $this;
    }

    /**
     * returns the current length of history when called.
     * This value may change throughout the life of the workflow.
     *
     * Generated from protobuf field <code>int64 history_size = 13;</code>
     * @return int|string
     */
    public function getHistorySize()
    {
        return $this->history_size;
    }

    /**
     * returns the current length of history when called.
     * This value may change throughout the life of the workflow.
     *
     * Generated from protobuf field <code>int64 history_size = 13;</code>
     * @param int|string $var
     * @return $this
     */
    public function setHistorySize($var)
    {
        GPBUtil::checkInt64($var);
        $this->history_size = $var;

        return $this;
    }

}

