File tree 2 files changed +45
-0
lines changed
2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -9400,6 +9400,28 @@ public struct Client: APIProtocol {
9400
9400
switch response.status.code {
9401
9401
case 204:
9402
9402
return .noContent(.init())
9403
+ case 404:
9404
+ let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
9405
+ let body: Components.Responses.not_found.Body
9406
+ let chosenContentType = try converter.bestContentType(
9407
+ received: contentType,
9408
+ options: [
9409
+ "application/json"
9410
+ ]
9411
+ )
9412
+ switch chosenContentType {
9413
+ case "application/json":
9414
+ body = try await converter.getResponseBodyAsJSON(
9415
+ Components.Schemas.basic_hyphen_error.self,
9416
+ from: responseBody,
9417
+ transforming: { value in
9418
+ .json(value)
9419
+ }
9420
+ )
9421
+ default:
9422
+ preconditionFailure("bestContentType chose an invalid content type.")
9423
+ }
9424
+ return .notFound(.init(body: body))
9403
9425
case 422:
9404
9426
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
9405
9427
let body: Components.Responses.validation_failed.Body
Original file line number Diff line number Diff line change @@ -41341,6 +41341,29 @@ public enum Operations {
41341
41341
}
41342
41342
}
41343
41343
}
41344
+ /// Resource not found
41345
+ ///
41346
+ /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/dispatches/post(repos/create-dispatch-event)/responses/404`.
41347
+ ///
41348
+ /// HTTP response code: `404 notFound`.
41349
+ case notFound(Components.Responses.not_found)
41350
+ /// The associated value of the enum case if `self` is `.notFound`.
41351
+ ///
41352
+ /// - Throws: An error if `self` is not `.notFound`.
41353
+ /// - SeeAlso: `.notFound`.
41354
+ public var notFound: Components.Responses.not_found {
41355
+ get throws {
41356
+ switch self {
41357
+ case let .notFound(response):
41358
+ return response
41359
+ default:
41360
+ try throwUnexpectedResponseStatus(
41361
+ expectedStatus: "notFound",
41362
+ response: self
41363
+ )
41364
+ }
41365
+ }
41366
+ }
41344
41367
/// Validation failed, or the endpoint has been spammed.
41345
41368
///
41346
41369
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/dispatches/post(repos/create-dispatch-event)/responses/422`.
You can’t perform that action at this time.
0 commit comments