///
/// BarkArkInfo.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::nitroark {

  /**
   * A struct which can be represented as a JavaScript object (BarkArkInfo).
   */
  struct BarkArkInfo final {
  public:
    std::string network     SWIFT_PRIVATE;
    std::string server_pubkey     SWIFT_PRIVATE;
    std::string mailbox_pubkey     SWIFT_PRIVATE;
    double round_interval     SWIFT_PRIVATE;
    double nb_round_nonces     SWIFT_PRIVATE;
    double vtxo_exit_delta     SWIFT_PRIVATE;
    double vtxo_lifetime     SWIFT_PRIVATE;
    double htlc_send_expiry_delta     SWIFT_PRIVATE;
    double max_vtxo_amount     SWIFT_PRIVATE;
    double required_board_confirmations     SWIFT_PRIVATE;
    double min_board_amount     SWIFT_PRIVATE;
    bool ln_receive_anti_dos_required     SWIFT_PRIVATE;

  public:
    BarkArkInfo() = default;
    explicit BarkArkInfo(std::string network, std::string server_pubkey, std::string mailbox_pubkey, double round_interval, double nb_round_nonces, double vtxo_exit_delta, double vtxo_lifetime, double htlc_send_expiry_delta, double max_vtxo_amount, double required_board_confirmations, double min_board_amount, bool ln_receive_anti_dos_required): network(network), server_pubkey(server_pubkey), mailbox_pubkey(mailbox_pubkey), round_interval(round_interval), nb_round_nonces(nb_round_nonces), vtxo_exit_delta(vtxo_exit_delta), vtxo_lifetime(vtxo_lifetime), htlc_send_expiry_delta(htlc_send_expiry_delta), max_vtxo_amount(max_vtxo_amount), required_board_confirmations(required_board_confirmations), min_board_amount(min_board_amount), ln_receive_anti_dos_required(ln_receive_anti_dos_required) {}

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

} // namespace margelo::nitro::nitroark

namespace margelo::nitro {

  // C++ BarkArkInfo <> JS BarkArkInfo (object)
  template <>
  struct JSIConverter<margelo::nitro::nitroark::BarkArkInfo> final {
    static inline margelo::nitro::nitroark::BarkArkInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return margelo::nitro::nitroark::BarkArkInfo(
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "network"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "server_pubkey"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mailbox_pubkey"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "round_interval"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "nb_round_nonces"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "vtxo_exit_delta"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "vtxo_lifetime"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "htlc_send_expiry_delta"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "max_vtxo_amount"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "required_board_confirmations"))),
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "min_board_amount"))),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "ln_receive_anti_dos_required")))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkArkInfo& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "network"), JSIConverter<std::string>::toJSI(runtime, arg.network));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "server_pubkey"), JSIConverter<std::string>::toJSI(runtime, arg.server_pubkey));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "mailbox_pubkey"), JSIConverter<std::string>::toJSI(runtime, arg.mailbox_pubkey));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "round_interval"), JSIConverter<double>::toJSI(runtime, arg.round_interval));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "nb_round_nonces"), JSIConverter<double>::toJSI(runtime, arg.nb_round_nonces));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "vtxo_exit_delta"), JSIConverter<double>::toJSI(runtime, arg.vtxo_exit_delta));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "vtxo_lifetime"), JSIConverter<double>::toJSI(runtime, arg.vtxo_lifetime));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "htlc_send_expiry_delta"), JSIConverter<double>::toJSI(runtime, arg.htlc_send_expiry_delta));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "max_vtxo_amount"), JSIConverter<double>::toJSI(runtime, arg.max_vtxo_amount));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "required_board_confirmations"), JSIConverter<double>::toJSI(runtime, arg.required_board_confirmations));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "min_board_amount"), JSIConverter<double>::toJSI(runtime, arg.min_board_amount));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "ln_receive_anti_dos_required"), JSIConverter<bool>::toJSI(runtime, arg.ln_receive_anti_dos_required));
      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, "network")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "server_pubkey")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mailbox_pubkey")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "round_interval")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "nb_round_nonces")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "vtxo_exit_delta")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "vtxo_lifetime")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "htlc_send_expiry_delta")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "max_vtxo_amount")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "required_board_confirmations")))) return false;
      if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "min_board_amount")))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "ln_receive_anti_dos_required")))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
