<?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.WorkflowExecutionCompletedEventAttributes</code>
 */
class WorkflowExecutionCompletedEventAttributes extends \Google\Protobuf\Internal\Message
{
    /**
     * Serialized result of workflow completion (ie: The return value of the workflow function)
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payloads result = 1;</code>
     */
    protected $result = null;
    /**
     * The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *
     * Generated from protobuf field <code>int64 workflow_task_completed_event_id = 2;</code>
     */
    protected $workflow_task_completed_event_id = 0;
    /**
     * If another run is started by cron, this contains the new run id.
     *
     * Generated from protobuf field <code>string new_execution_run_id = 3;</code>
     */
    protected $new_execution_run_id = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Temporal\Api\Common\V1\Payloads $result
     *           Serialized result of workflow completion (ie: The return value of the workflow function)
     *     @type int|string $workflow_task_completed_event_id
     *           The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *     @type string $new_execution_run_id
     *           If another run is started by cron, this contains the new run id.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\History\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Serialized result of workflow completion (ie: The return value of the workflow 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 result of workflow completion (ie: The return value of the workflow 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 `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *
     * Generated from protobuf field <code>int64 workflow_task_completed_event_id = 2;</code>
     * @return int|string
     */
    public function getWorkflowTaskCompletedEventId()
    {
        return $this->workflow_task_completed_event_id;
    }

    /**
     * The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *
     * Generated from protobuf field <code>int64 workflow_task_completed_event_id = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setWorkflowTaskCompletedEventId($var)
    {
        GPBUtil::checkInt64($var);
        $this->workflow_task_completed_event_id = $var;

        return $this;
    }

    /**
     * If another run is started by cron, this contains the new run id.
     *
     * Generated from protobuf field <code>string new_execution_run_id = 3;</code>
     * @return string
     */
    public function getNewExecutionRunId()
    {
        return $this->new_execution_run_id;
    }

    /**
     * If another run is started by cron, this contains the new run id.
     *
     * Generated from protobuf field <code>string new_execution_run_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setNewExecutionRunId($var)
    {
        GPBUtil::checkString($var, True);
        $this->new_execution_run_id = $var;

        return $this;
    }

}

