Skip to content

Bump Submodule/github/rest-api-description from 9eeb21a to 5b01aaf #71

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
4 changes: 2 additions & 2 deletions Sources/checks/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ public enum Components {
/// The id of the check.
///
/// - Remark: Generated from `#/components/schemas/check-run/id`.
public var id: Swift.Int
public var id: Swift.Int64
/// The SHA of the commit that is being checked.
///
/// - Remark: Generated from `#/components/schemas/check-run/head_sha`.
Expand Down Expand Up @@ -2192,7 +2192,7 @@ public enum Components {
/// - pull_requests: Pull requests that are open with a `head_sha` or `head_branch` that matches the check. The returned pull requests do not necessarily indicate pull requests that triggered the check.
/// - deployment:
public init(
id: Swift.Int,
id: Swift.Int64,
head_sha: Swift.String,
node_id: Swift.String,
external_id: Swift.String? = nil,
Expand Down
4 changes: 2 additions & 2 deletions Sources/git/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public struct Client: APIProtocol {
return .forbidden(.init(body: body))
case 422:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.validation_failed.Body
let body: Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
Expand All @@ -186,7 +186,7 @@ public struct Client: APIProtocol {
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.validation_hyphen_error.self,
Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent.Body.jsonPayload.self,
from: responseBody,
transforming: { value in
.json(value)
Expand Down
165 changes: 162 additions & 3 deletions Sources/git/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,102 @@ public enum Components {
case signature
}
}
/// The ID of the push protection bypass placeholder. This value is returned on any push protected routes.
///
/// - Remark: Generated from `#/components/schemas/secret-scanning-push-protection-bypass-placeholder-id`.
public typealias secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_placeholder_hyphen_id = Swift.String
/// Repository rule violation was detected
///
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error`.
public struct repository_hyphen_rule_hyphen_violation_hyphen_error: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/message`.
public var message: Swift.String?
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/documentation_url`.
public var documentation_url: Swift.String?
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/status`.
public var status: Swift.String?
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata`.
public struct metadataPayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning`.
public struct secret_scanningPayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning/bypass_placeholdersPayload`.
public struct bypass_placeholdersPayloadPayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning/bypass_placeholdersPayload/placeholder_id`.
public var placeholder_id: Components.Schemas.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_placeholder_hyphen_id?
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning/bypass_placeholdersPayload/token_type`.
public var token_type: Swift.String?
/// Creates a new `bypass_placeholdersPayloadPayload`.
///
/// - Parameters:
/// - placeholder_id:
/// - token_type:
public init(
placeholder_id: Components.Schemas.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_placeholder_hyphen_id? = nil,
token_type: Swift.String? = nil
) {
self.placeholder_id = placeholder_id
self.token_type = token_type
}
public enum CodingKeys: String, CodingKey {
case placeholder_id
case token_type
}
}
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning/bypass_placeholders`.
public typealias bypass_placeholdersPayload = [Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload.secret_scanningPayload.bypass_placeholdersPayloadPayload]
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning/bypass_placeholders`.
public var bypass_placeholders: Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload.secret_scanningPayload.bypass_placeholdersPayload?
/// Creates a new `secret_scanningPayload`.
///
/// - Parameters:
/// - bypass_placeholders:
public init(bypass_placeholders: Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload.secret_scanningPayload.bypass_placeholdersPayload? = nil) {
self.bypass_placeholders = bypass_placeholders
}
public enum CodingKeys: String, CodingKey {
case bypass_placeholders
}
}
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning`.
public var secret_scanning: Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload.secret_scanningPayload?
/// Creates a new `metadataPayload`.
///
/// - Parameters:
/// - secret_scanning:
public init(secret_scanning: Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload.secret_scanningPayload? = nil) {
self.secret_scanning = secret_scanning
}
public enum CodingKeys: String, CodingKey {
case secret_scanning
}
}
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata`.
public var metadata: Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload?
/// Creates a new `repository_hyphen_rule_hyphen_violation_hyphen_error`.
///
/// - Parameters:
/// - message:
/// - documentation_url:
/// - status:
/// - metadata:
public init(
message: Swift.String? = nil,
documentation_url: Swift.String? = nil,
status: Swift.String? = nil,
metadata: Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload? = nil
) {
self.message = message
self.documentation_url = documentation_url
self.status = status
self.metadata = metadata
}
public enum CodingKeys: String, CodingKey {
case message
case documentation_url
case status
case metadata
}
}
/// Short Blob
///
/// - Remark: Generated from `#/components/schemas/short-blob`.
Expand Down Expand Up @@ -1803,17 +1899,80 @@ public enum Operations {
}
}
}
/// Validation failed, or the endpoint has been spammed.
public struct UnprocessableContent: Sendable, Hashable {
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/git/blobs/POST/responses/422/content`.
@frozen public enum Body: Sendable, Hashable {
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/git/blobs/POST/responses/422/content/json`.
@frozen public enum jsonPayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/git/blobs/POST/responses/422/content/json/case1`.
case validation_hyphen_error(Components.Schemas.validation_hyphen_error)
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/git/blobs/POST/responses/422/content/json/case2`.
case repository_hyphen_rule_hyphen_violation_hyphen_error(Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error)
public init(from decoder: any Decoder) throws {
var errors: [any Error] = []
do {
self = .validation_hyphen_error(try .init(from: decoder))
return
} catch {
errors.append(error)
}
do {
self = .repository_hyphen_rule_hyphen_violation_hyphen_error(try .init(from: decoder))
return
} catch {
errors.append(error)
}
throw Swift.DecodingError.failedToDecodeOneOfSchema(
type: Self.self,
codingPath: decoder.codingPath,
errors: errors
)
}
public func encode(to encoder: any Encoder) throws {
switch self {
case let .validation_hyphen_error(value):
try value.encode(to: encoder)
case let .repository_hyphen_rule_hyphen_violation_hyphen_error(value):
try value.encode(to: encoder)
}
}
}
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/git/blobs/POST/responses/422/content/application\/json`.
case json(Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent.Body.jsonPayload)
/// The associated value of the enum case if `self` is `.json`.
///
/// - Throws: An error if `self` is not `.json`.
/// - SeeAlso: `.json`.
public var json: Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent.Body.jsonPayload {
get throws {
switch self {
case let .json(body):
return body
}
}
}
}
/// Received HTTP response body
public var body: Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent.Body
/// Creates a new `UnprocessableContent`.
///
/// - Parameters:
/// - body: Received HTTP response body
public init(body: Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent.Body) {
self.body = body
}
}
/// Validation failed
///
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/git/blobs/post(git/create-blob)/responses/422`.
///
/// HTTP response code: `422 unprocessableContent`.
case unprocessableContent(Components.Responses.validation_failed)
case unprocessableContent(Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent)
/// The associated value of the enum case if `self` is `.unprocessableContent`.
///
/// - Throws: An error if `self` is not `.unprocessableContent`.
/// - SeeAlso: `.unprocessableContent`.
public var unprocessableContent: Components.Responses.validation_failed {
public var unprocessableContent: Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent {
get throws {
switch self {
case let .unprocessableContent(response):
Expand Down
4 changes: 2 additions & 2 deletions Sources/repos/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8476,7 +8476,7 @@ public struct Client: APIProtocol {
return .unprocessableContent(.init(body: body))
case 409:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.conflict.Body
let body: Operations.repos_sol_create_hyphen_or_hyphen_update_hyphen_file_hyphen_contents.Output.Conflict.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
Expand All @@ -8486,7 +8486,7 @@ public struct Client: APIProtocol {
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.basic_hyphen_error.self,
Operations.repos_sol_create_hyphen_or_hyphen_update_hyphen_file_hyphen_contents.Output.Conflict.Body.jsonPayload.self,
from: responseBody,
transforming: { value in
.json(value)
Expand Down
Loading