Skip to content

Commit 6f1ea7b

Browse files
Merge pull request #42 from Wei18/dependabot/submodules/Submodule/github/rest-api-description-4cfaefc
Bump Submodule/github/rest-api-description from `b65cdca` to `4cfaefc`
2 parents 61cfe25 + 358a03f commit 6f1ea7b

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

Sources/repos/Client.swift

+22
Original file line numberDiff line numberDiff line change
@@ -9400,6 +9400,28 @@ public struct Client: APIProtocol {
94009400
switch response.status.code {
94019401
case 204:
94029402
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))
94039425
case 422:
94049426
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
94059427
let body: Components.Responses.validation_failed.Body

Sources/repos/Types.swift

+23
Original file line numberDiff line numberDiff line change
@@ -41341,6 +41341,29 @@ public enum Operations {
4134141341
}
4134241342
}
4134341343
}
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+
}
4134441367
/// Validation failed, or the endpoint has been spammed.
4134541368
///
4134641369
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/dispatches/post(repos/create-dispatch-event)/responses/422`.

0 commit comments

Comments
 (0)