<?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.JoinRequest</code>
 */
class JoinRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.livekit.ClientInfo client_info = 1;</code>
     */
    protected $client_info = null;
    /**
     * Generated from protobuf field <code>.livekit.ConnectionSettings connection_settings = 2;</code>
     */
    protected $connection_settings = null;
    /**
     * if not empty, will overwrite `metadata` in token
     *
     * Generated from protobuf field <code>string metadata = 3 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     */
    protected $metadata = '';
    /**
     * will set keys provided via this
     * will overwrite if the same key is in the token
     * will not delete keys from token if there is a key collision and this sets that key to empty value
     *
     * Generated from protobuf field <code>map<string, string> participant_attributes = 4 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     */
    private $participant_attributes;
    /**
     * Generated from protobuf field <code>repeated .livekit.AddTrackRequest add_track_requests = 5;</code>
     */
    private $add_track_requests;
    /**
     * Generated from protobuf field <code>.livekit.SessionDescription publisher_offer = 6;</code>
     */
    protected $publisher_offer = null;
    /**
     * Generated from protobuf field <code>bool reconnect = 7;</code>
     */
    protected $reconnect = false;
    /**
     * Generated from protobuf field <code>.livekit.ReconnectReason reconnect_reason = 8;</code>
     */
    protected $reconnect_reason = 0;
    /**
     * Generated from protobuf field <code>string participant_sid = 9;</code>
     */
    protected $participant_sid = '';
    /**
     * Generated from protobuf field <code>.livekit.SyncState sync_state = 10;</code>
     */
    protected $sync_state = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Livekit\ClientInfo $client_info
     *     @type \Livekit\ConnectionSettings $connection_settings
     *     @type string $metadata
     *           if not empty, will overwrite `metadata` in token
     *     @type array|\Google\Protobuf\Internal\MapField $participant_attributes
     *           will set keys provided via this
     *           will overwrite if the same key is in the token
     *           will not delete keys from token if there is a key collision and this sets that key to empty value
     *     @type \Livekit\AddTrackRequest[] $add_track_requests
     *     @type \Livekit\SessionDescription $publisher_offer
     *     @type bool $reconnect
     *     @type int $reconnect_reason
     *     @type string $participant_sid
     *     @type \Livekit\SyncState $sync_state
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitRtc::initOnce();
        parent::__construct($data);
    }

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

    public function hasClientInfo()
    {
        return isset($this->client_info);
    }

    public function clearClientInfo()
    {
        unset($this->client_info);
    }

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

        return $this;
    }

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

    public function hasConnectionSettings()
    {
        return isset($this->connection_settings);
    }

    public function clearConnectionSettings()
    {
        unset($this->connection_settings);
    }

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

        return $this;
    }

    /**
     * if not empty, will overwrite `metadata` in token
     *
     * Generated from protobuf field <code>string metadata = 3 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     * @return string
     */
    public function getMetadata()
    {
        return $this->metadata;
    }

    /**
     * if not empty, will overwrite `metadata` in token
     *
     * Generated from protobuf field <code>string metadata = 3 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     * @param string $var
     * @return $this
     */
    public function setMetadata($var)
    {
        GPBUtil::checkString($var, True);
        $this->metadata = $var;

        return $this;
    }

    /**
     * will set keys provided via this
     * will overwrite if the same key is in the token
     * will not delete keys from token if there is a key collision and this sets that key to empty value
     *
     * Generated from protobuf field <code>map<string, string> participant_attributes = 4 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getParticipantAttributes()
    {
        return $this->participant_attributes;
    }

    /**
     * will set keys provided via this
     * will overwrite if the same key is in the token
     * will not delete keys from token if there is a key collision and this sets that key to empty value
     *
     * Generated from protobuf field <code>map<string, string> participant_attributes = 4 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setParticipantAttributes($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->participant_attributes = $arr;

        return $this;
    }

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

    /**
     * Generated from protobuf field <code>repeated .livekit.AddTrackRequest add_track_requests = 5;</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 = 6;</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 = 6;</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>bool reconnect = 7;</code>
     * @return bool
     */
    public function getReconnect()
    {
        return $this->reconnect;
    }

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

        return $this;
    }

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

    /**
     * Generated from protobuf field <code>.livekit.ReconnectReason reconnect_reason = 8;</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>string participant_sid = 9;</code>
     * @return string
     */
    public function getParticipantSid()
    {
        return $this->participant_sid;
    }

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

        return $this;
    }

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

        return $this;
    }

}

