///
/// JWinBackOfferInputIOS.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 "WinBackOfferInputIOS.hpp"

#include <string>

namespace margelo::nitro::iap {

  using namespace facebook;

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

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

} // namespace margelo::nitro::iap
