/**
 * 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: GenerateModuleObjCpp
 *
 * We create an umbrella header (and corresponding implementation) here since
 * Cxx compilation in BUCK has a limitation: source-code producing genrule()s
 * must have a single output. More files => more genrule()s => slower builds.
 */

#import "RNOpentokReactNativeSpec.h"


@implementation NativeOpentokSpecBase
- (void)emitOnArchiveStarted:(NSDictionary *)value
{
  _eventEmitterCallback("onArchiveStarted", value);
}
- (void)emitOnArchiveStopped:(NSDictionary *)value
{
  _eventEmitterCallback("onArchiveStopped", value);
}
- (void)emitOnConnectionCreated:(NSDictionary *)value
{
  _eventEmitterCallback("onConnectionCreated", value);
}
- (void)emitOnConnectionDestroyed:(NSDictionary *)value
{
  _eventEmitterCallback("onConnectionDestroyed", value);
}
- (void)emitOnMuteForced:(NSDictionary *)value
{
  _eventEmitterCallback("onMuteForced", value);
}
- (void)emitOnSessionConnected:(NSDictionary *)value
{
  _eventEmitterCallback("onSessionConnected", value);
}
- (void)emitOnSessionDisconnected:(NSDictionary *)value
{
  _eventEmitterCallback("onSessionDisconnected", value);
}
- (void)emitOnSessionReconnecting:(NSDictionary *)value
{
  _eventEmitterCallback("onSessionReconnecting", value);
}
- (void)emitOnSessionReconnected:(NSDictionary *)value
{
  _eventEmitterCallback("onSessionReconnected", value);
}
- (void)emitOnStreamCreated:(NSDictionary *)value
{
  _eventEmitterCallback("onStreamCreated", value);
}
- (void)emitOnStreamDestroyed:(NSDictionary *)value
{
  _eventEmitterCallback("onStreamDestroyed", value);
}
- (void)emitOnStreamPropertyChanged:(NSDictionary *)value
{
  _eventEmitterCallback("onStreamPropertyChanged", value);
}
- (void)emitOnSignalReceived:(NSDictionary *)value
{
  _eventEmitterCallback("onSignalReceived", value);
}
- (void)emitOnSessionError:(NSDictionary *)value
{
  _eventEmitterCallback("onSessionError", value);
}

- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper
{
  _eventEmitterCallback = std::move(eventEmitterCallbackWrapper->_eventEmitterCallback);
}
@end

@implementation RCTCxxConvert (NativeOpentok_IceConfigCustomServersElement)
+ (RCTManagedPointer *)JS_NativeOpentok_IceConfigCustomServersElement:(id)json
{
  return facebook::react::managedPointer<JS::NativeOpentok::IceConfigCustomServersElement>(json);
}
@end
@implementation RCTCxxConvert (NativeOpentok_IceConfig)
+ (RCTManagedPointer *)JS_NativeOpentok_IceConfig:(id)json
{
  return facebook::react::managedPointer<JS::NativeOpentok::IceConfig>(json);
}
@end
@implementation RCTCxxConvert (NativeOpentok_SessionOptions)
+ (RCTManagedPointer *)JS_NativeOpentok_SessionOptions:(id)json
{
  return facebook::react::managedPointer<JS::NativeOpentok::SessionOptions>(json);
}
@end
namespace facebook::react {
  
    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_initSession(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "initSession", @selector(initSession:sessionId:options:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_connect(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "connect", @selector(connect:token:resolve:reject:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_disconnect(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "disconnect", @selector(disconnect:resolve:reject:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_getSubscriberRtcStatsReport(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "getSubscriberRtcStatsReport", @selector(getSubscriberRtcStatsReport:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_getPublisherRtcStatsReport(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "getPublisherRtcStatsReport", @selector(getPublisherRtcStatsReport:publisherId:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_setAudioTransformers(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "setAudioTransformers", @selector(setAudioTransformers:publisherId:transformers:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_setVideoTransformers(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "setVideoTransformers", @selector(setVideoTransformers:publisherId:transformers:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_publish(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "publish", @selector(publish:publisherId:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_unpublish(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "unpublish", @selector(unpublish:publisherId:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_removeSubscriber(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "removeSubscriber", @selector(removeSubscriber:streamId:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_sendSignal(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "sendSignal", @selector(sendSignal:type:data:to:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_setEncryptionSecret(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "setEncryptionSecret", @selector(setEncryptionSecret:secret:resolve:reject:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_getCapabilities(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "getCapabilities", @selector(getCapabilities:resolve:reject:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_reportIssue(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "reportIssue", @selector(reportIssue:resolve:reject:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_forceMuteAll(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "forceMuteAll", @selector(forceMuteAll:excludedStreamIds:resolve:reject:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_forceMuteStream(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "forceMuteStream", @selector(forceMuteStream:streamId:resolve:reject:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_forceDisconnect(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "forceDisconnect", @selector(forceDisconnect:connectionId:resolve:reject:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeOpentokSpecJSI_disableForceMute(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "disableForceMute", @selector(disableForceMute:resolve:reject:), args, count);
    }

  NativeOpentokSpecJSI::NativeOpentokSpecJSI(const ObjCTurboModule::InitParams &params)
    : ObjCTurboModule(params) {
      
        methodMap_["initSession"] = MethodMetadata {3, __hostFunction_NativeOpentokSpecJSI_initSession};
        setMethodArgConversionSelector(@"initSession", 2, @"JS_NativeOpentok_SessionOptions:");
        
        methodMap_["connect"] = MethodMetadata {2, __hostFunction_NativeOpentokSpecJSI_connect};
        
        
        methodMap_["disconnect"] = MethodMetadata {1, __hostFunction_NativeOpentokSpecJSI_disconnect};
        
        
        methodMap_["getSubscriberRtcStatsReport"] = MethodMetadata {1, __hostFunction_NativeOpentokSpecJSI_getSubscriberRtcStatsReport};
        
        
        methodMap_["getPublisherRtcStatsReport"] = MethodMetadata {2, __hostFunction_NativeOpentokSpecJSI_getPublisherRtcStatsReport};
        
        
        methodMap_["setAudioTransformers"] = MethodMetadata {3, __hostFunction_NativeOpentokSpecJSI_setAudioTransformers};
        
        
        methodMap_["setVideoTransformers"] = MethodMetadata {3, __hostFunction_NativeOpentokSpecJSI_setVideoTransformers};
        
        
        methodMap_["publish"] = MethodMetadata {2, __hostFunction_NativeOpentokSpecJSI_publish};
        
        
        methodMap_["unpublish"] = MethodMetadata {2, __hostFunction_NativeOpentokSpecJSI_unpublish};
        
        
        methodMap_["removeSubscriber"] = MethodMetadata {2, __hostFunction_NativeOpentokSpecJSI_removeSubscriber};
        
        
        methodMap_["sendSignal"] = MethodMetadata {4, __hostFunction_NativeOpentokSpecJSI_sendSignal};
        
        
        methodMap_["setEncryptionSecret"] = MethodMetadata {2, __hostFunction_NativeOpentokSpecJSI_setEncryptionSecret};
        
        
        methodMap_["getCapabilities"] = MethodMetadata {1, __hostFunction_NativeOpentokSpecJSI_getCapabilities};
        
        
        methodMap_["reportIssue"] = MethodMetadata {1, __hostFunction_NativeOpentokSpecJSI_reportIssue};
        
        
        methodMap_["forceMuteAll"] = MethodMetadata {2, __hostFunction_NativeOpentokSpecJSI_forceMuteAll};
        
        
        methodMap_["forceMuteStream"] = MethodMetadata {2, __hostFunction_NativeOpentokSpecJSI_forceMuteStream};
        
        
        methodMap_["forceDisconnect"] = MethodMetadata {2, __hostFunction_NativeOpentokSpecJSI_forceDisconnect};
        
        
        methodMap_["disableForceMute"] = MethodMetadata {1, __hostFunction_NativeOpentokSpecJSI_disableForceMute};
        
        eventEmitterMap_["onArchiveStarted"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onArchiveStopped"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onConnectionCreated"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onConnectionDestroyed"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onMuteForced"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onSessionConnected"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onSessionDisconnected"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onSessionReconnecting"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onSessionReconnected"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onStreamCreated"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onStreamDestroyed"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onStreamPropertyChanged"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onSignalReceived"] = std::make_shared<AsyncEventEmitter<id>>();
        eventEmitterMap_["onSessionError"] = std::make_shared<AsyncEventEmitter<id>>();
        setEventEmitterCallback([&](const std::string &name, id value) {
          static_cast<AsyncEventEmitter<id> &>(*eventEmitterMap_[name]).emit(value);
        });
  }
} // namespace facebook::react
