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

#pragma once

#include "HybridHeartbeatSeriesModuleSpec.hpp"

// Forward declaration of `HybridHeartbeatSeriesModuleSpec_cxx` to properly resolve imports.
namespace ReactNativeHealthkit { class HybridHeartbeatSeriesModuleSpec_cxx; }

// Forward declaration of `HeartbeatSeriesSample` to properly resolve imports.
namespace margelo::nitro::healthkit { struct HeartbeatSeriesSample; }
// Forward declaration of `Heartbeat` to properly resolve imports.
namespace margelo::nitro::healthkit { struct Heartbeat; }
// Forward declaration of `SampleType` to properly resolve imports.
namespace margelo::nitro::healthkit { struct SampleType; }
// Forward declaration of `WeatherCondition` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class WeatherCondition; }
// Forward declaration of `Quantity` to properly resolve imports.
namespace margelo::nitro::healthkit { struct Quantity; }
// Forward declaration of `InsulinDeliveryReason` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class InsulinDeliveryReason; }
// Forward declaration of `HeartRateMotionContext` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class HeartRateMotionContext; }
// Forward declaration of `SourceRevision` to properly resolve imports.
namespace margelo::nitro::healthkit { struct SourceRevision; }
// Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
// Forward declaration of `Device` to properly resolve imports.
namespace margelo::nitro::healthkit { struct Device; }
// Forward declaration of `QueryOptionsWithSortOrder` to properly resolve imports.
namespace margelo::nitro::healthkit { struct QueryOptionsWithSortOrder; }
// Forward declaration of `FilterForSamples` to properly resolve imports.
namespace margelo::nitro::healthkit { struct FilterForSamples; }
// Forward declaration of `FilterForSamplesBase` to properly resolve imports.
namespace margelo::nitro::healthkit { struct FilterForSamplesBase; }
// Forward declaration of `PredicateWithMetadataKey` to properly resolve imports.
namespace margelo::nitro::healthkit { struct PredicateWithMetadataKey; }
// Forward declaration of `ComparisonPredicateOperator` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class ComparisonPredicateOperator; }
// Forward declaration of `DateFilter` to properly resolve imports.
namespace margelo::nitro::healthkit { struct DateFilter; }
// Forward declaration of `HybridWorkoutProxySpec` to properly resolve imports.
namespace margelo::nitro::healthkit { class HybridWorkoutProxySpec; }
// Forward declaration of `HeartbeatSeriesSamplesWithAnchorResponse` to properly resolve imports.
namespace margelo::nitro::healthkit { struct HeartbeatSeriesSamplesWithAnchorResponse; }
// Forward declaration of `DeletedSample` to properly resolve imports.
namespace margelo::nitro::healthkit { struct DeletedSample; }
// Forward declaration of `QueryOptionsWithAnchor` to properly resolve imports.
namespace margelo::nitro::healthkit { struct QueryOptionsWithAnchor; }

#include "HeartbeatSeriesSample.hpp"
#include <vector>
#include <NitroModules/Promise.hpp>
#include "Heartbeat.hpp"
#include "SampleType.hpp"
#include <string>
#include <chrono>
#include "WeatherCondition.hpp"
#include <optional>
#include "Quantity.hpp"
#include "InsulinDeliveryReason.hpp"
#include "HeartRateMotionContext.hpp"
#include "SourceRevision.hpp"
#include <memory>
#include "HybridSourceProxySpec.hpp"
#include "Device.hpp"
#include <NitroModules/AnyMap.hpp>
#include "QueryOptionsWithSortOrder.hpp"
#include "FilterForSamples.hpp"
#include "FilterForSamplesBase.hpp"
#include "PredicateWithMetadataKey.hpp"
#include "ComparisonPredicateOperator.hpp"
#include <variant>
#include "DateFilter.hpp"
#include "HybridWorkoutProxySpec.hpp"
#include "HeartbeatSeriesSamplesWithAnchorResponse.hpp"
#include "DeletedSample.hpp"
#include "QueryOptionsWithAnchor.hpp"

#include "ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp"

namespace margelo::nitro::healthkit {

  /**
   * The C++ part of HybridHeartbeatSeriesModuleSpec_cxx.swift.
   *
   * HybridHeartbeatSeriesModuleSpecSwift (C++) accesses HybridHeartbeatSeriesModuleSpec_cxx (Swift), and might
   * contain some additional bridging code for C++ <> Swift interop.
   *
   * Since this obviously introduces an overhead, I hope at some point in
   * the future, HybridHeartbeatSeriesModuleSpec_cxx can directly inherit from the C++ class HybridHeartbeatSeriesModuleSpec
   * to simplify the whole structure and memory management.
   */
  class HybridHeartbeatSeriesModuleSpecSwift: public virtual HybridHeartbeatSeriesModuleSpec {
  public:
    // Constructor from a Swift instance
    explicit HybridHeartbeatSeriesModuleSpecSwift(const ReactNativeHealthkit::HybridHeartbeatSeriesModuleSpec_cxx& swiftPart):
      HybridObject(HybridHeartbeatSeriesModuleSpec::TAG),
      _swiftPart(swiftPart) { }

  public:
    // Get the Swift part
    inline ReactNativeHealthkit::HybridHeartbeatSeriesModuleSpec_cxx& getSwiftPart() noexcept {
      return _swiftPart;
    }

  public:
    inline size_t getExternalMemorySize() noexcept override {
      return _swiftPart.getMemorySize();
    }
    bool equals(const std::shared_ptr<HybridObject>& other) override {
      if (auto otherCast = std::dynamic_pointer_cast<HybridHeartbeatSeriesModuleSpecSwift>(other)) {
        return _swiftPart.equals(otherCast->_swiftPart);
      }
      return false;
    }
    void dispose() noexcept override {
      _swiftPart.dispose();
    }
    std::string toString() override {
      return _swiftPart.toString();
    }

  public:
    // Properties
    

  public:
    // Methods
    inline std::shared_ptr<Promise<std::vector<HeartbeatSeriesSample>>> queryHeartbeatSeriesSamples(const QueryOptionsWithSortOrder& options) override {
      auto __result = _swiftPart.queryHeartbeatSeriesSamples(std::forward<decltype(options)>(options));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<HeartbeatSeriesSamplesWithAnchorResponse>> queryHeartbeatSeriesSamplesWithAnchor(const QueryOptionsWithAnchor& options) override {
      auto __result = _swiftPart.queryHeartbeatSeriesSamplesWithAnchor(std::forward<decltype(options)>(options));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    ReactNativeHealthkit::HybridHeartbeatSeriesModuleSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::healthkit
