<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: temporal/api/workflowservice/v1/request_response.proto

namespace Temporal\Api\Workflowservice\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Generated from protobuf message <code>temporal.api.workflowservice.v1.RequestCancelWorkflowExecutionRequest</code>
 */
class RequestCancelWorkflowExecutionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     */
    protected $namespace = '';
    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution workflow_execution = 2;</code>
     */
    protected $workflow_execution = null;
    /**
     * The identity of the worker/client
     *
     * Generated from protobuf field <code>string identity = 3;</code>
     */
    protected $identity = '';
    /**
     * Used to de-dupe cancellation requests
     *
     * Generated from protobuf field <code>string request_id = 4;</code>
     */
    protected $request_id = '';
    /**
     * If set, this call will error if the most recent (if no run id is set on
     * `workflow_execution`), or specified (if it is) workflow execution is not part of the same
     * execution chain as this id.
     *
     * Generated from protobuf field <code>string first_execution_run_id = 5;</code>
     */
    protected $first_execution_run_id = '';
    /**
     * Reason for requesting the cancellation
     *
     * Generated from protobuf field <code>string reason = 6;</code>
     */
    protected $reason = '';
    /**
     * Links to be associated with the WorkflowExecutionCanceled event.
     *
     * Generated from protobuf field <code>repeated .temporal.api.common.v1.Link links = 7;</code>
     */
    private $links;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $namespace
     *     @type \Temporal\Api\Common\V1\WorkflowExecution $workflow_execution
     *     @type string $identity
     *           The identity of the worker/client
     *     @type string $request_id
     *           Used to de-dupe cancellation requests
     *     @type string $first_execution_run_id
     *           If set, this call will error if the most recent (if no run id is set on
     *           `workflow_execution`), or specified (if it is) workflow execution is not part of the same
     *           execution chain as this id.
     *     @type string $reason
     *           Reason for requesting the cancellation
     *     @type \Temporal\Api\Common\V1\Link[] $links
     *           Links to be associated with the WorkflowExecutionCanceled event.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflowservice\V1\RequestResponse::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     * @return string
     */
    public function getNamespace()
    {
        return $this->namespace;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkflowExecution workflow_execution = 2;</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 = 2;</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;
    }

    /**
     * The identity of the worker/client
     *
     * Generated from protobuf field <code>string identity = 3;</code>
     * @return string
     */
    public function getIdentity()
    {
        return $this->identity;
    }

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

        return $this;
    }

    /**
     * Used to de-dupe cancellation requests
     *
     * Generated from protobuf field <code>string request_id = 4;</code>
     * @return string
     */
    public function getRequestId()
    {
        return $this->request_id;
    }

    /**
     * Used to de-dupe cancellation requests
     *
     * Generated from protobuf field <code>string request_id = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setRequestId($var)
    {
        GPBUtil::checkString($var, True);
        $this->request_id = $var;

        return $this;
    }

    /**
     * If set, this call will error if the most recent (if no run id is set on
     * `workflow_execution`), or specified (if it is) workflow execution is not part of the same
     * execution chain as this id.
     *
     * Generated from protobuf field <code>string first_execution_run_id = 5;</code>
     * @return string
     */
    public function getFirstExecutionRunId()
    {
        return $this->first_execution_run_id;
    }

    /**
     * If set, this call will error if the most recent (if no run id is set on
     * `workflow_execution`), or specified (if it is) workflow execution is not part of the same
     * execution chain as this id.
     *
     * Generated from protobuf field <code>string first_execution_run_id = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setFirstExecutionRunId($var)
    {
        GPBUtil::checkString($var, True);
        $this->first_execution_run_id = $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;
    }

    /**
     * Links to be associated with the WorkflowExecutionCanceled event.
     *
     * Generated from protobuf field <code>repeated .temporal.api.common.v1.Link links = 7;</code>
     * @return RepeatedField<\Temporal\Api\Common\V1\Link>
     */
    public function getLinks()
    {
        return $this->links;
    }

    /**
     * Links to be associated with the WorkflowExecutionCanceled event.
     *
     * Generated from protobuf field <code>repeated .temporal.api.common.v1.Link links = 7;</code>
     * @param \Temporal\Api\Common\V1\Link[] $var
     * @return $this
     */
    public function setLinks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Temporal\Api\Common\V1\Link::class);
        $this->links = $arr;

        return $this;
    }

}

