Skip to content

Bump Submodule/github/rest-api-description from b65cdca to 4cfaefc #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Sources/repos/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9400,6 +9400,28 @@ public struct Client: APIProtocol {
switch response.status.code {
case 204:
return .noContent(.init())
case 404:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.not_found.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.basic_hyphen_error.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .notFound(.init(body: body))
case 422:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.validation_failed.Body
Expand Down
23 changes: 23 additions & 0 deletions Sources/repos/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41341,6 +41341,29 @@ public enum Operations {
}
}
}
/// Resource not found
///
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/dispatches/post(repos/create-dispatch-event)/responses/404`.
///
/// HTTP response code: `404 notFound`.
case notFound(Components.Responses.not_found)
/// The associated value of the enum case if `self` is `.notFound`.
///
/// - Throws: An error if `self` is not `.notFound`.
/// - SeeAlso: `.notFound`.
public var notFound: Components.Responses.not_found {
get throws {
switch self {
case let .notFound(response):
return response
default:
try throwUnexpectedResponseStatus(
expectedStatus: "notFound",
response: self
)
}
}
}
/// Validation failed, or the endpoint has been spammed.
///
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/dispatches/post(repos/create-dispatch-event)/responses/422`.
Expand Down
2 changes: 1 addition & 1 deletion Submodule/github/rest-api-description