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

#pragma once

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

#include <string>

namespace margelo::nitro::iap {

  using namespace facebook;

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

  public:
    /**
     * Convert this Java/Kotlin-based struct to the C++ struct NitroVerifyPurchaseWithIapkitAppleProps by copying all values to C++.
     */
    [[maybe_unused]]
    [[nodiscard]]
    NitroVerifyPurchaseWithIapkitAppleProps toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldJws = clazz->getField<jni::JString>("jws");
      jni::local_ref<jni::JString> jws = this->getFieldValue(fieldJws);
      return NitroVerifyPurchaseWithIapkitAppleProps(
        jws->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<JNitroVerifyPurchaseWithIapkitAppleProps::javaobject> fromCpp(const NitroVerifyPurchaseWithIapkitAppleProps& value) {
      using JSignature = JNitroVerifyPurchaseWithIapkitAppleProps(jni::alias_ref<jni::JString>);
      static const auto clazz = javaClassStatic();
      static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
      return create(
        clazz,
        jni::make_jstring(value.jws)
      );
    }
  };

} // namespace margelo::nitro::iap
