From eee96e911759948782b37586c05e6ba73ce6da29 Mon Sep 17 00:00:00 2001 From: Leo Dion Date: Wed, 10 Jan 2024 17:01:30 -0500 Subject: [PATCH] finished refactoring, working on linting --- .swiftlint.yml | 17 +- Sources/IPSWDownloads/Client.swift | 10 +- Sources/IPSWDownloads/Types.swift | 493 ++++++++++++----------------- Sources/IPSWDownloads/openapi.yaml | 192 ++++++----- 4 files changed, 314 insertions(+), 398 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 64e9a89..95c8c9c 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -3,6 +3,21 @@ identifier_name: excluded: - id - ok + - iv + - iTunes + - Access_hyphen_Control_hyphen_Allow_hyphen_Methods + - Access_hyphen_Control_hyphen_Allow_hyphen_Origin + - Cache_hyphen_Control + - X_hyphen_Data_hyphen_Location + - application_x_hyphen_plist + - text_html_charset_utf_hyphen_8 + - X_hyphen_Frame_hyphen_Options + - Expires + - Location +type_name: + excluded: + - iTunes + - Ok excluded: - Tests - DerivedData @@ -20,7 +35,7 @@ disabled_rules: custom_rules: payload_disallow: # 1 name: "Payload Disallowed" # 2 - regex: '\w+Payload' # 3 + regex: '\\b(?!UndocumentedPayload\b)\w+Payload\b' # 3 capture_group: 0 # 4 message: "Do not use Payload for identifier." # 5 severity: error # 6 \ No newline at end of file diff --git a/Sources/IPSWDownloads/Client.swift b/Sources/IPSWDownloads/Client.swift index 141528c..0893193 100644 --- a/Sources/IPSWDownloads/Client.swift +++ b/Sources/IPSWDownloads/Client.swift @@ -1232,7 +1232,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.identifierForModel.Output.Ok.Body.jsonPayload.self, + Components.Schemas.Model.self, from: responseBody, transforming: { value in .json(value) @@ -1420,7 +1420,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.otaDocumentationForDeviceAndVersion.Output.NotFound.Body.jsonPayload.self, + Components.Schemas.NotFoundDetails.self, from: responseBody, transforming: { value in .json(value) @@ -1619,7 +1619,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.otaInformationForIdentifierAndBuild.Output.Ok.Body.jsonPayload.self, + Components.Schemas.OTA.self, from: responseBody, transforming: { value in .json(value) @@ -1732,7 +1732,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.otasForVersion.Output.Ok.Body.jsonPayload.self, + [OpenAPIRuntime.OpenAPIValueContainer].self, from: responseBody, transforming: { value in .json(value) @@ -1862,7 +1862,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.releases.Output.Ok.Body.jsonPayload.self, + [OpenAPIRuntime.OpenAPIValueContainer].self, from: responseBody, transforming: { value in .json(value) diff --git a/Sources/IPSWDownloads/Types.swift b/Sources/IPSWDownloads/Types.swift index 8108da7..cdd9031 100644 --- a/Sources/IPSWDownloads/Types.swift +++ b/Sources/IPSWDownloads/Types.swift @@ -387,6 +387,195 @@ public enum Servers { public enum Components { /// Types generated from the `#/components/schemas` section of the OpenAPI document. public enum Schemas { + /// - Remark: Generated from `#/components/schemas/NotFoundDetails`. + public struct NotFoundDetails: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/NotFoundDetails/status`. + public var status: Swift.Double? + /// - Remark: Generated from `#/components/schemas/NotFoundDetails/message`. + public var message: Swift.String? + /// Creates a new `NotFoundDetails`. + /// + /// - Parameters: + /// - status: + /// - message: + public init( + status: Swift.Double? = nil, + message: Swift.String? = nil + ) { + self.status = status + self.message = message + } + + public enum CodingKeys: String, CodingKey { + case status + case message + } + } + + /// - Remark: Generated from `#/components/schemas/ReleaseDate`. + public struct ReleaseDate: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/ReleaseDate/date`. + public var date: Swift.String + /// - Remark: Generated from `#/components/schemas/ReleaseDate/releases`. + public var releases: [OpenAPIRuntime.OpenAPIValueContainer] + /// Creates a new `ReleaseDate`. + /// + /// - Parameters: + /// - date: + /// - releases: + public init( + date: Swift.String, + releases: [OpenAPIRuntime.OpenAPIValueContainer] + ) { + self.date = date + self.releases = releases + } + + public enum CodingKeys: String, CodingKey { + case date + case releases + } + } + + /// - Remark: Generated from `#/components/schemas/ReleaseEntry`. + public struct ReleaseEntry: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/ReleaseEntry/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/ReleaseEntry/date`. + public var date: Foundation.Date + /// - Remark: Generated from `#/components/schemas/ReleaseEntry/count`. + public var count: Swift.Double + /// - Remark: Generated from `#/components/schemas/ReleaseEntry/type`. + public var _type: Swift.String + /// Creates a new `ReleaseEntry`. + /// + /// - Parameters: + /// - name: + /// - date: + /// - count: + /// - _type: + public init( + name: Swift.String, + date: Foundation.Date, + count: Swift.Double, + _type: Swift.String + ) { + self.name = name + self.date = date + self.count = count + self._type = _type + } + + public enum CodingKeys: String, CodingKey { + case name + case date + case count + case _type = "type" + } + } + + /// - Remark: Generated from `#/components/schemas/OTA`. + public struct OTA: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/OTA/identifier`. + public var identifier: Swift.String + /// - Remark: Generated from `#/components/schemas/OTA/buildid`. + public var buildid: Swift.String + /// - Remark: Generated from `#/components/schemas/OTA/version`. + public var version: Swift.String + /// - Remark: Generated from `#/components/schemas/OTA/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/OTA/filesize`. + public var filesize: Swift.Double + /// - Remark: Generated from `#/components/schemas/OTA/prerequisitebuildid`. + public var prerequisitebuildid: Swift.String + /// - Remark: Generated from `#/components/schemas/OTA/prerequisiteversion`. + public var prerequisiteversion: Swift.String + /// - Remark: Generated from `#/components/schemas/OTA/releasetype`. + public var releasetype: Swift.String + /// - Remark: Generated from `#/components/schemas/OTA/uploaddate`. + public var uploaddate: Foundation.Date + /// - Remark: Generated from `#/components/schemas/OTA/releasedate`. + public var releasedate: Foundation.Date + /// - Remark: Generated from `#/components/schemas/OTA/marketingversion`. + public var marketingversion: OpenAPIRuntime.OpenAPIValueContainer? + /// - Remark: Generated from `#/components/schemas/OTA/signed`. + public var signed: Swift.Bool + /// Creates a new `OTA`. + /// + /// - Parameters: + /// - identifier: + /// - buildid: + /// - version: + /// - url: + /// - filesize: + /// - prerequisitebuildid: + /// - prerequisiteversion: + /// - releasetype: + /// - uploaddate: + /// - releasedate: + /// - marketingversion: + /// - signed: + public init( + identifier: Swift.String, + buildid: Swift.String, + version: Swift.String, + url: Swift.String, + filesize: Swift.Double, + prerequisitebuildid: Swift.String, + prerequisiteversion: Swift.String, + releasetype: Swift.String, + uploaddate: Foundation.Date, + releasedate: Foundation.Date, + marketingversion: OpenAPIRuntime.OpenAPIValueContainer? = nil, + signed: Swift.Bool + ) { + self.identifier = identifier + self.buildid = buildid + self.version = version + self.url = url + self.filesize = filesize + self.prerequisitebuildid = prerequisitebuildid + self.prerequisiteversion = prerequisiteversion + self.releasetype = releasetype + self.uploaddate = uploaddate + self.releasedate = releasedate + self.marketingversion = marketingversion + self.signed = signed + } + + public enum CodingKeys: String, CodingKey { + case identifier + case buildid + case version + case url + case filesize + case prerequisitebuildid + case prerequisiteversion + case releasetype + case uploaddate + case releasedate + case marketingversion + case signed + } + } + + /// - Remark: Generated from `#/components/schemas/Model`. + public struct Model: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/Model/identifier`. + public var identifier: Swift.String? + /// Creates a new `Model`. + /// + /// - Parameters: + /// - identifier: + public init(identifier: Swift.String? = nil) { + self.identifier = identifier + } + + public enum CodingKeys: String, CodingKey { + case identifier + } + } + /// - Remark: Generated from `#/components/schemas/Key`. public struct Key: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/Key/image`. @@ -400,7 +589,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/Key/iv`. public var iv: Swift.String /// - Remark: Generated from `#/components/schemas/Key/date`. - public var date: Swift.String + public var date: Foundation.Date /// Creates a new `Key`. /// /// - Parameters: @@ -416,7 +605,7 @@ public enum Components { kbag: Swift.String, key: Swift.String, iv: Swift.String, - date: Swift.String + date: Foundation.Date ) { self.image = image self.filename = filename @@ -3331,30 +3520,13 @@ public enum Operations { 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) + case json(Components.Schemas.Model) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.identifierForModel.Output.Ok.Body.jsonPayload { + public var json: Components.Schemas.Model { get throws { switch self { case let .json(body): @@ -3756,38 +3928,13 @@ public enum Operations { 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) + case json(Components.Schemas.NotFoundDetails) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.otaDocumentationForDeviceAndVersion.Output.NotFound.Body.jsonPayload { + public var json: Components.Schemas.NotFoundDetails { get throws { switch self { case let .json(body): @@ -4190,98 +4337,13 @@ public enum Operations { 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) + case json(Components.Schemas.OTA) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.otaInformationForIdentifierAndBuild.Output.Ok.Body.jsonPayload { + public var json: Components.Schemas.OTA { get throws { switch self { case let .json(body): @@ -4514,100 +4576,13 @@ public enum Operations { 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) + 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: Operations.otasForVersion.Output.Ok.Body.jsonPayload { + public var json: [OpenAPIRuntime.OpenAPIValueContainer] { get throws { switch self { case let .json(body): @@ -4882,79 +4857,13 @@ public enum Operations { 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) + 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: Operations.releases.Output.Ok.Body.jsonPayload { + public var json: [OpenAPIRuntime.OpenAPIValueContainer] { get throws { switch self { case let .json(body): diff --git a/Sources/IPSWDownloads/openapi.yaml b/Sources/IPSWDownloads/openapi.yaml index 9c740b1..ede394d 100644 --- a/Sources/IPSWDownloads/openapi.yaml +++ b/Sources/IPSWDownloads/openapi.yaml @@ -4439,10 +4439,7 @@ paths: content: application/json: schema: - type: object - properties: - identifier: - type: string + $ref: '#/components/schemas/Model' examples: example1: value: @@ -4577,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 @@ -4681,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 @@ -4833,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: @@ -5390,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: @@ -5651,6 +5558,91 @@ paths: components: schemas: + NotFoundDetails: + type: object + properties: + status: + type: number + 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: number + 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: number + 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: