Skip to content

Commit f7f7bd5

Browse files
Merge pull request #79 from Wei18/dependabot/submodules/Submodule/github/rest-api-description-aa5e982
Bump Submodule/github/rest-api-description from `d6e386e` to `aa5e982`
2 parents 4f17301 + d32bb09 commit f7f7bd5

File tree

12 files changed

+314
-720
lines changed

12 files changed

+314
-720
lines changed

Sources/checks/Types.swift

+14-104
Original file line numberDiff line numberDiff line change
@@ -2802,116 +2802,26 @@ public enum Operations {
28022802
@frozen public enum Body: Sendable, Hashable {
28032803
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json`.
28042804
@frozen public enum jsonPayload: Codable, Hashable, Sendable {
2805-
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case1`.
2806-
public struct Case1Payload: Codable, Hashable, Sendable {
2807-
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case1/status`.
2808-
public var status: OpenAPIRuntime.OpenAPIValueContainer
2809-
/// A container of undocumented properties.
2810-
public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer
2811-
/// Creates a new `Case1Payload`.
2812-
///
2813-
/// - Parameters:
2814-
/// - status:
2815-
/// - additionalProperties: A container of undocumented properties.
2816-
public init(
2817-
status: OpenAPIRuntime.OpenAPIValueContainer,
2818-
additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()
2819-
) {
2820-
self.status = status
2821-
self.additionalProperties = additionalProperties
2822-
}
2823-
public enum CodingKeys: String, CodingKey {
2824-
case status
2825-
}
2826-
public init(from decoder: any Decoder) throws {
2827-
let container = try decoder.container(keyedBy: CodingKeys.self)
2828-
status = try container.decode(
2829-
OpenAPIRuntime.OpenAPIValueContainer.self,
2830-
forKey: .status
2831-
)
2832-
additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [
2833-
"status"
2834-
])
2835-
}
2836-
public func encode(to encoder: any Encoder) throws {
2837-
var container = encoder.container(keyedBy: CodingKeys.self)
2838-
try container.encode(
2839-
status,
2840-
forKey: .status
2841-
)
2842-
try encoder.encodeAdditionalProperties(additionalProperties)
2843-
}
2844-
}
2845-
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case1`.
2846-
case case1(Operations.checks_sol_create.Input.Body.jsonPayload.Case1Payload)
2847-
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case2`.
2848-
public struct Case2Payload: Codable, Hashable, Sendable {
2849-
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case2/status`.
2850-
public var status: OpenAPIRuntime.OpenAPIValueContainer?
2851-
/// A container of undocumented properties.
2852-
public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer
2853-
/// Creates a new `Case2Payload`.
2854-
///
2855-
/// - Parameters:
2856-
/// - status:
2857-
/// - additionalProperties: A container of undocumented properties.
2858-
public init(
2859-
status: OpenAPIRuntime.OpenAPIValueContainer? = nil,
2860-
additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()
2861-
) {
2862-
self.status = status
2863-
self.additionalProperties = additionalProperties
2864-
}
2865-
public enum CodingKeys: String, CodingKey {
2866-
case status
2867-
}
2868-
public init(from decoder: any Decoder) throws {
2869-
let container = try decoder.container(keyedBy: CodingKeys.self)
2870-
status = try container.decodeIfPresent(
2871-
OpenAPIRuntime.OpenAPIValueContainer.self,
2872-
forKey: .status
2873-
)
2874-
additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [
2875-
"status"
2876-
])
2877-
}
2878-
public func encode(to encoder: any Encoder) throws {
2879-
var container = encoder.container(keyedBy: CodingKeys.self)
2880-
try container.encodeIfPresent(
2881-
status,
2882-
forKey: .status
2883-
)
2884-
try encoder.encodeAdditionalProperties(additionalProperties)
2885-
}
2805+
public enum CodingKeys: String, CodingKey {
2806+
case status
28862807
}
2887-
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case2`.
2888-
case case2(Operations.checks_sol_create.Input.Body.jsonPayload.Case2Payload)
28892808
public init(from decoder: any Decoder) throws {
2890-
var errors: [any Error] = []
2891-
do {
2892-
self = .case1(try .init(from: decoder))
2893-
return
2894-
} catch {
2895-
errors.append(error)
2896-
}
2897-
do {
2898-
self = .case2(try .init(from: decoder))
2899-
return
2900-
} catch {
2901-
errors.append(error)
2902-
}
2903-
throw Swift.DecodingError.failedToDecodeOneOfSchema(
2904-
type: Self.self,
2905-
codingPath: decoder.codingPath,
2906-
errors: errors
2809+
let container = try decoder.container(keyedBy: CodingKeys.self)
2810+
let discriminator = try container.decode(
2811+
Swift.String.self,
2812+
forKey: .status
29072813
)
2814+
switch discriminator {
2815+
default:
2816+
throw Swift.DecodingError.unknownOneOfDiscriminator(
2817+
discriminatorKey: CodingKeys.status,
2818+
discriminatorValue: discriminator,
2819+
codingPath: decoder.codingPath
2820+
)
2821+
}
29082822
}
29092823
public func encode(to encoder: any Encoder) throws {
29102824
switch self {
2911-
case let .case1(value):
2912-
try value.encode(to: encoder)
2913-
case let .case2(value):
2914-
try value.encode(to: encoder)
29152825
}
29162826
}
29172827
}

Sources/classroom/Client.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ public struct Client: APIProtocol {
129129
/// Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.
130130
///
131131
/// - Remark: HTTP `GET /assignments/{assignment_id}/accepted_assignments`.
132-
/// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assigments-for-an-assignment)`.
133-
public func classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment(_ input: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Input) async throws -> Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Output {
132+
/// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)`.
133+
public func classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment(_ input: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Input) async throws -> Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Output {
134134
try await client.send(
135135
input: input,
136-
forOperation: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.id,
136+
forOperation: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.id,
137137
serializer: { input in
138138
let path = try converter.renderedPath(
139139
template: "/assignments/{}/accepted_assignments",
@@ -170,7 +170,7 @@ public struct Client: APIProtocol {
170170
switch response.status.code {
171171
case 200:
172172
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
173-
let body: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok.Body
173+
let body: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok.Body
174174
let chosenContentType = try converter.bestContentType(
175175
received: contentType,
176176
options: [

0 commit comments

Comments
 (0)