///
/// JNativeIosPermission.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 "NativeIosPermission.hpp"



namespace margelo::nitro::one {

  using namespace facebook;

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

  public:
    /**
     * Convert this Java/Kotlin-based struct to the C++ struct NativeIosPermission by copying all values to C++.
     */
    [[maybe_unused]]
    [[nodiscard]]
    NativeIosPermission toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldStatus = clazz->getField<double>("status");
      double status = this->getFieldValue(fieldStatus);
      return NativeIosPermission(
        status
      );
    }

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

} // namespace margelo::nitro::one
