"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.Body = void 0;
exports.unionToBody = unionToBody;
exports.unionListToBody = unionListToBody;
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
const dominant_speaker_notification_1 = require("../../fbs/active-speaker-observer/dominant-speaker-notification");
const volumes_notification_1 = require("../../fbs/audio-level-observer/volumes-notification");
const layers_change_notification_1 = require("../../fbs/consumer/layers-change-notification");
const rtp_notification_1 = require("../../fbs/consumer/rtp-notification");
const score_notification_1 = require("../../fbs/consumer/score-notification");
const trace_notification_1 = require("../../fbs/consumer/trace-notification");
const buffered_amount_low_notification_1 = require("../../fbs/data-consumer/buffered-amount-low-notification");
const message_notification_1 = require("../../fbs/data-consumer/message-notification");
const send_notification_1 = require("../../fbs/data-producer/send-notification");
const rtcp_notification_1 = require("../../fbs/direct-transport/rtcp-notification");
const rtcp_tuple_notification_1 = require("../../fbs/plain-transport/rtcp-tuple-notification");
const tuple_notification_1 = require("../../fbs/plain-transport/tuple-notification");
const score_notification_2 = require("../../fbs/producer/score-notification");
const send_notification_2 = require("../../fbs/producer/send-notification");
const trace_notification_2 = require("../../fbs/producer/trace-notification");
const video_orientation_change_notification_1 = require("../../fbs/producer/video-orientation-change-notification");
const sctp_state_change_notification_1 = require("../../fbs/transport/sctp-state-change-notification");
const send_rtcp_notification_1 = require("../../fbs/transport/send-rtcp-notification");
const trace_notification_3 = require("../../fbs/transport/trace-notification");
const dtls_state_change_notification_1 = require("../../fbs/web-rtc-transport/dtls-state-change-notification");
const ice_selected_tuple_change_notification_1 = require("../../fbs/web-rtc-transport/ice-selected-tuple-change-notification");
const ice_state_change_notification_1 = require("../../fbs/web-rtc-transport/ice-state-change-notification");
var Body;
(function (Body) {
    Body[Body["NONE"] = 0] = "NONE";
    Body[Body["Transport_SendRtcpNotification"] = 1] = "Transport_SendRtcpNotification";
    Body[Body["Transport_SctpStateChangeNotification"] = 2] = "Transport_SctpStateChangeNotification";
    Body[Body["Producer_SendNotification"] = 3] = "Producer_SendNotification";
    Body[Body["DataProducer_SendNotification"] = 4] = "DataProducer_SendNotification";
    Body[Body["Transport_TraceNotification"] = 5] = "Transport_TraceNotification";
    Body[Body["WebRtcTransport_IceSelectedTupleChangeNotification"] = 6] = "WebRtcTransport_IceSelectedTupleChangeNotification";
    Body[Body["WebRtcTransport_IceStateChangeNotification"] = 7] = "WebRtcTransport_IceStateChangeNotification";
    Body[Body["WebRtcTransport_DtlsStateChangeNotification"] = 8] = "WebRtcTransport_DtlsStateChangeNotification";
    Body[Body["PlainTransport_TupleNotification"] = 9] = "PlainTransport_TupleNotification";
    Body[Body["PlainTransport_RtcpTupleNotification"] = 10] = "PlainTransport_RtcpTupleNotification";
    Body[Body["DirectTransport_RtcpNotification"] = 11] = "DirectTransport_RtcpNotification";
    Body[Body["Producer_ScoreNotification"] = 12] = "Producer_ScoreNotification";
    Body[Body["Producer_TraceNotification"] = 13] = "Producer_TraceNotification";
    Body[Body["Producer_VideoOrientationChangeNotification"] = 14] = "Producer_VideoOrientationChangeNotification";
    Body[Body["Consumer_LayersChangeNotification"] = 15] = "Consumer_LayersChangeNotification";
    Body[Body["Consumer_RtpNotification"] = 16] = "Consumer_RtpNotification";
    Body[Body["Consumer_ScoreNotification"] = 17] = "Consumer_ScoreNotification";
    Body[Body["Consumer_TraceNotification"] = 18] = "Consumer_TraceNotification";
    Body[Body["DataConsumer_MessageNotification"] = 19] = "DataConsumer_MessageNotification";
    Body[Body["DataConsumer_BufferedAmountLowNotification"] = 20] = "DataConsumer_BufferedAmountLowNotification";
    Body[Body["ActiveSpeakerObserver_DominantSpeakerNotification"] = 21] = "ActiveSpeakerObserver_DominantSpeakerNotification";
    Body[Body["AudioLevelObserver_VolumesNotification"] = 22] = "AudioLevelObserver_VolumesNotification";
})(Body || (exports.Body = Body = {}));
function unionToBody(type, accessor) {
    switch (Body[type]) {
        case 'NONE': return null;
        case 'Transport_SendRtcpNotification': return accessor(new send_rtcp_notification_1.SendRtcpNotification());
        case 'Transport_SctpStateChangeNotification': return accessor(new sctp_state_change_notification_1.SctpStateChangeNotification());
        case 'Producer_SendNotification': return accessor(new send_notification_2.SendNotification());
        case 'DataProducer_SendNotification': return accessor(new send_notification_1.SendNotification());
        case 'Transport_TraceNotification': return accessor(new trace_notification_3.TraceNotification());
        case 'WebRtcTransport_IceSelectedTupleChangeNotification': return accessor(new ice_selected_tuple_change_notification_1.IceSelectedTupleChangeNotification());
        case 'WebRtcTransport_IceStateChangeNotification': return accessor(new ice_state_change_notification_1.IceStateChangeNotification());
        case 'WebRtcTransport_DtlsStateChangeNotification': return accessor(new dtls_state_change_notification_1.DtlsStateChangeNotification());
        case 'PlainTransport_TupleNotification': return accessor(new tuple_notification_1.TupleNotification());
        case 'PlainTransport_RtcpTupleNotification': return accessor(new rtcp_tuple_notification_1.RtcpTupleNotification());
        case 'DirectTransport_RtcpNotification': return accessor(new rtcp_notification_1.RtcpNotification());
        case 'Producer_ScoreNotification': return accessor(new score_notification_2.ScoreNotification());
        case 'Producer_TraceNotification': return accessor(new trace_notification_2.TraceNotification());
        case 'Producer_VideoOrientationChangeNotification': return accessor(new video_orientation_change_notification_1.VideoOrientationChangeNotification());
        case 'Consumer_LayersChangeNotification': return accessor(new layers_change_notification_1.LayersChangeNotification());
        case 'Consumer_RtpNotification': return accessor(new rtp_notification_1.RtpNotification());
        case 'Consumer_ScoreNotification': return accessor(new score_notification_1.ScoreNotification());
        case 'Consumer_TraceNotification': return accessor(new trace_notification_1.TraceNotification());
        case 'DataConsumer_MessageNotification': return accessor(new message_notification_1.MessageNotification());
        case 'DataConsumer_BufferedAmountLowNotification': return accessor(new buffered_amount_low_notification_1.BufferedAmountLowNotification());
        case 'ActiveSpeakerObserver_DominantSpeakerNotification': return accessor(new dominant_speaker_notification_1.DominantSpeakerNotification());
        case 'AudioLevelObserver_VolumesNotification': return accessor(new volumes_notification_1.VolumesNotification());
        default: return null;
    }
}
function unionListToBody(type, accessor, index) {
    switch (Body[type]) {
        case 'NONE': return null;
        case 'Transport_SendRtcpNotification': return accessor(index, new send_rtcp_notification_1.SendRtcpNotification());
        case 'Transport_SctpStateChangeNotification': return accessor(index, new sctp_state_change_notification_1.SctpStateChangeNotification());
        case 'Producer_SendNotification': return accessor(index, new send_notification_2.SendNotification());
        case 'DataProducer_SendNotification': return accessor(index, new send_notification_1.SendNotification());
        case 'Transport_TraceNotification': return accessor(index, new trace_notification_3.TraceNotification());
        case 'WebRtcTransport_IceSelectedTupleChangeNotification': return accessor(index, new ice_selected_tuple_change_notification_1.IceSelectedTupleChangeNotification());
        case 'WebRtcTransport_IceStateChangeNotification': return accessor(index, new ice_state_change_notification_1.IceStateChangeNotification());
        case 'WebRtcTransport_DtlsStateChangeNotification': return accessor(index, new dtls_state_change_notification_1.DtlsStateChangeNotification());
        case 'PlainTransport_TupleNotification': return accessor(index, new tuple_notification_1.TupleNotification());
        case 'PlainTransport_RtcpTupleNotification': return accessor(index, new rtcp_tuple_notification_1.RtcpTupleNotification());
        case 'DirectTransport_RtcpNotification': return accessor(index, new rtcp_notification_1.RtcpNotification());
        case 'Producer_ScoreNotification': return accessor(index, new score_notification_2.ScoreNotification());
        case 'Producer_TraceNotification': return accessor(index, new trace_notification_2.TraceNotification());
        case 'Producer_VideoOrientationChangeNotification': return accessor(index, new video_orientation_change_notification_1.VideoOrientationChangeNotification());
        case 'Consumer_LayersChangeNotification': return accessor(index, new layers_change_notification_1.LayersChangeNotification());
        case 'Consumer_RtpNotification': return accessor(index, new rtp_notification_1.RtpNotification());
        case 'Consumer_ScoreNotification': return accessor(index, new score_notification_1.ScoreNotification());
        case 'Consumer_TraceNotification': return accessor(index, new trace_notification_1.TraceNotification());
        case 'DataConsumer_MessageNotification': return accessor(index, new message_notification_1.MessageNotification());
        case 'DataConsumer_BufferedAmountLowNotification': return accessor(index, new buffered_amount_low_notification_1.BufferedAmountLowNotification());
        case 'ActiveSpeakerObserver_DominantSpeakerNotification': return accessor(index, new dominant_speaker_notification_1.DominantSpeakerNotification());
        case 'AudioLevelObserver_VolumesNotification': return accessor(index, new volumes_notification_1.VolumesNotification());
        default: return null;
    }
}
