<?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.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes</code>
 */
class RequestCancelExternalWorkflowExecutionInitiatedEventAttributes extends \Google\Protobuf\Internal\Message
{
    /**
     * The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *
     * Generated from protobuf field <code>int64 workflow_task_completed_event_id = 1;</code>
     */
    protected $workflow_task_completed_event_id = 0;
    /**
     * The namespace the workflow to be cancelled lives in.
     * SDKs and UI tools should use `namespace` field but server must use `namespace_id` only.
     *
     * Generated from protobuf field <code>string namespace = 2;</code>
     */
    protected $namespace = '';
    /**
     * Generated from protobuf field <code>string namespace_id = 7;</code>
     */
    protected $namespace_id = '';
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution workflow_execution = 3;</code>
     */
    protected $workflow_execution = null;
    /**
     * Deprecated.
     *
     * Generated from protobuf field <code>string control = 4 [deprecated = true];</code>
     * @deprecated
     */
    protected $control = '';
    /**
     * Workers are expected to set this to true if the workflow they are requesting to cancel is
     * a child of the workflow which issued the request
     *
     * Generated from protobuf field <code>bool child_workflow_only = 5;</code>
     */
    protected $child_workflow_only = false;
    /**
     * Reason for requesting the cancellation
     *
     * Generated from protobuf field <code>string reason = 6;</code>
     */
    protected $reason = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $workflow_task_completed_event_id
     *           The `WORKFLOW_TASK_COMPLETED` event which this command was reported with
     *     @type string $namespace
     *           The namespace the workflow to be cancelled lives in.
     *           SDKs and UI tools should use `namespace` field but server must use `namespace_id` only.
     *     @type string $namespace_id
     *     @type \Temporal\Api\Common\V1\WorkflowExecution $workflow_execution
     *     @type string $control
     *           Deprecated.
     *     @type bool $child_workflow_only
     *           Workers are expected to set this to true if the workflow they are requesting to cancel is
     *           a child of the workflow which issued the request
     *     @type string $reason
     *           Reason for requesting the cancellation
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\History\V1\Message::initOnce();
        parent::__construct($data);
    }

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

        return $this;
    }

    /**
     * The namespace the workflow to be cancelled lives in.
     * SDKs and UI tools should use `namespace` field but server must use `namespace_id` only.
     *
     * Generated from protobuf field <code>string namespace = 2;</code>
     * @return string
     */
    public function getNamespace()
    {
        return $this->namespace;
    }

    /**
     * The namespace the workflow to be cancelled lives in.
     * SDKs and UI tools should use `namespace` field but server must use `namespace_id` only.
     *
     * Generated from protobuf field <code>string namespace = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setNamespace($var)
    {
        GPBUtil::checkString($var, True);
        $this->namespace = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string namespace_id = 7;</code>
     * @return string
     */
    public function getNamespaceId()
    {
        return $this->namespace_id;
    }

    /**
     * Generated from protobuf field <code>string namespace_id = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setNamespaceId($var)
    {
        GPBUtil::checkString($var, True);
        $this->namespace_id = $var;

        return $this;
    }

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

    public function hasWorkflowExecution()
    {
        return isset($this->workflow_execution);
    }

    public function clearWorkflowExecution()
    {
        unset($this->workflow_execution);
    }

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

        return $this;
    }

    /**
     * Deprecated.
     *
     * Generated from protobuf field <code>string control = 4 [deprecated = true];</code>
     * @return string
     * @deprecated
     */
    public function getControl()
    {
        if ($this->control !== '') {
            @trigger_error('control is deprecated.', E_USER_DEPRECATED);
        }
        return $this->control;
    }

    /**
     * Deprecated.
     *
     * Generated from protobuf field <code>string control = 4 [deprecated = true];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setControl($var)
    {
        @trigger_error('control is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, True);
        $this->control = $var;

        return $this;
    }

    /**
     * Workers are expected to set this to true if the workflow they are requesting to cancel is
     * a child of the workflow which issued the request
     *
     * Generated from protobuf field <code>bool child_workflow_only = 5;</code>
     * @return bool
     */
    public function getChildWorkflowOnly()
    {
        return $this->child_workflow_only;
    }

    /**
     * Workers are expected to set this to true if the workflow they are requesting to cancel is
     * a child of the workflow which issued the request
     *
     * Generated from protobuf field <code>bool child_workflow_only = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setChildWorkflowOnly($var)
    {
        GPBUtil::checkBool($var);
        $this->child_workflow_only = $var;

        return $this;
    }

    /**
     * Reason for requesting the cancellation
     *
     * Generated from protobuf field <code>string reason = 6;</code>
     * @return string
     */
    public function getReason()
    {
        return $this->reason;
    }

    /**
     * Reason for requesting the cancellation
     *
     * Generated from protobuf field <code>string reason = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setReason($var)
    {
        GPBUtil::checkString($var, True);
        $this->reason = $var;

        return $this;
    }

}

