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

namespace Temporal\Api\History\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.history.v1.WorkflowTaskStartedEventAttributes</code>
 */
class WorkflowTaskStartedEventAttributes extends \Google\Protobuf\Internal\Message
{
    /**
     * The id of the `WORKFLOW_TASK_SCHEDULED` event this task corresponds to
     *
     * Generated from protobuf field <code>int64 scheduled_event_id = 1;</code>
     */
    protected $scheduled_event_id = 0;
    /**
     * Identity of the worker who picked up this task
     *
     * Generated from protobuf field <code>string identity = 2;</code>
     */
    protected $identity = '';
    /**
     * TODO: ? Appears unused?
     *
     * Generated from protobuf field <code>string request_id = 3;</code>
     */
    protected $request_id = '';
    /**
     * True if this workflow should continue-as-new soon because its history size (in
     * either event count or bytes) is getting large.
     *
     * Generated from protobuf field <code>bool suggest_continue_as_new = 4;</code>
     */
    protected $suggest_continue_as_new = false;
    /**
     * Total history size in bytes, which the workflow might use to decide when to
     * continue-as-new regardless of the suggestion. Note that history event count is
     * just the event id of this event, so we don't include it explicitly here.
     *
     * Generated from protobuf field <code>int64 history_size_bytes = 5;</code>
     */
    protected $history_size_bytes = 0;
    /**
     * Version info of the worker to whom this task was dispatched.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkerVersionStamp worker_version = 6 [deprecated = true];</code>
     * @deprecated
     */
    protected $worker_version = null;
    /**
     * Used by server internally to properly reapply build ID redirects to an execution
     * when rebuilding it from events.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>int64 build_id_redirect_counter = 7 [deprecated = true];</code>
     * @deprecated
     */
    protected $build_id_redirect_counter = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $scheduled_event_id
     *           The id of the `WORKFLOW_TASK_SCHEDULED` event this task corresponds to
     *     @type string $identity
     *           Identity of the worker who picked up this task
     *     @type string $request_id
     *           TODO: ? Appears unused?
     *     @type bool $suggest_continue_as_new
     *           True if this workflow should continue-as-new soon because its history size (in
     *           either event count or bytes) is getting large.
     *     @type int|string $history_size_bytes
     *           Total history size in bytes, which the workflow might use to decide when to
     *           continue-as-new regardless of the suggestion. Note that history event count is
     *           just the event id of this event, so we don't include it explicitly here.
     *     @type \Temporal\Api\Common\V1\WorkerVersionStamp $worker_version
     *           Version info of the worker to whom this task was dispatched.
     *           Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *     @type int|string $build_id_redirect_counter
     *           Used by server internally to properly reapply build ID redirects to an execution
     *           when rebuilding it from events.
     *           Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\History\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * The id of the `WORKFLOW_TASK_SCHEDULED` event this task corresponds to
     *
     * Generated from protobuf field <code>int64 scheduled_event_id = 1;</code>
     * @return int|string
     */
    public function getScheduledEventId()
    {
        return $this->scheduled_event_id;
    }

    /**
     * The id of the `WORKFLOW_TASK_SCHEDULED` event this task corresponds to
     *
     * Generated from protobuf field <code>int64 scheduled_event_id = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setScheduledEventId($var)
    {
        GPBUtil::checkInt64($var);
        $this->scheduled_event_id = $var;

        return $this;
    }

    /**
     * Identity of the worker who picked up this task
     *
     * Generated from protobuf field <code>string identity = 2;</code>
     * @return string
     */
    public function getIdentity()
    {
        return $this->identity;
    }

    /**
     * Identity of the worker who picked up this task
     *
     * Generated from protobuf field <code>string identity = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setIdentity($var)
    {
        GPBUtil::checkString($var, True);
        $this->identity = $var;

        return $this;
    }

    /**
     * TODO: ? Appears unused?
     *
     * Generated from protobuf field <code>string request_id = 3;</code>
     * @return string
     */
    public function getRequestId()
    {
        return $this->request_id;
    }

    /**
     * TODO: ? Appears unused?
     *
     * Generated from protobuf field <code>string request_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setRequestId($var)
    {
        GPBUtil::checkString($var, True);
        $this->request_id = $var;

        return $this;
    }

    /**
     * True if this workflow should continue-as-new soon because its history size (in
     * either event count or bytes) is getting large.
     *
     * Generated from protobuf field <code>bool suggest_continue_as_new = 4;</code>
     * @return bool
     */
    public function getSuggestContinueAsNew()
    {
        return $this->suggest_continue_as_new;
    }

    /**
     * True if this workflow should continue-as-new soon because its history size (in
     * either event count or bytes) is getting large.
     *
     * Generated from protobuf field <code>bool suggest_continue_as_new = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setSuggestContinueAsNew($var)
    {
        GPBUtil::checkBool($var);
        $this->suggest_continue_as_new = $var;

        return $this;
    }

    /**
     * Total history size in bytes, which the workflow might use to decide when to
     * continue-as-new regardless of the suggestion. Note that history event count is
     * just the event id of this event, so we don't include it explicitly here.
     *
     * Generated from protobuf field <code>int64 history_size_bytes = 5;</code>
     * @return int|string
     */
    public function getHistorySizeBytes()
    {
        return $this->history_size_bytes;
    }

    /**
     * Total history size in bytes, which the workflow might use to decide when to
     * continue-as-new regardless of the suggestion. Note that history event count is
     * just the event id of this event, so we don't include it explicitly here.
     *
     * Generated from protobuf field <code>int64 history_size_bytes = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setHistorySizeBytes($var)
    {
        GPBUtil::checkInt64($var);
        $this->history_size_bytes = $var;

        return $this;
    }

    /**
     * Version info of the worker to whom this task was dispatched.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkerVersionStamp worker_version = 6 [deprecated = true];</code>
     * @return \Temporal\Api\Common\V1\WorkerVersionStamp|null
     * @deprecated
     */
    public function getWorkerVersion()
    {
        if (isset($this->worker_version)) {
            @trigger_error('worker_version is deprecated.', E_USER_DEPRECATED);
        }
        return $this->worker_version;
    }

    public function hasWorkerVersion()
    {
        if (isset($this->worker_version)) {
            @trigger_error('worker_version is deprecated.', E_USER_DEPRECATED);
        }
        return isset($this->worker_version);
    }

    public function clearWorkerVersion()
    {
        @trigger_error('worker_version is deprecated.', E_USER_DEPRECATED);
        unset($this->worker_version);
    }

    /**
     * Version info of the worker to whom this task was dispatched.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkerVersionStamp worker_version = 6 [deprecated = true];</code>
     * @param \Temporal\Api\Common\V1\WorkerVersionStamp $var
     * @return $this
     * @deprecated
     */
    public function setWorkerVersion($var)
    {
        @trigger_error('worker_version is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\WorkerVersionStamp::class);
        $this->worker_version = $var;

        return $this;
    }

    /**
     * Used by server internally to properly reapply build ID redirects to an execution
     * when rebuilding it from events.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>int64 build_id_redirect_counter = 7 [deprecated = true];</code>
     * @return int|string
     * @deprecated
     */
    public function getBuildIdRedirectCounter()
    {
        if ($this->build_id_redirect_counter !== 0) {
            @trigger_error('build_id_redirect_counter is deprecated.', E_USER_DEPRECATED);
        }
        return $this->build_id_redirect_counter;
    }

    /**
     * Used by server internally to properly reapply build ID redirects to an execution
     * when rebuilding it from events.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>int64 build_id_redirect_counter = 7 [deprecated = true];</code>
     * @param int|string $var
     * @return $this
     * @deprecated
     */
    public function setBuildIdRedirectCounter($var)
    {
        @trigger_error('build_id_redirect_counter is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkInt64($var);
        $this->build_id_redirect_counter = $var;

        return $this;
    }

}

