Skip to content
Snippets Groups Projects

Update Bindings

Merged Dariusz Rybicki requested to merge feature/update-bindings into development
1 file
+ 16
20
Compare changes
  • Side-by-side
  • Inline
@@ -2,35 +2,31 @@ import Bindings
import XCTestDynamicOverlay
public struct GetNotificationsReport {
public var run: (Int, String, Data) throws -> NotificationReport
public var run: (String, MessageServiceList) throws -> NotificationReport
public func callAsFunction(
e2eId: Int,
notificationCSV: String,
marshaledServices: Data
services: MessageServiceList
) throws -> NotificationReport {
try run(e2eId, notificationCSV, marshaledServices)
try run(notificationCSV, services)
}
}
extension GetNotificationsReport {
public static func live() -> GetNotificationsReport {
GetNotificationsReport { e2eId, notificationCSV, marshaledServices in
var error: NSError?
let result = BindingsGetNotificationsReport(
e2eId,
notificationCSV,
marshaledServices,
&error
)
if let error = error {
throw error
}
guard let result = result else {
fatalError("BindingsGetNotificationsReport returned nil without providing error")
}
return try NotificationReport.decode(result)
public static let live = GetNotificationsReport { notificationCSV, services in
var error: NSError?
let result = BindingsGetNotificationsReport(
notificationCSV,
try services.encode(),
&error
)
if let error = error {
throw error
}
guard let result = result else {
fatalError("BindingsGetNotificationsReport returned nil without providing error")
}
return try NotificationReport.decode(result)
}
}
Loading