///
/// JGoogleSignInButtonNativeSize.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 "GoogleSignInButtonNativeSize.hpp"

namespace margelo::nitro::nitrogooglesignin {

  using namespace facebook;

  /**
   * The C++ JNI bridge between the C++ enum "GoogleSignInButtonNativeSize" and the Kotlin enum "GoogleSignInButtonNativeSize".
   */
  struct JGoogleSignInButtonNativeSize final: public jni::JavaClass<JGoogleSignInButtonNativeSize> {
  public:
    static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrogooglesignin/GoogleSignInButtonNativeSize;";

  public:
    /**
     * Convert this Java/Kotlin-based enum to the C++ enum GoogleSignInButtonNativeSize.
     */
    [[maybe_unused]]
    [[nodiscard]]
    GoogleSignInButtonNativeSize toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldOrdinal = clazz->getField<int>("value");
      int ordinal = this->getFieldValue(fieldOrdinal);
      return static_cast<GoogleSignInButtonNativeSize>(ordinal);
    }

  public:
    /**
     * Create a Java/Kotlin-based enum with the given C++ enum's value.
     */
    [[maybe_unused]]
    static jni::alias_ref<JGoogleSignInButtonNativeSize> fromCpp(GoogleSignInButtonNativeSize value) {
      static const auto clazz = javaClassStatic();
      switch (value) {
        case GoogleSignInButtonNativeSize::STANDARD:
          static const auto fieldSTANDARD = clazz->getStaticField<JGoogleSignInButtonNativeSize>("STANDARD");
          return clazz->getStaticFieldValue(fieldSTANDARD);
        case GoogleSignInButtonNativeSize::WIDE:
          static const auto fieldWIDE = clazz->getStaticField<JGoogleSignInButtonNativeSize>("WIDE");
          return clazz->getStaticFieldValue(fieldWIDE);
        case GoogleSignInButtonNativeSize::ICON:
          static const auto fieldICON = clazz->getStaticField<JGoogleSignInButtonNativeSize>("ICON");
          return clazz->getStaticFieldValue(fieldICON);
        default:
          std::string stringValue = std::to_string(static_cast<int>(value));
          throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
      }
    }
  };

} // namespace margelo::nitro::nitrogooglesignin
