///
/// StateOfMindSample.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 `StateOfMindKind` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class StateOfMindKind; }
// Forward declaration of `StateOfMindValenceClassification` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class StateOfMindValenceClassification; }
// Forward declaration of `StateOfMindAssociation` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class StateOfMindAssociation; }
// Forward declaration of `StateOfMindLabel` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class StateOfMindLabel; }
// Forward declaration of `SampleType` to properly resolve imports.
namespace margelo::nitro::healthkit { struct SampleType; }
// Forward declaration of `SourceRevision` to properly resolve imports.
namespace margelo::nitro::healthkit { struct SourceRevision; }
// Forward declaration of `Device` to properly resolve imports.
namespace margelo::nitro::healthkit { struct Device; }

#include "StateOfMindKind.hpp"
#include "StateOfMindValenceClassification.hpp"
#include "StateOfMindAssociation.hpp"
#include <vector>
#include "StateOfMindLabel.hpp"
#include "SampleType.hpp"
#include <chrono>
#include <NitroModules/AnyMap.hpp>
#include <string>
#include "SourceRevision.hpp"
#include "Device.hpp"
#include <optional>

namespace margelo::nitro::healthkit {

  /**
   * A struct which can be represented as a JavaScript object (StateOfMindSample).
   */
  struct StateOfMindSample final {
  public:
    double valence     SWIFT_PRIVATE;
    StateOfMindKind kind     SWIFT_PRIVATE;
    StateOfMindValenceClassification valenceClassification     SWIFT_PRIVATE;
    std::vector<StateOfMindAssociation> associations     SWIFT_PRIVATE;
    std::vector<StateOfMindLabel> labels     SWIFT_PRIVATE;
    SampleType sampleType     SWIFT_PRIVATE;
    std::chrono::system_clock::time_point startDate     SWIFT_PRIVATE;
    std::chrono::system_clock::time_point endDate     SWIFT_PRIVATE;
    bool hasUndeterminedDuration     SWIFT_PRIVATE;
    std::shared_ptr<AnyMap> metadata     SWIFT_PRIVATE;
    std::string uuid     SWIFT_PRIVATE;
    SourceRevision sourceRevision     SWIFT_PRIVATE;
    std::optional<Device> device     SWIFT_PRIVATE;

  public:
    StateOfMindSample() = default;
    explicit StateOfMindSample(double valence, StateOfMindKind kind, StateOfMindValenceClassification valenceClassification, std::vector<StateOfMindAssociation> associations, std::vector<StateOfMindLabel> labels, SampleType sampleType, std::chrono::system_clock::time_point startDate, std::chrono::system_clock::time_point endDate, bool hasUndeterminedDuration, std::shared_ptr<AnyMap> metadata, std::string uuid, SourceRevision sourceRevision, std::optional<Device> device): valence(valence), kind(kind), valenceClassification(valenceClassification), associations(associations), labels(labels), sampleType(sampleType), startDate(startDate), endDate(endDate), hasUndeterminedDuration(hasUndeterminedDuration), metadata(metadata), uuid(uuid), sourceRevision(sourceRevision), device(device) {}

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

} // namespace margelo::nitro::healthkit

namespace margelo::nitro {

  // C++ StateOfMindSample <> JS StateOfMindSample (object)
  template <>
  struct JSIConverter<margelo::nitro::healthkit::StateOfMindSample> final {
    static inline margelo::nitro::healthkit::StateOfMindSample fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return margelo::nitro::healthkit::StateOfMindSample(
        JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "valence"))),
        JSIConverter<margelo::nitro::healthkit::StateOfMindKind>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "kind"))),
        JSIConverter<margelo::nitro::healthkit::StateOfMindValenceClassification>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "valenceClassification"))),
        JSIConverter<std::vector<margelo::nitro::healthkit::StateOfMindAssociation>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "associations"))),
        JSIConverter<std::vector<margelo::nitro::healthkit::StateOfMindLabel>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "labels"))),
        JSIConverter<margelo::nitro::healthkit::SampleType>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sampleType"))),
        JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))),
        JSIConverter<std::chrono::system_clock::time_point>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))),
        JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"))),
        JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid"))),
        JSIConverter<margelo::nitro::healthkit::SourceRevision>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"))),
        JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::healthkit::StateOfMindSample& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "valence"), JSIConverter<double>::toJSI(runtime, arg.valence));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "kind"), JSIConverter<margelo::nitro::healthkit::StateOfMindKind>::toJSI(runtime, arg.kind));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "valenceClassification"), JSIConverter<margelo::nitro::healthkit::StateOfMindValenceClassification>::toJSI(runtime, arg.valenceClassification));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "associations"), JSIConverter<std::vector<margelo::nitro::healthkit::StateOfMindAssociation>>::toJSI(runtime, arg.associations));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "labels"), JSIConverter<std::vector<margelo::nitro::healthkit::StateOfMindLabel>>::toJSI(runtime, arg.labels));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "sampleType"), JSIConverter<margelo::nitro::healthkit::SampleType>::toJSI(runtime, arg.sampleType));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.startDate));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter<std::chrono::system_clock::time_point>::toJSI(runtime, arg.endDate));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration"), JSIConverter<bool>::toJSI(runtime, arg.hasUndeterminedDuration));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.metadata));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "uuid"), JSIConverter<std::string>::toJSI(runtime, arg.uuid));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision"), JSIConverter<margelo::nitro::healthkit::SourceRevision>::toJSI(runtime, arg.sourceRevision));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "device"), JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::toJSI(runtime, arg.device));
      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<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "valence")))) return false;
      if (!JSIConverter<margelo::nitro::healthkit::StateOfMindKind>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "kind")))) return false;
      if (!JSIConverter<margelo::nitro::healthkit::StateOfMindValenceClassification>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "valenceClassification")))) return false;
      if (!JSIConverter<std::vector<margelo::nitro::healthkit::StateOfMindAssociation>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "associations")))) return false;
      if (!JSIConverter<std::vector<margelo::nitro::healthkit::StateOfMindLabel>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "labels")))) return false;
      if (!JSIConverter<margelo::nitro::healthkit::SampleType>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sampleType")))) return false;
      if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false;
      if (!JSIConverter<std::chrono::system_clock::time_point>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false;
      if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasUndeterminedDuration")))) return false;
      if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uuid")))) return false;
      if (!JSIConverter<margelo::nitro::healthkit::SourceRevision>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceRevision")))) return false;
      if (!JSIConverter<std::optional<margelo::nitro::healthkit::Device>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "device")))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
