Skip to content

Commit

Permalink
Merge pull request #276 from AvdLee/feature/updates-app-store-connect…
Browse files Browse the repository at this point in the history
…-api

Updates App Store Connect API spec to 3.5
  • Loading branch information
AvdLee authored Jun 17, 2024
2 parents bd4d549 + 248988b commit 76c3049
Show file tree
Hide file tree
Showing 394 changed files with 5,208 additions and 14,004 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
import Foundation

public struct AgeRatingDeclarationWithoutIncludesResponse: Codable {
/// AppStoreVersion
public var data: AppStoreVersion
/// AgeRatingDeclaration
public var data: AgeRatingDeclaration
public var links: DocumentLinks

public init(data: AppStoreVersion, links: DocumentLinks) {
public init(data: AgeRatingDeclaration, links: DocumentLinks) {
self.data = data
self.links = links
}

public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.data = try values.decode(AppStoreVersion.self, forKey: "data")
self.data = try values.decode(AgeRatingDeclaration.self, forKey: "data")
self.links = try values.decode(DocumentLinks.self, forKey: "links")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public struct AlternativeDistributionKeyCreateRequest: Codable {
public struct Data: Codable {
public var type: `Type`
public var attributes: Attributes
public var relationships: Relationships
public var relationships: Relationships?

public enum `Type`: String, Codable, CaseIterable {
case alternativeDistributionKeys
Expand All @@ -34,10 +34,10 @@ public struct AlternativeDistributionKeyCreateRequest: Codable {
}

public struct Relationships: Codable {
public var app: App
public var app: App?

public struct App: Codable {
public var data: Data
public var data: Data?

public struct Data: Codable, Identifiable {
public var type: `Type`
Expand Down Expand Up @@ -65,37 +65,37 @@ public struct AlternativeDistributionKeyCreateRequest: Codable {
}
}

public init(data: Data) {
public init(data: Data? = nil) {
self.data = data
}

public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.data = try values.decode(Data.self, forKey: "data")
self.data = try values.decodeIfPresent(Data.self, forKey: "data")
}

public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encode(data, forKey: "data")
try values.encodeIfPresent(data, forKey: "data")
}
}

public init(app: App) {
public init(app: App? = nil) {
self.app = app
}

public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.app = try values.decode(App.self, forKey: "app")
self.app = try values.decodeIfPresent(App.self, forKey: "app")
}

public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encode(app, forKey: "app")
try values.encodeIfPresent(app, forKey: "app")
}
}

public init(type: `Type`, attributes: Attributes, relationships: Relationships) {
public init(type: `Type`, attributes: Attributes, relationships: Relationships? = nil) {
self.type = type
self.attributes = attributes
self.relationships = relationships
Expand All @@ -105,14 +105,14 @@ public struct AlternativeDistributionKeyCreateRequest: Codable {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.type = try values.decode(`Type`.self, forKey: "type")
self.attributes = try values.decode(Attributes.self, forKey: "attributes")
self.relationships = try values.decode(Relationships.self, forKey: "relationships")
self.relationships = try values.decodeIfPresent(Relationships.self, forKey: "relationships")
}

public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encode(type, forKey: "type")
try values.encode(attributes, forKey: "attributes")
try values.encode(relationships, forKey: "relationships")
try values.encodeIfPresent(relationships, forKey: "relationships")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,27 @@

import Foundation

@available(*, deprecated, message: "Deprecated")
public struct AppPriceTiersResponse: Codable {
public var data: [AppPriceTier]
public var included: [AppPricePoint]?
public struct AlternativeDistributionKeysResponse: Codable {
public var data: [AlternativeDistributionKey]
public var links: PagedDocumentLinks
public var meta: PagingInformation?

public init(data: [AppPriceTier], included: [AppPricePoint]? = nil, links: PagedDocumentLinks, meta: PagingInformation? = nil) {
public init(data: [AlternativeDistributionKey], links: PagedDocumentLinks, meta: PagingInformation? = nil) {
self.data = data
self.included = included
self.links = links
self.meta = meta
}

public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.data = try values.decode([AppPriceTier].self, forKey: "data")
self.included = try values.decodeIfPresent([AppPricePoint].self, forKey: "included")
self.data = try values.decode([AlternativeDistributionKey].self, forKey: "data")
self.links = try values.decode(PagedDocumentLinks.self, forKey: "links")
self.meta = try values.decodeIfPresent(PagingInformation.self, forKey: "meta")
}

public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encode(data, forKey: "data")
try values.encodeIfPresent(included, forKey: "included")
try values.encode(links, forKey: "links")
try values.encodeIfPresent(meta, forKey: "meta")
}
Expand Down
169 changes: 2 additions & 167 deletions Sources/OpenAPI/Generated/Entities/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@ public struct App: Codable, Identifiable {
public var subscriptionStatusURLVersion: SubscriptionStatusURLVersion?
public var subscriptionStatusURLForSandbox: URL?
public var subscriptionStatusURLVersionForSandbox: SubscriptionStatusURLVersion?
/// - warning: Deprecated.
public var isAvailableInNewTerritories: Bool?
public var contentRightsDeclaration: ContentRightsDeclaration?

public enum ContentRightsDeclaration: String, Codable, CaseIterable {
case doesNotUseThirdPartyContent = "DOES_NOT_USE_THIRD_PARTY_CONTENT"
case usesThirdPartyContent = "USES_THIRD_PARTY_CONTENT"
}

public init(name: String? = nil, bundleID: String? = nil, sku: String? = nil, primaryLocale: String? = nil, isOrEverWasMadeForKids: Bool? = nil, subscriptionStatusURL: URL? = nil, subscriptionStatusURLVersion: SubscriptionStatusURLVersion? = nil, subscriptionStatusURLForSandbox: URL? = nil, subscriptionStatusURLVersionForSandbox: SubscriptionStatusURLVersion? = nil, isAvailableInNewTerritories: Bool? = nil, contentRightsDeclaration: ContentRightsDeclaration? = nil) {
public init(name: String? = nil, bundleID: String? = nil, sku: String? = nil, primaryLocale: String? = nil, isOrEverWasMadeForKids: Bool? = nil, subscriptionStatusURL: URL? = nil, subscriptionStatusURLVersion: SubscriptionStatusURLVersion? = nil, subscriptionStatusURLForSandbox: URL? = nil, subscriptionStatusURLVersionForSandbox: SubscriptionStatusURLVersion? = nil, contentRightsDeclaration: ContentRightsDeclaration? = nil) {
self.name = name
self.bundleID = bundleID
self.sku = sku
Expand All @@ -43,7 +41,6 @@ public struct App: Codable, Identifiable {
self.subscriptionStatusURLVersion = subscriptionStatusURLVersion
self.subscriptionStatusURLForSandbox = subscriptionStatusURLForSandbox
self.subscriptionStatusURLVersionForSandbox = subscriptionStatusURLVersionForSandbox
self.isAvailableInNewTerritories = isAvailableInNewTerritories
self.contentRightsDeclaration = contentRightsDeclaration
}

Expand All @@ -58,7 +55,6 @@ public struct App: Codable, Identifiable {
self.subscriptionStatusURLVersion = try values.decodeIfPresent(SubscriptionStatusURLVersion.self, forKey: "subscriptionStatusUrlVersion")
self.subscriptionStatusURLForSandbox = try values.decodeIfPresent(URL.self, forKey: "subscriptionStatusUrlForSandbox")
self.subscriptionStatusURLVersionForSandbox = try values.decodeIfPresent(SubscriptionStatusURLVersion.self, forKey: "subscriptionStatusUrlVersionForSandbox")
self.isAvailableInNewTerritories = try values.decodeIfPresent(Bool.self, forKey: "availableInNewTerritories")
self.contentRightsDeclaration = try values.decodeIfPresent(ContentRightsDeclaration.self, forKey: "contentRightsDeclaration")
}

Expand All @@ -73,7 +69,6 @@ public struct App: Codable, Identifiable {
try values.encodeIfPresent(subscriptionStatusURLVersion, forKey: "subscriptionStatusUrlVersion")
try values.encodeIfPresent(subscriptionStatusURLForSandbox, forKey: "subscriptionStatusUrlForSandbox")
try values.encodeIfPresent(subscriptionStatusURLVersionForSandbox, forKey: "subscriptionStatusUrlVersionForSandbox")
try values.encodeIfPresent(isAvailableInNewTerritories, forKey: "availableInNewTerritories")
try values.encodeIfPresent(contentRightsDeclaration, forKey: "contentRightsDeclaration")
}
}
Expand All @@ -93,10 +88,6 @@ public struct App: Codable, Identifiable {
public var endUserLicenseAgreement: EndUserLicenseAgreement?
public var preOrder: PreOrder?
/// - warning: Deprecated.
public var prices: Prices?
/// - warning: Deprecated.
public var availableTerritories: AvailableTerritories?
/// - warning: Deprecated.
public var inAppPurchases: InAppPurchases?
public var subscriptionGroups: SubscriptionGroups?
public var gameCenterEnabledVersions: GameCenterEnabledVersions?
Expand Down Expand Up @@ -1051,156 +1042,6 @@ public struct App: Codable, Identifiable {
}
}

@available(*, deprecated, message: "Deprecated")
public struct Prices: Codable {
public var links: Links?
public var meta: PagingInformation?
public var data: [Datum]?

public struct Links: Codable {
public var this: String?
public var related: String?

public init(this: String? = nil, related: String? = nil) {
self.this = this
self.related = related
}

public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.this = try values.decodeIfPresent(String.self, forKey: "self")
self.related = try values.decodeIfPresent(String.self, forKey: "related")
}

public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(this, forKey: "self")
try values.encodeIfPresent(related, forKey: "related")
}
}

public struct Datum: Codable, Identifiable {
public var type: `Type`
public var id: String

public enum `Type`: String, Codable, CaseIterable {
case appPrices
}

public init(type: `Type`, id: String) {
self.type = type
self.id = id
}

public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.type = try values.decode(`Type`.self, forKey: "type")
self.id = try values.decode(String.self, forKey: "id")
}

public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encode(type, forKey: "type")
try values.encode(id, forKey: "id")
}
}

public init(links: Links? = nil, meta: PagingInformation? = nil, data: [Datum]? = nil) {
self.links = links
self.meta = meta
self.data = data
}

public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.links = try values.decodeIfPresent(Links.self, forKey: "links")
self.meta = try values.decodeIfPresent(PagingInformation.self, forKey: "meta")
self.data = try values.decodeIfPresent([Datum].self, forKey: "data")
}

public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(links, forKey: "links")
try values.encodeIfPresent(meta, forKey: "meta")
try values.encodeIfPresent(data, forKey: "data")
}
}

@available(*, deprecated, message: "Deprecated")
public struct AvailableTerritories: Codable {
public var links: Links?
public var meta: PagingInformation?
public var data: [Datum]?

public struct Links: Codable {
public var this: String?
public var related: String?

public init(this: String? = nil, related: String? = nil) {
self.this = this
self.related = related
}

public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.this = try values.decodeIfPresent(String.self, forKey: "self")
self.related = try values.decodeIfPresent(String.self, forKey: "related")
}

public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(this, forKey: "self")
try values.encodeIfPresent(related, forKey: "related")
}
}

public struct Datum: Codable, Identifiable {
public var type: `Type`
public var id: String

public enum `Type`: String, Codable, CaseIterable {
case territories
}

public init(type: `Type`, id: String) {
self.type = type
self.id = id
}

public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.type = try values.decode(`Type`.self, forKey: "type")
self.id = try values.decode(String.self, forKey: "id")
}

public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encode(type, forKey: "type")
try values.encode(id, forKey: "id")
}
}

public init(links: Links? = nil, meta: PagingInformation? = nil, data: [Datum]? = nil) {
self.links = links
self.meta = meta
self.data = data
}

public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.links = try values.decodeIfPresent(Links.self, forKey: "links")
self.meta = try values.decodeIfPresent(PagingInformation.self, forKey: "meta")
self.data = try values.decodeIfPresent([Datum].self, forKey: "data")
}

public func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: StringCodingKey.self)
try values.encodeIfPresent(links, forKey: "links")
try values.encodeIfPresent(meta, forKey: "meta")
try values.encodeIfPresent(data, forKey: "data")
}
}

@available(*, deprecated, message: "Deprecated")
public struct InAppPurchases: Codable {
public var links: Links?
Expand Down Expand Up @@ -2008,7 +1849,7 @@ public struct App: Codable, Identifiable {
}
}

public init(appEncryptionDeclarations: AppEncryptionDeclarations? = nil, ciProduct: CiProduct? = nil, betaGroups: BetaGroups? = nil, appStoreVersions: AppStoreVersions? = nil, preReleaseVersions: PreReleaseVersions? = nil, betaAppLocalizations: BetaAppLocalizations? = nil, builds: Builds? = nil, betaLicenseAgreement: BetaLicenseAgreement? = nil, betaAppReviewDetail: BetaAppReviewDetail? = nil, appInfos: AppInfos? = nil, appClips: AppClips? = nil, endUserLicenseAgreement: EndUserLicenseAgreement? = nil, preOrder: PreOrder? = nil, prices: Prices? = nil, availableTerritories: AvailableTerritories? = nil, inAppPurchases: InAppPurchases? = nil, subscriptionGroups: SubscriptionGroups? = nil, gameCenterEnabledVersions: GameCenterEnabledVersions? = nil, appCustomProductPages: AppCustomProductPages? = nil, inAppPurchasesV2: InAppPurchasesV2? = nil, promotedPurchases: PromotedPurchases? = nil, appEvents: AppEvents? = nil, reviewSubmissions: ReviewSubmissions? = nil, subscriptionGracePeriod: SubscriptionGracePeriod? = nil, gameCenterDetail: GameCenterDetail? = nil, appStoreVersionExperimentsV2: AppStoreVersionExperimentsV2? = nil) {
public init(appEncryptionDeclarations: AppEncryptionDeclarations? = nil, ciProduct: CiProduct? = nil, betaGroups: BetaGroups? = nil, appStoreVersions: AppStoreVersions? = nil, preReleaseVersions: PreReleaseVersions? = nil, betaAppLocalizations: BetaAppLocalizations? = nil, builds: Builds? = nil, betaLicenseAgreement: BetaLicenseAgreement? = nil, betaAppReviewDetail: BetaAppReviewDetail? = nil, appInfos: AppInfos? = nil, appClips: AppClips? = nil, endUserLicenseAgreement: EndUserLicenseAgreement? = nil, preOrder: PreOrder? = nil, inAppPurchases: InAppPurchases? = nil, subscriptionGroups: SubscriptionGroups? = nil, gameCenterEnabledVersions: GameCenterEnabledVersions? = nil, appCustomProductPages: AppCustomProductPages? = nil, inAppPurchasesV2: InAppPurchasesV2? = nil, promotedPurchases: PromotedPurchases? = nil, appEvents: AppEvents? = nil, reviewSubmissions: ReviewSubmissions? = nil, subscriptionGracePeriod: SubscriptionGracePeriod? = nil, gameCenterDetail: GameCenterDetail? = nil, appStoreVersionExperimentsV2: AppStoreVersionExperimentsV2? = nil) {
self.appEncryptionDeclarations = appEncryptionDeclarations
self.ciProduct = ciProduct
self.betaGroups = betaGroups
Expand All @@ -2022,8 +1863,6 @@ public struct App: Codable, Identifiable {
self.appClips = appClips
self.endUserLicenseAgreement = endUserLicenseAgreement
self.preOrder = preOrder
self.prices = prices
self.availableTerritories = availableTerritories
self.inAppPurchases = inAppPurchases
self.subscriptionGroups = subscriptionGroups
self.gameCenterEnabledVersions = gameCenterEnabledVersions
Expand Down Expand Up @@ -2052,8 +1891,6 @@ public struct App: Codable, Identifiable {
self.appClips = try values.decodeIfPresent(AppClips.self, forKey: "appClips")
self.endUserLicenseAgreement = try values.decodeIfPresent(EndUserLicenseAgreement.self, forKey: "endUserLicenseAgreement")
self.preOrder = try values.decodeIfPresent(PreOrder.self, forKey: "preOrder")
self.prices = try values.decodeIfPresent(Prices.self, forKey: "prices")
self.availableTerritories = try values.decodeIfPresent(AvailableTerritories.self, forKey: "availableTerritories")
self.inAppPurchases = try values.decodeIfPresent(InAppPurchases.self, forKey: "inAppPurchases")
self.subscriptionGroups = try values.decodeIfPresent(SubscriptionGroups.self, forKey: "subscriptionGroups")
self.gameCenterEnabledVersions = try values.decodeIfPresent(GameCenterEnabledVersions.self, forKey: "gameCenterEnabledVersions")
Expand Down Expand Up @@ -2082,8 +1919,6 @@ public struct App: Codable, Identifiable {
try values.encodeIfPresent(appClips, forKey: "appClips")
try values.encodeIfPresent(endUserLicenseAgreement, forKey: "endUserLicenseAgreement")
try values.encodeIfPresent(preOrder, forKey: "preOrder")
try values.encodeIfPresent(prices, forKey: "prices")
try values.encodeIfPresent(availableTerritories, forKey: "availableTerritories")
try values.encodeIfPresent(inAppPurchases, forKey: "inAppPurchases")
try values.encodeIfPresent(subscriptionGroups, forKey: "subscriptionGroups")
try values.encodeIfPresent(gameCenterEnabledVersions, forKey: "gameCenterEnabledVersions")
Expand Down
Loading

0 comments on commit 76c3049

Please sign in to comment.