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

namespace Temporal\Api\Update\V1;

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

/**
 * Specifies client's intent to wait for Update results.
 *
 * Generated from protobuf message <code>temporal.api.update.v1.WaitPolicy</code>
 */
class WaitPolicy extends \Google\Protobuf\Internal\Message
{
    /**
     * Indicates the Update lifecycle stage that the Update must reach before
     * API call is returned.
     * NOTE: This field works together with API call timeout which is limited by
     * server timeout (maximum wait time). If server timeout is expired before
     * user specified timeout, API call returns even if specified stage is not reached.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage lifecycle_stage = 1;</code>
     */
    protected $lifecycle_stage = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $lifecycle_stage
     *           Indicates the Update lifecycle stage that the Update must reach before
     *           API call is returned.
     *           NOTE: This field works together with API call timeout which is limited by
     *           server timeout (maximum wait time). If server timeout is expired before
     *           user specified timeout, API call returns even if specified stage is not reached.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Update\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Indicates the Update lifecycle stage that the Update must reach before
     * API call is returned.
     * NOTE: This field works together with API call timeout which is limited by
     * server timeout (maximum wait time). If server timeout is expired before
     * user specified timeout, API call returns even if specified stage is not reached.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage lifecycle_stage = 1;</code>
     * @return int
     */
    public function getLifecycleStage()
    {
        return $this->lifecycle_stage;
    }

    /**
     * Indicates the Update lifecycle stage that the Update must reach before
     * API call is returned.
     * NOTE: This field works together with API call timeout which is limited by
     * server timeout (maximum wait time). If server timeout is expired before
     * user specified timeout, API call returns even if specified stage is not reached.
     *
     * Generated from protobuf field <code>.temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage lifecycle_stage = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setLifecycleStage($var)
    {
        GPBUtil::checkEnum($var, \Temporal\Api\Enums\V1\UpdateWorkflowExecutionLifecycleStage::class);
        $this->lifecycle_stage = $var;

        return $this;
    }

}

