ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.397.2

This commit is contained in:
speakeasybot
2024-09-16 18:44:33 +00:00
parent c0dafdc561
commit 6b54deac02
919 changed files with 16195 additions and 6963 deletions

View File

@@ -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)
}