///
/// ActivitySummary.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
#if __has_include(<NitroModules/JSIHelpers.hpp>)
#include <NitroModules/JSIHelpers.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
#include <NitroModules/PropNameIDCache.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

// Forward declaration of `ActivitySummaryDateComponents` to properly resolve imports.
namespace margelo::nitro::healthkit { struct ActivitySummaryDateComponents; }
// Forward declaration of `ActivityMoveMode` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class ActivityMoveMode; }
// Forward declaration of `Quantity` to properly resolve imports.
namespace margelo::nitro::healthkit { struct Quantity; }

#include "ActivitySummaryDateComponents.hpp"
#include "ActivityMoveMode.hpp"
#include "Quantity.hpp"
#include <optional>

namespace margelo::nitro::healthkit {

  /**
   * A struct which can be represented as a JavaScript object (ActivitySummary).
   */
  struct ActivitySummary final {
  public:
    ActivitySummaryDateComponents dateComponents     SWIFT_PRIVATE;
    ActivityMoveMode activityMoveMode     SWIFT_PRIVATE;
    Quantity activeEnergyBurned     SWIFT_PRIVATE;
    Quantity activeEnergyBurnedGoal     SWIFT_PRIVATE;
    Quantity appleExerciseTime     SWIFT_PRIVATE;
    Quantity appleExerciseTimeGoal     SWIFT_PRIVATE;
    Quantity appleStandHours     SWIFT_PRIVATE;
    Quantity appleStandHoursGoal     SWIFT_PRIVATE;
    std::optional<Quantity> appleMoveTime     SWIFT_PRIVATE;
    std::optional<Quantity> appleMoveTimeGoal     SWIFT_PRIVATE;
    std::optional<bool> isPaused     SWIFT_PRIVATE;

  public:
    ActivitySummary() = default;
    explicit ActivitySummary(ActivitySummaryDateComponents dateComponents, ActivityMoveMode activityMoveMode, Quantity activeEnergyBurned, Quantity activeEnergyBurnedGoal, Quantity appleExerciseTime, Quantity appleExerciseTimeGoal, Quantity appleStandHours, Quantity appleStandHoursGoal, std::optional<Quantity> appleMoveTime, std::optional<Quantity> appleMoveTimeGoal, std::optional<bool> isPaused): dateComponents(dateComponents), activityMoveMode(activityMoveMode), activeEnergyBurned(activeEnergyBurned), activeEnergyBurnedGoal(activeEnergyBurnedGoal), appleExerciseTime(appleExerciseTime), appleExerciseTimeGoal(appleExerciseTimeGoal), appleStandHours(appleStandHours), appleStandHoursGoal(appleStandHoursGoal), appleMoveTime(appleMoveTime), appleMoveTimeGoal(appleMoveTimeGoal), isPaused(isPaused) {}

  public:
    friend bool operator==(const ActivitySummary& lhs, const ActivitySummary& rhs) = default;
  };

} // namespace margelo::nitro::healthkit

namespace margelo::nitro {

  // C++ ActivitySummary <> JS ActivitySummary (object)
  template <>
  struct JSIConverter<margelo::nitro::healthkit::ActivitySummary> final {
    static inline margelo::nitro::healthkit::ActivitySummary fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return margelo::nitro::healthkit::ActivitySummary(
        JSIConverter<margelo::nitro::healthkit::ActivitySummaryDateComponents>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "dateComponents"))),
        JSIConverter<margelo::nitro::healthkit::ActivityMoveMode>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "activityMoveMode"))),
        JSIConverter<margelo::nitro::healthkit::Quantity>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "activeEnergyBurned"))),
        JSIConverter<margelo::nitro::healthkit::Quantity>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "activeEnergyBurnedGoal"))),
        JSIConverter<margelo::nitro::healthkit::Quantity>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appleExerciseTime"))),
        JSIConverter<margelo::nitro::healthkit::Quantity>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appleExerciseTimeGoal"))),
        JSIConverter<margelo::nitro::healthkit::Quantity>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appleStandHours"))),
        JSIConverter<margelo::nitro::healthkit::Quantity>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appleStandHoursGoal"))),
        JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appleMoveTime"))),
        JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appleMoveTimeGoal"))),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isPaused")))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::ActivitySummary& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "dateComponents"), JSIConverter<margelo::nitro::healthkit::ActivitySummaryDateComponents>::toJSI(runtime, arg.dateComponents));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "activityMoveMode"), JSIConverter<margelo::nitro::healthkit::ActivityMoveMode>::toJSI(runtime, arg.activityMoveMode));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "activeEnergyBurned"), JSIConverter<margelo::nitro::healthkit::Quantity>::toJSI(runtime, arg.activeEnergyBurned));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "activeEnergyBurnedGoal"), JSIConverter<margelo::nitro::healthkit::Quantity>::toJSI(runtime, arg.activeEnergyBurnedGoal));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "appleExerciseTime"), JSIConverter<margelo::nitro::healthkit::Quantity>::toJSI(runtime, arg.appleExerciseTime));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "appleExerciseTimeGoal"), JSIConverter<margelo::nitro::healthkit::Quantity>::toJSI(runtime, arg.appleExerciseTimeGoal));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "appleStandHours"), JSIConverter<margelo::nitro::healthkit::Quantity>::toJSI(runtime, arg.appleStandHours));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "appleStandHoursGoal"), JSIConverter<margelo::nitro::healthkit::Quantity>::toJSI(runtime, arg.appleStandHoursGoal));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "appleMoveTime"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.appleMoveTime));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "appleMoveTimeGoal"), JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::toJSI(runtime, arg.appleMoveTimeGoal));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "isPaused"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isPaused));
      return obj;
    }
    static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
      if (!value.isObject()) {
        return false;
      }
      jsi::Object obj = value.getObject(runtime);
      if (!nitro::isPlainObject(runtime, obj)) {
        return false;
      }
      if (!JSIConverter<margelo::nitro::healthkit::ActivitySummaryDateComponents>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "dateComponents")))) return false;
      if (!JSIConverter<margelo::nitro::healthkit::ActivityMoveMode>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "activityMoveMode")))) return false;
      if (!JSIConverter<margelo::nitro::healthkit::Quantity>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "activeEnergyBurned")))) return false;
      if (!JSIConverter<margelo::nitro::healthkit::Quantity>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "activeEnergyBurnedGoal")))) return false;
      if (!JSIConverter<margelo::nitro::healthkit::Quantity>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appleExerciseTime")))) return false;
      if (!JSIConverter<margelo::nitro::healthkit::Quantity>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appleExerciseTimeGoal")))) return false;
      if (!JSIConverter<margelo::nitro::healthkit::Quantity>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appleStandHours")))) return false;
      if (!JSIConverter<margelo::nitro::healthkit::Quantity>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appleStandHoursGoal")))) return false;
      if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appleMoveTime")))) return false;
      if (!JSIConverter<std::optional<margelo::nitro::healthkit::Quantity>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appleMoveTimeGoal")))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isPaused")))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
