///
/// AudioSet.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

// Forward declaration of `AVEncoderAudioQualityIOSType` to properly resolve imports.
namespace margelo::nitro::sound { enum class AVEncoderAudioQualityIOSType; }
// Forward declaration of `AVModeIOSOption` to properly resolve imports.
namespace margelo::nitro::sound { enum class AVModeIOSOption; }
// Forward declaration of `AVEncodingOption` to properly resolve imports.
namespace margelo::nitro::sound { enum class AVEncodingOption; }
// Forward declaration of `AVLinearPCMBitDepthKeyIOSType` to properly resolve imports.
namespace margelo::nitro::sound { enum class AVLinearPCMBitDepthKeyIOSType; }
// Forward declaration of `AudioSourceAndroidType` to properly resolve imports.
namespace margelo::nitro::sound { enum class AudioSourceAndroidType; }
// Forward declaration of `OutputFormatAndroidType` to properly resolve imports.
namespace margelo::nitro::sound { enum class OutputFormatAndroidType; }
// Forward declaration of `AudioEncoderAndroidType` to properly resolve imports.
namespace margelo::nitro::sound { enum class AudioEncoderAndroidType; }
// Forward declaration of `AudioQualityType` to properly resolve imports.
namespace margelo::nitro::sound { enum class AudioQualityType; }

#include "AVEncoderAudioQualityIOSType.hpp"
#include <optional>
#include "AVModeIOSOption.hpp"
#include "AVEncodingOption.hpp"
#include "AVLinearPCMBitDepthKeyIOSType.hpp"
#include "AudioSourceAndroidType.hpp"
#include "OutputFormatAndroidType.hpp"
#include "AudioEncoderAndroidType.hpp"
#include "AudioQualityType.hpp"

namespace margelo::nitro::sound {

  /**
   * A struct which can be represented as a JavaScript object (AudioSet).
   */
  struct AudioSet final {
  public:
    std::optional<AVEncoderAudioQualityIOSType> AVEncoderAudioQualityKeyIOS     SWIFT_PRIVATE;
    std::optional<AVModeIOSOption> AVModeIOS     SWIFT_PRIVATE;
    std::optional<AVEncodingOption> AVEncodingOptionIOS     SWIFT_PRIVATE;
    std::optional<AVEncodingOption> AVFormatIDKeyIOS     SWIFT_PRIVATE;
    std::optional<double> AVNumberOfChannelsKeyIOS     SWIFT_PRIVATE;
    std::optional<AVLinearPCMBitDepthKeyIOSType> AVLinearPCMBitDepthKeyIOS     SWIFT_PRIVATE;
    std::optional<bool> AVLinearPCMIsBigEndianKeyIOS     SWIFT_PRIVATE;
    std::optional<bool> AVLinearPCMIsFloatKeyIOS     SWIFT_PRIVATE;
    std::optional<bool> AVLinearPCMIsNonInterleavedIOS     SWIFT_PRIVATE;
    std::optional<double> AVSampleRateKeyIOS     SWIFT_PRIVATE;
    std::optional<AudioSourceAndroidType> AudioSourceAndroid     SWIFT_PRIVATE;
    std::optional<OutputFormatAndroidType> OutputFormatAndroid     SWIFT_PRIVATE;
    std::optional<AudioEncoderAndroidType> AudioEncoderAndroid     SWIFT_PRIVATE;
    std::optional<AudioQualityType> AudioQuality     SWIFT_PRIVATE;
    std::optional<double> AudioChannels     SWIFT_PRIVATE;
    std::optional<double> AudioSamplingRate     SWIFT_PRIVATE;
    std::optional<double> AudioEncodingBitRate     SWIFT_PRIVATE;
    std::optional<bool> IncludeBase64     SWIFT_PRIVATE;

  public:
    AudioSet() = default;
    explicit AudioSet(std::optional<AVEncoderAudioQualityIOSType> AVEncoderAudioQualityKeyIOS, std::optional<AVModeIOSOption> AVModeIOS, std::optional<AVEncodingOption> AVEncodingOptionIOS, std::optional<AVEncodingOption> AVFormatIDKeyIOS, std::optional<double> AVNumberOfChannelsKeyIOS, std::optional<AVLinearPCMBitDepthKeyIOSType> AVLinearPCMBitDepthKeyIOS, std::optional<bool> AVLinearPCMIsBigEndianKeyIOS, std::optional<bool> AVLinearPCMIsFloatKeyIOS, std::optional<bool> AVLinearPCMIsNonInterleavedIOS, std::optional<double> AVSampleRateKeyIOS, std::optional<AudioSourceAndroidType> AudioSourceAndroid, std::optional<OutputFormatAndroidType> OutputFormatAndroid, std::optional<AudioEncoderAndroidType> AudioEncoderAndroid, std::optional<AudioQualityType> AudioQuality, std::optional<double> AudioChannels, std::optional<double> AudioSamplingRate, std::optional<double> AudioEncodingBitRate, std::optional<bool> IncludeBase64): AVEncoderAudioQualityKeyIOS(AVEncoderAudioQualityKeyIOS), AVModeIOS(AVModeIOS), AVEncodingOptionIOS(AVEncodingOptionIOS), AVFormatIDKeyIOS(AVFormatIDKeyIOS), AVNumberOfChannelsKeyIOS(AVNumberOfChannelsKeyIOS), AVLinearPCMBitDepthKeyIOS(AVLinearPCMBitDepthKeyIOS), AVLinearPCMIsBigEndianKeyIOS(AVLinearPCMIsBigEndianKeyIOS), AVLinearPCMIsFloatKeyIOS(AVLinearPCMIsFloatKeyIOS), AVLinearPCMIsNonInterleavedIOS(AVLinearPCMIsNonInterleavedIOS), AVSampleRateKeyIOS(AVSampleRateKeyIOS), AudioSourceAndroid(AudioSourceAndroid), OutputFormatAndroid(OutputFormatAndroid), AudioEncoderAndroid(AudioEncoderAndroid), AudioQuality(AudioQuality), AudioChannels(AudioChannels), AudioSamplingRate(AudioSamplingRate), AudioEncodingBitRate(AudioEncodingBitRate), IncludeBase64(IncludeBase64) {}

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

} // namespace margelo::nitro::sound

namespace margelo::nitro {

  // C++ AudioSet <> JS AudioSet (object)
  template <>
  struct JSIConverter<margelo::nitro::sound::AudioSet> final {
    static inline margelo::nitro::sound::AudioSet fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return margelo::nitro::sound::AudioSet(
        JSIConverter<std::optional<margelo::nitro::sound::AVEncoderAudioQualityIOSType>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVEncoderAudioQualityKeyIOS"))),
        JSIConverter<std::optional<margelo::nitro::sound::AVModeIOSOption>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVModeIOS"))),
        JSIConverter<std::optional<margelo::nitro::sound::AVEncodingOption>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVEncodingOptionIOS"))),
        JSIConverter<std::optional<margelo::nitro::sound::AVEncodingOption>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVFormatIDKeyIOS"))),
        JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVNumberOfChannelsKeyIOS"))),
        JSIConverter<std::optional<margelo::nitro::sound::AVLinearPCMBitDepthKeyIOSType>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVLinearPCMBitDepthKeyIOS"))),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVLinearPCMIsBigEndianKeyIOS"))),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVLinearPCMIsFloatKeyIOS"))),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVLinearPCMIsNonInterleavedIOS"))),
        JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVSampleRateKeyIOS"))),
        JSIConverter<std::optional<margelo::nitro::sound::AudioSourceAndroidType>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AudioSourceAndroid"))),
        JSIConverter<std::optional<margelo::nitro::sound::OutputFormatAndroidType>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "OutputFormatAndroid"))),
        JSIConverter<std::optional<margelo::nitro::sound::AudioEncoderAndroidType>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AudioEncoderAndroid"))),
        JSIConverter<std::optional<margelo::nitro::sound::AudioQualityType>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AudioQuality"))),
        JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AudioChannels"))),
        JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AudioSamplingRate"))),
        JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AudioEncodingBitRate"))),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "IncludeBase64")))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::sound::AudioSet& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AVEncoderAudioQualityKeyIOS"), JSIConverter<std::optional<margelo::nitro::sound::AVEncoderAudioQualityIOSType>>::toJSI(runtime, arg.AVEncoderAudioQualityKeyIOS));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AVModeIOS"), JSIConverter<std::optional<margelo::nitro::sound::AVModeIOSOption>>::toJSI(runtime, arg.AVModeIOS));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AVEncodingOptionIOS"), JSIConverter<std::optional<margelo::nitro::sound::AVEncodingOption>>::toJSI(runtime, arg.AVEncodingOptionIOS));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AVFormatIDKeyIOS"), JSIConverter<std::optional<margelo::nitro::sound::AVEncodingOption>>::toJSI(runtime, arg.AVFormatIDKeyIOS));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AVNumberOfChannelsKeyIOS"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.AVNumberOfChannelsKeyIOS));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AVLinearPCMBitDepthKeyIOS"), JSIConverter<std::optional<margelo::nitro::sound::AVLinearPCMBitDepthKeyIOSType>>::toJSI(runtime, arg.AVLinearPCMBitDepthKeyIOS));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AVLinearPCMIsBigEndianKeyIOS"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.AVLinearPCMIsBigEndianKeyIOS));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AVLinearPCMIsFloatKeyIOS"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.AVLinearPCMIsFloatKeyIOS));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AVLinearPCMIsNonInterleavedIOS"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.AVLinearPCMIsNonInterleavedIOS));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AVSampleRateKeyIOS"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.AVSampleRateKeyIOS));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AudioSourceAndroid"), JSIConverter<std::optional<margelo::nitro::sound::AudioSourceAndroidType>>::toJSI(runtime, arg.AudioSourceAndroid));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "OutputFormatAndroid"), JSIConverter<std::optional<margelo::nitro::sound::OutputFormatAndroidType>>::toJSI(runtime, arg.OutputFormatAndroid));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AudioEncoderAndroid"), JSIConverter<std::optional<margelo::nitro::sound::AudioEncoderAndroidType>>::toJSI(runtime, arg.AudioEncoderAndroid));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AudioQuality"), JSIConverter<std::optional<margelo::nitro::sound::AudioQualityType>>::toJSI(runtime, arg.AudioQuality));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AudioChannels"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.AudioChannels));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AudioSamplingRate"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.AudioSamplingRate));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "AudioEncodingBitRate"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.AudioEncodingBitRate));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "IncludeBase64"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.IncludeBase64));
      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::optional<margelo::nitro::sound::AVEncoderAudioQualityIOSType>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVEncoderAudioQualityKeyIOS")))) return false;
      if (!JSIConverter<std::optional<margelo::nitro::sound::AVModeIOSOption>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVModeIOS")))) return false;
      if (!JSIConverter<std::optional<margelo::nitro::sound::AVEncodingOption>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVEncodingOptionIOS")))) return false;
      if (!JSIConverter<std::optional<margelo::nitro::sound::AVEncodingOption>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVFormatIDKeyIOS")))) return false;
      if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVNumberOfChannelsKeyIOS")))) return false;
      if (!JSIConverter<std::optional<margelo::nitro::sound::AVLinearPCMBitDepthKeyIOSType>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVLinearPCMBitDepthKeyIOS")))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVLinearPCMIsBigEndianKeyIOS")))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVLinearPCMIsFloatKeyIOS")))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVLinearPCMIsNonInterleavedIOS")))) return false;
      if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AVSampleRateKeyIOS")))) return false;
      if (!JSIConverter<std::optional<margelo::nitro::sound::AudioSourceAndroidType>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AudioSourceAndroid")))) return false;
      if (!JSIConverter<std::optional<margelo::nitro::sound::OutputFormatAndroidType>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "OutputFormatAndroid")))) return false;
      if (!JSIConverter<std::optional<margelo::nitro::sound::AudioEncoderAndroidType>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AudioEncoderAndroid")))) return false;
      if (!JSIConverter<std::optional<margelo::nitro::sound::AudioQualityType>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AudioQuality")))) return false;
      if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AudioChannels")))) return false;
      if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AudioSamplingRate")))) return false;
      if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "AudioEncodingBitRate")))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "IncludeBase64")))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
