
/**
 * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
 *
 * Do not edit this file as changes may cause incorrect behavior and will be lost
 * once the code is regenerated.
 *
 * @generated by codegen project: GenerateEventEmitterCpp.js
 */

#include "EventEmitters.h"


namespace facebook::react {

void OTRNPublisherEventEmitter::onError(OnError event) const {
  dispatchEvent("error", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    payload.setProperty(runtime, "code", event.code);
payload.setProperty(runtime, "message", event.message);
    return payload;
  });
}


void OTRNPublisherEventEmitter::onStreamCreated(OnStreamCreated event) const {
  dispatchEvent("streamCreated", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    payload.setProperty(runtime, "streamId", event.streamId);
    return payload;
  });
}


void OTRNPublisherEventEmitter::onStreamDestroyed(OnStreamDestroyed event) const {
  dispatchEvent("streamDestroyed", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    payload.setProperty(runtime, "streamId", event.streamId);
    return payload;
  });
}


void OTRNPublisherEventEmitter::onAudioLevel(OnAudioLevel event) const {
  dispatchEvent("audioLevel", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    payload.setProperty(runtime, "audioLevel", event.audioLevel);
    return payload;
  });
}


void OTRNPublisherEventEmitter::onAudioNetworkStats(OnAudioNetworkStats event) const {
  dispatchEvent("audioNetworkStats", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    payload.setProperty(runtime, "jsonStats", event.jsonStats);
    return payload;
  });
}


void OTRNPublisherEventEmitter::onMuteForced(OnMuteForced event) const {
  dispatchEvent("muteForced", [](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    
    return payload;
  });
}


void OTRNPublisherEventEmitter::onRtcStatsReport(OnRtcStatsReport event) const {
  dispatchEvent("rtcStatsReport", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    payload.setProperty(runtime, "jsonStats", event.jsonStats);
    return payload;
  });
}


void OTRNPublisherEventEmitter::onVideoDisabled(OnVideoDisabled event) const {
  dispatchEvent("videoDisabled", [](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    
    return payload;
  });
}


void OTRNPublisherEventEmitter::onVideoDisableWarning(OnVideoDisableWarning event) const {
  dispatchEvent("videoDisableWarning", [](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    
    return payload;
  });
}


void OTRNPublisherEventEmitter::onVideoDisableWarningLifted(OnVideoDisableWarningLifted event) const {
  dispatchEvent("videoDisableWarningLifted", [](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    
    return payload;
  });
}


void OTRNPublisherEventEmitter::onVideoEnabled(OnVideoEnabled event) const {
  dispatchEvent("videoEnabled", [](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    
    return payload;
  });
}


void OTRNPublisherEventEmitter::onVideoNetworkStats(OnVideoNetworkStats event) const {
  dispatchEvent("videoNetworkStats", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    payload.setProperty(runtime, "jsonStats", event.jsonStats);
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onSubscriberConnected(OnSubscriberConnected event) const {
  dispatchEvent("subscriberConnected", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onSubscriberDisconnected(OnSubscriberDisconnected event) const {
  dispatchEvent("subscriberDisconnected", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onSubscriberError(OnSubscriberError event) const {
  dispatchEvent("subscriberError", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
{
  auto error = jsi::Object(runtime);
  error.setProperty(runtime, "code", event.error.code);
  error.setProperty(runtime, "message", event.error.message);
  payload.setProperty(runtime, "error", error);
}
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onRtcStatsReport(OnRtcStatsReport event) const {
  dispatchEvent("rtcStatsReport", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
payload.setProperty(runtime, "jsonStats", event.jsonStats);
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onAudioLevel(OnAudioLevel event) const {
  dispatchEvent("audioLevel", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
payload.setProperty(runtime, "audioLevel", event.audioLevel);
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onAudioNetworkStats(OnAudioNetworkStats event) const {
  dispatchEvent("audioNetworkStats", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
payload.setProperty(runtime, "jsonStats", event.jsonStats);
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onCaptionReceived(OnCaptionReceived event) const {
  dispatchEvent("captionReceived", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
payload.setProperty(runtime, "text", event.text);
payload.setProperty(runtime, "isFinal", event.isFinal);
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onVideoDataReceived(OnVideoDataReceived event) const {
  dispatchEvent("videoDataReceived", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onVideoDisabled(OnVideoDisabled event) const {
  dispatchEvent("videoDisabled", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
payload.setProperty(runtime, "reason", event.reason);
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onVideoDisableWarning(OnVideoDisableWarning event) const {
  dispatchEvent("videoDisableWarning", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onVideoDisableWarningLifted(OnVideoDisableWarningLifted event) const {
  dispatchEvent("videoDisableWarningLifted", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onVideoEnabled(OnVideoEnabled event) const {
  dispatchEvent("videoEnabled", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
payload.setProperty(runtime, "reason", event.reason);
    return payload;
  });
}


void OTRNSubscriberEventEmitter::onVideoNetworkStats(OnVideoNetworkStats event) const {
  dispatchEvent("videoNetworkStats", [event=std::move(event)](jsi::Runtime &runtime) {
    auto payload = jsi::Object(runtime);
    {
  auto stream = jsi::Object(runtime);
  stream.setProperty(runtime, "name", event.stream.name);
  stream.setProperty(runtime, "streamId", event.stream.streamId);
  stream.setProperty(runtime, "hasAudio", event.stream.hasAudio);
  stream.setProperty(runtime, "hasCaptions", event.stream.hasCaptions);
  stream.setProperty(runtime, "hasVideo", event.stream.hasVideo);
  stream.setProperty(runtime, "sessionId", event.stream.sessionId);
  stream.setProperty(runtime, "width", event.stream.width);
  stream.setProperty(runtime, "height", event.stream.height);
  stream.setProperty(runtime, "videoType", event.stream.videoType);
  {
    auto connection = jsi::Object(runtime);
    connection.setProperty(runtime, "creationTime", event.stream.connection.creationTime);
    connection.setProperty(runtime, "data", event.stream.connection.data);
    connection.setProperty(runtime, "connectionId", event.stream.connection.connectionId);
    stream.setProperty(runtime, "connection", connection);
  }
  stream.setProperty(runtime, "creationTime", event.stream.creationTime);
  payload.setProperty(runtime, "stream", stream);
}
payload.setProperty(runtime, "jsonStats", event.jsonStats);
    return payload;
  });
}

} // namespace facebook::react
