<?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.WorkflowExecutionCancelRequestedEventAttributes</code>
 */
class WorkflowExecutionCancelRequestedEventAttributes extends \Google\Protobuf\Internal\Message
{
    /**
     * User provided reason for requesting cancellation
     * TODO: shall we create a new field with name "reason" and deprecate this one?
     *
     * Generated from protobuf field <code>string cause = 1;</code>
     */
    protected $cause = '';
    /**
     * TODO: Is this the ID of the event in the workflow which initiated this cancel, if there was one?
     *
     * Generated from protobuf field <code>int64 external_initiated_event_id = 2;</code>
     */
    protected $external_initiated_event_id = 0;
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution external_workflow_execution = 3;</code>
     */
    protected $external_workflow_execution = null;
    /**
     * id of the worker or client who requested this cancel
     *
     * Generated from protobuf field <code>string identity = 4;</code>
     */
    protected $identity = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $cause
     *           User provided reason for requesting cancellation
     *           TODO: shall we create a new field with name "reason" and deprecate this one?
     *     @type int|string $external_initiated_event_id
     *           TODO: Is this the ID of the event in the workflow which initiated this cancel, if there was one?
     *     @type \Temporal\Api\Common\V1\WorkflowExecution $external_workflow_execution
     *     @type string $identity
     *           id of the worker or client who requested this cancel
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\History\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * User provided reason for requesting cancellation
     * TODO: shall we create a new field with name "reason" and deprecate this one?
     *
     * Generated from protobuf field <code>string cause = 1;</code>
     * @return string
     */
    public function getCause()
    {
        return $this->cause;
    }

    /**
     * User provided reason for requesting cancellation
     * TODO: shall we create a new field with name "reason" and deprecate this one?
     *
     * Generated from protobuf field <code>string cause = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setCause($var)
    {
        GPBUtil::checkString($var, True);
        $this->cause = $var;

        return $this;
    }

    /**
     * TODO: Is this the ID of the event in the workflow which initiated this cancel, if there was one?
     *
     * Generated from protobuf field <code>int64 external_initiated_event_id = 2;</code>
     * @return int|string
     */
    public function getExternalInitiatedEventId()
    {
        return $this->external_initiated_event_id;
    }

    /**
     * TODO: Is this the ID of the event in the workflow which initiated this cancel, if there was one?
     *
     * Generated from protobuf field <code>int64 external_initiated_event_id = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setExternalInitiatedEventId($var)
    {
        GPBUtil::checkInt64($var);
        $this->external_initiated_event_id = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution external_workflow_execution = 3;</code>
     * @return \Temporal\Api\Common\V1\WorkflowExecution|null
     */
    public function getExternalWorkflowExecution()
    {
        return $this->external_workflow_execution;
    }

    public function hasExternalWorkflowExecution()
    {
        return isset($this->external_workflow_execution);
    }

    public function clearExternalWorkflowExecution()
    {
        unset($this->external_workflow_execution);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution external_workflow_execution = 3;</code>
     * @param \Temporal\Api\Common\V1\WorkflowExecution $var
     * @return $this
     */
    public function setExternalWorkflowExecution($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\WorkflowExecution::class);
        $this->external_workflow_execution = $var;

        return $this;
    }

    /**
     * id of the worker or client who requested this cancel
     *
     * Generated from protobuf field <code>string identity = 4;</code>
     * @return string
     */
    public function getIdentity()
    {
        return $this->identity;
    }

    /**
     * id of the worker or client who requested this cancel
     *
     * 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;
    }

}

