///
/// NativeNotificationCategoryOptions.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 <optional>
#include <string>
#include <vector>

namespace margelo::nitro::one {

  /**
   * A struct which can be represented as a JavaScript object (NativeNotificationCategoryOptions).
   */
  struct NativeNotificationCategoryOptions final {
  public:
    std::optional<bool> allowInCarPlay     SWIFT_PRIVATE;
    std::optional<std::string> categorySummaryFormat     SWIFT_PRIVATE;
    std::optional<bool> customDismissAction     SWIFT_PRIVATE;
    std::optional<std::vector<std::string>> intentIdentifiers     SWIFT_PRIVATE;
    std::optional<std::string> previewPlaceholder     SWIFT_PRIVATE;
    std::optional<bool> showTitle     SWIFT_PRIVATE;
    std::optional<bool> showSubtitle     SWIFT_PRIVATE;

  public:
    NativeNotificationCategoryOptions() = default;
    explicit NativeNotificationCategoryOptions(std::optional<bool> allowInCarPlay, std::optional<std::string> categorySummaryFormat, std::optional<bool> customDismissAction, std::optional<std::vector<std::string>> intentIdentifiers, std::optional<std::string> previewPlaceholder, std::optional<bool> showTitle, std::optional<bool> showSubtitle): allowInCarPlay(allowInCarPlay), categorySummaryFormat(categorySummaryFormat), customDismissAction(customDismissAction), intentIdentifiers(intentIdentifiers), previewPlaceholder(previewPlaceholder), showTitle(showTitle), showSubtitle(showSubtitle) {}

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

} // namespace margelo::nitro::one

namespace margelo::nitro {

  // C++ NativeNotificationCategoryOptions <> JS NativeNotificationCategoryOptions (object)
  template <>
  struct JSIConverter<margelo::nitro::one::NativeNotificationCategoryOptions> final {
    static inline margelo::nitro::one::NativeNotificationCategoryOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return margelo::nitro::one::NativeNotificationCategoryOptions(
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "allowInCarPlay"))),
        JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "categorySummaryFormat"))),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "customDismissAction"))),
        JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "intentIdentifiers"))),
        JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "previewPlaceholder"))),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "showTitle"))),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "showSubtitle")))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::one::NativeNotificationCategoryOptions& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "allowInCarPlay"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.allowInCarPlay));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "categorySummaryFormat"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.categorySummaryFormat));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "customDismissAction"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.customDismissAction));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "intentIdentifiers"), JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.intentIdentifiers));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "previewPlaceholder"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.previewPlaceholder));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "showTitle"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.showTitle));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "showSubtitle"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.showSubtitle));
      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<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "allowInCarPlay")))) return false;
      if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "categorySummaryFormat")))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "customDismissAction")))) return false;
      if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "intentIdentifiers")))) return false;
      if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "previewPlaceholder")))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "showTitle")))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "showSubtitle")))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
