diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/Namespace.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/Namespace.swift index ab8fab00..9ac61b82 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/Namespace.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/Namespace.swift @@ -1628,6 +1628,24 @@ public enum V1 { public enum InAppPurchaseSubmissions {} + public enum InAppPurchaseVersions { + public enum ById { + public enum Image {} + + public enum Images {} + + public enum Localizations {} + + public enum Relationships { + public enum Image {} + + public enum Images {} + + public enum Localizations {} + } + } + } + public enum InAppPurchases { public enum ById {} } @@ -1776,17 +1794,31 @@ public enum V1 { public enum SubscriptionGroupSubmissions {} + public enum SubscriptionGroupVersions { + public enum ById { + public enum Localizations {} + + public enum Relationships { + public enum Localizations {} + } + } + } + public enum SubscriptionGroups { public enum ById { public enum Relationships { public enum SubscriptionGroupLocalizations {} public enum Subscriptions {} + + public enum Versions {} } public enum SubscriptionGroupLocalizations {} public enum Subscriptions {} + + public enum Versions {} } } @@ -1842,6 +1874,8 @@ public enum V1 { public enum SubscriptionPricePoints { public enum ById { + public enum AdjustedEqualizations {} + public enum Equalizations {} public enum Relationships { @@ -1866,6 +1900,24 @@ public enum V1 { public enum SubscriptionSubmissions {} + public enum SubscriptionVersions { + public enum ById { + public enum Image {} + + public enum Images {} + + public enum Localizations {} + + public enum Relationships { + public enum Image {} + + public enum Images {} + + public enum Localizations {} + } + } + } + public enum Subscriptions { public enum ById { public enum AppStoreReviewScreenshot {} @@ -1909,6 +1961,8 @@ public enum V1 { public enum SubscriptionLocalizations {} + public enum Versions {} + public enum WinBackOffers {} } @@ -1916,6 +1970,8 @@ public enum V1 { public enum SubscriptionLocalizations {} + public enum Versions {} + public enum WinBackOffers {} } } @@ -2103,6 +2159,14 @@ public enum V2 { } } + public enum InAppPurchaseImages { + public enum ById {} + } + + public enum InAppPurchaseLocalizations { + public enum ById {} + } + public enum InAppPurchases { public enum ById { public enum AppStoreReviewScreenshot {} @@ -2141,7 +2205,11 @@ public enum V2 { public enum PricePoints {} public enum PromotedPurchase {} + + public enum Versions {} } + + public enum Versions {} } } @@ -2150,6 +2218,18 @@ public enum V2 { } public enum SandboxTestersClearPurchaseHistoryRequest {} + + public enum SubscriptionGroupLocalizations { + public enum ById {} + } + + public enum SubscriptionImages { + public enum ById {} + } + + public enum SubscriptionLocalizations { + public enum ById {} + } } public enum V3 { public enum AppPricePoints { diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfoLocalizations/ById/AppInfoLocalizationsById.GET.0b83534.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfoLocalizations/ById/AppInfoLocalizationsById.GET.0b83534.generated.swift index c397d8a5..9048bf2b 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfoLocalizations/ById/AppInfoLocalizationsById.GET.0b83534.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfoLocalizations/ById/AppInfoLocalizationsById.GET.0b83534.generated.swift @@ -174,6 +174,10 @@ extension V1.AppInfoLocalizations.ById.GET { .init(rawValue: "franceAgeRating") } + public static var kidsAgeBand: Self { + .init(rawValue: "kidsAgeBand") + } + public static var koreaAgeRating: Self { .init(rawValue: "koreaAgeRating") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfos/ById/AgeRatingDeclaration/AppInfosByIdAgeRatingDeclaration.GET.1dcaca2.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfos/ById/AgeRatingDeclaration/AppInfosByIdAgeRatingDeclaration.GET.1dcaca2.generated.swift index 500f7e6a..cd508764 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfos/ById/AgeRatingDeclaration/AppInfosByIdAgeRatingDeclaration.GET.1dcaca2.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfos/ById/AgeRatingDeclaration/AppInfosByIdAgeRatingDeclaration.GET.1dcaca2.generated.swift @@ -179,6 +179,14 @@ extension V1.AppInfos.ById.AgeRatingDeclaration.GET { .init(rawValue: "sexualContentOrNudity") } + public static var socialMedia: Self { + .init(rawValue: "socialMedia") + } + + public static var socialMediaAgeRestricted: Self { + .init(rawValue: "socialMediaAgeRestricted") + } + public static var unrestrictedWebAccess: Self { .init(rawValue: "unrestrictedWebAccess") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfos/ById/AppInfoLocalizations/AppInfosByIdAppInfoLocalizations.GET.3d8ecb5.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfos/ById/AppInfoLocalizations/AppInfosByIdAppInfoLocalizations.GET.3d8ecb5.generated.swift index cf732e1a..84137cb9 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfos/ById/AppInfoLocalizations/AppInfosByIdAppInfoLocalizations.GET.3d8ecb5.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfos/ById/AppInfoLocalizations/AppInfosByIdAppInfoLocalizations.GET.3d8ecb5.generated.swift @@ -183,6 +183,10 @@ extension V1.AppInfos.ById.AppInfoLocalizations.GET { .init(rawValue: "franceAgeRating") } + public static var kidsAgeBand: Self { + .init(rawValue: "kidsAgeBand") + } + public static var koreaAgeRating: Self { .init(rawValue: "koreaAgeRating") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfos/ById/AppInfosById.GET.f5390de.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfos/ById/AppInfosById.GET.f5390de.generated.swift index 49eb1a67..f1ce09cf 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfos/ById/AppInfosById.GET.f5390de.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/AppInfos/ById/AppInfosById.GET.f5390de.generated.swift @@ -196,6 +196,14 @@ extension V1.AppInfos.ById.GET { .init(rawValue: "sexualContentOrNudity") } + public static var socialMedia: Self { + .init(rawValue: "socialMedia") + } + + public static var socialMediaAgeRestricted: Self { + .init(rawValue: "socialMediaAgeRestricted") + } + public static var unrestrictedWebAccess: Self { .init(rawValue: "unrestrictedWebAccess") } @@ -328,6 +336,10 @@ extension V1.AppInfos.ById.GET { .init(rawValue: "franceAgeRating") } + public static var kidsAgeBand: Self { + .init(rawValue: "kidsAgeBand") + } + public static var koreaAgeRating: Self { .init(rawValue: "koreaAgeRating") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/Apps.GET.d3db1ee.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/Apps.GET.d3db1ee.generated.swift index 0d680f7f..6cb02b7e 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/Apps.GET.d3db1ee.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/Apps.GET.d3db1ee.generated.swift @@ -483,6 +483,10 @@ extension V1.Apps.GET { .init(rawValue: "franceAgeRating") } + public static var kidsAgeBand: Self { + .init(rawValue: "kidsAgeBand") + } + public static var koreaAgeRating: Self { .init(rawValue: "koreaAgeRating") } @@ -1539,6 +1543,10 @@ extension V1.Apps.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -1695,6 +1703,10 @@ extension V1.Apps.GET { .init(rawValue: "subscriptions") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/AppInfos/AppsByIdAppInfos.GET.dcf3ea6.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/AppInfos/AppsByIdAppInfos.GET.dcf3ea6.generated.swift index fbd436b1..6dfe17ad 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/AppInfos/AppsByIdAppInfos.GET.dcf3ea6.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/AppInfos/AppsByIdAppInfos.GET.dcf3ea6.generated.swift @@ -199,6 +199,14 @@ extension V1.Apps.ById.AppInfos.GET { .init(rawValue: "sexualContentOrNudity") } + public static var socialMedia: Self { + .init(rawValue: "socialMedia") + } + + public static var socialMediaAgeRestricted: Self { + .init(rawValue: "socialMediaAgeRestricted") + } + public static var unrestrictedWebAccess: Self { .init(rawValue: "unrestrictedWebAccess") } @@ -331,6 +339,10 @@ extension V1.Apps.ById.AppInfos.GET { .init(rawValue: "franceAgeRating") } + public static var kidsAgeBand: Self { + .init(rawValue: "kidsAgeBand") + } + public static var koreaAgeRating: Self { .init(rawValue: "koreaAgeRating") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/AppsById.GET.37ceec0.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/AppsById.GET.37ceec0.generated.swift index 2ca2c1ee..aa6354bc 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/AppsById.GET.37ceec0.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/AppsById.GET.37ceec0.generated.swift @@ -434,6 +434,10 @@ extension V1.Apps.ById.GET { .init(rawValue: "franceAgeRating") } + public static var kidsAgeBand: Self { + .init(rawValue: "kidsAgeBand") + } + public static var koreaAgeRating: Self { .init(rawValue: "koreaAgeRating") } @@ -1490,6 +1494,10 @@ extension V1.Apps.ById.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -1646,6 +1654,10 @@ extension V1.Apps.ById.GET { .init(rawValue: "subscriptions") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/InAppPurchasesV2/AppsByIdInAppPurchasesV2.GET.a47247f.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/InAppPurchasesV2/AppsByIdInAppPurchasesV2.GET.a47247f.generated.swift index c68887c8..30e8d24b 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/InAppPurchasesV2/AppsByIdInAppPurchasesV2.GET.a47247f.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/InAppPurchasesV2/AppsByIdInAppPurchasesV2.GET.a47247f.generated.swift @@ -42,6 +42,8 @@ extension V1.Apps.ById.InAppPurchasesV2 { value: parameters.fields[.inAppPurchaseOfferCodes]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[inAppPurchasePriceSchedules]", value: parameters.fields[.inAppPurchasePriceSchedules]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[inAppPurchaseVersions]", + value: parameters.fields[.inAppPurchaseVersions]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[inAppPurchases]", value: parameters.fields[.inAppPurchases]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[promotedPurchases]", @@ -62,6 +64,8 @@ extension V1.Apps.ById.InAppPurchasesV2 { value: parameters.limit[.inAppPurchaseLocalizations].map { "\($0)" }), URLQueryItem(name: "limit[offerCodes]", value: parameters.limit[.offerCodes].map { "\($0)" }), + URLQueryItem(name: "limit[versions]", + value: parameters.limit[.versions].map { "\($0)" }), URLQueryItem(name: "limit", value: parameters.limit[].map { "\($0)" }), URLQueryItem(name: "sort", @@ -381,6 +385,42 @@ extension V1.Apps.ById.InAppPurchasesV2.GET { } } + public struct InAppPurchaseVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var inAppPurchase: Self { + .init(rawValue: "inAppPurchase") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + public struct InAppPurchases: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { public static var appStoreReviewScreenshot: Self { .init(rawValue: "appStoreReviewScreenshot") @@ -446,6 +486,10 @@ extension V1.Apps.ById.InAppPurchasesV2.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -525,6 +569,11 @@ extension V1.Apps.ById.InAppPurchasesV2.GET { .init(key: "fields[inAppPurchasePriceSchedules]") } + /// the fields to include for returned resources of type inAppPurchaseVersions + public static var inAppPurchaseVersions: Relation<[InAppPurchaseVersions]?> { + .init(key: "fields[inAppPurchaseVersions]") + } + /// the fields to include for returned resources of type inAppPurchases public static var inAppPurchases: Relation<[InAppPurchases]?> { .init(key: "fields[inAppPurchases]") @@ -697,6 +746,10 @@ extension V1.Apps.ById.InAppPurchasesV2.GET { .init(rawValue: "promotedPurchase") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -737,6 +790,11 @@ extension V1.Apps.ById.InAppPurchasesV2.GET { .init(key: "limit[offerCodes]") } + /// maximum number of related versions returned (when they are included) + public static var versions: Relation { + .init(key: "limit[versions]") + } + internal let key: String public func hash(into hasher: inout Hasher) { diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/PromotedPurchases/AppsByIdPromotedPurchases.GET.62d9cf2.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/PromotedPurchases/AppsByIdPromotedPurchases.GET.62d9cf2.generated.swift index 01d7961d..b670b8ee 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/PromotedPurchases/AppsByIdPromotedPurchases.GET.62d9cf2.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/PromotedPurchases/AppsByIdPromotedPurchases.GET.62d9cf2.generated.swift @@ -169,6 +169,10 @@ extension V1.Apps.ById.PromotedPurchases.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -289,6 +293,10 @@ extension V1.Apps.ById.PromotedPurchases.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/ReviewSubmissions/AppsByIdReviewSubmissions.GET.7dc5c8b.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/ReviewSubmissions/AppsByIdReviewSubmissions.GET.7dc5c8b.generated.swift index 825d88f0..7ae224da 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/ReviewSubmissions/AppsByIdReviewSubmissions.GET.7dc5c8b.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/ReviewSubmissions/AppsByIdReviewSubmissions.GET.7dc5c8b.generated.swift @@ -533,10 +533,22 @@ extension V1.Apps.ById.ReviewSubmissions.GET { .init(rawValue: "gameCenterLeaderboardVersion") } + public static var inAppPurchaseVersion: Self { + .init(rawValue: "inAppPurchaseVersion") + } + public static var state: Self { .init(rawValue: "state") } + public static var subscriptionGroupVersion: Self { + .init(rawValue: "subscriptionGroupVersion") + } + + public static var subscriptionVersion: Self { + .init(rawValue: "subscriptionVersion") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/SubscriptionGroups/AppsByIdSubscriptionGroups.GET.3586939.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/SubscriptionGroups/AppsByIdSubscriptionGroups.GET.3586939.generated.swift index a8de9afc..9d9a5218 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/SubscriptionGroups/AppsByIdSubscriptionGroups.GET.3586939.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Apps/ById/SubscriptionGroups/AppsByIdSubscriptionGroups.GET.3586939.generated.swift @@ -30,6 +30,8 @@ extension V1.Apps.ById.SubscriptionGroups { components?.queryItems = [ URLQueryItem(name: "fields[subscriptionGroupLocalizations]", value: parameters.fields[.subscriptionGroupLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionGroupVersions]", + value: parameters.fields[.subscriptionGroupVersions]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[subscriptionGroups]", value: parameters.fields[.subscriptionGroups]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[subscriptions]", @@ -44,6 +46,8 @@ extension V1.Apps.ById.SubscriptionGroups { value: parameters.limit[.subscriptionGroupLocalizations].map { "\($0)" }), URLQueryItem(name: "limit[subscriptions]", value: parameters.limit[.subscriptions].map { "\($0)" }), + URLQueryItem(name: "limit[versions]", + value: parameters.limit[.versions].map { "\($0)" }), URLQueryItem(name: "limit", value: parameters.limit[].map { "\($0)" }), URLQueryItem(name: "sort", @@ -151,6 +155,34 @@ extension V1.Apps.ById.SubscriptionGroups.GET { } } + public struct SubscriptionGroupVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscriptionGroup: Self { + .init(rawValue: "subscriptionGroup") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + public struct SubscriptionGroups: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { public static var referenceName: Self { .init(rawValue: "referenceName") @@ -164,6 +196,10 @@ extension V1.Apps.ById.SubscriptionGroups.GET { .init(rawValue: "subscriptions") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -252,6 +288,10 @@ extension V1.Apps.ById.SubscriptionGroups.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } @@ -273,6 +313,11 @@ extension V1.Apps.ById.SubscriptionGroups.GET { .init(key: "fields[subscriptionGroupLocalizations]") } + /// the fields to include for returned resources of type subscriptionGroupVersions + public static var subscriptionGroupVersions: Relation<[SubscriptionGroupVersions]?> { + .init(key: "fields[subscriptionGroupVersions]") + } + /// the fields to include for returned resources of type subscriptionGroups public static var subscriptionGroups: Relation<[SubscriptionGroups]?> { .init(key: "fields[subscriptionGroups]") @@ -379,6 +424,10 @@ extension V1.Apps.ById.SubscriptionGroups.GET { .init(rawValue: "subscriptions") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -414,6 +463,11 @@ extension V1.Apps.ById.SubscriptionGroups.GET { .init(key: "limit[subscriptions]") } + /// maximum number of related versions returned (when they are included) + public static var versions: Relation { + .init(key: "limit[versions]") + } + internal let key: String public func hash(into hasher: inout Hasher) { diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/CiProducts/ById/App/CiProductsByIdApp.GET.a65f4ca.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/CiProducts/ById/App/CiProductsByIdApp.GET.a65f4ca.generated.swift index 62184647..c2fbf06f 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/CiProducts/ById/App/CiProductsByIdApp.GET.a65f4ca.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/CiProducts/ById/App/CiProductsByIdApp.GET.a65f4ca.generated.swift @@ -434,6 +434,10 @@ extension V1.CiProducts.ById.App.GET { .init(rawValue: "franceAgeRating") } + public static var kidsAgeBand: Self { + .init(rawValue: "kidsAgeBand") + } + public static var koreaAgeRating: Self { .init(rawValue: "koreaAgeRating") } @@ -1490,6 +1494,10 @@ extension V1.CiProducts.ById.App.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -1646,6 +1654,10 @@ extension V1.CiProducts.ById.App.GET { .init(rawValue: "subscriptions") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseAppStoreReviewScreenshots/ById/InAppPurchaseAppStoreReviewScreenshotsById.GET.66cbd18.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseAppStoreReviewScreenshots/ById/InAppPurchaseAppStoreReviewScreenshotsById.GET.66cbd18.generated.swift index c1b84dc6..952a2fa3 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseAppStoreReviewScreenshots/ById/InAppPurchaseAppStoreReviewScreenshotsById.GET.66cbd18.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseAppStoreReviewScreenshots/ById/InAppPurchaseAppStoreReviewScreenshotsById.GET.66cbd18.generated.swift @@ -210,6 +210,10 @@ extension V1.InAppPurchaseAppStoreReviewScreenshots.ById.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseContents/ById/InAppPurchaseContentsById.GET.b1b4b4b.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseContents/ById/InAppPurchaseContentsById.GET.b1b4b4b.generated.swift index ae37c581..0c1ab665 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseContents/ById/InAppPurchaseContentsById.GET.b1b4b4b.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseContents/ById/InAppPurchaseContentsById.GET.b1b4b4b.generated.swift @@ -194,6 +194,10 @@ extension V1.InAppPurchaseContents.ById.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseImages/ById/InAppPurchaseImagesById.GET.9dc78df.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseImages/ById/InAppPurchaseImagesById.GET.9dc78df.generated.swift index 41141666..abc85abf 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseImages/ById/InAppPurchaseImagesById.GET.9dc78df.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseImages/ById/InAppPurchaseImagesById.GET.9dc78df.generated.swift @@ -206,6 +206,10 @@ extension V1.InAppPurchaseImages.ById.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.GET.36e69d9.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.GET.36e69d9.generated.swift index 014a77fe..6503d1e6 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.GET.36e69d9.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.GET.36e69d9.generated.swift @@ -194,6 +194,10 @@ extension V1.InAppPurchaseLocalizations.ById.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Image/InAppPurchaseVersionsByIdImage.GET.873ee78.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Image/InAppPurchaseVersionsByIdImage.GET.873ee78.generated.swift new file mode 100644 index 00000000..a37c9f82 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Image/InAppPurchaseVersionsByIdImage.GET.873ee78.generated.swift @@ -0,0 +1,145 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.InAppPurchaseVersions.ById.Image { + public struct GET: Endpoint { + public typealias Response = InAppPurchaseImageV2Response + + public var path: String { + "/v1/inAppPurchaseVersions/\(id)/image" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[inAppPurchaseImages]", + value: parameters.fields[.inAppPurchaseImages]?.map { "\($0)" }.joined(separator: ",")) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, Single InAppPurchaseImage as `InAppPurchaseImageV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseImageV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.InAppPurchaseVersions.ById.Image.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct InAppPurchaseImages: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var assetDeliveryState: Self { + .init(rawValue: "assetDeliveryState") + } + + public static var assetToken: Self { + .init(rawValue: "assetToken") + } + + public static var fileName: Self { + .init(rawValue: "fileName") + } + + public static var fileSize: Self { + .init(rawValue: "fileSize") + } + + public static var imageAsset: Self { + .init(rawValue: "imageAsset") + } + + public static var uploadOperations: Self { + .init(rawValue: "uploadOperations") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type inAppPurchaseImages + public static var inAppPurchaseImages: Relation<[InAppPurchaseImages]?> { + .init(key: "fields[inAppPurchaseImages]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Images/InAppPurchaseVersionsByIdImages.GET.afb5434.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Images/InAppPurchaseVersionsByIdImages.GET.afb5434.generated.swift new file mode 100644 index 00000000..8a7a5710 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Images/InAppPurchaseVersionsByIdImages.GET.afb5434.generated.swift @@ -0,0 +1,150 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.InAppPurchaseVersions.ById.Images { + public struct GET: Endpoint { + public typealias Response = InAppPurchaseImagesV2Response + + public var path: String { + "/v1/inAppPurchaseVersions/\(id)/images" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[inAppPurchaseImages]", + value: parameters.fields[.inAppPurchaseImages]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of InAppPurchaseImages as `InAppPurchaseImagesV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseImagesV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.InAppPurchaseVersions.ById.Images.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + /// maximum resources per page + public var limit: Int? + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct InAppPurchaseImages: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var assetDeliveryState: Self { + .init(rawValue: "assetDeliveryState") + } + + public static var assetToken: Self { + .init(rawValue: "assetToken") + } + + public static var fileName: Self { + .init(rawValue: "fileName") + } + + public static var fileSize: Self { + .init(rawValue: "fileSize") + } + + public static var imageAsset: Self { + .init(rawValue: "imageAsset") + } + + public static var uploadOperations: Self { + .init(rawValue: "uploadOperations") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type inAppPurchaseImages + public static var inAppPurchaseImages: Relation<[InAppPurchaseImages]?> { + .init(key: "fields[inAppPurchaseImages]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/InAppPurchaseVersionsById.GET.2cc3688.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/InAppPurchaseVersionsById.GET.2cc3688.generated.swift new file mode 100644 index 00000000..021f0bd5 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/InAppPurchaseVersionsById.GET.2cc3688.generated.swift @@ -0,0 +1,376 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.InAppPurchaseVersions.ById { + public struct GET: Endpoint { + public typealias Response = InAppPurchaseVersionResponse + + public var path: String { + "/v1/inAppPurchaseVersions/\(id)" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[inAppPurchaseImages]", + value: parameters.fields[.inAppPurchaseImages]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[inAppPurchaseLocalizations]", + value: parameters.fields[.inAppPurchaseLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[inAppPurchaseVersions]", + value: parameters.fields[.inAppPurchaseVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[inAppPurchases]", + value: parameters.fields[.inAppPurchases]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "limit[images]", + value: parameters.limit[.images].map { "\($0)" }), + URLQueryItem(name: "limit[localizations]", + value: parameters.limit[.localizations].map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, Single InAppPurchaseVersion as `InAppPurchaseVersionResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseVersionResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.InAppPurchaseVersions.ById.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + /// comma-separated list of relationships to include + public var include: [Include]? + + public var limit: Limit = Limit() + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct InAppPurchaseImages: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var assetDeliveryState: Self { + .init(rawValue: "assetDeliveryState") + } + + public static var assetToken: Self { + .init(rawValue: "assetToken") + } + + public static var fileName: Self { + .init(rawValue: "fileName") + } + + public static var fileSize: Self { + .init(rawValue: "fileSize") + } + + public static var imageAsset: Self { + .init(rawValue: "imageAsset") + } + + public static var uploadOperations: Self { + .init(rawValue: "uploadOperations") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct InAppPurchaseLocalizations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var description: Self { + .init(rawValue: "description") + } + + public static var locale: Self { + .init(rawValue: "locale") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct InAppPurchaseVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var inAppPurchase: Self { + .init(rawValue: "inAppPurchase") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct InAppPurchases: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var appStoreReviewScreenshot: Self { + .init(rawValue: "appStoreReviewScreenshot") + } + + public static var content: Self { + .init(rawValue: "content") + } + + public static var contentHosting: Self { + .init(rawValue: "contentHosting") + } + + public static var familySharable: Self { + .init(rawValue: "familySharable") + } + + public static var iapPriceSchedule: Self { + .init(rawValue: "iapPriceSchedule") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var inAppPurchaseAvailability: Self { + .init(rawValue: "inAppPurchaseAvailability") + } + + public static var inAppPurchaseLocalizations: Self { + .init(rawValue: "inAppPurchaseLocalizations") + } + + public static var inAppPurchaseType: Self { + .init(rawValue: "inAppPurchaseType") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var offerCodes: Self { + .init(rawValue: "offerCodes") + } + + public static var pricePoints: Self { + .init(rawValue: "pricePoints") + } + + public static var productId: Self { + .init(rawValue: "productId") + } + + public static var promotedPurchase: Self { + .init(rawValue: "promotedPurchase") + } + + public static var reviewNote: Self { + .init(rawValue: "reviewNote") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var versions: Self { + .init(rawValue: "versions") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type inAppPurchaseImages + public static var inAppPurchaseImages: Relation<[InAppPurchaseImages]?> { + .init(key: "fields[inAppPurchaseImages]") + } + + /// the fields to include for returned resources of type inAppPurchaseLocalizations + public static var inAppPurchaseLocalizations: Relation<[InAppPurchaseLocalizations]?> { + .init(key: "fields[inAppPurchaseLocalizations]") + } + + /// the fields to include for returned resources of type inAppPurchaseVersions + public static var inAppPurchaseVersions: Relation<[InAppPurchaseVersions]?> { + .init(key: "fields[inAppPurchaseVersions]") + } + + /// the fields to include for returned resources of type inAppPurchases + public static var inAppPurchases: Relation<[InAppPurchases]?> { + .init(key: "fields[inAppPurchases]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var inAppPurchase: Self { + .init(rawValue: "inAppPurchase") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Limit: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct Relation: Hashable { + /// maximum number of related images returned (when they are included) + public static var images: Relation { + .init(key: "limit[images]") + } + + /// maximum number of related localizations returned (when they are included) + public static var localizations: Relation { + .init(key: "limit[localizations]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Localizations/InAppPurchaseVersionsByIdLocalizations.GET.1fa926b.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Localizations/InAppPurchaseVersionsByIdLocalizations.GET.1fa926b.generated.swift new file mode 100644 index 00000000..c244ed67 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Localizations/InAppPurchaseVersionsByIdLocalizations.GET.1fa926b.generated.swift @@ -0,0 +1,206 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.InAppPurchaseVersions.ById.Localizations { + public struct GET: Endpoint { + public typealias Response = InAppPurchaseLocalizationsV2Response + + public var path: String { + "/v1/inAppPurchaseVersions/\(id)/localizations" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[inAppPurchaseLocalizations]", + value: parameters.fields[.inAppPurchaseLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[inAppPurchaseVersions]", + value: parameters.fields[.inAppPurchaseVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of InAppPurchaseLocalizations as `InAppPurchaseLocalizationsV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseLocalizationsV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.InAppPurchaseVersions.ById.Localizations.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + /// comma-separated list of relationships to include + public var include: [Include]? + + /// maximum resources per page + public var limit: Int? + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct InAppPurchaseLocalizations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var description: Self { + .init(rawValue: "description") + } + + public static var locale: Self { + .init(rawValue: "locale") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct InAppPurchaseVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var inAppPurchase: Self { + .init(rawValue: "inAppPurchase") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type inAppPurchaseLocalizations + public static var inAppPurchaseLocalizations: Relation<[InAppPurchaseLocalizations]?> { + .init(key: "fields[inAppPurchaseLocalizations]") + } + + /// the fields to include for returned resources of type inAppPurchaseVersions + public static var inAppPurchaseVersions: Relation<[InAppPurchaseVersions]?> { + .init(key: "fields[inAppPurchaseVersions]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Relationships/Image/InAppPurchaseVersionsByIdRelationshipsImage.GET.fbe8657.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Relationships/Image/InAppPurchaseVersionsByIdRelationshipsImage.GET.fbe8657.generated.swift new file mode 100644 index 00000000..92acc51c --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Relationships/Image/InAppPurchaseVersionsByIdRelationshipsImage.GET.fbe8657.generated.swift @@ -0,0 +1,86 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.InAppPurchaseVersions.ById.Relationships.Image { + public struct GET: Endpoint { + public typealias Response = InAppPurchaseVersionImageLinkageResponse + + public var path: String { + "/v1/inAppPurchaseVersions/\(id)/relationships/image" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, Related linkage as `InAppPurchaseVersionImageLinkageResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseVersionImageLinkageResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.InAppPurchaseVersions.ById.Relationships.Image.GET { + public struct Parameters: Hashable { + + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Relationships/Images/InAppPurchaseVersionsByIdRelationshipsImages.GET.7fe232f.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Relationships/Images/InAppPurchaseVersionsByIdRelationshipsImages.GET.7fe232f.generated.swift new file mode 100644 index 00000000..704b516f --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Relationships/Images/InAppPurchaseVersionsByIdRelationshipsImages.GET.7fe232f.generated.swift @@ -0,0 +1,88 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.InAppPurchaseVersions.ById.Relationships.Images { + public struct GET: Endpoint { + public typealias Response = InAppPurchaseVersionImagesLinkagesResponse + + public var path: String { + "/v1/inAppPurchaseVersions/\(id)/relationships/images" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of related linkages as `InAppPurchaseVersionImagesLinkagesResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseVersionImagesLinkagesResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.InAppPurchaseVersions.ById.Relationships.Images.GET { + public struct Parameters: Hashable { + /// maximum resources per page + public var limit: Int? + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Relationships/Localizations/InAppPurchaseVersionsByIdRelationshipsLocalizations.GET.1088387.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Relationships/Localizations/InAppPurchaseVersionsByIdRelationshipsLocalizations.GET.1088387.generated.swift new file mode 100644 index 00000000..2bde96d9 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/ById/Relationships/Localizations/InAppPurchaseVersionsByIdRelationshipsLocalizations.GET.1088387.generated.swift @@ -0,0 +1,88 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.InAppPurchaseVersions.ById.Relationships.Localizations { + public struct GET: Endpoint { + public typealias Response = InAppPurchaseVersionLocalizationsLinkagesResponse + + public var path: String { + "/v1/inAppPurchaseVersions/\(id)/relationships/localizations" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of related linkages as `InAppPurchaseVersionLocalizationsLinkagesResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseVersionLocalizationsLinkagesResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.InAppPurchaseVersions.ById.Relationships.Localizations.GET { + public struct Parameters: Hashable { + /// maximum resources per page + public var limit: Int? + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/InAppPurchaseVersions.POST.3095fc8.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/InAppPurchaseVersions.POST.3095fc8.generated.swift new file mode 100644 index 00000000..1cd87b9d --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/InAppPurchaseVersions/InAppPurchaseVersions.POST.3095fc8.generated.swift @@ -0,0 +1,84 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.InAppPurchaseVersions { + public struct POST: Endpoint { + public typealias Parameters = InAppPurchaseVersionCreateRequest + public typealias Response = InAppPurchaseVersionResponse + + public var path: String { + "/v1/inAppPurchaseVersions" + } + + /// InAppPurchaseVersion representation + public var parameters: Parameters + + public init(parameters: Parameters) { + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "POST" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **201**, Single InAppPurchaseVersion as `InAppPurchaseVersionResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 201: + return try jsonDecoder.decode(InAppPurchaseVersionResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/PromotedPurchases/ById/PromotedPurchasesById.GET.1e5319f.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/PromotedPurchases/ById/PromotedPurchasesById.GET.1e5319f.generated.swift index 70bc49a3..d447f337 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/PromotedPurchases/ById/PromotedPurchasesById.GET.1e5319f.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/PromotedPurchases/ById/PromotedPurchasesById.GET.1e5319f.generated.swift @@ -164,6 +164,10 @@ extension V1.PromotedPurchases.ById.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -284,6 +288,10 @@ extension V1.PromotedPurchases.ById.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/ReviewSubmissions/ById/Items/ReviewSubmissionsByIdItems.GET.82e114e.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/ReviewSubmissions/ById/Items/ReviewSubmissionsByIdItems.GET.82e114e.generated.swift index 610ca687..72ba40d6 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/ReviewSubmissions/ById/Items/ReviewSubmissionsByIdItems.GET.82e114e.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/ReviewSubmissions/ById/Items/ReviewSubmissionsByIdItems.GET.82e114e.generated.swift @@ -48,8 +48,14 @@ extension V1.ReviewSubmissions.ById.Items { value: parameters.fields[.gameCenterLeaderboardSetVersions]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[gameCenterLeaderboardVersions]", value: parameters.fields[.gameCenterLeaderboardVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[inAppPurchaseVersions]", + value: parameters.fields[.inAppPurchaseVersions]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[reviewSubmissionItems]", value: parameters.fields[.reviewSubmissionItems]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionGroupVersions]", + value: parameters.fields[.subscriptionGroupVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionVersions]", + value: parameters.fields[.subscriptionVersions]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "include", value: parameters.include?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "limit", @@ -600,6 +606,42 @@ extension V1.ReviewSubmissions.ById.Items.GET { } } + public struct InAppPurchaseVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var inAppPurchase: Self { + .init(rawValue: "inAppPurchase") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + public struct ReviewSubmissionItems: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { public static var appCustomProductPageVersion: Self { .init(rawValue: "appCustomProductPageVersion") @@ -645,10 +687,86 @@ extension V1.ReviewSubmissions.ById.Items.GET { .init(rawValue: "gameCenterLeaderboardVersion") } + public static var inAppPurchaseVersion: Self { + .init(rawValue: "inAppPurchaseVersion") + } + public static var state: Self { .init(rawValue: "state") } + public static var subscriptionGroupVersion: Self { + .init(rawValue: "subscriptionGroupVersion") + } + + public static var subscriptionVersion: Self { + .init(rawValue: "subscriptionVersion") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionGroupVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscriptionGroup: Self { + .init(rawValue: "subscriptionGroup") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscription: Self { + .init(rawValue: "subscription") + } + + public static var version: Self { + .init(rawValue: "version") + } + public var description: String { rawValue } @@ -711,11 +829,26 @@ extension V1.ReviewSubmissions.ById.Items.GET { .init(key: "fields[gameCenterLeaderboardVersions]") } + /// the fields to include for returned resources of type inAppPurchaseVersions + public static var inAppPurchaseVersions: Relation<[InAppPurchaseVersions]?> { + .init(key: "fields[inAppPurchaseVersions]") + } + /// the fields to include for returned resources of type reviewSubmissionItems public static var reviewSubmissionItems: Relation<[ReviewSubmissionItems]?> { .init(key: "fields[reviewSubmissionItems]") } + /// the fields to include for returned resources of type subscriptionGroupVersions + public static var subscriptionGroupVersions: Relation<[SubscriptionGroupVersions]?> { + .init(key: "fields[subscriptionGroupVersions]") + } + + /// the fields to include for returned resources of type subscriptionVersions + public static var subscriptionVersions: Relation<[SubscriptionVersions]?> { + .init(key: "fields[subscriptionVersions]") + } + internal let key: String public func hash(into hasher: inout Hasher) { @@ -769,6 +902,18 @@ extension V1.ReviewSubmissions.ById.Items.GET { .init(rawValue: "gameCenterLeaderboardVersion") } + public static var inAppPurchaseVersion: Self { + .init(rawValue: "inAppPurchaseVersion") + } + + public static var subscriptionGroupVersion: Self { + .init(rawValue: "subscriptionGroupVersion") + } + + public static var subscriptionVersion: Self { + .init(rawValue: "subscriptionVersion") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/ReviewSubmissions/ById/ReviewSubmissionsById.GET.1799edb.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/ReviewSubmissions/ById/ReviewSubmissionsById.GET.1799edb.generated.swift index 1828715d..d1486517 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/ReviewSubmissions/ById/ReviewSubmissionsById.GET.1799edb.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/ReviewSubmissions/ById/ReviewSubmissionsById.GET.1799edb.generated.swift @@ -524,10 +524,22 @@ extension V1.ReviewSubmissions.ById.GET { .init(rawValue: "gameCenterLeaderboardVersion") } + public static var inAppPurchaseVersion: Self { + .init(rawValue: "inAppPurchaseVersion") + } + public static var state: Self { .init(rawValue: "state") } + public static var subscriptionGroupVersion: Self { + .init(rawValue: "subscriptionGroupVersion") + } + + public static var subscriptionVersion: Self { + .init(rawValue: "subscriptionVersion") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/ReviewSubmissions/ReviewSubmissions.GET.2271ac3.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/ReviewSubmissions/ReviewSubmissions.GET.2271ac3.generated.swift index a69d286a..b4af6395 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/ReviewSubmissions/ReviewSubmissions.GET.2271ac3.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/ReviewSubmissions/ReviewSubmissions.GET.2271ac3.generated.swift @@ -528,10 +528,22 @@ extension V1.ReviewSubmissions.GET { .init(rawValue: "gameCenterLeaderboardVersion") } + public static var inAppPurchaseVersion: Self { + .init(rawValue: "inAppPurchaseVersion") + } + public static var state: Self { .init(rawValue: "state") } + public static var subscriptionGroupVersion: Self { + .init(rawValue: "subscriptionGroupVersion") + } + + public static var subscriptionVersion: Self { + .init(rawValue: "subscriptionVersion") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionAppStoreReviewScreenshots/ById/SubscriptionAppStoreReviewScreenshotsById.GET.1504677.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionAppStoreReviewScreenshots/ById/SubscriptionAppStoreReviewScreenshotsById.GET.1504677.generated.swift index 479986b4..03f0d73d 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionAppStoreReviewScreenshots/ById/SubscriptionAppStoreReviewScreenshotsById.GET.1504677.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionAppStoreReviewScreenshots/ById/SubscriptionAppStoreReviewScreenshotsById.GET.1504677.generated.swift @@ -222,6 +222,10 @@ extension V1.SubscriptionAppStoreReviewScreenshots.ById.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.GET.8ac8701.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.GET.8ac8701.generated.swift index 5d11a697..df14bc39 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.GET.8ac8701.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.GET.8ac8701.generated.swift @@ -142,6 +142,10 @@ extension V1.SubscriptionGroupLocalizations.ById.GET { .init(rawValue: "subscriptions") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupVersions/ById/Localizations/SubscriptionGroupVersionsByIdLocalizations.GET.b94de26.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupVersions/ById/Localizations/SubscriptionGroupVersionsByIdLocalizations.GET.b94de26.generated.swift new file mode 100644 index 00000000..5b23e85e --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupVersions/ById/Localizations/SubscriptionGroupVersionsByIdLocalizations.GET.b94de26.generated.swift @@ -0,0 +1,198 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionGroupVersions.ById.Localizations { + public struct GET: Endpoint { + public typealias Response = SubscriptionGroupLocalizationsV2Response + + public var path: String { + "/v1/subscriptionGroupVersions/\(id)/localizations" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[subscriptionGroupLocalizations]", + value: parameters.fields[.subscriptionGroupLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionGroupVersions]", + value: parameters.fields[.subscriptionGroupVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of SubscriptionGroupLocalizations as `SubscriptionGroupLocalizationsV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionGroupLocalizationsV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionGroupVersions.ById.Localizations.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + /// comma-separated list of relationships to include + public var include: [Include]? + + /// maximum resources per page + public var limit: Int? + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct SubscriptionGroupLocalizations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var customAppName: Self { + .init(rawValue: "customAppName") + } + + public static var locale: Self { + .init(rawValue: "locale") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionGroupVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscriptionGroup: Self { + .init(rawValue: "subscriptionGroup") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type subscriptionGroupLocalizations + public static var subscriptionGroupLocalizations: Relation<[SubscriptionGroupLocalizations]?> { + .init(key: "fields[subscriptionGroupLocalizations]") + } + + /// the fields to include for returned resources of type subscriptionGroupVersions + public static var subscriptionGroupVersions: Relation<[SubscriptionGroupVersions]?> { + .init(key: "fields[subscriptionGroupVersions]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupVersions/ById/Relationships/Localizations/SubscriptionGroupVersionsByIdRelationshipsLocalizations.GET.b8e1c0f.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupVersions/ById/Relationships/Localizations/SubscriptionGroupVersionsByIdRelationshipsLocalizations.GET.b8e1c0f.generated.swift new file mode 100644 index 00000000..d1423ccf --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupVersions/ById/Relationships/Localizations/SubscriptionGroupVersionsByIdRelationshipsLocalizations.GET.b8e1c0f.generated.swift @@ -0,0 +1,88 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionGroupVersions.ById.Relationships.Localizations { + public struct GET: Endpoint { + public typealias Response = SubscriptionGroupVersionLocalizationsLinkagesResponse + + public var path: String { + "/v1/subscriptionGroupVersions/\(id)/relationships/localizations" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of related linkages as `SubscriptionGroupVersionLocalizationsLinkagesResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionGroupVersionLocalizationsLinkagesResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionGroupVersions.ById.Relationships.Localizations.GET { + public struct Parameters: Hashable { + /// maximum resources per page + public var limit: Int? + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupVersions/ById/SubscriptionGroupVersionsById.GET.075b2d0.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupVersions/ById/SubscriptionGroupVersionsById.GET.075b2d0.generated.swift new file mode 100644 index 00000000..02d1d2d0 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupVersions/ById/SubscriptionGroupVersionsById.GET.075b2d0.generated.swift @@ -0,0 +1,258 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionGroupVersions.ById { + public struct GET: Endpoint { + public typealias Response = SubscriptionGroupVersionResponse + + public var path: String { + "/v1/subscriptionGroupVersions/\(id)" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[subscriptionGroupLocalizations]", + value: parameters.fields[.subscriptionGroupLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionGroupVersions]", + value: parameters.fields[.subscriptionGroupVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionGroups]", + value: parameters.fields[.subscriptionGroups]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "limit[localizations]", + value: parameters.limit[.localizations].map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, Single SubscriptionGroupVersion as `SubscriptionGroupVersionResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionGroupVersionResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionGroupVersions.ById.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + /// comma-separated list of relationships to include + public var include: [Include]? + + public var limit: Limit = Limit() + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct SubscriptionGroupLocalizations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var customAppName: Self { + .init(rawValue: "customAppName") + } + + public static var locale: Self { + .init(rawValue: "locale") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionGroupVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscriptionGroup: Self { + .init(rawValue: "subscriptionGroup") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionGroups: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var referenceName: Self { + .init(rawValue: "referenceName") + } + + public static var subscriptionGroupLocalizations: Self { + .init(rawValue: "subscriptionGroupLocalizations") + } + + public static var subscriptions: Self { + .init(rawValue: "subscriptions") + } + + public static var versions: Self { + .init(rawValue: "versions") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type subscriptionGroupLocalizations + public static var subscriptionGroupLocalizations: Relation<[SubscriptionGroupLocalizations]?> { + .init(key: "fields[subscriptionGroupLocalizations]") + } + + /// the fields to include for returned resources of type subscriptionGroupVersions + public static var subscriptionGroupVersions: Relation<[SubscriptionGroupVersions]?> { + .init(key: "fields[subscriptionGroupVersions]") + } + + /// the fields to include for returned resources of type subscriptionGroups + public static var subscriptionGroups: Relation<[SubscriptionGroups]?> { + .init(key: "fields[subscriptionGroups]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var subscriptionGroup: Self { + .init(rawValue: "subscriptionGroup") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Limit: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct Relation: Hashable { + /// maximum number of related localizations returned (when they are included) + public static var localizations: Relation { + .init(key: "limit[localizations]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupVersions/SubscriptionGroupVersions.POST.3580f27.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupVersions/SubscriptionGroupVersions.POST.3580f27.generated.swift new file mode 100644 index 00000000..a6315191 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroupVersions/SubscriptionGroupVersions.POST.3580f27.generated.swift @@ -0,0 +1,84 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionGroupVersions { + public struct POST: Endpoint { + public typealias Parameters = SubscriptionGroupVersionCreateRequest + public typealias Response = SubscriptionGroupVersionResponse + + public var path: String { + "/v1/subscriptionGroupVersions" + } + + /// SubscriptionGroupVersion representation + public var parameters: Parameters + + public init(parameters: Parameters) { + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "POST" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **201**, Single SubscriptionGroupVersion as `SubscriptionGroupVersionResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 201: + return try jsonDecoder.decode(SubscriptionGroupVersionResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/Relationships/Versions/SubscriptionGroupsByIdRelationshipsVersions.GET.9033006.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/Relationships/Versions/SubscriptionGroupsByIdRelationshipsVersions.GET.9033006.generated.swift new file mode 100644 index 00000000..78e7a499 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/Relationships/Versions/SubscriptionGroupsByIdRelationshipsVersions.GET.9033006.generated.swift @@ -0,0 +1,88 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionGroups.ById.Relationships.Versions { + public struct GET: Endpoint { + public typealias Response = SubscriptionGroupVersionsLinkagesResponse + + public var path: String { + "/v1/subscriptionGroups/\(id)/relationships/versions" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of related linkages as `SubscriptionGroupVersionsLinkagesResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionGroupVersionsLinkagesResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionGroups.ById.Relationships.Versions.GET { + public struct Parameters: Hashable { + /// maximum resources per page + public var limit: Int? + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/SubscriptionGroupLocalizations/SubscriptionGroupsByIdSubscriptionGroupLocalizations.GET.3b1b1be.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/SubscriptionGroupLocalizations/SubscriptionGroupsByIdSubscriptionGroupLocalizations.GET.3b1b1be.generated.swift index 9d31d0b6..1eb42015 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/SubscriptionGroupLocalizations/SubscriptionGroupsByIdSubscriptionGroupLocalizations.GET.3b1b1be.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/SubscriptionGroupLocalizations/SubscriptionGroupsByIdSubscriptionGroupLocalizations.GET.3b1b1be.generated.swift @@ -147,6 +147,10 @@ extension V1.SubscriptionGroups.ById.SubscriptionGroupLocalizations.GET { .init(rawValue: "subscriptions") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/SubscriptionGroupsById.GET.216dec1.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/SubscriptionGroupsById.GET.216dec1.generated.swift index 74bd3198..e455b577 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/SubscriptionGroupsById.GET.216dec1.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/SubscriptionGroupsById.GET.216dec1.generated.swift @@ -30,6 +30,8 @@ extension V1.SubscriptionGroups.ById { components?.queryItems = [ URLQueryItem(name: "fields[subscriptionGroupLocalizations]", value: parameters.fields[.subscriptionGroupLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionGroupVersions]", + value: parameters.fields[.subscriptionGroupVersions]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[subscriptionGroups]", value: parameters.fields[.subscriptionGroups]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[subscriptions]", @@ -39,7 +41,9 @@ extension V1.SubscriptionGroups.ById { URLQueryItem(name: "limit[subscriptionGroupLocalizations]", value: parameters.limit[.subscriptionGroupLocalizations].map { "\($0)" }), URLQueryItem(name: "limit[subscriptions]", - value: parameters.limit[.subscriptions].map { "\($0)" }) + value: parameters.limit[.subscriptions].map { "\($0)" }), + URLQueryItem(name: "limit[versions]", + value: parameters.limit[.versions].map { "\($0)" }) ].filter { $0.value != nil } if components?.queryItems?.isEmpty ?? false { components?.queryItems = nil @@ -137,6 +141,34 @@ extension V1.SubscriptionGroups.ById.GET { } } + public struct SubscriptionGroupVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscriptionGroup: Self { + .init(rawValue: "subscriptionGroup") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + public struct SubscriptionGroups: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { public static var referenceName: Self { .init(rawValue: "referenceName") @@ -150,6 +182,10 @@ extension V1.SubscriptionGroups.ById.GET { .init(rawValue: "subscriptions") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -238,6 +274,10 @@ extension V1.SubscriptionGroups.ById.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } @@ -259,6 +299,11 @@ extension V1.SubscriptionGroups.ById.GET { .init(key: "fields[subscriptionGroupLocalizations]") } + /// the fields to include for returned resources of type subscriptionGroupVersions + public static var subscriptionGroupVersions: Relation<[SubscriptionGroupVersions]?> { + .init(key: "fields[subscriptionGroupVersions]") + } + /// the fields to include for returned resources of type subscriptionGroups public static var subscriptionGroups: Relation<[SubscriptionGroups]?> { .init(key: "fields[subscriptionGroups]") @@ -286,6 +331,10 @@ extension V1.SubscriptionGroups.ById.GET { .init(rawValue: "subscriptions") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -316,6 +365,11 @@ extension V1.SubscriptionGroups.ById.GET { .init(key: "limit[subscriptions]") } + /// maximum number of related versions returned (when they are included) + public static var versions: Relation { + .init(key: "limit[versions]") + } + internal let key: String public func hash(into hasher: inout Hasher) { diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/Subscriptions/SubscriptionGroupsByIdSubscriptions.GET.c1878f2.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/Subscriptions/SubscriptionGroupsByIdSubscriptions.GET.c1878f2.generated.swift index 0e3776bf..00f66bef 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/Subscriptions/SubscriptionGroupsByIdSubscriptions.GET.c1878f2.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/Subscriptions/SubscriptionGroupsByIdSubscriptions.GET.c1878f2.generated.swift @@ -50,6 +50,8 @@ extension V1.SubscriptionGroups.ById.Subscriptions { value: parameters.fields[.subscriptionPrices]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[subscriptionPromotionalOffers]", value: parameters.fields[.subscriptionPromotionalOffers]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionVersions]", + value: parameters.fields[.subscriptionVersions]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[subscriptions]", value: parameters.fields[.subscriptions]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[winBackOffers]", @@ -76,6 +78,8 @@ extension V1.SubscriptionGroups.ById.Subscriptions { value: parameters.limit[.promotionalOffers].map { "\($0)" }), URLQueryItem(name: "limit[subscriptionLocalizations]", value: parameters.limit[.subscriptionLocalizations].map { "\($0)" }), + URLQueryItem(name: "limit[versions]", + value: parameters.limit[.versions].map { "\($0)" }), URLQueryItem(name: "limit[winBackOffers]", value: parameters.limit[.winBackOffers].map { "\($0)" }), URLQueryItem(name: "limit", @@ -266,6 +270,10 @@ extension V1.SubscriptionGroups.ById.Subscriptions.GET { .init(rawValue: "subscriptions") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -577,6 +585,42 @@ extension V1.SubscriptionGroups.ById.Subscriptions.GET { } } + public struct SubscriptionVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscription: Self { + .init(rawValue: "subscription") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + public struct Subscriptions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { public static var appStoreReviewScreenshot: Self { .init(rawValue: "appStoreReviewScreenshot") @@ -654,6 +698,10 @@ extension V1.SubscriptionGroups.ById.Subscriptions.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } @@ -793,6 +841,11 @@ extension V1.SubscriptionGroups.ById.Subscriptions.GET { .init(key: "fields[subscriptionPromotionalOffers]") } + /// the fields to include for returned resources of type subscriptionVersions + public static var subscriptionVersions: Relation<[SubscriptionVersions]?> { + .init(key: "fields[subscriptionVersions]") + } + /// the fields to include for returned resources of type subscriptions public static var subscriptions: Relation<[Subscriptions]?> { .init(key: "fields[subscriptions]") @@ -940,6 +993,10 @@ extension V1.SubscriptionGroups.ById.Subscriptions.GET { .init(rawValue: "subscriptionLocalizations") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } @@ -1004,6 +1061,11 @@ extension V1.SubscriptionGroups.ById.Subscriptions.GET { .init(key: "limit[subscriptionLocalizations]") } + /// maximum number of related versions returned (when they are included) + public static var versions: Relation { + .init(key: "limit[versions]") + } + /// maximum number of related winBackOffers returned (when they are included) public static var winBackOffers: Relation { .init(key: "limit[winBackOffers]") diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/Versions/SubscriptionGroupsByIdVersions.GET.924e17c.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/Versions/SubscriptionGroupsByIdVersions.GET.924e17c.generated.swift new file mode 100644 index 00000000..62fd6fff --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionGroups/ById/Versions/SubscriptionGroupsByIdVersions.GET.924e17c.generated.swift @@ -0,0 +1,340 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionGroups.ById.Versions { + public struct GET: Endpoint { + public typealias Response = SubscriptionGroupVersionsResponse + + public var path: String { + "/v1/subscriptionGroups/\(id)/versions" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[subscriptionGroupLocalizations]", + value: parameters.fields[.subscriptionGroupLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionGroupVersions]", + value: parameters.fields[.subscriptionGroupVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionGroups]", + value: parameters.fields[.subscriptionGroups]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "filter[state]", + value: parameters.filter[.state]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "limit[localizations]", + value: parameters.limit[.localizations].map { "\($0)" }), + URLQueryItem(name: "limit", + value: parameters.limit[].map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of SubscriptionGroupVersions as `SubscriptionGroupVersionsResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionGroupVersionsResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionGroups.ById.Versions.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + public var filter: Filter = Filter() + + /// comma-separated list of relationships to include + public var include: [Include]? + + /// maximum resources per page + public var limit: Limit = Limit() + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct SubscriptionGroupLocalizations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var customAppName: Self { + .init(rawValue: "customAppName") + } + + public static var locale: Self { + .init(rawValue: "locale") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionGroupVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscriptionGroup: Self { + .init(rawValue: "subscriptionGroup") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionGroups: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var referenceName: Self { + .init(rawValue: "referenceName") + } + + public static var subscriptionGroupLocalizations: Self { + .init(rawValue: "subscriptionGroupLocalizations") + } + + public static var subscriptions: Self { + .init(rawValue: "subscriptions") + } + + public static var versions: Self { + .init(rawValue: "versions") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type subscriptionGroupLocalizations + public static var subscriptionGroupLocalizations: Relation<[SubscriptionGroupLocalizations]?> { + .init(key: "fields[subscriptionGroupLocalizations]") + } + + /// the fields to include for returned resources of type subscriptionGroupVersions + public static var subscriptionGroupVersions: Relation<[SubscriptionGroupVersions]?> { + .init(key: "fields[subscriptionGroupVersions]") + } + + /// the fields to include for returned resources of type subscriptionGroups + public static var subscriptionGroups: Relation<[SubscriptionGroups]?> { + .init(key: "fields[subscriptionGroups]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Filter: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct State: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var accepted: Self { + .init(rawValue: "ACCEPTED") + } + + public static var approved: Self { + .init(rawValue: "APPROVED") + } + + public static var developerRejected: Self { + .init(rawValue: "DEVELOPER_REJECTED") + } + + public static var inReview: Self { + .init(rawValue: "IN_REVIEW") + } + + public static var prepareForSubmission: Self { + .init(rawValue: "PREPARE_FOR_SUBMISSION") + } + + public static var readyForReview: Self { + .init(rawValue: "READY_FOR_REVIEW") + } + + public static var rejected: Self { + .init(rawValue: "REJECTED") + } + + public static var replacedWithNewVersion: Self { + .init(rawValue: "REPLACED_WITH_NEW_VERSION") + } + + public static var waitingForReview: Self { + .init(rawValue: "WAITING_FOR_REVIEW") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// filter by attribute 'state' + public static var state: Relation<[State]?> { + .init(key: "filter[state]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var subscriptionGroup: Self { + .init(rawValue: "subscriptionGroup") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Limit: Hashable { + public subscript () -> Int? { + get { self[Relation(key: "limit")] } + set { self[Relation(key: "limit")] = newValue } + } + + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct Relation: Hashable { + /// maximum number of related localizations returned (when they are included) + public static var localizations: Relation { + .init(key: "limit[localizations]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionImages/ById/SubscriptionImagesById.GET.e335fd1.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionImages/ById/SubscriptionImagesById.GET.e335fd1.generated.swift index 4db2af3e..28462d26 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionImages/ById/SubscriptionImagesById.GET.e335fd1.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionImages/ById/SubscriptionImagesById.GET.e335fd1.generated.swift @@ -218,6 +218,10 @@ extension V1.SubscriptionImages.ById.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.GET.731e3ba.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.GET.731e3ba.generated.swift index d5aab332..acb9efda 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.GET.731e3ba.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.GET.731e3ba.generated.swift @@ -206,6 +206,10 @@ extension V1.SubscriptionLocalizations.ById.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionOfferCodes/ById/Prices/SubscriptionOfferCodesByIdPrices.GET.86de8a9.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionOfferCodes/ById/Prices/SubscriptionOfferCodesByIdPrices.GET.86de8a9.generated.swift index 07d733f6..629a6779 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionOfferCodes/ById/Prices/SubscriptionOfferCodesByIdPrices.GET.86de8a9.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionOfferCodes/ById/Prices/SubscriptionOfferCodesByIdPrices.GET.86de8a9.generated.swift @@ -129,6 +129,10 @@ extension V1.SubscriptionOfferCodes.ById.Prices.GET { } public struct SubscriptionPricePoints: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var adjustedEqualizations: Self { + .init(rawValue: "adjustedEqualizations") + } + public static var customerPrice: Self { .init(rawValue: "customerPrice") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionOfferCodes/ById/SubscriptionOfferCodesById.GET.6f18d2e.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionOfferCodes/ById/SubscriptionOfferCodesById.GET.6f18d2e.generated.swift index 383049f9..ed705476 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionOfferCodes/ById/SubscriptionOfferCodesById.GET.6f18d2e.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionOfferCodes/ById/SubscriptionOfferCodesById.GET.6f18d2e.generated.swift @@ -360,6 +360,10 @@ extension V1.SubscriptionOfferCodes.ById.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPricePoints/ById/AdjustedEqualizations/SubscriptionPricePointsByIdAdjustedEqualizations.GET.a412a9b.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPricePoints/ById/AdjustedEqualizations/SubscriptionPricePointsByIdAdjustedEqualizations.GET.a412a9b.generated.swift new file mode 100644 index 00000000..28b3e701 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPricePoints/ById/AdjustedEqualizations/SubscriptionPricePointsByIdAdjustedEqualizations.GET.a412a9b.generated.swift @@ -0,0 +1,241 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionPricePoints.ById.AdjustedEqualizations { + public struct GET: Endpoint { + public typealias Response = SubscriptionPricePointsResponse + + public var path: String { + "/v1/subscriptionPricePoints/\(id)/adjustedEqualizations" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[subscriptionPricePoints]", + value: parameters.fields[.subscriptionPricePoints]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[territories]", + value: parameters.fields[.territories]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "filter[planType]", + value: parameters.filter[.planType]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "filter[subscription]", + value: parameters.filter[.subscription]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "filter[territory]", + value: parameters.filter[.territory]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "filter[upfrontPricePointId]", + value: parameters.filter[.upfrontPricePointId]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of SubscriptionPricePoints as `SubscriptionPricePointsResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionPricePointsResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionPricePoints.ById.AdjustedEqualizations.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + public var filter: Filter = Filter() + + /// comma-separated list of relationships to include + public var include: [Include]? + + /// maximum resources per page + public var limit: Int? + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct SubscriptionPricePoints: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var adjustedEqualizations: Self { + .init(rawValue: "adjustedEqualizations") + } + + public static var customerPrice: Self { + .init(rawValue: "customerPrice") + } + + public static var equalizations: Self { + .init(rawValue: "equalizations") + } + + public static var proceeds: Self { + .init(rawValue: "proceeds") + } + + public static var proceedsYear2: Self { + .init(rawValue: "proceedsYear2") + } + + public static var territory: Self { + .init(rawValue: "territory") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Territories: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var currency: Self { + .init(rawValue: "currency") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type subscriptionPricePoints + public static var subscriptionPricePoints: Relation<[SubscriptionPricePoints]?> { + .init(key: "fields[subscriptionPricePoints]") + } + + /// the fields to include for returned resources of type territories + public static var territories: Relation<[Territories]?> { + .init(key: "fields[territories]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Filter: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct Relation: Hashable { + /// filter by planType + public static var planType: Relation<[String]?> { + .init(key: "filter[planType]") + } + + /// filter by id(s) of related 'subscription' + public static var subscription: Relation<[String]?> { + .init(key: "filter[subscription]") + } + + /// filter by id(s) of related 'territory' + public static var territory: Relation<[String]?> { + .init(key: "filter[territory]") + } + + /// filter by upfrontPricePointId + public static var upfrontPricePointId: Relation<[String]?> { + .init(key: "filter[upfrontPricePointId]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var territory: Self { + .init(rawValue: "territory") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPricePoints/ById/Equalizations/SubscriptionPricePointsByIdEqualizations.GET.044b8ee.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPricePoints/ById/Equalizations/SubscriptionPricePointsByIdEqualizations.GET.044b8ee.generated.swift index 083b4493..e7505c28 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPricePoints/ById/Equalizations/SubscriptionPricePointsByIdEqualizations.GET.044b8ee.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPricePoints/ById/Equalizations/SubscriptionPricePointsByIdEqualizations.GET.044b8ee.generated.swift @@ -32,10 +32,14 @@ extension V1.SubscriptionPricePoints.ById.Equalizations { value: parameters.fields[.subscriptionPricePoints]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[territories]", value: parameters.fields[.territories]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "filter[planType]", + value: parameters.filter[.planType]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "filter[subscription]", value: parameters.filter[.subscription]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "filter[territory]", value: parameters.filter[.territory]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "filter[upfrontPricePointId]", + value: parameters.filter[.upfrontPricePointId]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "include", value: parameters.include?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "limit", @@ -109,6 +113,10 @@ extension V1.SubscriptionPricePoints.ById.Equalizations.GET { private var values: [AnyHashable: AnyHashable] = [:] public struct SubscriptionPricePoints: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var adjustedEqualizations: Self { + .init(rawValue: "adjustedEqualizations") + } + public static var customerPrice: Self { .init(rawValue: "customerPrice") } @@ -184,6 +192,11 @@ extension V1.SubscriptionPricePoints.ById.Equalizations.GET { private var values: [AnyHashable: AnyHashable] = [:] public struct Relation: Hashable { + /// filter by planType + public static var planType: Relation<[String]?> { + .init(key: "filter[planType]") + } + /// filter by id(s) of related 'subscription' public static var subscription: Relation<[String]?> { .init(key: "filter[subscription]") @@ -194,6 +207,11 @@ extension V1.SubscriptionPricePoints.ById.Equalizations.GET { .init(key: "filter[territory]") } + /// filter by upfrontPricePointId + public static var upfrontPricePointId: Relation<[String]?> { + .init(key: "filter[upfrontPricePointId]") + } + internal let key: String public func hash(into hasher: inout Hasher) { diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPricePoints/ById/SubscriptionPricePointsById.GET.a50bff2.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPricePoints/ById/SubscriptionPricePointsById.GET.a50bff2.generated.swift index 48093033..8c3570bb 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPricePoints/ById/SubscriptionPricePointsById.GET.a50bff2.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPricePoints/ById/SubscriptionPricePointsById.GET.a50bff2.generated.swift @@ -98,6 +98,10 @@ extension V1.SubscriptionPricePoints.ById.GET { private var values: [AnyHashable: AnyHashable] = [:] public struct SubscriptionPricePoints: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var adjustedEqualizations: Self { + .init(rawValue: "adjustedEqualizations") + } + public static var customerPrice: Self { .init(rawValue: "customerPrice") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPromotionalOffers/ById/Prices/SubscriptionPromotionalOffersByIdPrices.GET.45d0d63.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPromotionalOffers/ById/Prices/SubscriptionPromotionalOffersByIdPrices.GET.45d0d63.generated.swift index 806984a6..491c0267 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPromotionalOffers/ById/Prices/SubscriptionPromotionalOffersByIdPrices.GET.45d0d63.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPromotionalOffers/ById/Prices/SubscriptionPromotionalOffersByIdPrices.GET.45d0d63.generated.swift @@ -109,6 +109,10 @@ extension V1.SubscriptionPromotionalOffers.ById.Prices.GET { private var values: [AnyHashable: AnyHashable] = [:] public struct SubscriptionPricePoints: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var adjustedEqualizations: Self { + .init(rawValue: "adjustedEqualizations") + } + public static var customerPrice: Self { .init(rawValue: "customerPrice") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPromotionalOffers/ById/SubscriptionPromotionalOffersById.GET.c143fce.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPromotionalOffers/ById/SubscriptionPromotionalOffersById.GET.c143fce.generated.swift index d8e01178..d6e64392 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPromotionalOffers/ById/SubscriptionPromotionalOffersById.GET.c143fce.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionPromotionalOffers/ById/SubscriptionPromotionalOffersById.GET.c143fce.generated.swift @@ -244,6 +244,10 @@ extension V1.SubscriptionPromotionalOffers.ById.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Image/SubscriptionVersionsByIdImage.GET.97d745b.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Image/SubscriptionVersionsByIdImage.GET.97d745b.generated.swift new file mode 100644 index 00000000..600b3a5a --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Image/SubscriptionVersionsByIdImage.GET.97d745b.generated.swift @@ -0,0 +1,145 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionVersions.ById.Image { + public struct GET: Endpoint { + public typealias Response = SubscriptionImageV2Response + + public var path: String { + "/v1/subscriptionVersions/\(id)/image" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[subscriptionImages]", + value: parameters.fields[.subscriptionImages]?.map { "\($0)" }.joined(separator: ",")) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, Single SubscriptionImage as `SubscriptionImageV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionImageV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionVersions.ById.Image.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct SubscriptionImages: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var assetDeliveryState: Self { + .init(rawValue: "assetDeliveryState") + } + + public static var assetToken: Self { + .init(rawValue: "assetToken") + } + + public static var fileName: Self { + .init(rawValue: "fileName") + } + + public static var fileSize: Self { + .init(rawValue: "fileSize") + } + + public static var imageAsset: Self { + .init(rawValue: "imageAsset") + } + + public static var uploadOperations: Self { + .init(rawValue: "uploadOperations") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type subscriptionImages + public static var subscriptionImages: Relation<[SubscriptionImages]?> { + .init(key: "fields[subscriptionImages]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Images/SubscriptionVersionsByIdImages.GET.9f16c8e.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Images/SubscriptionVersionsByIdImages.GET.9f16c8e.generated.swift new file mode 100644 index 00000000..0bb46870 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Images/SubscriptionVersionsByIdImages.GET.9f16c8e.generated.swift @@ -0,0 +1,150 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionVersions.ById.Images { + public struct GET: Endpoint { + public typealias Response = SubscriptionImagesV2Response + + public var path: String { + "/v1/subscriptionVersions/\(id)/images" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[subscriptionImages]", + value: parameters.fields[.subscriptionImages]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of SubscriptionImages as `SubscriptionImagesV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionImagesV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionVersions.ById.Images.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + /// maximum resources per page + public var limit: Int? + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct SubscriptionImages: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var assetDeliveryState: Self { + .init(rawValue: "assetDeliveryState") + } + + public static var assetToken: Self { + .init(rawValue: "assetToken") + } + + public static var fileName: Self { + .init(rawValue: "fileName") + } + + public static var fileSize: Self { + .init(rawValue: "fileSize") + } + + public static var imageAsset: Self { + .init(rawValue: "imageAsset") + } + + public static var uploadOperations: Self { + .init(rawValue: "uploadOperations") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type subscriptionImages + public static var subscriptionImages: Relation<[SubscriptionImages]?> { + .init(key: "fields[subscriptionImages]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Localizations/SubscriptionVersionsByIdLocalizations.GET.94676fe.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Localizations/SubscriptionVersionsByIdLocalizations.GET.94676fe.generated.swift new file mode 100644 index 00000000..89c5f960 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Localizations/SubscriptionVersionsByIdLocalizations.GET.94676fe.generated.swift @@ -0,0 +1,206 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionVersions.ById.Localizations { + public struct GET: Endpoint { + public typealias Response = SubscriptionLocalizationsV2Response + + public var path: String { + "/v1/subscriptionVersions/\(id)/localizations" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[subscriptionLocalizations]", + value: parameters.fields[.subscriptionLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionVersions]", + value: parameters.fields[.subscriptionVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of SubscriptionLocalizations as `SubscriptionLocalizationsV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionLocalizationsV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionVersions.ById.Localizations.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + /// comma-separated list of relationships to include + public var include: [Include]? + + /// maximum resources per page + public var limit: Int? + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct SubscriptionLocalizations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var description: Self { + .init(rawValue: "description") + } + + public static var locale: Self { + .init(rawValue: "locale") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscription: Self { + .init(rawValue: "subscription") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type subscriptionLocalizations + public static var subscriptionLocalizations: Relation<[SubscriptionLocalizations]?> { + .init(key: "fields[subscriptionLocalizations]") + } + + /// the fields to include for returned resources of type subscriptionVersions + public static var subscriptionVersions: Relation<[SubscriptionVersions]?> { + .init(key: "fields[subscriptionVersions]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Relationships/Image/SubscriptionVersionsByIdRelationshipsImage.GET.70af327.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Relationships/Image/SubscriptionVersionsByIdRelationshipsImage.GET.70af327.generated.swift new file mode 100644 index 00000000..9801239d --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Relationships/Image/SubscriptionVersionsByIdRelationshipsImage.GET.70af327.generated.swift @@ -0,0 +1,86 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionVersions.ById.Relationships.Image { + public struct GET: Endpoint { + public typealias Response = SubscriptionVersionImageLinkageResponse + + public var path: String { + "/v1/subscriptionVersions/\(id)/relationships/image" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, Related linkage as `SubscriptionVersionImageLinkageResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionVersionImageLinkageResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionVersions.ById.Relationships.Image.GET { + public struct Parameters: Hashable { + + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Relationships/Images/SubscriptionVersionsByIdRelationshipsImages.GET.0d17da9.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Relationships/Images/SubscriptionVersionsByIdRelationshipsImages.GET.0d17da9.generated.swift new file mode 100644 index 00000000..145f7a7f --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Relationships/Images/SubscriptionVersionsByIdRelationshipsImages.GET.0d17da9.generated.swift @@ -0,0 +1,88 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionVersions.ById.Relationships.Images { + public struct GET: Endpoint { + public typealias Response = SubscriptionVersionImagesLinkagesResponse + + public var path: String { + "/v1/subscriptionVersions/\(id)/relationships/images" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of related linkages as `SubscriptionVersionImagesLinkagesResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionVersionImagesLinkagesResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionVersions.ById.Relationships.Images.GET { + public struct Parameters: Hashable { + /// maximum resources per page + public var limit: Int? + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Relationships/Localizations/SubscriptionVersionsByIdRelationshipsLocalizations.GET.2cf9337.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Relationships/Localizations/SubscriptionVersionsByIdRelationshipsLocalizations.GET.2cf9337.generated.swift new file mode 100644 index 00000000..de6d0d14 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/Relationships/Localizations/SubscriptionVersionsByIdRelationshipsLocalizations.GET.2cf9337.generated.swift @@ -0,0 +1,88 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionVersions.ById.Relationships.Localizations { + public struct GET: Endpoint { + public typealias Response = SubscriptionVersionLocalizationsLinkagesResponse + + public var path: String { + "/v1/subscriptionVersions/\(id)/relationships/localizations" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of related linkages as `SubscriptionVersionLocalizationsLinkagesResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionVersionLocalizationsLinkagesResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionVersions.ById.Relationships.Localizations.GET { + public struct Parameters: Hashable { + /// maximum resources per page + public var limit: Int? + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/SubscriptionVersionsById.GET.4e2fed0.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/SubscriptionVersionsById.GET.4e2fed0.generated.swift new file mode 100644 index 00000000..d31d676d --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/ById/SubscriptionVersionsById.GET.4e2fed0.generated.swift @@ -0,0 +1,392 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionVersions.ById { + public struct GET: Endpoint { + public typealias Response = SubscriptionVersionResponse + + public var path: String { + "/v1/subscriptionVersions/\(id)" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[subscriptionImages]", + value: parameters.fields[.subscriptionImages]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionLocalizations]", + value: parameters.fields[.subscriptionLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionVersions]", + value: parameters.fields[.subscriptionVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptions]", + value: parameters.fields[.subscriptions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "limit[images]", + value: parameters.limit[.images].map { "\($0)" }), + URLQueryItem(name: "limit[localizations]", + value: parameters.limit[.localizations].map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, Single SubscriptionVersion as `SubscriptionVersionResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionVersionResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.SubscriptionVersions.ById.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + /// comma-separated list of relationships to include + public var include: [Include]? + + public var limit: Limit = Limit() + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct SubscriptionImages: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var assetDeliveryState: Self { + .init(rawValue: "assetDeliveryState") + } + + public static var assetToken: Self { + .init(rawValue: "assetToken") + } + + public static var fileName: Self { + .init(rawValue: "fileName") + } + + public static var fileSize: Self { + .init(rawValue: "fileSize") + } + + public static var imageAsset: Self { + .init(rawValue: "imageAsset") + } + + public static var uploadOperations: Self { + .init(rawValue: "uploadOperations") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionLocalizations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var description: Self { + .init(rawValue: "description") + } + + public static var locale: Self { + .init(rawValue: "locale") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscription: Self { + .init(rawValue: "subscription") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Subscriptions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var appStoreReviewScreenshot: Self { + .init(rawValue: "appStoreReviewScreenshot") + } + + public static var familySharable: Self { + .init(rawValue: "familySharable") + } + + public static var group: Self { + .init(rawValue: "group") + } + + public static var groupLevel: Self { + .init(rawValue: "groupLevel") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var introductoryOffers: Self { + .init(rawValue: "introductoryOffers") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var offerCodes: Self { + .init(rawValue: "offerCodes") + } + + public static var planAvailabilities: Self { + .init(rawValue: "planAvailabilities") + } + + public static var pricePoints: Self { + .init(rawValue: "pricePoints") + } + + public static var prices: Self { + .init(rawValue: "prices") + } + + public static var productId: Self { + .init(rawValue: "productId") + } + + public static var promotedPurchase: Self { + .init(rawValue: "promotedPurchase") + } + + public static var promotionalOffers: Self { + .init(rawValue: "promotionalOffers") + } + + public static var reviewNote: Self { + .init(rawValue: "reviewNote") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscriptionAvailability: Self { + .init(rawValue: "subscriptionAvailability") + } + + public static var subscriptionLocalizations: Self { + .init(rawValue: "subscriptionLocalizations") + } + + public static var subscriptionPeriod: Self { + .init(rawValue: "subscriptionPeriod") + } + + public static var versions: Self { + .init(rawValue: "versions") + } + + public static var winBackOffers: Self { + .init(rawValue: "winBackOffers") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type subscriptionImages + public static var subscriptionImages: Relation<[SubscriptionImages]?> { + .init(key: "fields[subscriptionImages]") + } + + /// the fields to include for returned resources of type subscriptionLocalizations + public static var subscriptionLocalizations: Relation<[SubscriptionLocalizations]?> { + .init(key: "fields[subscriptionLocalizations]") + } + + /// the fields to include for returned resources of type subscriptionVersions + public static var subscriptionVersions: Relation<[SubscriptionVersions]?> { + .init(key: "fields[subscriptionVersions]") + } + + /// the fields to include for returned resources of type subscriptions + public static var subscriptions: Relation<[Subscriptions]?> { + .init(key: "fields[subscriptions]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var subscription: Self { + .init(rawValue: "subscription") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Limit: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct Relation: Hashable { + /// maximum number of related images returned (when they are included) + public static var images: Relation { + .init(key: "limit[images]") + } + + /// maximum number of related localizations returned (when they are included) + public static var localizations: Relation { + .init(key: "limit[localizations]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/SubscriptionVersions.POST.b65810e.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/SubscriptionVersions.POST.b65810e.generated.swift new file mode 100644 index 00000000..8f38991d --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/SubscriptionVersions/SubscriptionVersions.POST.b65810e.generated.swift @@ -0,0 +1,84 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.SubscriptionVersions { + public struct POST: Endpoint { + public typealias Parameters = SubscriptionVersionCreateRequest + public typealias Response = SubscriptionVersionResponse + + public var path: String { + "/v1/subscriptionVersions" + } + + /// SubscriptionVersion representation + public var parameters: Parameters + + public init(parameters: Parameters) { + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "POST" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **201**, Single SubscriptionVersion as `SubscriptionVersionResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 201: + return try jsonDecoder.decode(SubscriptionVersionResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/AppStoreReviewScreenshot/SubscriptionsByIdAppStoreReviewScreenshot.GET.1e85fc9.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/AppStoreReviewScreenshot/SubscriptionsByIdAppStoreReviewScreenshot.GET.1e85fc9.generated.swift index 43cab393..11ab36c7 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/AppStoreReviewScreenshot/SubscriptionsByIdAppStoreReviewScreenshot.GET.1e85fc9.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/AppStoreReviewScreenshot/SubscriptionsByIdAppStoreReviewScreenshot.GET.1e85fc9.generated.swift @@ -222,6 +222,10 @@ extension V1.Subscriptions.ById.AppStoreReviewScreenshot.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Images/SubscriptionsByIdImages.GET.dc8952a.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Images/SubscriptionsByIdImages.GET.dc8952a.generated.swift index bac14cd5..81ece0c8 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Images/SubscriptionsByIdImages.GET.dc8952a.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Images/SubscriptionsByIdImages.GET.dc8952a.generated.swift @@ -223,6 +223,10 @@ extension V1.Subscriptions.ById.Images.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/IntroductoryOffers/SubscriptionsByIdIntroductoryOffers.GET.a4dd192.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/IntroductoryOffers/SubscriptionsByIdIntroductoryOffers.GET.a4dd192.generated.swift index 85fdda9f..d6618307 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/IntroductoryOffers/SubscriptionsByIdIntroductoryOffers.GET.a4dd192.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/IntroductoryOffers/SubscriptionsByIdIntroductoryOffers.GET.a4dd192.generated.swift @@ -159,6 +159,10 @@ extension V1.Subscriptions.ById.IntroductoryOffers.GET { } public struct SubscriptionPricePoints: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var adjustedEqualizations: Self { + .init(rawValue: "adjustedEqualizations") + } + public static var customerPrice: Self { .init(rawValue: "customerPrice") } @@ -267,6 +271,10 @@ extension V1.Subscriptions.ById.IntroductoryOffers.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/OfferCodes/SubscriptionsByIdOfferCodes.GET.12e3713.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/OfferCodes/SubscriptionsByIdOfferCodes.GET.12e3713.generated.swift index 7a17b95c..254223ef 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/OfferCodes/SubscriptionsByIdOfferCodes.GET.12e3713.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/OfferCodes/SubscriptionsByIdOfferCodes.GET.12e3713.generated.swift @@ -367,6 +367,10 @@ extension V1.Subscriptions.ById.OfferCodes.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/PricePoints/SubscriptionsByIdPricePoints.GET.423b6c1.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/PricePoints/SubscriptionsByIdPricePoints.GET.423b6c1.generated.swift index 7486f4de..d485d951 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/PricePoints/SubscriptionsByIdPricePoints.GET.423b6c1.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/PricePoints/SubscriptionsByIdPricePoints.GET.423b6c1.generated.swift @@ -32,8 +32,12 @@ extension V1.Subscriptions.ById.PricePoints { value: parameters.fields[.subscriptionPricePoints]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[territories]", value: parameters.fields[.territories]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "filter[planType]", + value: parameters.filter[.planType]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "filter[territory]", value: parameters.filter[.territory]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "filter[upfrontPricePointId]", + value: parameters.filter[.upfrontPricePointId]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "include", value: parameters.include?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "limit", @@ -107,6 +111,10 @@ extension V1.Subscriptions.ById.PricePoints.GET { private var values: [AnyHashable: AnyHashable] = [:] public struct SubscriptionPricePoints: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var adjustedEqualizations: Self { + .init(rawValue: "adjustedEqualizations") + } + public static var customerPrice: Self { .init(rawValue: "customerPrice") } @@ -182,11 +190,21 @@ extension V1.Subscriptions.ById.PricePoints.GET { private var values: [AnyHashable: AnyHashable] = [:] public struct Relation: Hashable { + /// filter by planType + public static var planType: Relation<[String]?> { + .init(key: "filter[planType]") + } + /// filter by id(s) of related 'territory' public static var territory: Relation<[String]?> { .init(key: "filter[territory]") } + /// filter by upfrontPricePointId + public static var upfrontPricePointId: Relation<[String]?> { + .init(key: "filter[upfrontPricePointId]") + } + internal let key: String public func hash(into hasher: inout Hasher) { diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Prices/SubscriptionsByIdPrices.GET.e41242b.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Prices/SubscriptionsByIdPrices.GET.e41242b.generated.swift index 709fff6a..4d0357c2 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Prices/SubscriptionsByIdPrices.GET.e41242b.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Prices/SubscriptionsByIdPrices.GET.e41242b.generated.swift @@ -113,6 +113,10 @@ extension V1.Subscriptions.ById.Prices.GET { private var values: [AnyHashable: AnyHashable] = [:] public struct SubscriptionPricePoints: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var adjustedEqualizations: Self { + .init(rawValue: "adjustedEqualizations") + } + public static var customerPrice: Self { .init(rawValue: "customerPrice") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/PromotedPurchase/SubscriptionsByIdPromotedPurchase.GET.96fa960.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/PromotedPurchase/SubscriptionsByIdPromotedPurchase.GET.96fa960.generated.swift index 70a02a06..b57edf09 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/PromotedPurchase/SubscriptionsByIdPromotedPurchase.GET.96fa960.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/PromotedPurchase/SubscriptionsByIdPromotedPurchase.GET.96fa960.generated.swift @@ -164,6 +164,10 @@ extension V1.Subscriptions.ById.PromotedPurchase.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -284,6 +288,10 @@ extension V1.Subscriptions.ById.PromotedPurchase.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/PromotionalOffers/SubscriptionsByIdPromotionalOffers.GET.0f955f5.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/PromotionalOffers/SubscriptionsByIdPromotionalOffers.GET.0f955f5.generated.swift index 855ff26f..ab6abfb9 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/PromotionalOffers/SubscriptionsByIdPromotionalOffers.GET.0f955f5.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/PromotionalOffers/SubscriptionsByIdPromotionalOffers.GET.0f955f5.generated.swift @@ -251,6 +251,10 @@ extension V1.Subscriptions.ById.PromotionalOffers.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Relationships/Versions/SubscriptionsByIdRelationshipsVersions.GET.245f9b0.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Relationships/Versions/SubscriptionsByIdRelationshipsVersions.GET.245f9b0.generated.swift new file mode 100644 index 00000000..138bb54e --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Relationships/Versions/SubscriptionsByIdRelationshipsVersions.GET.245f9b0.generated.swift @@ -0,0 +1,88 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.Subscriptions.ById.Relationships.Versions { + public struct GET: Endpoint { + public typealias Response = SubscriptionVersionsLinkagesResponse + + public var path: String { + "/v1/subscriptions/\(id)/relationships/versions" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of related linkages as `SubscriptionVersionsLinkagesResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionVersionsLinkagesResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.Subscriptions.ById.Relationships.Versions.GET { + public struct Parameters: Hashable { + /// maximum resources per page + public var limit: Int? + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/SubscriptionLocalizations/SubscriptionsByIdSubscriptionLocalizations.GET.eef6109.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/SubscriptionLocalizations/SubscriptionsByIdSubscriptionLocalizations.GET.eef6109.generated.swift index e3220136..59c5b4ff 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/SubscriptionLocalizations/SubscriptionsByIdSubscriptionLocalizations.GET.eef6109.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/SubscriptionLocalizations/SubscriptionsByIdSubscriptionLocalizations.GET.eef6109.generated.swift @@ -211,6 +211,10 @@ extension V1.Subscriptions.ById.SubscriptionLocalizations.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/SubscriptionsById.GET.fc34fc5.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/SubscriptionsById.GET.fc34fc5.generated.swift index fbbb8647..e3431002 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/SubscriptionsById.GET.fc34fc5.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/SubscriptionsById.GET.fc34fc5.generated.swift @@ -50,6 +50,8 @@ extension V1.Subscriptions.ById { value: parameters.fields[.subscriptionPrices]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[subscriptionPromotionalOffers]", value: parameters.fields[.subscriptionPromotionalOffers]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionVersions]", + value: parameters.fields[.subscriptionVersions]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[subscriptions]", value: parameters.fields[.subscriptions]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[winBackOffers]", @@ -70,6 +72,8 @@ extension V1.Subscriptions.ById { value: parameters.limit[.promotionalOffers].map { "\($0)" }), URLQueryItem(name: "limit[subscriptionLocalizations]", value: parameters.limit[.subscriptionLocalizations].map { "\($0)" }), + URLQueryItem(name: "limit[versions]", + value: parameters.limit[.versions].map { "\($0)" }), URLQueryItem(name: "limit[winBackOffers]", value: parameters.limit[.winBackOffers].map { "\($0)" }) ].filter { $0.value != nil } @@ -250,6 +254,10 @@ extension V1.Subscriptions.ById.GET { .init(rawValue: "subscriptions") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -561,6 +569,42 @@ extension V1.Subscriptions.ById.GET { } } + public struct SubscriptionVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscription: Self { + .init(rawValue: "subscription") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + public struct Subscriptions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { public static var appStoreReviewScreenshot: Self { .init(rawValue: "appStoreReviewScreenshot") @@ -638,6 +682,10 @@ extension V1.Subscriptions.ById.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } @@ -777,6 +825,11 @@ extension V1.Subscriptions.ById.GET { .init(key: "fields[subscriptionPromotionalOffers]") } + /// the fields to include for returned resources of type subscriptionVersions + public static var subscriptionVersions: Relation<[SubscriptionVersions]?> { + .init(key: "fields[subscriptionVersions]") + } + /// the fields to include for returned resources of type subscriptions public static var subscriptions: Relation<[Subscriptions]?> { .init(key: "fields[subscriptions]") @@ -840,6 +893,10 @@ extension V1.Subscriptions.ById.GET { .init(rawValue: "subscriptionLocalizations") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } @@ -899,6 +956,11 @@ extension V1.Subscriptions.ById.GET { .init(key: "limit[subscriptionLocalizations]") } + /// maximum number of related versions returned (when they are included) + public static var versions: Relation { + .init(key: "limit[versions]") + } + /// maximum number of related winBackOffers returned (when they are included) public static var winBackOffers: Relation { .init(key: "limit[winBackOffers]") diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Versions/SubscriptionsByIdVersions.GET.c0ad9cb.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Versions/SubscriptionsByIdVersions.GET.c0ad9cb.generated.swift new file mode 100644 index 00000000..7e619bfe --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/Subscriptions/ById/Versions/SubscriptionsByIdVersions.GET.c0ad9cb.generated.swift @@ -0,0 +1,474 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V1.Subscriptions.ById.Versions { + public struct GET: Endpoint { + public typealias Response = SubscriptionVersionsResponse + + public var path: String { + "/v1/subscriptions/\(id)/versions" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[subscriptionImages]", + value: parameters.fields[.subscriptionImages]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionLocalizations]", + value: parameters.fields[.subscriptionLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionVersions]", + value: parameters.fields[.subscriptionVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptions]", + value: parameters.fields[.subscriptions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "filter[state]", + value: parameters.filter[.state]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "limit[images]", + value: parameters.limit[.images].map { "\($0)" }), + URLQueryItem(name: "limit[localizations]", + value: parameters.limit[.localizations].map { "\($0)" }), + URLQueryItem(name: "limit", + value: parameters.limit[].map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of SubscriptionVersions as `SubscriptionVersionsResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionVersionsResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V1.Subscriptions.ById.Versions.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + public var filter: Filter = Filter() + + /// comma-separated list of relationships to include + public var include: [Include]? + + /// maximum resources per page + public var limit: Limit = Limit() + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct SubscriptionImages: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var assetDeliveryState: Self { + .init(rawValue: "assetDeliveryState") + } + + public static var assetToken: Self { + .init(rawValue: "assetToken") + } + + public static var fileName: Self { + .init(rawValue: "fileName") + } + + public static var fileSize: Self { + .init(rawValue: "fileSize") + } + + public static var imageAsset: Self { + .init(rawValue: "imageAsset") + } + + public static var uploadOperations: Self { + .init(rawValue: "uploadOperations") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionLocalizations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var description: Self { + .init(rawValue: "description") + } + + public static var locale: Self { + .init(rawValue: "locale") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscription: Self { + .init(rawValue: "subscription") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Subscriptions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var appStoreReviewScreenshot: Self { + .init(rawValue: "appStoreReviewScreenshot") + } + + public static var familySharable: Self { + .init(rawValue: "familySharable") + } + + public static var group: Self { + .init(rawValue: "group") + } + + public static var groupLevel: Self { + .init(rawValue: "groupLevel") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var introductoryOffers: Self { + .init(rawValue: "introductoryOffers") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var offerCodes: Self { + .init(rawValue: "offerCodes") + } + + public static var planAvailabilities: Self { + .init(rawValue: "planAvailabilities") + } + + public static var pricePoints: Self { + .init(rawValue: "pricePoints") + } + + public static var prices: Self { + .init(rawValue: "prices") + } + + public static var productId: Self { + .init(rawValue: "productId") + } + + public static var promotedPurchase: Self { + .init(rawValue: "promotedPurchase") + } + + public static var promotionalOffers: Self { + .init(rawValue: "promotionalOffers") + } + + public static var reviewNote: Self { + .init(rawValue: "reviewNote") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscriptionAvailability: Self { + .init(rawValue: "subscriptionAvailability") + } + + public static var subscriptionLocalizations: Self { + .init(rawValue: "subscriptionLocalizations") + } + + public static var subscriptionPeriod: Self { + .init(rawValue: "subscriptionPeriod") + } + + public static var versions: Self { + .init(rawValue: "versions") + } + + public static var winBackOffers: Self { + .init(rawValue: "winBackOffers") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type subscriptionImages + public static var subscriptionImages: Relation<[SubscriptionImages]?> { + .init(key: "fields[subscriptionImages]") + } + + /// the fields to include for returned resources of type subscriptionLocalizations + public static var subscriptionLocalizations: Relation<[SubscriptionLocalizations]?> { + .init(key: "fields[subscriptionLocalizations]") + } + + /// the fields to include for returned resources of type subscriptionVersions + public static var subscriptionVersions: Relation<[SubscriptionVersions]?> { + .init(key: "fields[subscriptionVersions]") + } + + /// the fields to include for returned resources of type subscriptions + public static var subscriptions: Relation<[Subscriptions]?> { + .init(key: "fields[subscriptions]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Filter: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct State: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var accepted: Self { + .init(rawValue: "ACCEPTED") + } + + public static var approved: Self { + .init(rawValue: "APPROVED") + } + + public static var developerRejected: Self { + .init(rawValue: "DEVELOPER_REJECTED") + } + + public static var inReview: Self { + .init(rawValue: "IN_REVIEW") + } + + public static var prepareForSubmission: Self { + .init(rawValue: "PREPARE_FOR_SUBMISSION") + } + + public static var readyForReview: Self { + .init(rawValue: "READY_FOR_REVIEW") + } + + public static var rejected: Self { + .init(rawValue: "REJECTED") + } + + public static var replacedWithNewVersion: Self { + .init(rawValue: "REPLACED_WITH_NEW_VERSION") + } + + public static var waitingForReview: Self { + .init(rawValue: "WAITING_FOR_REVIEW") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// filter by attribute 'state' + public static var state: Relation<[State]?> { + .init(key: "filter[state]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var subscription: Self { + .init(rawValue: "subscription") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Limit: Hashable { + public subscript () -> Int? { + get { self[Relation(key: "limit")] } + set { self[Relation(key: "limit")] = newValue } + } + + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct Relation: Hashable { + /// maximum number of related images returned (when they are included) + public static var images: Relation { + .init(key: "limit[images]") + } + + /// maximum number of related localizations returned (when they are included) + public static var localizations: Relation { + .init(key: "limit[localizations]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/WinBackOffers/ById/Prices/WinBackOffersByIdPrices.GET.3de578d.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/WinBackOffers/ById/Prices/WinBackOffersByIdPrices.GET.3de578d.generated.swift index 6443f1a0..8ee4bc83 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/WinBackOffers/ById/Prices/WinBackOffersByIdPrices.GET.3de578d.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V1/WinBackOffers/ById/Prices/WinBackOffersByIdPrices.GET.3de578d.generated.swift @@ -109,6 +109,10 @@ extension V1.WinBackOffers.ById.Prices.GET { private var values: [AnyHashable: AnyHashable] = [:] public struct SubscriptionPricePoints: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var adjustedEqualizations: Self { + .init(rawValue: "adjustedEqualizations") + } + public static var customerPrice: Self { .init(rawValue: "customerPrice") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseImages/ById/InAppPurchaseImagesById.DELETE.4281805.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseImages/ById/InAppPurchaseImagesById.DELETE.4281805.generated.swift new file mode 100644 index 00000000..1024abe3 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseImages/ById/InAppPurchaseImagesById.DELETE.4281805.generated.swift @@ -0,0 +1,68 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.InAppPurchaseImages.ById { + public struct DELETE: Endpoint { + public typealias Parameters = Never + public typealias Response = Void + + public var path: String { + "/v2/inAppPurchaseImages/\(id)" + } + + /// the id of the requested resource + public var id: String + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "DELETE" + return urlRequest + } + + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseImages/ById/InAppPurchaseImagesById.GET.4281805.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseImages/ById/InAppPurchaseImagesById.GET.4281805.generated.swift new file mode 100644 index 00000000..1cffd2f6 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseImages/ById/InAppPurchaseImagesById.GET.4281805.generated.swift @@ -0,0 +1,145 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.InAppPurchaseImages.ById { + public struct GET: Endpoint { + public typealias Response = InAppPurchaseImageV2Response + + public var path: String { + "/v2/inAppPurchaseImages/\(id)" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[inAppPurchaseImages]", + value: parameters.fields[.inAppPurchaseImages]?.map { "\($0)" }.joined(separator: ",")) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, Single InAppPurchaseImage as `InAppPurchaseImageV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseImageV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V2.InAppPurchaseImages.ById.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct InAppPurchaseImages: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var assetDeliveryState: Self { + .init(rawValue: "assetDeliveryState") + } + + public static var assetToken: Self { + .init(rawValue: "assetToken") + } + + public static var fileName: Self { + .init(rawValue: "fileName") + } + + public static var fileSize: Self { + .init(rawValue: "fileSize") + } + + public static var imageAsset: Self { + .init(rawValue: "imageAsset") + } + + public static var uploadOperations: Self { + .init(rawValue: "uploadOperations") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type inAppPurchaseImages + public static var inAppPurchaseImages: Relation<[InAppPurchaseImages]?> { + .init(key: "fields[inAppPurchaseImages]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseImages/ById/InAppPurchaseImagesById.PATCH.4281805.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseImages/ById/InAppPurchaseImagesById.PATCH.4281805.generated.swift new file mode 100644 index 00000000..66bae12c --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseImages/ById/InAppPurchaseImagesById.PATCH.4281805.generated.swift @@ -0,0 +1,95 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.InAppPurchaseImages.ById { + public struct PATCH: Endpoint { + public typealias Parameters = InAppPurchaseImageV2UpdateRequest + public typealias Response = InAppPurchaseImageV2Response + + public var path: String { + "/v2/inAppPurchaseImages/\(id)" + } + + /// the id of the requested resource + public var id: String + + /// InAppPurchaseImage representation + public var parameters: Parameters + + public init( + id: String, + parameters: Parameters + ) { + self.id = id + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "PATCH" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **200**, Single InAppPurchaseImage as `InAppPurchaseImageV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseImageV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseImages/InAppPurchaseImages.POST.2b61301.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseImages/InAppPurchaseImages.POST.2b61301.generated.swift new file mode 100644 index 00000000..05056931 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseImages/InAppPurchaseImages.POST.2b61301.generated.swift @@ -0,0 +1,84 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.InAppPurchaseImages { + public struct POST: Endpoint { + public typealias Parameters = InAppPurchaseImageV2CreateRequest + public typealias Response = InAppPurchaseImageV2Response + + public var path: String { + "/v2/inAppPurchaseImages" + } + + /// InAppPurchaseImage representation + public var parameters: Parameters + + public init(parameters: Parameters) { + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "POST" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **201**, Single InAppPurchaseImage as `InAppPurchaseImageV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 201: + return try jsonDecoder.decode(InAppPurchaseImageV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.DELETE.44ff67b.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.DELETE.44ff67b.generated.swift new file mode 100644 index 00000000..3876a444 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.DELETE.44ff67b.generated.swift @@ -0,0 +1,68 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.InAppPurchaseLocalizations.ById { + public struct DELETE: Endpoint { + public typealias Parameters = Never + public typealias Response = Void + + public var path: String { + "/v2/inAppPurchaseLocalizations/\(id)" + } + + /// the id of the requested resource + public var id: String + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "DELETE" + return urlRequest + } + + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.GET.44ff67b.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.GET.44ff67b.generated.swift new file mode 100644 index 00000000..b0295715 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.GET.44ff67b.generated.swift @@ -0,0 +1,201 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.InAppPurchaseLocalizations.ById { + public struct GET: Endpoint { + public typealias Response = InAppPurchaseLocalizationV2Response + + public var path: String { + "/v2/inAppPurchaseLocalizations/\(id)" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[inAppPurchaseLocalizations]", + value: parameters.fields[.inAppPurchaseLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[inAppPurchaseVersions]", + value: parameters.fields[.inAppPurchaseVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, Single InAppPurchaseLocalization as `InAppPurchaseLocalizationV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseLocalizationV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V2.InAppPurchaseLocalizations.ById.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + /// comma-separated list of relationships to include + public var include: [Include]? + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct InAppPurchaseLocalizations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var description: Self { + .init(rawValue: "description") + } + + public static var locale: Self { + .init(rawValue: "locale") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct InAppPurchaseVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var inAppPurchase: Self { + .init(rawValue: "inAppPurchase") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type inAppPurchaseLocalizations + public static var inAppPurchaseLocalizations: Relation<[InAppPurchaseLocalizations]?> { + .init(key: "fields[inAppPurchaseLocalizations]") + } + + /// the fields to include for returned resources of type inAppPurchaseVersions + public static var inAppPurchaseVersions: Relation<[InAppPurchaseVersions]?> { + .init(key: "fields[inAppPurchaseVersions]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.PATCH.44ff67b.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.PATCH.44ff67b.generated.swift new file mode 100644 index 00000000..36fec14f --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseLocalizations/ById/InAppPurchaseLocalizationsById.PATCH.44ff67b.generated.swift @@ -0,0 +1,95 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.InAppPurchaseLocalizations.ById { + public struct PATCH: Endpoint { + public typealias Parameters = InAppPurchaseLocalizationV2UpdateRequest + public typealias Response = InAppPurchaseLocalizationV2Response + + public var path: String { + "/v2/inAppPurchaseLocalizations/\(id)" + } + + /// the id of the requested resource + public var id: String + + /// InAppPurchaseLocalization representation + public var parameters: Parameters + + public init( + id: String, + parameters: Parameters + ) { + self.id = id + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "PATCH" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **200**, Single InAppPurchaseLocalization as `InAppPurchaseLocalizationV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseLocalizationV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseLocalizations/InAppPurchaseLocalizations.POST.9ee811a.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseLocalizations/InAppPurchaseLocalizations.POST.9ee811a.generated.swift new file mode 100644 index 00000000..fa11a1f3 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchaseLocalizations/InAppPurchaseLocalizations.POST.9ee811a.generated.swift @@ -0,0 +1,84 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.InAppPurchaseLocalizations { + public struct POST: Endpoint { + public typealias Parameters = InAppPurchaseLocalizationV2CreateRequest + public typealias Response = InAppPurchaseLocalizationV2Response + + public var path: String { + "/v2/inAppPurchaseLocalizations" + } + + /// InAppPurchaseLocalization representation + public var parameters: Parameters + + public init(parameters: Parameters) { + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "POST" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **201**, Single InAppPurchaseLocalization as `InAppPurchaseLocalizationV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 201: + return try jsonDecoder.decode(InAppPurchaseLocalizationV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/AppStoreReviewScreenshot/InAppPurchasesByIdAppStoreReviewScreenshot.GET.6300db3.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/AppStoreReviewScreenshot/InAppPurchasesByIdAppStoreReviewScreenshot.GET.6300db3.generated.swift index e3339c78..309d603e 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/AppStoreReviewScreenshot/InAppPurchasesByIdAppStoreReviewScreenshot.GET.6300db3.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/AppStoreReviewScreenshot/InAppPurchasesByIdAppStoreReviewScreenshot.GET.6300db3.generated.swift @@ -210,6 +210,10 @@ extension V2.InAppPurchases.ById.AppStoreReviewScreenshot.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Content/InAppPurchasesByIdContent.GET.6af7bd8.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Content/InAppPurchasesByIdContent.GET.6af7bd8.generated.swift index ff84651e..103877a7 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Content/InAppPurchasesByIdContent.GET.6af7bd8.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Content/InAppPurchasesByIdContent.GET.6af7bd8.generated.swift @@ -194,6 +194,10 @@ extension V2.InAppPurchases.ById.Content.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Images/InAppPurchasesByIdImages.GET.95733aa.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Images/InAppPurchasesByIdImages.GET.95733aa.generated.swift index 5bd04242..2fea47b0 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Images/InAppPurchasesByIdImages.GET.95733aa.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Images/InAppPurchasesByIdImages.GET.95733aa.generated.swift @@ -211,6 +211,10 @@ extension V2.InAppPurchases.ById.Images.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/InAppPurchaseLocalizations/InAppPurchasesByIdInAppPurchaseLocalizations.GET.f825840.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/InAppPurchaseLocalizations/InAppPurchasesByIdInAppPurchaseLocalizations.GET.f825840.generated.swift index 835c6015..4f0653ea 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/InAppPurchaseLocalizations/InAppPurchasesByIdInAppPurchaseLocalizations.GET.f825840.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/InAppPurchaseLocalizations/InAppPurchasesByIdInAppPurchaseLocalizations.GET.f825840.generated.swift @@ -199,6 +199,10 @@ extension V2.InAppPurchases.ById.InAppPurchaseLocalizations.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/InAppPurchasesById.GET.2fb25cf.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/InAppPurchasesById.GET.2fb25cf.generated.swift index 18507a2a..8b1d1b5a 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/InAppPurchasesById.GET.2fb25cf.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/InAppPurchasesById.GET.2fb25cf.generated.swift @@ -44,6 +44,8 @@ extension V2.InAppPurchases.ById { value: parameters.fields[.inAppPurchasePricePoints]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[inAppPurchasePriceSchedules]", value: parameters.fields[.inAppPurchasePriceSchedules]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[inAppPurchaseVersions]", + value: parameters.fields[.inAppPurchaseVersions]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[inAppPurchases]", value: parameters.fields[.inAppPurchases]?.map { "\($0)" }.joined(separator: ",")), URLQueryItem(name: "fields[promotedPurchases]", @@ -57,7 +59,9 @@ extension V2.InAppPurchases.ById { URLQueryItem(name: "limit[offerCodes]", value: parameters.limit[.offerCodes].map { "\($0)" }), URLQueryItem(name: "limit[pricePoints]", - value: parameters.limit[.pricePoints].map { "\($0)" }) + value: parameters.limit[.pricePoints].map { "\($0)" }), + URLQueryItem(name: "limit[versions]", + value: parameters.limit[.versions].map { "\($0)" }) ].filter { $0.value != nil } if components?.queryItems?.isEmpty ?? false { components?.queryItems = nil @@ -395,6 +399,42 @@ extension V2.InAppPurchases.ById.GET { } } + public struct InAppPurchaseVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var inAppPurchase: Self { + .init(rawValue: "inAppPurchase") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + public struct InAppPurchases: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { public static var appStoreReviewScreenshot: Self { .init(rawValue: "appStoreReviewScreenshot") @@ -460,6 +500,10 @@ extension V2.InAppPurchases.ById.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -544,6 +588,11 @@ extension V2.InAppPurchases.ById.GET { .init(key: "fields[inAppPurchasePriceSchedules]") } + /// the fields to include for returned resources of type inAppPurchaseVersions + public static var inAppPurchaseVersions: Relation<[InAppPurchaseVersions]?> { + .init(key: "fields[inAppPurchaseVersions]") + } + /// the fields to include for returned resources of type inAppPurchases public static var inAppPurchases: Relation<[InAppPurchases]?> { .init(key: "fields[inAppPurchases]") @@ -599,6 +648,10 @@ extension V2.InAppPurchases.ById.GET { .init(rawValue: "promotedPurchase") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -639,6 +692,11 @@ extension V2.InAppPurchases.ById.GET { .init(key: "limit[pricePoints]") } + /// maximum number of related versions returned (when they are included) + public static var versions: Relation { + .init(key: "limit[versions]") + } + internal let key: String public func hash(into hasher: inout Hasher) { diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/PromotedPurchase/InAppPurchasesByIdPromotedPurchase.GET.12375e3.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/PromotedPurchase/InAppPurchasesByIdPromotedPurchase.GET.12375e3.generated.swift index 45cf6efc..b4737980 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/PromotedPurchase/InAppPurchasesByIdPromotedPurchase.GET.12375e3.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/PromotedPurchase/InAppPurchasesByIdPromotedPurchase.GET.12375e3.generated.swift @@ -164,6 +164,10 @@ extension V2.InAppPurchases.ById.PromotedPurchase.GET { .init(rawValue: "state") } + public static var versions: Self { + .init(rawValue: "versions") + } + public var description: String { rawValue } @@ -284,6 +288,10 @@ extension V2.InAppPurchases.ById.PromotedPurchase.GET { .init(rawValue: "subscriptionPeriod") } + public static var versions: Self { + .init(rawValue: "versions") + } + public static var winBackOffers: Self { .init(rawValue: "winBackOffers") } diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Relationships/Versions/InAppPurchasesByIdRelationshipsVersions.GET.970980c.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Relationships/Versions/InAppPurchasesByIdRelationshipsVersions.GET.970980c.generated.swift new file mode 100644 index 00000000..9dc38ae8 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Relationships/Versions/InAppPurchasesByIdRelationshipsVersions.GET.970980c.generated.swift @@ -0,0 +1,88 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.InAppPurchases.ById.Relationships.Versions { + public struct GET: Endpoint { + public typealias Response = InAppPurchaseV2VersionsLinkagesResponse + + public var path: String { + "/v2/inAppPurchases/\(id)/relationships/versions" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "limit", + value: parameters.limit.map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of related linkages as `InAppPurchaseV2VersionsLinkagesResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseV2VersionsLinkagesResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V2.InAppPurchases.ById.Relationships.Versions.GET { + public struct Parameters: Hashable { + /// maximum resources per page + public var limit: Int? + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Versions/InAppPurchasesByIdVersions.GET.432bd2c.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Versions/InAppPurchasesByIdVersions.GET.432bd2c.generated.swift new file mode 100644 index 00000000..07189902 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/InAppPurchases/ById/Versions/InAppPurchasesByIdVersions.GET.432bd2c.generated.swift @@ -0,0 +1,458 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.InAppPurchases.ById.Versions { + public struct GET: Endpoint { + public typealias Response = InAppPurchaseVersionsResponse + + public var path: String { + "/v2/inAppPurchases/\(id)/versions" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[inAppPurchaseImages]", + value: parameters.fields[.inAppPurchaseImages]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[inAppPurchaseLocalizations]", + value: parameters.fields[.inAppPurchaseLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[inAppPurchaseVersions]", + value: parameters.fields[.inAppPurchaseVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[inAppPurchases]", + value: parameters.fields[.inAppPurchases]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "filter[state]", + value: parameters.filter[.state]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "limit[images]", + value: parameters.limit[.images].map { "\($0)" }), + URLQueryItem(name: "limit[localizations]", + value: parameters.limit[.localizations].map { "\($0)" }), + URLQueryItem(name: "limit", + value: parameters.limit[].map { "\($0)" }) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, List of InAppPurchaseVersions as `InAppPurchaseVersionsResponse` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(InAppPurchaseVersionsResponse.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V2.InAppPurchases.ById.Versions.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + public var filter: Filter = Filter() + + /// comma-separated list of relationships to include + public var include: [Include]? + + /// maximum resources per page + public var limit: Limit = Limit() + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct InAppPurchaseImages: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var assetDeliveryState: Self { + .init(rawValue: "assetDeliveryState") + } + + public static var assetToken: Self { + .init(rawValue: "assetToken") + } + + public static var fileName: Self { + .init(rawValue: "fileName") + } + + public static var fileSize: Self { + .init(rawValue: "fileSize") + } + + public static var imageAsset: Self { + .init(rawValue: "imageAsset") + } + + public static var uploadOperations: Self { + .init(rawValue: "uploadOperations") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct InAppPurchaseLocalizations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var description: Self { + .init(rawValue: "description") + } + + public static var locale: Self { + .init(rawValue: "locale") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct InAppPurchaseVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var inAppPurchase: Self { + .init(rawValue: "inAppPurchase") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct InAppPurchases: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var appStoreReviewScreenshot: Self { + .init(rawValue: "appStoreReviewScreenshot") + } + + public static var content: Self { + .init(rawValue: "content") + } + + public static var contentHosting: Self { + .init(rawValue: "contentHosting") + } + + public static var familySharable: Self { + .init(rawValue: "familySharable") + } + + public static var iapPriceSchedule: Self { + .init(rawValue: "iapPriceSchedule") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var inAppPurchaseAvailability: Self { + .init(rawValue: "inAppPurchaseAvailability") + } + + public static var inAppPurchaseLocalizations: Self { + .init(rawValue: "inAppPurchaseLocalizations") + } + + public static var inAppPurchaseType: Self { + .init(rawValue: "inAppPurchaseType") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var offerCodes: Self { + .init(rawValue: "offerCodes") + } + + public static var pricePoints: Self { + .init(rawValue: "pricePoints") + } + + public static var productId: Self { + .init(rawValue: "productId") + } + + public static var promotedPurchase: Self { + .init(rawValue: "promotedPurchase") + } + + public static var reviewNote: Self { + .init(rawValue: "reviewNote") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var versions: Self { + .init(rawValue: "versions") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type inAppPurchaseImages + public static var inAppPurchaseImages: Relation<[InAppPurchaseImages]?> { + .init(key: "fields[inAppPurchaseImages]") + } + + /// the fields to include for returned resources of type inAppPurchaseLocalizations + public static var inAppPurchaseLocalizations: Relation<[InAppPurchaseLocalizations]?> { + .init(key: "fields[inAppPurchaseLocalizations]") + } + + /// the fields to include for returned resources of type inAppPurchaseVersions + public static var inAppPurchaseVersions: Relation<[InAppPurchaseVersions]?> { + .init(key: "fields[inAppPurchaseVersions]") + } + + /// the fields to include for returned resources of type inAppPurchases + public static var inAppPurchases: Relation<[InAppPurchases]?> { + .init(key: "fields[inAppPurchases]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Filter: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct State: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var accepted: Self { + .init(rawValue: "ACCEPTED") + } + + public static var approved: Self { + .init(rawValue: "APPROVED") + } + + public static var developerRejected: Self { + .init(rawValue: "DEVELOPER_REJECTED") + } + + public static var inReview: Self { + .init(rawValue: "IN_REVIEW") + } + + public static var prepareForSubmission: Self { + .init(rawValue: "PREPARE_FOR_SUBMISSION") + } + + public static var readyForReview: Self { + .init(rawValue: "READY_FOR_REVIEW") + } + + public static var rejected: Self { + .init(rawValue: "REJECTED") + } + + public static var replacedWithNewVersion: Self { + .init(rawValue: "REPLACED_WITH_NEW_VERSION") + } + + public static var waitingForReview: Self { + .init(rawValue: "WAITING_FOR_REVIEW") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// filter by attribute 'state' + public static var state: Relation<[State]?> { + .init(key: "filter[state]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var inAppPurchase: Self { + .init(rawValue: "inAppPurchase") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Limit: Hashable { + public subscript () -> Int? { + get { self[Relation(key: "limit")] } + set { self[Relation(key: "limit")] = newValue } + } + + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct Relation: Hashable { + /// maximum number of related images returned (when they are included) + public static var images: Relation { + .init(key: "limit[images]") + } + + /// maximum number of related localizations returned (when they are included) + public static var localizations: Relation { + .init(key: "limit[localizations]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.DELETE.0aabced.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.DELETE.0aabced.generated.swift new file mode 100644 index 00000000..f344ade7 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.DELETE.0aabced.generated.swift @@ -0,0 +1,68 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.SubscriptionGroupLocalizations.ById { + public struct DELETE: Endpoint { + public typealias Parameters = Never + public typealias Response = Void + + public var path: String { + "/v2/subscriptionGroupLocalizations/\(id)" + } + + /// the id of the requested resource + public var id: String + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "DELETE" + return urlRequest + } + + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.GET.0aabced.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.GET.0aabced.generated.swift new file mode 100644 index 00000000..12349491 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.GET.0aabced.generated.swift @@ -0,0 +1,193 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.SubscriptionGroupLocalizations.ById { + public struct GET: Endpoint { + public typealias Response = SubscriptionGroupLocalizationV2Response + + public var path: String { + "/v2/subscriptionGroupLocalizations/\(id)" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[subscriptionGroupLocalizations]", + value: parameters.fields[.subscriptionGroupLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionGroupVersions]", + value: parameters.fields[.subscriptionGroupVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, Single SubscriptionGroupLocalization as `SubscriptionGroupLocalizationV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionGroupLocalizationV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V2.SubscriptionGroupLocalizations.ById.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + /// comma-separated list of relationships to include + public var include: [Include]? + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct SubscriptionGroupLocalizations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var customAppName: Self { + .init(rawValue: "customAppName") + } + + public static var locale: Self { + .init(rawValue: "locale") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionGroupVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscriptionGroup: Self { + .init(rawValue: "subscriptionGroup") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type subscriptionGroupLocalizations + public static var subscriptionGroupLocalizations: Relation<[SubscriptionGroupLocalizations]?> { + .init(key: "fields[subscriptionGroupLocalizations]") + } + + /// the fields to include for returned resources of type subscriptionGroupVersions + public static var subscriptionGroupVersions: Relation<[SubscriptionGroupVersions]?> { + .init(key: "fields[subscriptionGroupVersions]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.PATCH.0aabced.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.PATCH.0aabced.generated.swift new file mode 100644 index 00000000..ac78e8c7 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionGroupLocalizations/ById/SubscriptionGroupLocalizationsById.PATCH.0aabced.generated.swift @@ -0,0 +1,95 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.SubscriptionGroupLocalizations.ById { + public struct PATCH: Endpoint { + public typealias Parameters = SubscriptionGroupLocalizationV2UpdateRequest + public typealias Response = SubscriptionGroupLocalizationV2Response + + public var path: String { + "/v2/subscriptionGroupLocalizations/\(id)" + } + + /// the id of the requested resource + public var id: String + + /// SubscriptionGroupLocalization representation + public var parameters: Parameters + + public init( + id: String, + parameters: Parameters + ) { + self.id = id + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "PATCH" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **200**, Single SubscriptionGroupLocalization as `SubscriptionGroupLocalizationV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionGroupLocalizationV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionGroupLocalizations/SubscriptionGroupLocalizations.POST.8c50399.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionGroupLocalizations/SubscriptionGroupLocalizations.POST.8c50399.generated.swift new file mode 100644 index 00000000..48dc3ade --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionGroupLocalizations/SubscriptionGroupLocalizations.POST.8c50399.generated.swift @@ -0,0 +1,84 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.SubscriptionGroupLocalizations { + public struct POST: Endpoint { + public typealias Parameters = SubscriptionGroupLocalizationV2CreateRequest + public typealias Response = SubscriptionGroupLocalizationV2Response + + public var path: String { + "/v2/subscriptionGroupLocalizations" + } + + /// SubscriptionGroupLocalization representation + public var parameters: Parameters + + public init(parameters: Parameters) { + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "POST" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **201**, Single SubscriptionGroupLocalization as `SubscriptionGroupLocalizationV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 201: + return try jsonDecoder.decode(SubscriptionGroupLocalizationV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionImages/ById/SubscriptionImagesById.DELETE.9c0c38d.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionImages/ById/SubscriptionImagesById.DELETE.9c0c38d.generated.swift new file mode 100644 index 00000000..71b31f77 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionImages/ById/SubscriptionImagesById.DELETE.9c0c38d.generated.swift @@ -0,0 +1,68 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.SubscriptionImages.ById { + public struct DELETE: Endpoint { + public typealias Parameters = Never + public typealias Response = Void + + public var path: String { + "/v2/subscriptionImages/\(id)" + } + + /// the id of the requested resource + public var id: String + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "DELETE" + return urlRequest + } + + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionImages/ById/SubscriptionImagesById.GET.9c0c38d.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionImages/ById/SubscriptionImagesById.GET.9c0c38d.generated.swift new file mode 100644 index 00000000..9f1aabb3 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionImages/ById/SubscriptionImagesById.GET.9c0c38d.generated.swift @@ -0,0 +1,145 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.SubscriptionImages.ById { + public struct GET: Endpoint { + public typealias Response = SubscriptionImageV2Response + + public var path: String { + "/v2/subscriptionImages/\(id)" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[subscriptionImages]", + value: parameters.fields[.subscriptionImages]?.map { "\($0)" }.joined(separator: ",")) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, Single SubscriptionImage as `SubscriptionImageV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionImageV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V2.SubscriptionImages.ById.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct SubscriptionImages: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var assetDeliveryState: Self { + .init(rawValue: "assetDeliveryState") + } + + public static var assetToken: Self { + .init(rawValue: "assetToken") + } + + public static var fileName: Self { + .init(rawValue: "fileName") + } + + public static var fileSize: Self { + .init(rawValue: "fileSize") + } + + public static var imageAsset: Self { + .init(rawValue: "imageAsset") + } + + public static var uploadOperations: Self { + .init(rawValue: "uploadOperations") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type subscriptionImages + public static var subscriptionImages: Relation<[SubscriptionImages]?> { + .init(key: "fields[subscriptionImages]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionImages/ById/SubscriptionImagesById.PATCH.9c0c38d.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionImages/ById/SubscriptionImagesById.PATCH.9c0c38d.generated.swift new file mode 100644 index 00000000..529c5168 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionImages/ById/SubscriptionImagesById.PATCH.9c0c38d.generated.swift @@ -0,0 +1,95 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.SubscriptionImages.ById { + public struct PATCH: Endpoint { + public typealias Parameters = SubscriptionImageV2UpdateRequest + public typealias Response = SubscriptionImageV2Response + + public var path: String { + "/v2/subscriptionImages/\(id)" + } + + /// the id of the requested resource + public var id: String + + /// SubscriptionImage representation + public var parameters: Parameters + + public init( + id: String, + parameters: Parameters + ) { + self.id = id + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "PATCH" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **200**, Single SubscriptionImage as `SubscriptionImageV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionImageV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionImages/SubscriptionImages.POST.a801606.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionImages/SubscriptionImages.POST.a801606.generated.swift new file mode 100644 index 00000000..189bbb32 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionImages/SubscriptionImages.POST.a801606.generated.swift @@ -0,0 +1,84 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.SubscriptionImages { + public struct POST: Endpoint { + public typealias Parameters = SubscriptionImageV2CreateRequest + public typealias Response = SubscriptionImageV2Response + + public var path: String { + "/v2/subscriptionImages" + } + + /// SubscriptionImage representation + public var parameters: Parameters + + public init(parameters: Parameters) { + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "POST" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **201**, Single SubscriptionImage as `SubscriptionImageV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 201: + return try jsonDecoder.decode(SubscriptionImageV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.DELETE.ac21076.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.DELETE.ac21076.generated.swift new file mode 100644 index 00000000..67e6c433 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.DELETE.ac21076.generated.swift @@ -0,0 +1,68 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.SubscriptionLocalizations.ById { + public struct DELETE: Endpoint { + public typealias Parameters = Never + public typealias Response = Void + + public var path: String { + "/v2/subscriptionLocalizations/\(id)" + } + + /// the id of the requested resource + public var id: String + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "DELETE" + return urlRequest + } + + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.GET.ac21076.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.GET.ac21076.generated.swift new file mode 100644 index 00000000..6c92fbc4 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.GET.ac21076.generated.swift @@ -0,0 +1,201 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.SubscriptionLocalizations.ById { + public struct GET: Endpoint { + public typealias Response = SubscriptionLocalizationV2Response + + public var path: String { + "/v2/subscriptionLocalizations/\(id)" + } + + /// the id of the requested resource + public var id: String + + public var parameters: Parameters = Parameters() + + public init(id: String) { + self.id = id + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + components?.queryItems = [ + URLQueryItem(name: "fields[subscriptionLocalizations]", + value: parameters.fields[.subscriptionLocalizations]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "fields[subscriptionVersions]", + value: parameters.fields[.subscriptionVersions]?.map { "\($0)" }.joined(separator: ",")), + URLQueryItem(name: "include", + value: parameters.include?.map { "\($0)" }.joined(separator: ",")) + ].filter { $0.value != nil } + if components?.queryItems?.isEmpty ?? false { + components?.queryItems = nil + } + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "GET" + return urlRequest + } + + /// - Returns: **200**, Single SubscriptionLocalization as `SubscriptionLocalizationV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionLocalizationV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +extension V2.SubscriptionLocalizations.ById.GET { + public struct Parameters: Hashable { + public var fields: Fields = Fields() + + /// comma-separated list of relationships to include + public var include: [Include]? + + public struct Fields: Hashable { + public subscript (_ relation: Relation) -> T { + get { values[relation]?.base as! T } + set { values[relation] = AnyHashable(newValue) } + } + + private var values: [AnyHashable: AnyHashable] = [:] + + public struct SubscriptionLocalizations: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var description: Self { + .init(rawValue: "description") + } + + public static var locale: Self { + .init(rawValue: "locale") + } + + public static var name: Self { + .init(rawValue: "name") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct SubscriptionVersions: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var image: Self { + .init(rawValue: "image") + } + + public static var images: Self { + .init(rawValue: "images") + } + + public static var localizations: Self { + .init(rawValue: "localizations") + } + + public static var state: Self { + .init(rawValue: "state") + } + + public static var subscription: Self { + .init(rawValue: "subscription") + } + + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + + public struct Relation: Hashable { + /// the fields to include for returned resources of type subscriptionLocalizations + public static var subscriptionLocalizations: Relation<[SubscriptionLocalizations]?> { + .init(key: "fields[subscriptionLocalizations]") + } + + /// the fields to include for returned resources of type subscriptionVersions + public static var subscriptionVersions: Relation<[SubscriptionVersions]?> { + .init(key: "fields[subscriptionVersions]") + } + + internal let key: String + + public func hash(into hasher: inout Hasher) { + hasher.combine(key) + } + } + } + + public struct Include: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var version: Self { + .init(rawValue: "version") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.PATCH.ac21076.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.PATCH.ac21076.generated.swift new file mode 100644 index 00000000..29a34068 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionLocalizations/ById/SubscriptionLocalizationsById.PATCH.ac21076.generated.swift @@ -0,0 +1,95 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.SubscriptionLocalizations.ById { + public struct PATCH: Endpoint { + public typealias Parameters = SubscriptionLocalizationV2UpdateRequest + public typealias Response = SubscriptionLocalizationV2Response + + public var path: String { + "/v2/subscriptionLocalizations/\(id)" + } + + /// the id of the requested resource + public var id: String + + /// SubscriptionLocalization representation + public var parameters: Parameters + + public init( + id: String, + parameters: Parameters + ) { + self.id = id + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "PATCH" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **200**, Single SubscriptionLocalization as `SubscriptionLocalizationV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **404**, Not found error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 200: + return try jsonDecoder.decode(SubscriptionLocalizationV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 404: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionLocalizations/SubscriptionLocalizations.POST.4584fde.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionLocalizations/SubscriptionLocalizations.POST.4584fde.generated.swift new file mode 100644 index 00000000..4cc654b4 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Endpoints/V2/SubscriptionLocalizations/SubscriptionLocalizations.POST.4584fde.generated.swift @@ -0,0 +1,84 @@ +// autogenerated + +// swiftlint:disable all +import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + +extension V2.SubscriptionLocalizations { + public struct POST: Endpoint { + public typealias Parameters = SubscriptionLocalizationV2CreateRequest + public typealias Response = SubscriptionLocalizationV2Response + + public var path: String { + "/v2/subscriptionLocalizations" + } + + /// SubscriptionLocalization representation + public var parameters: Parameters + + public init(parameters: Parameters) { + self.parameters = parameters + } + + public func request(with baseURL: URL) throws -> URLRequest? { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) + components?.path = path + + var urlRequest = components?.url.map { URLRequest(url: $0) } + urlRequest?.httpMethod = "POST" + + var jsonEncoder: JSONEncoder { + let encoder = JSONEncoder() + return encoder + } + + urlRequest?.httpBody = try jsonEncoder.encode(parameters) + urlRequest?.setValue("application/json", forHTTPHeaderField: "Content-Type") + return urlRequest + } + + /// - Returns: **201**, Single SubscriptionLocalization as `SubscriptionLocalizationV2Response` + /// - Throws: **400**, Parameter error(s) as `ErrorResponse` + /// - Throws: **401**, Unauthorized error(s) as `ErrorResponse` + /// - Throws: **403**, Forbidden error as `ErrorResponse` + /// - Throws: **409**, Request entity error(s) as `ErrorResponse` + /// - Throws: **422**, Unprocessable request entity error(s) as `ErrorResponse` + /// - Throws: **429**, Rate limit exceeded error as `ErrorResponse` + public static func response(from data: Data, urlResponse: HTTPURLResponse) throws -> Response { + var jsonDecoder: JSONDecoder { + let decoder = JSONDecoder() + return decoder + } + + switch urlResponse.statusCode { + case 201: + return try jsonDecoder.decode(SubscriptionLocalizationV2Response.self, from: data) + + case 400: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 401: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 403: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 409: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 422: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + case 429: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + + default: + throw try jsonDecoder.decode(ErrorResponse.self, from: data) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/AgeRatingDeclaration.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/AgeRatingDeclaration.generated.swift index 4bada0f6..9a267b14 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/AgeRatingDeclaration.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/AgeRatingDeclaration.generated.swift @@ -81,6 +81,10 @@ public struct AgeRatingDeclaration: Hashable, Codable, Sendable { public var sexualContentOrNudity: SexualContentOrNudity? + public var socialMedia: Bool? + + public var socialMediaAgeRestricted: Bool? + public var unrestrictedWebAccess: Bool? public var userGeneratedContent: Bool? @@ -114,6 +118,8 @@ public struct AgeRatingDeclaration: Hashable, Codable, Sendable { profanityOrCrudeHumor: ProfanityOrCrudeHumor? = nil, sexualContentGraphicAndNudity: SexualContentGraphicAndNudity? = nil, sexualContentOrNudity: SexualContentOrNudity? = nil, + socialMedia: Bool? = nil, + socialMediaAgeRestricted: Bool? = nil, unrestrictedWebAccess: Bool? = nil, userGeneratedContent: Bool? = nil, violenceCartoonOrFantasy: ViolenceCartoonOrFantasy? = nil, @@ -142,6 +148,8 @@ public struct AgeRatingDeclaration: Hashable, Codable, Sendable { self.profanityOrCrudeHumor = profanityOrCrudeHumor self.sexualContentGraphicAndNudity = sexualContentGraphicAndNudity self.sexualContentOrNudity = sexualContentOrNudity + self.socialMedia = socialMedia + self.socialMediaAgeRestricted = socialMediaAgeRestricted self.unrestrictedWebAccess = unrestrictedWebAccess self.userGeneratedContent = userGeneratedContent self.violenceCartoonOrFantasy = violenceCartoonOrFantasy @@ -172,6 +180,8 @@ public struct AgeRatingDeclaration: Hashable, Codable, Sendable { case profanityOrCrudeHumor case sexualContentGraphicAndNudity case sexualContentOrNudity + case socialMedia + case socialMediaAgeRestricted case unrestrictedWebAccess case userGeneratedContent case violenceCartoonOrFantasy diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/AppInfo.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/AppInfo.generated.swift index 6a23ac66..20588ba9 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/AppInfo.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/AppInfo.generated.swift @@ -56,6 +56,8 @@ public struct AppInfo: Hashable, Codable, Sendable { @available(*, deprecated) public var franceAgeRating: FranceAgeRating? + public var kidsAgeBand: KidsAgeBand? + @available(*, deprecated) public var koreaAgeRating: KoreaAgeRating? @@ -68,6 +70,7 @@ public struct AppInfo: Hashable, Codable, Sendable { brazilAgeRating: BrazilAgeRating? = nil, brazilAgeRatingV2: BrazilAgeRatingV2? = nil, franceAgeRating: FranceAgeRating? = nil, + kidsAgeBand: KidsAgeBand? = nil, koreaAgeRating: KoreaAgeRating? = nil, state: State? = nil ) { @@ -77,6 +80,7 @@ public struct AppInfo: Hashable, Codable, Sendable { self.brazilAgeRating = brazilAgeRating self.brazilAgeRatingV2 = brazilAgeRatingV2 self.franceAgeRating = franceAgeRating + self.kidsAgeBand = kidsAgeBand self.koreaAgeRating = koreaAgeRating self.state = state } @@ -88,6 +92,7 @@ public struct AppInfo: Hashable, Codable, Sendable { case brazilAgeRating case brazilAgeRatingV2 case franceAgeRating + case kidsAgeBand case koreaAgeRating case state } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseImageV2.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseImageV2.generated.swift new file mode 100644 index 00000000..1deaa3ca --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseImageV2.generated.swift @@ -0,0 +1,78 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseImageV2: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public var links: ResourceLinks? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil, + links: ResourceLinks? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + case links + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseImages + } + + public struct Attributes: Hashable, Codable, Sendable { + public var assetDeliveryState: AppMediaAssetState? + + public var assetToken: String? + + public var fileName: String? + + public var fileSize: Int? + + public var imageAsset: ImageAsset? + + public var uploadOperations: [UploadOperation]? + + public init( + assetDeliveryState: AppMediaAssetState? = nil, + assetToken: String? = nil, + fileName: String? = nil, + fileSize: Int? = nil, + imageAsset: ImageAsset? = nil, + uploadOperations: [UploadOperation]? = nil + ) { + self.assetDeliveryState = assetDeliveryState + self.assetToken = assetToken + self.fileName = fileName + self.fileSize = fileSize + self.imageAsset = imageAsset + self.uploadOperations = uploadOperations + } + + private enum CodingKeys: String, CodingKey { + case assetDeliveryState + case assetToken + case fileName + case fileSize + case imageAsset + case uploadOperations + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseLocalizationV2.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseLocalizationV2.generated.swift new file mode 100644 index 00000000..940fa07d --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseLocalizationV2.generated.swift @@ -0,0 +1,115 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseLocalizationV2: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public var relationships: Relationships? + + public var links: ResourceLinks? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil, + relationships: Relationships? = nil, + links: ResourceLinks? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + self.relationships = relationships + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + case relationships + case links + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseLocalizations + } + + public struct Attributes: Hashable, Codable, Sendable { + public var description: String? + + public var locale: String? + + public var name: String? + + public init( + description: String? = nil, + locale: String? = nil, + name: String? = nil + ) { + self.description = description + self.locale = locale + self.name = name + } + + private enum CodingKeys: String, CodingKey { + case description + case locale + case name + } + } + + public struct Relationships: Hashable, Codable, Sendable { + public var version: Version? + + public init(version: Version? = nil) { + self.version = version + } + + private enum CodingKeys: String, CodingKey { + case version + } + + public struct Version: Hashable, Codable, Sendable { + public var data: Data? + + public init(data: Data? = nil) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseVersions + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseV2.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseV2.generated.swift index 55f51a13..a8657117 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseV2.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseV2.generated.swift @@ -103,6 +103,8 @@ public struct InAppPurchaseV2: Hashable, Codable, Sendable { public var promotedPurchase: PromotedPurchase? + public var versions: Versions? + public init( appStoreReviewScreenshot: AppStoreReviewScreenshot? = nil, content: Content? = nil, @@ -112,7 +114,8 @@ public struct InAppPurchaseV2: Hashable, Codable, Sendable { inAppPurchaseLocalizations: InAppPurchaseLocalizations? = nil, offerCodes: OfferCodes? = nil, pricePoints: PricePoints? = nil, - promotedPurchase: PromotedPurchase? = nil + promotedPurchase: PromotedPurchase? = nil, + versions: Versions? = nil ) { self.appStoreReviewScreenshot = appStoreReviewScreenshot self.content = content @@ -123,6 +126,7 @@ public struct InAppPurchaseV2: Hashable, Codable, Sendable { self.offerCodes = offerCodes self.pricePoints = pricePoints self.promotedPurchase = promotedPurchase + self.versions = versions } private enum CodingKeys: String, CodingKey { @@ -135,6 +139,7 @@ public struct InAppPurchaseV2: Hashable, Codable, Sendable { case offerCodes case pricePoints case promotedPurchase + case versions } public struct AppStoreReviewScreenshot: Hashable, Codable, Sendable { @@ -534,6 +539,53 @@ public struct InAppPurchaseV2: Hashable, Codable, Sendable { } } } + + public struct Versions: Hashable, Codable, Sendable { + public var data: [Data]? + + public var links: RelationshipLinks? + + public var meta: PagingInformation? + + public init( + data: [Data]? = nil, + links: RelationshipLinks? = nil, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseVersions + } + } + } } } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseVersion.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseVersion.generated.swift new file mode 100644 index 00000000..69d4ae7b --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/InAppPurchaseVersion.generated.swift @@ -0,0 +1,311 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseVersion: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public var relationships: Relationships? + + public var links: ResourceLinks? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil, + relationships: Relationships? = nil, + links: ResourceLinks? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + self.relationships = relationships + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + case relationships + case links + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseVersions + } + + public struct Attributes: Hashable, Codable, Sendable { + public var state: State? + + public var version: Int? + + public init( + state: State? = nil, + version: Int? = nil + ) { + self.state = state + self.version = version + } + + private enum CodingKeys: String, CodingKey { + case state + case version + } + + public struct State: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var accepted: Self { + .init(rawValue: "ACCEPTED") + } + + public static var approved: Self { + .init(rawValue: "APPROVED") + } + + public static var developerRejected: Self { + .init(rawValue: "DEVELOPER_REJECTED") + } + + public static var inReview: Self { + .init(rawValue: "IN_REVIEW") + } + + public static var prepareForSubmission: Self { + .init(rawValue: "PREPARE_FOR_SUBMISSION") + } + + public static var readyForReview: Self { + .init(rawValue: "READY_FOR_REVIEW") + } + + public static var rejected: Self { + .init(rawValue: "REJECTED") + } + + public static var replacedWithNewVersion: Self { + .init(rawValue: "REPLACED_WITH_NEW_VERSION") + } + + public static var waitingForReview: Self { + .init(rawValue: "WAITING_FOR_REVIEW") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + } + + public struct Relationships: Hashable, Codable, Sendable { + public var image: Image? + + public var images: Images? + + public var inAppPurchase: InAppPurchase? + + public var localizations: Localizations? + + public init( + image: Image? = nil, + images: Images? = nil, + inAppPurchase: InAppPurchase? = nil, + localizations: Localizations? = nil + ) { + self.image = image + self.images = images + self.inAppPurchase = inAppPurchase + self.localizations = localizations + } + + private enum CodingKeys: String, CodingKey { + case image + case images + case inAppPurchase + case localizations + } + + public struct Image: Hashable, Codable, Sendable { + public var data: Data? + + public var links: RelationshipLinks? + + public init( + data: Data? = nil, + links: RelationshipLinks? = nil + ) { + self.data = data + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case data + case links + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseImages + } + } + } + + public struct Images: Hashable, Codable, Sendable { + public var data: [Data]? + + public var links: RelationshipLinks? + + public var meta: PagingInformation? + + public init( + data: [Data]? = nil, + links: RelationshipLinks? = nil, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseImages + } + } + } + + public struct InAppPurchase: Hashable, Codable, Sendable { + public var data: Data? + + public init(data: Data? = nil) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchases + } + } + } + + public struct Localizations: Hashable, Codable, Sendable { + public var data: [Data]? + + public var links: RelationshipLinks? + + public var meta: PagingInformation? + + public init( + data: [Data]? = nil, + links: RelationshipLinks? = nil, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseLocalizations + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/AgeRatingDeclarationUpdateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/AgeRatingDeclarationUpdateRequest.generated.swift index c20d2b2b..af5e52b2 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/AgeRatingDeclarationUpdateRequest.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/AgeRatingDeclarationUpdateRequest.generated.swift @@ -87,6 +87,10 @@ public struct AgeRatingDeclarationUpdateRequest: Hashable, Codable, Sendable { public var sexualContentOrNudity: SexualContentOrNudity? + public var socialMedia: Bool? + + public var socialMediaAgeRestricted: Bool? + public var unrestrictedWebAccess: Bool? public var userGeneratedContent: Bool? @@ -120,6 +124,8 @@ public struct AgeRatingDeclarationUpdateRequest: Hashable, Codable, Sendable { profanityOrCrudeHumor: ProfanityOrCrudeHumor? = nil, sexualContentGraphicAndNudity: SexualContentGraphicAndNudity? = nil, sexualContentOrNudity: SexualContentOrNudity? = nil, + socialMedia: Bool? = nil, + socialMediaAgeRestricted: Bool? = nil, unrestrictedWebAccess: Bool? = nil, userGeneratedContent: Bool? = nil, violenceCartoonOrFantasy: ViolenceCartoonOrFantasy? = nil, @@ -148,6 +154,8 @@ public struct AgeRatingDeclarationUpdateRequest: Hashable, Codable, Sendable { self.profanityOrCrudeHumor = profanityOrCrudeHumor self.sexualContentGraphicAndNudity = sexualContentGraphicAndNudity self.sexualContentOrNudity = sexualContentOrNudity + self.socialMedia = socialMedia + self.socialMediaAgeRestricted = socialMediaAgeRestricted self.unrestrictedWebAccess = unrestrictedWebAccess self.userGeneratedContent = userGeneratedContent self.violenceCartoonOrFantasy = violenceCartoonOrFantasy @@ -178,6 +186,8 @@ public struct AgeRatingDeclarationUpdateRequest: Hashable, Codable, Sendable { case profanityOrCrudeHumor case sexualContentGraphicAndNudity case sexualContentOrNudity + case socialMedia + case socialMediaAgeRestricted case unrestrictedWebAccess case userGeneratedContent case violenceCartoonOrFantasy diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseImageV2CreateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseImageV2CreateRequest.generated.swift new file mode 100644 index 00000000..ce4129d9 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseImageV2CreateRequest.generated.swift @@ -0,0 +1,112 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseImageV2CreateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var type: `Type` + + public var attributes: Attributes + + public var relationships: Relationships + + public init( + type: `Type`, + attributes: Attributes, + relationships: Relationships + ) { + self.type = type + self.attributes = attributes + self.relationships = relationships + } + + private enum CodingKeys: String, CodingKey { + case type + case attributes + case relationships + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseImages + } + + public struct Attributes: Hashable, Codable, Sendable { + public var fileName: String + + public var fileSize: Int + + public init( + fileName: String, + fileSize: Int + ) { + self.fileName = fileName + self.fileSize = fileSize + } + + private enum CodingKeys: String, CodingKey { + case fileName + case fileSize + } + } + + public struct Relationships: Hashable, Codable, Sendable { + public var version: Version + + public init(version: Version) { + self.version = version + } + + private enum CodingKeys: String, CodingKey { + case version + } + + public struct Version: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseVersions + } + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseImageV2UpdateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseImageV2UpdateRequest.generated.swift new file mode 100644 index 00000000..d1266810 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseImageV2UpdateRequest.generated.swift @@ -0,0 +1,58 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseImageV2UpdateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseImages + } + + public struct Attributes: Hashable, Codable, Sendable { + public var uploaded: Bool? + + public init(uploaded: Bool? = nil) { + self.uploaded = uploaded + } + + private enum CodingKeys: String, CodingKey { + case uploaded + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseLocalizationV2CreateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseLocalizationV2CreateRequest.generated.swift new file mode 100644 index 00000000..d922c7d1 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseLocalizationV2CreateRequest.generated.swift @@ -0,0 +1,117 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseLocalizationV2CreateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var type: `Type` + + public var attributes: Attributes + + public var relationships: Relationships + + public init( + type: `Type`, + attributes: Attributes, + relationships: Relationships + ) { + self.type = type + self.attributes = attributes + self.relationships = relationships + } + + private enum CodingKeys: String, CodingKey { + case type + case attributes + case relationships + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseLocalizations + } + + public struct Attributes: Hashable, Codable, Sendable { + public var description: String? + + public var locale: String + + public var name: String + + public init( + description: String? = nil, + locale: String, + name: String + ) { + self.description = description + self.locale = locale + self.name = name + } + + private enum CodingKeys: String, CodingKey { + case description + case locale + case name + } + } + + public struct Relationships: Hashable, Codable, Sendable { + public var version: Version + + public init(version: Version) { + self.version = version + } + + private enum CodingKeys: String, CodingKey { + case version + } + + public struct Version: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseVersions + } + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseLocalizationV2UpdateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseLocalizationV2UpdateRequest.generated.swift new file mode 100644 index 00000000..c31f9710 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseLocalizationV2UpdateRequest.generated.swift @@ -0,0 +1,65 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseLocalizationV2UpdateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseLocalizations + } + + public struct Attributes: Hashable, Codable, Sendable { + public var description: String? + + public var name: String? + + public init( + description: String? = nil, + name: String? = nil + ) { + self.description = description + self.name = name + } + + private enum CodingKeys: String, CodingKey { + case description + case name + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseVersionCreateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseVersionCreateRequest.generated.swift new file mode 100644 index 00000000..96841465 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/InAppPurchaseVersionCreateRequest.generated.swift @@ -0,0 +1,88 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseVersionCreateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var type: `Type` + + public var relationships: Relationships + + public init( + type: `Type`, + relationships: Relationships + ) { + self.type = type + self.relationships = relationships + } + + private enum CodingKeys: String, CodingKey { + case type + case relationships + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseVersions + } + + public struct Relationships: Hashable, Codable, Sendable { + public var inAppPurchase: InAppPurchase + + public init(inAppPurchase: InAppPurchase) { + self.inAppPurchase = inAppPurchase + } + + private enum CodingKeys: String, CodingKey { + case inAppPurchase + } + + public struct InAppPurchase: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchases + } + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/ReviewSubmissionItemCreateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/ReviewSubmissionItemCreateRequest.generated.swift index 9d41c72d..b22f0626 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/ReviewSubmissionItemCreateRequest.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/ReviewSubmissionItemCreateRequest.generated.swift @@ -59,8 +59,14 @@ public struct ReviewSubmissionItemCreateRequest: Hashable, Codable, Sendable { public var gameCenterLeaderboardVersion: GameCenterLeaderboardVersion? + public var inAppPurchaseVersion: InAppPurchaseVersion? + public var reviewSubmission: ReviewSubmission + public var subscriptionGroupVersion: SubscriptionGroupVersion? + + public var subscriptionVersion: SubscriptionVersion? + public init( appCustomProductPageVersion: AppCustomProductPageVersion? = nil, appEvent: AppEvent? = nil, @@ -73,7 +79,10 @@ public struct ReviewSubmissionItemCreateRequest: Hashable, Codable, Sendable { gameCenterChallengeVersion: GameCenterChallengeVersion? = nil, gameCenterLeaderboardSetVersion: GameCenterLeaderboardSetVersion? = nil, gameCenterLeaderboardVersion: GameCenterLeaderboardVersion? = nil, - reviewSubmission: ReviewSubmission + inAppPurchaseVersion: InAppPurchaseVersion? = nil, + reviewSubmission: ReviewSubmission, + subscriptionGroupVersion: SubscriptionGroupVersion? = nil, + subscriptionVersion: SubscriptionVersion? = nil ) { self.appCustomProductPageVersion = appCustomProductPageVersion self.appEvent = appEvent @@ -86,7 +95,10 @@ public struct ReviewSubmissionItemCreateRequest: Hashable, Codable, Sendable { self.gameCenterChallengeVersion = gameCenterChallengeVersion self.gameCenterLeaderboardSetVersion = gameCenterLeaderboardSetVersion self.gameCenterLeaderboardVersion = gameCenterLeaderboardVersion + self.inAppPurchaseVersion = inAppPurchaseVersion self.reviewSubmission = reviewSubmission + self.subscriptionGroupVersion = subscriptionGroupVersion + self.subscriptionVersion = subscriptionVersion } private enum CodingKeys: String, CodingKey { @@ -101,7 +113,10 @@ public struct ReviewSubmissionItemCreateRequest: Hashable, Codable, Sendable { case gameCenterChallengeVersion case gameCenterLeaderboardSetVersion case gameCenterLeaderboardVersion + case inAppPurchaseVersion case reviewSubmission + case subscriptionGroupVersion + case subscriptionVersion } public struct AppCustomProductPageVersion: Hashable, Codable, Sendable { @@ -489,6 +504,41 @@ public struct ReviewSubmissionItemCreateRequest: Hashable, Codable, Sendable { } } + public struct InAppPurchaseVersion: Hashable, Codable, Sendable { + public var data: Data? + + public init(data: Data? = nil) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseVersions + } + } + } + public struct ReviewSubmission: Hashable, Codable, Sendable { public var data: Data @@ -523,6 +573,76 @@ public struct ReviewSubmissionItemCreateRequest: Hashable, Codable, Sendable { } } } + + public struct SubscriptionGroupVersion: Hashable, Codable, Sendable { + public var data: Data? + + public init(data: Data? = nil) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupVersions + } + } + } + + public struct SubscriptionVersion: Hashable, Codable, Sendable { + public var data: Data? + + public init(data: Data? = nil) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionVersions + } + } + } } } } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionGroupLocalizationV2CreateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionGroupLocalizationV2CreateRequest.generated.swift new file mode 100644 index 00000000..b462d0a7 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionGroupLocalizationV2CreateRequest.generated.swift @@ -0,0 +1,117 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionGroupLocalizationV2CreateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var type: `Type` + + public var attributes: Attributes + + public var relationships: Relationships + + public init( + type: `Type`, + attributes: Attributes, + relationships: Relationships + ) { + self.type = type + self.attributes = attributes + self.relationships = relationships + } + + private enum CodingKeys: String, CodingKey { + case type + case attributes + case relationships + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupLocalizations + } + + public struct Attributes: Hashable, Codable, Sendable { + public var customAppName: String? + + public var locale: String + + public var name: String + + public init( + customAppName: String? = nil, + locale: String, + name: String + ) { + self.customAppName = customAppName + self.locale = locale + self.name = name + } + + private enum CodingKeys: String, CodingKey { + case customAppName + case locale + case name + } + } + + public struct Relationships: Hashable, Codable, Sendable { + public var version: Version + + public init(version: Version) { + self.version = version + } + + private enum CodingKeys: String, CodingKey { + case version + } + + public struct Version: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupVersions + } + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionGroupLocalizationV2UpdateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionGroupLocalizationV2UpdateRequest.generated.swift new file mode 100644 index 00000000..64f68650 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionGroupLocalizationV2UpdateRequest.generated.swift @@ -0,0 +1,65 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionGroupLocalizationV2UpdateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupLocalizations + } + + public struct Attributes: Hashable, Codable, Sendable { + public var customAppName: String? + + public var name: String? + + public init( + customAppName: String? = nil, + name: String? = nil + ) { + self.customAppName = customAppName + self.name = name + } + + private enum CodingKeys: String, CodingKey { + case customAppName + case name + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionGroupVersionCreateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionGroupVersionCreateRequest.generated.swift new file mode 100644 index 00000000..025238c8 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionGroupVersionCreateRequest.generated.swift @@ -0,0 +1,88 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionGroupVersionCreateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var type: `Type` + + public var relationships: Relationships + + public init( + type: `Type`, + relationships: Relationships + ) { + self.type = type + self.relationships = relationships + } + + private enum CodingKeys: String, CodingKey { + case type + case relationships + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupVersions + } + + public struct Relationships: Hashable, Codable, Sendable { + public var subscriptionGroup: SubscriptionGroup + + public init(subscriptionGroup: SubscriptionGroup) { + self.subscriptionGroup = subscriptionGroup + } + + private enum CodingKeys: String, CodingKey { + case subscriptionGroup + } + + public struct SubscriptionGroup: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroups + } + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionImageV2CreateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionImageV2CreateRequest.generated.swift new file mode 100644 index 00000000..615dcca0 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionImageV2CreateRequest.generated.swift @@ -0,0 +1,112 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionImageV2CreateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var type: `Type` + + public var attributes: Attributes + + public var relationships: Relationships + + public init( + type: `Type`, + attributes: Attributes, + relationships: Relationships + ) { + self.type = type + self.attributes = attributes + self.relationships = relationships + } + + private enum CodingKeys: String, CodingKey { + case type + case attributes + case relationships + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionImages + } + + public struct Attributes: Hashable, Codable, Sendable { + public var fileName: String + + public var fileSize: Int + + public init( + fileName: String, + fileSize: Int + ) { + self.fileName = fileName + self.fileSize = fileSize + } + + private enum CodingKeys: String, CodingKey { + case fileName + case fileSize + } + } + + public struct Relationships: Hashable, Codable, Sendable { + public var version: Version + + public init(version: Version) { + self.version = version + } + + private enum CodingKeys: String, CodingKey { + case version + } + + public struct Version: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionVersions + } + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionImageV2UpdateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionImageV2UpdateRequest.generated.swift new file mode 100644 index 00000000..dc9133e7 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionImageV2UpdateRequest.generated.swift @@ -0,0 +1,58 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionImageV2UpdateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionImages + } + + public struct Attributes: Hashable, Codable, Sendable { + public var uploaded: Bool? + + public init(uploaded: Bool? = nil) { + self.uploaded = uploaded + } + + private enum CodingKeys: String, CodingKey { + case uploaded + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionLocalizationV2CreateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionLocalizationV2CreateRequest.generated.swift new file mode 100644 index 00000000..e7e5c4ab --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionLocalizationV2CreateRequest.generated.swift @@ -0,0 +1,117 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionLocalizationV2CreateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var type: `Type` + + public var attributes: Attributes + + public var relationships: Relationships + + public init( + type: `Type`, + attributes: Attributes, + relationships: Relationships + ) { + self.type = type + self.attributes = attributes + self.relationships = relationships + } + + private enum CodingKeys: String, CodingKey { + case type + case attributes + case relationships + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionLocalizations + } + + public struct Attributes: Hashable, Codable, Sendable { + public var description: String? + + public var locale: String + + public var name: String + + public init( + description: String? = nil, + locale: String, + name: String + ) { + self.description = description + self.locale = locale + self.name = name + } + + private enum CodingKeys: String, CodingKey { + case description + case locale + case name + } + } + + public struct Relationships: Hashable, Codable, Sendable { + public var version: Version + + public init(version: Version) { + self.version = version + } + + private enum CodingKeys: String, CodingKey { + case version + } + + public struct Version: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionVersions + } + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionLocalizationV2UpdateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionLocalizationV2UpdateRequest.generated.swift new file mode 100644 index 00000000..d19ba6b0 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionLocalizationV2UpdateRequest.generated.swift @@ -0,0 +1,65 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionLocalizationV2UpdateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionLocalizations + } + + public struct Attributes: Hashable, Codable, Sendable { + public var description: String? + + public var name: String? + + public init( + description: String? = nil, + name: String? = nil + ) { + self.description = description + self.name = name + } + + private enum CodingKeys: String, CodingKey { + case description + case name + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionVersionCreateRequest.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionVersionCreateRequest.generated.swift new file mode 100644 index 00000000..788ae08d --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Requests/SubscriptionVersionCreateRequest.generated.swift @@ -0,0 +1,88 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionVersionCreateRequest: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var type: `Type` + + public var relationships: Relationships + + public init( + type: `Type`, + relationships: Relationships + ) { + self.type = type + self.relationships = relationships + } + + private enum CodingKeys: String, CodingKey { + case type + case relationships + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionVersions + } + + public struct Relationships: Hashable, Codable, Sendable { + public var subscription: Subscription + + public init(subscription: Subscription) { + self.subscription = subscription + } + + private enum CodingKeys: String, CodingKey { + case subscription + } + + public struct Subscription: Hashable, Codable, Sendable { + public var data: Data + + public init(data: Data) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptions + } + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseImageV2Response.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseImageV2Response.generated.swift new file mode 100644 index 00000000..de8c08b7 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseImageV2Response.generated.swift @@ -0,0 +1,25 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseImageV2Response: Hashable, Codable, Sendable { + public var data: InAppPurchaseImageV2 + + public var links: DocumentLinks + + public init( + data: InAppPurchaseImageV2, + links: DocumentLinks + ) { + self.data = data + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case data + case links + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseImagesV2Response.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseImagesV2Response.generated.swift new file mode 100644 index 00000000..05951623 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseImagesV2Response.generated.swift @@ -0,0 +1,30 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseImagesV2Response: Hashable, Codable, Sendable { + public var data: [InAppPurchaseImageV2] + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [InAppPurchaseImageV2], + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseLocalizationV2Response.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseLocalizationV2Response.generated.swift new file mode 100644 index 00000000..e84da41a --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseLocalizationV2Response.generated.swift @@ -0,0 +1,30 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseLocalizationV2Response: Hashable, Codable, Sendable { + public var data: InAppPurchaseLocalizationV2 + + public var included: [InAppPurchaseVersion]? + + public var links: DocumentLinks + + public init( + data: InAppPurchaseLocalizationV2, + included: [InAppPurchaseVersion]? = nil, + links: DocumentLinks + ) { + self.data = data + self.included = included + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case data + case included + case links + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseLocalizationsV2Response.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseLocalizationsV2Response.generated.swift new file mode 100644 index 00000000..631e7e42 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseLocalizationsV2Response.generated.swift @@ -0,0 +1,35 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseLocalizationsV2Response: Hashable, Codable, Sendable { + public var data: [InAppPurchaseLocalizationV2] + + public var included: [InAppPurchaseVersion]? + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [InAppPurchaseLocalizationV2], + included: [InAppPurchaseVersion]? = nil, + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.included = included + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case included + case links + case meta + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseV2Response.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseV2Response.generated.swift index 75a0c048..a7089f44 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseV2Response.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseV2Response.generated.swift @@ -35,6 +35,7 @@ public struct InAppPurchaseV2Response: Hashable, Codable, Sendable { case inAppPurchaseOfferCode(InAppPurchaseOfferCode) case inAppPurchasePricePoint(InAppPurchasePricePoint) case inAppPurchasePriceSchedule(InAppPurchasePriceSchedule) + case inAppPurchaseVersion(InAppPurchaseVersion) case promotedPurchase(PromotedPurchase) public init(from decoder: Decoder) throws { @@ -80,6 +81,11 @@ public struct InAppPurchaseV2Response: Hashable, Codable, Sendable { } catch { lastError = error } + do { + return .inAppPurchaseVersion(try InAppPurchaseVersion(from: decoder)) + } catch { + lastError = error + } do { return .promotedPurchase(try PromotedPurchase(from: decoder)) } catch { @@ -115,6 +121,9 @@ public struct InAppPurchaseV2Response: Hashable, Codable, Sendable { case .inAppPurchasePriceSchedule(let value): try value.encode(to: encoder) + case .inAppPurchaseVersion(let value): + try value.encode(to: encoder) + case .promotedPurchase(let value): try value.encode(to: encoder) } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseV2VersionsLinkagesResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseV2VersionsLinkagesResponse.generated.swift new file mode 100644 index 00000000..3825f1d4 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseV2VersionsLinkagesResponse.generated.swift @@ -0,0 +1,53 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseV2VersionsLinkagesResponse: Hashable, Codable, Sendable { + public var data: [Data] + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [Data], + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseVersions + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionImageLinkageResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionImageLinkageResponse.generated.swift new file mode 100644 index 00000000..725572f1 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionImageLinkageResponse.generated.swift @@ -0,0 +1,48 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseVersionImageLinkageResponse: Hashable, Codable, Sendable { + public var data: Data + + public var links: DocumentLinks + + public init( + data: Data, + links: DocumentLinks + ) { + self.data = data + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case data + case links + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseImages + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionImagesLinkagesResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionImagesLinkagesResponse.generated.swift new file mode 100644 index 00000000..8d74c2f5 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionImagesLinkagesResponse.generated.swift @@ -0,0 +1,53 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseVersionImagesLinkagesResponse: Hashable, Codable, Sendable { + public var data: [Data] + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [Data], + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseImages + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionLocalizationsLinkagesResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionLocalizationsLinkagesResponse.generated.swift new file mode 100644 index 00000000..f6d43093 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionLocalizationsLinkagesResponse.generated.swift @@ -0,0 +1,53 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseVersionLocalizationsLinkagesResponse: Hashable, Codable, Sendable { + public var data: [Data] + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [Data], + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseLocalizations + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionResponse.generated.swift new file mode 100644 index 00000000..ff9d7b25 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionResponse.generated.swift @@ -0,0 +1,71 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseVersionResponse: Hashable, Codable, Sendable { + public var data: InAppPurchaseVersion + + public var included: [Included]? + + public var links: DocumentLinks + + public init( + data: InAppPurchaseVersion, + included: [Included]? = nil, + links: DocumentLinks + ) { + self.data = data + self.included = included + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case data + case included + case links + } + + public enum Included: Hashable, Codable, Sendable { + case inAppPurchaseImageV2(InAppPurchaseImageV2) + case inAppPurchaseLocalizationV2(InAppPurchaseLocalizationV2) + case inAppPurchaseV2(InAppPurchaseV2) + + public init(from decoder: Decoder) throws { + self = try { + var lastError: Error! + do { + return .inAppPurchaseImageV2(try InAppPurchaseImageV2(from: decoder)) + } catch { + lastError = error + } + do { + return .inAppPurchaseLocalizationV2(try InAppPurchaseLocalizationV2(from: decoder)) + } catch { + lastError = error + } + do { + return .inAppPurchaseV2(try InAppPurchaseV2(from: decoder)) + } catch { + lastError = error + } + throw lastError + }() + } + + public func encode(to encoder: Encoder) throws { + switch self { + case .inAppPurchaseImageV2(let value): + try value.encode(to: encoder) + + case .inAppPurchaseLocalizationV2(let value): + try value.encode(to: encoder) + + case .inAppPurchaseV2(let value): + try value.encode(to: encoder) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionsResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionsResponse.generated.swift new file mode 100644 index 00000000..415935b3 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchaseVersionsResponse.generated.swift @@ -0,0 +1,76 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct InAppPurchaseVersionsResponse: Hashable, Codable, Sendable { + public var data: [InAppPurchaseVersion] + + public var included: [Included]? + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [InAppPurchaseVersion], + included: [Included]? = nil, + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.included = included + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case included + case links + case meta + } + + public enum Included: Hashable, Codable, Sendable { + case inAppPurchaseImageV2(InAppPurchaseImageV2) + case inAppPurchaseLocalizationV2(InAppPurchaseLocalizationV2) + case inAppPurchaseV2(InAppPurchaseV2) + + public init(from decoder: Decoder) throws { + self = try { + var lastError: Error! + do { + return .inAppPurchaseImageV2(try InAppPurchaseImageV2(from: decoder)) + } catch { + lastError = error + } + do { + return .inAppPurchaseLocalizationV2(try InAppPurchaseLocalizationV2(from: decoder)) + } catch { + lastError = error + } + do { + return .inAppPurchaseV2(try InAppPurchaseV2(from: decoder)) + } catch { + lastError = error + } + throw lastError + }() + } + + public func encode(to encoder: Encoder) throws { + switch self { + case .inAppPurchaseImageV2(let value): + try value.encode(to: encoder) + + case .inAppPurchaseLocalizationV2(let value): + try value.encode(to: encoder) + + case .inAppPurchaseV2(let value): + try value.encode(to: encoder) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchasesV2Response.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchasesV2Response.generated.swift index 8e60f60d..f3ccc870 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchasesV2Response.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/InAppPurchasesV2Response.generated.swift @@ -40,6 +40,7 @@ public struct InAppPurchasesV2Response: Hashable, Codable, Sendable { case inAppPurchaseOfferCode(InAppPurchaseOfferCode) case inAppPurchasePricePoint(InAppPurchasePricePoint) case inAppPurchasePriceSchedule(InAppPurchasePriceSchedule) + case inAppPurchaseVersion(InAppPurchaseVersion) case promotedPurchase(PromotedPurchase) public init(from decoder: Decoder) throws { @@ -85,6 +86,11 @@ public struct InAppPurchasesV2Response: Hashable, Codable, Sendable { } catch { lastError = error } + do { + return .inAppPurchaseVersion(try InAppPurchaseVersion(from: decoder)) + } catch { + lastError = error + } do { return .promotedPurchase(try PromotedPurchase(from: decoder)) } catch { @@ -120,6 +126,9 @@ public struct InAppPurchasesV2Response: Hashable, Codable, Sendable { case .inAppPurchasePriceSchedule(let value): try value.encode(to: encoder) + case .inAppPurchaseVersion(let value): + try value.encode(to: encoder) + case .promotedPurchase(let value): try value.encode(to: encoder) } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/ReviewSubmissionItemResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/ReviewSubmissionItemResponse.generated.swift index e3f37bec..eab0e7ce 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/ReviewSubmissionItemResponse.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/ReviewSubmissionItemResponse.generated.swift @@ -37,6 +37,9 @@ public struct ReviewSubmissionItemResponse: Hashable, Codable, Sendable { case gameCenterChallengeVersion(GameCenterChallengeVersion) case gameCenterLeaderboardSetVersionV2(GameCenterLeaderboardSetVersionV2) case gameCenterLeaderboardVersionV2(GameCenterLeaderboardVersionV2) + case inAppPurchaseVersion(InAppPurchaseVersion) + case subscriptionGroupVersion(SubscriptionGroupVersion) + case subscriptionVersion(SubscriptionVersion) public init(from decoder: Decoder) throws { self = try { @@ -91,6 +94,21 @@ public struct ReviewSubmissionItemResponse: Hashable, Codable, Sendable { } catch { lastError = error } + do { + return .inAppPurchaseVersion(try InAppPurchaseVersion(from: decoder)) + } catch { + lastError = error + } + do { + return .subscriptionGroupVersion(try SubscriptionGroupVersion(from: decoder)) + } catch { + lastError = error + } + do { + return .subscriptionVersion(try SubscriptionVersion(from: decoder)) + } catch { + lastError = error + } throw lastError }() } @@ -126,6 +144,15 @@ public struct ReviewSubmissionItemResponse: Hashable, Codable, Sendable { case .gameCenterLeaderboardVersionV2(let value): try value.encode(to: encoder) + + case .inAppPurchaseVersion(let value): + try value.encode(to: encoder) + + case .subscriptionGroupVersion(let value): + try value.encode(to: encoder) + + case .subscriptionVersion(let value): + try value.encode(to: encoder) } } } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/ReviewSubmissionItemsResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/ReviewSubmissionItemsResponse.generated.swift index 3fde252c..d9bd4cdc 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/ReviewSubmissionItemsResponse.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/ReviewSubmissionItemsResponse.generated.swift @@ -42,6 +42,9 @@ public struct ReviewSubmissionItemsResponse: Hashable, Codable, Sendable { case gameCenterChallengeVersion(GameCenterChallengeVersion) case gameCenterLeaderboardSetVersionV2(GameCenterLeaderboardSetVersionV2) case gameCenterLeaderboardVersionV2(GameCenterLeaderboardVersionV2) + case inAppPurchaseVersion(InAppPurchaseVersion) + case subscriptionGroupVersion(SubscriptionGroupVersion) + case subscriptionVersion(SubscriptionVersion) public init(from decoder: Decoder) throws { self = try { @@ -96,6 +99,21 @@ public struct ReviewSubmissionItemsResponse: Hashable, Codable, Sendable { } catch { lastError = error } + do { + return .inAppPurchaseVersion(try InAppPurchaseVersion(from: decoder)) + } catch { + lastError = error + } + do { + return .subscriptionGroupVersion(try SubscriptionGroupVersion(from: decoder)) + } catch { + lastError = error + } + do { + return .subscriptionVersion(try SubscriptionVersion(from: decoder)) + } catch { + lastError = error + } throw lastError }() } @@ -131,6 +149,15 @@ public struct ReviewSubmissionItemsResponse: Hashable, Codable, Sendable { case .gameCenterLeaderboardVersionV2(let value): try value.encode(to: encoder) + + case .inAppPurchaseVersion(let value): + try value.encode(to: encoder) + + case .subscriptionGroupVersion(let value): + try value.encode(to: encoder) + + case .subscriptionVersion(let value): + try value.encode(to: encoder) } } } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupLocalizationV2Response.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupLocalizationV2Response.generated.swift new file mode 100644 index 00000000..632dad39 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupLocalizationV2Response.generated.swift @@ -0,0 +1,30 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionGroupLocalizationV2Response: Hashable, Codable, Sendable { + public var data: SubscriptionGroupLocalizationV2 + + public var included: [SubscriptionGroupVersion]? + + public var links: DocumentLinks + + public init( + data: SubscriptionGroupLocalizationV2, + included: [SubscriptionGroupVersion]? = nil, + links: DocumentLinks + ) { + self.data = data + self.included = included + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case data + case included + case links + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupLocalizationsV2Response.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupLocalizationsV2Response.generated.swift new file mode 100644 index 00000000..5c92f75b --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupLocalizationsV2Response.generated.swift @@ -0,0 +1,35 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionGroupLocalizationsV2Response: Hashable, Codable, Sendable { + public var data: [SubscriptionGroupLocalizationV2] + + public var included: [SubscriptionGroupVersion]? + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [SubscriptionGroupLocalizationV2], + included: [SubscriptionGroupVersion]? = nil, + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.included = included + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case included + case links + case meta + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupResponse.generated.swift index 315d0854..9ea0c186 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupResponse.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupResponse.generated.swift @@ -28,6 +28,7 @@ public struct SubscriptionGroupResponse: Hashable, Codable, Sendable { public enum Included: Hashable, Codable, Sendable { case subscriptionGroupLocalization(SubscriptionGroupLocalization) + case subscriptionGroupVersion(SubscriptionGroupVersion) case subscription(Subscription) public init(from decoder: Decoder) throws { @@ -38,6 +39,11 @@ public struct SubscriptionGroupResponse: Hashable, Codable, Sendable { } catch { lastError = error } + do { + return .subscriptionGroupVersion(try SubscriptionGroupVersion(from: decoder)) + } catch { + lastError = error + } do { return .subscription(try Subscription(from: decoder)) } catch { @@ -52,6 +58,9 @@ public struct SubscriptionGroupResponse: Hashable, Codable, Sendable { case .subscriptionGroupLocalization(let value): try value.encode(to: encoder) + case .subscriptionGroupVersion(let value): + try value.encode(to: encoder) + case .subscription(let value): try value.encode(to: encoder) } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupVersionLocalizationsLinkagesResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupVersionLocalizationsLinkagesResponse.generated.swift new file mode 100644 index 00000000..5abc216b --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupVersionLocalizationsLinkagesResponse.generated.swift @@ -0,0 +1,53 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionGroupVersionLocalizationsLinkagesResponse: Hashable, Codable, Sendable { + public var data: [Data] + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [Data], + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupLocalizations + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupVersionResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupVersionResponse.generated.swift new file mode 100644 index 00000000..8b5383be --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupVersionResponse.generated.swift @@ -0,0 +1,62 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionGroupVersionResponse: Hashable, Codable, Sendable { + public var data: SubscriptionGroupVersion + + public var included: [Included]? + + public var links: DocumentLinks + + public init( + data: SubscriptionGroupVersion, + included: [Included]? = nil, + links: DocumentLinks + ) { + self.data = data + self.included = included + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case data + case included + case links + } + + public enum Included: Hashable, Codable, Sendable { + case subscriptionGroupLocalizationV2(SubscriptionGroupLocalizationV2) + case subscriptionGroup(SubscriptionGroup) + + public init(from decoder: Decoder) throws { + self = try { + var lastError: Error! + do { + return .subscriptionGroupLocalizationV2(try SubscriptionGroupLocalizationV2(from: decoder)) + } catch { + lastError = error + } + do { + return .subscriptionGroup(try SubscriptionGroup(from: decoder)) + } catch { + lastError = error + } + throw lastError + }() + } + + public func encode(to encoder: Encoder) throws { + switch self { + case .subscriptionGroupLocalizationV2(let value): + try value.encode(to: encoder) + + case .subscriptionGroup(let value): + try value.encode(to: encoder) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupVersionsLinkagesResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupVersionsLinkagesResponse.generated.swift new file mode 100644 index 00000000..6d8b859f --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupVersionsLinkagesResponse.generated.swift @@ -0,0 +1,53 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionGroupVersionsLinkagesResponse: Hashable, Codable, Sendable { + public var data: [Data] + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [Data], + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupVersions + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupVersionsResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupVersionsResponse.generated.swift new file mode 100644 index 00000000..265322e4 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupVersionsResponse.generated.swift @@ -0,0 +1,67 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionGroupVersionsResponse: Hashable, Codable, Sendable { + public var data: [SubscriptionGroupVersion] + + public var included: [Included]? + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [SubscriptionGroupVersion], + included: [Included]? = nil, + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.included = included + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case included + case links + case meta + } + + public enum Included: Hashable, Codable, Sendable { + case subscriptionGroupLocalizationV2(SubscriptionGroupLocalizationV2) + case subscriptionGroup(SubscriptionGroup) + + public init(from decoder: Decoder) throws { + self = try { + var lastError: Error! + do { + return .subscriptionGroupLocalizationV2(try SubscriptionGroupLocalizationV2(from: decoder)) + } catch { + lastError = error + } + do { + return .subscriptionGroup(try SubscriptionGroup(from: decoder)) + } catch { + lastError = error + } + throw lastError + }() + } + + public func encode(to encoder: Encoder) throws { + switch self { + case .subscriptionGroupLocalizationV2(let value): + try value.encode(to: encoder) + + case .subscriptionGroup(let value): + try value.encode(to: encoder) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupsResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupsResponse.generated.swift index 5bbb8374..f8399cb0 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupsResponse.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionGroupsResponse.generated.swift @@ -33,6 +33,7 @@ public struct SubscriptionGroupsResponse: Hashable, Codable, Sendable { public enum Included: Hashable, Codable, Sendable { case subscriptionGroupLocalization(SubscriptionGroupLocalization) + case subscriptionGroupVersion(SubscriptionGroupVersion) case subscription(Subscription) public init(from decoder: Decoder) throws { @@ -43,6 +44,11 @@ public struct SubscriptionGroupsResponse: Hashable, Codable, Sendable { } catch { lastError = error } + do { + return .subscriptionGroupVersion(try SubscriptionGroupVersion(from: decoder)) + } catch { + lastError = error + } do { return .subscription(try Subscription(from: decoder)) } catch { @@ -57,6 +63,9 @@ public struct SubscriptionGroupsResponse: Hashable, Codable, Sendable { case .subscriptionGroupLocalization(let value): try value.encode(to: encoder) + case .subscriptionGroupVersion(let value): + try value.encode(to: encoder) + case .subscription(let value): try value.encode(to: encoder) } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionImageV2Response.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionImageV2Response.generated.swift new file mode 100644 index 00000000..5cba0cdf --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionImageV2Response.generated.swift @@ -0,0 +1,25 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionImageV2Response: Hashable, Codable, Sendable { + public var data: SubscriptionImageV2 + + public var links: DocumentLinks + + public init( + data: SubscriptionImageV2, + links: DocumentLinks + ) { + self.data = data + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case data + case links + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionImagesV2Response.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionImagesV2Response.generated.swift new file mode 100644 index 00000000..da01dfe0 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionImagesV2Response.generated.swift @@ -0,0 +1,30 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionImagesV2Response: Hashable, Codable, Sendable { + public var data: [SubscriptionImageV2] + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [SubscriptionImageV2], + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionLocalizationV2Response.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionLocalizationV2Response.generated.swift new file mode 100644 index 00000000..74f36a91 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionLocalizationV2Response.generated.swift @@ -0,0 +1,30 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionLocalizationV2Response: Hashable, Codable, Sendable { + public var data: SubscriptionLocalizationV2 + + public var included: [SubscriptionVersion]? + + public var links: DocumentLinks + + public init( + data: SubscriptionLocalizationV2, + included: [SubscriptionVersion]? = nil, + links: DocumentLinks + ) { + self.data = data + self.included = included + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case data + case included + case links + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionLocalizationsV2Response.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionLocalizationsV2Response.generated.swift new file mode 100644 index 00000000..c57c097d --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionLocalizationsV2Response.generated.swift @@ -0,0 +1,35 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionLocalizationsV2Response: Hashable, Codable, Sendable { + public var data: [SubscriptionLocalizationV2] + + public var included: [SubscriptionVersion]? + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [SubscriptionLocalizationV2], + included: [SubscriptionVersion]? = nil, + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.included = included + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case included + case links + case meta + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionResponse.generated.swift index abc79d27..2376e2ce 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionResponse.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionResponse.generated.swift @@ -38,6 +38,7 @@ public struct SubscriptionResponse: Hashable, Codable, Sendable { case subscriptionPlanAvailability(SubscriptionPlanAvailability) case subscriptionPrice(SubscriptionPrice) case subscriptionPromotionalOffer(SubscriptionPromotionalOffer) + case subscriptionVersion(SubscriptionVersion) case winBackOffer(WinBackOffer) public init(from decoder: Decoder) throws { @@ -98,6 +99,11 @@ public struct SubscriptionResponse: Hashable, Codable, Sendable { } catch { lastError = error } + do { + return .subscriptionVersion(try SubscriptionVersion(from: decoder)) + } catch { + lastError = error + } do { return .winBackOffer(try WinBackOffer(from: decoder)) } catch { @@ -142,6 +148,9 @@ public struct SubscriptionResponse: Hashable, Codable, Sendable { case .subscriptionPromotionalOffer(let value): try value.encode(to: encoder) + case .subscriptionVersion(let value): + try value.encode(to: encoder) + case .winBackOffer(let value): try value.encode(to: encoder) } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionImageLinkageResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionImageLinkageResponse.generated.swift new file mode 100644 index 00000000..2c8c6c7a --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionImageLinkageResponse.generated.swift @@ -0,0 +1,48 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionVersionImageLinkageResponse: Hashable, Codable, Sendable { + public var data: Data + + public var links: DocumentLinks + + public init( + data: Data, + links: DocumentLinks + ) { + self.data = data + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case data + case links + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionImages + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionImagesLinkagesResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionImagesLinkagesResponse.generated.swift new file mode 100644 index 00000000..08bf8719 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionImagesLinkagesResponse.generated.swift @@ -0,0 +1,53 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionVersionImagesLinkagesResponse: Hashable, Codable, Sendable { + public var data: [Data] + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [Data], + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionImages + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionLocalizationsLinkagesResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionLocalizationsLinkagesResponse.generated.swift new file mode 100644 index 00000000..f3c12f74 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionLocalizationsLinkagesResponse.generated.swift @@ -0,0 +1,53 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionVersionLocalizationsLinkagesResponse: Hashable, Codable, Sendable { + public var data: [Data] + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [Data], + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionLocalizations + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionResponse.generated.swift new file mode 100644 index 00000000..1fa24eaa --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionResponse.generated.swift @@ -0,0 +1,71 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionVersionResponse: Hashable, Codable, Sendable { + public var data: SubscriptionVersion + + public var included: [Included]? + + public var links: DocumentLinks + + public init( + data: SubscriptionVersion, + included: [Included]? = nil, + links: DocumentLinks + ) { + self.data = data + self.included = included + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case data + case included + case links + } + + public enum Included: Hashable, Codable, Sendable { + case subscriptionImageV2(SubscriptionImageV2) + case subscriptionLocalizationV2(SubscriptionLocalizationV2) + case subscription(Subscription) + + public init(from decoder: Decoder) throws { + self = try { + var lastError: Error! + do { + return .subscriptionImageV2(try SubscriptionImageV2(from: decoder)) + } catch { + lastError = error + } + do { + return .subscriptionLocalizationV2(try SubscriptionLocalizationV2(from: decoder)) + } catch { + lastError = error + } + do { + return .subscription(try Subscription(from: decoder)) + } catch { + lastError = error + } + throw lastError + }() + } + + public func encode(to encoder: Encoder) throws { + switch self { + case .subscriptionImageV2(let value): + try value.encode(to: encoder) + + case .subscriptionLocalizationV2(let value): + try value.encode(to: encoder) + + case .subscription(let value): + try value.encode(to: encoder) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionsLinkagesResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionsLinkagesResponse.generated.swift new file mode 100644 index 00000000..899202e0 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionsLinkagesResponse.generated.swift @@ -0,0 +1,53 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionVersionsLinkagesResponse: Hashable, Codable, Sendable { + public var data: [Data] + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [Data], + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionVersions + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionsResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionsResponse.generated.swift new file mode 100644 index 00000000..29cadcf3 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionVersionsResponse.generated.swift @@ -0,0 +1,76 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionVersionsResponse: Hashable, Codable, Sendable { + public var data: [SubscriptionVersion] + + public var included: [Included]? + + public var links: PagedDocumentLinks + + public var meta: PagingInformation? + + public init( + data: [SubscriptionVersion], + included: [Included]? = nil, + links: PagedDocumentLinks, + meta: PagingInformation? = nil + ) { + self.data = data + self.included = included + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case included + case links + case meta + } + + public enum Included: Hashable, Codable, Sendable { + case subscriptionImageV2(SubscriptionImageV2) + case subscriptionLocalizationV2(SubscriptionLocalizationV2) + case subscription(Subscription) + + public init(from decoder: Decoder) throws { + self = try { + var lastError: Error! + do { + return .subscriptionImageV2(try SubscriptionImageV2(from: decoder)) + } catch { + lastError = error + } + do { + return .subscriptionLocalizationV2(try SubscriptionLocalizationV2(from: decoder)) + } catch { + lastError = error + } + do { + return .subscription(try Subscription(from: decoder)) + } catch { + lastError = error + } + throw lastError + }() + } + + public func encode(to encoder: Encoder) throws { + switch self { + case .subscriptionImageV2(let value): + try value.encode(to: encoder) + + case .subscriptionLocalizationV2(let value): + try value.encode(to: encoder) + + case .subscription(let value): + try value.encode(to: encoder) + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionsResponse.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionsResponse.generated.swift index 633b63c6..ad71ce9f 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionsResponse.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Responses/SubscriptionsResponse.generated.swift @@ -43,6 +43,7 @@ public struct SubscriptionsResponse: Hashable, Codable, Sendable { case subscriptionPlanAvailability(SubscriptionPlanAvailability) case subscriptionPrice(SubscriptionPrice) case subscriptionPromotionalOffer(SubscriptionPromotionalOffer) + case subscriptionVersion(SubscriptionVersion) case winBackOffer(WinBackOffer) public init(from decoder: Decoder) throws { @@ -103,6 +104,11 @@ public struct SubscriptionsResponse: Hashable, Codable, Sendable { } catch { lastError = error } + do { + return .subscriptionVersion(try SubscriptionVersion(from: decoder)) + } catch { + lastError = error + } do { return .winBackOffer(try WinBackOffer(from: decoder)) } catch { @@ -147,6 +153,9 @@ public struct SubscriptionsResponse: Hashable, Codable, Sendable { case .subscriptionPromotionalOffer(let value): try value.encode(to: encoder) + case .subscriptionVersion(let value): + try value.encode(to: encoder) + case .winBackOffer(let value): try value.encode(to: encoder) } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/ReviewSubmissionItem.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/ReviewSubmissionItem.generated.swift index 321ebbad..abd82905 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/ReviewSubmissionItem.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/ReviewSubmissionItem.generated.swift @@ -107,6 +107,12 @@ public struct ReviewSubmissionItem: Hashable, Codable, Sendable { public var gameCenterLeaderboardVersion: GameCenterLeaderboardVersion? + public var inAppPurchaseVersion: InAppPurchaseVersion? + + public var subscriptionGroupVersion: SubscriptionGroupVersion? + + public var subscriptionVersion: SubscriptionVersion? + public init( appCustomProductPageVersion: AppCustomProductPageVersion? = nil, appEvent: AppEvent? = nil, @@ -118,7 +124,10 @@ public struct ReviewSubmissionItem: Hashable, Codable, Sendable { gameCenterActivityVersion: GameCenterActivityVersion? = nil, gameCenterChallengeVersion: GameCenterChallengeVersion? = nil, gameCenterLeaderboardSetVersion: GameCenterLeaderboardSetVersion? = nil, - gameCenterLeaderboardVersion: GameCenterLeaderboardVersion? = nil + gameCenterLeaderboardVersion: GameCenterLeaderboardVersion? = nil, + inAppPurchaseVersion: InAppPurchaseVersion? = nil, + subscriptionGroupVersion: SubscriptionGroupVersion? = nil, + subscriptionVersion: SubscriptionVersion? = nil ) { self.appCustomProductPageVersion = appCustomProductPageVersion self.appEvent = appEvent @@ -131,6 +140,9 @@ public struct ReviewSubmissionItem: Hashable, Codable, Sendable { self.gameCenterChallengeVersion = gameCenterChallengeVersion self.gameCenterLeaderboardSetVersion = gameCenterLeaderboardSetVersion self.gameCenterLeaderboardVersion = gameCenterLeaderboardVersion + self.inAppPurchaseVersion = inAppPurchaseVersion + self.subscriptionGroupVersion = subscriptionGroupVersion + self.subscriptionVersion = subscriptionVersion } private enum CodingKeys: String, CodingKey { @@ -145,6 +157,9 @@ public struct ReviewSubmissionItem: Hashable, Codable, Sendable { case gameCenterChallengeVersion case gameCenterLeaderboardSetVersion case gameCenterLeaderboardVersion + case inAppPurchaseVersion + case subscriptionGroupVersion + case subscriptionVersion } public struct AppCustomProductPageVersion: Hashable, Codable, Sendable { @@ -531,6 +546,111 @@ public struct ReviewSubmissionItem: Hashable, Codable, Sendable { } } } + + public struct InAppPurchaseVersion: Hashable, Codable, Sendable { + public var data: Data? + + public init(data: Data? = nil) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case inAppPurchaseVersions + } + } + } + + public struct SubscriptionGroupVersion: Hashable, Codable, Sendable { + public var data: Data? + + public init(data: Data? = nil) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupVersions + } + } + } + + public struct SubscriptionVersion: Hashable, Codable, Sendable { + public var data: Data? + + public init(data: Data? = nil) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionVersions + } + } + } } } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/Subscription.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/Subscription.generated.swift index 5a4ec8d6..5cf5e681 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/Subscription.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/Subscription.generated.swift @@ -198,6 +198,8 @@ public struct Subscription: Hashable, Codable, Sendable { public var subscriptionLocalizations: SubscriptionLocalizations? + public var versions: Versions? + public var winBackOffers: WinBackOffers? public init( @@ -213,6 +215,7 @@ public struct Subscription: Hashable, Codable, Sendable { promotionalOffers: PromotionalOffers? = nil, subscriptionAvailability: SubscriptionAvailability? = nil, subscriptionLocalizations: SubscriptionLocalizations? = nil, + versions: Versions? = nil, winBackOffers: WinBackOffers? = nil ) { self.appStoreReviewScreenshot = appStoreReviewScreenshot @@ -227,6 +230,7 @@ public struct Subscription: Hashable, Codable, Sendable { self.promotionalOffers = promotionalOffers self.subscriptionAvailability = subscriptionAvailability self.subscriptionLocalizations = subscriptionLocalizations + self.versions = versions self.winBackOffers = winBackOffers } @@ -243,6 +247,7 @@ public struct Subscription: Hashable, Codable, Sendable { case promotionalOffers case subscriptionAvailability case subscriptionLocalizations + case versions case winBackOffers } @@ -748,6 +753,53 @@ public struct Subscription: Hashable, Codable, Sendable { } } + public struct Versions: Hashable, Codable, Sendable { + public var data: [Data]? + + public var links: RelationshipLinks? + + public var meta: PagingInformation? + + public init( + data: [Data]? = nil, + links: RelationshipLinks? = nil, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionVersions + } + } + } + public struct WinBackOffers: Hashable, Codable, Sendable { public var data: [Data]? diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionGroup.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionGroup.generated.swift index cb207db8..5424a3ce 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionGroup.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionGroup.generated.swift @@ -57,17 +57,22 @@ public struct SubscriptionGroup: Hashable, Codable, Sendable { public var subscriptions: Subscriptions? + public var versions: Versions? + public init( subscriptionGroupLocalizations: SubscriptionGroupLocalizations? = nil, - subscriptions: Subscriptions? = nil + subscriptions: Subscriptions? = nil, + versions: Versions? = nil ) { self.subscriptionGroupLocalizations = subscriptionGroupLocalizations self.subscriptions = subscriptions + self.versions = versions } private enum CodingKeys: String, CodingKey { case subscriptionGroupLocalizations case subscriptions + case versions } public struct SubscriptionGroupLocalizations: Hashable, Codable, Sendable { @@ -163,6 +168,53 @@ public struct SubscriptionGroup: Hashable, Codable, Sendable { } } } + + public struct Versions: Hashable, Codable, Sendable { + public var data: [Data]? + + public var links: RelationshipLinks? + + public var meta: PagingInformation? + + public init( + data: [Data]? = nil, + links: RelationshipLinks? = nil, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupVersions + } + } + } } } diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionGroupLocalizationV2.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionGroupLocalizationV2.generated.swift new file mode 100644 index 00000000..3dfa30bd --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionGroupLocalizationV2.generated.swift @@ -0,0 +1,115 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionGroupLocalizationV2: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public var relationships: Relationships? + + public var links: ResourceLinks? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil, + relationships: Relationships? = nil, + links: ResourceLinks? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + self.relationships = relationships + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + case relationships + case links + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupLocalizations + } + + public struct Attributes: Hashable, Codable, Sendable { + public var customAppName: String? + + public var locale: String? + + public var name: String? + + public init( + customAppName: String? = nil, + locale: String? = nil, + name: String? = nil + ) { + self.customAppName = customAppName + self.locale = locale + self.name = name + } + + private enum CodingKeys: String, CodingKey { + case customAppName + case locale + case name + } + } + + public struct Relationships: Hashable, Codable, Sendable { + public var version: Version? + + public init(version: Version? = nil) { + self.version = version + } + + private enum CodingKeys: String, CodingKey { + case version + } + + public struct Version: Hashable, Codable, Sendable { + public var data: Data? + + public init(data: Data? = nil) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupVersions + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionGroupVersion.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionGroupVersion.generated.swift new file mode 100644 index 00000000..91fe2350 --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionGroupVersion.generated.swift @@ -0,0 +1,212 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionGroupVersion: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public var relationships: Relationships? + + public var links: ResourceLinks? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil, + relationships: Relationships? = nil, + links: ResourceLinks? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + self.relationships = relationships + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + case relationships + case links + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupVersions + } + + public struct Attributes: Hashable, Codable, Sendable { + public var state: State? + + public var version: Int? + + public init( + state: State? = nil, + version: Int? = nil + ) { + self.state = state + self.version = version + } + + private enum CodingKeys: String, CodingKey { + case state + case version + } + + public struct State: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var accepted: Self { + .init(rawValue: "ACCEPTED") + } + + public static var approved: Self { + .init(rawValue: "APPROVED") + } + + public static var developerRejected: Self { + .init(rawValue: "DEVELOPER_REJECTED") + } + + public static var inReview: Self { + .init(rawValue: "IN_REVIEW") + } + + public static var prepareForSubmission: Self { + .init(rawValue: "PREPARE_FOR_SUBMISSION") + } + + public static var readyForReview: Self { + .init(rawValue: "READY_FOR_REVIEW") + } + + public static var rejected: Self { + .init(rawValue: "REJECTED") + } + + public static var replacedWithNewVersion: Self { + .init(rawValue: "REPLACED_WITH_NEW_VERSION") + } + + public static var waitingForReview: Self { + .init(rawValue: "WAITING_FOR_REVIEW") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + } + + public struct Relationships: Hashable, Codable, Sendable { + public var localizations: Localizations? + + public var subscriptionGroup: SubscriptionGroup? + + public init( + localizations: Localizations? = nil, + subscriptionGroup: SubscriptionGroup? = nil + ) { + self.localizations = localizations + self.subscriptionGroup = subscriptionGroup + } + + private enum CodingKeys: String, CodingKey { + case localizations + case subscriptionGroup + } + + public struct Localizations: Hashable, Codable, Sendable { + public var data: [Data]? + + public var links: RelationshipLinks? + + public var meta: PagingInformation? + + public init( + data: [Data]? = nil, + links: RelationshipLinks? = nil, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroupLocalizations + } + } + } + + public struct SubscriptionGroup: Hashable, Codable, Sendable { + public var data: Data? + + public init(data: Data? = nil) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionGroups + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionImageV2.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionImageV2.generated.swift new file mode 100644 index 00000000..fa5f2b1d --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionImageV2.generated.swift @@ -0,0 +1,78 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionImageV2: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public var links: ResourceLinks? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil, + links: ResourceLinks? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + case links + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionImages + } + + public struct Attributes: Hashable, Codable, Sendable { + public var assetDeliveryState: AppMediaAssetState? + + public var assetToken: String? + + public var fileName: String? + + public var fileSize: Int? + + public var imageAsset: ImageAsset? + + public var uploadOperations: [UploadOperation]? + + public init( + assetDeliveryState: AppMediaAssetState? = nil, + assetToken: String? = nil, + fileName: String? = nil, + fileSize: Int? = nil, + imageAsset: ImageAsset? = nil, + uploadOperations: [UploadOperation]? = nil + ) { + self.assetDeliveryState = assetDeliveryState + self.assetToken = assetToken + self.fileName = fileName + self.fileSize = fileSize + self.imageAsset = imageAsset + self.uploadOperations = uploadOperations + } + + private enum CodingKeys: String, CodingKey { + case assetDeliveryState + case assetToken + case fileName + case fileSize + case imageAsset + case uploadOperations + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionLocalizationV2.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionLocalizationV2.generated.swift new file mode 100644 index 00000000..6f5e776c --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionLocalizationV2.generated.swift @@ -0,0 +1,115 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionLocalizationV2: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public var relationships: Relationships? + + public var links: ResourceLinks? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil, + relationships: Relationships? = nil, + links: ResourceLinks? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + self.relationships = relationships + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + case relationships + case links + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionLocalizations + } + + public struct Attributes: Hashable, Codable, Sendable { + public var description: String? + + public var locale: String? + + public var name: String? + + public init( + description: String? = nil, + locale: String? = nil, + name: String? = nil + ) { + self.description = description + self.locale = locale + self.name = name + } + + private enum CodingKeys: String, CodingKey { + case description + case locale + case name + } + } + + public struct Relationships: Hashable, Codable, Sendable { + public var version: Version? + + public init(version: Version? = nil) { + self.version = version + } + + private enum CodingKeys: String, CodingKey { + case version + } + + public struct Version: Hashable, Codable, Sendable { + public var data: Data? + + public init(data: Data? = nil) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionVersions + } + } + } + } +} + +// swiftlint:enable all diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionPricePoint.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionPricePoint.generated.swift index 6318ec67..a8b8460f 100644 --- a/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionPricePoint.generated.swift +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionPricePoint.generated.swift @@ -65,23 +65,40 @@ public struct SubscriptionPricePoint: Hashable, Codable, Sendable { } public struct Relationships: Hashable, Codable, Sendable { + public var adjustedEqualizations: AdjustedEqualizations? + public var equalizations: Equalizations? public var territory: Territory? public init( + adjustedEqualizations: AdjustedEqualizations? = nil, equalizations: Equalizations? = nil, territory: Territory? = nil ) { + self.adjustedEqualizations = adjustedEqualizations self.equalizations = equalizations self.territory = territory } private enum CodingKeys: String, CodingKey { + case adjustedEqualizations case equalizations case territory } + public struct AdjustedEqualizations: Hashable, Codable, Sendable { + public var links: RelationshipLinks? + + public init(links: RelationshipLinks? = nil) { + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case links + } + } + public struct Equalizations: Hashable, Codable, Sendable { public var links: RelationshipLinks? diff --git a/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionVersion.generated.swift b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionVersion.generated.swift new file mode 100644 index 00000000..dbbe74bc --- /dev/null +++ b/Sources/AppStoreConnectKit/autogenerated/Schemas/SubscriptionVersion.generated.swift @@ -0,0 +1,311 @@ +// autogenerated + +// swiftlint:disable all +import Foundation + +public struct SubscriptionVersion: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public var attributes: Attributes? + + public var relationships: Relationships? + + public var links: ResourceLinks? + + public init( + id: String, + type: `Type`, + attributes: Attributes? = nil, + relationships: Relationships? = nil, + links: ResourceLinks? = nil + ) { + self.id = id + self.type = type + self.attributes = attributes + self.relationships = relationships + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case id + case type + case attributes + case relationships + case links + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionVersions + } + + public struct Attributes: Hashable, Codable, Sendable { + public var state: State? + + public var version: Int? + + public init( + state: State? = nil, + version: Int? = nil + ) { + self.state = state + self.version = version + } + + private enum CodingKeys: String, CodingKey { + case state + case version + } + + public struct State: Hashable, Codable, RawRepresentable, CustomStringConvertible, Sendable { + public static var accepted: Self { + .init(rawValue: "ACCEPTED") + } + + public static var approved: Self { + .init(rawValue: "APPROVED") + } + + public static var developerRejected: Self { + .init(rawValue: "DEVELOPER_REJECTED") + } + + public static var inReview: Self { + .init(rawValue: "IN_REVIEW") + } + + public static var prepareForSubmission: Self { + .init(rawValue: "PREPARE_FOR_SUBMISSION") + } + + public static var readyForReview: Self { + .init(rawValue: "READY_FOR_REVIEW") + } + + public static var rejected: Self { + .init(rawValue: "REJECTED") + } + + public static var replacedWithNewVersion: Self { + .init(rawValue: "REPLACED_WITH_NEW_VERSION") + } + + public static var waitingForReview: Self { + .init(rawValue: "WAITING_FOR_REVIEW") + } + + public var description: String { + rawValue + } + + public var rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + } + } + + public struct Relationships: Hashable, Codable, Sendable { + public var image: Image? + + public var images: Images? + + public var localizations: Localizations? + + public var subscription: Subscription? + + public init( + image: Image? = nil, + images: Images? = nil, + localizations: Localizations? = nil, + subscription: Subscription? = nil + ) { + self.image = image + self.images = images + self.localizations = localizations + self.subscription = subscription + } + + private enum CodingKeys: String, CodingKey { + case image + case images + case localizations + case subscription + } + + public struct Image: Hashable, Codable, Sendable { + public var data: Data? + + public var links: RelationshipLinks? + + public init( + data: Data? = nil, + links: RelationshipLinks? = nil + ) { + self.data = data + self.links = links + } + + private enum CodingKeys: String, CodingKey { + case data + case links + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionImages + } + } + } + + public struct Images: Hashable, Codable, Sendable { + public var data: [Data]? + + public var links: RelationshipLinks? + + public var meta: PagingInformation? + + public init( + data: [Data]? = nil, + links: RelationshipLinks? = nil, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionImages + } + } + } + + public struct Localizations: Hashable, Codable, Sendable { + public var data: [Data]? + + public var links: RelationshipLinks? + + public var meta: PagingInformation? + + public init( + data: [Data]? = nil, + links: RelationshipLinks? = nil, + meta: PagingInformation? = nil + ) { + self.data = data + self.links = links + self.meta = meta + } + + private enum CodingKeys: String, CodingKey { + case data + case links + case meta + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptionLocalizations + } + } + } + + public struct Subscription: Hashable, Codable, Sendable { + public var data: Data? + + public init(data: Data? = nil) { + self.data = data + } + + private enum CodingKeys: String, CodingKey { + case data + } + + public struct Data: Hashable, Codable, Sendable { + public var id: String + + public var type: `Type` + + public init( + id: String, + type: `Type` + ) { + self.id = id + self.type = type + } + + private enum CodingKeys: String, CodingKey { + case id + case type + } + + public enum `Type`: String, Hashable, Codable, Sendable { + case subscriptions + } + } + } + } +} + +// swiftlint:enable all