Skip to content

Commit a89f5c2

Browse files
Update generated code
1 parent 20708a7 commit a89f5c2

2,243 files changed

Lines changed: 153023 additions & 71080 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Sources/AppStoreConnectKit/autogenerated/Endpoints/Namespace.swift

Lines changed: 878 additions & 74 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// autogenerated
2+
3+
// swiftlint:disable all
4+
import Foundation
5+
#if canImport(FoundationNetworking)
6+
import FoundationNetworking
7+
#endif
8+
9+
extension V1.AccessibilityDeclarations {
10+
public struct POST: Endpoint {
11+
public typealias Parameters = AccessibilityDeclarationCreateRequest
12+
public typealias Response = AccessibilityDeclarationResponse
13+
14+
public var path: String {
15+
"/v1/accessibilityDeclarations"
16+
}
17+
18+
/// AccessibilityDeclaration representation
19+
public var parameters: Parameters
20+
21+
public init(parameters: Parameters) {
22+
self.parameters = parameters
23+
}
24+
25+
public func request(with baseURL: URL) throws -> URLRequest? {
26+
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true)
27+
components?.path = path
28+
29+
var urlRequest = components?.url.map { URLRequest(url: $0) }
30+
urlRequest?.httpMethod = "POST"
31+
32+
var jsonEncoder: JSONEncoder {
33+
let encoder = JSONEncoder()
34+
return encoder
35+
}
36+
37+
urlRequest?.httpBody = try jsonEncoder.encode(parameters)
38+
urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type")
39+
return urlRequest
40+
}
41+
42+
/// - Returns: **201**, Single AccessibilityDeclaration as `AccessibilityDeclarationResponse`
43+
/// - Throws: **400**, Parameter error(s) as `ErrorResponse`
44+
/// - Throws: **401**, Unauthorized error(s) as `ErrorResponse`
45+
/// - Throws: **403**, Forbidden error as `ErrorResponse`
46+
/// - Throws: **409**, Request entity error(s) as `ErrorResponse`
47+
/// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse`
48+
/// - Throws: **429**, Rate limit exceeded error as `ErrorResponse`
49+
public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response {
50+
var jsonDecoder: JSONDecoder {
51+
let decoder = JSONDecoder()
52+
return decoder
53+
}
54+
55+
switch urlResponse.statusCode {
56+
case 201:
57+
return try jsonDecoder.decode(AccessibilityDeclarationResponse.self, from: data)
58+
59+
case 400:
60+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
61+
62+
case 401:
63+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
64+
65+
case 403:
66+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
67+
68+
case 409:
69+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
70+
71+
case 422:
72+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
73+
74+
case 429:
75+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
76+
77+
default:
78+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
79+
}
80+
}
81+
}
82+
}
83+
84+
// swiftlint:enable all
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// autogenerated
2+
3+
// swiftlint:disable all
4+
import Foundation
5+
#if canImport(FoundationNetworking)
6+
import FoundationNetworking
7+
#endif
8+
9+
extension V1.AccessibilityDeclarations.ById {
10+
public struct DELETE: Endpoint {
11+
public typealias Parameters = Never
12+
public typealias Response = Void
13+
14+
public var path: String {
15+
"/v1/accessibilityDeclarations/\(id)"
16+
}
17+
18+
/// the id of the requested resource
19+
public var id: String
20+
21+
public init(id: String) {
22+
self.id = id
23+
}
24+
25+
public func request(with baseURL: URL) throws -> URLRequest? {
26+
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true)
27+
components?.path = path
28+
29+
var urlRequest = components?.url.map { URLRequest(url: $0) }
30+
urlRequest?.httpMethod = "DELETE"
31+
return urlRequest
32+
}
33+
34+
/// - Throws: **400**, Parameter error(s) as `ErrorResponse`
35+
/// - Throws: **401**, Unauthorized error(s) as `ErrorResponse`
36+
/// - Throws: **403**, Forbidden error as `ErrorResponse`
37+
/// - Throws: **404**, Not found error as `ErrorResponse`
38+
/// - Throws: **409**, Request entity error(s) as `ErrorResponse`
39+
/// - Throws: **429**, Rate limit exceeded error as `ErrorResponse`
40+
public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response {
41+
var jsonDecoder: JSONDecoder {
42+
let decoder = JSONDecoder()
43+
return decoder
44+
}
45+
46+
switch urlResponse.statusCode {
47+
case 400:
48+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
49+
50+
case 401:
51+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
52+
53+
case 403:
54+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
55+
56+
case 404:
57+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
58+
59+
case 409:
60+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
61+
62+
case 429:
63+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
64+
65+
default:
66+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
67+
}
68+
}
69+
}
70+
}
71+
72+
// swiftlint:enable all
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
// autogenerated
2+
3+
// swiftlint:disable all
4+
import Foundation
5+
#if canImport(FoundationNetworking)
6+
import FoundationNetworking
7+
#endif
8+
9+
extension V1.AccessibilityDeclarations.ById {
10+
public struct GET: Endpoint {
11+
public typealias Response = AccessibilityDeclarationResponse
12+
13+
public var path: String {
14+
"/v1/accessibilityDeclarations/\(id)"
15+
}
16+
17+
/// the id of the requested resource
18+
public var id: String
19+
20+
public var parameters: Parameters = Parameters()
21+
22+
public init(id: String) {
23+
self.id = id
24+
}
25+
26+
public func request(with baseURL: URL) throws -> URLRequest? {
27+
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true)
28+
components?.path = path
29+
30+
components?.queryItems = [
31+
URLQueryItem(name: "fields[accessibilityDeclarations]",
32+
value: parameters.fields[.accessibilityDeclarations]?.map { "\($0)" }.joined(separator: ","))
33+
].filter { $0.value != nil }
34+
if components?.queryItems?.isEmpty ?? false {
35+
components?.queryItems = nil
36+
}
37+
38+
var urlRequest = components?.url.map { URLRequest(url: $0) }
39+
urlRequest?.httpMethod = "GET"
40+
return urlRequest
41+
}
42+
43+
/// - Returns: **200**, Single AccessibilityDeclaration as `AccessibilityDeclarationResponse`
44+
/// - Throws: **400**, Parameter error(s) as `ErrorResponse`
45+
/// - Throws: **401**, Unauthorized error(s) as `ErrorResponse`
46+
/// - Throws: **403**, Forbidden error as `ErrorResponse`
47+
/// - Throws: **404**, Not found error as `ErrorResponse`
48+
/// - Throws: **429**, Rate limit exceeded error as `ErrorResponse`
49+
public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response {
50+
var jsonDecoder: JSONDecoder {
51+
let decoder = JSONDecoder()
52+
return decoder
53+
}
54+
55+
switch urlResponse.statusCode {
56+
case 200:
57+
return try jsonDecoder.decode(AccessibilityDeclarationResponse.self, from: data)
58+
59+
case 400:
60+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
61+
62+
case 401:
63+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
64+
65+
case 403:
66+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
67+
68+
case 404:
69+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
70+
71+
case 429:
72+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
73+
74+
default:
75+
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
76+
}
77+
}
78+
}
79+
}
80+
81+
extension V1.AccessibilityDeclarations.ById.GET {
82+
public struct Parameters: Hashable {
83+
public var fields: Fields = Fields()
84+
85+
public struct Fields: Hashable {
86+
public subscript <T: Hashable>(_ relation: Relation<T>) -> T {
87+
get { values[relation]?.base as! T }
88+
set { values[relation] = AnyHashable(newValue) }
89+
}
90+
91+
private var values: [AnyHashable: AnyHashable] = [:]
92+
93+
public struct AccessibilityDeclarations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable {
94+
public static var deviceFamily: Self {
95+
.init(rawValue: "deviceFamily")
96+
}
97+
98+
public static var state: Self {
99+
.init(rawValue: "state")
100+
}
101+
102+
public static var supportsAudioDescriptions: Self {
103+
.init(rawValue: "supportsAudioDescriptions")
104+
}
105+
106+
public static var supportsCaptions: Self {
107+
.init(rawValue: "supportsCaptions")
108+
}
109+
110+
public static var supportsDarkInterface: Self {
111+
.init(rawValue: "supportsDarkInterface")
112+
}
113+
114+
public static var supportsDifferentiateWithoutColorAlone: Self {
115+
.init(rawValue: "supportsDifferentiateWithoutColorAlone")
116+
}
117+
118+
public static var supportsLargerText: Self {
119+
.init(rawValue: "supportsLargerText")
120+
}
121+
122+
public static var supportsReducedMotion: Self {
123+
.init(rawValue: "supportsReducedMotion")
124+
}
125+
126+
public static var supportsSufficientContrast: Self {
127+
.init(rawValue: "supportsSufficientContrast")
128+
}
129+
130+
public static var supportsVoiceControl: Self {
131+
.init(rawValue: "supportsVoiceControl")
132+
}
133+
134+
public static var supportsVoiceover: Self {
135+
.init(rawValue: "supportsVoiceover")
136+
}
137+
138+
public var description: String {
139+
rawValue
140+
}
141+
142+
public var rawValue: String
143+
144+
public init(rawValue: String) {
145+
self.rawValue = rawValue
146+
}
147+
}
148+
149+
public struct Relation<T>: Hashable {
150+
/// the fields to include for returned resources of type accessibilityDeclarations
151+
public static var accessibilityDeclarations: Relation<[AccessibilityDeclarations]?> {
152+
.init(key: "fields[accessibilityDeclarations]")
153+
}
154+
155+
internal let key: String
156+
157+
public func hash(into hasher: inout Hasher) {
158+
hasher.combine(key)
159+
}
160+
}
161+
}
162+
}
163+
}
164+
165+
// swiftlint:enable all

0 commit comments

Comments
 (0)