mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-09 12:47:44 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.397.2
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
|
||||
|
||||
import Foundation
|
||||
@@ -51,12 +51,20 @@ private func configureStartUniversalTranscodeRequest(with configuration: URLRequ
|
||||
private func handleGetTimelineResponse(response: Client.APIResponse) throws -> Operations.GetTimelineResponse {
|
||||
let httpResponse = response.httpResponse
|
||||
|
||||
if [200, 400].contains(httpResponse.statusCode) {
|
||||
if httpResponse.statusCode == 200 {
|
||||
return .empty
|
||||
} else if httpResponse.statusCode == 400 {
|
||||
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
|
||||
do {
|
||||
return .badRequest(try JSONDecoder().decode(Operations.GetTimelineBadRequest.self, from: data))
|
||||
} catch {
|
||||
throw ResponseHandlerError.failedToDecodeJSON(error)
|
||||
}
|
||||
}
|
||||
} else if httpResponse.statusCode == 401 {
|
||||
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
|
||||
do {
|
||||
return .object(try JSONDecoder().decode(Operations.GetTimelineResponseBody.self, from: data))
|
||||
return .unauthorized(try JSONDecoder().decode(Operations.GetTimelineUnauthorized.self, from: data))
|
||||
} catch {
|
||||
throw ResponseHandlerError.failedToDecodeJSON(error)
|
||||
}
|
||||
@@ -69,12 +77,20 @@ private func handleGetTimelineResponse(response: Client.APIResponse) throws -> O
|
||||
private func handleStartUniversalTranscodeResponse(response: Client.APIResponse) throws -> Operations.StartUniversalTranscodeResponse {
|
||||
let httpResponse = response.httpResponse
|
||||
|
||||
if [200, 400].contains(httpResponse.statusCode) {
|
||||
if httpResponse.statusCode == 200 {
|
||||
return .empty
|
||||
} else if httpResponse.statusCode == 400 {
|
||||
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
|
||||
do {
|
||||
return .badRequest(try JSONDecoder().decode(Operations.StartUniversalTranscodeBadRequest.self, from: data))
|
||||
} catch {
|
||||
throw ResponseHandlerError.failedToDecodeJSON(error)
|
||||
}
|
||||
}
|
||||
} else if httpResponse.statusCode == 401 {
|
||||
if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
|
||||
do {
|
||||
return .object(try JSONDecoder().decode(Operations.StartUniversalTranscodeResponseBody.self, from: data))
|
||||
return .unauthorized(try JSONDecoder().decode(Operations.StartUniversalTranscodeUnauthorized.self, from: data))
|
||||
} catch {
|
||||
throw ResponseHandlerError.failedToDecodeJSON(error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user