///
/// HybridNitroWalletSpecSwift.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 "HybridNitroWalletSpec.hpp"

// Forward declaration of `HybridNitroWalletSpec_cxx` to properly resolve imports.
namespace NitroWallet { class HybridNitroWalletSpec_cxx; }



#include <NitroModules/Promise.hpp>
#include <string>
#include <optional>

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

namespace margelo::nitro::nitrowallet {

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

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

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

  public:
    // Properties
    

  public:
    // Methods
    inline std::shared_ptr<Promise<bool>> canAddPassesToAppleWallet() override {
      auto __result = _swiftPart.canAddPassesToAppleWallet();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> addPassToAppleWallet(const std::string& base64String) override {
      auto __result = _swiftPart.addPassToAppleWallet(base64String);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> viewPassInAppleWallet(const std::string& cardIdentifier, const std::optional<std::string>& serialNumber) override {
      auto __result = _swiftPart.viewPassInAppleWallet(cardIdentifier, serialNumber);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> doesPassExistInAppleWallet(const std::string& cardIdentifier, const std::optional<std::string>& serialNumber) override {
      auto __result = _swiftPart.doesPassExistInAppleWallet(cardIdentifier, serialNumber);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> removePassFromAppleWallet(const std::string& cardIdentifier, const std::optional<std::string>& serialNumber) override {
      auto __result = _swiftPart.removePassFromAppleWallet(cardIdentifier, serialNumber);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    NitroWallet::HybridNitroWalletSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::nitrowallet
