///
/// JDeleteRecordParams.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 "DeleteRecordParams.hpp"

#include <string>

namespace margelo::nitro::cloudkitmodule {

  using namespace facebook;

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

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

} // namespace margelo::nitro::cloudkitmodule
