<?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.SignalRequest</code>
 */
class SignalRequest extends \Google\Protobuf\Internal\Message
{
    protected $message;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Livekit\SessionDescription $offer
     *           participant offer for publisher
     *     @type \Livekit\SessionDescription $answer
     *           participant answering subscriber offer
     *     @type \Livekit\TrickleRequest $trickle
     *     @type \Livekit\AddTrackRequest $add_track
     *     @type \Livekit\MuteTrackRequest $mute
     *           mute the participant's published tracks
     *     @type \Livekit\UpdateSubscription $subscription
     *           Subscribe or unsubscribe from tracks
     *     @type \Livekit\UpdateTrackSettings $track_setting
     *           Update settings of subscribed tracks
     *     @type \Livekit\LeaveRequest $leave
     *           Immediately terminate session
     *     @type \Livekit\UpdateVideoLayers $update_layers
     *           Update published video layers
     *     @type \Livekit\SubscriptionPermission $subscription_permission
     *           Update subscriber permissions
     *     @type \Livekit\SyncState $sync_state
     *           sync client's subscribe state to server during reconnect
     *     @type \Livekit\SimulateScenario $simulate
     *           Simulate conditions, for client validations
     *     @type int|string $ping
     *           client triggered ping to server
     *     @type \Livekit\UpdateParticipantMetadata $update_metadata
     *           update a participant's own metadata, name, or attributes
     *           requires canUpdateOwnParticipantMetadata permission
     *     @type \Livekit\Ping $ping_req
     *     @type \Livekit\UpdateLocalAudioTrack $update_audio_track
     *           Update local audio track settings
     *     @type \Livekit\UpdateLocalVideoTrack $update_video_track
     *           Update local video track settings
     *     @type \Livekit\PublishDataTrackRequest $publish_data_track_request
     *           Publish a data track
     *     @type \Livekit\UnpublishDataTrackRequest $unpublish_data_track_request
     *           Unpublish a data track
     *     @type \Livekit\UpdateDataSubscription $update_data_subscription
     *           Update subscription state for one or more data tracks
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitRtc::initOnce();
        parent::__construct($data);
    }

    /**
     * participant offer for publisher
     *
     * Generated from protobuf field <code>.livekit.SessionDescription offer = 1;</code>
     * @return \Livekit\SessionDescription|null
     */
    public function getOffer()
    {
        return $this->readOneof(1);
    }

    public function hasOffer()
    {
        return $this->hasOneof(1);
    }

    /**
     * participant offer for publisher
     *
     * Generated from protobuf field <code>.livekit.SessionDescription offer = 1;</code>
     * @param \Livekit\SessionDescription $var
     * @return $this
     */
    public function setOffer($var)
    {
        GPBUtil::checkMessage($var, \Livekit\SessionDescription::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * participant answering subscriber offer
     *
     * Generated from protobuf field <code>.livekit.SessionDescription answer = 2;</code>
     * @return \Livekit\SessionDescription|null
     */
    public function getAnswer()
    {
        return $this->readOneof(2);
    }

    public function hasAnswer()
    {
        return $this->hasOneof(2);
    }

    /**
     * participant answering subscriber offer
     *
     * Generated from protobuf field <code>.livekit.SessionDescription answer = 2;</code>
     * @param \Livekit\SessionDescription $var
     * @return $this
     */
    public function setAnswer($var)
    {
        GPBUtil::checkMessage($var, \Livekit\SessionDescription::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.TrickleRequest trickle = 3;</code>
     * @return \Livekit\TrickleRequest|null
     */
    public function getTrickle()
    {
        return $this->readOneof(3);
    }

    public function hasTrickle()
    {
        return $this->hasOneof(3);
    }

    /**
     * Generated from protobuf field <code>.livekit.TrickleRequest trickle = 3;</code>
     * @param \Livekit\TrickleRequest $var
     * @return $this
     */
    public function setTrickle($var)
    {
        GPBUtil::checkMessage($var, \Livekit\TrickleRequest::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

    public function hasAddTrack()
    {
        return $this->hasOneof(4);
    }

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

        return $this;
    }

    /**
     * mute the participant's published tracks
     *
     * Generated from protobuf field <code>.livekit.MuteTrackRequest mute = 5;</code>
     * @return \Livekit\MuteTrackRequest|null
     */
    public function getMute()
    {
        return $this->readOneof(5);
    }

    public function hasMute()
    {
        return $this->hasOneof(5);
    }

    /**
     * mute the participant's published tracks
     *
     * Generated from protobuf field <code>.livekit.MuteTrackRequest mute = 5;</code>
     * @param \Livekit\MuteTrackRequest $var
     * @return $this
     */
    public function setMute($var)
    {
        GPBUtil::checkMessage($var, \Livekit\MuteTrackRequest::class);
        $this->writeOneof(5, $var);

        return $this;
    }

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

    public function hasSubscription()
    {
        return $this->hasOneof(6);
    }

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

        return $this;
    }

    /**
     * Update settings of subscribed tracks
     *
     * Generated from protobuf field <code>.livekit.UpdateTrackSettings track_setting = 7;</code>
     * @return \Livekit\UpdateTrackSettings|null
     */
    public function getTrackSetting()
    {
        return $this->readOneof(7);
    }

    public function hasTrackSetting()
    {
        return $this->hasOneof(7);
    }

    /**
     * Update settings of subscribed tracks
     *
     * Generated from protobuf field <code>.livekit.UpdateTrackSettings track_setting = 7;</code>
     * @param \Livekit\UpdateTrackSettings $var
     * @return $this
     */
    public function setTrackSetting($var)
    {
        GPBUtil::checkMessage($var, \Livekit\UpdateTrackSettings::class);
        $this->writeOneof(7, $var);

        return $this;
    }

    /**
     * Immediately terminate session
     *
     * Generated from protobuf field <code>.livekit.LeaveRequest leave = 8;</code>
     * @return \Livekit\LeaveRequest|null
     */
    public function getLeave()
    {
        return $this->readOneof(8);
    }

    public function hasLeave()
    {
        return $this->hasOneof(8);
    }

    /**
     * Immediately terminate session
     *
     * Generated from protobuf field <code>.livekit.LeaveRequest leave = 8;</code>
     * @param \Livekit\LeaveRequest $var
     * @return $this
     */
    public function setLeave($var)
    {
        GPBUtil::checkMessage($var, \Livekit\LeaveRequest::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * Update published video layers
     *
     * Generated from protobuf field <code>.livekit.UpdateVideoLayers update_layers = 10 [deprecated = true];</code>
     * @return \Livekit\UpdateVideoLayers|null
     * @deprecated
     */
    public function getUpdateLayers()
    {
        if ($this->hasOneof(10)) {
            @trigger_error('update_layers is deprecated.', E_USER_DEPRECATED);
        }
        return $this->readOneof(10);
    }

    public function hasUpdateLayers()
    {
        if ($this->hasOneof(10)) {
            @trigger_error('update_layers is deprecated.', E_USER_DEPRECATED);
        }
        return $this->hasOneof(10);
    }

    /**
     * Update published video layers
     *
     * Generated from protobuf field <code>.livekit.UpdateVideoLayers update_layers = 10 [deprecated = true];</code>
     * @param \Livekit\UpdateVideoLayers $var
     * @return $this
     * @deprecated
     */
    public function setUpdateLayers($var)
    {
        @trigger_error('update_layers is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkMessage($var, \Livekit\UpdateVideoLayers::class);
        $this->writeOneof(10, $var);

        return $this;
    }

    /**
     * Update subscriber permissions
     *
     * Generated from protobuf field <code>.livekit.SubscriptionPermission subscription_permission = 11;</code>
     * @return \Livekit\SubscriptionPermission|null
     */
    public function getSubscriptionPermission()
    {
        return $this->readOneof(11);
    }

    public function hasSubscriptionPermission()
    {
        return $this->hasOneof(11);
    }

    /**
     * Update subscriber permissions
     *
     * Generated from protobuf field <code>.livekit.SubscriptionPermission subscription_permission = 11;</code>
     * @param \Livekit\SubscriptionPermission $var
     * @return $this
     */
    public function setSubscriptionPermission($var)
    {
        GPBUtil::checkMessage($var, \Livekit\SubscriptionPermission::class);
        $this->writeOneof(11, $var);

        return $this;
    }

    /**
     * sync client's subscribe state to server during reconnect
     *
     * Generated from protobuf field <code>.livekit.SyncState sync_state = 12;</code>
     * @return \Livekit\SyncState|null
     */
    public function getSyncState()
    {
        return $this->readOneof(12);
    }

    public function hasSyncState()
    {
        return $this->hasOneof(12);
    }

    /**
     * sync client's subscribe state to server during reconnect
     *
     * Generated from protobuf field <code>.livekit.SyncState sync_state = 12;</code>
     * @param \Livekit\SyncState $var
     * @return $this
     */
    public function setSyncState($var)
    {
        GPBUtil::checkMessage($var, \Livekit\SyncState::class);
        $this->writeOneof(12, $var);

        return $this;
    }

    /**
     * Simulate conditions, for client validations
     *
     * Generated from protobuf field <code>.livekit.SimulateScenario simulate = 13;</code>
     * @return \Livekit\SimulateScenario|null
     */
    public function getSimulate()
    {
        return $this->readOneof(13);
    }

    public function hasSimulate()
    {
        return $this->hasOneof(13);
    }

    /**
     * Simulate conditions, for client validations
     *
     * Generated from protobuf field <code>.livekit.SimulateScenario simulate = 13;</code>
     * @param \Livekit\SimulateScenario $var
     * @return $this
     */
    public function setSimulate($var)
    {
        GPBUtil::checkMessage($var, \Livekit\SimulateScenario::class);
        $this->writeOneof(13, $var);

        return $this;
    }

    /**
     * client triggered ping to server
     *
     * Generated from protobuf field <code>int64 ping = 14;</code>
     * @return int|string
     */
    public function getPing()
    {
        return $this->readOneof(14);
    }

    public function hasPing()
    {
        return $this->hasOneof(14);
    }

    /**
     * client triggered ping to server
     *
     * Generated from protobuf field <code>int64 ping = 14;</code>
     * @param int|string $var
     * @return $this
     */
    public function setPing($var)
    {
        GPBUtil::checkInt64($var);
        $this->writeOneof(14, $var);

        return $this;
    }

    /**
     * update a participant's own metadata, name, or attributes
     * requires canUpdateOwnParticipantMetadata permission
     *
     * Generated from protobuf field <code>.livekit.UpdateParticipantMetadata update_metadata = 15;</code>
     * @return \Livekit\UpdateParticipantMetadata|null
     */
    public function getUpdateMetadata()
    {
        return $this->readOneof(15);
    }

    public function hasUpdateMetadata()
    {
        return $this->hasOneof(15);
    }

    /**
     * update a participant's own metadata, name, or attributes
     * requires canUpdateOwnParticipantMetadata permission
     *
     * Generated from protobuf field <code>.livekit.UpdateParticipantMetadata update_metadata = 15;</code>
     * @param \Livekit\UpdateParticipantMetadata $var
     * @return $this
     */
    public function setUpdateMetadata($var)
    {
        GPBUtil::checkMessage($var, \Livekit\UpdateParticipantMetadata::class);
        $this->writeOneof(15, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.Ping ping_req = 16;</code>
     * @return \Livekit\Ping|null
     */
    public function getPingReq()
    {
        return $this->readOneof(16);
    }

    public function hasPingReq()
    {
        return $this->hasOneof(16);
    }

    /**
     * Generated from protobuf field <code>.livekit.Ping ping_req = 16;</code>
     * @param \Livekit\Ping $var
     * @return $this
     */
    public function setPingReq($var)
    {
        GPBUtil::checkMessage($var, \Livekit\Ping::class);
        $this->writeOneof(16, $var);

        return $this;
    }

    /**
     * Update local audio track settings
     *
     * Generated from protobuf field <code>.livekit.UpdateLocalAudioTrack update_audio_track = 17;</code>
     * @return \Livekit\UpdateLocalAudioTrack|null
     */
    public function getUpdateAudioTrack()
    {
        return $this->readOneof(17);
    }

    public function hasUpdateAudioTrack()
    {
        return $this->hasOneof(17);
    }

    /**
     * Update local audio track settings
     *
     * Generated from protobuf field <code>.livekit.UpdateLocalAudioTrack update_audio_track = 17;</code>
     * @param \Livekit\UpdateLocalAudioTrack $var
     * @return $this
     */
    public function setUpdateAudioTrack($var)
    {
        GPBUtil::checkMessage($var, \Livekit\UpdateLocalAudioTrack::class);
        $this->writeOneof(17, $var);

        return $this;
    }

    /**
     * Update local video track settings
     *
     * Generated from protobuf field <code>.livekit.UpdateLocalVideoTrack update_video_track = 18;</code>
     * @return \Livekit\UpdateLocalVideoTrack|null
     */
    public function getUpdateVideoTrack()
    {
        return $this->readOneof(18);
    }

    public function hasUpdateVideoTrack()
    {
        return $this->hasOneof(18);
    }

    /**
     * Update local video track settings
     *
     * Generated from protobuf field <code>.livekit.UpdateLocalVideoTrack update_video_track = 18;</code>
     * @param \Livekit\UpdateLocalVideoTrack $var
     * @return $this
     */
    public function setUpdateVideoTrack($var)
    {
        GPBUtil::checkMessage($var, \Livekit\UpdateLocalVideoTrack::class);
        $this->writeOneof(18, $var);

        return $this;
    }

    /**
     * Publish a data track
     *
     * Generated from protobuf field <code>.livekit.PublishDataTrackRequest publish_data_track_request = 19;</code>
     * @return \Livekit\PublishDataTrackRequest|null
     */
    public function getPublishDataTrackRequest()
    {
        return $this->readOneof(19);
    }

    public function hasPublishDataTrackRequest()
    {
        return $this->hasOneof(19);
    }

    /**
     * Publish a data track
     *
     * Generated from protobuf field <code>.livekit.PublishDataTrackRequest publish_data_track_request = 19;</code>
     * @param \Livekit\PublishDataTrackRequest $var
     * @return $this
     */
    public function setPublishDataTrackRequest($var)
    {
        GPBUtil::checkMessage($var, \Livekit\PublishDataTrackRequest::class);
        $this->writeOneof(19, $var);

        return $this;
    }

    /**
     * Unpublish a data track
     *
     * Generated from protobuf field <code>.livekit.UnpublishDataTrackRequest unpublish_data_track_request = 20;</code>
     * @return \Livekit\UnpublishDataTrackRequest|null
     */
    public function getUnpublishDataTrackRequest()
    {
        return $this->readOneof(20);
    }

    public function hasUnpublishDataTrackRequest()
    {
        return $this->hasOneof(20);
    }

    /**
     * Unpublish a data track
     *
     * Generated from protobuf field <code>.livekit.UnpublishDataTrackRequest unpublish_data_track_request = 20;</code>
     * @param \Livekit\UnpublishDataTrackRequest $var
     * @return $this
     */
    public function setUnpublishDataTrackRequest($var)
    {
        GPBUtil::checkMessage($var, \Livekit\UnpublishDataTrackRequest::class);
        $this->writeOneof(20, $var);

        return $this;
    }

    /**
     * Update subscription state for one or more data tracks
     *
     * Generated from protobuf field <code>.livekit.UpdateDataSubscription update_data_subscription = 21;</code>
     * @return \Livekit\UpdateDataSubscription|null
     */
    public function getUpdateDataSubscription()
    {
        return $this->readOneof(21);
    }

    public function hasUpdateDataSubscription()
    {
        return $this->hasOneof(21);
    }

    /**
     * Update subscription state for one or more data tracks
     *
     * Generated from protobuf field <code>.livekit.UpdateDataSubscription update_data_subscription = 21;</code>
     * @param \Livekit\UpdateDataSubscription $var
     * @return $this
     */
    public function setUpdateDataSubscription($var)
    {
        GPBUtil::checkMessage($var, \Livekit\UpdateDataSubscription::class);
        $this->writeOneof(21, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getMessage()
    {
        return $this->whichOneof("message");
    }

}

