<?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.SyncState</code>
 */
class SyncState extends \Google\Protobuf\Internal\Message
{
    /**
     * last subscribe/publish answer before reconnecting
     * subscribe answer if using dual peer connection
     * publish answer if using single peer connection
     *
     * Generated from protobuf field <code>.livekit.SessionDescription answer = 1;</code>
     */
    protected $answer = null;
    /**
     * Generated from protobuf field <code>.livekit.UpdateSubscription subscription = 2;</code>
     */
    protected $subscription = null;
    /**
     * Generated from protobuf field <code>repeated .livekit.TrackPublishedResponse publish_tracks = 3;</code>
     */
    private $publish_tracks;
    /**
     * Generated from protobuf field <code>repeated .livekit.DataChannelInfo data_channels = 4;</code>
     */
    private $data_channels;
    /**
     * last received server side offer/sent client side offer before reconnecting
     * received server side offer if using dual peer connection
     * sent client side offer if using single peer connection
     *
     * Generated from protobuf field <code>.livekit.SessionDescription offer = 5;</code>
     */
    protected $offer = null;
    /**
     * Generated from protobuf field <code>repeated string track_sids_disabled = 6;</code>
     */
    private $track_sids_disabled;
    /**
     * Generated from protobuf field <code>repeated .livekit.DataChannelReceiveState datachannel_receive_states = 7;</code>
     */
    private $datachannel_receive_states;
    /**
     * Generated from protobuf field <code>repeated .livekit.PublishDataTrackResponse publish_data_tracks = 8;</code>
     */
    private $publish_data_tracks;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Livekit\SessionDescription $answer
     *           last subscribe/publish answer before reconnecting
     *           subscribe answer if using dual peer connection
     *           publish answer if using single peer connection
     *     @type \Livekit\UpdateSubscription $subscription
     *     @type \Livekit\TrackPublishedResponse[] $publish_tracks
     *     @type \Livekit\DataChannelInfo[] $data_channels
     *     @type \Livekit\SessionDescription $offer
     *           last received server side offer/sent client side offer before reconnecting
     *           received server side offer if using dual peer connection
     *           sent client side offer if using single peer connection
     *     @type string[] $track_sids_disabled
     *     @type \Livekit\DataChannelReceiveState[] $datachannel_receive_states
     *     @type \Livekit\PublishDataTrackResponse[] $publish_data_tracks
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitRtc::initOnce();
        parent::__construct($data);
    }

    /**
     * last subscribe/publish answer before reconnecting
     * subscribe answer if using dual peer connection
     * publish answer if using single peer connection
     *
     * Generated from protobuf field <code>.livekit.SessionDescription answer = 1;</code>
     * @return \Livekit\SessionDescription|null
     */
    public function getAnswer()
    {
        return $this->answer;
    }

    public function hasAnswer()
    {
        return isset($this->answer);
    }

    public function clearAnswer()
    {
        unset($this->answer);
    }

    /**
     * last subscribe/publish answer before reconnecting
     * subscribe answer if using dual peer connection
     * publish answer if using single peer connection
     *
     * Generated from protobuf field <code>.livekit.SessionDescription answer = 1;</code>
     * @param \Livekit\SessionDescription $var
     * @return $this
     */
    public function setAnswer($var)
    {
        GPBUtil::checkMessage($var, \Livekit\SessionDescription::class);
        $this->answer = $var;

        return $this;
    }

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

    public function hasSubscription()
    {
        return isset($this->subscription);
    }

    public function clearSubscription()
    {
        unset($this->subscription);
    }

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.DataChannelInfo data_channels = 4;</code>
     * @return RepeatedField<\Livekit\DataChannelInfo>
     */
    public function getDataChannels()
    {
        return $this->data_channels;
    }

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

        return $this;
    }

    /**
     * last received server side offer/sent client side offer before reconnecting
     * received server side offer if using dual peer connection
     * sent client side offer if using single peer connection
     *
     * Generated from protobuf field <code>.livekit.SessionDescription offer = 5;</code>
     * @return \Livekit\SessionDescription|null
     */
    public function getOffer()
    {
        return $this->offer;
    }

    public function hasOffer()
    {
        return isset($this->offer);
    }

    public function clearOffer()
    {
        unset($this->offer);
    }

    /**
     * last received server side offer/sent client side offer before reconnecting
     * received server side offer if using dual peer connection
     * sent client side offer if using single peer connection
     *
     * Generated from protobuf field <code>.livekit.SessionDescription offer = 5;</code>
     * @param \Livekit\SessionDescription $var
     * @return $this
     */
    public function setOffer($var)
    {
        GPBUtil::checkMessage($var, \Livekit\SessionDescription::class);
        $this->offer = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated string track_sids_disabled = 6;</code>
     * @return RepeatedField<string>
     */
    public function getTrackSidsDisabled()
    {
        return $this->track_sids_disabled;
    }

    /**
     * Generated from protobuf field <code>repeated string track_sids_disabled = 6;</code>
     * @param string[] $var
     * @return $this
     */
    public function setTrackSidsDisabled($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->track_sids_disabled = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.DataChannelReceiveState datachannel_receive_states = 7;</code>
     * @return RepeatedField<\Livekit\DataChannelReceiveState>
     */
    public function getDatachannelReceiveStates()
    {
        return $this->datachannel_receive_states;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.PublishDataTrackResponse publish_data_tracks = 8;</code>
     * @return RepeatedField<\Livekit\PublishDataTrackResponse>
     */
    public function getPublishDataTracks()
    {
        return $this->publish_data_tracks;
    }

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

        return $this;
    }

}

