///
/// HybridAcousticConnectRNSpecSwift.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 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 <NitroModules/Null.hpp>
#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:
    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<HybridAcousticConnectRNSpecSwift>(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 bool enable() override {
      auto __result = _swiftPart.enable();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool disable() override {
      auto __result = _swiftPart.disable();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    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<bool, std::string, double>& 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::variant<nitro::NullType, 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<bool, std::string, double>>& 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<bool, std::string, double>>& 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::variant<nitro::NullType, 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::variant<nitro::NullType, std::string>>& logicalPageName, const std::optional<std::variant<nitro::NullType, 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::variant<nitro::NullType, std::string>>& logicalPageName, const std::optional<std::variant<nitro::NullType, 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;
    }
    inline bool logDialogShowEvent(const std::string& dialogId, const std::string& dialogTitle, const std::string& dialogType) override {
      auto __result = _swiftPart.logDialogShowEvent(dialogId, dialogTitle, dialogType);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logDialogDismissEvent(const std::string& dialogId, const std::string& dismissReason) override {
      auto __result = _swiftPart.logDialogDismissEvent(dialogId, dismissReason);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logDialogButtonClickEvent(const std::string& dialogId, const std::string& buttonText, double buttonIndex) override {
      auto __result = _swiftPart.logDialogButtonClickEvent(dialogId, buttonText, std::forward<decltype(buttonIndex)>(buttonIndex));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool logDialogCustomEvent(const std::string& dialogId, const std::string& eventName, const std::unordered_map<std::string, std::variant<bool, std::string, double>>& values) override {
      auto __result = _swiftPart.logDialogCustomEvent(dialogId, eventName, values);
      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
