<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: livekit_rtc.proto

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.LeaveRequest</code>
 */
class LeaveRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * sent when server initiates the disconnect due to server-restart
     * indicates clients should attempt full-reconnect sequence
     * NOTE: `can_reconnect` obsoleted by `action` starting in protocol version 13
     *
     * Generated from protobuf field <code>bool can_reconnect = 1;</code>
     */
    protected $can_reconnect = false;
    /**
     * Generated from protobuf field <code>.livekit.DisconnectReason reason = 2;</code>
     */
    protected $reason = 0;
    /**
     * Generated from protobuf field <code>.livekit.LeaveRequest.Action action = 3;</code>
     */
    protected $action = 0;
    /**
     * Generated from protobuf field <code>.livekit.RegionSettings regions = 4;</code>
     */
    protected $regions = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $can_reconnect
     *           sent when server initiates the disconnect due to server-restart
     *           indicates clients should attempt full-reconnect sequence
     *           NOTE: `can_reconnect` obsoleted by `action` starting in protocol version 13
     *     @type int $reason
     *     @type int $action
     *     @type \Livekit\RegionSettings $regions
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitRtc::initOnce();
        parent::__construct($data);
    }

    /**
     * sent when server initiates the disconnect due to server-restart
     * indicates clients should attempt full-reconnect sequence
     * NOTE: `can_reconnect` obsoleted by `action` starting in protocol version 13
     *
     * Generated from protobuf field <code>bool can_reconnect = 1;</code>
     * @return bool
     */
    public function getCanReconnect()
    {
        return $this->can_reconnect;
    }

    /**
     * sent when server initiates the disconnect due to server-restart
     * indicates clients should attempt full-reconnect sequence
     * NOTE: `can_reconnect` obsoleted by `action` starting in protocol version 13
     *
     * Generated from protobuf field <code>bool can_reconnect = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setCanReconnect($var)
    {
        GPBUtil::checkBool($var);
        $this->can_reconnect = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.DisconnectReason reason = 2;</code>
     * @return int
     */
    public function getReason()
    {
        return $this->reason;
    }

    /**
     * Generated from protobuf field <code>.livekit.DisconnectReason reason = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setReason($var)
    {
        GPBUtil::checkEnum($var, \Livekit\DisconnectReason::class);
        $this->reason = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.LeaveRequest.Action action = 3;</code>
     * @return int
     */
    public function getAction()
    {
        return $this->action;
    }

    /**
     * Generated from protobuf field <code>.livekit.LeaveRequest.Action action = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setAction($var)
    {
        GPBUtil::checkEnum($var, \Livekit\LeaveRequest\Action::class);
        $this->action = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.RegionSettings regions = 4;</code>
     * @return \Livekit\RegionSettings|null
     */
    public function getRegions()
    {
        return $this->regions;
    }

    public function hasRegions()
    {
        return isset($this->regions);
    }

    public function clearRegions()
    {
        unset($this->regions);
    }

    /**
     * Generated from protobuf field <code>.livekit.RegionSettings regions = 4;</code>
     * @param \Livekit\RegionSettings $var
     * @return $this
     */
    public function setRegions($var)
    {
        GPBUtil::checkMessage($var, \Livekit\RegionSettings::class);
        $this->regions = $var;

        return $this;
    }

}

