///
/// JLaunchApplePayModel.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///

#pragma once

#include <fbjni/fbjni.h>
#include "LaunchApplePayModel.hpp"

#include <string>

namespace margelo::nitro::fawrypay_rnfawrypaysdk {

  using namespace facebook;

  /**
   * The C++ JNI bridge between the C++ struct "LaunchApplePayModel" and the the Kotlin data class "LaunchApplePayModel".
   */
  struct JLaunchApplePayModel final: public jni::JavaClass<JLaunchApplePayModel> {
  public:
    static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/fawrypay/rnfawrypaysdk/LaunchApplePayModel;";

  public:
    /**
     * Convert this Java/Kotlin-based struct to the C++ struct LaunchApplePayModel by copying all values to C++.
     */
    [[maybe_unused]]
    [[nodiscard]]
    LaunchApplePayModel toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldMerchantID = clazz->getField<jni::JString>("merchantID");
      jni::local_ref<jni::JString> merchantID = this->getFieldValue(fieldMerchantID);
      return LaunchApplePayModel(
        merchantID->toStdString()
      );
    }

  public:
    /**
     * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
     */
    [[maybe_unused]]
    static jni::local_ref<JLaunchApplePayModel::javaobject> fromCpp(const LaunchApplePayModel& value) {
      return newInstance(
        jni::make_jstring(value.merchantID)
      );
    }
  };

} // namespace margelo::nitro::fawrypay_rnfawrypaysdk
