Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
952 changes: 878 additions & 74 deletions Sources/AppStoreConnectKit/autogenerated/Endpoints/Namespace.swift

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// autogenerated

// swiftlint:disable all
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

extension V1.AccessibilityDeclarations {
public struct POST: Endpoint {
public typealias Parameters = AccessibilityDeclarationCreateRequest
public typealias Response = AccessibilityDeclarationResponse

public var path: String {
"/v1/accessibilityDeclarations"
}

/// AccessibilityDeclaration representation
public var parameters: Parameters

public init(parameters: Parameters) {
self.parameters = parameters
}

public func request(with baseURL: URL) throws -> URLRequest? {
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true)
components?.path = path

var urlRequest = components?.url.map { URLRequest(url: $0) }
urlRequest?.httpMethod = "POST"

var jsonEncoder: JSONEncoder {
let encoder = JSONEncoder()
return encoder
}

urlRequest?.httpBody = try jsonEncoder.encode(parameters)
urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type")
return urlRequest
}

/// - Returns: **201**, Single AccessibilityDeclaration as `AccessibilityDeclarationResponse`
/// - Throws: **400**, Parameter error(s) as `ErrorResponse`
/// - Throws: **401**, Unauthorized error(s) as `ErrorResponse`
/// - Throws: **403**, Forbidden error as `ErrorResponse`
/// - Throws: **409**, Request entity error(s) as `ErrorResponse`
/// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse`
/// - Throws: **429**, Rate limit exceeded error as `ErrorResponse`
public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response {
var jsonDecoder: JSONDecoder {
let decoder = JSONDecoder()
return decoder
}

switch urlResponse.statusCode {
case 201:
return try jsonDecoder.decode(AccessibilityDeclarationResponse.self, from: data)

case 400:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 401:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 403:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 409:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 422:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 429:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

default:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
}
}
}
}

// swiftlint:enable all
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// autogenerated

// swiftlint:disable all
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

extension V1.AccessibilityDeclarations.ById {
public struct DELETE: Endpoint {
public typealias Parameters = Never
public typealias Response = Void

public var path: String {
"/v1/accessibilityDeclarations/\(id)"
}

/// the id of the requested resource
public var id: String

public init(id: String) {
self.id = id
}

public func request(with baseURL: URL) throws -> URLRequest? {
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true)
components?.path = path

var urlRequest = components?.url.map { URLRequest(url: $0) }
urlRequest?.httpMethod = "DELETE"
return urlRequest
}

/// - Throws: **400**, Parameter error(s) as `ErrorResponse`
/// - Throws: **401**, Unauthorized error(s) as `ErrorResponse`
/// - Throws: **403**, Forbidden error as `ErrorResponse`
/// - Throws: **404**, Not found error as `ErrorResponse`
/// - Throws: **409**, Request entity error(s) as `ErrorResponse`
/// - Throws: **429**, Rate limit exceeded error as `ErrorResponse`
public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response {
var jsonDecoder: JSONDecoder {
let decoder = JSONDecoder()
return decoder
}

switch urlResponse.statusCode {
case 400:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 401:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 403:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 404:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 409:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 429:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

default:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
}
}
}
}

// swiftlint:enable all
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
// autogenerated

// swiftlint:disable all
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

extension V1.AccessibilityDeclarations.ById {
public struct GET: Endpoint {
public typealias Response = AccessibilityDeclarationResponse

public var path: String {
"/v1/accessibilityDeclarations/\(id)"
}

/// the id of the requested resource
public var id: String

public var parameters: Parameters = Parameters()

public init(id: String) {
self.id = id
}

public func request(with baseURL: URL) throws -> URLRequest? {
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true)
components?.path = path

components?.queryItems = [
URLQueryItem(name: "fields[accessibilityDeclarations]",
value: parameters.fields[.accessibilityDeclarations]?.map { "\($0)" }.joined(separator: ","))
].filter { $0.value != nil }
if components?.queryItems?.isEmpty ?? false {
components?.queryItems = nil
}

var urlRequest = components?.url.map { URLRequest(url: $0) }
urlRequest?.httpMethod = "GET"
return urlRequest
}

/// - Returns: **200**, Single AccessibilityDeclaration as `AccessibilityDeclarationResponse`
/// - Throws: **400**, Parameter error(s) as `ErrorResponse`
/// - Throws: **401**, Unauthorized error(s) as `ErrorResponse`
/// - Throws: **403**, Forbidden error as `ErrorResponse`
/// - Throws: **404**, Not found error as `ErrorResponse`
/// - Throws: **429**, Rate limit exceeded error as `ErrorResponse`
public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response {
var jsonDecoder: JSONDecoder {
let decoder = JSONDecoder()
return decoder
}

switch urlResponse.statusCode {
case 200:
return try jsonDecoder.decode(AccessibilityDeclarationResponse.self, from: data)

case 400:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 401:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 403:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 404:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

case 429:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)

default:
throw try jsonDecoder.decode(ErrorResponse.self, from: data)
}
}
}
}

extension V1.AccessibilityDeclarations.ById.GET {
public struct Parameters: Hashable {
public var fields: Fields = Fields()

public struct Fields: Hashable {
public subscript <T: Hashable>(_ relation: Relation<T>) -> T {
get { values[relation]?.base as! T }
set { values[relation] = AnyHashable(newValue) }
}

private var values: [AnyHashable: AnyHashable] = [:]

public struct AccessibilityDeclarations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable {
public static var deviceFamily: Self {
.init(rawValue: "deviceFamily")
}

public static var state: Self {
.init(rawValue: "state")
}

public static var supportsAudioDescriptions: Self {
.init(rawValue: "supportsAudioDescriptions")
}

public static var supportsCaptions: Self {
.init(rawValue: "supportsCaptions")
}

public static var supportsDarkInterface: Self {
.init(rawValue: "supportsDarkInterface")
}

public static var supportsDifferentiateWithoutColorAlone: Self {
.init(rawValue: "supportsDifferentiateWithoutColorAlone")
}

public static var supportsLargerText: Self {
.init(rawValue: "supportsLargerText")
}

public static var supportsReducedMotion: Self {
.init(rawValue: "supportsReducedMotion")
}

public static var supportsSufficientContrast: Self {
.init(rawValue: "supportsSufficientContrast")
}

public static var supportsVoiceControl: Self {
.init(rawValue: "supportsVoiceControl")
}

public static var supportsVoiceover: Self {
.init(rawValue: "supportsVoiceover")
}

public var description: String {
rawValue
}

public var rawValue: String

public init(rawValue: String) {
self.rawValue = rawValue
}
}

public struct Relation<T>: Hashable {
/// the fields to include for returned resources of type accessibilityDeclarations
public static var accessibilityDeclarations: Relation<[AccessibilityDeclarations]?> {
.init(key: "fields[accessibilityDeclarations]")
}

internal let key: String

public func hash(into hasher: inout Hasher) {
hasher.combine(key)
}
}
}
}
}

// swiftlint:enable all
Loading