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

#pragma once

#include "HybridStateOfMindModuleSpec.hpp"

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

// Forward declaration of `StateOfMindSample` to properly resolve imports.
namespace margelo::nitro::healthkit { struct StateOfMindSample; }
// 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 `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 `StateOfMindSamplesWithAnchorResponse` to properly resolve imports.
namespace margelo::nitro::healthkit { struct StateOfMindSamplesWithAnchorResponse; }
// 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 "StateOfMindSample.hpp"
#include <vector>
#include <NitroModules/Promise.hpp>
#include "StateOfMindKind.hpp"
#include "StateOfMindValenceClassification.hpp"
#include "StateOfMindAssociation.hpp"
#include "StateOfMindLabel.hpp"
#include "SampleType.hpp"
#include <string>
#include <chrono>
#include <NitroModules/AnyMap.hpp>
#include "SourceRevision.hpp"
#include <memory>
#include "HybridSourceProxySpec.hpp"
#include <optional>
#include "Device.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 "StateOfMindSamplesWithAnchorResponse.hpp"
#include "DeletedSample.hpp"
#include "QueryOptionsWithAnchor.hpp"

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

namespace margelo::nitro::healthkit {

  /**
   * The C++ part of HybridStateOfMindModuleSpec_cxx.swift.
   *
   * HybridStateOfMindModuleSpecSwift (C++) accesses HybridStateOfMindModuleSpec_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, HybridStateOfMindModuleSpec_cxx can directly inherit from the C++ class HybridStateOfMindModuleSpec
   * to simplify the whole structure and memory management.
   */
  class HybridStateOfMindModuleSpecSwift: public virtual HybridStateOfMindModuleSpec {
  public:
    // Constructor from a Swift instance
    explicit HybridStateOfMindModuleSpecSwift(const ReactNativeHealthkit::HybridStateOfMindModuleSpec_cxx& swiftPart):
      HybridObject(HybridStateOfMindModuleSpec::TAG),
      _swiftPart(swiftPart) { }

  public:
    // Get the Swift part
    inline ReactNativeHealthkit::HybridStateOfMindModuleSpec_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<HybridStateOfMindModuleSpecSwift>(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<StateOfMindSample>>> queryStateOfMindSamples(const QueryOptionsWithSortOrder& options) override {
      auto __result = _swiftPart.queryStateOfMindSamples(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<StateOfMindSamplesWithAnchorResponse>> queryStateOfMindSamplesWithAnchor(const QueryOptionsWithAnchor& options) override {
      auto __result = _swiftPart.queryStateOfMindSamplesWithAnchor(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<std::optional<StateOfMindSample>>> saveStateOfMindSample(std::chrono::system_clock::time_point date, StateOfMindKind kind, double valence, const std::vector<StateOfMindLabel>& labels, const std::vector<StateOfMindAssociation>& associations, const std::optional<std::shared_ptr<AnyMap>>& metadata) override {
      auto __result = _swiftPart.saveStateOfMindSample(date, static_cast<int>(kind), std::forward<decltype(valence)>(valence), labels, associations, metadata);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    ReactNativeHealthkit::HybridStateOfMindModuleSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::healthkit
