From 87ab1f115f871f4a0e7537a8f9ee8aed4270b9fe Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Thu, 11 Jan 2024 17:20:40 -0500 Subject: [PATCH] refining API --- .swiftformat | 2 +- .swiftlint.yml | 142 +- Package.swift | 5 +- Scripts/generate.sh | 3 - Sources/IPSWDownloads/Client.swift | 1906 ------- Sources/IPSWDownloads/IPSWDownloads.swift | 40 + Sources/IPSWDownloads/Types.swift | 5007 ----------------- .../openapi-generator-config.yaml | 2 +- project.yml | 11 - 9 files changed, 154 insertions(+), 6964 deletions(-) delete mode 100755 Scripts/generate.sh delete mode 100644 Sources/IPSWDownloads/Client.swift create mode 100644 Sources/IPSWDownloads/IPSWDownloads.swift delete mode 100644 Sources/IPSWDownloads/Types.swift diff --git a/.swiftformat b/.swiftformat index 7001c5e..2601bf7 100644 --- a/.swiftformat +++ b/.swiftformat @@ -2,6 +2,6 @@ --header strip --commas inline --disable wrapMultilineStatementBraces ---extensionacl on-extension +--extensionacl on-declarations --decimalgrouping 3,4 --exclude .build, DerivedData diff --git a/.swiftlint.yml b/.swiftlint.yml index 95c8c9c..db96f2b 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,41 +1,121 @@ +opt_in_rules: + - anyobject_protocol + - array_init + - attributes + - closure_body_length + - closure_end_indentation + - closure_spacing + - collection_alignment + - conditional_returns_on_newline + - contains_over_filter_count + - contains_over_filter_is_empty + - contains_over_first_not_nil + - contains_over_range_nil_comparison + - convenience_type + - discouraged_object_literal + - discouraged_optional_boolean + - empty_collection_literal + - empty_count + - empty_string + - empty_xctest_method + - enum_case_associated_values_count + - expiring_todo + - explicit_acl + - explicit_init + - explicit_self + - explicit_top_level_acl + - fallthrough + - fatal_error_message + - file_header + - file_name + - file_name_no_space + - file_types_order + - first_where + - flatmap_over_map_reduce + - force_unwrapping + - function_default_parameter_at_end + - ibinspectable_in_extension + - identical_operands + - implicit_return + - implicitly_unwrapped_optional + - indentation_width + - joined_default_parameter + - last_where + - legacy_multiple + - legacy_random + - literal_expression_end_indentation + - lower_acl_than_parent + - missing_docs + - modifier_order + - multiline_arguments + - multiline_arguments_brackets + - multiline_function_chains + - multiline_literal_brackets + - multiline_parameters + - nimble_operator + - nslocalizedstring_key + - nslocalizedstring_require_bundle + - number_separator + - object_literal + - operator_usage_whitespace + - optional_enum_case_matching + - overridden_super_call + - override_in_extension + - pattern_matching_keywords + - prefer_self_type_over_type_of_self + - prefer_zero_over_explicit_init + - private_action + - private_outlet + - prohibited_interface_builder + - prohibited_super_call + - quick_discouraged_call + - quick_discouraged_focused_test + - quick_discouraged_pending_test + - reduce_into + - redundant_nil_coalescing + - redundant_type_annotation + - required_enum_case + - single_test_class + - sorted_first_last + - sorted_imports + - static_operator + - strict_fileprivate + - strong_iboutlet + - switch_case_on_newline + - toggle_bool + - trailing_closure + - type_contents_order + - unavailable_function + - unneeded_parentheses_in_closure_argument + - unowned_variable_capture + - untyped_error_in_catch + - unused_declaration + - unused_import + - vertical_parameter_alignment_on_call + - vertical_whitespace_between_cases + - vertical_whitespace_closing_braces + - vertical_whitespace_opening_braces + - xct_specific_matcher + - yoda_condition +cyclomatic_complexity: + - 6 + - 9 +file_length: + - 200 + - 550 +function_body_length: + - 15 + - 25 function_parameter_count: 8 +line_length: + - 90 + - 90 identifier_name: excluded: - id - - ok - - iv - - iTunes - - Access_hyphen_Control_hyphen_Allow_hyphen_Methods - - Access_hyphen_Control_hyphen_Allow_hyphen_Origin - - Cache_hyphen_Control - - X_hyphen_Data_hyphen_Location - - application_x_hyphen_plist - - text_html_charset_utf_hyphen_8 - - X_hyphen_Frame_hyphen_Options - - Expires - - Location -type_name: - excluded: - - iTunes - - Ok excluded: - Tests - DerivedData - .build indentation_width: indentation_width: 2 -disabled_rules: - - line_length - - nesting - - type_body_length - - function_body_length - - cyclomatic_complexity - - closure_body_length - - file_length -custom_rules: - payload_disallow: # 1 - name: "Payload Disallowed" # 2 - regex: '\\b(?!UndocumentedPayload\b)\w+Payload\b' # 3 - capture_group: 0 # 4 - message: "Do not use Payload for identifier." # 5 - severity: error # 6 \ No newline at end of file diff --git a/Package.swift b/Package.swift index 65d7b96..28619d2 100644 --- a/Package.swift +++ b/Package.swift @@ -23,10 +23,7 @@ let package = Package( .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession") ], - exclude: [ - "openapi-generator-config.yaml", - "openapi.yaml" - ] + plugins: [.plugin(name: "OpenAPIGenerator", package: "swift-openapi-generator")] ) ] ) diff --git a/Scripts/generate.sh b/Scripts/generate.sh deleted file mode 100755 index 2003cfb..0000000 --- a/Scripts/generate.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -swift run swift-openapi-generator generate --output-directory Sources/IPSWDownloads --config Sources/IPSWDownloads/openapi-generator-config.yaml Sources/IPSWDownloads/openapi.yaml \ No newline at end of file diff --git a/Sources/IPSWDownloads/Client.swift b/Sources/IPSWDownloads/Client.swift deleted file mode 100644 index 0893193..0000000 --- a/Sources/IPSWDownloads/Client.swift +++ /dev/null @@ -1,1906 +0,0 @@ -// Generated by swift-openapi-generator, do not modify. -@_spi(Generated) import OpenAPIRuntime -#if os(Linux) - @preconcurrency import struct Foundation.Data - @preconcurrency import struct Foundation.Date - @preconcurrency import struct Foundation.URL -#else - import struct Foundation.Data - import struct Foundation.Date - import struct Foundation.URL -#endif -import HTTPTypes -/// Download current and previous versions of Apple's iOS Firmware, iTunes and OTA updates. -public struct Client: APIProtocol { - /// The underlying HTTP client. - private let client: UniversalClient - /// Creates a new client. - /// - Parameters: - /// - serverURL: The server URL that the client connects to. Any server - /// URLs defined in the OpenAPI document are available as static methods - /// on the ``Servers`` type. - /// - configuration: A set of configuration values for the client. - /// - transport: A transport that performs HTTP operations. - /// - middlewares: A list of middlewares to call before the transport. - public init( - serverURL: Foundation.URL, - configuration: Configuration = .init(), - transport: any ClientTransport, - middlewares: [any ClientMiddleware] = [] - ) { - client = .init( - serverURL: serverURL, - configuration: configuration, - transport: transport, - middlewares: middlewares - ) - } - - private var converter: Converter { - client.converter - } - - /// Get Firmwares For Device - /// - /// GetFirmwaresForDevice returns Firmwares for a given Device. An optional "type" get parameter may be - /// specified to retrieve OTA Firmwares instead of normal IPSW files. - /// As of 2021-03-04, it is recommended that you use the "boards" property of the device, as devices can have multiple boards. - /// - /// - Remark: HTTP `GET /device/{identifier}`. - /// - Remark: Generated from `#/paths//device/{identifier}/get(firmwaresForDevice)`. - public func firmwaresForDevice(_ input: Operations.firmwaresForDevice.Input) async throws -> Operations.firmwaresForDevice.Output { - try await client.send( - input: input, - forOperation: Operations.firmwaresForDevice.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/device/{}", - parameters: [ - input.path.identifier - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "type", - value: input.query._type - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.firmwaresForDevice.Output.Ok.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.firmwaresForDevice.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/x-plist", - "application/xml" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Device.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/x-plist": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .application_x_hyphen_plist(value) - } - ) - case "application/xml": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .xml(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - let headers: Operations.firmwaresForDevice.Output.NotFound.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - return .notFound(.init(headers: headers)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Get Devices - /// - /// GetDevices returns a list of all devices known to IPSW Downloads - /// If you wish to only get devices which have Firmware Keys, add the ?keysOnly=true parameter. - /// As of 2021-03-04, it is recommended that you use the "boards" property of each device, as devices can have multiple boards. - /// - /// - Remark: HTTP `GET /devices`. - /// - Remark: Generated from `#/paths//devices/get(devices)`. - public func devices(_ input: Operations.devices.Input) async throws -> Operations.devices.Output { - try await client.send( - input: input, - forOperation: Operations.devices.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/devices", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "keysOnly", - value: input.query.keysOnly - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.devices.Output.Ok.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.devices.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/x-plist", - "application/xml" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [OpenAPIRuntime.OpenAPIValueContainer].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/x-plist": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .application_x_hyphen_plist(value) - } - ) - case "application/xml": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .xml(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Download IPSW - /// - /// DownloadIPSW redirects to download an IPSW as specified by its identifier and buildid - /// - /// - Remark: HTTP `GET /ipsw/download/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ipsw/download/{identifier}/{buildid}/get(ipswDownload)`. - public func ipswDownload(_ input: Operations.ipswDownload.Input) async throws -> Operations.ipswDownload.Output { - try await client.send( - input: input, - forOperation: Operations.ipswDownload.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/ipsw/download/{}/{}", - parameters: [ - input.path.identifier, - input.path.buildid - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 302: - let headers: Operations.ipswDownload.Output.Found.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ipswDownload.Output.Found.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "text/html" - ] - ) - switch chosenContentType { - case "text/html": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .text_html_charset_utf_hyphen_8(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .found(.init( - headers: headers, - body: body - )) - case 404: - let headers: Operations.ipswDownload.Output.NotFound.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - return .notFound(.init(headers: headers)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Get IPSW Information - /// - /// GetIPSWInformation returns all known information for an IPSW as specified by identifier and buildid - /// - /// - Remark: HTTP `GET /ipsw/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ipsw/{identifier}/{buildid}/get(ipswByIdentifierAndBuild)`. - public func ipswByIdentifierAndBuild(_ input: Operations.ipswByIdentifierAndBuild.Input) async throws -> Operations.ipswByIdentifierAndBuild.Output { - try await client.send( - input: input, - forOperation: Operations.ipswByIdentifierAndBuild.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/ipsw/{}/{}", - parameters: [ - input.path.identifier, - input.path.buildid - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.ipswByIdentifierAndBuild.Output.Ok.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ipswByIdentifierAndBuild.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/x-plist", - "application/xml" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Firmware.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/x-plist": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .application_x_hyphen_plist(value) - } - ) - case "application/xml": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .xml(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - let headers: Operations.ipswByIdentifierAndBuild.Output.NotFound.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - return .notFound(.init(headers: headers)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Get IPSW List For Version - /// - /// GetIPSWListForVersion finds all IPSW files for a given iOS version - /// - /// - Remark: HTTP `GET /ipsw/{version}`. - /// - Remark: Generated from `#/paths//ipsw/{version}/get(ipswListForVersion)`. - public func ipswListForVersion(_ input: Operations.ipswListForVersion.Input) async throws -> Operations.ipswListForVersion.Output { - try await client.send( - input: input, - forOperation: Operations.ipswListForVersion.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/ipsw/{}", - parameters: [ - input.path.version - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.ipswListForVersion.Output.Ok.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ipswListForVersion.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/x-plist", - "application/xml" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [OpenAPIRuntime.OpenAPIValueContainer].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/x-plist": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .application_x_hyphen_plist(value) - } - ) - case "application/xml": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .xml(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - let headers: Operations.ipswListForVersion.Output.NotFound.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - return .notFound(.init(headers: headers)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Download Itunes - /// - /// DownloadItunes redirects to download an iTunes installer as specified by its platform and version, and architecture for windows - /// - /// - Remark: HTTP `GET /itunes/download/{platform}/{version}`. - /// - Remark: Generated from `#/paths//itunes/download/{platform}/{version}/get(itunesDownloadForPlatformAndVersion)`. - public func itunesDownloadForPlatformAndVersion(_ input: Operations.itunesDownloadForPlatformAndVersion.Input) async throws -> Operations.itunesDownloadForPlatformAndVersion.Output { - try await client.send( - input: input, - forOperation: Operations.itunesDownloadForPlatformAndVersion.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/itunes/download/{}/{}", - parameters: [ - input.path.platform, - input.path.version - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "arch", - value: input.query.arch - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 302: - let headers: Operations.itunesDownloadForPlatformAndVersion.Output.Found.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.itunesDownloadForPlatformAndVersion.Output.Found.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "text/html" - ] - ) - switch chosenContentType { - case "text/html": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .text_html_charset_utf_hyphen_8(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .found(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Find Itunes - /// - /// FindItunes finds FindItunes versions for a given platform. specify either "windows" or "macOS" - /// - /// - Remark: HTTP `GET /itunes/{platform}`. - /// - Remark: Generated from `#/paths//itunes/{platform}/get(itunesForPlatform)`. - public func itunesForPlatform(_ input: Operations.itunesForPlatform.Input) async throws -> Operations.itunesForPlatform.Output { - try await client.send( - input: input, - forOperation: Operations.itunesForPlatform.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/itunes/{}", - parameters: [ - input.path.platform - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.itunesForPlatform.Output.Ok.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.itunesForPlatform.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/x-plist", - "application/xml" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.iTunes].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/x-plist": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .application_x_hyphen_plist(value) - } - ) - case "application/xml": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .xml(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - let headers: Operations.itunesForPlatform.Output.NotFound.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - return .notFound(.init(headers: headers)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Keys Device List - /// - /// KeysDeviceList returns the firmwares which have keys for a given device - /// - /// - Remark: HTTP `GET /keys/device/{identifier}`. - /// - Remark: Generated from `#/paths//keys/device/{identifier}/get(firmwareKeysForIdentifier)`. - public func firmwareKeysForIdentifier(_ input: Operations.firmwareKeysForIdentifier.Input) async throws -> Operations.firmwareKeysForIdentifier.Output { - try await client.send( - input: input, - forOperation: Operations.firmwareKeysForIdentifier.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/keys/device/{}", - parameters: [ - input.path.identifier - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.firmwareKeysForIdentifier.Output.Ok.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.firmwareKeysForIdentifier.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/x-plist", - "application/xml" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.FirmwareKey].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/x-plist": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .application_x_hyphen_plist(value) - } - ) - case "application/xml": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .xml(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - let headers: Operations.firmwareKeysForIdentifier.Output.NotFound.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - return .notFound(.init(headers: headers)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Keys For IPSW - /// - /// KeysForIPSW returns FirmwareKeys for a given IPSW - /// - /// - Remark: HTTP `GET /keys/ipsw/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//keys/ipsw/{identifier}/{buildid}/get(firmwareKeysForIdentifierAndBuild)`. - public func firmwareKeysForIdentifierAndBuild(_ input: Operations.firmwareKeysForIdentifierAndBuild.Input) async throws -> Operations.firmwareKeysForIdentifierAndBuild.Output { - try await client.send( - input: input, - forOperation: Operations.firmwareKeysForIdentifierAndBuild.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/keys/ipsw/{}/{}", - parameters: [ - input.path.identifier, - input.path.buildid - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/x-plist", - "application/xml" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [OpenAPIRuntime.OpenAPIValueContainer].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/x-plist": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .application_x_hyphen_plist(value) - } - ) - case "application/xml": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .xml(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - let headers: Operations.firmwareKeysForIdentifierAndBuild.Output.NotFound.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - return .notFound(.init(headers: headers)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Identify Model - /// - /// IdentifyModel finds the identifier of a given model number - /// - /// - Remark: HTTP `GET /model/{model}`. - /// - Remark: Generated from `#/paths//model/{model}/get(identifierForModel)`. - public func identifierForModel(_ input: Operations.identifierForModel.Input) async throws -> Operations.identifierForModel.Output { - try await client.send( - input: input, - forOperation: Operations.identifierForModel.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/model/{}", - parameters: [ - input.path.model - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.identifierForModel.Output.Ok.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.identifierForModel.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/x-plist", - "application/xml" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Model.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/x-plist": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .application_x_hyphen_plist(value) - } - ) - case "application/xml": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .xml(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - let headers: Operations.identifierForModel.Output.NotFound.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - return .notFound(.init(headers: headers)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// OTA Documentation - /// - /// OTADocumentation returns the documentation for a given device type and version - /// - /// - Remark: HTTP `GET /ota/documentation/{device}/{version}`. - /// - Remark: Generated from `#/paths//ota/documentation/{device}/{version}/get(otaDocumentationForDeviceAndVersion)`. - public func otaDocumentationForDeviceAndVersion(_ input: Operations.otaDocumentationForDeviceAndVersion.Input) async throws -> Operations.otaDocumentationForDeviceAndVersion.Output { - try await client.send( - input: input, - forOperation: Operations.otaDocumentationForDeviceAndVersion.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/ota/documentation/{}/{}", - parameters: [ - input.path.device, - input.path.version - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.otaDocumentationForDeviceAndVersion.Output.Ok.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ), - X_hyphen_Frame_hyphen_Options: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Frame-Options", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.otaDocumentationForDeviceAndVersion.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "text/html" - ] - ) - switch chosenContentType { - case "text/html": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .html(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - let headers: Operations.otaDocumentationForDeviceAndVersion.Output.NotFound.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.otaDocumentationForDeviceAndVersion.Output.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.NotFoundDetails.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Download OTA - /// - /// DownloadOTA redirects to download an OTA Firmware as specified by its identifier, buildid and optionally prerequisite - /// - /// - Remark: HTTP `GET /ota/download/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ota/download/{identifier}/{buildid}/get(otaDownloadForIdentifierAndBuild)`. - public func otaDownloadForIdentifierAndBuild(_ input: Operations.otaDownloadForIdentifierAndBuild.Input) async throws -> Operations.otaDownloadForIdentifierAndBuild.Output { - try await client.send( - input: input, - forOperation: Operations.otaDownloadForIdentifierAndBuild.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/ota/download/{}/{}", - parameters: [ - input.path.identifier, - input.path.buildid - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "prerequisite", - value: input.query.prerequisite - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 302: - let headers: Operations.otaDownloadForIdentifierAndBuild.Output.Found.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.otaDownloadForIdentifierAndBuild.Output.Found.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "text/html" - ] - ) - switch chosenContentType { - case "text/html": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .text_html_charset_utf_hyphen_8(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .found(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Get OTA Information - /// - /// GetOTAInformation returns all known information for an OTA specified by its identifier and build (and optionally - /// prerequisite firmware) - /// - /// - Remark: HTTP `GET /ota/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ota/{identifier}/{buildid}/get(otaInformationForIdentifierAndBuild)`. - public func otaInformationForIdentifierAndBuild(_ input: Operations.otaInformationForIdentifierAndBuild.Input) async throws -> Operations.otaInformationForIdentifierAndBuild.Output { - try await client.send( - input: input, - forOperation: Operations.otaInformationForIdentifierAndBuild.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/ota/{}/{}", - parameters: [ - input.path.identifier, - input.path.buildid - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "prerequisite", - value: input.query.prerequisite - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.otaInformationForIdentifierAndBuild.Output.Ok.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.otaInformationForIdentifierAndBuild.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/x-plist", - "application/xml" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OTA.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/x-plist": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .application_x_hyphen_plist(value) - } - ) - case "application/xml": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .xml(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Get OTA List For Version - /// - /// GetOTAListForVersion finds all OTA files for a given iOS version - /// - /// - Remark: HTTP `GET /ota/{version}`. - /// - Remark: Generated from `#/paths//ota/{version}/get(otasForVersion)`. - public func otasForVersion(_ input: Operations.otasForVersion.Input) async throws -> Operations.otasForVersion.Output { - try await client.send( - input: input, - forOperation: Operations.otasForVersion.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/ota/{}", - parameters: [ - input.path.version - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.otasForVersion.Output.Ok.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.otasForVersion.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/x-plist", - "application/xml" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [OpenAPIRuntime.OpenAPIValueContainer].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/x-plist": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .application_x_hyphen_plist(value) - } - ) - case "application/xml": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .xml(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - let headers: Operations.otasForVersion.Output.NotFound.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - return .notFound(.init(headers: headers)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - - /// Releases - /// - /// Releases returns the release timeline of all entities in the IPSW Downloads database - /// - /// - Remark: HTTP `GET /releases`. - /// - Remark: Generated from `#/paths//releases/get(releases)`. - public func releases(_ input: Operations.releases.Input) async throws -> Operations.releases.Output { - try await client.send( - input: input, - forOperation: Operations.releases.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/releases", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.releases.Output.Ok.Headers = try .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ) - ) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.releases.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/x-plist", - "application/xml" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [OpenAPIRuntime.OpenAPIValueContainer].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/x-plist": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .application_x_hyphen_plist(value) - } - ) - case "application/xml": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .xml(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } -} diff --git a/Sources/IPSWDownloads/IPSWDownloads.swift b/Sources/IPSWDownloads/IPSWDownloads.swift new file mode 100644 index 0000000..d2db259 --- /dev/null +++ b/Sources/IPSWDownloads/IPSWDownloads.swift @@ -0,0 +1,40 @@ +// +// File.swift +// +// +// Created by Leo Dion on 1/11/24. +// +import OpenAPIRuntime +import Foundation + +/// A hand-written Swift API for the greeting service, one that doesn't leak any generated code. +public struct IPSWDownloads { + + public static let serverURL = try! Servers.server1() + + /// The underlying generated client to make HTTP requests to GreetingService. + private let underlyingClient: any APIProtocol +// + /// An internal initializer used by other initializers and by tests. + /// - Parameter underlyingClient: The client to use to make HTTP requests. + private init(underlyingClient: any APIProtocol) { self.underlyingClient = underlyingClient } +// +// /// Creates a new client for GreetingService. + public init(serverURL: URL = Self.serverURL, transport: any ClientTransport) { + self.init( + underlyingClient: Client( + serverURL: serverURL, + transport: transport + ) + ) + } +// +// /// Fetches the customized greeting for the provided name. +// /// - Parameter name: The name for which to provide a greeting, or nil to get a default. +// /// - Returns: A customized greeting message. +// /// - Throws: An error if the underlying HTTP client fails. +// public func getGreeting(name: String?) async throws -> String { +// let response = try await underlyingClient.getGreeting(query: .init(name: name)) +// return try response.ok.body.json.message +// } +} diff --git a/Sources/IPSWDownloads/Types.swift b/Sources/IPSWDownloads/Types.swift deleted file mode 100644 index cdd9031..0000000 --- a/Sources/IPSWDownloads/Types.swift +++ /dev/null @@ -1,5007 +0,0 @@ -// Generated by swift-openapi-generator, do not modify. -@_spi(Generated) import OpenAPIRuntime -#if os(Linux) - @preconcurrency import struct Foundation.Data - @preconcurrency import struct Foundation.Date - @preconcurrency import struct Foundation.URL -#else - import struct Foundation.Data - import struct Foundation.Date - import struct Foundation.URL -#endif -/// A type that performs HTTP operations defined by the OpenAPI document. -public protocol APIProtocol: Sendable { - /// Get Firmwares For Device - /// - /// GetFirmwaresForDevice returns Firmwares for a given Device. An optional "type" get parameter may be - /// specified to retrieve OTA Firmwares instead of normal IPSW files. - /// As of 2021-03-04, it is recommended that you use the "boards" property of the device, as devices can have multiple boards. - /// - /// - Remark: HTTP `GET /device/{identifier}`. - /// - Remark: Generated from `#/paths//device/{identifier}/get(firmwaresForDevice)`. - func firmwaresForDevice(_ input: Operations.firmwaresForDevice.Input) async throws -> Operations.firmwaresForDevice.Output - /// Get Devices - /// - /// GetDevices returns a list of all devices known to IPSW Downloads - /// If you wish to only get devices which have Firmware Keys, add the ?keysOnly=true parameter. - /// As of 2021-03-04, it is recommended that you use the "boards" property of each device, as devices can have multiple boards. - /// - /// - Remark: HTTP `GET /devices`. - /// - Remark: Generated from `#/paths//devices/get(devices)`. - func devices(_ input: Operations.devices.Input) async throws -> Operations.devices.Output - /// Download IPSW - /// - /// DownloadIPSW redirects to download an IPSW as specified by its identifier and buildid - /// - /// - Remark: HTTP `GET /ipsw/download/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ipsw/download/{identifier}/{buildid}/get(ipswDownload)`. - func ipswDownload(_ input: Operations.ipswDownload.Input) async throws -> Operations.ipswDownload.Output - /// Get IPSW Information - /// - /// GetIPSWInformation returns all known information for an IPSW as specified by identifier and buildid - /// - /// - Remark: HTTP `GET /ipsw/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ipsw/{identifier}/{buildid}/get(ipswByIdentifierAndBuild)`. - func ipswByIdentifierAndBuild(_ input: Operations.ipswByIdentifierAndBuild.Input) async throws -> Operations.ipswByIdentifierAndBuild.Output - /// Get IPSW List For Version - /// - /// GetIPSWListForVersion finds all IPSW files for a given iOS version - /// - /// - Remark: HTTP `GET /ipsw/{version}`. - /// - Remark: Generated from `#/paths//ipsw/{version}/get(ipswListForVersion)`. - func ipswListForVersion(_ input: Operations.ipswListForVersion.Input) async throws -> Operations.ipswListForVersion.Output - /// Download Itunes - /// - /// DownloadItunes redirects to download an iTunes installer as specified by its platform and version, and architecture for windows - /// - /// - Remark: HTTP `GET /itunes/download/{platform}/{version}`. - /// - Remark: Generated from `#/paths//itunes/download/{platform}/{version}/get(itunesDownloadForPlatformAndVersion)`. - func itunesDownloadForPlatformAndVersion(_ input: Operations.itunesDownloadForPlatformAndVersion.Input) async throws -> Operations.itunesDownloadForPlatformAndVersion.Output - /// Find Itunes - /// - /// FindItunes finds FindItunes versions for a given platform. specify either "windows" or "macOS" - /// - /// - Remark: HTTP `GET /itunes/{platform}`. - /// - Remark: Generated from `#/paths//itunes/{platform}/get(itunesForPlatform)`. - func itunesForPlatform(_ input: Operations.itunesForPlatform.Input) async throws -> Operations.itunesForPlatform.Output - /// Keys Device List - /// - /// KeysDeviceList returns the firmwares which have keys for a given device - /// - /// - Remark: HTTP `GET /keys/device/{identifier}`. - /// - Remark: Generated from `#/paths//keys/device/{identifier}/get(firmwareKeysForIdentifier)`. - func firmwareKeysForIdentifier(_ input: Operations.firmwareKeysForIdentifier.Input) async throws -> Operations.firmwareKeysForIdentifier.Output - /// Keys For IPSW - /// - /// KeysForIPSW returns FirmwareKeys for a given IPSW - /// - /// - Remark: HTTP `GET /keys/ipsw/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//keys/ipsw/{identifier}/{buildid}/get(firmwareKeysForIdentifierAndBuild)`. - func firmwareKeysForIdentifierAndBuild(_ input: Operations.firmwareKeysForIdentifierAndBuild.Input) async throws -> Operations.firmwareKeysForIdentifierAndBuild.Output - /// Identify Model - /// - /// IdentifyModel finds the identifier of a given model number - /// - /// - Remark: HTTP `GET /model/{model}`. - /// - Remark: Generated from `#/paths//model/{model}/get(identifierForModel)`. - func identifierForModel(_ input: Operations.identifierForModel.Input) async throws -> Operations.identifierForModel.Output - /// OTA Documentation - /// - /// OTADocumentation returns the documentation for a given device type and version - /// - /// - Remark: HTTP `GET /ota/documentation/{device}/{version}`. - /// - Remark: Generated from `#/paths//ota/documentation/{device}/{version}/get(otaDocumentationForDeviceAndVersion)`. - func otaDocumentationForDeviceAndVersion(_ input: Operations.otaDocumentationForDeviceAndVersion.Input) async throws -> Operations.otaDocumentationForDeviceAndVersion.Output - /// Download OTA - /// - /// DownloadOTA redirects to download an OTA Firmware as specified by its identifier, buildid and optionally prerequisite - /// - /// - Remark: HTTP `GET /ota/download/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ota/download/{identifier}/{buildid}/get(otaDownloadForIdentifierAndBuild)`. - func otaDownloadForIdentifierAndBuild(_ input: Operations.otaDownloadForIdentifierAndBuild.Input) async throws -> Operations.otaDownloadForIdentifierAndBuild.Output - /// Get OTA Information - /// - /// GetOTAInformation returns all known information for an OTA specified by its identifier and build (and optionally - /// prerequisite firmware) - /// - /// - Remark: HTTP `GET /ota/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ota/{identifier}/{buildid}/get(otaInformationForIdentifierAndBuild)`. - func otaInformationForIdentifierAndBuild(_ input: Operations.otaInformationForIdentifierAndBuild.Input) async throws -> Operations.otaInformationForIdentifierAndBuild.Output - /// Get OTA List For Version - /// - /// GetOTAListForVersion finds all OTA files for a given iOS version - /// - /// - Remark: HTTP `GET /ota/{version}`. - /// - Remark: Generated from `#/paths//ota/{version}/get(otasForVersion)`. - func otasForVersion(_ input: Operations.otasForVersion.Input) async throws -> Operations.otasForVersion.Output - /// Releases - /// - /// Releases returns the release timeline of all entities in the IPSW Downloads database - /// - /// - Remark: HTTP `GET /releases`. - /// - Remark: Generated from `#/paths//releases/get(releases)`. - func releases(_ input: Operations.releases.Input) async throws -> Operations.releases.Output -} - -/// Convenience overloads for operation inputs. -public extension APIProtocol { - /// Get Firmwares For Device - /// - /// GetFirmwaresForDevice returns Firmwares for a given Device. An optional "type" get parameter may be - /// specified to retrieve OTA Firmwares instead of normal IPSW files. - /// As of 2021-03-04, it is recommended that you use the "boards" property of the device, as devices can have multiple boards. - /// - /// - Remark: HTTP `GET /device/{identifier}`. - /// - Remark: Generated from `#/paths//device/{identifier}/get(firmwaresForDevice)`. - func firmwaresForDevice( - path: Operations.firmwaresForDevice.Input.Path, - query: Operations.firmwaresForDevice.Input.Query, - headers: Operations.firmwaresForDevice.Input.Headers = .init() - ) async throws -> Operations.firmwaresForDevice.Output { - try await firmwaresForDevice(Operations.firmwaresForDevice.Input( - path: path, - query: query, - headers: headers - )) - } - - /// Get Devices - /// - /// GetDevices returns a list of all devices known to IPSW Downloads - /// If you wish to only get devices which have Firmware Keys, add the ?keysOnly=true parameter. - /// As of 2021-03-04, it is recommended that you use the "boards" property of each device, as devices can have multiple boards. - /// - /// - Remark: HTTP `GET /devices`. - /// - Remark: Generated from `#/paths//devices/get(devices)`. - func devices( - query: Operations.devices.Input.Query, - headers: Operations.devices.Input.Headers = .init() - ) async throws -> Operations.devices.Output { - try await devices(Operations.devices.Input( - query: query, - headers: headers - )) - } - - /// Download IPSW - /// - /// DownloadIPSW redirects to download an IPSW as specified by its identifier and buildid - /// - /// - Remark: HTTP `GET /ipsw/download/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ipsw/download/{identifier}/{buildid}/get(ipswDownload)`. - func ipswDownload( - path: Operations.ipswDownload.Input.Path, - headers: Operations.ipswDownload.Input.Headers = .init() - ) async throws -> Operations.ipswDownload.Output { - try await ipswDownload(Operations.ipswDownload.Input( - path: path, - headers: headers - )) - } - - /// Get IPSW Information - /// - /// GetIPSWInformation returns all known information for an IPSW as specified by identifier and buildid - /// - /// - Remark: HTTP `GET /ipsw/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ipsw/{identifier}/{buildid}/get(ipswByIdentifierAndBuild)`. - func ipswByIdentifierAndBuild( - path: Operations.ipswByIdentifierAndBuild.Input.Path, - headers: Operations.ipswByIdentifierAndBuild.Input.Headers = .init() - ) async throws -> Operations.ipswByIdentifierAndBuild.Output { - try await ipswByIdentifierAndBuild(Operations.ipswByIdentifierAndBuild.Input( - path: path, - headers: headers - )) - } - - /// Get IPSW List For Version - /// - /// GetIPSWListForVersion finds all IPSW files for a given iOS version - /// - /// - Remark: HTTP `GET /ipsw/{version}`. - /// - Remark: Generated from `#/paths//ipsw/{version}/get(ipswListForVersion)`. - func ipswListForVersion( - path: Operations.ipswListForVersion.Input.Path, - headers: Operations.ipswListForVersion.Input.Headers = .init() - ) async throws -> Operations.ipswListForVersion.Output { - try await ipswListForVersion(Operations.ipswListForVersion.Input( - path: path, - headers: headers - )) - } - - /// Download Itunes - /// - /// DownloadItunes redirects to download an iTunes installer as specified by its platform and version, and architecture for windows - /// - /// - Remark: HTTP `GET /itunes/download/{platform}/{version}`. - /// - Remark: Generated from `#/paths//itunes/download/{platform}/{version}/get(itunesDownloadForPlatformAndVersion)`. - func itunesDownloadForPlatformAndVersion( - path: Operations.itunesDownloadForPlatformAndVersion.Input.Path, - query: Operations.itunesDownloadForPlatformAndVersion.Input.Query, - headers: Operations.itunesDownloadForPlatformAndVersion.Input.Headers = .init() - ) async throws -> Operations.itunesDownloadForPlatformAndVersion.Output { - try await itunesDownloadForPlatformAndVersion(Operations.itunesDownloadForPlatformAndVersion.Input( - path: path, - query: query, - headers: headers - )) - } - - /// Find Itunes - /// - /// FindItunes finds FindItunes versions for a given platform. specify either "windows" or "macOS" - /// - /// - Remark: HTTP `GET /itunes/{platform}`. - /// - Remark: Generated from `#/paths//itunes/{platform}/get(itunesForPlatform)`. - func itunesForPlatform( - path: Operations.itunesForPlatform.Input.Path, - headers: Operations.itunesForPlatform.Input.Headers = .init() - ) async throws -> Operations.itunesForPlatform.Output { - try await itunesForPlatform(Operations.itunesForPlatform.Input( - path: path, - headers: headers - )) - } - - /// Keys Device List - /// - /// KeysDeviceList returns the firmwares which have keys for a given device - /// - /// - Remark: HTTP `GET /keys/device/{identifier}`. - /// - Remark: Generated from `#/paths//keys/device/{identifier}/get(firmwareKeysForIdentifier)`. - func firmwareKeysForIdentifier( - path: Operations.firmwareKeysForIdentifier.Input.Path, - headers: Operations.firmwareKeysForIdentifier.Input.Headers = .init() - ) async throws -> Operations.firmwareKeysForIdentifier.Output { - try await firmwareKeysForIdentifier(Operations.firmwareKeysForIdentifier.Input( - path: path, - headers: headers - )) - } - - /// Keys For IPSW - /// - /// KeysForIPSW returns FirmwareKeys for a given IPSW - /// - /// - Remark: HTTP `GET /keys/ipsw/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//keys/ipsw/{identifier}/{buildid}/get(firmwareKeysForIdentifierAndBuild)`. - func firmwareKeysForIdentifierAndBuild( - path: Operations.firmwareKeysForIdentifierAndBuild.Input.Path, - headers: Operations.firmwareKeysForIdentifierAndBuild.Input.Headers = .init() - ) async throws -> Operations.firmwareKeysForIdentifierAndBuild.Output { - try await firmwareKeysForIdentifierAndBuild(Operations.firmwareKeysForIdentifierAndBuild.Input( - path: path, - headers: headers - )) - } - - /// Identify Model - /// - /// IdentifyModel finds the identifier of a given model number - /// - /// - Remark: HTTP `GET /model/{model}`. - /// - Remark: Generated from `#/paths//model/{model}/get(identifierForModel)`. - func identifierForModel( - path: Operations.identifierForModel.Input.Path, - headers: Operations.identifierForModel.Input.Headers = .init() - ) async throws -> Operations.identifierForModel.Output { - try await identifierForModel(Operations.identifierForModel.Input( - path: path, - headers: headers - )) - } - - /// OTA Documentation - /// - /// OTADocumentation returns the documentation for a given device type and version - /// - /// - Remark: HTTP `GET /ota/documentation/{device}/{version}`. - /// - Remark: Generated from `#/paths//ota/documentation/{device}/{version}/get(otaDocumentationForDeviceAndVersion)`. - func otaDocumentationForDeviceAndVersion( - path: Operations.otaDocumentationForDeviceAndVersion.Input.Path, - headers: Operations.otaDocumentationForDeviceAndVersion.Input.Headers = .init() - ) async throws -> Operations.otaDocumentationForDeviceAndVersion.Output { - try await otaDocumentationForDeviceAndVersion(Operations.otaDocumentationForDeviceAndVersion.Input( - path: path, - headers: headers - )) - } - - /// Download OTA - /// - /// DownloadOTA redirects to download an OTA Firmware as specified by its identifier, buildid and optionally prerequisite - /// - /// - Remark: HTTP `GET /ota/download/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ota/download/{identifier}/{buildid}/get(otaDownloadForIdentifierAndBuild)`. - func otaDownloadForIdentifierAndBuild( - path: Operations.otaDownloadForIdentifierAndBuild.Input.Path, - query: Operations.otaDownloadForIdentifierAndBuild.Input.Query, - headers: Operations.otaDownloadForIdentifierAndBuild.Input.Headers = .init() - ) async throws -> Operations.otaDownloadForIdentifierAndBuild.Output { - try await otaDownloadForIdentifierAndBuild(Operations.otaDownloadForIdentifierAndBuild.Input( - path: path, - query: query, - headers: headers - )) - } - - /// Get OTA Information - /// - /// GetOTAInformation returns all known information for an OTA specified by its identifier and build (and optionally - /// prerequisite firmware) - /// - /// - Remark: HTTP `GET /ota/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ota/{identifier}/{buildid}/get(otaInformationForIdentifierAndBuild)`. - func otaInformationForIdentifierAndBuild( - path: Operations.otaInformationForIdentifierAndBuild.Input.Path, - query: Operations.otaInformationForIdentifierAndBuild.Input.Query, - headers: Operations.otaInformationForIdentifierAndBuild.Input.Headers = .init() - ) async throws -> Operations.otaInformationForIdentifierAndBuild.Output { - try await otaInformationForIdentifierAndBuild(Operations.otaInformationForIdentifierAndBuild.Input( - path: path, - query: query, - headers: headers - )) - } - - /// Get OTA List For Version - /// - /// GetOTAListForVersion finds all OTA files for a given iOS version - /// - /// - Remark: HTTP `GET /ota/{version}`. - /// - Remark: Generated from `#/paths//ota/{version}/get(otasForVersion)`. - func otasForVersion( - path: Operations.otasForVersion.Input.Path, - headers: Operations.otasForVersion.Input.Headers = .init() - ) async throws -> Operations.otasForVersion.Output { - try await otasForVersion(Operations.otasForVersion.Input( - path: path, - headers: headers - )) - } - - /// Releases - /// - /// Releases returns the release timeline of all entities in the IPSW Downloads database - /// - /// - Remark: HTTP `GET /releases`. - /// - Remark: Generated from `#/paths//releases/get(releases)`. - func releases(headers: Operations.releases.Input.Headers = .init()) async throws -> Operations.releases.Output { - try await releases(Operations.releases.Input(headers: headers)) - } -} - -/// Server URLs defined in the OpenAPI document. -public enum Servers { - public static func server1() throws -> Foundation.URL { - try Foundation.URL( - validatingOpenAPIServerURL: "https://api.ipsw.me/v4", - variables: [] - ) - } -} - -/// Types generated from the components section of the OpenAPI document. -public enum Components { - /// Types generated from the `#/components/schemas` section of the OpenAPI document. - public enum Schemas { - /// - Remark: Generated from `#/components/schemas/NotFoundDetails`. - public struct NotFoundDetails: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/NotFoundDetails/status`. - public var status: Swift.Double? - /// - Remark: Generated from `#/components/schemas/NotFoundDetails/message`. - public var message: Swift.String? - /// Creates a new `NotFoundDetails`. - /// - /// - Parameters: - /// - status: - /// - message: - public init( - status: Swift.Double? = nil, - message: Swift.String? = nil - ) { - self.status = status - self.message = message - } - - public enum CodingKeys: String, CodingKey { - case status - case message - } - } - - /// - Remark: Generated from `#/components/schemas/ReleaseDate`. - public struct ReleaseDate: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/ReleaseDate/date`. - public var date: Swift.String - /// - Remark: Generated from `#/components/schemas/ReleaseDate/releases`. - public var releases: [OpenAPIRuntime.OpenAPIValueContainer] - /// Creates a new `ReleaseDate`. - /// - /// - Parameters: - /// - date: - /// - releases: - public init( - date: Swift.String, - releases: [OpenAPIRuntime.OpenAPIValueContainer] - ) { - self.date = date - self.releases = releases - } - - public enum CodingKeys: String, CodingKey { - case date - case releases - } - } - - /// - Remark: Generated from `#/components/schemas/ReleaseEntry`. - public struct ReleaseEntry: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/ReleaseEntry/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/ReleaseEntry/date`. - public var date: Foundation.Date - /// - Remark: Generated from `#/components/schemas/ReleaseEntry/count`. - public var count: Swift.Double - /// - Remark: Generated from `#/components/schemas/ReleaseEntry/type`. - public var _type: Swift.String - /// Creates a new `ReleaseEntry`. - /// - /// - Parameters: - /// - name: - /// - date: - /// - count: - /// - _type: - public init( - name: Swift.String, - date: Foundation.Date, - count: Swift.Double, - _type: Swift.String - ) { - self.name = name - self.date = date - self.count = count - self._type = _type - } - - public enum CodingKeys: String, CodingKey { - case name - case date - case count - case _type = "type" - } - } - - /// - Remark: Generated from `#/components/schemas/OTA`. - public struct OTA: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/OTA/identifier`. - public var identifier: Swift.String - /// - Remark: Generated from `#/components/schemas/OTA/buildid`. - public var buildid: Swift.String - /// - Remark: Generated from `#/components/schemas/OTA/version`. - public var version: Swift.String - /// - Remark: Generated from `#/components/schemas/OTA/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/OTA/filesize`. - public var filesize: Swift.Double - /// - Remark: Generated from `#/components/schemas/OTA/prerequisitebuildid`. - public var prerequisitebuildid: Swift.String - /// - Remark: Generated from `#/components/schemas/OTA/prerequisiteversion`. - public var prerequisiteversion: Swift.String - /// - Remark: Generated from `#/components/schemas/OTA/releasetype`. - public var releasetype: Swift.String - /// - Remark: Generated from `#/components/schemas/OTA/uploaddate`. - public var uploaddate: Foundation.Date - /// - Remark: Generated from `#/components/schemas/OTA/releasedate`. - public var releasedate: Foundation.Date - /// - Remark: Generated from `#/components/schemas/OTA/marketingversion`. - public var marketingversion: OpenAPIRuntime.OpenAPIValueContainer? - /// - Remark: Generated from `#/components/schemas/OTA/signed`. - public var signed: Swift.Bool - /// Creates a new `OTA`. - /// - /// - Parameters: - /// - identifier: - /// - buildid: - /// - version: - /// - url: - /// - filesize: - /// - prerequisitebuildid: - /// - prerequisiteversion: - /// - releasetype: - /// - uploaddate: - /// - releasedate: - /// - marketingversion: - /// - signed: - public init( - identifier: Swift.String, - buildid: Swift.String, - version: Swift.String, - url: Swift.String, - filesize: Swift.Double, - prerequisitebuildid: Swift.String, - prerequisiteversion: Swift.String, - releasetype: Swift.String, - uploaddate: Foundation.Date, - releasedate: Foundation.Date, - marketingversion: OpenAPIRuntime.OpenAPIValueContainer? = nil, - signed: Swift.Bool - ) { - self.identifier = identifier - self.buildid = buildid - self.version = version - self.url = url - self.filesize = filesize - self.prerequisitebuildid = prerequisitebuildid - self.prerequisiteversion = prerequisiteversion - self.releasetype = releasetype - self.uploaddate = uploaddate - self.releasedate = releasedate - self.marketingversion = marketingversion - self.signed = signed - } - - public enum CodingKeys: String, CodingKey { - case identifier - case buildid - case version - case url - case filesize - case prerequisitebuildid - case prerequisiteversion - case releasetype - case uploaddate - case releasedate - case marketingversion - case signed - } - } - - /// - Remark: Generated from `#/components/schemas/Model`. - public struct Model: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/Model/identifier`. - public var identifier: Swift.String? - /// Creates a new `Model`. - /// - /// - Parameters: - /// - identifier: - public init(identifier: Swift.String? = nil) { - self.identifier = identifier - } - - public enum CodingKeys: String, CodingKey { - case identifier - } - } - - /// - Remark: Generated from `#/components/schemas/Key`. - public struct Key: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/Key/image`. - public var image: Swift.String - /// - Remark: Generated from `#/components/schemas/Key/filename`. - public var filename: Swift.String - /// - Remark: Generated from `#/components/schemas/Key/kbag`. - public var kbag: Swift.String - /// - Remark: Generated from `#/components/schemas/Key/key`. - public var key: Swift.String - /// - Remark: Generated from `#/components/schemas/Key/iv`. - public var iv: Swift.String - /// - Remark: Generated from `#/components/schemas/Key/date`. - public var date: Foundation.Date - /// Creates a new `Key`. - /// - /// - Parameters: - /// - image: - /// - filename: - /// - kbag: - /// - key: - /// - iv: - /// - date: - public init( - image: Swift.String, - filename: Swift.String, - kbag: Swift.String, - key: Swift.String, - iv: Swift.String, - date: Foundation.Date - ) { - self.image = image - self.filename = filename - self.kbag = kbag - self.key = key - self.iv = iv - self.date = date - } - - public enum CodingKeys: String, CodingKey { - case image - case filename - case kbag - case key - case iv - case date - } - } - - /// - Remark: Generated from `#/components/schemas/FirmwareKey`. - public struct FirmwareKey: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/FirmwareKey/identifier`. - public var identifier: Swift.String - /// - Remark: Generated from `#/components/schemas/FirmwareKey/buildid`. - public var buildid: Swift.String - /// - Remark: Generated from `#/components/schemas/FirmwareKey/codename`. - public var codename: Swift.String - /// - Remark: Generated from `#/components/schemas/FirmwareKey/baseband`. - public var baseband: Swift.String? - /// - Remark: Generated from `#/components/schemas/FirmwareKey/updateramdiskexists`. - public var updateramdiskexists: Swift.Bool - /// - Remark: Generated from `#/components/schemas/FirmwareKey/restoreramdiskexists`. - public var restoreramdiskexists: Swift.Bool - /// - Remark: Generated from `#/components/schemas/FirmwareKey/keys`. - public var keys: [Components.Schemas.Key]? - /// Creates a new `FirmwareKey`. - /// - /// - Parameters: - /// - identifier: - /// - buildid: - /// - codename: - /// - baseband: - /// - updateramdiskexists: - /// - restoreramdiskexists: - /// - keys: - public init( - identifier: Swift.String, - buildid: Swift.String, - codename: Swift.String, - baseband: Swift.String? = nil, - updateramdiskexists: Swift.Bool, - restoreramdiskexists: Swift.Bool, - keys: [Components.Schemas.Key]? = nil - ) { - self.identifier = identifier - self.buildid = buildid - self.codename = codename - self.baseband = baseband - self.updateramdiskexists = updateramdiskexists - self.restoreramdiskexists = restoreramdiskexists - self.keys = keys - } - - public enum CodingKeys: String, CodingKey { - case identifier - case buildid - case codename - case baseband - case updateramdiskexists - case restoreramdiskexists - case keys - } - } - - /// - Remark: Generated from `#/components/schemas/iTunes`. - public struct iTunes: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/iTunes/platform`. - public var platform: Swift.String - /// - Remark: Generated from `#/components/schemas/iTunes/version`. - public var version: Swift.String - /// - Remark: Generated from `#/components/schemas/iTunes/datefound`. - public var datefound: Foundation.Date - /// - Remark: Generated from `#/components/schemas/iTunes/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/iTunes/64biturl`. - public var _64biturl: Swift.String? - /// - Remark: Generated from `#/components/schemas/iTunes/releasedate`. - public var releasedate: Foundation.Date - /// - Remark: Generated from `#/components/schemas/iTunes/uploaddate`. - public var uploaddate: Foundation.Date - /// Creates a new `iTunes`. - /// - /// - Parameters: - /// - platform: - /// - version: - /// - datefound: - /// - url: - /// - _64biturl: - /// - releasedate: - /// - uploaddate: - public init( - platform: Swift.String, - version: Swift.String, - datefound: Foundation.Date, - url: Swift.String, - _64biturl: Swift.String? = nil, - releasedate: Foundation.Date, - uploaddate: Foundation.Date - ) { - self.platform = platform - self.version = version - self.datefound = datefound - self.url = url - self._64biturl = _64biturl - self.releasedate = releasedate - self.uploaddate = uploaddate - } - - public enum CodingKeys: String, CodingKey { - case platform - case version - case datefound - case url - case _64biturl = "64biturl" - case releasedate - case uploaddate - } - } - - /// - Remark: Generated from `#/components/schemas/Board`. - public struct Board: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/Board/boardconfig`. - public var boardconfig: Swift.String - /// - Remark: Generated from `#/components/schemas/Board/platform`. - public var platform: Swift.String - /// - Remark: Generated from `#/components/schemas/Board/cpid`. - public var cpid: Swift.Double - /// - Remark: Generated from `#/components/schemas/Board/bdid`. - public var bdid: Swift.Double - /// Creates a new `Board`. - /// - /// - Parameters: - /// - boardconfig: - /// - platform: - /// - cpid: - /// - bdid: - public init( - boardconfig: Swift.String, - platform: Swift.String, - cpid: Swift.Double, - bdid: Swift.Double - ) { - self.boardconfig = boardconfig - self.platform = platform - self.cpid = cpid - self.bdid = bdid - } - - public enum CodingKeys: String, CodingKey { - case boardconfig - case platform - case cpid - case bdid - } - } - - /// - Remark: Generated from `#/components/schemas/Firmware`. - public struct Firmware: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/Firmware/identifier`. - public var identifier: Swift.String - /// - Remark: Generated from `#/components/schemas/Firmware/version`. - public var version: Swift.String - /// - Remark: Generated from `#/components/schemas/Firmware/buildid`. - public var buildid: Swift.String - /// - Remark: Generated from `#/components/schemas/Firmware/sha1sum`. - public var sha1sum: Swift.String - /// - Remark: Generated from `#/components/schemas/Firmware/md5sum`. - public var md5sum: Swift.String - /// - Remark: Generated from `#/components/schemas/Firmware/filesize`. - public var filesize: Swift.Double - /// - Remark: Generated from `#/components/schemas/Firmware/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/Firmware/releasedate`. - public var releasedate: Foundation.Date - /// - Remark: Generated from `#/components/schemas/Firmware/uploaddate`. - public var uploaddate: Foundation.Date - /// - Remark: Generated from `#/components/schemas/Firmware/signed`. - public var signed: Swift.Bool - /// Creates a new `Firmware`. - /// - /// - Parameters: - /// - identifier: - /// - version: - /// - buildid: - /// - sha1sum: - /// - md5sum: - /// - filesize: - /// - url: - /// - releasedate: - /// - uploaddate: - /// - signed: - public init( - identifier: Swift.String, - version: Swift.String, - buildid: Swift.String, - sha1sum: Swift.String, - md5sum: Swift.String, - filesize: Swift.Double, - url: Swift.String, - releasedate: Foundation.Date, - uploaddate: Foundation.Date, - signed: Swift.Bool - ) { - self.identifier = identifier - self.version = version - self.buildid = buildid - self.sha1sum = sha1sum - self.md5sum = md5sum - self.filesize = filesize - self.url = url - self.releasedate = releasedate - self.uploaddate = uploaddate - self.signed = signed - } - - public enum CodingKeys: String, CodingKey { - case identifier - case version - case buildid - case sha1sum - case md5sum - case filesize - case url - case releasedate - case uploaddate - case signed - } - } - - /// - Remark: Generated from `#/components/schemas/Device`. - public struct Device: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/Device/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/Device/identifier`. - public var identifier: Swift.String - /// - Remark: Generated from `#/components/schemas/Device/firmwares`. - public var firmwares: [Components.Schemas.Firmware] - /// - Remark: Generated from `#/components/schemas/Device/boards`. - public var boards: [Components.Schemas.Board] - /// - Remark: Generated from `#/components/schemas/Device/boardconfig`. - public var boardconfig: Swift.String? - /// - Remark: Generated from `#/components/schemas/Device/platform`. - public var platform: Swift.String? - /// - Remark: Generated from `#/components/schemas/Device/cpid`. - public var cpid: Swift.Double? - /// - Remark: Generated from `#/components/schemas/Device/bdid`. - public var bdid: Swift.Double? - /// Creates a new `Device`. - /// - /// - Parameters: - /// - name: - /// - identifier: - /// - firmwares: - /// - boards: - /// - boardconfig: - /// - platform: - /// - cpid: - /// - bdid: - public init( - name: Swift.String, - identifier: Swift.String, - firmwares: [Components.Schemas.Firmware], - boards: [Components.Schemas.Board], - boardconfig: Swift.String? = nil, - platform: Swift.String? = nil, - cpid: Swift.Double? = nil, - bdid: Swift.Double? = nil - ) { - self.name = name - self.identifier = identifier - self.firmwares = firmwares - self.boards = boards - self.boardconfig = boardconfig - self.platform = platform - self.cpid = cpid - self.bdid = bdid - } - - public enum CodingKeys: String, CodingKey { - case name - case identifier - case firmwares - case boards - case boardconfig - case platform - case cpid - case bdid - } - } - } - - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters {} - /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. - public enum RequestBodies {} - /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses {} - /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers {} -} - -/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { - /// Get Firmwares For Device - /// - /// GetFirmwaresForDevice returns Firmwares for a given Device. An optional "type" get parameter may be - /// specified to retrieve OTA Firmwares instead of normal IPSW files. - /// As of 2021-03-04, it is recommended that you use the "boards" property of the device, as devices can have multiple boards. - /// - /// - Remark: HTTP `GET /device/{identifier}`. - /// - Remark: Generated from `#/paths//device/{identifier}/get(firmwaresForDevice)`. - public enum firmwaresForDevice { - public static let id: Swift.String = "firmwaresForDevice" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/device/{identifier}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/device/{identifier}/GET/path/identifier`. - public var identifier: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - identifier: - public init(identifier: Swift.String) { - self.identifier = identifier - } - } - - public var path: Operations.firmwaresForDevice.Input.Path - /// - Remark: Generated from `#/paths/device/{identifier}/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/device/{identifier}/GET/query/type`. - public var _type: Swift.String - /// Creates a new `Query`. - /// - /// - Parameters: - /// - _type: - public init(_type: Swift.String) { - self._type = _type - } - } - - public var query: Operations.firmwaresForDevice.Input.Query - /// - Remark: Generated from `#/paths/device/{identifier}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.firmwaresForDevice.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.firmwaresForDevice.Input.Path, - query: Operations.firmwaresForDevice.Input.Query, - headers: Operations.firmwaresForDevice.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.firmwaresForDevice.Output.Ok.Headers - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Device) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.Device { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/content/application\/x-plist`. - case application_x_hyphen_plist(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.application_x_hyphen_plist`. - /// - /// - Throws: An error if `self` is not `.application_x_hyphen_plist`. - /// - SeeAlso: `.application_x_hyphen_plist`. - public var application_x_hyphen_plist: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .application_x_hyphen_plist(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/x-plist", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/content/application\/xml`. - case xml(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.xml`. - /// - /// - Throws: An error if `self` is not `.xml`. - /// - SeeAlso: `.xml`. - public var xml: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .xml(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/xml", - body: self - ) - } - } - } - } - - /// Received HTTP response body - public var body: Operations.firmwaresForDevice.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.firmwaresForDevice.Output.Ok.Headers = .init(), - body: Operations.firmwaresForDevice.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - - /// OK - /// - /// - Remark: Generated from `#/paths//device/{identifier}/get(firmwaresForDevice)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.firmwaresForDevice.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.firmwaresForDevice.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/404/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/404/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/404/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/404/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.firmwaresForDevice.Output.NotFound.Headers - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.firmwaresForDevice.Output.NotFound.Headers = .init()) { - self.headers = headers - } - } - - /// Not Found - /// - /// - Remark: Generated from `#/paths//device/{identifier}/get(firmwaresForDevice)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.firmwaresForDevice.Output.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.firmwaresForDevice.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case application_x_hyphen_plist - case xml - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "application/x-plist": - self = .application_x_hyphen_plist - case "application/xml": - self = .xml - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .application_x_hyphen_plist: - return "application/x-plist" - case .xml: - return "application/xml" - } - } - - public static var allCases: [Self] { - [ - .json, - .application_x_hyphen_plist, - .xml - ] - } - } - } - - /// Get Devices - /// - /// GetDevices returns a list of all devices known to IPSW Downloads - /// If you wish to only get devices which have Firmware Keys, add the ?keysOnly=true parameter. - /// As of 2021-03-04, it is recommended that you use the "boards" property of each device, as devices can have multiple boards. - /// - /// - Remark: HTTP `GET /devices`. - /// - Remark: Generated from `#/paths//devices/get(devices)`. - public enum devices { - public static let id: Swift.String = "devices" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/devices/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/devices/GET/query/keysOnly`. - public var keysOnly: Swift.Bool - /// Creates a new `Query`. - /// - /// - Parameters: - /// - keysOnly: - public init(keysOnly: Swift.Bool) { - self.keysOnly = keysOnly - } - } - - public var query: Operations.devices.Input.Query - /// - Remark: Generated from `#/paths/devices/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.devices.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - query: - /// - headers: - public init( - query: Operations.devices.Input.Query, - headers: Operations.devices.Input.Headers = .init() - ) { - self.query = query - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/devices/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/devices/GET/responses/200/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/devices/GET/responses/200/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/devices/GET/responses/200/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/devices/GET/responses/200/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/devices/GET/responses/200/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.devices.Output.Ok.Headers - /// - Remark: Generated from `#/paths/devices/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/devices/GET/responses/200/content/application\/json`. - case json([OpenAPIRuntime.OpenAPIValueContainer]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [OpenAPIRuntime.OpenAPIValueContainer] { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/devices/GET/responses/200/content/application\/x-plist`. - case application_x_hyphen_plist(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.application_x_hyphen_plist`. - /// - /// - Throws: An error if `self` is not `.application_x_hyphen_plist`. - /// - SeeAlso: `.application_x_hyphen_plist`. - public var application_x_hyphen_plist: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .application_x_hyphen_plist(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/x-plist", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/devices/GET/responses/200/content/application\/xml`. - case xml(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.xml`. - /// - /// - Throws: An error if `self` is not `.xml`. - /// - SeeAlso: `.xml`. - public var xml: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .xml(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/xml", - body: self - ) - } - } - } - } - - /// Received HTTP response body - public var body: Operations.devices.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.devices.Output.Ok.Headers = .init(), - body: Operations.devices.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - - /// OK - /// - /// - Remark: Generated from `#/paths//devices/get(devices)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.devices.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.devices.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case application_x_hyphen_plist - case xml - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "application/x-plist": - self = .application_x_hyphen_plist - case "application/xml": - self = .xml - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .application_x_hyphen_plist: - return "application/x-plist" - case .xml: - return "application/xml" - } - } - - public static var allCases: [Self] { - [ - .json, - .application_x_hyphen_plist, - .xml - ] - } - } - } - - /// Download IPSW - /// - /// DownloadIPSW redirects to download an IPSW as specified by its identifier and buildid - /// - /// - Remark: HTTP `GET /ipsw/download/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ipsw/download/{identifier}/{buildid}/get(ipswDownload)`. - public enum ipswDownload { - public static let id: Swift.String = "ipswDownload" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/path/identifier`. - public var identifier: Swift.String - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/path/buildid`. - public var buildid: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - identifier: - /// - buildid: - public init( - identifier: Swift.String, - buildid: Swift.String - ) { - self.identifier = identifier - self.buildid = buildid - } - } - - public var path: Operations.ipswDownload.Input.Path - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.ipswDownload.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ipswDownload.Input.Path, - headers: Operations.ipswDownload.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Found: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/responses/302/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/responses/302/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/responses/302/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/responses/302/headers/Location`. - public var Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Location = Location - } - } - - /// Received HTTP response headers - public var headers: Operations.ipswDownload.Output.Found.Headers - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/responses/302/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/responses/302/content/text\/html; charset=utf-8`. - case text_html_charset_utf_hyphen_8(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.text_html_charset_utf_hyphen_8`. - /// - /// - Throws: An error if `self` is not `.text_html_charset_utf_hyphen_8`. - /// - SeeAlso: `.text_html_charset_utf_hyphen_8`. - public var text_html_charset_utf_hyphen_8: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .text_html_charset_utf_hyphen_8(body): - return body - } - } - } - } - - /// Received HTTP response body - public var body: Operations.ipswDownload.Output.Found.Body - /// Creates a new `Found`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ipswDownload.Output.Found.Headers = .init(), - body: Operations.ipswDownload.Output.Found.Body - ) { - self.headers = headers - self.body = body - } - } - - /// Found - /// - /// - Remark: Generated from `#/paths//ipsw/download/{identifier}/{buildid}/get(ipswDownload)/responses/302`. - /// - /// HTTP response code: `302 found`. - case found(Operations.ipswDownload.Output.Found) - /// The associated value of the enum case if `self` is `.found`. - /// - /// - Throws: An error if `self` is not `.found`. - /// - SeeAlso: `.found`. - public var found: Operations.ipswDownload.Output.Found { - get throws { - switch self { - case let .found(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "found", - response: self - ) - } - } - } - - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/responses/404/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/responses/404/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/responses/404/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/download/{identifier}/{buildid}/GET/responses/404/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.ipswDownload.Output.NotFound.Headers - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.ipswDownload.Output.NotFound.Headers = .init()) { - self.headers = headers - } - } - - /// Not Found - /// - /// - Remark: Generated from `#/paths//ipsw/download/{identifier}/{buildid}/get(ipswDownload)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.ipswDownload.Output.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.ipswDownload.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case text_html_charset_utf_hyphen_8 - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "text/html": - self = .text_html_charset_utf_hyphen_8 - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .text_html_charset_utf_hyphen_8: - return "text/html" - } - } - - public static var allCases: [Self] { - [ - .text_html_charset_utf_hyphen_8 - ] - } - } - } - - /// Get IPSW Information - /// - /// GetIPSWInformation returns all known information for an IPSW as specified by identifier and buildid - /// - /// - Remark: HTTP `GET /ipsw/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ipsw/{identifier}/{buildid}/get(ipswByIdentifierAndBuild)`. - public enum ipswByIdentifierAndBuild { - public static let id: Swift.String = "ipswByIdentifierAndBuild" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/path/identifier`. - public var identifier: Swift.String - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/path/buildid`. - public var buildid: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - identifier: - /// - buildid: - public init( - identifier: Swift.String, - buildid: Swift.String - ) { - self.identifier = identifier - self.buildid = buildid - } - } - - public var path: Operations.ipswByIdentifierAndBuild.Input.Path - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.ipswByIdentifierAndBuild.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ipswByIdentifierAndBuild.Input.Path, - headers: Operations.ipswByIdentifierAndBuild.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/200/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/200/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/200/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/200/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/200/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.ipswByIdentifierAndBuild.Output.Ok.Headers - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Firmware) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.Firmware { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/200/content/application\/x-plist`. - case application_x_hyphen_plist(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.application_x_hyphen_plist`. - /// - /// - Throws: An error if `self` is not `.application_x_hyphen_plist`. - /// - SeeAlso: `.application_x_hyphen_plist`. - public var application_x_hyphen_plist: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .application_x_hyphen_plist(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/x-plist", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/200/content/application\/xml`. - case xml(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.xml`. - /// - /// - Throws: An error if `self` is not `.xml`. - /// - SeeAlso: `.xml`. - public var xml: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .xml(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/xml", - body: self - ) - } - } - } - } - - /// Received HTTP response body - public var body: Operations.ipswByIdentifierAndBuild.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ipswByIdentifierAndBuild.Output.Ok.Headers = .init(), - body: Operations.ipswByIdentifierAndBuild.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - - /// OK - /// - /// - Remark: Generated from `#/paths//ipsw/{identifier}/{buildid}/get(ipswByIdentifierAndBuild)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ipswByIdentifierAndBuild.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ipswByIdentifierAndBuild.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/404/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/404/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/404/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/{identifier}/{buildid}/GET/responses/404/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.ipswByIdentifierAndBuild.Output.NotFound.Headers - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.ipswByIdentifierAndBuild.Output.NotFound.Headers = .init()) { - self.headers = headers - } - } - - /// Not Found - /// - /// - Remark: Generated from `#/paths//ipsw/{identifier}/{buildid}/get(ipswByIdentifierAndBuild)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.ipswByIdentifierAndBuild.Output.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.ipswByIdentifierAndBuild.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case application_x_hyphen_plist - case xml - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "application/x-plist": - self = .application_x_hyphen_plist - case "application/xml": - self = .xml - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .application_x_hyphen_plist: - return "application/x-plist" - case .xml: - return "application/xml" - } - } - - public static var allCases: [Self] { - [ - .json, - .application_x_hyphen_plist, - .xml - ] - } - } - } - - /// Get IPSW List For Version - /// - /// GetIPSWListForVersion finds all IPSW files for a given iOS version - /// - /// - Remark: HTTP `GET /ipsw/{version}`. - /// - Remark: Generated from `#/paths//ipsw/{version}/get(ipswListForVersion)`. - public enum ipswListForVersion { - public static let id: Swift.String = "ipswListForVersion" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/path/version`. - public var version: Swift.Double - /// Creates a new `Path`. - /// - /// - Parameters: - /// - version: - public init(version: Swift.Double) { - self.version = version - } - } - - public var path: Operations.ipswListForVersion.Input.Path - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.ipswListForVersion.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ipswListForVersion.Input.Path, - headers: Operations.ipswListForVersion.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/200/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/200/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/200/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/200/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/200/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.ipswListForVersion.Output.Ok.Headers - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/200/content/application\/json`. - case json([OpenAPIRuntime.OpenAPIValueContainer]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [OpenAPIRuntime.OpenAPIValueContainer] { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/200/content/application\/x-plist`. - case application_x_hyphen_plist(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.application_x_hyphen_plist`. - /// - /// - Throws: An error if `self` is not `.application_x_hyphen_plist`. - /// - SeeAlso: `.application_x_hyphen_plist`. - public var application_x_hyphen_plist: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .application_x_hyphen_plist(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/x-plist", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/200/content/application\/xml`. - case xml(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.xml`. - /// - /// - Throws: An error if `self` is not `.xml`. - /// - SeeAlso: `.xml`. - public var xml: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .xml(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/xml", - body: self - ) - } - } - } - } - - /// Received HTTP response body - public var body: Operations.ipswListForVersion.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ipswListForVersion.Output.Ok.Headers = .init(), - body: Operations.ipswListForVersion.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - - /// OK - /// - /// - Remark: Generated from `#/paths//ipsw/{version}/get(ipswListForVersion)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ipswListForVersion.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ipswListForVersion.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/404/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/404/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/404/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/ipsw/{version}/GET/responses/404/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.ipswListForVersion.Output.NotFound.Headers - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.ipswListForVersion.Output.NotFound.Headers = .init()) { - self.headers = headers - } - } - - /// Not Found - /// - /// - Remark: Generated from `#/paths//ipsw/{version}/get(ipswListForVersion)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.ipswListForVersion.Output.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.ipswListForVersion.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case application_x_hyphen_plist - case xml - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "application/x-plist": - self = .application_x_hyphen_plist - case "application/xml": - self = .xml - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .application_x_hyphen_plist: - return "application/x-plist" - case .xml: - return "application/xml" - } - } - - public static var allCases: [Self] { - [ - .json, - .application_x_hyphen_plist, - .xml - ] - } - } - } - - /// Download Itunes - /// - /// DownloadItunes redirects to download an iTunes installer as specified by its platform and version, and architecture for windows - /// - /// - Remark: HTTP `GET /itunes/download/{platform}/{version}`. - /// - Remark: Generated from `#/paths//itunes/download/{platform}/{version}/get(itunesDownloadForPlatformAndVersion)`. - public enum itunesDownloadForPlatformAndVersion { - public static let id: Swift.String = "itunesDownloadForPlatformAndVersion" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/download/{platform}/{version}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/download/{platform}/{version}/GET/path/platform`. - public var platform: Swift.String - /// - Remark: Generated from `#/paths/itunes/download/{platform}/{version}/GET/path/version`. - public var version: Swift.Double - /// Creates a new `Path`. - /// - /// - Parameters: - /// - platform: - /// - version: - public init( - platform: Swift.String, - version: Swift.Double - ) { - self.platform = platform - self.version = version - } - } - - public var path: Operations.itunesDownloadForPlatformAndVersion.Input.Path - /// - Remark: Generated from `#/paths/itunes/download/{platform}/{version}/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/download/{platform}/{version}/GET/query/arch`. - public var arch: Swift.String - /// Creates a new `Query`. - /// - /// - Parameters: - /// - arch: - public init(arch: Swift.String) { - self.arch = arch - } - } - - public var query: Operations.itunesDownloadForPlatformAndVersion.Input.Query - /// - Remark: Generated from `#/paths/itunes/download/{platform}/{version}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.itunesDownloadForPlatformAndVersion.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.itunesDownloadForPlatformAndVersion.Input.Path, - query: Operations.itunesDownloadForPlatformAndVersion.Input.Query, - headers: Operations.itunesDownloadForPlatformAndVersion.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Found: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/download/{platform}/{version}/GET/responses/302/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/download/{platform}/{version}/GET/responses/302/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/itunes/download/{platform}/{version}/GET/responses/302/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/itunes/download/{platform}/{version}/GET/responses/302/headers/Location`. - public var Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Location = Location - } - } - - /// Received HTTP response headers - public var headers: Operations.itunesDownloadForPlatformAndVersion.Output.Found.Headers - /// - Remark: Generated from `#/paths/itunes/download/{platform}/{version}/GET/responses/302/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/download/{platform}/{version}/GET/responses/302/content/text\/html; charset=utf-8`. - case text_html_charset_utf_hyphen_8(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.text_html_charset_utf_hyphen_8`. - /// - /// - Throws: An error if `self` is not `.text_html_charset_utf_hyphen_8`. - /// - SeeAlso: `.text_html_charset_utf_hyphen_8`. - public var text_html_charset_utf_hyphen_8: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .text_html_charset_utf_hyphen_8(body): - return body - } - } - } - } - - /// Received HTTP response body - public var body: Operations.itunesDownloadForPlatformAndVersion.Output.Found.Body - /// Creates a new `Found`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.itunesDownloadForPlatformAndVersion.Output.Found.Headers = .init(), - body: Operations.itunesDownloadForPlatformAndVersion.Output.Found.Body - ) { - self.headers = headers - self.body = body - } - } - - /// Found - /// - /// - Remark: Generated from `#/paths//itunes/download/{platform}/{version}/get(itunesDownloadForPlatformAndVersion)/responses/302`. - /// - /// HTTP response code: `302 found`. - case found(Operations.itunesDownloadForPlatformAndVersion.Output.Found) - /// The associated value of the enum case if `self` is `.found`. - /// - /// - Throws: An error if `self` is not `.found`. - /// - SeeAlso: `.found`. - public var found: Operations.itunesDownloadForPlatformAndVersion.Output.Found { - get throws { - switch self { - case let .found(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "found", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case text_html_charset_utf_hyphen_8 - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "text/html": - self = .text_html_charset_utf_hyphen_8 - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .text_html_charset_utf_hyphen_8: - return "text/html" - } - } - - public static var allCases: [Self] { - [ - .text_html_charset_utf_hyphen_8 - ] - } - } - } - - /// Find Itunes - /// - /// FindItunes finds FindItunes versions for a given platform. specify either "windows" or "macOS" - /// - /// - Remark: HTTP `GET /itunes/{platform}`. - /// - Remark: Generated from `#/paths//itunes/{platform}/get(itunesForPlatform)`. - public enum itunesForPlatform { - public static let id: Swift.String = "itunesForPlatform" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/path/platform`. - public var platform: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - platform: - public init(platform: Swift.String) { - self.platform = platform - } - } - - public var path: Operations.itunesForPlatform.Input.Path - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.itunesForPlatform.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.itunesForPlatform.Input.Path, - headers: Operations.itunesForPlatform.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/200/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/200/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/200/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/200/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/200/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.itunesForPlatform.Output.Ok.Headers - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/200/content/application\/json`. - case json([Components.Schemas.iTunes]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.iTunes] { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/200/content/application\/x-plist`. - case application_x_hyphen_plist(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.application_x_hyphen_plist`. - /// - /// - Throws: An error if `self` is not `.application_x_hyphen_plist`. - /// - SeeAlso: `.application_x_hyphen_plist`. - public var application_x_hyphen_plist: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .application_x_hyphen_plist(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/x-plist", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/200/content/application\/xml`. - case xml(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.xml`. - /// - /// - Throws: An error if `self` is not `.xml`. - /// - SeeAlso: `.xml`. - public var xml: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .xml(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/xml", - body: self - ) - } - } - } - } - - /// Received HTTP response body - public var body: Operations.itunesForPlatform.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.itunesForPlatform.Output.Ok.Headers = .init(), - body: Operations.itunesForPlatform.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - - /// OK - /// - /// - Remark: Generated from `#/paths//itunes/{platform}/get(itunesForPlatform)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.itunesForPlatform.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.itunesForPlatform.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/404/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/404/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/404/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/itunes/{platform}/GET/responses/404/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.itunesForPlatform.Output.NotFound.Headers - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.itunesForPlatform.Output.NotFound.Headers = .init()) { - self.headers = headers - } - } - - /// Not Found - /// - /// - Remark: Generated from `#/paths//itunes/{platform}/get(itunesForPlatform)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.itunesForPlatform.Output.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.itunesForPlatform.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case application_x_hyphen_plist - case xml - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "application/x-plist": - self = .application_x_hyphen_plist - case "application/xml": - self = .xml - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .application_x_hyphen_plist: - return "application/x-plist" - case .xml: - return "application/xml" - } - } - - public static var allCases: [Self] { - [ - .json, - .application_x_hyphen_plist, - .xml - ] - } - } - } - - /// Keys Device List - /// - /// KeysDeviceList returns the firmwares which have keys for a given device - /// - /// - Remark: HTTP `GET /keys/device/{identifier}`. - /// - Remark: Generated from `#/paths//keys/device/{identifier}/get(firmwareKeysForIdentifier)`. - public enum firmwareKeysForIdentifier { - public static let id: Swift.String = "firmwareKeysForIdentifier" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/path/identifier`. - public var identifier: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - identifier: - public init(identifier: Swift.String) { - self.identifier = identifier - } - } - - public var path: Operations.firmwareKeysForIdentifier.Input.Path - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.firmwareKeysForIdentifier.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.firmwareKeysForIdentifier.Input.Path, - headers: Operations.firmwareKeysForIdentifier.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.firmwareKeysForIdentifier.Output.Ok.Headers - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/application\/json`. - case json([Components.Schemas.FirmwareKey]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.FirmwareKey] { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/application\/x-plist`. - case application_x_hyphen_plist(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.application_x_hyphen_plist`. - /// - /// - Throws: An error if `self` is not `.application_x_hyphen_plist`. - /// - SeeAlso: `.application_x_hyphen_plist`. - public var application_x_hyphen_plist: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .application_x_hyphen_plist(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/x-plist", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/application\/xml`. - case xml(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.xml`. - /// - /// - Throws: An error if `self` is not `.xml`. - /// - SeeAlso: `.xml`. - public var xml: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .xml(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/xml", - body: self - ) - } - } - } - } - - /// Received HTTP response body - public var body: Operations.firmwareKeysForIdentifier.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.firmwareKeysForIdentifier.Output.Ok.Headers = .init(), - body: Operations.firmwareKeysForIdentifier.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - - /// OK - /// - /// - Remark: Generated from `#/paths//keys/device/{identifier}/get(firmwareKeysForIdentifier)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.firmwareKeysForIdentifier.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.firmwareKeysForIdentifier.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/404/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/404/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/404/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/404/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.firmwareKeysForIdentifier.Output.NotFound.Headers - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.firmwareKeysForIdentifier.Output.NotFound.Headers = .init()) { - self.headers = headers - } - } - - /// Not Found - /// - /// - Remark: Generated from `#/paths//keys/device/{identifier}/get(firmwareKeysForIdentifier)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.firmwareKeysForIdentifier.Output.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.firmwareKeysForIdentifier.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case application_x_hyphen_plist - case xml - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "application/x-plist": - self = .application_x_hyphen_plist - case "application/xml": - self = .xml - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .application_x_hyphen_plist: - return "application/x-plist" - case .xml: - return "application/xml" - } - } - - public static var allCases: [Self] { - [ - .json, - .application_x_hyphen_plist, - .xml - ] - } - } - } - - /// Keys For IPSW - /// - /// KeysForIPSW returns FirmwareKeys for a given IPSW - /// - /// - Remark: HTTP `GET /keys/ipsw/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//keys/ipsw/{identifier}/{buildid}/get(firmwareKeysForIdentifierAndBuild)`. - public enum firmwareKeysForIdentifierAndBuild { - public static let id: Swift.String = "firmwareKeysForIdentifierAndBuild" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/path/identifier`. - public var identifier: Swift.String - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/path/buildid`. - public var buildid: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - identifier: - /// - buildid: - public init( - identifier: Swift.String, - buildid: Swift.String - ) { - self.identifier = identifier - self.buildid = buildid - } - } - - public var path: Operations.firmwareKeysForIdentifierAndBuild.Input.Path - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.firmwareKeysForIdentifierAndBuild.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.firmwareKeysForIdentifierAndBuild.Input.Path, - headers: Operations.firmwareKeysForIdentifierAndBuild.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Headers - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/application\/json`. - case json([OpenAPIRuntime.OpenAPIValueContainer]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [OpenAPIRuntime.OpenAPIValueContainer] { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/application\/x-plist`. - case application_x_hyphen_plist(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.application_x_hyphen_plist`. - /// - /// - Throws: An error if `self` is not `.application_x_hyphen_plist`. - /// - SeeAlso: `.application_x_hyphen_plist`. - public var application_x_hyphen_plist: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .application_x_hyphen_plist(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/x-plist", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/application\/xml`. - case xml(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.xml`. - /// - /// - Throws: An error if `self` is not `.xml`. - /// - SeeAlso: `.xml`. - public var xml: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .xml(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/xml", - body: self - ) - } - } - } - } - - /// Received HTTP response body - public var body: Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Headers = .init(), - body: Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - - /// OK - /// - /// - Remark: Generated from `#/paths//keys/ipsw/{identifier}/{buildid}/get(firmwareKeysForIdentifierAndBuild)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.firmwareKeysForIdentifierAndBuild.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.firmwareKeysForIdentifierAndBuild.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/404/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/404/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/404/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/404/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.firmwareKeysForIdentifierAndBuild.Output.NotFound.Headers - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.firmwareKeysForIdentifierAndBuild.Output.NotFound.Headers = .init()) { - self.headers = headers - } - } - - /// Not Found - /// - /// - Remark: Generated from `#/paths//keys/ipsw/{identifier}/{buildid}/get(firmwareKeysForIdentifierAndBuild)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.firmwareKeysForIdentifierAndBuild.Output.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.firmwareKeysForIdentifierAndBuild.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case application_x_hyphen_plist - case xml - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "application/x-plist": - self = .application_x_hyphen_plist - case "application/xml": - self = .xml - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .application_x_hyphen_plist: - return "application/x-plist" - case .xml: - return "application/xml" - } - } - - public static var allCases: [Self] { - [ - .json, - .application_x_hyphen_plist, - .xml - ] - } - } - } - - /// Identify Model - /// - /// IdentifyModel finds the identifier of a given model number - /// - /// - Remark: HTTP `GET /model/{model}`. - /// - Remark: Generated from `#/paths//model/{model}/get(identifierForModel)`. - public enum identifierForModel { - public static let id: Swift.String = "identifierForModel" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/model/{model}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/model/{model}/GET/path/model`. - public var model: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - model: - public init(model: Swift.String) { - self.model = model - } - } - - public var path: Operations.identifierForModel.Input.Path - /// - Remark: Generated from `#/paths/model/{model}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.identifierForModel.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.identifierForModel.Input.Path, - headers: Operations.identifierForModel.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/200/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/200/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/200/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/200/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/200/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.identifierForModel.Output.Ok.Headers - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Model) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.Model { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/200/content/application\/x-plist`. - case application_x_hyphen_plist(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.application_x_hyphen_plist`. - /// - /// - Throws: An error if `self` is not `.application_x_hyphen_plist`. - /// - SeeAlso: `.application_x_hyphen_plist`. - public var application_x_hyphen_plist: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .application_x_hyphen_plist(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/x-plist", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/200/content/application\/xml`. - case xml(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.xml`. - /// - /// - Throws: An error if `self` is not `.xml`. - /// - SeeAlso: `.xml`. - public var xml: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .xml(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/xml", - body: self - ) - } - } - } - } - - /// Received HTTP response body - public var body: Operations.identifierForModel.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.identifierForModel.Output.Ok.Headers = .init(), - body: Operations.identifierForModel.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - - /// OK - /// - /// - Remark: Generated from `#/paths//model/{model}/get(identifierForModel)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.identifierForModel.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.identifierForModel.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/404/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/404/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/404/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/404/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.identifierForModel.Output.NotFound.Headers - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.identifierForModel.Output.NotFound.Headers = .init()) { - self.headers = headers - } - } - - /// Not Found - /// - /// - Remark: Generated from `#/paths//model/{model}/get(identifierForModel)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.identifierForModel.Output.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.identifierForModel.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case application_x_hyphen_plist - case xml - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "application/x-plist": - self = .application_x_hyphen_plist - case "application/xml": - self = .xml - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .application_x_hyphen_plist: - return "application/x-plist" - case .xml: - return "application/xml" - } - } - - public static var allCases: [Self] { - [ - .json, - .application_x_hyphen_plist, - .xml - ] - } - } - } - - /// OTA Documentation - /// - /// OTADocumentation returns the documentation for a given device type and version - /// - /// - Remark: HTTP `GET /ota/documentation/{device}/{version}`. - /// - Remark: Generated from `#/paths//ota/documentation/{device}/{version}/get(otaDocumentationForDeviceAndVersion)`. - public enum otaDocumentationForDeviceAndVersion { - public static let id: Swift.String = "otaDocumentationForDeviceAndVersion" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/path/device`. - public var device: Swift.String - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/path/version`. - public var version: Swift.Double - /// Creates a new `Path`. - /// - /// - Parameters: - /// - device: - /// - version: - public init( - device: Swift.String, - version: Swift.Double - ) { - self.device = device - self.version = version - } - } - - public var path: Operations.otaDocumentationForDeviceAndVersion.Input.Path - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.otaDocumentationForDeviceAndVersion.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.otaDocumentationForDeviceAndVersion.Input.Path, - headers: Operations.otaDocumentationForDeviceAndVersion.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/200/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/200/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/200/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/200/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/200/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/200/headers/X-Frame-Options`. - public var X_hyphen_Frame_hyphen_Options: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - /// - X_hyphen_Frame_hyphen_Options: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil, - X_hyphen_Frame_hyphen_Options: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - self.X_hyphen_Frame_hyphen_Options = X_hyphen_Frame_hyphen_Options - } - } - - /// Received HTTP response headers - public var headers: Operations.otaDocumentationForDeviceAndVersion.Output.Ok.Headers - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/200/content/text\/html`. - case html(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.html`. - /// - /// - Throws: An error if `self` is not `.html`. - /// - SeeAlso: `.html`. - public var html: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .html(body): - return body - } - } - } - } - - /// Received HTTP response body - public var body: Operations.otaDocumentationForDeviceAndVersion.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.otaDocumentationForDeviceAndVersion.Output.Ok.Headers = .init(), - body: Operations.otaDocumentationForDeviceAndVersion.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - - /// OK - /// - /// - Remark: Generated from `#/paths//ota/documentation/{device}/{version}/get(otaDocumentationForDeviceAndVersion)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.otaDocumentationForDeviceAndVersion.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.otaDocumentationForDeviceAndVersion.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/404/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/404/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/404/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/404/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/404/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/404/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.otaDocumentationForDeviceAndVersion.Output.NotFound.Headers - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/404/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/404/content/application\/json`. - case json(Components.Schemas.NotFoundDetails) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.NotFoundDetails { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - - /// Received HTTP response body - public var body: Operations.otaDocumentationForDeviceAndVersion.Output.NotFound.Body - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.otaDocumentationForDeviceAndVersion.Output.NotFound.Headers = .init(), - body: Operations.otaDocumentationForDeviceAndVersion.Output.NotFound.Body - ) { - self.headers = headers - self.body = body - } - } - - /// Not Found - /// - /// - Remark: Generated from `#/paths//ota/documentation/{device}/{version}/get(otaDocumentationForDeviceAndVersion)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.otaDocumentationForDeviceAndVersion.Output.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.otaDocumentationForDeviceAndVersion.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case html - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "text/html": - self = .html - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .html: - return "text/html" - case .json: - return "application/json" - } - } - - public static var allCases: [Self] { - [ - .html, - .json - ] - } - } - } - - /// Download OTA - /// - /// DownloadOTA redirects to download an OTA Firmware as specified by its identifier, buildid and optionally prerequisite - /// - /// - Remark: HTTP `GET /ota/download/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ota/download/{identifier}/{buildid}/get(otaDownloadForIdentifierAndBuild)`. - public enum otaDownloadForIdentifierAndBuild { - public static let id: Swift.String = "otaDownloadForIdentifierAndBuild" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/download/{identifier}/{buildid}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/download/{identifier}/{buildid}/GET/path/identifier`. - public var identifier: Swift.String - /// - Remark: Generated from `#/paths/ota/download/{identifier}/{buildid}/GET/path/buildid`. - public var buildid: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - identifier: - /// - buildid: - public init( - identifier: Swift.String, - buildid: Swift.String - ) { - self.identifier = identifier - self.buildid = buildid - } - } - - public var path: Operations.otaDownloadForIdentifierAndBuild.Input.Path - /// - Remark: Generated from `#/paths/ota/download/{identifier}/{buildid}/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/download/{identifier}/{buildid}/GET/query/prerequisite`. - public var prerequisite: Swift.String - /// Creates a new `Query`. - /// - /// - Parameters: - /// - prerequisite: - public init(prerequisite: Swift.String) { - self.prerequisite = prerequisite - } - } - - public var query: Operations.otaDownloadForIdentifierAndBuild.Input.Query - /// - Remark: Generated from `#/paths/ota/download/{identifier}/{buildid}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.otaDownloadForIdentifierAndBuild.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.otaDownloadForIdentifierAndBuild.Input.Path, - query: Operations.otaDownloadForIdentifierAndBuild.Input.Query, - headers: Operations.otaDownloadForIdentifierAndBuild.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Found: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/download/{identifier}/{buildid}/GET/responses/302/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/download/{identifier}/{buildid}/GET/responses/302/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/ota/download/{identifier}/{buildid}/GET/responses/302/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/ota/download/{identifier}/{buildid}/GET/responses/302/headers/Location`. - public var Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Location = Location - } - } - - /// Received HTTP response headers - public var headers: Operations.otaDownloadForIdentifierAndBuild.Output.Found.Headers - /// - Remark: Generated from `#/paths/ota/download/{identifier}/{buildid}/GET/responses/302/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/download/{identifier}/{buildid}/GET/responses/302/content/text\/html; charset=utf-8`. - case text_html_charset_utf_hyphen_8(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.text_html_charset_utf_hyphen_8`. - /// - /// - Throws: An error if `self` is not `.text_html_charset_utf_hyphen_8`. - /// - SeeAlso: `.text_html_charset_utf_hyphen_8`. - public var text_html_charset_utf_hyphen_8: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .text_html_charset_utf_hyphen_8(body): - return body - } - } - } - } - - /// Received HTTP response body - public var body: Operations.otaDownloadForIdentifierAndBuild.Output.Found.Body - /// Creates a new `Found`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.otaDownloadForIdentifierAndBuild.Output.Found.Headers = .init(), - body: Operations.otaDownloadForIdentifierAndBuild.Output.Found.Body - ) { - self.headers = headers - self.body = body - } - } - - /// Found - /// - /// - Remark: Generated from `#/paths//ota/download/{identifier}/{buildid}/get(otaDownloadForIdentifierAndBuild)/responses/302`. - /// - /// HTTP response code: `302 found`. - case found(Operations.otaDownloadForIdentifierAndBuild.Output.Found) - /// The associated value of the enum case if `self` is `.found`. - /// - /// - Throws: An error if `self` is not `.found`. - /// - SeeAlso: `.found`. - public var found: Operations.otaDownloadForIdentifierAndBuild.Output.Found { - get throws { - switch self { - case let .found(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "found", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case text_html_charset_utf_hyphen_8 - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "text/html": - self = .text_html_charset_utf_hyphen_8 - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .text_html_charset_utf_hyphen_8: - return "text/html" - } - } - - public static var allCases: [Self] { - [ - .text_html_charset_utf_hyphen_8 - ] - } - } - } - - /// Get OTA Information - /// - /// GetOTAInformation returns all known information for an OTA specified by its identifier and build (and optionally - /// prerequisite firmware) - /// - /// - Remark: HTTP `GET /ota/{identifier}/{buildid}`. - /// - Remark: Generated from `#/paths//ota/{identifier}/{buildid}/get(otaInformationForIdentifierAndBuild)`. - public enum otaInformationForIdentifierAndBuild { - public static let id: Swift.String = "otaInformationForIdentifierAndBuild" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/path/identifier`. - public var identifier: Swift.String - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/path/buildid`. - public var buildid: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - identifier: - /// - buildid: - public init( - identifier: Swift.String, - buildid: Swift.String - ) { - self.identifier = identifier - self.buildid = buildid - } - } - - public var path: Operations.otaInformationForIdentifierAndBuild.Input.Path - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/query/prerequisite`. - public var prerequisite: Swift.String - /// Creates a new `Query`. - /// - /// - Parameters: - /// - prerequisite: - public init(prerequisite: Swift.String) { - self.prerequisite = prerequisite - } - } - - public var query: Operations.otaInformationForIdentifierAndBuild.Input.Query - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.otaInformationForIdentifierAndBuild.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.otaInformationForIdentifierAndBuild.Input.Path, - query: Operations.otaInformationForIdentifierAndBuild.Input.Query, - headers: Operations.otaInformationForIdentifierAndBuild.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.otaInformationForIdentifierAndBuild.Output.Ok.Headers - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OTA) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.OTA { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/application\/x-plist`. - case application_x_hyphen_plist(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.application_x_hyphen_plist`. - /// - /// - Throws: An error if `self` is not `.application_x_hyphen_plist`. - /// - SeeAlso: `.application_x_hyphen_plist`. - public var application_x_hyphen_plist: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .application_x_hyphen_plist(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/x-plist", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/application\/xml`. - case xml(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.xml`. - /// - /// - Throws: An error if `self` is not `.xml`. - /// - SeeAlso: `.xml`. - public var xml: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .xml(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/xml", - body: self - ) - } - } - } - } - - /// Received HTTP response body - public var body: Operations.otaInformationForIdentifierAndBuild.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.otaInformationForIdentifierAndBuild.Output.Ok.Headers = .init(), - body: Operations.otaInformationForIdentifierAndBuild.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - - /// OK - /// - /// - Remark: Generated from `#/paths//ota/{identifier}/{buildid}/get(otaInformationForIdentifierAndBuild)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.otaInformationForIdentifierAndBuild.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.otaInformationForIdentifierAndBuild.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case application_x_hyphen_plist - case xml - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "application/x-plist": - self = .application_x_hyphen_plist - case "application/xml": - self = .xml - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .application_x_hyphen_plist: - return "application/x-plist" - case .xml: - return "application/xml" - } - } - - public static var allCases: [Self] { - [ - .json, - .application_x_hyphen_plist, - .xml - ] - } - } - } - - /// Get OTA List For Version - /// - /// GetOTAListForVersion finds all OTA files for a given iOS version - /// - /// - Remark: HTTP `GET /ota/{version}`. - /// - Remark: Generated from `#/paths//ota/{version}/get(otasForVersion)`. - public enum otasForVersion { - public static let id: Swift.String = "otasForVersion" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{version}/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{version}/GET/path/version`. - public var version: Swift.Double - /// Creates a new `Path`. - /// - /// - Parameters: - /// - version: - public init(version: Swift.Double) { - self.version = version - } - } - - public var path: Operations.otasForVersion.Input.Path - /// - Remark: Generated from `#/paths/ota/{version}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.otasForVersion.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.otasForVersion.Input.Path, - headers: Operations.otasForVersion.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.otasForVersion.Output.Ok.Headers - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/application\/json`. - case json([OpenAPIRuntime.OpenAPIValueContainer]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [OpenAPIRuntime.OpenAPIValueContainer] { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/application\/x-plist`. - case application_x_hyphen_plist(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.application_x_hyphen_plist`. - /// - /// - Throws: An error if `self` is not `.application_x_hyphen_plist`. - /// - SeeAlso: `.application_x_hyphen_plist`. - public var application_x_hyphen_plist: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .application_x_hyphen_plist(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/x-plist", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/application\/xml`. - case xml(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.xml`. - /// - /// - Throws: An error if `self` is not `.xml`. - /// - SeeAlso: `.xml`. - public var xml: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .xml(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/xml", - body: self - ) - } - } - } - } - - /// Received HTTP response body - public var body: Operations.otasForVersion.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.otasForVersion.Output.Ok.Headers = .init(), - body: Operations.otasForVersion.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - - /// OK - /// - /// - Remark: Generated from `#/paths//ota/{version}/get(otasForVersion)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.otasForVersion.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.otasForVersion.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/404/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/404/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/404/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/404/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.otasForVersion.Output.NotFound.Headers - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.otasForVersion.Output.NotFound.Headers = .init()) { - self.headers = headers - } - } - - /// Not Found - /// - /// - Remark: Generated from `#/paths//ota/{version}/get(otasForVersion)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.otasForVersion.Output.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.otasForVersion.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case application_x_hyphen_plist - case xml - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "application/x-plist": - self = .application_x_hyphen_plist - case "application/xml": - self = .xml - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .application_x_hyphen_plist: - return "application/x-plist" - case .xml: - return "application/xml" - } - } - - public static var allCases: [Self] { - [ - .json, - .application_x_hyphen_plist, - .xml - ] - } - } - } - - /// Releases - /// - /// Releases returns the release timeline of all entities in the IPSW Downloads database - /// - /// - Remark: HTTP `GET /releases`. - /// - Remark: Generated from `#/paths//releases/get(releases)`. - public enum releases { - public static let id: Swift.String = "releases" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/releases/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - - public var headers: Operations.releases.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - headers: - public init(headers: Operations.releases.Input.Headers = .init()) { - self.headers = headers - } - } - - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/releases/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/releases/GET/responses/200/headers/Access-Control-Allow-Methods`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? - /// - Remark: Generated from `#/paths/releases/GET/responses/200/headers/Access-Control-Allow-Origin`. - public var Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? - /// - Remark: Generated from `#/paths/releases/GET/responses/200/headers/Cache-Control`. - public var Cache_hyphen_Control: Swift.String? - /// - Remark: Generated from `#/paths/releases/GET/responses/200/headers/Expires`. - public var Expires: Swift.String? - /// - Remark: Generated from `#/paths/releases/GET/responses/200/headers/X-Data-Location`. - public var X_hyphen_Data_hyphen_Location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: - /// - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: - /// - Cache_hyphen_Control: - /// - Expires: - /// - X_hyphen_Data_hyphen_Location: - public init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: Swift.String? = nil, - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: Swift.String? = nil, - Cache_hyphen_Control: Swift.String? = nil, - Expires: Swift.String? = nil, - X_hyphen_Data_hyphen_Location: Swift.String? = nil - ) { - self.Access_hyphen_Control_hyphen_Allow_hyphen_Methods = Access_hyphen_Control_hyphen_Allow_hyphen_Methods - self.Access_hyphen_Control_hyphen_Allow_hyphen_Origin = Access_hyphen_Control_hyphen_Allow_hyphen_Origin - self.Cache_hyphen_Control = Cache_hyphen_Control - self.Expires = Expires - self.X_hyphen_Data_hyphen_Location = X_hyphen_Data_hyphen_Location - } - } - - /// Received HTTP response headers - public var headers: Operations.releases.Output.Ok.Headers - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content/application\/json`. - case json([OpenAPIRuntime.OpenAPIValueContainer]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [OpenAPIRuntime.OpenAPIValueContainer] { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content/application\/x-plist`. - case application_x_hyphen_plist(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.application_x_hyphen_plist`. - /// - /// - Throws: An error if `self` is not `.application_x_hyphen_plist`. - /// - SeeAlso: `.application_x_hyphen_plist`. - public var application_x_hyphen_plist: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .application_x_hyphen_plist(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/x-plist", - body: self - ) - } - } - } - - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content/application\/xml`. - case xml(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.xml`. - /// - /// - Throws: An error if `self` is not `.xml`. - /// - SeeAlso: `.xml`. - public var xml: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .xml(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/xml", - body: self - ) - } - } - } - } - - /// Received HTTP response body - public var body: Operations.releases.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.releases.Output.Ok.Headers = .init(), - body: Operations.releases.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - - /// OK - /// - /// - Remark: Generated from `#/paths//releases/get(releases)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.releases.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.releases.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case application_x_hyphen_plist - case xml - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "application/x-plist": - self = .application_x_hyphen_plist - case "application/xml": - self = .xml - default: - self = .other(rawValue) - } - } - - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .application_x_hyphen_plist: - return "application/x-plist" - case .xml: - return "application/xml" - } - } - - public static var allCases: [Self] { - [ - .json, - .application_x_hyphen_plist, - .xml - ] - } - } - } -} diff --git a/Sources/IPSWDownloads/openapi-generator-config.yaml b/Sources/IPSWDownloads/openapi-generator-config.yaml index 736542d..1df6f28 100644 --- a/Sources/IPSWDownloads/openapi-generator-config.yaml +++ b/Sources/IPSWDownloads/openapi-generator-config.yaml @@ -1,4 +1,4 @@ generate: - types - client -accessModifier: public +accessModifier: internal diff --git a/project.yml b/project.yml index aab6ecd..37cf40a 100644 --- a/project.yml +++ b/project.yml @@ -5,17 +5,6 @@ packages: IPSWDownloads: path: . aggregateTargets: - Generate: - name: Generate Code - settings: - FORMAT_ONLY: true - buildScripts: - - path: Scripts/generate.sh - name: Generate Code - basedOnDependencyAnalysis: false - - path: Scripts/lint.sh - name: Lint - basedOnDependencyAnalysis: false Lint: buildScripts: - path: Scripts/lint.sh