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 2621f01..db96f2b 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,19 +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 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 \ No newline at end of file diff --git a/Package.swift b/Package.swift index 65d7b96..3c7f25a 100644 --- a/Package.swift +++ b/Package.swift @@ -1,5 +1,4 @@ // swift-tools-version: 5.9 -// The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -15,18 +14,13 @@ let package = Package( .package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.0") ], targets: [ - // Targets are the basic building blocks of a package, defining a module or a test suite. - // Targets can depend on other targets in this package and products from dependencies. .target( name: "IPSWDownloads", dependencies: [ .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/Board.swift b/Sources/IPSWDownloads/Board.swift new file mode 100644 index 0000000..96eb731 --- /dev/null +++ b/Sources/IPSWDownloads/Board.swift @@ -0,0 +1,32 @@ +// +// File.swift +// +// +// Created by Leo Dion on 1/11/24. +// +import Foundation + +public struct Board { + public let boardconfig: String + public let platform: String + public let cpid: Int + public let bdid: Int + + public init(boardconfig: String, platform: String, cpid: Int, bdid: Int) { + self.boardconfig = boardconfig + self.platform = platform + self.cpid = cpid + self.bdid = bdid + } +} + +extension Board { + init(component: Components.Schemas.Board) { + self.init( + boardconfig: component.boardconfig, + platform: component.platform, + cpid: component.cpid, + bdid: component.bdid + ) + } +} diff --git a/Sources/IPSWDownloads/Client.swift b/Sources/IPSWDownloads/Client.swift deleted file mode 100644 index dca5933..0000000 --- a/Sources/IPSWDownloads/Client.swift +++ /dev/null @@ -1,1890 +0,0 @@ -// Generated by swift-openapi-generator, do not modify. -@_spi(Generated) import OpenAPIRuntime -#if os(Linux) -@preconcurrency import struct Foundation.URL -@preconcurrency import struct Foundation.Data -@preconcurrency import struct Foundation.Date -#else -import struct Foundation.URL -import struct Foundation.Data -import struct Foundation.Date -#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] = [] - ) { - self.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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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( - Operations.firmwareKeysForIdentifier.Output.Ok.Body.jsonPayload.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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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( - Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body.jsonPayload.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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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( - Operations.identifierForModel.Output.Ok.Body.jsonPayload.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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "X-Data-Location", - as: Swift.String.self - ), - X_hyphen_Frame_hyphen_Options: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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( - Operations.otaDocumentationForDeviceAndVersion.Output.NotFound.Body.jsonPayload.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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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( - Operations.otaInformationForIdentifierAndBuild.Output.Ok.Body.jsonPayload.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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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( - Operations.otasForVersion.Output.Ok.Body.jsonPayload.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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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 = .init( - Access_hyphen_Control_hyphen_Allow_hyphen_Methods: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Methods", - as: Swift.String.self - ), - Access_hyphen_Control_hyphen_Allow_hyphen_Origin: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Access-Control-Allow-Origin", - as: Swift.String.self - ), - Cache_hyphen_Control: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - ), - Expires: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Expires", - as: Swift.String.self - ), - X_hyphen_Data_hyphen_Location: try 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( - Operations.releases.Output.Ok.Body.jsonPayload.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/Device.swift b/Sources/IPSWDownloads/Device.swift new file mode 100644 index 0000000..5e6cc4c --- /dev/null +++ b/Sources/IPSWDownloads/Device.swift @@ -0,0 +1,32 @@ +// +// File.swift +// +// +// Created by Leo Dion on 1/11/24. +// +import Foundation + +public struct Device { + public let name: String + public let identifier: String + public let firmwares: [Firmware] + public let boards: [Board] + + public init(name: String, identifier: String, firmwares: [Firmware], boards: [Board]) { + self.name = name + self.identifier = identifier + self.firmwares = firmwares + self.boards = boards + } +} + +extension Device { + init(component: Components.Schemas.Device) throws { + try self.init( + name: component.name, + identifier: component.identifier, + firmwares: component.firmwares.map(Firmware.init(component:)), + boards: component.boards.map(Board.init(component:)) + ) + } +} diff --git a/Sources/IPSWDownloads/Firmware.swift b/Sources/IPSWDownloads/Firmware.swift new file mode 100644 index 0000000..66406e4 --- /dev/null +++ b/Sources/IPSWDownloads/Firmware.swift @@ -0,0 +1,61 @@ +// +// File.swift +// +// +// Created by Leo Dion on 1/11/24. +// +import Foundation + +public struct Firmware { + public let identifier: String + public let version: String + public let buildid: String + public let sha1sum: String + public let md5sum: String + public let filesize: Int + public let url: URL + public let releasedate: Date + public let uploaddate: Date + public let signed: Bool + + public init( + identifier: String, + version: String, + buildid: String, + sha1sum: String, + md5sum: String, + filesize: Int, + url: URL, + releasedate: Date, + uploaddate: Date, + signed: 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 + } +} + +extension Firmware { + init(component: Components.Schemas.Firmware) throws { + try self.init( + identifier: component.identifier, + version: component.version, + buildid: component.buildid, + sha1sum: component.sha1sum, + md5sum: component.md5sum, + filesize: component.filesize, + url: URL(validatingURL: component.url), + releasedate: component.releasedate, + uploaddate: component.uploaddate, + signed: component.signed + ) + } +} diff --git a/Sources/IPSWDownloads/FirmwareType.swift b/Sources/IPSWDownloads/FirmwareType.swift new file mode 100644 index 0000000..21a3142 --- /dev/null +++ b/Sources/IPSWDownloads/FirmwareType.swift @@ -0,0 +1,12 @@ +// +// File.swift +// +// +// Created by Leo Dion on 1/11/24. +// +import Foundation + +public enum FirmwareType: String { + case ipsw + case ota +} diff --git a/Sources/IPSWDownloads/IPSWDownloads.swift b/Sources/IPSWDownloads/IPSWDownloads.swift new file mode 100644 index 0000000..db0dcda --- /dev/null +++ b/Sources/IPSWDownloads/IPSWDownloads.swift @@ -0,0 +1,46 @@ +// +// File.swift +// +// +// Created by Leo Dion on 1/11/24. +// +import Foundation +import OpenAPIRuntime + +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( + transport: any ClientTransport, + serverURL: URL = Self.serverURL + ) { + self.init( + underlyingClient: Client( + serverURL: serverURL, + transport: transport + ) + ) + } + + public func device( + withIdentifier identifier: String, + type: FirmwareType + ) async throws -> Device { + let input = Operations.firmwaresForDevice.Input( + path: .init(identifier: identifier), + query: .init(_type: type.rawValue) + ) + let device = try await underlyingClient.firmwaresForDevice(input).ok.body.json + return try Device(component: device) + } +} diff --git a/Sources/IPSWDownloads/RuntimeError.swift b/Sources/IPSWDownloads/RuntimeError.swift new file mode 100644 index 0000000..25d5d12 --- /dev/null +++ b/Sources/IPSWDownloads/RuntimeError.swift @@ -0,0 +1,11 @@ +// +// File.swift +// +// +// Created by Leo Dion on 1/11/24. +// +import Foundation + +enum RuntimeError: Error { + case invalidURL(String) +} diff --git a/Sources/IPSWDownloads/Types.swift b/Sources/IPSWDownloads/Types.swift deleted file mode 100644 index be4eb0d..0000000 --- a/Sources/IPSWDownloads/Types.swift +++ /dev/null @@ -1,5100 +0,0 @@ -// Generated by swift-openapi-generator, do not modify. -@_spi(Generated) import OpenAPIRuntime -#if os(Linux) -@preconcurrency import struct Foundation.URL -@preconcurrency import struct Foundation.Data -@preconcurrency import struct Foundation.Date -#else -import struct Foundation.URL -import struct Foundation.Data -import struct Foundation.Date -#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. -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)`. - public 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)`. - public 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)`. - public 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)`. - public 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)`. - public 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)`. - public 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)`. - public 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)`. - public 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)`. - public 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)`. - public 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)`. - public 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)`. - public 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)`. - public 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)`. - public 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)`. - public 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/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/json`. - @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case1Payload`. - public struct Case1PayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case1Payload/identifier`. - public var identifier: Swift.String - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case1Payload/buildid`. - public var buildid: Swift.String - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case1Payload/codename`. - public var codename: Swift.String - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case1Payload/baseband`. - public var baseband: Swift.String - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case1Payload/updateramdiskexists`. - public var updateramdiskexists: Swift.Bool - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case1Payload/restoreramdiskexists`. - public var restoreramdiskexists: Swift.Bool - /// Creates a new `Case1PayloadPayload`. - /// - /// - Parameters: - /// - identifier: - /// - buildid: - /// - codename: - /// - baseband: - /// - updateramdiskexists: - /// - restoreramdiskexists: - public init( - identifier: Swift.String, - buildid: Swift.String, - codename: Swift.String, - baseband: Swift.String, - updateramdiskexists: Swift.Bool, - restoreramdiskexists: Swift.Bool - ) { - self.identifier = identifier - self.buildid = buildid - self.codename = codename - self.baseband = baseband - self.updateramdiskexists = updateramdiskexists - self.restoreramdiskexists = restoreramdiskexists - } - public enum CodingKeys: String, CodingKey { - case identifier - case buildid - case codename - case baseband - case updateramdiskexists - case restoreramdiskexists - } - } - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/case1`. - public typealias Case1Payload = [Operations.firmwareKeysForIdentifier.Output.Ok.Body.jsonPayload.Case1PayloadPayload] - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/case1`. - case case1(Operations.firmwareKeysForIdentifier.Output.Ok.Body.jsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case2Payload`. - public struct Case2PayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case2Payload/identifier`. - public var identifier: Swift.String - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case2Payload/buildid`. - public var buildid: Swift.String - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case2Payload/codename`. - public var codename: Swift.String - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case2Payload/updateramdiskexists`. - public var updateramdiskexists: Swift.Bool - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/Case2Payload/restoreramdiskexists`. - public var restoreramdiskexists: Swift.Bool - /// Creates a new `Case2PayloadPayload`. - /// - /// - Parameters: - /// - identifier: - /// - buildid: - /// - codename: - /// - updateramdiskexists: - /// - restoreramdiskexists: - public init( - identifier: Swift.String, - buildid: Swift.String, - codename: Swift.String, - updateramdiskexists: Swift.Bool, - restoreramdiskexists: Swift.Bool - ) { - self.identifier = identifier - self.buildid = buildid - self.codename = codename - self.updateramdiskexists = updateramdiskexists - self.restoreramdiskexists = restoreramdiskexists - } - public enum CodingKeys: String, CodingKey { - case identifier - case buildid - case codename - case updateramdiskexists - case restoreramdiskexists - } - } - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/case2`. - public typealias Case2Payload = [Operations.firmwareKeysForIdentifier.Output.Ok.Body.jsonPayload.Case2PayloadPayload] - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/json/case2`. - case case2(Operations.firmwareKeysForIdentifier.Output.Ok.Body.jsonPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// - Remark: Generated from `#/paths/keys/device/{identifier}/GET/responses/200/content/application\/json`. - case json(Operations.firmwareKeysForIdentifier.Output.Ok.Body.jsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.firmwareKeysForIdentifier.Output.Ok.Body.jsonPayload { - 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/json`. - @frozen public enum jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/identifier`. - public var identifier: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/buildid`. - public var buildid: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/codename`. - public var codename: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/updateramdiskexists`. - public var updateramdiskexists: Swift.Bool? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/restoreramdiskexists`. - public var restoreramdiskexists: Swift.Bool? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/keysPayload`. - public struct keysPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/keysPayload/image`. - public var image: Swift.String - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/keysPayload/filename`. - public var filename: Swift.String - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/keysPayload/kbag`. - public var kbag: Swift.String - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/keysPayload/key`. - public var key: Swift.String - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/keysPayload/iv`. - public var iv: Swift.String - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/keysPayload/date`. - public var date: Swift.String - /// Creates a new `keysPayloadPayload`. - /// - /// - 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: Swift.String - ) { - 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 `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/keys`. - public typealias keysPayload = [Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body.jsonPayload.Case1Payload.keysPayloadPayload] - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1/keys`. - public var keys: Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body.jsonPayload.Case1Payload.keysPayload? - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - identifier: - /// - buildid: - /// - codename: - /// - updateramdiskexists: - /// - restoreramdiskexists: - /// - keys: - public init( - identifier: Swift.String? = nil, - buildid: Swift.String? = nil, - codename: Swift.String? = nil, - updateramdiskexists: Swift.Bool? = nil, - restoreramdiskexists: Swift.Bool? = nil, - keys: Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body.jsonPayload.Case1Payload.keysPayload? = nil - ) { - self.identifier = identifier - self.buildid = buildid - self.codename = codename - self.updateramdiskexists = updateramdiskexists - self.restoreramdiskexists = restoreramdiskexists - self.keys = keys - } - public enum CodingKeys: String, CodingKey { - case identifier - case buildid - case codename - case updateramdiskexists - case restoreramdiskexists - case keys - } - } - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case1`. - case case1(Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body.jsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2`. - public struct Case2Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/identifier`. - public var identifier: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/buildid`. - public var buildid: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/codename`. - public var codename: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/baseband`. - public var baseband: Swift.String? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/updateramdiskexists`. - public var updateramdiskexists: Swift.Bool? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/restoreramdiskexists`. - public var restoreramdiskexists: Swift.Bool? - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/keysPayload`. - public struct keysPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/keysPayload/image`. - public var image: Swift.String - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/keysPayload/filename`. - public var filename: Swift.String - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/keysPayload/kbag`. - public var kbag: Swift.String - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/keysPayload/key`. - public var key: Swift.String - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/keysPayload/iv`. - public var iv: Swift.String - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/keysPayload/date`. - public var date: Swift.String - /// Creates a new `keysPayloadPayload`. - /// - /// - 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: Swift.String - ) { - 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 `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/keys`. - public typealias keysPayload = [Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body.jsonPayload.Case2Payload.keysPayloadPayload] - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2/keys`. - public var keys: Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body.jsonPayload.Case2Payload.keysPayload? - /// Creates a new `Case2Payload`. - /// - /// - Parameters: - /// - identifier: - /// - buildid: - /// - codename: - /// - baseband: - /// - updateramdiskexists: - /// - restoreramdiskexists: - /// - keys: - public init( - identifier: Swift.String? = nil, - buildid: Swift.String? = nil, - codename: Swift.String? = nil, - baseband: Swift.String? = nil, - updateramdiskexists: Swift.Bool? = nil, - restoreramdiskexists: Swift.Bool? = nil, - keys: Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body.jsonPayload.Case2Payload.keysPayload? = 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 `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/json/case2`. - case case2(Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body.jsonPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try value.encode(to: encoder) - } - } - } - /// - Remark: Generated from `#/paths/keys/ipsw/{identifier}/{buildid}/GET/responses/200/content/application\/json`. - case json(Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body.jsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.firmwareKeysForIdentifierAndBuild.Output.Ok.Body.jsonPayload { - 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/json`. - public struct jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/200/content/json/identifier`. - public var identifier: Swift.String? - /// Creates a new `jsonPayload`. - /// - /// - Parameters: - /// - identifier: - public init(identifier: Swift.String? = nil) { - self.identifier = identifier - } - public enum CodingKeys: String, CodingKey { - case identifier - } - } - /// - Remark: Generated from `#/paths/model/{model}/GET/responses/200/content/application\/json`. - case json(Operations.identifierForModel.Output.Ok.Body.jsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.identifierForModel.Output.Ok.Body.jsonPayload { - 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/json`. - public struct jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/404/content/json/status`. - public var status: Swift.Double? - /// - Remark: Generated from `#/paths/ota/documentation/{device}/{version}/GET/responses/404/content/json/message`. - public var message: Swift.String? - /// Creates a new `jsonPayload`. - /// - /// - 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 `#/paths/ota/documentation/{device}/{version}/GET/responses/404/content/application\/json`. - case json(Operations.otaDocumentationForDeviceAndVersion.Output.NotFound.Body.jsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.otaDocumentationForDeviceAndVersion.Output.NotFound.Body.jsonPayload { - 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/json`. - public struct jsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/json/identifier`. - public var identifier: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/json/buildid`. - public var buildid: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/json/version`. - public var version: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/json/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/json/filesize`. - public var filesize: Swift.Double? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/json/prerequisitebuildid`. - public var prerequisitebuildid: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/json/prerequisiteversion`. - public var prerequisiteversion: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/json/releasetype`. - public var releasetype: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/json/uploaddate`. - public var uploaddate: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/json/releasedate`. - public var releasedate: Swift.String? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/json/marketingversion`. - public var marketingversion: OpenAPIRuntime.OpenAPIValueContainer? - /// - Remark: Generated from `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/json/signed`. - public var signed: Swift.Bool? - /// Creates a new `jsonPayload`. - /// - /// - Parameters: - /// - identifier: - /// - buildid: - /// - version: - /// - url: - /// - filesize: - /// - prerequisitebuildid: - /// - prerequisiteversion: - /// - releasetype: - /// - uploaddate: - /// - releasedate: - /// - marketingversion: - /// - signed: - public init( - identifier: Swift.String? = nil, - buildid: Swift.String? = nil, - version: Swift.String? = nil, - url: Swift.String? = nil, - filesize: Swift.Double? = nil, - prerequisitebuildid: Swift.String? = nil, - prerequisiteversion: Swift.String? = nil, - releasetype: Swift.String? = nil, - uploaddate: Swift.String? = nil, - releasedate: Swift.String? = nil, - marketingversion: OpenAPIRuntime.OpenAPIValueContainer? = nil, - signed: Swift.Bool? = nil - ) { - 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 `#/paths/ota/{identifier}/{buildid}/GET/responses/200/content/application\/json`. - case json(Operations.otaInformationForIdentifierAndBuild.Output.Ok.Body.jsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.otaInformationForIdentifierAndBuild.Output.Ok.Body.jsonPayload { - 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/jsonPayload`. - public struct jsonPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/jsonPayload/identifier`. - public var identifier: Swift.String - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/jsonPayload/buildid`. - public var buildid: Swift.String - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/jsonPayload/version`. - public var version: Swift.String - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/jsonPayload/url`. - public var url: Swift.String - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/jsonPayload/filesize`. - public var filesize: Swift.Double - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/jsonPayload/prerequisitebuildid`. - public var prerequisitebuildid: Swift.String - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/jsonPayload/prerequisiteversion`. - public var prerequisiteversion: Swift.String - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/jsonPayload/releasetype`. - public var releasetype: Swift.String - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/jsonPayload/uploaddate`. - public var uploaddate: Swift.String - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/jsonPayload/releasedate`. - public var releasedate: Swift.String - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/jsonPayload/marketingversion`. - public var marketingversion: OpenAPIRuntime.OpenAPIValueContainer? - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/jsonPayload/signed`. - public var signed: Swift.Bool - /// Creates a new `jsonPayloadPayload`. - /// - /// - 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: Swift.String, - releasedate: Swift.String, - 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 `#/paths/ota/{version}/GET/responses/200/content/json`. - public typealias jsonPayload = [Operations.otasForVersion.Output.Ok.Body.jsonPayloadPayload] - /// - Remark: Generated from `#/paths/ota/{version}/GET/responses/200/content/application\/json`. - case json(Operations.otasForVersion.Output.Ok.Body.jsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.otasForVersion.Output.Ok.Body.jsonPayload { - 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/jsonPayload`. - public struct jsonPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content/jsonPayload/date`. - public var date: Swift.String - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content/jsonPayload/releasesPayload`. - public struct releasesPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content/jsonPayload/releasesPayload/name`. - public var name: Swift.String - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content/jsonPayload/releasesPayload/date`. - public var date: Swift.String - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content/jsonPayload/releasesPayload/count`. - public var count: Swift.Double - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content/jsonPayload/releasesPayload/type`. - public var _type: Swift.String - /// Creates a new `releasesPayloadPayload`. - /// - /// - Parameters: - /// - name: - /// - date: - /// - count: - /// - _type: - public init( - name: Swift.String, - date: Swift.String, - 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 `#/paths/releases/GET/responses/200/content/jsonPayload/releases`. - public typealias releasesPayload = [Operations.releases.Output.Ok.Body.jsonPayloadPayload.releasesPayloadPayload] - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content/jsonPayload/releases`. - public var releases: Operations.releases.Output.Ok.Body.jsonPayloadPayload.releasesPayload - /// Creates a new `jsonPayloadPayload`. - /// - /// - Parameters: - /// - date: - /// - releases: - public init( - date: Swift.String, - releases: Operations.releases.Output.Ok.Body.jsonPayloadPayload.releasesPayload - ) { - self.date = date - self.releases = releases - } - public enum CodingKeys: String, CodingKey { - case date - case releases - } - } - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content/json`. - public typealias jsonPayload = [Operations.releases.Output.Ok.Body.jsonPayloadPayload] - /// - Remark: Generated from `#/paths/releases/GET/responses/200/content/application\/json`. - case json(Operations.releases.Output.Ok.Body.jsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.releases.Output.Ok.Body.jsonPayload { - 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/URL.swift b/Sources/IPSWDownloads/URL.swift new file mode 100644 index 0000000..855ef01 --- /dev/null +++ b/Sources/IPSWDownloads/URL.swift @@ -0,0 +1,17 @@ +// +// File.swift +// +// +// Created by Leo Dion on 1/11/24. +// +import Foundation + +extension URL { + /// Returns a validated server URL, or throws an error. + /// - Parameter string: A URL string. + /// - Throws: If the provided string doesn't convert to URL. + public init(validatingURL string: String) throws { + guard let url = Self(string: string) else { throw RuntimeError.invalidURL(string) } + self = url + } +} 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/Sources/IPSWDownloads/openapi.yaml b/Sources/IPSWDownloads/openapi.yaml index 2ab583c..7537fe7 100644 --- a/Sources/IPSWDownloads/openapi.yaml +++ b/Sources/IPSWDownloads/openapi.yaml @@ -3510,50 +3510,9 @@ paths: content: application/json: schema: - oneOf: - - type: array - items: - type: object - properties: - identifier: - type: string - buildid: - type: string - codename: - type: string - baseband: - type: string - updateramdiskexists: - type: boolean - restoreramdiskexists: - type: boolean - required: - - identifier - - buildid - - codename - - baseband - - updateramdiskexists - - restoreramdiskexists - - type: array - items: - type: object - properties: - identifier: - type: string - buildid: - type: string - codename: - type: string - updateramdiskexists: - type: boolean - restoreramdiskexists: - type: boolean - required: - - identifier - - buildid - - codename - - updateramdiskexists - - restoreramdiskexists + type: array + items: + $ref: '#/components/schemas/FirmwareKey' examples: example1: value: @@ -4028,81 +3987,10 @@ paths: content: application/json: schema: - oneOf: - - type: object - properties: - identifier: - type: string - buildid: - type: string - codename: - type: string - updateramdiskexists: - type: boolean - restoreramdiskexists: - type: boolean - keys: - type: array - items: - type: object - properties: - image: - type: string - filename: - type: string - kbag: - type: string - key: - type: string - iv: - type: string - date: - type: string - required: - - image - - filename - - kbag - - key - - iv - - date - - type: object - properties: - identifier: - type: string - buildid: - type: string - codename: - type: string - baseband: - type: string - updateramdiskexists: - type: boolean - restoreramdiskexists: - type: boolean - keys: - type: array - items: - type: object - properties: - image: - type: string - filename: - type: string - kbag: - type: string - key: - type: string - iv: - type: string - date: - type: string - required: - - image - - filename - - kbag - - key - - iv - - date + type: array + items: + schema: + $ref: '#/components/schemas/FirmwareKey' examples: example1: value: @@ -4551,10 +4439,7 @@ paths: content: application/json: schema: - type: object - properties: - identifier: - type: string + $ref: '#/components/schemas/Model' examples: example1: value: @@ -4689,12 +4574,7 @@ paths: content: application/json: schema: - type: object - properties: - status: - type: number - message: - type: string + $ref: '#/components/schemas/NotFoundDetails' example: status: 404 message: not found @@ -4793,32 +4673,7 @@ paths: content: application/json: schema: - type: object - properties: - identifier: - type: string - buildid: - type: string - version: - type: string - url: - type: string - filesize: - type: number - prerequisitebuildid: - type: string - prerequisiteversion: - type: string - releasetype: - type: string - uploaddate: - type: string - releasedate: - type: string - marketingversion: - nullable: true - signed: - type: boolean + $ref: '#/components/schemas/OTA' example: identifier: iPhone3,3 buildid: 11D201 @@ -4945,45 +4800,8 @@ paths: schema: type: array items: - type: object - properties: - identifier: - type: string - buildid: - type: string - version: - type: string - url: - type: string - filesize: - type: number - prerequisitebuildid: - type: string - prerequisiteversion: - type: string - releasetype: - type: string - uploaddate: - type: string - releasedate: - type: string - marketingversion: - nullable: true - signed: - type: boolean - required: - - identifier - - buildid - - version - - url - - filesize - - prerequisitebuildid - - prerequisiteversion - - releasetype - - uploaddate - - releasedate - - marketingversion - - signed + schema: + $ref: '#/components/schemas/OTA' examples: example1: value: @@ -5502,31 +5320,8 @@ paths: schema: type: array items: - type: object - properties: - date: - type: string - releases: - type: array - items: - type: object - properties: - name: - type: string - date: - type: string - count: - type: number - type: - type: string - required: - - name - - date - - count - - type - required: - - date - - releases + schema: + $ref: '#/components/schemas/ReleaseDate' example: - date: '2021-03-04' releases: @@ -5763,6 +5558,139 @@ paths: components: schemas: + NotFoundDetails: + type: object + properties: + status: + type: integer + message: + type: string + ReleaseDate: + type: object + properties: + date: + type: string + format: date + releases: + type: array + items: + schema: + $ref: '#/components/schemas/ReleaseEntry' + required: + - date + - releases + ReleaseEntry: + type: object + properties: + name: + type: string + date: + type: string + format: date-time + count: + type: integer + type: + type: string + required: + - name + - date + - count + - type + OTA: + type: object + properties: + identifier: + type: string + buildid: + type: string + version: + type: string + url: + type: string + filesize: + type: integer + prerequisitebuildid: + type: string + prerequisiteversion: + type: string + releasetype: + type: string + uploaddate: + type: string + format: date-time + releasedate: + type: string + format: date-time + marketingversion: + nullable: true + signed: + type: boolean + required: + - identifier + - buildid + - version + - url + - filesize + - prerequisitebuildid + - prerequisiteversion + - releasetype + - uploaddate + - releasedate + - marketingversion + - signed + Model: + type: object + properties: + identifier: + type: string + Key: + type: object + properties: + image: + type: string + filename: + type: string + kbag: + type: string + key: + type: string + iv: + type: string + date: + type: string + format: date-time + required: + - image + - filename + - kbag + - key + - iv + - date + FirmwareKey: + type: object + properties: + identifier: + type: string + buildid: + type: string + codename: + type: string + baseband: + type: string + updateramdiskexists: + type: boolean + restoreramdiskexists: + type: boolean + keys: + type: array + items: + $ref: '#/components/schemas/Key' + required: + - identifier + - buildid + - codename + - updateramdiskexists + - restoreramdiskexists iTunes: type: object properties: @@ -5800,9 +5728,9 @@ components: platform: type: string cpid: - type: number + type: integer bdid: - type: number + type: integer required: - boardconfig - platform @@ -5833,7 +5761,7 @@ components: md5sum: type: string filesize: - type: number + type: integer url: type: string format: uri @@ -5870,9 +5798,9 @@ components: platform: type: string cpid: - type: number + type: integer bdid: - type: number + type: integer tags: - name: Api 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