///
/// JGoogleSignInButtonContentAlignment.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 "GoogleSignInButtonContentAlignment.hpp"

namespace margelo::nitro::nitrogooglesignin {

  using namespace facebook;

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

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

  public:
    /**
     * Create a Java/Kotlin-based enum with the given C++ enum's value.
     */
    [[maybe_unused]]
    static jni::alias_ref<JGoogleSignInButtonContentAlignment> fromCpp(GoogleSignInButtonContentAlignment value) {
      static const auto clazz = javaClassStatic();
      switch (value) {
        case GoogleSignInButtonContentAlignment::CENTER:
          static const auto fieldCENTER = clazz->getStaticField<JGoogleSignInButtonContentAlignment>("CENTER");
          return clazz->getStaticFieldValue(fieldCENTER);
        case GoogleSignInButtonContentAlignment::LEADING:
          static const auto fieldLEADING = clazz->getStaticField<JGoogleSignInButtonContentAlignment>("LEADING");
          return clazz->getStaticFieldValue(fieldLEADING);
        case GoogleSignInButtonContentAlignment::TRAILING:
          static const auto fieldTRAILING = clazz->getStaticField<JGoogleSignInButtonContentAlignment>("TRAILING");
          return clazz->getStaticFieldValue(fieldTRAILING);
        default:
          std::string stringValue = std::to_string(static_cast<int>(value));
          throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
      }
    }
  };

} // namespace margelo::nitro::nitrogooglesignin
