<?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.ActivityTaskCompletedEventAttributes</code>
 */
class ActivityTaskCompletedEventAttributes extends \Google\Protobuf\Internal\Message
{
    /**
     * Serialized results of the activity. IE: The return value of the activity function
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads result = 1;</code>
     */
    protected $result = null;
    /**
     * The id of the `ACTIVITY_TASK_SCHEDULED` event this completion corresponds to
     *
     * Generated from protobuf field <code>int64 scheduled_event_id = 2;</code>
     */
    protected $scheduled_event_id = 0;
    /**
     * The id of the `ACTIVITY_TASK_STARTED` event this completion corresponds to
     *
     * Generated from protobuf field <code>int64 started_event_id = 3;</code>
     */
    protected $started_event_id = 0;
    /**
     * id of the worker that completed this task
     *
     * Generated from protobuf field <code>string identity = 4;</code>
     */
    protected $identity = '';
    /**
     * Version info of the worker who processed this workflow task.
     * 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 = 5 [deprecated = true];</code>
     * @deprecated
     */
    protected $worker_version = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Temporal\Api\Common\V1\Payloads $result
     *           Serialized results of the activity. IE: The return value of the activity function
     *     @type int|string $scheduled_event_id
     *           The id of the `ACTIVITY_TASK_SCHEDULED` event this completion corresponds to
     *     @type int|string $started_event_id
     *           The id of the `ACTIVITY_TASK_STARTED` event this completion corresponds to
     *     @type string $identity
     *           id of the worker that completed this task
     *     @type \Temporal\Api\Common\V1\WorkerVersionStamp $worker_version
     *           Version info of the worker who processed this workflow task.
     *           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);
    }

    /**
     * Serialized results of the activity. IE: The return value of the activity function
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads result = 1;</code>
     * @return \Temporal\Api\Common\V1\Payloads|null
     */
    public function getResult()
    {
        return $this->result;
    }

    public function hasResult()
    {
        return isset($this->result);
    }

    public function clearResult()
    {
        unset($this->result);
    }

    /**
     * Serialized results of the activity. IE: The return value of the activity function
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads result = 1;</code>
     * @param \Temporal\Api\Common\V1\Payloads $var
     * @return $this
     */
    public function setResult($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\Payloads::class);
        $this->result = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * The id of the `ACTIVITY_TASK_STARTED` event this completion corresponds to
     *
     * Generated from protobuf field <code>int64 started_event_id = 3;</code>
     * @return int|string
     */
    public function getStartedEventId()
    {
        return $this->started_event_id;
    }

    /**
     * The id of the `ACTIVITY_TASK_STARTED` event this completion corresponds to
     *
     * Generated from protobuf field <code>int64 started_event_id = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setStartedEventId($var)
    {
        GPBUtil::checkInt64($var);
        $this->started_event_id = $var;

        return $this;
    }

    /**
     * id of the worker that completed this task
     *
     * Generated from protobuf field <code>string identity = 4;</code>
     * @return string
     */
    public function getIdentity()
    {
        return $this->identity;
    }

    /**
     * id of the worker that completed this task
     *
     * Generated from protobuf field <code>string identity = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setIdentity($var)
    {
        GPBUtil::checkString($var, True);
        $this->identity = $var;

        return $this;
    }

    /**
     * Version info of the worker who processed this workflow task.
     * 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 = 5 [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 who processed this workflow task.
     * 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 = 5 [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;
    }

}

