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

#pragma once

#include "HybridReactNativeBundleUpdateSpec.hpp"

// Forward declaration of `HybridReactNativeBundleUpdateSpec_cxx` to properly resolve imports.
namespace ReactNativeBundleUpdate { class HybridReactNativeBundleUpdateSpec_cxx; }

// Forward declaration of `BundleDownloadResult` to properly resolve imports.
namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadResult; }
// Forward declaration of `BundleDownloadParams` to properly resolve imports.
namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadParams; }
// Forward declaration of `BundleVerifyParams` to properly resolve imports.
namespace margelo::nitro::reactnativebundleupdate { struct BundleVerifyParams; }
// Forward declaration of `BundleVerifyASCParams` to properly resolve imports.
namespace margelo::nitro::reactnativebundleupdate { struct BundleVerifyASCParams; }
// Forward declaration of `BundleDownloadASCParams` to properly resolve imports.
namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadASCParams; }
// Forward declaration of `BundleInstallParams` to properly resolve imports.
namespace margelo::nitro::reactnativebundleupdate { struct BundleInstallParams; }
// Forward declaration of `TestResult` to properly resolve imports.
namespace margelo::nitro::reactnativebundleupdate { struct TestResult; }
// Forward declaration of `FallbackBundleInfo` to properly resolve imports.
namespace margelo::nitro::reactnativebundleupdate { struct FallbackBundleInfo; }
// Forward declaration of `BundleSwitchParams` to properly resolve imports.
namespace margelo::nitro::reactnativebundleupdate { struct BundleSwitchParams; }
// Forward declaration of `LocalBundleInfo` to properly resolve imports.
namespace margelo::nitro::reactnativebundleupdate { struct LocalBundleInfo; }
// Forward declaration of `AscFileInfo` to properly resolve imports.
namespace margelo::nitro::reactnativebundleupdate { struct AscFileInfo; }
// Forward declaration of `BundleDownloadEvent` to properly resolve imports.
namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadEvent; }

#include "BundleDownloadResult.hpp"
#include <NitroModules/Promise.hpp>
#include <string>
#include "BundleDownloadParams.hpp"
#include "BundleVerifyParams.hpp"
#include "BundleVerifyASCParams.hpp"
#include "BundleDownloadASCParams.hpp"
#include "BundleInstallParams.hpp"
#include "TestResult.hpp"
#include "FallbackBundleInfo.hpp"
#include <vector>
#include "BundleSwitchParams.hpp"
#include "LocalBundleInfo.hpp"
#include "AscFileInfo.hpp"
#include "BundleDownloadEvent.hpp"
#include <functional>

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

namespace margelo::nitro::reactnativebundleupdate {

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

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

  public:
    inline size_t getExternalMemorySize() noexcept override {
      return _swiftPart.getMemorySize();
    }
    void dispose() noexcept override {
      _swiftPart.dispose();
    }
    std::string toString() override {
      return _swiftPart.toString();
    }

  public:
    // Properties
    

  public:
    // Methods
    inline std::shared_ptr<Promise<BundleDownloadResult>> downloadBundle(const BundleDownloadParams& params) override {
      auto __result = _swiftPart.downloadBundle(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<void>> verifyBundle(const BundleVerifyParams& params) override {
      auto __result = _swiftPart.verifyBundle(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<void>> verifyBundleASC(const BundleVerifyASCParams& params) override {
      auto __result = _swiftPart.verifyBundleASC(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<void>> downloadBundleASC(const BundleDownloadASCParams& params) override {
      auto __result = _swiftPart.downloadBundleASC(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<void>> installBundle(const BundleInstallParams& params) override {
      auto __result = _swiftPart.installBundle(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<void>> clearDownload() override {
      auto __result = _swiftPart.clearDownload();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> clearBundle() override {
      auto __result = _swiftPart.clearBundle();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<TestResult>> clearAllJSBundleData() override {
      auto __result = _swiftPart.clearAllJSBundleData();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> resetToBuiltInBundle() override {
      auto __result = _swiftPart.resetToBuiltInBundle();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::vector<FallbackBundleInfo>>> getFallbackUpdateBundleData() override {
      auto __result = _swiftPart.getFallbackUpdateBundleData();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> setCurrentUpdateBundleData(const BundleSwitchParams& params) override {
      auto __result = _swiftPart.setCurrentUpdateBundleData(std::forward<decltype(params)>(params));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::string getWebEmbedPath() override {
      auto __result = _swiftPart.getWebEmbedPath();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::string>> getWebEmbedPathAsync() override {
      auto __result = _swiftPart.getWebEmbedPathAsync();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::string getJsBundlePath() override {
      auto __result = _swiftPart.getJsBundlePath();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::string>> getJsBundlePathAsync() override {
      auto __result = _swiftPart.getJsBundlePathAsync();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::string getBackgroundJsBundlePath() override {
      auto __result = _swiftPart.getBackgroundJsBundlePath();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::string>> getBackgroundJsBundlePathAsync() override {
      auto __result = _swiftPart.getBackgroundJsBundlePathAsync();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::string>> getNativeAppVersion() override {
      auto __result = _swiftPart.getNativeAppVersion();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::string>> getNativeBuildNumber() override {
      auto __result = _swiftPart.getNativeBuildNumber();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::string>> getBuiltinBundleVersion() override {
      auto __result = _swiftPart.getBuiltinBundleVersion();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> testVerification() override {
      auto __result = _swiftPart.testVerification();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> testSkipVerification() override {
      auto __result = _swiftPart.testSkipVerification();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline bool isSkipGpgVerificationAllowed() override {
      auto __result = _swiftPart.isSkipGpgVerificationAllowed();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<bool>> isBundleExists(const std::string& appVersion, const std::string& bundleVersion) override {
      auto __result = _swiftPart.isBundleExists(appVersion, bundleVersion);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> verifyExtractedBundle(const std::string& appVersion, const std::string& bundleVersion) override {
      auto __result = _swiftPart.verifyExtractedBundle(appVersion, bundleVersion);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::vector<LocalBundleInfo>>> listLocalBundles() override {
      auto __result = _swiftPart.listLocalBundles();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::vector<AscFileInfo>>> listAscFiles() override {
      auto __result = _swiftPart.listAscFiles();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<std::string>> getSha256FromFilePath(const std::string& filePath) override {
      auto __result = _swiftPart.getSha256FromFilePath(filePath);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<TestResult>> testDeleteJsBundle(const std::string& appVersion, const std::string& bundleVersion) override {
      auto __result = _swiftPart.testDeleteJsBundle(appVersion, bundleVersion);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<TestResult>> testDeleteJsRuntimeDir(const std::string& appVersion, const std::string& bundleVersion) override {
      auto __result = _swiftPart.testDeleteJsRuntimeDir(appVersion, bundleVersion);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<TestResult>> testDeleteMetadataJson(const std::string& appVersion, const std::string& bundleVersion) override {
      auto __result = _swiftPart.testDeleteMetadataJson(appVersion, bundleVersion);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<TestResult>> testWriteEmptyMetadataJson(const std::string& appVersion, const std::string& bundleVersion) override {
      auto __result = _swiftPart.testWriteEmptyMetadataJson(appVersion, bundleVersion);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline double addDownloadListener(const std::function<void(const BundleDownloadEvent& /* event */)>& callback) override {
      auto __result = _swiftPart.addDownloadListener(callback);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline void removeDownloadListener(double id) override {
      auto __result = _swiftPart.removeDownloadListener(std::forward<decltype(id)>(id));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }

  private:
    ReactNativeBundleUpdate::HybridReactNativeBundleUpdateSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::reactnativebundleupdate
