ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.402.14

This commit is contained in:
speakeasybot
2024-09-26 00:08:34 +00:00
parent bc084b3372
commit 805777f2b4
129 changed files with 5612 additions and 1316 deletions

View File

@@ -19,6 +19,15 @@ class _HubsAPI: HubsAPI {
)
}
public func getRecentlyAdded(request: Operations.GetRecentlyAddedRequest) async throws -> Response<Operations.GetRecentlyAddedResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
try configureGetRecentlyAddedRequest(with: configuration, request: request)
},
handleResponse: handleGetRecentlyAddedResponse
)
}
public func getLibraryHubs(request: Operations.GetLibraryHubsRequest) async throws -> Response<Operations.GetLibraryHubsResponse> {
return try await client.makeRequest(
configureRequest: { configuration in
@@ -39,6 +48,13 @@ private func configureGetGlobalHubsRequest(with configuration: URLRequestConfigu
configuration.telemetryHeader = .userAgent
}
private func configureGetRecentlyAddedRequest(with configuration: URLRequestConfiguration, request: Operations.GetRecentlyAddedRequest) throws {
configuration.path = "/hubs/home/recentlyAdded"
configuration.method = .get
configuration.queryParameterSerializable = request
configuration.telemetryHeader = .userAgent
}
private func configureGetLibraryHubsRequest(with configuration: URLRequestConfiguration, request: Operations.GetLibraryHubsRequest) throws {
configuration.path = "/hubs/sections/{sectionId}"
configuration.method = .get
@@ -81,6 +97,24 @@ private func handleGetGlobalHubsResponse(response: Client.APIResponse) throws ->
return .empty
}
private func handleGetRecentlyAddedResponse(response: Client.APIResponse) throws -> Operations.GetRecentlyAddedResponse {
let httpResponse = response.httpResponse
if httpResponse.statusCode == 200 {
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
do {
return .object(try JSONDecoder().decode(Operations.GetRecentlyAddedResponseBody.self, from: data))
} catch {
throw ResponseHandlerError.failedToDecodeJSON(error)
}
}
} else if [400, 401].contains(httpResponse.statusCode) {
return .empty
}
return .empty
}
private func handleGetLibraryHubsResponse(response: Client.APIResponse) throws -> Operations.GetLibraryHubsResponse {
let httpResponse = response.httpResponse