Skip to content

Bump Submodule/github/rest-api-description from d6e386e to aa5e982 #79

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

118 changes: 14 additions & 104 deletions Sources/checks/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2802,116 +2802,26 @@ public enum Operations {
@frozen public enum Body: Sendable, Hashable {
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json`.
@frozen public enum jsonPayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case1`.
public struct Case1Payload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case1/status`.
public var status: OpenAPIRuntime.OpenAPIValueContainer
/// A container of undocumented properties.
public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer
/// Creates a new `Case1Payload`.
///
/// - Parameters:
/// - status:
/// - additionalProperties: A container of undocumented properties.
public init(
status: OpenAPIRuntime.OpenAPIValueContainer,
additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()
) {
self.status = status
self.additionalProperties = additionalProperties
}
public enum CodingKeys: String, CodingKey {
case status
}
public init(from decoder: any Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
status = try container.decode(
OpenAPIRuntime.OpenAPIValueContainer.self,
forKey: .status
)
additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [
"status"
])
}
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(
status,
forKey: .status
)
try encoder.encodeAdditionalProperties(additionalProperties)
}
}
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case1`.
case case1(Operations.checks_sol_create.Input.Body.jsonPayload.Case1Payload)
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case2`.
public struct Case2Payload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case2/status`.
public var status: OpenAPIRuntime.OpenAPIValueContainer?
/// A container of undocumented properties.
public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer
/// Creates a new `Case2Payload`.
///
/// - Parameters:
/// - status:
/// - additionalProperties: A container of undocumented properties.
public init(
status: OpenAPIRuntime.OpenAPIValueContainer? = nil,
additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()
) {
self.status = status
self.additionalProperties = additionalProperties
}
public enum CodingKeys: String, CodingKey {
case status
}
public init(from decoder: any Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
status = try container.decodeIfPresent(
OpenAPIRuntime.OpenAPIValueContainer.self,
forKey: .status
)
additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [
"status"
])
}
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(
status,
forKey: .status
)
try encoder.encodeAdditionalProperties(additionalProperties)
}
public enum CodingKeys: String, CodingKey {
case status
}
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/check-runs/POST/requestBody/json/case2`.
case case2(Operations.checks_sol_create.Input.Body.jsonPayload.Case2Payload)
public init(from decoder: any Decoder) throws {
var errors: [any Error] = []
do {
self = .case1(try .init(from: decoder))
return
} catch {
errors.append(error)
}
do {
self = .case2(try .init(from: decoder))
return
} catch {
errors.append(error)
}
throw Swift.DecodingError.failedToDecodeOneOfSchema(
type: Self.self,
codingPath: decoder.codingPath,
errors: errors
let container = try decoder.container(keyedBy: CodingKeys.self)
let discriminator = try container.decode(
Swift.String.self,
forKey: .status
)
switch discriminator {
default:
throw Swift.DecodingError.unknownOneOfDiscriminator(
discriminatorKey: CodingKeys.status,
discriminatorValue: discriminator,
codingPath: decoder.codingPath
)
}
}
public func encode(to encoder: any Encoder) throws {
switch self {
case let .case1(value):
try value.encode(to: encoder)
case let .case2(value):
try value.encode(to: encoder)
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/classroom/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ public struct Client: APIProtocol {
/// 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.
///
/// - Remark: HTTP `GET /assignments/{assignment_id}/accepted_assignments`.
/// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assigments-for-an-assignment)`.
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 {
/// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)`.
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 {
try await client.send(
input: input,
forOperation: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.id,
forOperation: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.id,
serializer: { input in
let path = try converter.renderedPath(
template: "/assignments/{}/accepted_assignments",
Expand Down Expand Up @@ -170,7 +170,7 @@ public struct Client: APIProtocol {
switch response.status.code {
case 200:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.classroom_sol_list_hyphen_accepted_hyphen_assigments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok.Body
let body: Operations.classroom_sol_list_hyphen_accepted_hyphen_assignments_hyphen_for_hyphen_an_hyphen_assignment.Output.Ok.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
Expand Down
Loading