///
/// NitroGoogleSignin-Swift-Cxx-Bridge.cpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#include "NitroGoogleSignin-Swift-Cxx-Bridge.hpp"

// Include C++ implementation defined types
#include "HybridGoogleSignInButtonSpecSwift.hpp"
#include "HybridNitroGoogleSigninSpecSwift.hpp"
#include "NitroGoogleSignin-Swift-Cxx-Umbrella.hpp"
#include <NitroModules/NitroDefines.hpp>

namespace margelo::nitro::nitrogooglesignin::bridge::swift {

  // pragma MARK: std::function<void()>
  Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept {
    auto swiftClosure = NitroGoogleSignin::Func_void::fromUnsafe(swiftClosureWrapper);
    return [swiftClosure = std::move(swiftClosure)]() mutable -> void {
      swiftClosure.call();
    };
  }
  
  // pragma MARK: std::shared_ptr<HybridGoogleSignInButtonSpec>
  std::shared_ptr<HybridGoogleSignInButtonSpec> create_std__shared_ptr_HybridGoogleSignInButtonSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
    NitroGoogleSignin::HybridGoogleSignInButtonSpec_cxx swiftPart = NitroGoogleSignin::HybridGoogleSignInButtonSpec_cxx::fromUnsafe(swiftUnsafePointer);
    return std::make_shared<margelo::nitro::nitrogooglesignin::HybridGoogleSignInButtonSpecSwift>(swiftPart);
  }
  void* NON_NULL get_std__shared_ptr_HybridGoogleSignInButtonSpec_(std__shared_ptr_HybridGoogleSignInButtonSpec_ cppType) {
    std::shared_ptr<margelo::nitro::nitrogooglesignin::HybridGoogleSignInButtonSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitrogooglesignin::HybridGoogleSignInButtonSpecSwift>(cppType);
    #ifdef NITRO_DEBUG
    if (swiftWrapper == nullptr) [[unlikely]] {
      throw std::runtime_error("Class \"HybridGoogleSignInButtonSpec\" is not implemented in Swift!");
    }
    #endif
    NitroGoogleSignin::HybridGoogleSignInButtonSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
    return swiftPart.toUnsafe();
  }
  
  // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
  Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
    auto swiftClosure = NitroGoogleSignin::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
    return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
      swiftClosure.call(error);
    };
  }
  
  // pragma MARK: std::function<void(const OneTapResponse& /* result */)>
  Func_void_OneTapResponse create_Func_void_OneTapResponse(void* NON_NULL swiftClosureWrapper) noexcept {
    auto swiftClosure = NitroGoogleSignin::Func_void_OneTapResponse::fromUnsafe(swiftClosureWrapper);
    return [swiftClosure = std::move(swiftClosure)](const OneTapResponse& result) mutable -> void {
      swiftClosure.call(result);
    };
  }
  
  // pragma MARK: std::function<void(const OneTapAuthorizationResult& /* result */)>
  Func_void_OneTapAuthorizationResult create_Func_void_OneTapAuthorizationResult(void* NON_NULL swiftClosureWrapper) noexcept {
    auto swiftClosure = NitroGoogleSignin::Func_void_OneTapAuthorizationResult::fromUnsafe(swiftClosureWrapper);
    return [swiftClosure = std::move(swiftClosure)](const OneTapAuthorizationResult& result) mutable -> void {
      swiftClosure.call(result);
    };
  }
  
  // pragma MARK: std::function<void(const GetTokensResponse& /* result */)>
  Func_void_GetTokensResponse create_Func_void_GetTokensResponse(void* NON_NULL swiftClosureWrapper) noexcept {
    auto swiftClosure = NitroGoogleSignin::Func_void_GetTokensResponse::fromUnsafe(swiftClosureWrapper);
    return [swiftClosure = std::move(swiftClosure)](const GetTokensResponse& result) mutable -> void {
      swiftClosure.call(result);
    };
  }
  
  // pragma MARK: std::shared_ptr<HybridNitroGoogleSigninSpec>
  std::shared_ptr<HybridNitroGoogleSigninSpec> create_std__shared_ptr_HybridNitroGoogleSigninSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
    NitroGoogleSignin::HybridNitroGoogleSigninSpec_cxx swiftPart = NitroGoogleSignin::HybridNitroGoogleSigninSpec_cxx::fromUnsafe(swiftUnsafePointer);
    return std::make_shared<margelo::nitro::nitrogooglesignin::HybridNitroGoogleSigninSpecSwift>(swiftPart);
  }
  void* NON_NULL get_std__shared_ptr_HybridNitroGoogleSigninSpec_(std__shared_ptr_HybridNitroGoogleSigninSpec_ cppType) {
    std::shared_ptr<margelo::nitro::nitrogooglesignin::HybridNitroGoogleSigninSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitrogooglesignin::HybridNitroGoogleSigninSpecSwift>(cppType);
    #ifdef NITRO_DEBUG
    if (swiftWrapper == nullptr) [[unlikely]] {
      throw std::runtime_error("Class \"HybridNitroGoogleSigninSpec\" is not implemented in Swift!");
    }
    #endif
    NitroGoogleSignin::HybridNitroGoogleSigninSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
    return swiftPart.toUnsafe();
  }

} // namespace margelo::nitro::nitrogooglesignin::bridge::swift
