///
/// HybridCoreModuleSpec.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/HybridObject.hpp>)
#include <NitroModules/HybridObject.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

// Forward declaration of `ObjectTypeIdentifier` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class ObjectTypeIdentifier; }
// Forward declaration of `UpdateFrequency` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class UpdateFrequency; }
// Forward declaration of `HybridSourceProxySpec` to properly resolve imports.
namespace margelo::nitro::healthkit { class HybridSourceProxySpec; }
// Forward declaration of `IdentifierWithUnit` to properly resolve imports.
namespace margelo::nitro::healthkit { struct IdentifierWithUnit; }
// Forward declaration of `QuantityTypeIdentifier` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class QuantityTypeIdentifier; }
// Forward declaration of `SampleTypeIdentifier` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class SampleTypeIdentifier; }
// Forward declaration of `FilterForSamples` to properly resolve imports.
namespace margelo::nitro::healthkit { struct FilterForSamples; }
// Forward declaration of `OnChangeCallbackArgs` to properly resolve imports.
namespace margelo::nitro::healthkit { struct OnChangeCallbackArgs; }
// Forward declaration of `AuthorizationStatus` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class AuthorizationStatus; }
// Forward declaration of `AuthorizationRequestStatus` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class AuthorizationRequestStatus; }
// Forward declaration of `AuthDataTypes` to properly resolve imports.
namespace margelo::nitro::healthkit { struct AuthDataTypes; }
// Forward declaration of `PerObjectTypeIdentifier` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class PerObjectTypeIdentifier; }
// Forward declaration of `SampleTypeIdentifierWriteable` to properly resolve imports.
namespace margelo::nitro::healthkit { enum class SampleTypeIdentifierWriteable; }

#include <NitroModules/Promise.hpp>
#include "ObjectTypeIdentifier.hpp"
#include "UpdateFrequency.hpp"
#include <string>
#include <vector>
#include <memory>
#include "HybridSourceProxySpec.hpp"
#include "IdentifierWithUnit.hpp"
#include "QuantityTypeIdentifier.hpp"
#include <optional>
#include "SampleTypeIdentifier.hpp"
#include "FilterForSamples.hpp"
#include "OnChangeCallbackArgs.hpp"
#include <functional>
#include "AuthorizationStatus.hpp"
#include "AuthorizationRequestStatus.hpp"
#include "AuthDataTypes.hpp"
#include "PerObjectTypeIdentifier.hpp"
#include "SampleTypeIdentifierWriteable.hpp"
#include <unordered_map>

namespace margelo::nitro::healthkit {

  using namespace margelo::nitro;

  /**
   * An abstract base class for `CoreModule`
   * Inherit this class to create instances of `HybridCoreModuleSpec` in C++.
   * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
   * @example
   * ```cpp
   * class HybridCoreModule: public HybridCoreModuleSpec {
   * public:
   *   HybridCoreModule(...): HybridObject(TAG) { ... }
   *   // ...
   * };
   * ```
   */
  class HybridCoreModuleSpec: public virtual HybridObject {
    public:
      // Constructor
      explicit HybridCoreModuleSpec(): HybridObject(TAG) { }

      // Destructor
      ~HybridCoreModuleSpec() override = default;

    public:
      // Properties
      

    public:
      // Methods
      virtual std::shared_ptr<Promise<bool>> enableBackgroundDelivery(ObjectTypeIdentifier typeIdentifier, UpdateFrequency updateFrequency) = 0;
      virtual std::shared_ptr<Promise<bool>> disableBackgroundDelivery(ObjectTypeIdentifier typeIdentifier) = 0;
      virtual std::shared_ptr<Promise<bool>> disableAllBackgroundDelivery() = 0;
      virtual std::shared_ptr<Promise<bool>> configureBackgroundTypes(const std::vector<std::string>& typeIdentifiers, UpdateFrequency updateFrequency) = 0;
      virtual std::shared_ptr<Promise<bool>> clearBackgroundTypes() = 0;
      virtual bool isHealthDataAvailable() = 0;
      virtual std::shared_ptr<Promise<bool>> isHealthDataAvailableAsync() = 0;
      virtual bool isProtectedDataAvailable() = 0;
      virtual std::shared_ptr<Promise<bool>> isProtectedDataAvailableAsync() = 0;
      virtual std::shared_ptr<HybridSourceProxySpec> currentAppSource() = 0;
      virtual std::shared_ptr<Promise<std::vector<IdentifierWithUnit>>> getPreferredUnits(const std::vector<QuantityTypeIdentifier>& identifiers, std::optional<bool> forceUpdate) = 0;
      virtual std::shared_ptr<Promise<std::vector<std::shared_ptr<HybridSourceProxySpec>>>> querySources(SampleTypeIdentifier identifier, const std::optional<FilterForSamples>& filter) = 0;
      virtual std::string subscribeToObserverQuery(SampleTypeIdentifier typeIdentifier, const std::function<void(const OnChangeCallbackArgs& /* args */)>& callback) = 0;
      virtual bool unsubscribeQuery(const std::string& queryId) = 0;
      virtual std::shared_ptr<Promise<bool>> unsubscribeQueryAsync(const std::string& queryId) = 0;
      virtual double unsubscribeQueries(const std::vector<std::string>& queryIds) = 0;
      virtual std::shared_ptr<Promise<double>> unsubscribeQueriesAsync(const std::vector<std::string>& queryIds) = 0;
      virtual AuthorizationStatus authorizationStatusFor(ObjectTypeIdentifier type) = 0;
      virtual std::shared_ptr<Promise<AuthorizationRequestStatus>> getRequestStatusForAuthorization(const AuthDataTypes& toCheck) = 0;
      virtual std::shared_ptr<Promise<bool>> requestAuthorization(const AuthDataTypes& toRequest) = 0;
      virtual std::shared_ptr<Promise<void>> requestPerObjectReadAuthorization(PerObjectTypeIdentifier typeIdentifier) = 0;
      virtual std::shared_ptr<Promise<double>> deleteObjects(SampleTypeIdentifierWriteable objectTypeIdentifier, const FilterForSamples& filter) = 0;
      virtual bool isObjectTypeAvailable(ObjectTypeIdentifier objectTypeIdentifier) = 0;
      virtual std::unordered_map<std::string, bool> areObjectTypesAvailable(const std::vector<ObjectTypeIdentifier>& objectTypeIdentifiers) = 0;
      virtual std::shared_ptr<Promise<std::unordered_map<std::string, bool>>> areObjectTypesAvailableAsync(const std::vector<ObjectTypeIdentifier>& objectTypeIdentifiers) = 0;
      virtual std::shared_ptr<Promise<bool>> isObjectTypeAvailableAsync(ObjectTypeIdentifier objectTypeIdentifier) = 0;

    protected:
      // Hybrid Setup
      void loadHybridMethods() override;

    protected:
      // Tag for logging
      static constexpr auto TAG = "CoreModule";
  };

} // namespace margelo::nitro::healthkit
