///
/// JNativeNotification.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 "NativeNotification.hpp"

#include "JNativeContent.hpp"
#include "JNativeNotificationRequest.hpp"
#include "JNativeTrigger.hpp"
#include "JNativeTriggerType.hpp"
#include "NativeContent.hpp"
#include "NativeNotificationRequest.hpp"
#include "NativeTrigger.hpp"
#include "NativeTriggerType.hpp"
#include <NitroModules/AnyMap.hpp>
#include <NitroModules/JAnyMap.hpp>
#include <optional>
#include <string>

namespace margelo::nitro::one {

  using namespace facebook;

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

  public:
    /**
     * Convert this Java/Kotlin-based struct to the C++ struct NativeNotification by copying all values to C++.
     */
    [[maybe_unused]]
    [[nodiscard]]
    NativeNotification toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldRequest = clazz->getField<JNativeNotificationRequest>("request");
      jni::local_ref<JNativeNotificationRequest> request = this->getFieldValue(fieldRequest);
      static const auto fieldDate = clazz->getField<double>("date");
      double date = this->getFieldValue(fieldDate);
      return NativeNotification(
        request->toCpp(),
        date
      );
    }

  public:
    /**
     * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
     */
    [[maybe_unused]]
    static jni::local_ref<JNativeNotification::javaobject> fromCpp(const NativeNotification& value) {
      using JSignature = JNativeNotification(jni::alias_ref<JNativeNotificationRequest>, double);
      static const auto clazz = javaClassStatic();
      static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
      return create(
        clazz,
        JNativeNotificationRequest::fromCpp(value.request),
        value.date
      );
    }
  };

} // namespace margelo::nitro::one
