/// /// NativeHeartbeatSeriesSummary.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() #include #else #error NitroModules cannot be found! Are you sure you installed NitroModules properly? #endif #if __has_include() #include #else #error NitroModules cannot be found! Are you sure you installed NitroModules properly? #endif #if __has_include() #include #else #error NitroModules cannot be found! Are you sure you installed NitroModules properly? #endif #if __has_include() #include #else #error NitroModules cannot be found! Are you sure you installed NitroModules properly? #endif #include #include #include namespace margelo::nitro::haptika::ppg { /** * A struct which can be represented as a JavaScript object (NativeHeartbeatSeriesSummary). */ struct NativeHeartbeatSeriesSummary final { public: std::string startDate SWIFT_PRIVATE; std::string endDate SWIFT_PRIVATE; std::optional sourceName SWIFT_PRIVATE; std::optional sourceBundleIdentifier SWIFT_PRIVATE; std::vector heartbeatTimesSinceSeriesStartSeconds SWIFT_PRIVATE; std::vector precededByGapIndexes SWIFT_PRIVATE; public: NativeHeartbeatSeriesSummary() = default; explicit NativeHeartbeatSeriesSummary(std::string startDate, std::string endDate, std::optional sourceName, std::optional sourceBundleIdentifier, std::vector heartbeatTimesSinceSeriesStartSeconds, std::vector precededByGapIndexes): startDate(startDate), endDate(endDate), sourceName(sourceName), sourceBundleIdentifier(sourceBundleIdentifier), heartbeatTimesSinceSeriesStartSeconds(heartbeatTimesSinceSeriesStartSeconds), precededByGapIndexes(precededByGapIndexes) {} public: friend bool operator==(const NativeHeartbeatSeriesSummary& lhs, const NativeHeartbeatSeriesSummary& rhs) = default; }; } // namespace margelo::nitro::haptika::ppg namespace margelo::nitro { // C++ NativeHeartbeatSeriesSummary <> JS NativeHeartbeatSeriesSummary (object) template <> struct JSIConverter final { static inline margelo::nitro::haptika::ppg::NativeHeartbeatSeriesSummary fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); return margelo::nitro::haptika::ppg::NativeHeartbeatSeriesSummary( JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate"))), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate"))), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceName"))), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceBundleIdentifier"))), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "heartbeatTimesSinceSeriesStartSeconds"))), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "precededByGapIndexes"))) ); } static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::haptika::ppg::NativeHeartbeatSeriesSummary& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, PropNameIDCache::get(runtime, "startDate"), JSIConverter::toJSI(runtime, arg.startDate)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "endDate"), JSIConverter::toJSI(runtime, arg.endDate)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceName"), JSIConverter>::toJSI(runtime, arg.sourceName)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "sourceBundleIdentifier"), JSIConverter>::toJSI(runtime, arg.sourceBundleIdentifier)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "heartbeatTimesSinceSeriesStartSeconds"), JSIConverter>::toJSI(runtime, arg.heartbeatTimesSinceSeriesStartSeconds)); obj.setProperty(runtime, PropNameIDCache::get(runtime, "precededByGapIndexes"), JSIConverter>::toJSI(runtime, arg.precededByGapIndexes)); 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::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "startDate")))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "endDate")))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceName")))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sourceBundleIdentifier")))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "heartbeatTimesSinceSeriesStartSeconds")))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "precededByGapIndexes")))) return false; return true; } }; } // namespace margelo::nitro