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

// Forward declaration of `FawryLanguages` to properly resolve imports.
namespace margelo::nitro::fawrypay_rnfawrypaysdk { enum class FawryLanguages; }
// Forward declaration of `MerchantInfo` to properly resolve imports.
namespace margelo::nitro::fawrypay_rnfawrypaysdk { struct MerchantInfo; }
// Forward declaration of `CustomerInfo` to properly resolve imports.
namespace margelo::nitro::fawrypay_rnfawrypaysdk { struct CustomerInfo; }
// Forward declaration of `BillItems` to properly resolve imports.
namespace margelo::nitro::fawrypay_rnfawrypaysdk { struct BillItems; }
// Forward declaration of `LaunchApplePayModel` to properly resolve imports.
namespace margelo::nitro::fawrypay_rnfawrypaysdk { struct LaunchApplePayModel; }
// Forward declaration of `LaunchCheckoutModel` to properly resolve imports.
namespace margelo::nitro::fawrypay_rnfawrypaysdk { struct LaunchCheckoutModel; }

#include <string>
#include "FawryLanguages.hpp"
#include "MerchantInfo.hpp"
#include "CustomerInfo.hpp"
#include <vector>
#include "BillItems.hpp"
#include <optional>
#include "LaunchApplePayModel.hpp"
#include "LaunchCheckoutModel.hpp"

namespace margelo::nitro::fawrypay_rnfawrypaysdk {

  /**
   * A struct which can be represented as a JavaScript object (FawryLaunchModel).
   */
  struct FawryLaunchModel {
  public:
    std::string baseUrl     SWIFT_PRIVATE;
    FawryLanguages lang     SWIFT_PRIVATE;
    MerchantInfo merchantInfo     SWIFT_PRIVATE;
    CustomerInfo customerInfo     SWIFT_PRIVATE;
    std::vector<BillItems> items     SWIFT_PRIVATE;
    bool allow3DPayment     SWIFT_PRIVATE;
    bool skipReceipt     SWIFT_PRIVATE;
    bool skipLogin     SWIFT_PRIVATE;
    std::optional<bool> skipCustomerInput     SWIFT_PRIVATE;
    bool payWithCardToken     SWIFT_PRIVATE;
    bool authCaptureMode     SWIFT_PRIVATE;
    bool allowVoucher     SWIFT_PRIVATE;
    std::optional<std::string> paymentSignature     SWIFT_PRIVATE;
    std::optional<std::string> tokenizationSignature     SWIFT_PRIVATE;
    std::optional<std::string> paymentMethod     SWIFT_PRIVATE;
    std::optional<LaunchApplePayModel> launchApplePayModel     SWIFT_PRIVATE;
    std::optional<LaunchCheckoutModel> launchCheckoutModel     SWIFT_PRIVATE;

  public:
    FawryLaunchModel() = default;
    explicit FawryLaunchModel(std::string baseUrl, FawryLanguages lang, MerchantInfo merchantInfo, CustomerInfo customerInfo, std::vector<BillItems> items, bool allow3DPayment, bool skipReceipt, bool skipLogin, std::optional<bool> skipCustomerInput, bool payWithCardToken, bool authCaptureMode, bool allowVoucher, std::optional<std::string> paymentSignature, std::optional<std::string> tokenizationSignature, std::optional<std::string> paymentMethod, std::optional<LaunchApplePayModel> launchApplePayModel, std::optional<LaunchCheckoutModel> launchCheckoutModel): baseUrl(baseUrl), lang(lang), merchantInfo(merchantInfo), customerInfo(customerInfo), items(items), allow3DPayment(allow3DPayment), skipReceipt(skipReceipt), skipLogin(skipLogin), skipCustomerInput(skipCustomerInput), payWithCardToken(payWithCardToken), authCaptureMode(authCaptureMode), allowVoucher(allowVoucher), paymentSignature(paymentSignature), tokenizationSignature(tokenizationSignature), paymentMethod(paymentMethod), launchApplePayModel(launchApplePayModel), launchCheckoutModel(launchCheckoutModel) {}
  };

} // namespace margelo::nitro::fawrypay_rnfawrypaysdk

namespace margelo::nitro {

  using namespace margelo::nitro::fawrypay_rnfawrypaysdk;

  // C++ FawryLaunchModel <> JS FawryLaunchModel (object)
  template <>
  struct JSIConverter<FawryLaunchModel> final {
    static inline FawryLaunchModel fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return FawryLaunchModel(
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "baseUrl")),
        JSIConverter<FawryLanguages>::fromJSI(runtime, obj.getProperty(runtime, "lang")),
        JSIConverter<MerchantInfo>::fromJSI(runtime, obj.getProperty(runtime, "merchantInfo")),
        JSIConverter<CustomerInfo>::fromJSI(runtime, obj.getProperty(runtime, "customerInfo")),
        JSIConverter<std::vector<BillItems>>::fromJSI(runtime, obj.getProperty(runtime, "items")),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "allow3DPayment")),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "skipReceipt")),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "skipLogin")),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "skipCustomerInput")),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "payWithCardToken")),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "authCaptureMode")),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "allowVoucher")),
        JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "paymentSignature")),
        JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "tokenizationSignature")),
        JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "paymentMethod")),
        JSIConverter<std::optional<LaunchApplePayModel>>::fromJSI(runtime, obj.getProperty(runtime, "launchApplePayModel")),
        JSIConverter<std::optional<LaunchCheckoutModel>>::fromJSI(runtime, obj.getProperty(runtime, "launchCheckoutModel"))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const FawryLaunchModel& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, "baseUrl", JSIConverter<std::string>::toJSI(runtime, arg.baseUrl));
      obj.setProperty(runtime, "lang", JSIConverter<FawryLanguages>::toJSI(runtime, arg.lang));
      obj.setProperty(runtime, "merchantInfo", JSIConverter<MerchantInfo>::toJSI(runtime, arg.merchantInfo));
      obj.setProperty(runtime, "customerInfo", JSIConverter<CustomerInfo>::toJSI(runtime, arg.customerInfo));
      obj.setProperty(runtime, "items", JSIConverter<std::vector<BillItems>>::toJSI(runtime, arg.items));
      obj.setProperty(runtime, "allow3DPayment", JSIConverter<bool>::toJSI(runtime, arg.allow3DPayment));
      obj.setProperty(runtime, "skipReceipt", JSIConverter<bool>::toJSI(runtime, arg.skipReceipt));
      obj.setProperty(runtime, "skipLogin", JSIConverter<bool>::toJSI(runtime, arg.skipLogin));
      obj.setProperty(runtime, "skipCustomerInput", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.skipCustomerInput));
      obj.setProperty(runtime, "payWithCardToken", JSIConverter<bool>::toJSI(runtime, arg.payWithCardToken));
      obj.setProperty(runtime, "authCaptureMode", JSIConverter<bool>::toJSI(runtime, arg.authCaptureMode));
      obj.setProperty(runtime, "allowVoucher", JSIConverter<bool>::toJSI(runtime, arg.allowVoucher));
      obj.setProperty(runtime, "paymentSignature", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.paymentSignature));
      obj.setProperty(runtime, "tokenizationSignature", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.tokenizationSignature));
      obj.setProperty(runtime, "paymentMethod", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.paymentMethod));
      obj.setProperty(runtime, "launchApplePayModel", JSIConverter<std::optional<LaunchApplePayModel>>::toJSI(runtime, arg.launchApplePayModel));
      obj.setProperty(runtime, "launchCheckoutModel", JSIConverter<std::optional<LaunchCheckoutModel>>::toJSI(runtime, arg.launchCheckoutModel));
      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::string>::canConvert(runtime, obj.getProperty(runtime, "baseUrl"))) return false;
      if (!JSIConverter<FawryLanguages>::canConvert(runtime, obj.getProperty(runtime, "lang"))) return false;
      if (!JSIConverter<MerchantInfo>::canConvert(runtime, obj.getProperty(runtime, "merchantInfo"))) return false;
      if (!JSIConverter<CustomerInfo>::canConvert(runtime, obj.getProperty(runtime, "customerInfo"))) return false;
      if (!JSIConverter<std::vector<BillItems>>::canConvert(runtime, obj.getProperty(runtime, "items"))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "allow3DPayment"))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "skipReceipt"))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "skipLogin"))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "skipCustomerInput"))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "payWithCardToken"))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "authCaptureMode"))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "allowVoucher"))) return false;
      if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "paymentSignature"))) return false;
      if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "tokenizationSignature"))) return false;
      if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "paymentMethod"))) return false;
      if (!JSIConverter<std::optional<LaunchApplePayModel>>::canConvert(runtime, obj.getProperty(runtime, "launchApplePayModel"))) return false;
      if (!JSIConverter<std::optional<LaunchCheckoutModel>>::canConvert(runtime, obj.getProperty(runtime, "launchCheckoutModel"))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
