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

#pragma once

#include "HybridOneNotificationsSpec.hpp"

// Forward declaration of `HybridOneNotificationsSpec_cxx` to properly resolve imports.
namespace One { class HybridOneNotificationsSpec_cxx; }

// Forward declaration of `NativePermissionResponse` to properly resolve imports.
namespace margelo::nitro::one { struct NativePermissionResponse; }
// Forward declaration of `NotificationPermissionStatus` to properly resolve imports.
namespace margelo::nitro::one { enum class NotificationPermissionStatus; }
// Forward declaration of `NativeIosPermission` to properly resolve imports.
namespace margelo::nitro::one { struct NativeIosPermission; }
// Forward declaration of `NativePermissionRequest` to properly resolve imports.
namespace margelo::nitro::one { struct NativePermissionRequest; }
// Forward declaration of `NativeIosPermissionRequest` to properly resolve imports.
namespace margelo::nitro::one { struct NativeIosPermissionRequest; }
// Forward declaration of `NativeNotificationCategory` to properly resolve imports.
namespace margelo::nitro::one { struct NativeNotificationCategory; }
// Forward declaration of `NativeNotificationAction` to properly resolve imports.
namespace margelo::nitro::one { struct NativeNotificationAction; }
// Forward declaration of `NativeNotificationCategoryOptions` to properly resolve imports.
namespace margelo::nitro::one { struct NativeNotificationCategoryOptions; }
// Forward declaration of `NativeChannel` to properly resolve imports.
namespace margelo::nitro::one { struct NativeChannel; }
// Forward declaration of `NativeChannelInput` to properly resolve imports.
namespace margelo::nitro::one { struct NativeChannelInput; }
// Forward declaration of `NativeScheduleInput` to properly resolve imports.
namespace margelo::nitro::one { struct NativeScheduleInput; }
// Forward declaration of `NativeContentInput` to properly resolve imports.
namespace margelo::nitro::one { struct NativeContentInput; }
// Forward declaration of `NativeTriggerInput` to properly resolve imports.
namespace margelo::nitro::one { struct NativeTriggerInput; }
// Forward declaration of `NativeNotificationRequest` to properly resolve imports.
namespace margelo::nitro::one { struct NativeNotificationRequest; }
// Forward declaration of `NativeContent` to properly resolve imports.
namespace margelo::nitro::one { struct NativeContent; }
// Forward declaration of `NativeTrigger` to properly resolve imports.
namespace margelo::nitro::one { struct NativeTrigger; }
// Forward declaration of `NativeTriggerType` to properly resolve imports.
namespace margelo::nitro::one { enum class NativeTriggerType; }
// Forward declaration of `NativeNotification` to properly resolve imports.
namespace margelo::nitro::one { struct NativeNotification; }
// Forward declaration of `NativePushToken` to properly resolve imports.
namespace margelo::nitro::one { struct NativePushToken; }
// Forward declaration of `NativeNotificationResponse` to properly resolve imports.
namespace margelo::nitro::one { struct NativeNotificationResponse; }
// Forward declaration of `NotificationBehavior` to properly resolve imports.
namespace margelo::nitro::one { struct NotificationBehavior; }

#include "NativePermissionResponse.hpp"
#include <NitroModules/Promise.hpp>
#include "NotificationPermissionStatus.hpp"
#include "NativeIosPermission.hpp"
#include <optional>
#include "NativePermissionRequest.hpp"
#include "NativeIosPermissionRequest.hpp"
#include "NativeNotificationCategory.hpp"
#include <string>
#include "NativeNotificationAction.hpp"
#include <vector>
#include "NativeNotificationCategoryOptions.hpp"
#include "NativeChannel.hpp"
#include "NativeChannelInput.hpp"
#include "NativeScheduleInput.hpp"
#include "NativeContentInput.hpp"
#include <NitroModules/AnyMap.hpp>
#include "NativeTriggerInput.hpp"
#include "NativeNotificationRequest.hpp"
#include "NativeContent.hpp"
#include "NativeTrigger.hpp"
#include "NativeTriggerType.hpp"
#include "NativeNotification.hpp"
#include "NativePushToken.hpp"
#include <functional>
#include "NativeNotificationResponse.hpp"
#include "NotificationBehavior.hpp"

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

namespace margelo::nitro::one {

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

  public:
    // Get the Swift part
    inline One::HybridOneNotificationsSpec_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<HybridOneNotificationsSpecSwift>(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<NativePermissionResponse>> getPermissions() override {
      auto __result = _swiftPart.getPermissions();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<NativePermissionResponse>> requestPermissions(const NativePermissionRequest& options) override {
      auto __result = _swiftPart.requestPermissions(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<double>> getBadgeCount() override {
      auto __result = _swiftPart.getBadgeCount();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> setBadgeCount(double count) override {
      auto __result = _swiftPart.setBadgeCount(std::forward<decltype(count)>(count));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<NativeNotificationCategory>> setNotificationCategory(const NativeNotificationCategory& category) override {
      auto __result = _swiftPart.setNotificationCategory(std::forward<decltype(category)>(category));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::vector<NativeNotificationCategory>>> getNotificationCategories() override {
      auto __result = _swiftPart.getNotificationCategories();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> deleteNotificationCategory(const std::string& identifier) override {
      auto __result = _swiftPart.deleteNotificationCategory(identifier);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::optional<NativeChannel>>> setNotificationChannel(const std::string& channelId, const NativeChannelInput& channel) override {
      auto __result = _swiftPart.setNotificationChannel(channelId, std::forward<decltype(channel)>(channel));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::optional<NativeChannel>>> getNotificationChannel(const std::string& channelId) override {
      auto __result = _swiftPart.getNotificationChannel(channelId);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::vector<NativeChannel>>> getNotificationChannels() override {
      auto __result = _swiftPart.getNotificationChannels();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> deleteNotificationChannel(const std::string& channelId) override {
      auto __result = _swiftPart.deleteNotificationChannel(channelId);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::string>> scheduleNotification(const NativeScheduleInput& request) override {
      auto __result = _swiftPart.scheduleNotification(std::forward<decltype(request)>(request));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> cancelScheduledNotification(const std::string& identifier) override {
      auto __result = _swiftPart.cancelScheduledNotification(identifier);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> cancelAllScheduledNotifications() override {
      auto __result = _swiftPart.cancelAllScheduledNotifications();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::vector<NativeNotificationRequest>>> getAllScheduledNotifications() override {
      auto __result = _swiftPart.getAllScheduledNotifications();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::vector<NativeNotification>>> getPresentedNotifications() override {
      auto __result = _swiftPart.getPresentedNotifications();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> dismissNotification(const std::string& identifier) override {
      auto __result = _swiftPart.dismissNotification(identifier);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> dismissAllNotifications() override {
      auto __result = _swiftPart.dismissAllNotifications();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<NativePushToken>> getDevicePushToken() override {
      auto __result = _swiftPart.getDevicePushToken();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline void setListeners(const std::function<void(const std::string& /* requestId */, const NativeNotification& /* notification */)>& onReceived, const std::function<void(const NativeNotificationResponse& /* response */)>& onResponse, const std::function<void(const NativePushToken& /* token */)>& onPushToken) override {
      auto __result = _swiftPart.setListeners(onReceived, onResponse, onPushToken);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void presentNotification(const std::string& requestId, const NotificationBehavior& behavior) override {
      auto __result = _swiftPart.presentNotification(requestId, std::forward<decltype(behavior)>(behavior));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline std::optional<NativeNotificationResponse> getLastNotificationResponse() override {
      auto __result = _swiftPart.getLastNotificationResponse();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline void clearLastNotificationResponse() override {
      auto __result = _swiftPart.clearLastNotificationResponse();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }

  private:
    One::HybridOneNotificationsSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::one
