<?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.RespondWorkflowTaskCompletedResponse</code>
 */
class RespondWorkflowTaskCompletedResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * See `RespondWorkflowTaskCompletedResponse::return_new_workflow_task`
     *
     * Generated from protobuf field <code>.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse workflow_task = 1;</code>
     */
    protected $workflow_task = null;
    /**
     * See `ScheduleActivityTaskCommandAttributes::request_eager_execution`
     *
     * Generated from protobuf field <code>repeated .temporal.api.workflowservice.v1.PollActivityTaskQueueResponse activity_tasks = 2;</code>
     */
    private $activity_tasks;
    /**
     * If non zero, indicates the server has discarded the workflow task that was being responded to.
     * Will be the event ID of the last workflow task started event in the history before the new workflow task.
     * Server is only expected to discard a workflow task if it could not have modified the workflow state.
     *
     * Generated from protobuf field <code>int64 reset_history_event_id = 3;</code>
     */
    protected $reset_history_event_id = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Temporal\Api\Workflowservice\V1\PollWorkflowTaskQueueResponse $workflow_task
     *           See `RespondWorkflowTaskCompletedResponse::return_new_workflow_task`
     *     @type \Temporal\Api\Workflowservice\V1\PollActivityTaskQueueResponse[] $activity_tasks
     *           See `ScheduleActivityTaskCommandAttributes::request_eager_execution`
     *     @type int|string $reset_history_event_id
     *           If non zero, indicates the server has discarded the workflow task that was being responded to.
     *           Will be the event ID of the last workflow task started event in the history before the new workflow task.
     *           Server is only expected to discard a workflow task if it could not have modified the workflow state.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflowservice\V1\RequestResponse::initOnce();
        parent::__construct($data);
    }

    /**
     * See `RespondWorkflowTaskCompletedResponse::return_new_workflow_task`
     *
     * Generated from protobuf field <code>.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse workflow_task = 1;</code>
     * @return \Temporal\Api\Workflowservice\V1\PollWorkflowTaskQueueResponse|null
     */
    public function getWorkflowTask()
    {
        return $this->workflow_task;
    }

    public function hasWorkflowTask()
    {
        return isset($this->workflow_task);
    }

    public function clearWorkflowTask()
    {
        unset($this->workflow_task);
    }

    /**
     * See `RespondWorkflowTaskCompletedResponse::return_new_workflow_task`
     *
     * Generated from protobuf field <code>.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse workflow_task = 1;</code>
     * @param \Temporal\Api\Workflowservice\V1\PollWorkflowTaskQueueResponse $var
     * @return $this
     */
    public function setWorkflowTask($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Workflowservice\V1\PollWorkflowTaskQueueResponse::class);
        $this->workflow_task = $var;

        return $this;
    }

    /**
     * See `ScheduleActivityTaskCommandAttributes::request_eager_execution`
     *
     * Generated from protobuf field <code>repeated .temporal.api.workflowservice.v1.PollActivityTaskQueueResponse activity_tasks = 2;</code>
     * @return RepeatedField<\Temporal\Api\Workflowservice\V1\PollActivityTaskQueueResponse>
     */
    public function getActivityTasks()
    {
        return $this->activity_tasks;
    }

    /**
     * See `ScheduleActivityTaskCommandAttributes::request_eager_execution`
     *
     * Generated from protobuf field <code>repeated .temporal.api.workflowservice.v1.PollActivityTaskQueueResponse activity_tasks = 2;</code>
     * @param \Temporal\Api\Workflowservice\V1\PollActivityTaskQueueResponse[] $var
     * @return $this
     */
    public function setActivityTasks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Temporal\Api\Workflowservice\V1\PollActivityTaskQueueResponse::class);
        $this->activity_tasks = $arr;

        return $this;
    }

    /**
     * If non zero, indicates the server has discarded the workflow task that was being responded to.
     * Will be the event ID of the last workflow task started event in the history before the new workflow task.
     * Server is only expected to discard a workflow task if it could not have modified the workflow state.
     *
     * Generated from protobuf field <code>int64 reset_history_event_id = 3;</code>
     * @return int|string
     */
    public function getResetHistoryEventId()
    {
        return $this->reset_history_event_id;
    }

    /**
     * If non zero, indicates the server has discarded the workflow task that was being responded to.
     * Will be the event ID of the last workflow task started event in the history before the new workflow task.
     * Server is only expected to discard a workflow task if it could not have modified the workflow state.
     *
     * Generated from protobuf field <code>int64 reset_history_event_id = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setResetHistoryEventId($var)
    {
        GPBUtil::checkInt64($var);
        $this->reset_history_event_id = $var;

        return $this;
    }

}

