-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
937e441
commit cabccd4
Showing
4 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
Sources/XcodeCloudKit/Transport/AppStoreConnectAPIAdapter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import AppStoreConnect_Swift_SDK | ||
|
||
class AppStoreConnectSDKTransport: Transport { | ||
private let appStoreConnectSDK: APIProvider | ||
|
||
init(appStoreConnectSDK: APIProvider) { | ||
self.appStoreConnectSDK = appStoreConnectSDK | ||
} | ||
|
||
func perform<T: Decodable>(request: TransportRequest<T>) async throws -> T { | ||
let request = Request<T>( | ||
path: request.path, | ||
method: request.method, | ||
query: request.queryParameters, | ||
id: "" | ||
) | ||
|
||
return try await appStoreConnectSDK.request(request) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
protocol Transport { | ||
func perform<T: Decodable>(request: TransportRequest<T>) async throws -> T | ||
} | ||
|
||
struct TransportRequest<T: Decodable> { | ||
let path: String | ||
let method: String | ||
let queryParameters: [(key: String, value: String?)]? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import AppStoreConnect_Swift_SDK | ||
|
||
// Will populate with requests | ||
enum RequestBuilder { | ||
} | ||
|