///
/// LDP_PresentParams.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 `LDP_Mode` to properly resolve imports.
namespace margelo::nitro::lunardatepicker { enum class LDP_Mode; }
// Forward declaration of `LDP_Range` to properly resolve imports.
namespace margelo::nitro::lunardatepicker { struct LDP_Range; }

#include <string>
#include <optional>
#include "LDP_Mode.hpp"
#include "LDP_Range.hpp"
#include <functional>

namespace margelo::nitro::lunardatepicker {

  /**
   * A struct which can be represented as a JavaScript object (LDP_PresentParams).
   */
  struct LDP_PresentParams final {
  public:
    std::string theme     SWIFT_PRIVATE;
    std::string language     SWIFT_PRIVATE;
    std::string title     SWIFT_PRIVATE;
    std::string submitText     SWIFT_PRIVATE;
    std::optional<std::string> fromText     SWIFT_PRIVATE;
    std::optional<std::string> toText     SWIFT_PRIVATE;
    std::optional<std::string> notSelectedText     SWIFT_PRIVATE;
    LDP_Mode mode     SWIFT_PRIVATE;
    std::optional<bool> showHeader     SWIFT_PRIVATE;
    std::function<void(const LDP_Range& /* result */)> onDone     SWIFT_PRIVATE;
    std::optional<std::string> minimumDate     SWIFT_PRIVATE;
    std::optional<std::string> maximumDate     SWIFT_PRIVATE;
    std::optional<LDP_Range> initialValue     SWIFT_PRIVATE;

  public:
    LDP_PresentParams() = default;
    explicit LDP_PresentParams(std::string theme, std::string language, std::string title, std::string submitText, std::optional<std::string> fromText, std::optional<std::string> toText, std::optional<std::string> notSelectedText, LDP_Mode mode, std::optional<bool> showHeader, std::function<void(const LDP_Range& /* result */)> onDone, std::optional<std::string> minimumDate, std::optional<std::string> maximumDate, std::optional<LDP_Range> initialValue): theme(theme), language(language), title(title), submitText(submitText), fromText(fromText), toText(toText), notSelectedText(notSelectedText), mode(mode), showHeader(showHeader), onDone(onDone), minimumDate(minimumDate), maximumDate(maximumDate), initialValue(initialValue) {}

  public:
    // LDP_PresentParams is not equatable because these properties are not equatable: onDone
  };

} // namespace margelo::nitro::lunardatepicker

namespace margelo::nitro {

  // C++ LDP_PresentParams <> JS LDP_PresentParams (object)
  template <>
  struct JSIConverter<margelo::nitro::lunardatepicker::LDP_PresentParams> final {
    static inline margelo::nitro::lunardatepicker::LDP_PresentParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return margelo::nitro::lunardatepicker::LDP_PresentParams(
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "theme"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "language"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "submitText"))),
        JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fromText"))),
        JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "toText"))),
        JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "notSelectedText"))),
        JSIConverter<margelo::nitro::lunardatepicker::LDP_Mode>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mode"))),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "showHeader"))),
        JSIConverter<std::function<void(const margelo::nitro::lunardatepicker::LDP_Range&)>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onDone"))),
        JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minimumDate"))),
        JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maximumDate"))),
        JSIConverter<std::optional<margelo::nitro::lunardatepicker::LDP_Range>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "initialValue")))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::lunardatepicker::LDP_PresentParams& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "theme"), JSIConverter<std::string>::toJSI(runtime, arg.theme));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "language"), JSIConverter<std::string>::toJSI(runtime, arg.language));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "title"), JSIConverter<std::string>::toJSI(runtime, arg.title));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "submitText"), JSIConverter<std::string>::toJSI(runtime, arg.submitText));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "fromText"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.fromText));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "toText"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.toText));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "notSelectedText"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.notSelectedText));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "mode"), JSIConverter<margelo::nitro::lunardatepicker::LDP_Mode>::toJSI(runtime, arg.mode));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "showHeader"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.showHeader));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "onDone"), JSIConverter<std::function<void(const margelo::nitro::lunardatepicker::LDP_Range&)>>::toJSI(runtime, arg.onDone));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "minimumDate"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.minimumDate));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "maximumDate"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.maximumDate));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "initialValue"), JSIConverter<std::optional<margelo::nitro::lunardatepicker::LDP_Range>>::toJSI(runtime, arg.initialValue));
      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, "theme")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "language")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "submitText")))) return false;
      if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fromText")))) return false;
      if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "toText")))) return false;
      if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "notSelectedText")))) return false;
      if (!JSIConverter<margelo::nitro::lunardatepicker::LDP_Mode>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mode")))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "showHeader")))) return false;
      if (!JSIConverter<std::function<void(const margelo::nitro::lunardatepicker::LDP_Range&)>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onDone")))) return false;
      if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minimumDate")))) return false;
      if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maximumDate")))) return false;
      if (!JSIConverter<std::optional<margelo::nitro::lunardatepicker::LDP_Range>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "initialValue")))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
