mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-10 04:21:03 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.402.14
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user