///
/// NativeAzureConfig.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#if __has_include(<NitroModules/JSIConverter.hpp>)
#include <NitroModules/JSIConverter.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/NitroDefines.hpp>)
#include <NitroModules/NitroDefines.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/JSIHelpers.hpp>)
#include <NitroModules/JSIHelpers.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
#include <NitroModules/PropNameIDCache.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif



#include <string>

namespace margelo::nitro::clarion::azure {

  /**
   * A struct which can be represented as a JavaScript object (NativeAzureConfig).
   */
  struct NativeAzureConfig final {
  public:
    std::string language     SWIFT_PRIVATE;
    bool emitPartials     SWIFT_PRIVATE;
    bool emitAudioLevel     SWIFT_PRIVATE;
    double audioLevelIntervalMs     SWIFT_PRIVATE;
    std::string subscriptionKey     SWIFT_PRIVATE;
    std::string region     SWIFT_PRIVATE;
    std::string authToken     SWIFT_PRIVATE;
    std::string endpoint     SWIFT_PRIVATE;
    std::string outputFormat     SWIFT_PRIVATE;
    std::string profanity     SWIFT_PRIVATE;
    bool enableSpeakerDiarization     SWIFT_PRIVATE;
    std::string autoDetectLanguages     SWIFT_PRIVATE;
    double silenceTimeoutMs     SWIFT_PRIVATE;
    std::string phraseHints     SWIFT_PRIVATE;
    bool degradeOnTierMismatch     SWIFT_PRIVATE;

  public:
    NativeAzureConfig() = default;
    explicit NativeAzureConfig(std::string language, bool emitPartials, bool emitAudioLevel, double audioLevelIntervalMs, std::string subscriptionKey, std::string region, std::string authToken, std::string endpoint, std::string outputFormat, std::string profanity, bool enableSpeakerDiarization, std::string autoDetectLanguages, double silenceTimeoutMs, std::string phraseHints, bool degradeOnTierMismatch): language(language), emitPartials(emitPartials), emitAudioLevel(emitAudioLevel), audioLevelIntervalMs(audioLevelIntervalMs), subscriptionKey(subscriptionKey), region(region), authToken(authToken), endpoint(endpoint), outputFormat(outputFormat), profanity(profanity), enableSpeakerDiarization(enableSpeakerDiarization), autoDetectLanguages(autoDetectLanguages), silenceTimeoutMs(silenceTimeoutMs), phraseHints(phraseHints), degradeOnTierMismatch(degradeOnTierMismatch) {}

  public:
    friend bool operator==(const NativeAzureConfig& lhs, const NativeAzureConfig& rhs) = default;
  };

} // namespace margelo::nitro::clarion::azure

namespace margelo::nitro {

  // C++ NativeAzureConfig <> JS NativeAzureConfig (object)
  template <>
  struct JSIConverter<margelo::nitro::clarion::azure::NativeAzureConfig> final {
    static inline margelo::nitro::clarion::azure::NativeAzureConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return margelo::nitro::clarion::azure::NativeAzureConfig(
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "language"))),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "emitPartials"))),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "emitAudioLevel"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "audioLevelIntervalMs"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subscriptionKey"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "region"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "authToken"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endpoint"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "outputFormat"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "profanity"))),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "enableSpeakerDiarization"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoDetectLanguages"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "silenceTimeoutMs"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "phraseHints"))),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "degradeOnTierMismatch")))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::clarion::azure::NativeAzureConfig& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "language"), JSIConverter<std::string>::toJSI(runtime, arg.language));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "emitPartials"), JSIConverter<bool>::toJSI(runtime, arg.emitPartials));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "emitAudioLevel"), JSIConverter<bool>::toJSI(runtime, arg.emitAudioLevel));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "audioLevelIntervalMs"), JSIConverter<double>::toJSI(runtime, arg.audioLevelIntervalMs));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "subscriptionKey"), JSIConverter<std::string>::toJSI(runtime, arg.subscriptionKey));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "region"), JSIConverter<std::string>::toJSI(runtime, arg.region));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "authToken"), JSIConverter<std::string>::toJSI(runtime, arg.authToken));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "endpoint"), JSIConverter<std::string>::toJSI(runtime, arg.endpoint));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "outputFormat"), JSIConverter<std::string>::toJSI(runtime, arg.outputFormat));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "profanity"), JSIConverter<std::string>::toJSI(runtime, arg.profanity));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "enableSpeakerDiarization"), JSIConverter<bool>::toJSI(runtime, arg.enableSpeakerDiarization));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "autoDetectLanguages"), JSIConverter<std::string>::toJSI(runtime, arg.autoDetectLanguages));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "silenceTimeoutMs"), JSIConverter<double>::toJSI(runtime, arg.silenceTimeoutMs));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "phraseHints"), JSIConverter<std::string>::toJSI(runtime, arg.phraseHints));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "degradeOnTierMismatch"), JSIConverter<bool>::toJSI(runtime, arg.degradeOnTierMismatch));
      return obj;
    }
    static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
      if (!value.isObject()) {
        return false;
      }
      jsi::Object obj = value.getObject(runtime);
      if (!nitro::isPlainObject(runtime, obj)) {
        return false;
      }
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "language")))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "emitPartials")))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "emitAudioLevel")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "audioLevelIntervalMs")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subscriptionKey")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "region")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "authToken")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endpoint")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "outputFormat")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "profanity")))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "enableSpeakerDiarization")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoDetectLanguages")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "silenceTimeoutMs")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "phraseHints")))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "degradeOnTierMismatch")))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
