Skip to content

Commit aa20f38

Browse files
author
Guilherme Souza
committed
Add all delegate methods
1 parent 987d47a commit aa20f38

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Sources/GetExtensions/MultiAPIClientDelegate.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,22 @@ public struct MultiAPIClientDelegate: APIClientDelegate {
4848
}
4949
return nil
5050
}
51+
52+
public func client<T>(_ client: APIClient, encoderForRequest request: Request<T>) -> JSONEncoder? {
53+
for delegate in delegates {
54+
if let encoder = delegate.client(client, encoderForRequest: request) {
55+
return encoder
56+
}
57+
}
58+
return nil
59+
}
60+
61+
public func client<T>(_ client: APIClient, decoderForRequest request: Request<T>) -> JSONDecoder? {
62+
for delegate in delegates {
63+
if let decoder = delegate.client(client, decoderForRequest: request) {
64+
return decoder
65+
}
66+
}
67+
return nil
68+
}
5169
}

0 commit comments

Comments
 (0)