Skip to content

Commit

Permalink
Update App Store Connect API spec to 3.7 (#292)
Browse files Browse the repository at this point in the history
* Updates ASC API spec to latest version

* Removes patches for version 3.7.2

* Re-generates code after removing patches
  • Loading branch information
polpielladev authored Nov 13, 2024
1 parent 000c0a9 commit 11b2fdf
Show file tree
Hide file tree
Showing 250 changed files with 1,383 additions and 4,600 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ update: download generate
# see https://github.com/AvdLee/appstoreconnect-swift-sdk/pull/197
.PHONY: download
download:
curl -fsSL -o - https://developer.apple.com/sample-code/app-store-connect/app-store-connect-openapi-specification.zip | bsdtar -xOf - | jq '.components.schemas.BundleIdPlatform.enum |= [ "IOS", "MAC_OS", "UNIVERSAL", "SERVICES" ] | .paths."/v1/certificates".get.parameters = (.paths."/v1/certificates".get.parameters | map(if .name == "filter[certificateType]" then .schema.items.enum += ["DEVELOPER_ID_APPLICATION_G2"] else . end)) | .components.schemas.CertificateType.enum += ["DEVELOPER_ID_APPLICATION_G2"] | del(.["x-important"]) | del(.. |."enum"? | select(. != null and length == 0))' > Sources/OpenAPI/app_store_connect_api.json
curl -fsSL -o - https://developer.apple.com/sample-code/app-store-connect/app-store-connect-openapi-specification.zip | bsdtar -xOf - | jq '.components.schemas.BundleIdPlatform.enum |= [ "IOS", "MAC_OS", "UNIVERSAL", "SERVICES" ] | del(.["x-important"]) | del(.. |."enum"? | select(. != null and length == 0))' > Sources/OpenAPI/app_store_connect_api.json

# Runs the CreateAPI generator to update generated source code
.PHONY: generate
Expand Down
76 changes: 1 addition & 75 deletions Sources/OpenAPI/Generated/Entities/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ public struct App: Codable, Identifiable {
public var appClips: AppClips?
public var appPricePoints: AppPricePoints?
public var endUserLicenseAgreement: EndUserLicenseAgreement?
public var preOrder: PreOrder?
public var appPriceSchedule: AppPriceSchedule?
public var appAvailability: AppAvailability?
public var appAvailabilityV2: AppAvailabilityV2?
/// - warning: Deprecated.
public var inAppPurchases: InAppPurchases?
Expand Down Expand Up @@ -758,54 +756,6 @@ public struct App: Codable, Identifiable {
}
}

public struct PreOrder: Codable {
public var links: RelationshipLinks?
public var data: Data?

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

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

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: RelationshipLinks? = nil, data: Data? = nil) {
self.links = links
self.data = data
}

public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: StringCodingKey.self)
self.links = try values.decodeIfPresent(RelationshipLinks.self, forKey: "links")
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.encodeIfPresent(links, forKey: "links")
try values.encodeIfPresent(data, forKey: "data")
}
}

public struct AppPriceSchedule: Codable {
public var links: RelationshipLinks?

Expand All @@ -824,24 +774,6 @@ public struct App: Codable, Identifiable {
}
}

public struct AppAvailability: Codable {
public var links: RelationshipLinks?

public init(links: RelationshipLinks? = nil) {
self.links = links
}

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

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

public struct AppAvailabilityV2: Codable {
public var links: RelationshipLinks?

Expand Down Expand Up @@ -1515,7 +1447,7 @@ public struct App: Codable, Identifiable {
}
}

public init(appEncryptionDeclarations: AppEncryptionDeclarations? = nil, ciProduct: CiProduct? = nil, betaTesters: BetaTesters? = 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, appPricePoints: AppPricePoints? = nil, endUserLicenseAgreement: EndUserLicenseAgreement? = nil, preOrder: PreOrder? = nil, appPriceSchedule: AppPriceSchedule? = nil, appAvailability: AppAvailability? = nil, appAvailabilityV2: AppAvailabilityV2? = nil, inAppPurchases: InAppPurchases? = nil, subscriptionGroups: SubscriptionGroups? = nil, gameCenterEnabledVersions: GameCenterEnabledVersions? = nil, perfPowerMetrics: PerfPowerMetrics? = nil, appCustomProductPages: AppCustomProductPages? = nil, inAppPurchasesV2: InAppPurchasesV2? = nil, promotedPurchases: PromotedPurchases? = nil, appEvents: AppEvents? = nil, reviewSubmissions: ReviewSubmissions? = nil, subscriptionGracePeriod: SubscriptionGracePeriod? = nil, customerReviews: CustomerReviews? = nil, gameCenterDetail: GameCenterDetail? = nil, appStoreVersionExperimentsV2: AppStoreVersionExperimentsV2? = nil, alternativeDistributionKey: AlternativeDistributionKey? = nil, analyticsReportRequests: AnalyticsReportRequests? = nil, marketplaceSearchDetail: MarketplaceSearchDetail? = nil) {
public init(appEncryptionDeclarations: AppEncryptionDeclarations? = nil, ciProduct: CiProduct? = nil, betaTesters: BetaTesters? = 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, appPricePoints: AppPricePoints? = nil, endUserLicenseAgreement: EndUserLicenseAgreement? = nil, appPriceSchedule: AppPriceSchedule? = nil, appAvailabilityV2: AppAvailabilityV2? = nil, inAppPurchases: InAppPurchases? = nil, subscriptionGroups: SubscriptionGroups? = nil, gameCenterEnabledVersions: GameCenterEnabledVersions? = nil, perfPowerMetrics: PerfPowerMetrics? = nil, appCustomProductPages: AppCustomProductPages? = nil, inAppPurchasesV2: InAppPurchasesV2? = nil, promotedPurchases: PromotedPurchases? = nil, appEvents: AppEvents? = nil, reviewSubmissions: ReviewSubmissions? = nil, subscriptionGracePeriod: SubscriptionGracePeriod? = nil, customerReviews: CustomerReviews? = nil, gameCenterDetail: GameCenterDetail? = nil, appStoreVersionExperimentsV2: AppStoreVersionExperimentsV2? = nil, alternativeDistributionKey: AlternativeDistributionKey? = nil, analyticsReportRequests: AnalyticsReportRequests? = nil, marketplaceSearchDetail: MarketplaceSearchDetail? = nil) {
self.appEncryptionDeclarations = appEncryptionDeclarations
self.ciProduct = ciProduct
self.betaTesters = betaTesters
Expand All @@ -1530,9 +1462,7 @@ public struct App: Codable, Identifiable {
self.appClips = appClips
self.appPricePoints = appPricePoints
self.endUserLicenseAgreement = endUserLicenseAgreement
self.preOrder = preOrder
self.appPriceSchedule = appPriceSchedule
self.appAvailability = appAvailability
self.appAvailabilityV2 = appAvailabilityV2
self.inAppPurchases = inAppPurchases
self.subscriptionGroups = subscriptionGroups
Expand Down Expand Up @@ -1568,9 +1498,7 @@ public struct App: Codable, Identifiable {
self.appClips = try values.decodeIfPresent(AppClips.self, forKey: "appClips")
self.appPricePoints = try values.decodeIfPresent(AppPricePoints.self, forKey: "appPricePoints")
self.endUserLicenseAgreement = try values.decodeIfPresent(EndUserLicenseAgreement.self, forKey: "endUserLicenseAgreement")
self.preOrder = try values.decodeIfPresent(PreOrder.self, forKey: "preOrder")
self.appPriceSchedule = try values.decodeIfPresent(AppPriceSchedule.self, forKey: "appPriceSchedule")
self.appAvailability = try values.decodeIfPresent(AppAvailability.self, forKey: "appAvailability")
self.appAvailabilityV2 = try values.decodeIfPresent(AppAvailabilityV2.self, forKey: "appAvailabilityV2")
self.inAppPurchases = try values.decodeIfPresent(InAppPurchases.self, forKey: "inAppPurchases")
self.subscriptionGroups = try values.decodeIfPresent(SubscriptionGroups.self, forKey: "subscriptionGroups")
Expand Down Expand Up @@ -1606,9 +1534,7 @@ public struct App: Codable, Identifiable {
try values.encodeIfPresent(appClips, forKey: "appClips")
try values.encodeIfPresent(appPricePoints, forKey: "appPricePoints")
try values.encodeIfPresent(endUserLicenseAgreement, forKey: "endUserLicenseAgreement")
try values.encodeIfPresent(preOrder, forKey: "preOrder")
try values.encodeIfPresent(appPriceSchedule, forKey: "appPriceSchedule")
try values.encodeIfPresent(appAvailability, forKey: "appAvailability")
try values.encodeIfPresent(appAvailabilityV2, forKey: "appAvailabilityV2")
try values.encodeIfPresent(inAppPurchases, forKey: "inAppPurchases")
try values.encodeIfPresent(subscriptionGroups, forKey: "subscriptionGroups")
Expand Down
179 changes: 0 additions & 179 deletions Sources/OpenAPI/Generated/Entities/AppAvailability.swift

This file was deleted.

Loading

0 comments on commit 11b2fdf

Please sign in to comment.