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

#pragma once

#include "HybridAcousticConnectRNSpec.hpp"

// Forward declaration of `HybridAcousticConnectRNSpec_cxx` to properly resolve imports.
namespace AcousticConnectRN { class HybridAcousticConnectRNSpec_cxx; }



#include <string>
#include <variant>
#include <optional>
#include <unordered_map>

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

namespace margelo::nitro::acousticconnectrn {

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

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

  public:
    // Get memory pressure
    inline size_t getExternalMemorySize() noexcept override {
      return _swiftPart.getMemorySize();
    }

  public:
    // Properties
    

  public:
    // Methods
    inline bool setBooleanConfigItemForKey(const std::string& key, bool value, const std::string& moduleName) override {
      auto __result = _swiftPart.setBooleanConfigItemForKey(key, std::forward<decltype(value)>(value), moduleName);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool setStringItemForKey(const std::string& key, const std::string& value, const std::string& moduleName) override {
      auto __result = _swiftPart.setStringItemForKey(key, value, moduleName);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool setNumberItemForKey(const std::string& key, double value, const std::string& moduleName) override {
      auto __result = _swiftPart.setNumberItemForKey(key, std::forward<decltype(value)>(value), moduleName);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool setConfigItemForKey(const std::string& key, const std::variant<std::string, double, bool>& value, const std::string& moduleName) override {
      auto __result = _swiftPart.setConfigItemForKey(key, value, moduleName);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool getBooleanConfigItemForKey(bool theDefault, const std::string& key, const std::string& moduleName) override {
      auto __result = _swiftPart.getBooleanConfigItemForKey(std::forward<decltype(theDefault)>(theDefault), key, moduleName);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::optional<std::string> getStringItemForKey(const std::string& theDefault, const std::string& key, const std::string& moduleName) override {
      auto __result = _swiftPart.getStringItemForKey(theDefault, key, moduleName);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline double getNumberItemForKey(double theDefault, const std::string& key, const std::string& moduleName) override {
      auto __result = _swiftPart.getNumberItemForKey(std::forward<decltype(theDefault)>(theDefault), key, moduleName);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logCustomEvent(const std::string& eventName, const std::unordered_map<std::string, std::variant<std::string, double, bool>>& values, double level) override {
      auto __result = _swiftPart.logCustomEvent(eventName, values, std::forward<decltype(level)>(level));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logSignal(const std::unordered_map<std::string, std::variant<std::string, double, bool>>& values, double level) override {
      auto __result = _swiftPart.logSignal(values, std::forward<decltype(level)>(level));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logExceptionEvent(const std::string& message, const std::string& stackInfo, bool unhandled) override {
      auto __result = _swiftPart.logExceptionEvent(message, stackInfo, std::forward<decltype(unhandled)>(unhandled));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logLocation() override {
      auto __result = _swiftPart.logLocation();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logLocationWithLatitudeLongitude(double latitude, double longitude, double level) override {
      auto __result = _swiftPart.logLocationWithLatitudeLongitude(std::forward<decltype(latitude)>(latitude), std::forward<decltype(longitude)>(longitude), std::forward<decltype(level)>(level));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logClickEvent(double target, const std::string& controlId) override {
      auto __result = _swiftPart.logClickEvent(std::forward<decltype(target)>(target), controlId);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logTextChangeEvent(double target, const std::string& controlId, const std::optional<std::string>& text) override {
      auto __result = _swiftPart.logTextChangeEvent(std::forward<decltype(target)>(target), controlId, text);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool setCurrentScreenName(const std::string& logicalPageName) override {
      auto __result = _swiftPart.setCurrentScreenName(logicalPageName);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logScreenViewContextLoad(const std::optional<std::string>& logicalPageName, const std::optional<std::string>& referrer) override {
      auto __result = _swiftPart.logScreenViewContextLoad(logicalPageName, referrer);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logScreenViewContextUnload(const std::optional<std::string>& logicalPageName, const std::optional<std::string>& referrer) override {
      auto __result = _swiftPart.logScreenViewContextUnload(logicalPageName, referrer);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logScreenLayout(const std::string& name, double delay) override {
      auto __result = _swiftPart.logScreenLayout(name, std::forward<decltype(delay)>(delay));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    AcousticConnectRN::HybridAcousticConnectRNSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::acousticconnectrn
