///
/// AccessibilitySettings.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2024 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



#include <optional>

namespace margelo::nitro::stylesheet {

  /**
   * A struct which can be represented as a JavaScript object (AccessibilitySettings).
   */
  struct AccessibilitySettings {
  public:
    std::optional<bool> isReduceMotionEnabled     SWIFT_PRIVATE;
    std::optional<bool> isReduceTransparencyEnabled     SWIFT_PRIVATE;
    std::optional<bool> isDifferentiateWithoutColorEnabled     SWIFT_PRIVATE;
    std::optional<bool> isInvertColorsEnabled     SWIFT_PRIVATE;
    std::optional<bool> isShowButtonShapesEnabled     SWIFT_PRIVATE;
    std::optional<bool> isBoldTextEnabled     SWIFT_PRIVATE;
    std::optional<bool> isVoiceOverEnabled     SWIFT_PRIVATE;
    std::optional<bool> isSwitchControlEnabled     SWIFT_PRIVATE;
    std::optional<bool> isVideoAutoplayEnabled     SWIFT_PRIVATE;
    std::optional<bool> isClosedCaptioningEnabled     SWIFT_PRIVATE;
    std::optional<bool> prefersCrossFadeTransitions     SWIFT_PRIVATE;
    std::optional<bool> isGrayscaleEnabled     SWIFT_PRIVATE;
    std::optional<bool> isDarkerSystemColorsEnabled     SWIFT_PRIVATE;
    std::optional<bool> isMonoAudioEnabled     SWIFT_PRIVATE;
    std::optional<bool> isShakeToUndoEnabled     SWIFT_PRIVATE;
    std::optional<bool> isSpeakScreenEnabled     SWIFT_PRIVATE;
    std::optional<bool> isSpeakSelectionEnabled     SWIFT_PRIVATE;
    std::optional<bool> isOnOffSwitchLabelsEnabled     SWIFT_PRIVATE;

  public:
    explicit AccessibilitySettings(std::optional<bool> isReduceMotionEnabled, std::optional<bool> isReduceTransparencyEnabled, std::optional<bool> isDifferentiateWithoutColorEnabled, std::optional<bool> isInvertColorsEnabled, std::optional<bool> isShowButtonShapesEnabled, std::optional<bool> isBoldTextEnabled, std::optional<bool> isVoiceOverEnabled, std::optional<bool> isSwitchControlEnabled, std::optional<bool> isVideoAutoplayEnabled, std::optional<bool> isClosedCaptioningEnabled, std::optional<bool> prefersCrossFadeTransitions, std::optional<bool> isGrayscaleEnabled, std::optional<bool> isDarkerSystemColorsEnabled, std::optional<bool> isMonoAudioEnabled, std::optional<bool> isShakeToUndoEnabled, std::optional<bool> isSpeakScreenEnabled, std::optional<bool> isSpeakSelectionEnabled, std::optional<bool> isOnOffSwitchLabelsEnabled): isReduceMotionEnabled(isReduceMotionEnabled), isReduceTransparencyEnabled(isReduceTransparencyEnabled), isDifferentiateWithoutColorEnabled(isDifferentiateWithoutColorEnabled), isInvertColorsEnabled(isInvertColorsEnabled), isShowButtonShapesEnabled(isShowButtonShapesEnabled), isBoldTextEnabled(isBoldTextEnabled), isVoiceOverEnabled(isVoiceOverEnabled), isSwitchControlEnabled(isSwitchControlEnabled), isVideoAutoplayEnabled(isVideoAutoplayEnabled), isClosedCaptioningEnabled(isClosedCaptioningEnabled), prefersCrossFadeTransitions(prefersCrossFadeTransitions), isGrayscaleEnabled(isGrayscaleEnabled), isDarkerSystemColorsEnabled(isDarkerSystemColorsEnabled), isMonoAudioEnabled(isMonoAudioEnabled), isShakeToUndoEnabled(isShakeToUndoEnabled), isSpeakScreenEnabled(isSpeakScreenEnabled), isSpeakSelectionEnabled(isSpeakSelectionEnabled), isOnOffSwitchLabelsEnabled(isOnOffSwitchLabelsEnabled) {}
  };

} // namespace margelo::nitro::stylesheet

namespace margelo::nitro {

  using namespace margelo::nitro::stylesheet;

  // C++ AccessibilitySettings <> JS AccessibilitySettings (object)
  template <>
  struct JSIConverter<AccessibilitySettings> {
    static inline AccessibilitySettings fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return AccessibilitySettings(
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isReduceMotionEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isReduceTransparencyEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isDifferentiateWithoutColorEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isInvertColorsEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isShowButtonShapesEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isBoldTextEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isVoiceOverEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isSwitchControlEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isVideoAutoplayEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isClosedCaptioningEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "prefersCrossFadeTransitions")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isGrayscaleEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isDarkerSystemColorsEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isMonoAudioEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isShakeToUndoEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isSpeakScreenEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isSpeakSelectionEnabled")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isOnOffSwitchLabelsEnabled"))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const AccessibilitySettings& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, "isReduceMotionEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isReduceMotionEnabled));
      obj.setProperty(runtime, "isReduceTransparencyEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isReduceTransparencyEnabled));
      obj.setProperty(runtime, "isDifferentiateWithoutColorEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isDifferentiateWithoutColorEnabled));
      obj.setProperty(runtime, "isInvertColorsEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isInvertColorsEnabled));
      obj.setProperty(runtime, "isShowButtonShapesEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isShowButtonShapesEnabled));
      obj.setProperty(runtime, "isBoldTextEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isBoldTextEnabled));
      obj.setProperty(runtime, "isVoiceOverEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isVoiceOverEnabled));
      obj.setProperty(runtime, "isSwitchControlEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isSwitchControlEnabled));
      obj.setProperty(runtime, "isVideoAutoplayEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isVideoAutoplayEnabled));
      obj.setProperty(runtime, "isClosedCaptioningEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isClosedCaptioningEnabled));
      obj.setProperty(runtime, "prefersCrossFadeTransitions", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.prefersCrossFadeTransitions));
      obj.setProperty(runtime, "isGrayscaleEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isGrayscaleEnabled));
      obj.setProperty(runtime, "isDarkerSystemColorsEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isDarkerSystemColorsEnabled));
      obj.setProperty(runtime, "isMonoAudioEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isMonoAudioEnabled));
      obj.setProperty(runtime, "isShakeToUndoEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isShakeToUndoEnabled));
      obj.setProperty(runtime, "isSpeakScreenEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isSpeakScreenEnabled));
      obj.setProperty(runtime, "isSpeakSelectionEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isSpeakSelectionEnabled));
      obj.setProperty(runtime, "isOnOffSwitchLabelsEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isOnOffSwitchLabelsEnabled));
      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 (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isReduceMotionEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isReduceTransparencyEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isDifferentiateWithoutColorEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isInvertColorsEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isShowButtonShapesEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isBoldTextEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isVoiceOverEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isSwitchControlEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isVideoAutoplayEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isClosedCaptioningEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "prefersCrossFadeTransitions"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isGrayscaleEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isDarkerSystemColorsEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isMonoAudioEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isShakeToUndoEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isSpeakScreenEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isSpeakSelectionEnabled"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isOnOffSwitchLabelsEnabled"))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
