mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-07 20:57:47 +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
|
||||
@@ -70,12 +70,20 @@ private func configureEnablePaperTrailRequest(with configuration: URLRequestConf
|
||||
private func handleLogLineResponse(response: Client.APIResponse) throws -> Operations.LogLineResponse {
|
||||
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.LogLineBadRequest.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.LogLineResponseBody.self, from: data))
|
||||
return .unauthorized(try JSONDecoder().decode(Operations.LogLineUnauthorized.self, from: data))
|
||||
} catch {
|
||||
throw ResponseHandlerError.failedToDecodeJSON(error)
|
||||
}
|
||||
@@ -88,12 +96,20 @@ private func handleLogLineResponse(response: Client.APIResponse) throws -> Opera
|
||||
private func handleLogMultiLineResponse(response: Client.APIResponse) throws -> Operations.LogMultiLineResponse {
|
||||
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.LogMultiLineBadRequest.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.LogMultiLineResponseBody.self, from: data))
|
||||
return .unauthorized(try JSONDecoder().decode(Operations.LogMultiLineUnauthorized.self, from: data))
|
||||
} catch {
|
||||
throw ResponseHandlerError.failedToDecodeJSON(error)
|
||||
}
|
||||
@@ -106,12 +122,20 @@ private func handleLogMultiLineResponse(response: Client.APIResponse) throws ->
|
||||
private func handleEnablePaperTrailResponse(response: Client.APIResponse) throws -> Operations.EnablePaperTrailResponse {
|
||||
let httpResponse = response.httpResponse
|
||||
|
||||
if [200, 400, 403].contains(httpResponse.statusCode) {
|
||||
if [200, 403].contains(httpResponse.statusCode) {
|
||||
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.EnablePaperTrailBadRequest.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.EnablePaperTrailResponseBody.self, from: data))
|
||||
return .unauthorized(try JSONDecoder().decode(Operations.EnablePaperTrailUnauthorized.self, from: data))
|
||||
} catch {
|
||||
throw ResponseHandlerError.failedToDecodeJSON(error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user