///
/// StateOfMindLabel.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#if __has_include(<NitroModules/JSIConverter.hpp>)
#include <NitroModules/JSIConverter.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/NitroDefines.hpp>)
#include <NitroModules/NitroDefines.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

namespace margelo::nitro::healthkit {

  /**
   * An enum which can be represented as a JavaScript enum (StateOfMindLabel).
   */
  enum class StateOfMindLabel {
    AMAZED      SWIFT_NAME(amazed) = 1,
    AMUSED      SWIFT_NAME(amused) = 2,
    ANGRY      SWIFT_NAME(angry) = 3,
    ANXIOUS      SWIFT_NAME(anxious) = 4,
    ASHAMED      SWIFT_NAME(ashamed) = 5,
    BRAVE      SWIFT_NAME(brave) = 6,
    CALM      SWIFT_NAME(calm) = 7,
    CONTENT      SWIFT_NAME(content) = 8,
    DISAPPOINTED      SWIFT_NAME(disappointed) = 9,
    DISCOURAGED      SWIFT_NAME(discouraged) = 10,
    DISGUSTED      SWIFT_NAME(disgusted) = 11,
    EMBARRASSED      SWIFT_NAME(embarrassed) = 12,
    EXCITED      SWIFT_NAME(excited) = 13,
    FRUSTRATED      SWIFT_NAME(frustrated) = 14,
    GRATEFUL      SWIFT_NAME(grateful) = 15,
    GUILTY      SWIFT_NAME(guilty) = 16,
    HAPPY      SWIFT_NAME(happy) = 17,
    HOPELESS      SWIFT_NAME(hopeless) = 18,
    IRRITATED      SWIFT_NAME(irritated) = 19,
    JEALOUS      SWIFT_NAME(jealous) = 20,
    JOYFUL      SWIFT_NAME(joyful) = 21,
    LONELY      SWIFT_NAME(lonely) = 22,
    PASSIONATE      SWIFT_NAME(passionate) = 23,
    PEACEFUL      SWIFT_NAME(peaceful) = 24,
    PROUD      SWIFT_NAME(proud) = 25,
    RELIEVED      SWIFT_NAME(relieved) = 26,
    SAD      SWIFT_NAME(sad) = 27,
    SCARED      SWIFT_NAME(scared) = 28,
    STRESSED      SWIFT_NAME(stressed) = 29,
    SURPRISED      SWIFT_NAME(surprised) = 30,
    WORRIED      SWIFT_NAME(worried) = 31,
    ANNOYED      SWIFT_NAME(annoyed) = 32,
    CONFIDENT      SWIFT_NAME(confident) = 33,
    DRAINED      SWIFT_NAME(drained) = 34,
    HOPEFUL      SWIFT_NAME(hopeful) = 35,
    INDIFFERENT      SWIFT_NAME(indifferent) = 36,
    OVERWHELMED      SWIFT_NAME(overwhelmed) = 37,
    SATISFIED      SWIFT_NAME(satisfied) = 38,
  } CLOSED_ENUM;

} // namespace margelo::nitro::healthkit

namespace margelo::nitro {

  // C++ StateOfMindLabel <> JS StateOfMindLabel (enum)
  template <>
  struct JSIConverter<margelo::nitro::healthkit::StateOfMindLabel> final {
    static inline margelo::nitro::healthkit::StateOfMindLabel fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
      return static_cast<margelo::nitro::healthkit::StateOfMindLabel>(enumValue);
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::healthkit::StateOfMindLabel arg) {
      int enumValue = static_cast<int>(arg);
      return JSIConverter<int>::toJSI(runtime, enumValue);
    }
    static inline bool canConvert(jsi::Runtime&, const jsi::Value& value) {
      if (!value.isNumber()) {
        return false;
      }
      double number = value.getNumber();
      int integer = static_cast<int>(number);
      if (number != integer) {
        // The integer is not the same value as the double - we truncated floating points.
        // Enums are all integers, so the input floating point number is obviously invalid.
        return false;
      }
      // Check if we are within the bounds of the enum.
      return integer >= 1 && integer <= 38;
    }
  };

} // namespace margelo::nitro
