Skip to content

Commit e42299d

Browse files
Commit via running ake Sources/gists
1 parent 20d0bc1 commit e42299d

File tree

1 file changed

+143
-125
lines changed

1 file changed

+143
-125
lines changed

Sources/gists/Types.swift

Lines changed: 143 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,131 @@ public enum Components {
755755
case status
756756
}
757757
}
758+
/// Validation Error
759+
///
760+
/// - Remark: Generated from `#/components/schemas/validation-error`.
761+
public struct validation_hyphen_error: Codable, Hashable, Sendable {
762+
/// - Remark: Generated from `#/components/schemas/validation-error/message`.
763+
public var message: Swift.String
764+
/// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`.
765+
public var documentation_url: Swift.String
766+
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`.
767+
public struct errorsPayloadPayload: Codable, Hashable, Sendable {
768+
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`.
769+
public var resource: Swift.String?
770+
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`.
771+
public var field: Swift.String?
772+
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`.
773+
public var message: Swift.String?
774+
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`.
775+
public var code: Swift.String
776+
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`.
777+
public var index: Swift.Int?
778+
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`.
779+
@frozen public enum valuePayload: Codable, Hashable, Sendable {
780+
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`.
781+
case case1(Swift.String?)
782+
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`.
783+
case case2(Swift.Int?)
784+
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`.
785+
case case3([Swift.String]?)
786+
public init(from decoder: any Decoder) throws {
787+
var errors: [any Error] = []
788+
do {
789+
self = .case1(try decoder.decodeFromSingleValueContainer())
790+
return
791+
} catch {
792+
errors.append(error)
793+
}
794+
do {
795+
self = .case2(try decoder.decodeFromSingleValueContainer())
796+
return
797+
} catch {
798+
errors.append(error)
799+
}
800+
do {
801+
self = .case3(try decoder.decodeFromSingleValueContainer())
802+
return
803+
} catch {
804+
errors.append(error)
805+
}
806+
throw Swift.DecodingError.failedToDecodeOneOfSchema(
807+
type: Self.self,
808+
codingPath: decoder.codingPath,
809+
errors: errors
810+
)
811+
}
812+
public func encode(to encoder: any Encoder) throws {
813+
switch self {
814+
case let .case1(value):
815+
try encoder.encodeToSingleValueContainer(value)
816+
case let .case2(value):
817+
try encoder.encodeToSingleValueContainer(value)
818+
case let .case3(value):
819+
try encoder.encodeToSingleValueContainer(value)
820+
}
821+
}
822+
}
823+
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`.
824+
public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload?
825+
/// Creates a new `errorsPayloadPayload`.
826+
///
827+
/// - Parameters:
828+
/// - resource:
829+
/// - field:
830+
/// - message:
831+
/// - code:
832+
/// - index:
833+
/// - value:
834+
public init(
835+
resource: Swift.String? = nil,
836+
field: Swift.String? = nil,
837+
message: Swift.String? = nil,
838+
code: Swift.String,
839+
index: Swift.Int? = nil,
840+
value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil
841+
) {
842+
self.resource = resource
843+
self.field = field
844+
self.message = message
845+
self.code = code
846+
self.index = index
847+
self.value = value
848+
}
849+
public enum CodingKeys: String, CodingKey {
850+
case resource
851+
case field
852+
case message
853+
case code
854+
case index
855+
case value
856+
}
857+
}
858+
/// - Remark: Generated from `#/components/schemas/validation-error/errors`.
859+
public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload]
860+
/// - Remark: Generated from `#/components/schemas/validation-error/errors`.
861+
public var errors: Components.Schemas.validation_hyphen_error.errorsPayload?
862+
/// Creates a new `validation_hyphen_error`.
863+
///
864+
/// - Parameters:
865+
/// - message:
866+
/// - documentation_url:
867+
/// - errors:
868+
public init(
869+
message: Swift.String,
870+
documentation_url: Swift.String,
871+
errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil
872+
) {
873+
self.message = message
874+
self.documentation_url = documentation_url
875+
self.errors = errors
876+
}
877+
public enum CodingKeys: String, CodingKey {
878+
case message
879+
case documentation_url
880+
case errors
881+
}
882+
}
758883
/// A GitHub user.
759884
///
760885
/// - Remark: Generated from `#/components/schemas/nullable-simple-user`.
@@ -900,131 +1025,6 @@ public enum Components {
9001025
case user_view_type
9011026
}
9021027
}
903-
/// Validation Error
904-
///
905-
/// - Remark: Generated from `#/components/schemas/validation-error`.
906-
public struct validation_hyphen_error: Codable, Hashable, Sendable {
907-
/// - Remark: Generated from `#/components/schemas/validation-error/message`.
908-
public var message: Swift.String
909-
/// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`.
910-
public var documentation_url: Swift.String
911-
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload`.
912-
public struct errorsPayloadPayload: Codable, Hashable, Sendable {
913-
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/resource`.
914-
public var resource: Swift.String?
915-
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/field`.
916-
public var field: Swift.String?
917-
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/message`.
918-
public var message: Swift.String?
919-
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/code`.
920-
public var code: Swift.String
921-
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/index`.
922-
public var index: Swift.Int?
923-
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`.
924-
@frozen public enum valuePayload: Codable, Hashable, Sendable {
925-
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case1`.
926-
case case1(Swift.String?)
927-
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case2`.
928-
case case2(Swift.Int?)
929-
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value/case3`.
930-
case case3([Swift.String]?)
931-
public init(from decoder: any Decoder) throws {
932-
var errors: [any Error] = []
933-
do {
934-
self = .case1(try decoder.decodeFromSingleValueContainer())
935-
return
936-
} catch {
937-
errors.append(error)
938-
}
939-
do {
940-
self = .case2(try decoder.decodeFromSingleValueContainer())
941-
return
942-
} catch {
943-
errors.append(error)
944-
}
945-
do {
946-
self = .case3(try decoder.decodeFromSingleValueContainer())
947-
return
948-
} catch {
949-
errors.append(error)
950-
}
951-
throw Swift.DecodingError.failedToDecodeOneOfSchema(
952-
type: Self.self,
953-
codingPath: decoder.codingPath,
954-
errors: errors
955-
)
956-
}
957-
public func encode(to encoder: any Encoder) throws {
958-
switch self {
959-
case let .case1(value):
960-
try encoder.encodeToSingleValueContainer(value)
961-
case let .case2(value):
962-
try encoder.encodeToSingleValueContainer(value)
963-
case let .case3(value):
964-
try encoder.encodeToSingleValueContainer(value)
965-
}
966-
}
967-
}
968-
/// - Remark: Generated from `#/components/schemas/validation-error/errorsPayload/value`.
969-
public var value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload?
970-
/// Creates a new `errorsPayloadPayload`.
971-
///
972-
/// - Parameters:
973-
/// - resource:
974-
/// - field:
975-
/// - message:
976-
/// - code:
977-
/// - index:
978-
/// - value:
979-
public init(
980-
resource: Swift.String? = nil,
981-
field: Swift.String? = nil,
982-
message: Swift.String? = nil,
983-
code: Swift.String,
984-
index: Swift.Int? = nil,
985-
value: Components.Schemas.validation_hyphen_error.errorsPayloadPayload.valuePayload? = nil
986-
) {
987-
self.resource = resource
988-
self.field = field
989-
self.message = message
990-
self.code = code
991-
self.index = index
992-
self.value = value
993-
}
994-
public enum CodingKeys: String, CodingKey {
995-
case resource
996-
case field
997-
case message
998-
case code
999-
case index
1000-
case value
1001-
}
1002-
}
1003-
/// - Remark: Generated from `#/components/schemas/validation-error/errors`.
1004-
public typealias errorsPayload = [Components.Schemas.validation_hyphen_error.errorsPayloadPayload]
1005-
/// - Remark: Generated from `#/components/schemas/validation-error/errors`.
1006-
public var errors: Components.Schemas.validation_hyphen_error.errorsPayload?
1007-
/// Creates a new `validation_hyphen_error`.
1008-
///
1009-
/// - Parameters:
1010-
/// - message:
1011-
/// - documentation_url:
1012-
/// - errors:
1013-
public init(
1014-
message: Swift.String,
1015-
documentation_url: Swift.String,
1016-
errors: Components.Schemas.validation_hyphen_error.errorsPayload? = nil
1017-
) {
1018-
self.message = message
1019-
self.documentation_url = documentation_url
1020-
self.errors = errors
1021-
}
1022-
public enum CodingKeys: String, CodingKey {
1023-
case message
1024-
case documentation_url
1025-
case errors
1026-
}
1027-
}
10281028
/// How the author is associated with the repository.
10291029
///
10301030
/// - Remark: Generated from `#/components/schemas/author-association`.
@@ -1137,6 +1137,8 @@ public enum Components {
11371137
public var description: Swift.String?
11381138
/// - Remark: Generated from `#/components/schemas/base-gist/comments`.
11391139
public var comments: Swift.Int
1140+
/// - Remark: Generated from `#/components/schemas/base-gist/comments_enabled`.
1141+
public var comments_enabled: Swift.Bool?
11401142
/// - Remark: Generated from `#/components/schemas/base-gist/user`.
11411143
public var user: Components.Schemas.nullable_hyphen_simple_hyphen_user?
11421144
/// - Remark: Generated from `#/components/schemas/base-gist/comments_url`.
@@ -1166,6 +1168,7 @@ public enum Components {
11661168
/// - updated_at:
11671169
/// - description:
11681170
/// - comments:
1171+
/// - comments_enabled:
11691172
/// - user:
11701173
/// - comments_url:
11711174
/// - owner:
@@ -1187,6 +1190,7 @@ public enum Components {
11871190
updated_at: Foundation.Date,
11881191
description: Swift.String? = nil,
11891192
comments: Swift.Int,
1193+
comments_enabled: Swift.Bool? = nil,
11901194
user: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil,
11911195
comments_url: Swift.String,
11921196
owner: Components.Schemas.simple_hyphen_user? = nil,
@@ -1208,6 +1212,7 @@ public enum Components {
12081212
self.updated_at = updated_at
12091213
self.description = description
12101214
self.comments = comments
1215+
self.comments_enabled = comments_enabled
12111216
self.user = user
12121217
self.comments_url = comments_url
12131218
self.owner = owner
@@ -1230,6 +1235,7 @@ public enum Components {
12301235
case updated_at
12311236
case description
12321237
case comments
1238+
case comments_enabled
12331239
case user
12341240
case comments_url
12351241
case owner
@@ -1947,6 +1953,8 @@ public enum Components {
19471953
public var description: Swift.String?
19481954
/// - Remark: Generated from `#/components/schemas/gist-simple/fork_of/comments`.
19491955
public var comments: Swift.Int
1956+
/// - Remark: Generated from `#/components/schemas/gist-simple/fork_of/comments_enabled`.
1957+
public var comments_enabled: Swift.Bool?
19501958
/// - Remark: Generated from `#/components/schemas/gist-simple/fork_of/user`.
19511959
public var user: Components.Schemas.nullable_hyphen_simple_hyphen_user?
19521960
/// - Remark: Generated from `#/components/schemas/gist-simple/fork_of/comments_url`.
@@ -1976,6 +1984,7 @@ public enum Components {
19761984
/// - updated_at:
19771985
/// - description:
19781986
/// - comments:
1987+
/// - comments_enabled:
19791988
/// - user:
19801989
/// - comments_url:
19811990
/// - owner:
@@ -1997,6 +2006,7 @@ public enum Components {
19972006
updated_at: Foundation.Date,
19982007
description: Swift.String? = nil,
19992008
comments: Swift.Int,
2009+
comments_enabled: Swift.Bool? = nil,
20002010
user: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil,
20012011
comments_url: Swift.String,
20022012
owner: Components.Schemas.nullable_hyphen_simple_hyphen_user? = nil,
@@ -2018,6 +2028,7 @@ public enum Components {
20182028
self.updated_at = updated_at
20192029
self.description = description
20202030
self.comments = comments
2031+
self.comments_enabled = comments_enabled
20212032
self.user = user
20222033
self.comments_url = comments_url
20232034
self.owner = owner
@@ -2040,6 +2051,7 @@ public enum Components {
20402051
case updated_at
20412052
case description
20422053
case comments
2054+
case comments_enabled
20432055
case user
20442056
case comments_url
20452057
case owner
@@ -2159,6 +2171,8 @@ public enum Components {
21592171
public var description: Swift.String?
21602172
/// - Remark: Generated from `#/components/schemas/gist-simple/comments`.
21612173
public var comments: Swift.Int?
2174+
/// - Remark: Generated from `#/components/schemas/gist-simple/comments_enabled`.
2175+
public var comments_enabled: Swift.Bool?
21622176
/// - Remark: Generated from `#/components/schemas/gist-simple/user`.
21632177
public var user: Swift.String?
21642178
/// - Remark: Generated from `#/components/schemas/gist-simple/comments_url`.
@@ -2187,6 +2201,7 @@ public enum Components {
21872201
/// - updated_at:
21882202
/// - description:
21892203
/// - comments:
2204+
/// - comments_enabled:
21902205
/// - user:
21912206
/// - comments_url:
21922207
/// - owner:
@@ -2209,6 +2224,7 @@ public enum Components {
22092224
updated_at: Swift.String? = nil,
22102225
description: Swift.String? = nil,
22112226
comments: Swift.Int? = nil,
2227+
comments_enabled: Swift.Bool? = nil,
22122228
user: Swift.String? = nil,
22132229
comments_url: Swift.String? = nil,
22142230
owner: Components.Schemas.simple_hyphen_user? = nil,
@@ -2231,6 +2247,7 @@ public enum Components {
22312247
self.updated_at = updated_at
22322248
self.description = description
22332249
self.comments = comments
2250+
self.comments_enabled = comments_enabled
22342251
self.user = user
22352252
self.comments_url = comments_url
22362253
self.owner = owner
@@ -2254,6 +2271,7 @@ public enum Components {
22542271
case updated_at
22552272
case description
22562273
case comments
2274+
case comments_enabled
22572275
case user
22582276
case comments_url
22592277
case owner

0 commit comments

Comments
 (0)