<?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.JoinResponse</code>
 */
class JoinResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.livekit.Room room = 1;</code>
     */
    protected $room = null;
    /**
     * Generated from protobuf field <code>.livekit.ParticipantInfo participant = 2;</code>
     */
    protected $participant = null;
    /**
     * Generated from protobuf field <code>repeated .livekit.ParticipantInfo other_participants = 3;</code>
     */
    private $other_participants;
    /**
     * deprecated. use server_info.version instead.
     *
     * Generated from protobuf field <code>string server_version = 4;</code>
     */
    protected $server_version = '';
    /**
     * Generated from protobuf field <code>repeated .livekit.ICEServer ice_servers = 5;</code>
     */
    private $ice_servers;
    /**
     * use subscriber as the primary PeerConnection
     *
     * Generated from protobuf field <code>bool subscriber_primary = 6;</code>
     */
    protected $subscriber_primary = false;
    /**
     * when the current server isn't available, return alternate url to retry connection
     * when this is set, the other fields will be largely empty
     *
     * Generated from protobuf field <code>string alternative_url = 7;</code>
     */
    protected $alternative_url = '';
    /**
     * Generated from protobuf field <code>.livekit.ClientConfiguration client_configuration = 8;</code>
     */
    protected $client_configuration = null;
    /**
     * deprecated. use server_info.region instead.
     *
     * Generated from protobuf field <code>string server_region = 9;</code>
     */
    protected $server_region = '';
    /**
     * Generated from protobuf field <code>int32 ping_timeout = 10;</code>
     */
    protected $ping_timeout = 0;
    /**
     * Generated from protobuf field <code>int32 ping_interval = 11;</code>
     */
    protected $ping_interval = 0;
    /**
     * Generated from protobuf field <code>.livekit.ServerInfo server_info = 12;</code>
     */
    protected $server_info = null;
    /**
     * Server-Injected-Frame byte trailer, used to identify unencrypted frames when e2ee is enabled
     *
     * Generated from protobuf field <code>bytes sif_trailer = 13;</code>
     */
    protected $sif_trailer = '';
    /**
     * Generated from protobuf field <code>repeated .livekit.Codec enabled_publish_codecs = 14;</code>
     */
    private $enabled_publish_codecs;
    /**
     * when set, client should attempt to establish publish peer connection when joining room to speed up publishing
     *
     * Generated from protobuf field <code>bool fast_publish = 15;</code>
     */
    protected $fast_publish = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Livekit\Room $room
     *     @type \Livekit\ParticipantInfo $participant
     *     @type \Livekit\ParticipantInfo[] $other_participants
     *     @type string $server_version
     *           deprecated. use server_info.version instead.
     *     @type \Livekit\ICEServer[] $ice_servers
     *     @type bool $subscriber_primary
     *           use subscriber as the primary PeerConnection
     *     @type string $alternative_url
     *           when the current server isn't available, return alternate url to retry connection
     *           when this is set, the other fields will be largely empty
     *     @type \Livekit\ClientConfiguration $client_configuration
     *     @type string $server_region
     *           deprecated. use server_info.region instead.
     *     @type int $ping_timeout
     *     @type int $ping_interval
     *     @type \Livekit\ServerInfo $server_info
     *     @type string $sif_trailer
     *           Server-Injected-Frame byte trailer, used to identify unencrypted frames when e2ee is enabled
     *     @type \Livekit\Codec[] $enabled_publish_codecs
     *     @type bool $fast_publish
     *           when set, client should attempt to establish publish peer connection when joining room to speed up publishing
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitRtc::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.livekit.Room room = 1;</code>
     * @return \Livekit\Room|null
     */
    public function getRoom()
    {
        return $this->room;
    }

    public function hasRoom()
    {
        return isset($this->room);
    }

    public function clearRoom()
    {
        unset($this->room);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.ParticipantInfo participant = 2;</code>
     * @return \Livekit\ParticipantInfo|null
     */
    public function getParticipant()
    {
        return $this->participant;
    }

    public function hasParticipant()
    {
        return isset($this->participant);
    }

    public function clearParticipant()
    {
        unset($this->participant);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.ParticipantInfo other_participants = 3;</code>
     * @return RepeatedField<\Livekit\ParticipantInfo>
     */
    public function getOtherParticipants()
    {
        return $this->other_participants;
    }

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

        return $this;
    }

    /**
     * deprecated. use server_info.version instead.
     *
     * Generated from protobuf field <code>string server_version = 4;</code>
     * @return string
     */
    public function getServerVersion()
    {
        return $this->server_version;
    }

    /**
     * deprecated. use server_info.version instead.
     *
     * Generated from protobuf field <code>string server_version = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setServerVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->server_version = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.ICEServer ice_servers = 5;</code>
     * @return RepeatedField<\Livekit\ICEServer>
     */
    public function getIceServers()
    {
        return $this->ice_servers;
    }

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

        return $this;
    }

    /**
     * use subscriber as the primary PeerConnection
     *
     * Generated from protobuf field <code>bool subscriber_primary = 6;</code>
     * @return bool
     */
    public function getSubscriberPrimary()
    {
        return $this->subscriber_primary;
    }

    /**
     * use subscriber as the primary PeerConnection
     *
     * Generated from protobuf field <code>bool subscriber_primary = 6;</code>
     * @param bool $var
     * @return $this
     */
    public function setSubscriberPrimary($var)
    {
        GPBUtil::checkBool($var);
        $this->subscriber_primary = $var;

        return $this;
    }

    /**
     * when the current server isn't available, return alternate url to retry connection
     * when this is set, the other fields will be largely empty
     *
     * Generated from protobuf field <code>string alternative_url = 7;</code>
     * @return string
     */
    public function getAlternativeUrl()
    {
        return $this->alternative_url;
    }

    /**
     * when the current server isn't available, return alternate url to retry connection
     * when this is set, the other fields will be largely empty
     *
     * Generated from protobuf field <code>string alternative_url = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setAlternativeUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->alternative_url = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.ClientConfiguration client_configuration = 8;</code>
     * @return \Livekit\ClientConfiguration|null
     */
    public function getClientConfiguration()
    {
        return $this->client_configuration;
    }

    public function hasClientConfiguration()
    {
        return isset($this->client_configuration);
    }

    public function clearClientConfiguration()
    {
        unset($this->client_configuration);
    }

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

        return $this;
    }

    /**
     * deprecated. use server_info.region instead.
     *
     * Generated from protobuf field <code>string server_region = 9;</code>
     * @return string
     */
    public function getServerRegion()
    {
        return $this->server_region;
    }

    /**
     * deprecated. use server_info.region instead.
     *
     * Generated from protobuf field <code>string server_region = 9;</code>
     * @param string $var
     * @return $this
     */
    public function setServerRegion($var)
    {
        GPBUtil::checkString($var, True);
        $this->server_region = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int32 ping_timeout = 10;</code>
     * @return int
     */
    public function getPingTimeout()
    {
        return $this->ping_timeout;
    }

    /**
     * Generated from protobuf field <code>int32 ping_timeout = 10;</code>
     * @param int $var
     * @return $this
     */
    public function setPingTimeout($var)
    {
        GPBUtil::checkInt32($var);
        $this->ping_timeout = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int32 ping_interval = 11;</code>
     * @return int
     */
    public function getPingInterval()
    {
        return $this->ping_interval;
    }

    /**
     * Generated from protobuf field <code>int32 ping_interval = 11;</code>
     * @param int $var
     * @return $this
     */
    public function setPingInterval($var)
    {
        GPBUtil::checkInt32($var);
        $this->ping_interval = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.ServerInfo server_info = 12;</code>
     * @return \Livekit\ServerInfo|null
     */
    public function getServerInfo()
    {
        return $this->server_info;
    }

    public function hasServerInfo()
    {
        return isset($this->server_info);
    }

    public function clearServerInfo()
    {
        unset($this->server_info);
    }

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

        return $this;
    }

    /**
     * Server-Injected-Frame byte trailer, used to identify unencrypted frames when e2ee is enabled
     *
     * Generated from protobuf field <code>bytes sif_trailer = 13;</code>
     * @return string
     */
    public function getSifTrailer()
    {
        return $this->sif_trailer;
    }

    /**
     * Server-Injected-Frame byte trailer, used to identify unencrypted frames when e2ee is enabled
     *
     * Generated from protobuf field <code>bytes sif_trailer = 13;</code>
     * @param string $var
     * @return $this
     */
    public function setSifTrailer($var)
    {
        GPBUtil::checkString($var, False);
        $this->sif_trailer = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.Codec enabled_publish_codecs = 14;</code>
     * @return RepeatedField<\Livekit\Codec>
     */
    public function getEnabledPublishCodecs()
    {
        return $this->enabled_publish_codecs;
    }

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

        return $this;
    }

    /**
     * when set, client should attempt to establish publish peer connection when joining room to speed up publishing
     *
     * Generated from protobuf field <code>bool fast_publish = 15;</code>
     * @return bool
     */
    public function getFastPublish()
    {
        return $this->fast_publish;
    }

    /**
     * when set, client should attempt to establish publish peer connection when joining room to speed up publishing
     *
     * Generated from protobuf field <code>bool fast_publish = 15;</code>
     * @param bool $var
     * @return $this
     */
    public function setFastPublish($var)
    {
        GPBUtil::checkBool($var);
        $this->fast_publish = $var;

        return $this;
    }

}

