<?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.UpdateWorkflowExecutionResponse</code>
 */
class UpdateWorkflowExecutionResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Enough information for subsequent poll calls if needed. Never null.
     *
     * Generated from protobuf field <code>.temporal.api.update.v1.UpdateRef update_ref = 1;</code>
     */
    protected $update_ref = null;
    /**
     * The outcome of the Update if and only if the Workflow Update
     * has completed. If this response is being returned before the Update has
     * completed then this field will not be set.
     *
     * Generated from protobuf field <code>.temporal.api.update.v1.Outcome outcome = 2;</code>
     */
    protected $outcome = null;
    /**
     * The most advanced lifecycle stage that the Update is known to have
     * reached, where lifecycle stages are ordered
     * UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_UNSPECIFIED <
     * UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ADMITTED <
     * UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ACCEPTED <
     * UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED.
     * UNSPECIFIED will be returned if and only if the server's maximum wait
     * time was reached before the Update reached the stage specified in the
     * request WaitPolicy, and before the context deadline expired; clients may
     * may then retry the call as needed.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage stage = 3;</code>
     */
    protected $stage = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Temporal\Api\Update\V1\UpdateRef $update_ref
     *           Enough information for subsequent poll calls if needed. Never null.
     *     @type \Temporal\Api\Update\V1\Outcome $outcome
     *           The outcome of the Update if and only if the Workflow Update
     *           has completed. If this response is being returned before the Update has
     *           completed then this field will not be set.
     *     @type int $stage
     *           The most advanced lifecycle stage that the Update is known to have
     *           reached, where lifecycle stages are ordered
     *           UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_UNSPECIFIED <
     *           UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ADMITTED <
     *           UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ACCEPTED <
     *           UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED.
     *           UNSPECIFIED will be returned if and only if the server's maximum wait
     *           time was reached before the Update reached the stage specified in the
     *           request WaitPolicy, and before the context deadline expired; clients may
     *           may then retry the call as needed.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflowservice\V1\RequestResponse::initOnce();
        parent::__construct($data);
    }

    /**
     * Enough information for subsequent poll calls if needed. Never null.
     *
     * Generated from protobuf field <code>.temporal.api.update.v1.UpdateRef update_ref = 1;</code>
     * @return \Temporal\Api\Update\V1\UpdateRef|null
     */
    public function getUpdateRef()
    {
        return $this->update_ref;
    }

    public function hasUpdateRef()
    {
        return isset($this->update_ref);
    }

    public function clearUpdateRef()
    {
        unset($this->update_ref);
    }

    /**
     * Enough information for subsequent poll calls if needed. Never null.
     *
     * Generated from protobuf field <code>.temporal.api.update.v1.UpdateRef update_ref = 1;</code>
     * @param \Temporal\Api\Update\V1\UpdateRef $var
     * @return $this
     */
    public function setUpdateRef($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Update\V1\UpdateRef::class);
        $this->update_ref = $var;

        return $this;
    }

    /**
     * The outcome of the Update if and only if the Workflow Update
     * has completed. If this response is being returned before the Update has
     * completed then this field will not be set.
     *
     * Generated from protobuf field <code>.temporal.api.update.v1.Outcome outcome = 2;</code>
     * @return \Temporal\Api\Update\V1\Outcome|null
     */
    public function getOutcome()
    {
        return $this->outcome;
    }

    public function hasOutcome()
    {
        return isset($this->outcome);
    }

    public function clearOutcome()
    {
        unset($this->outcome);
    }

    /**
     * The outcome of the Update if and only if the Workflow Update
     * has completed. If this response is being returned before the Update has
     * completed then this field will not be set.
     *
     * Generated from protobuf field <code>.temporal.api.update.v1.Outcome outcome = 2;</code>
     * @param \Temporal\Api\Update\V1\Outcome $var
     * @return $this
     */
    public function setOutcome($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Update\V1\Outcome::class);
        $this->outcome = $var;

        return $this;
    }

    /**
     * The most advanced lifecycle stage that the Update is known to have
     * reached, where lifecycle stages are ordered
     * UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_UNSPECIFIED <
     * UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ADMITTED <
     * UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ACCEPTED <
     * UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED.
     * UNSPECIFIED will be returned if and only if the server's maximum wait
     * time was reached before the Update reached the stage specified in the
     * request WaitPolicy, and before the context deadline expired; clients may
     * may then retry the call as needed.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage stage = 3;</code>
     * @return int
     */
    public function getStage()
    {
        return $this->stage;
    }

    /**
     * The most advanced lifecycle stage that the Update is known to have
     * reached, where lifecycle stages are ordered
     * UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_UNSPECIFIED <
     * UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ADMITTED <
     * UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ACCEPTED <
     * UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED.
     * UNSPECIFIED will be returned if and only if the server's maximum wait
     * time was reached before the Update reached the stage specified in the
     * request WaitPolicy, and before the context deadline expired; clients may
     * may then retry the call as needed.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage stage = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setStage($var)
    {
        GPBUtil::checkEnum($var, \Temporal\Api\Enums\V1\UpdateWorkflowExecutionLifecycleStage::class);
        $this->stage = $var;

        return $this;
    }

}

