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

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.StartSession</code>
 */
class StartSession extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string room_name = 1;</code>
     */
    protected $room_name = '';
    /**
     * Generated from protobuf field <code>string identity = 2;</code>
     */
    protected $identity = '';
    /**
     * Generated from protobuf field <code>string connection_id = 3;</code>
     */
    protected $connection_id = '';
    /**
     * if a client is reconnecting (i.e. resume instead of restart)
     *
     * Generated from protobuf field <code>bool reconnect = 4;</code>
     */
    protected $reconnect = false;
    /**
     * Generated from protobuf field <code>bool auto_subscribe = 9;</code>
     */
    protected $auto_subscribe = false;
    /**
     * Generated from protobuf field <code>bool hidden = 10 [deprecated = true];</code>
     * @deprecated
     */
    protected $hidden = false;
    /**
     * Generated from protobuf field <code>.livekit.ClientInfo client = 11;</code>
     */
    protected $client = null;
    /**
     * Generated from protobuf field <code>bool recorder = 12 [deprecated = true];</code>
     * @deprecated
     */
    protected $recorder = false;
    /**
     * Generated from protobuf field <code>string name = 13;</code>
     */
    protected $name = '';
    /**
     * A user's ClaimGrants serialized in JSON
     *
     * Generated from protobuf field <code>string grants_json = 14;</code>
     */
    protected $grants_json = '';
    /**
     * Generated from protobuf field <code>bool adaptive_stream = 15;</code>
     */
    protected $adaptive_stream = false;
    /**
     *if reconnect, client will set current sid
     *
     * Generated from protobuf field <code>string participant_id = 16;</code>
     */
    protected $participant_id = '';
    /**
     * Generated from protobuf field <code>.livekit.ReconnectReason reconnect_reason = 17;</code>
     */
    protected $reconnect_reason = 0;
    /**
     * Generated from protobuf field <code>optional bool subscriber_allow_pause = 18;</code>
     */
    protected $subscriber_allow_pause = null;
    /**
     * Generated from protobuf field <code>bool disable_ice_lite = 19;</code>
     */
    protected $disable_ice_lite = false;
    /**
     * Generated from protobuf field <code>.livekit.CreateRoomRequest create_room = 20;</code>
     */
    protected $create_room = null;
    /**
     * Generated from protobuf field <code>repeated .livekit.AddTrackRequest add_track_requests = 21;</code>
     */
    private $add_track_requests;
    /**
     * Generated from protobuf field <code>.livekit.SessionDescription publisher_offer = 22;</code>
     */
    protected $publisher_offer = null;
    /**
     * Generated from protobuf field <code>.livekit.SyncState sync_state = 23;</code>
     */
    protected $sync_state = null;
    /**
     * Generated from protobuf field <code>bool use_single_peer_connection = 24;</code>
     */
    protected $use_single_peer_connection = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $room_name
     *     @type string $identity
     *     @type string $connection_id
     *     @type bool $reconnect
     *           if a client is reconnecting (i.e. resume instead of restart)
     *     @type bool $auto_subscribe
     *     @type bool $hidden
     *     @type \Livekit\ClientInfo $client
     *     @type bool $recorder
     *     @type string $name
     *     @type string $grants_json
     *           A user's ClaimGrants serialized in JSON
     *     @type bool $adaptive_stream
     *     @type string $participant_id
     *          if reconnect, client will set current sid
     *     @type int $reconnect_reason
     *     @type bool $subscriber_allow_pause
     *     @type bool $disable_ice_lite
     *     @type \Livekit\CreateRoomRequest $create_room
     *     @type \Livekit\AddTrackRequest[] $add_track_requests
     *     @type \Livekit\SessionDescription $publisher_offer
     *     @type \Livekit\SyncState $sync_state
     *     @type bool $use_single_peer_connection
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitInternal::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>string identity = 2;</code>
     * @return string
     */
    public function getIdentity()
    {
        return $this->identity;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>string connection_id = 3;</code>
     * @return string
     */
    public function getConnectionId()
    {
        return $this->connection_id;
    }

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

        return $this;
    }

    /**
     * if a client is reconnecting (i.e. resume instead of restart)
     *
     * Generated from protobuf field <code>bool reconnect = 4;</code>
     * @return bool
     */
    public function getReconnect()
    {
        return $this->reconnect;
    }

    /**
     * if a client is reconnecting (i.e. resume instead of restart)
     *
     * Generated from protobuf field <code>bool reconnect = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setReconnect($var)
    {
        GPBUtil::checkBool($var);
        $this->reconnect = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool auto_subscribe = 9;</code>
     * @return bool
     */
    public function getAutoSubscribe()
    {
        return $this->auto_subscribe;
    }

    /**
     * Generated from protobuf field <code>bool auto_subscribe = 9;</code>
     * @param bool $var
     * @return $this
     */
    public function setAutoSubscribe($var)
    {
        GPBUtil::checkBool($var);
        $this->auto_subscribe = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool hidden = 10 [deprecated = true];</code>
     * @return bool
     * @deprecated
     */
    public function getHidden()
    {
        if ($this->hidden !== false) {
            @trigger_error('hidden is deprecated.', E_USER_DEPRECATED);
        }
        return $this->hidden;
    }

    /**
     * Generated from protobuf field <code>bool hidden = 10 [deprecated = true];</code>
     * @param bool $var
     * @return $this
     * @deprecated
     */
    public function setHidden($var)
    {
        @trigger_error('hidden is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkBool($var);
        $this->hidden = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.ClientInfo client = 11;</code>
     * @return \Livekit\ClientInfo|null
     */
    public function getClient()
    {
        return $this->client;
    }

    public function hasClient()
    {
        return isset($this->client);
    }

    public function clearClient()
    {
        unset($this->client);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool recorder = 12 [deprecated = true];</code>
     * @return bool
     * @deprecated
     */
    public function getRecorder()
    {
        if ($this->recorder !== false) {
            @trigger_error('recorder is deprecated.', E_USER_DEPRECATED);
        }
        return $this->recorder;
    }

    /**
     * Generated from protobuf field <code>bool recorder = 12 [deprecated = true];</code>
     * @param bool $var
     * @return $this
     * @deprecated
     */
    public function setRecorder($var)
    {
        @trigger_error('recorder is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkBool($var);
        $this->recorder = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string name = 13;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

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

        return $this;
    }

    /**
     * A user's ClaimGrants serialized in JSON
     *
     * Generated from protobuf field <code>string grants_json = 14;</code>
     * @return string
     */
    public function getGrantsJson()
    {
        return $this->grants_json;
    }

    /**
     * A user's ClaimGrants serialized in JSON
     *
     * Generated from protobuf field <code>string grants_json = 14;</code>
     * @param string $var
     * @return $this
     */
    public function setGrantsJson($var)
    {
        GPBUtil::checkString($var, True);
        $this->grants_json = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool adaptive_stream = 15;</code>
     * @return bool
     */
    public function getAdaptiveStream()
    {
        return $this->adaptive_stream;
    }

    /**
     * Generated from protobuf field <code>bool adaptive_stream = 15;</code>
     * @param bool $var
     * @return $this
     */
    public function setAdaptiveStream($var)
    {
        GPBUtil::checkBool($var);
        $this->adaptive_stream = $var;

        return $this;
    }

    /**
     *if reconnect, client will set current sid
     *
     * Generated from protobuf field <code>string participant_id = 16;</code>
     * @return string
     */
    public function getParticipantId()
    {
        return $this->participant_id;
    }

    /**
     *if reconnect, client will set current sid
     *
     * Generated from protobuf field <code>string participant_id = 16;</code>
     * @param string $var
     * @return $this
     */
    public function setParticipantId($var)
    {
        GPBUtil::checkString($var, True);
        $this->participant_id = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.ReconnectReason reconnect_reason = 17;</code>
     * @return int
     */
    public function getReconnectReason()
    {
        return $this->reconnect_reason;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional bool subscriber_allow_pause = 18;</code>
     * @return bool
     */
    public function getSubscriberAllowPause()
    {
        return isset($this->subscriber_allow_pause) ? $this->subscriber_allow_pause : false;
    }

    public function hasSubscriberAllowPause()
    {
        return isset($this->subscriber_allow_pause);
    }

    public function clearSubscriberAllowPause()
    {
        unset($this->subscriber_allow_pause);
    }

    /**
     * Generated from protobuf field <code>optional bool subscriber_allow_pause = 18;</code>
     * @param bool $var
     * @return $this
     */
    public function setSubscriberAllowPause($var)
    {
        GPBUtil::checkBool($var);
        $this->subscriber_allow_pause = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool disable_ice_lite = 19;</code>
     * @return bool
     */
    public function getDisableIceLite()
    {
        return $this->disable_ice_lite;
    }

    /**
     * Generated from protobuf field <code>bool disable_ice_lite = 19;</code>
     * @param bool $var
     * @return $this
     */
    public function setDisableIceLite($var)
    {
        GPBUtil::checkBool($var);
        $this->disable_ice_lite = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.CreateRoomRequest create_room = 20;</code>
     * @return \Livekit\CreateRoomRequest|null
     */
    public function getCreateRoom()
    {
        return $this->create_room;
    }

    public function hasCreateRoom()
    {
        return isset($this->create_room);
    }

    public function clearCreateRoom()
    {
        unset($this->create_room);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.AddTrackRequest add_track_requests = 21;</code>
     * @return RepeatedField<\Livekit\AddTrackRequest>
     */
    public function getAddTrackRequests()
    {
        return $this->add_track_requests;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.AddTrackRequest add_track_requests = 21;</code>
     * @param \Livekit\AddTrackRequest[] $var
     * @return $this
     */
    public function setAddTrackRequests($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Livekit\AddTrackRequest::class);
        $this->add_track_requests = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.SessionDescription publisher_offer = 22;</code>
     * @return \Livekit\SessionDescription|null
     */
    public function getPublisherOffer()
    {
        return $this->publisher_offer;
    }

    public function hasPublisherOffer()
    {
        return isset($this->publisher_offer);
    }

    public function clearPublisherOffer()
    {
        unset($this->publisher_offer);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.SyncState sync_state = 23;</code>
     * @return \Livekit\SyncState|null
     */
    public function getSyncState()
    {
        return $this->sync_state;
    }

    public function hasSyncState()
    {
        return isset($this->sync_state);
    }

    public function clearSyncState()
    {
        unset($this->sync_state);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool use_single_peer_connection = 24;</code>
     * @return bool
     */
    public function getUseSinglePeerConnection()
    {
        return $this->use_single_peer_connection;
    }

    /**
     * Generated from protobuf field <code>bool use_single_peer_connection = 24;</code>
     * @param bool $var
     * @return $this
     */
    public function setUseSinglePeerConnection($var)
    {
        GPBUtil::checkBool($var);
        $this->use_single_peer_connection = $var;

        return $this;
    }

}

