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

#pragma once

#include "HybridRnIapSpec.hpp"

// Forward declaration of `HybridRnIapSpec_cxx` to properly resolve imports.
namespace NitroIap { class HybridRnIapSpec_cxx; }

// Forward declaration of `InitConnectionConfig` to properly resolve imports.
namespace margelo::nitro::iap { struct InitConnectionConfig; }
// Forward declaration of `AlternativeBillingModeAndroid` to properly resolve imports.
namespace margelo::nitro::iap { enum class AlternativeBillingModeAndroid; }
// Forward declaration of `BillingProgramAndroid` to properly resolve imports.
namespace margelo::nitro::iap { enum class BillingProgramAndroid; }
// Forward declaration of `NitroProduct` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroProduct; }
// Forward declaration of `IapPlatform` to properly resolve imports.
namespace margelo::nitro::iap { enum class IapPlatform; }
// Forward declaration of `PaymentModeIOS` to properly resolve imports.
namespace margelo::nitro::iap { enum class PaymentModeIOS; }
// Forward declaration of `NitroOneTimePurchaseOfferDetail` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroOneTimePurchaseOfferDetail; }
// Forward declaration of `NitroDiscountDisplayInfoAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroDiscountDisplayInfoAndroid; }
// Forward declaration of `NitroDiscountAmountAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroDiscountAmountAndroid; }
// Forward declaration of `NitroLimitedQuantityInfoAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroLimitedQuantityInfoAndroid; }
// Forward declaration of `NitroPreorderDetailsAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroPreorderDetailsAndroid; }
// Forward declaration of `NitroRentalDetailsAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroRentalDetailsAndroid; }
// Forward declaration of `NitroValidTimeWindowAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroValidTimeWindowAndroid; }
// Forward declaration of `PurchaseAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct PurchaseAndroid; }
// Forward declaration of `PurchaseIOS` to properly resolve imports.
namespace margelo::nitro::iap { struct PurchaseIOS; }
// Forward declaration of `PendingPurchaseUpdateAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct PendingPurchaseUpdateAndroid; }
// Forward declaration of `PurchaseState` to properly resolve imports.
namespace margelo::nitro::iap { enum class PurchaseState; }
// Forward declaration of `IapStore` to properly resolve imports.
namespace margelo::nitro::iap { enum class IapStore; }
// Forward declaration of `PurchaseOfferIOS` to properly resolve imports.
namespace margelo::nitro::iap { struct PurchaseOfferIOS; }
// Forward declaration of `RenewalInfoIOS` to properly resolve imports.
namespace margelo::nitro::iap { struct RenewalInfoIOS; }
// Forward declaration of `NitroPurchaseRequest` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroPurchaseRequest; }
// Forward declaration of `NitroRequestPurchaseIos` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroRequestPurchaseIos; }
// Forward declaration of `PromotionalOfferJwsInputIOS` to properly resolve imports.
namespace margelo::nitro::iap { struct PromotionalOfferJwsInputIOS; }
// Forward declaration of `WinBackOfferInputIOS` to properly resolve imports.
namespace margelo::nitro::iap { struct WinBackOfferInputIOS; }
// Forward declaration of `NitroRequestPurchaseAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroRequestPurchaseAndroid; }
// Forward declaration of `AndroidSubscriptionOfferInput` to properly resolve imports.
namespace margelo::nitro::iap { struct AndroidSubscriptionOfferInput; }
// Forward declaration of `SubscriptionProductReplacementParamsAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct SubscriptionProductReplacementParamsAndroid; }
// Forward declaration of `SubscriptionReplacementModeAndroid` to properly resolve imports.
namespace margelo::nitro::iap { enum class SubscriptionReplacementModeAndroid; }
// Forward declaration of `NitroPurchase` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroPurchase; }
// Forward declaration of `NitroRenewalInfoIOS` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroRenewalInfoIOS; }
// Forward declaration of `NitroAvailablePurchasesOptions` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroAvailablePurchasesOptions; }
// Forward declaration of `NitroAvailablePurchasesIosOptions` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroAvailablePurchasesIosOptions; }
// Forward declaration of `NitroAvailablePurchasesAndroidOptions` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroAvailablePurchasesAndroidOptions; }
// Forward declaration of `NitroAvailablePurchasesAndroidType` to properly resolve imports.
namespace margelo::nitro::iap { enum class NitroAvailablePurchasesAndroidType; }
// Forward declaration of `NitroActiveSubscription` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroActiveSubscription; }
// Forward declaration of `NitroPurchaseResult` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroPurchaseResult; }
// Forward declaration of `NitroFinishTransactionParams` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroFinishTransactionParams; }
// Forward declaration of `NitroFinishTransactionIosParams` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroFinishTransactionIosParams; }
// Forward declaration of `NitroFinishTransactionAndroidParams` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroFinishTransactionAndroidParams; }
// Forward declaration of `NitroSubscriptionStatus` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroSubscriptionStatus; }
// Forward declaration of `NitroSubscriptionRenewalInfo` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroSubscriptionRenewalInfo; }
// Forward declaration of `NitroReceiptValidationResultIOS` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroReceiptValidationResultIOS; }
// Forward declaration of `NitroReceiptValidationResultAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroReceiptValidationResultAndroid; }
// Forward declaration of `NitroReceiptValidationParams` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroReceiptValidationParams; }
// Forward declaration of `NitroReceiptValidationAppleOptions` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroReceiptValidationAppleOptions; }
// Forward declaration of `NitroReceiptValidationGoogleOptions` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroReceiptValidationGoogleOptions; }
// Forward declaration of `NitroReceiptValidationHorizonOptions` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroReceiptValidationHorizonOptions; }
// Forward declaration of `NitroVerifyPurchaseWithProviderResult` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderResult; }
// Forward declaration of `NitroVerifyPurchaseWithIapkitResult` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitResult; }
// Forward declaration of `IapkitPurchaseState` to properly resolve imports.
namespace margelo::nitro::iap { enum class IapkitPurchaseState; }
// Forward declaration of `NitroVerifyPurchaseWithProviderError` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderError; }
// Forward declaration of `PurchaseVerificationProvider` to properly resolve imports.
namespace margelo::nitro::iap { enum class PurchaseVerificationProvider; }
// Forward declaration of `NitroVerifyPurchaseWithProviderProps` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithProviderProps; }
// Forward declaration of `NitroVerifyPurchaseWithIapkitProps` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitProps; }
// Forward declaration of `NitroVerifyPurchaseWithIapkitAppleProps` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitAppleProps; }
// Forward declaration of `NitroVerifyPurchaseWithIapkitGoogleProps` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroVerifyPurchaseWithIapkitGoogleProps; }
// Forward declaration of `NitroDeepLinkOptionsAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroDeepLinkOptionsAndroid; }
// Forward declaration of `UserChoiceBillingDetails` to properly resolve imports.
namespace margelo::nitro::iap { struct UserChoiceBillingDetails; }
// Forward declaration of `DeveloperProvidedBillingDetailsAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct DeveloperProvidedBillingDetailsAndroid; }
// Forward declaration of `NitroBillingProgramAvailabilityResultAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroBillingProgramAvailabilityResultAndroid; }
// Forward declaration of `NitroBillingProgramReportingDetailsAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroBillingProgramReportingDetailsAndroid; }
// Forward declaration of `NitroLaunchExternalLinkParamsAndroid` to properly resolve imports.
namespace margelo::nitro::iap { struct NitroLaunchExternalLinkParamsAndroid; }
// Forward declaration of `ExternalLinkLaunchModeAndroid` to properly resolve imports.
namespace margelo::nitro::iap { enum class ExternalLinkLaunchModeAndroid; }
// Forward declaration of `ExternalLinkTypeAndroid` to properly resolve imports.
namespace margelo::nitro::iap { enum class ExternalLinkTypeAndroid; }
// Forward declaration of `ExternalPurchaseNoticeResultIOS` to properly resolve imports.
namespace margelo::nitro::iap { struct ExternalPurchaseNoticeResultIOS; }
// Forward declaration of `ExternalPurchaseNoticeAction` to properly resolve imports.
namespace margelo::nitro::iap { enum class ExternalPurchaseNoticeAction; }
// Forward declaration of `ExternalPurchaseLinkResultIOS` to properly resolve imports.
namespace margelo::nitro::iap { struct ExternalPurchaseLinkResultIOS; }
// Forward declaration of `ExternalPurchaseCustomLinkTokenResultIOS` to properly resolve imports.
namespace margelo::nitro::iap { struct ExternalPurchaseCustomLinkTokenResultIOS; }
// Forward declaration of `ExternalPurchaseCustomLinkTokenTypeIOS` to properly resolve imports.
namespace margelo::nitro::iap { enum class ExternalPurchaseCustomLinkTokenTypeIOS; }
// Forward declaration of `ExternalPurchaseCustomLinkNoticeResultIOS` to properly resolve imports.
namespace margelo::nitro::iap { struct ExternalPurchaseCustomLinkNoticeResultIOS; }
// Forward declaration of `ExternalPurchaseCustomLinkNoticeTypeIOS` to properly resolve imports.
namespace margelo::nitro::iap { enum class ExternalPurchaseCustomLinkNoticeTypeIOS; }

#include <NitroModules/Promise.hpp>
#include <NitroModules/Null.hpp>
#include "InitConnectionConfig.hpp"
#include <variant>
#include <optional>
#include "AlternativeBillingModeAndroid.hpp"
#include "BillingProgramAndroid.hpp"
#include "NitroProduct.hpp"
#include <vector>
#include <string>
#include "IapPlatform.hpp"
#include "PaymentModeIOS.hpp"
#include "NitroOneTimePurchaseOfferDetail.hpp"
#include "NitroDiscountDisplayInfoAndroid.hpp"
#include "NitroDiscountAmountAndroid.hpp"
#include "NitroLimitedQuantityInfoAndroid.hpp"
#include "NitroPreorderDetailsAndroid.hpp"
#include "NitroRentalDetailsAndroid.hpp"
#include "NitroValidTimeWindowAndroid.hpp"
#include "PurchaseAndroid.hpp"
#include "PurchaseIOS.hpp"
#include "PendingPurchaseUpdateAndroid.hpp"
#include "PurchaseState.hpp"
#include "IapStore.hpp"
#include "PurchaseOfferIOS.hpp"
#include "RenewalInfoIOS.hpp"
#include "NitroPurchaseRequest.hpp"
#include "NitroRequestPurchaseIos.hpp"
#include <unordered_map>
#include "PromotionalOfferJwsInputIOS.hpp"
#include "WinBackOfferInputIOS.hpp"
#include "NitroRequestPurchaseAndroid.hpp"
#include "AndroidSubscriptionOfferInput.hpp"
#include "SubscriptionProductReplacementParamsAndroid.hpp"
#include "SubscriptionReplacementModeAndroid.hpp"
#include "NitroPurchase.hpp"
#include "NitroRenewalInfoIOS.hpp"
#include "NitroAvailablePurchasesOptions.hpp"
#include "NitroAvailablePurchasesIosOptions.hpp"
#include "NitroAvailablePurchasesAndroidOptions.hpp"
#include "NitroAvailablePurchasesAndroidType.hpp"
#include "NitroActiveSubscription.hpp"
#include "NitroPurchaseResult.hpp"
#include "NitroFinishTransactionParams.hpp"
#include "NitroFinishTransactionIosParams.hpp"
#include "NitroFinishTransactionAndroidParams.hpp"
#include <functional>
#include "NitroSubscriptionStatus.hpp"
#include "NitroSubscriptionRenewalInfo.hpp"
#include "NitroReceiptValidationResultIOS.hpp"
#include "NitroReceiptValidationResultAndroid.hpp"
#include "NitroReceiptValidationParams.hpp"
#include "NitroReceiptValidationAppleOptions.hpp"
#include "NitroReceiptValidationGoogleOptions.hpp"
#include "NitroReceiptValidationHorizonOptions.hpp"
#include "NitroVerifyPurchaseWithProviderResult.hpp"
#include "NitroVerifyPurchaseWithIapkitResult.hpp"
#include "IapkitPurchaseState.hpp"
#include "NitroVerifyPurchaseWithProviderError.hpp"
#include "PurchaseVerificationProvider.hpp"
#include "NitroVerifyPurchaseWithProviderProps.hpp"
#include "NitroVerifyPurchaseWithIapkitProps.hpp"
#include "NitroVerifyPurchaseWithIapkitAppleProps.hpp"
#include "NitroVerifyPurchaseWithIapkitGoogleProps.hpp"
#include "NitroDeepLinkOptionsAndroid.hpp"
#include "UserChoiceBillingDetails.hpp"
#include "DeveloperProvidedBillingDetailsAndroid.hpp"
#include "NitroBillingProgramAvailabilityResultAndroid.hpp"
#include "NitroBillingProgramReportingDetailsAndroid.hpp"
#include "NitroLaunchExternalLinkParamsAndroid.hpp"
#include "ExternalLinkLaunchModeAndroid.hpp"
#include "ExternalLinkTypeAndroid.hpp"
#include "ExternalPurchaseNoticeResultIOS.hpp"
#include "ExternalPurchaseNoticeAction.hpp"
#include "ExternalPurchaseLinkResultIOS.hpp"
#include "ExternalPurchaseCustomLinkTokenResultIOS.hpp"
#include "ExternalPurchaseCustomLinkTokenTypeIOS.hpp"
#include "ExternalPurchaseCustomLinkNoticeResultIOS.hpp"
#include "ExternalPurchaseCustomLinkNoticeTypeIOS.hpp"

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

namespace margelo::nitro::iap {

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

  public:
    // Get the Swift part
    inline NitroIap::HybridRnIapSpec_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<HybridRnIapSpecSwift>(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<bool>> initConnection(const std::optional<std::variant<nitro::NullType, InitConnectionConfig>>& config) override {
      auto __result = _swiftPart.initConnection(config);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> endConnection() override {
      auto __result = _swiftPart.endConnection();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::vector<NitroProduct>>> fetchProducts(const std::vector<std::string>& skus, const std::string& type) override {
      auto __result = _swiftPart.fetchProducts(skus, type);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::variant<nitro::NullType, PurchaseAndroid, PurchaseIOS, std::vector<std::variant<PurchaseAndroid, PurchaseIOS>>>>> requestPurchase(const NitroPurchaseRequest& request) override {
      auto __result = _swiftPart.requestPurchase(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<std::vector<NitroPurchase>>> getAvailablePurchases(const std::optional<NitroAvailablePurchasesOptions>& options) override {
      auto __result = _swiftPart.getAvailablePurchases(options);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::vector<NitroActiveSubscription>>> getActiveSubscriptions(const std::optional<std::vector<std::string>>& subscriptionIds) override {
      auto __result = _swiftPart.getActiveSubscriptions(subscriptionIds);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> hasActiveSubscriptions(const std::optional<std::vector<std::string>>& subscriptionIds) override {
      auto __result = _swiftPart.hasActiveSubscriptions(subscriptionIds);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::variant<bool, NitroPurchaseResult>>> finishTransaction(const NitroFinishTransactionParams& params) override {
      auto __result = _swiftPart.finishTransaction(std::forward<decltype(params)>(params));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline void addPurchaseUpdatedListener(const std::function<void(const NitroPurchase& /* purchase */)>& listener) override {
      auto __result = _swiftPart.addPurchaseUpdatedListener(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void addPurchaseErrorListener(const std::function<void(const NitroPurchaseResult& /* error */)>& listener) override {
      auto __result = _swiftPart.addPurchaseErrorListener(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void removePurchaseUpdatedListener(const std::function<void(const NitroPurchase& /* purchase */)>& listener) override {
      auto __result = _swiftPart.removePurchaseUpdatedListener(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void removePurchaseErrorListener(const std::function<void(const NitroPurchaseResult& /* error */)>& listener) override {
      auto __result = _swiftPart.removePurchaseErrorListener(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void addPromotedProductListenerIOS(const std::function<void(const NitroProduct& /* product */)>& listener) override {
      auto __result = _swiftPart.addPromotedProductListenerIOS(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void removePromotedProductListenerIOS(const std::function<void(const NitroProduct& /* product */)>& listener) override {
      auto __result = _swiftPart.removePromotedProductListenerIOS(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline std::shared_ptr<Promise<std::string>> getStorefrontIOS() override {
      auto __result = _swiftPart.getStorefrontIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::variant<nitro::NullType, std::string>>> getAppTransactionIOS() override {
      auto __result = _swiftPart.getAppTransactionIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::variant<nitro::NullType, NitroProduct>>> requestPromotedProductIOS() override {
      auto __result = _swiftPart.requestPromotedProductIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::variant<nitro::NullType, NitroProduct>>> getPromotedProductIOS() override {
      auto __result = _swiftPart.getPromotedProductIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> buyPromotedProductIOS() override {
      auto __result = _swiftPart.buyPromotedProductIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> presentCodeRedemptionSheetIOS() override {
      auto __result = _swiftPart.presentCodeRedemptionSheetIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> clearTransactionIOS() override {
      auto __result = _swiftPart.clearTransactionIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::variant<nitro::NullType, std::string>>> beginRefundRequestIOS(const std::string& sku) override {
      auto __result = _swiftPart.beginRefundRequestIOS(sku);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::variant<nitro::NullType, std::vector<NitroSubscriptionStatus>>>> subscriptionStatusIOS(const std::string& sku) override {
      auto __result = _swiftPart.subscriptionStatusIOS(sku);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::variant<nitro::NullType, NitroPurchase>>> currentEntitlementIOS(const std::string& sku) override {
      auto __result = _swiftPart.currentEntitlementIOS(sku);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::variant<nitro::NullType, NitroPurchase>>> latestTransactionIOS(const std::string& sku) override {
      auto __result = _swiftPart.latestTransactionIOS(sku);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::vector<NitroPurchase>>> getPendingTransactionsIOS() override {
      auto __result = _swiftPart.getPendingTransactionsIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> syncIOS() override {
      auto __result = _swiftPart.syncIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::vector<NitroPurchase>>> showManageSubscriptionsIOS() override {
      auto __result = _swiftPart.showManageSubscriptionsIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> deepLinkToSubscriptionsIOS() override {
      auto __result = _swiftPart.deepLinkToSubscriptionsIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> isEligibleForIntroOfferIOS(const std::string& groupID) override {
      auto __result = _swiftPart.isEligibleForIntroOfferIOS(groupID);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::string>> getReceiptDataIOS() override {
      auto __result = _swiftPart.getReceiptDataIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::string>> getReceiptIOS() override {
      auto __result = _swiftPart.getReceiptIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::string>> requestReceiptRefreshIOS() override {
      auto __result = _swiftPart.requestReceiptRefreshIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> isTransactionVerifiedIOS(const std::string& sku) override {
      auto __result = _swiftPart.isTransactionVerifiedIOS(sku);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::variant<nitro::NullType, std::string>>> getTransactionJwsIOS(const std::string& sku) override {
      auto __result = _swiftPart.getTransactionJwsIOS(sku);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::variant<NitroReceiptValidationResultIOS, NitroReceiptValidationResultAndroid>>> validateReceipt(const NitroReceiptValidationParams& params) override {
      auto __result = _swiftPart.validateReceipt(std::forward<decltype(params)>(params));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<NitroVerifyPurchaseWithProviderResult>> verifyPurchaseWithProvider(const NitroVerifyPurchaseWithProviderProps& params) override {
      auto __result = _swiftPart.verifyPurchaseWithProvider(std::forward<decltype(params)>(params));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::string>> getStorefront() override {
      auto __result = _swiftPart.getStorefront();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> deepLinkToSubscriptionsAndroid(const NitroDeepLinkOptionsAndroid& options) override {
      auto __result = _swiftPart.deepLinkToSubscriptionsAndroid(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<bool>> checkAlternativeBillingAvailabilityAndroid() override {
      auto __result = _swiftPart.checkAlternativeBillingAvailabilityAndroid();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> showAlternativeBillingDialogAndroid() override {
      auto __result = _swiftPart.showAlternativeBillingDialogAndroid();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::variant<nitro::NullType, std::string>>> createAlternativeBillingTokenAndroid(const std::optional<std::variant<nitro::NullType, std::string>>& sku) override {
      auto __result = _swiftPart.createAlternativeBillingTokenAndroid(sku);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline void addUserChoiceBillingListenerAndroid(const std::function<void(const UserChoiceBillingDetails& /* details */)>& listener) override {
      auto __result = _swiftPart.addUserChoiceBillingListenerAndroid(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void removeUserChoiceBillingListenerAndroid(const std::function<void(const UserChoiceBillingDetails& /* details */)>& listener) override {
      auto __result = _swiftPart.removeUserChoiceBillingListenerAndroid(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void addDeveloperProvidedBillingListenerAndroid(const std::function<void(const DeveloperProvidedBillingDetailsAndroid& /* details */)>& listener) override {
      auto __result = _swiftPart.addDeveloperProvidedBillingListenerAndroid(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void removeDeveloperProvidedBillingListenerAndroid(const std::function<void(const DeveloperProvidedBillingDetailsAndroid& /* details */)>& listener) override {
      auto __result = _swiftPart.removeDeveloperProvidedBillingListenerAndroid(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void addSubscriptionBillingIssueListener(const std::function<void(const NitroPurchase& /* purchase */)>& listener) override {
      auto __result = _swiftPart.addSubscriptionBillingIssueListener(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void removeSubscriptionBillingIssueListener(const std::function<void(const NitroPurchase& /* purchase */)>& listener) override {
      auto __result = _swiftPart.removeSubscriptionBillingIssueListener(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void enableBillingProgramAndroid(BillingProgramAndroid program) override {
      auto __result = _swiftPart.enableBillingProgramAndroid(static_cast<int>(program));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline std::shared_ptr<Promise<NitroBillingProgramAvailabilityResultAndroid>> isBillingProgramAvailableAndroid(BillingProgramAndroid program) override {
      auto __result = _swiftPart.isBillingProgramAvailableAndroid(static_cast<int>(program));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<NitroBillingProgramReportingDetailsAndroid>> createBillingProgramReportingDetailsAndroid(BillingProgramAndroid program) override {
      auto __result = _swiftPart.createBillingProgramReportingDetailsAndroid(static_cast<int>(program));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> launchExternalLinkAndroid(const NitroLaunchExternalLinkParamsAndroid& params) override {
      auto __result = _swiftPart.launchExternalLinkAndroid(std::forward<decltype(params)>(params));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> canPresentExternalPurchaseNoticeIOS() override {
      auto __result = _swiftPart.canPresentExternalPurchaseNoticeIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<ExternalPurchaseNoticeResultIOS>> presentExternalPurchaseNoticeSheetIOS() override {
      auto __result = _swiftPart.presentExternalPurchaseNoticeSheetIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<ExternalPurchaseLinkResultIOS>> presentExternalPurchaseLinkIOS(const std::string& url) override {
      auto __result = _swiftPart.presentExternalPurchaseLinkIOS(url);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> isEligibleForExternalPurchaseCustomLinkIOS() override {
      auto __result = _swiftPart.isEligibleForExternalPurchaseCustomLinkIOS();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<ExternalPurchaseCustomLinkTokenResultIOS>> getExternalPurchaseCustomLinkTokenIOS(ExternalPurchaseCustomLinkTokenTypeIOS tokenType) override {
      auto __result = _swiftPart.getExternalPurchaseCustomLinkTokenIOS(static_cast<int>(tokenType));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<ExternalPurchaseCustomLinkNoticeResultIOS>> showExternalPurchaseCustomLinkNoticeIOS(ExternalPurchaseCustomLinkNoticeTypeIOS noticeType) override {
      auto __result = _swiftPart.showExternalPurchaseCustomLinkNoticeIOS(static_cast<int>(noticeType));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    NitroIap::HybridRnIapSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::iap
