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

/**
 * Nexus operation completed successfully.
 *
 * Generated from protobuf message <code>temporal.api.history.v1.NexusOperationCompletedEventAttributes</code>
 */
class NexusOperationCompletedEventAttributes extends \Google\Protobuf\Internal\Message
{
    /**
     * The ID of the `NEXUS_OPERATION_SCHEDULED` event. Uniquely identifies this operation.
     *
     * Generated from protobuf field <code>int64 scheduled_event_id = 1;</code>
     */
    protected $scheduled_event_id = 0;
    /**
     * Serialized result of the Nexus operation. The response of the Nexus handler.
     * Delivered either via a completion callback or as a response to a synchronous operation.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payload result = 2;</code>
     */
    protected $result = null;
    /**
     * The request ID allocated at schedule time.
     *
     * Generated from protobuf field <code>string request_id = 3;</code>
     */
    protected $request_id = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $scheduled_event_id
     *           The ID of the `NEXUS_OPERATION_SCHEDULED` event. Uniquely identifies this operation.
     *     @type \Temporal\Api\Common\V1\Payload $result
     *           Serialized result of the Nexus operation. The response of the Nexus handler.
     *           Delivered either via a completion callback or as a response to a synchronous operation.
     *     @type string $request_id
     *           The request ID allocated at schedule time.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\History\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * The ID of the `NEXUS_OPERATION_SCHEDULED` event. Uniquely identifies this operation.
     *
     * 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 `NEXUS_OPERATION_SCHEDULED` event. Uniquely identifies this operation.
     *
     * 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;
    }

    /**
     * Serialized result of the Nexus operation. The response of the Nexus handler.
     * Delivered either via a completion callback or as a response to a synchronous operation.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payload result = 2;</code>
     * @return \Temporal\Api\Common\V1\Payload|null
     */
    public function getResult()
    {
        return $this->result;
    }

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

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

    /**
     * Serialized result of the Nexus operation. The response of the Nexus handler.
     * Delivered either via a completion callback or as a response to a synchronous operation.
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.Payload result = 2;</code>
     * @param \Temporal\Api\Common\V1\Payload $var
     * @return $this
     */
    public function setResult($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\Payload::class);
        $this->result = $var;

        return $this;
    }

    /**
     * The request ID allocated at schedule time.
     *
     * Generated from protobuf field <code>string request_id = 3;</code>
     * @return string
     */
    public function getRequestId()
    {
        return $this->request_id;
    }

    /**
     * The request ID allocated at schedule time.
     *
     * 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;
    }

}

