diff --git a/Sources/ElixxirDAppsSDK/Functors/UnregisterForNotifications.swift b/Sources/ElixxirDAppsSDK/Functors/UnregisterForNotifications.swift new file mode 100644 index 0000000000000000000000000000000000000000..aa3ce63bd35c4f17da9cfb531445a7596e94eb57 --- /dev/null +++ b/Sources/ElixxirDAppsSDK/Functors/UnregisterForNotifications.swift @@ -0,0 +1,29 @@ +import Bindings +import XCTestDynamicOverlay + +public struct UnregisterForNotifications { + public var run: (Int) throws -> Void + + public func callAsFunction( + e2eId: Int + ) throws { + try run(e2eId) + } +} + +extension UnregisterForNotifications { + public static let live = UnregisterForNotifications { e2eId in + var error: NSError? + BindingsUnregisterForNotifications(e2eId, &error) + if let error = error { + throw error + } + } +} + +extension UnregisterForNotifications { + public static let unimplemented = UnregisterForNotifications( + run: XCTUnimplemented("\(Self.self)") + ) +} +