Skip to content
Snippets Groups Projects
Commit 144c6a51 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add LookupUD functor

parent be376032
No related branches found
No related tags found
1 merge request!102Release 1.0.0
import Bindings
import XCTestDynamicOverlay
public struct LookupUD {
public var run: (Int, Data, Data, Data, UdLookupCallback) throws -> SingleUseSendReport
public func callAsFunction(
e2eId: Int,
udContact: Data,
udId: Data,
singleRequestParamsJSON: Data,
callback: UdLookupCallback
) throws -> SingleUseSendReport {
try run(e2eId, udContact, udId, singleRequestParamsJSON, callback)
}
}
extension LookupUD {
public static let live = LookupUD {
e2eId, udContact, udId, singleRequestParamsJSON, callback in
var error: NSError?
let reportData = BindingsLookupUD(
e2eId,
udContact,
callback.makeBindingsUdLookupCallback(),
udId,
singleRequestParamsJSON,
&error
)
if let error = error {
throw error
}
guard let reportData = reportData else {
fatalError("BindingsLookupUD returned `nil` without providing error")
}
return try SingleUseSendReport.decode(reportData)
}
}
extension LookupUD {
public static let unimplemented = LookupUD(
run: XCTUnimplemented("\(Self.self)")
)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment