Skip to content

Commit e32cd62

Browse files
Commit via running ake Sources/git
1 parent 4951c72 commit e32cd62

File tree

2 files changed

+164
-5
lines changed

2 files changed

+164
-5
lines changed

Sources/git/Client.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public struct Client: APIProtocol {
176176
return .forbidden(.init(body: body))
177177
case 422:
178178
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
179-
let body: Components.Responses.validation_failed.Body
179+
let body: Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent.Body
180180
let chosenContentType = try converter.bestContentType(
181181
received: contentType,
182182
options: [
@@ -186,7 +186,7 @@ public struct Client: APIProtocol {
186186
switch chosenContentType {
187187
case "application/json":
188188
body = try await converter.getResponseBodyAsJSON(
189-
Components.Schemas.validation_hyphen_error.self,
189+
Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent.Body.jsonPayload.self,
190190
from: responseBody,
191191
transforming: { value in
192192
.json(value)

Sources/git/Types.swift

Lines changed: 162 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,102 @@ public enum Components {
812812
case signature
813813
}
814814
}
815+
/// The ID of the push protection bypass placeholder. This value is returned on any push protected routes.
816+
///
817+
/// - Remark: Generated from `#/components/schemas/secret-scanning-push-protection-bypass-placeholder-id`.
818+
public typealias secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_placeholder_hyphen_id = Swift.String
819+
/// Repository rule violation was detected
820+
///
821+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error`.
822+
public struct repository_hyphen_rule_hyphen_violation_hyphen_error: Codable, Hashable, Sendable {
823+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/message`.
824+
public var message: Swift.String?
825+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/documentation_url`.
826+
public var documentation_url: Swift.String?
827+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/status`.
828+
public var status: Swift.String?
829+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata`.
830+
public struct metadataPayload: Codable, Hashable, Sendable {
831+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning`.
832+
public struct secret_scanningPayload: Codable, Hashable, Sendable {
833+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning/bypass_placeholdersPayload`.
834+
public struct bypass_placeholdersPayloadPayload: Codable, Hashable, Sendable {
835+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning/bypass_placeholdersPayload/placeholder_id`.
836+
public var placeholder_id: Components.Schemas.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_placeholder_hyphen_id?
837+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning/bypass_placeholdersPayload/token_type`.
838+
public var token_type: Swift.String?
839+
/// Creates a new `bypass_placeholdersPayloadPayload`.
840+
///
841+
/// - Parameters:
842+
/// - placeholder_id:
843+
/// - token_type:
844+
public init(
845+
placeholder_id: Components.Schemas.secret_hyphen_scanning_hyphen_push_hyphen_protection_hyphen_bypass_hyphen_placeholder_hyphen_id? = nil,
846+
token_type: Swift.String? = nil
847+
) {
848+
self.placeholder_id = placeholder_id
849+
self.token_type = token_type
850+
}
851+
public enum CodingKeys: String, CodingKey {
852+
case placeholder_id
853+
case token_type
854+
}
855+
}
856+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning/bypass_placeholders`.
857+
public typealias bypass_placeholdersPayload = [Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload.secret_scanningPayload.bypass_placeholdersPayloadPayload]
858+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning/bypass_placeholders`.
859+
public var bypass_placeholders: Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload.secret_scanningPayload.bypass_placeholdersPayload?
860+
/// Creates a new `secret_scanningPayload`.
861+
///
862+
/// - Parameters:
863+
/// - bypass_placeholders:
864+
public init(bypass_placeholders: Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload.secret_scanningPayload.bypass_placeholdersPayload? = nil) {
865+
self.bypass_placeholders = bypass_placeholders
866+
}
867+
public enum CodingKeys: String, CodingKey {
868+
case bypass_placeholders
869+
}
870+
}
871+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata/secret_scanning`.
872+
public var secret_scanning: Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload.secret_scanningPayload?
873+
/// Creates a new `metadataPayload`.
874+
///
875+
/// - Parameters:
876+
/// - secret_scanning:
877+
public init(secret_scanning: Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload.secret_scanningPayload? = nil) {
878+
self.secret_scanning = secret_scanning
879+
}
880+
public enum CodingKeys: String, CodingKey {
881+
case secret_scanning
882+
}
883+
}
884+
/// - Remark: Generated from `#/components/schemas/repository-rule-violation-error/metadata`.
885+
public var metadata: Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload?
886+
/// Creates a new `repository_hyphen_rule_hyphen_violation_hyphen_error`.
887+
///
888+
/// - Parameters:
889+
/// - message:
890+
/// - documentation_url:
891+
/// - status:
892+
/// - metadata:
893+
public init(
894+
message: Swift.String? = nil,
895+
documentation_url: Swift.String? = nil,
896+
status: Swift.String? = nil,
897+
metadata: Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error.metadataPayload? = nil
898+
) {
899+
self.message = message
900+
self.documentation_url = documentation_url
901+
self.status = status
902+
self.metadata = metadata
903+
}
904+
public enum CodingKeys: String, CodingKey {
905+
case message
906+
case documentation_url
907+
case status
908+
case metadata
909+
}
910+
}
815911
/// Short Blob
816912
///
817913
/// - Remark: Generated from `#/components/schemas/short-blob`.
@@ -1803,17 +1899,80 @@ public enum Operations {
18031899
}
18041900
}
18051901
}
1806-
/// Validation failed, or the endpoint has been spammed.
1902+
public struct UnprocessableContent: Sendable, Hashable {
1903+
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/git/blobs/POST/responses/422/content`.
1904+
@frozen public enum Body: Sendable, Hashable {
1905+
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/git/blobs/POST/responses/422/content/json`.
1906+
@frozen public enum jsonPayload: Codable, Hashable, Sendable {
1907+
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/git/blobs/POST/responses/422/content/json/case1`.
1908+
case validation_hyphen_error(Components.Schemas.validation_hyphen_error)
1909+
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/git/blobs/POST/responses/422/content/json/case2`.
1910+
case repository_hyphen_rule_hyphen_violation_hyphen_error(Components.Schemas.repository_hyphen_rule_hyphen_violation_hyphen_error)
1911+
public init(from decoder: any Decoder) throws {
1912+
var errors: [any Error] = []
1913+
do {
1914+
self = .validation_hyphen_error(try .init(from: decoder))
1915+
return
1916+
} catch {
1917+
errors.append(error)
1918+
}
1919+
do {
1920+
self = .repository_hyphen_rule_hyphen_violation_hyphen_error(try .init(from: decoder))
1921+
return
1922+
} catch {
1923+
errors.append(error)
1924+
}
1925+
throw Swift.DecodingError.failedToDecodeOneOfSchema(
1926+
type: Self.self,
1927+
codingPath: decoder.codingPath,
1928+
errors: errors
1929+
)
1930+
}
1931+
public func encode(to encoder: any Encoder) throws {
1932+
switch self {
1933+
case let .validation_hyphen_error(value):
1934+
try value.encode(to: encoder)
1935+
case let .repository_hyphen_rule_hyphen_violation_hyphen_error(value):
1936+
try value.encode(to: encoder)
1937+
}
1938+
}
1939+
}
1940+
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/git/blobs/POST/responses/422/content/application\/json`.
1941+
case json(Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent.Body.jsonPayload)
1942+
/// The associated value of the enum case if `self` is `.json`.
1943+
///
1944+
/// - Throws: An error if `self` is not `.json`.
1945+
/// - SeeAlso: `.json`.
1946+
public var json: Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent.Body.jsonPayload {
1947+
get throws {
1948+
switch self {
1949+
case let .json(body):
1950+
return body
1951+
}
1952+
}
1953+
}
1954+
}
1955+
/// Received HTTP response body
1956+
public var body: Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent.Body
1957+
/// Creates a new `UnprocessableContent`.
1958+
///
1959+
/// - Parameters:
1960+
/// - body: Received HTTP response body
1961+
public init(body: Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent.Body) {
1962+
self.body = body
1963+
}
1964+
}
1965+
/// Validation failed
18071966
///
18081967
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/git/blobs/post(git/create-blob)/responses/422`.
18091968
///
18101969
/// HTTP response code: `422 unprocessableContent`.
1811-
case unprocessableContent(Components.Responses.validation_failed)
1970+
case unprocessableContent(Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent)
18121971
/// The associated value of the enum case if `self` is `.unprocessableContent`.
18131972
///
18141973
/// - Throws: An error if `self` is not `.unprocessableContent`.
18151974
/// - SeeAlso: `.unprocessableContent`.
1816-
public var unprocessableContent: Components.Responses.validation_failed {
1975+
public var unprocessableContent: Operations.git_sol_create_hyphen_blob.Output.UnprocessableContent {
18171976
get throws {
18181977
switch self {
18191978
case let .unprocessableContent(response):

0 commit comments

Comments
 (0)