Skip to content

Commit

Permalink
Update from new spec (2.0) (#87)
Browse files Browse the repository at this point in the history
* Update from new spec (2.0)

* Update Package.resolved

* Update Package.resolved

* Regenerate

* Add documentation

* Remove fields with no cases

Co-authored-by: Morten Bjerg Gregersen <[email protected]>
  • Loading branch information
bagbutik-ci and MortenGregersen authored Jul 12, 2022
1 parent 519a312 commit a0752c0
Show file tree
Hide file tree
Showing 330 changed files with 20,975 additions and 518 deletions.
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "f3c9084a71ef4376f2fabbdf1d3d90a49f1fabdb",
"version": "1.1.2"
"revision": "df9ee6676cd5b3bf5b330ec7568a5644f547201b",
"version": "1.1.3"
}
},
{
Expand All @@ -114,8 +114,8 @@
"repositoryURL": "https://github.com/nicklockwood/SwiftFormat",
"state": {
"branch": null,
"revision": "2dcce7fe2d6c245d8d669d394d5be5fe45d582fc",
"version": "0.49.8"
"revision": "378543f07b6acf6e13982ffed8bd71d4b0041f61",
"version": "0.49.11"
}
},
{
Expand Down
57 changes: 54 additions & 3 deletions Sources/Bagbutik/Endpoints/App/GetAppV1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,27 @@ public enum GetAppV1 {
case builds([Builds])
/// The fields to include for returned resources of type ciProducts
case ciProducts([CiProducts])
/// The fields to include for returned resources of type customerReviews
case customerReviews([CustomerReviews])
/// The fields to include for returned resources of type endUserLicenseAgreements
case endUserLicenseAgreements([EndUserLicenseAgreements])
/// The fields to include for returned resources of type gameCenterEnabledVersions
case gameCenterEnabledVersions([GameCenterEnabledVersions])
/// The fields to include for returned resources of type inAppPurchases
@available(*, deprecated, message: "Apple has marked it as deprecated and it will be removed sometime in the future.")
case inAppPurchases([InAppPurchases])
/// The fields to include for returned resources of type perfPowerMetrics
case perfPowerMetrics([PerfPowerMetrics])
/// The fields to include for returned resources of type preReleaseVersions
case preReleaseVersions([PreReleaseVersions])
/// The fields to include for returned resources of type promotedPurchases
case promotedPurchases([PromotedPurchases])
/// The fields to include for returned resources of type reviewSubmissions
case reviewSubmissions([ReviewSubmissions])
/// The fields to include for returned resources of type subscriptionGracePeriods
case subscriptionGracePeriods([SubscriptionGracePeriods])
/// The fields to include for returned resources of type subscriptionGroups
case subscriptionGroups([SubscriptionGroups])
/// The fields to include for returned resources of type territories
case territories([Territories])

Expand Down Expand Up @@ -153,13 +162,12 @@ public enum GetAppV1 {
case build
case copyright
case createdDate
case customerReviews
case downloadable
case earliestReleaseDate
case idfaDeclaration
case platform
case releaseType
case routingAppCoverage
case usesIdfa
case versionString
}

Expand All @@ -180,9 +188,11 @@ public enum GetAppV1 {
case bundleId
case ciProduct
case contentRightsDeclaration
case customerReviews
case endUserLicenseAgreement
case gameCenterEnabledVersions
case inAppPurchases
case inAppPurchasesV2
case isOrEverWasMadeForKids
case name
case perfPowerMetrics
Expand All @@ -191,8 +201,11 @@ public enum GetAppV1 {
case pricePoints
case prices
case primaryLocale
case promotedPurchases
case reviewSubmissions
case sku
case subscriptionGracePeriod
case subscriptionGroups
case subscriptionStatusUrl
case subscriptionStatusUrlForSandbox
case subscriptionStatusUrlVersion
Expand Down Expand Up @@ -282,6 +295,16 @@ public enum GetAppV1 {
case workflows
}

public enum CustomerReviews: String, ParameterValue, CaseIterable {
case body
case createdDate
case rating
case response
case reviewerNickname
case territory
case title
}

public enum EndUserLicenseAgreements: String, ParameterValue, CaseIterable {
case agreementText
case app
Expand Down Expand Up @@ -317,6 +340,16 @@ public enum GetAppV1 {
case version
}

public enum PromotedPurchases: String, ParameterValue, CaseIterable {
case app
case enabled
case inAppPurchaseV2
case promotionImages
case state
case subscription
case visibleForAllUsers
}

public enum ReviewSubmissions: String, ParameterValue, CaseIterable {
case app
case appStoreVersionForReview
Expand All @@ -328,6 +361,18 @@ public enum GetAppV1 {
case submittedDate
}

public enum SubscriptionGracePeriods: String, ParameterValue, CaseIterable {
case app
case optIn
}

public enum SubscriptionGroups: String, ParameterValue, CaseIterable {
case app
case referenceName
case subscriptionGroupLocalizations
case subscriptions
}

public enum Territories: String, ParameterValue, CaseIterable {
case currency
}
Expand All @@ -337,7 +382,7 @@ public enum GetAppV1 {
Relationship data to include in the response.
*/
public enum Include: String, IncludeParameter {
case appClips, appCustomProductPages, appEvents, appInfos, appStoreVersions, availableTerritories, betaAppLocalizations, betaAppReviewDetail, betaGroups, betaLicenseAgreement, builds, ciProduct, endUserLicenseAgreement, gameCenterEnabledVersions, inAppPurchases, preOrder, preReleaseVersions, prices, reviewSubmissions
case appClips, appCustomProductPages, appEvents, appInfos, appStoreVersions, availableTerritories, betaAppLocalizations, betaAppReviewDetail, betaGroups, betaLicenseAgreement, builds, ciProduct, endUserLicenseAgreement, gameCenterEnabledVersions, inAppPurchases, inAppPurchasesV2, preOrder, preReleaseVersions, prices, promotedPurchases, reviewSubmissions, subscriptionGracePeriod, subscriptionGroups
}

/**
Expand Down Expand Up @@ -366,11 +411,17 @@ public enum GetAppV1 {
case gameCenterEnabledVersions(Int)
/// Maximum number of related inAppPurchases returned (when they are included) - maximum 50
case inAppPurchases(Int)
/// Maximum number of related inAppPurchasesV2 returned (when they are included) - maximum 50
case inAppPurchasesV2(Int)
/// Maximum number of related preReleaseVersions returned (when they are included) - maximum 50
case preReleaseVersions(Int)
/// Maximum number of related prices returned (when they are included) - maximum 50
case prices(Int)
/// Maximum number of related promotedPurchases returned (when they are included) - maximum 50
case promotedPurchases(Int)
/// Maximum number of related reviewSubmissions returned (when they are included) - maximum 50
case reviewSubmissions(Int)
/// Maximum number of related subscriptionGroups returned (when they are included) - maximum 50
case subscriptionGroups(Int)
}
}
57 changes: 54 additions & 3 deletions Sources/Bagbutik/Endpoints/App/ListAppsV1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,27 @@ public enum ListAppsV1 {
case builds([Builds])
/// The fields to include for returned resources of type ciProducts
case ciProducts([CiProducts])
/// The fields to include for returned resources of type customerReviews
case customerReviews([CustomerReviews])
/// The fields to include for returned resources of type endUserLicenseAgreements
case endUserLicenseAgreements([EndUserLicenseAgreements])
/// The fields to include for returned resources of type gameCenterEnabledVersions
case gameCenterEnabledVersions([GameCenterEnabledVersions])
/// The fields to include for returned resources of type inAppPurchases
@available(*, deprecated, message: "Apple has marked it as deprecated and it will be removed sometime in the future.")
case inAppPurchases([InAppPurchases])
/// The fields to include for returned resources of type perfPowerMetrics
case perfPowerMetrics([PerfPowerMetrics])
/// The fields to include for returned resources of type preReleaseVersions
case preReleaseVersions([PreReleaseVersions])
/// The fields to include for returned resources of type promotedPurchases
case promotedPurchases([PromotedPurchases])
/// The fields to include for returned resources of type reviewSubmissions
case reviewSubmissions([ReviewSubmissions])
/// The fields to include for returned resources of type subscriptionGracePeriods
case subscriptionGracePeriods([SubscriptionGracePeriods])
/// The fields to include for returned resources of type subscriptionGroups
case subscriptionGroups([SubscriptionGroups])
/// The fields to include for returned resources of type territories
case territories([Territories])

Expand Down Expand Up @@ -160,13 +169,12 @@ public enum ListAppsV1 {
case build
case copyright
case createdDate
case customerReviews
case downloadable
case earliestReleaseDate
case idfaDeclaration
case platform
case releaseType
case routingAppCoverage
case usesIdfa
case versionString
}

Expand All @@ -187,9 +195,11 @@ public enum ListAppsV1 {
case bundleId
case ciProduct
case contentRightsDeclaration
case customerReviews
case endUserLicenseAgreement
case gameCenterEnabledVersions
case inAppPurchases
case inAppPurchasesV2
case isOrEverWasMadeForKids
case name
case perfPowerMetrics
Expand All @@ -198,8 +208,11 @@ public enum ListAppsV1 {
case pricePoints
case prices
case primaryLocale
case promotedPurchases
case reviewSubmissions
case sku
case subscriptionGracePeriod
case subscriptionGroups
case subscriptionStatusUrl
case subscriptionStatusUrlForSandbox
case subscriptionStatusUrlVersion
Expand Down Expand Up @@ -289,6 +302,16 @@ public enum ListAppsV1 {
case workflows
}

public enum CustomerReviews: String, ParameterValue, CaseIterable {
case body
case createdDate
case rating
case response
case reviewerNickname
case territory
case title
}

public enum EndUserLicenseAgreements: String, ParameterValue, CaseIterable {
case agreementText
case app
Expand Down Expand Up @@ -324,6 +347,16 @@ public enum ListAppsV1 {
case version
}

public enum PromotedPurchases: String, ParameterValue, CaseIterable {
case app
case enabled
case inAppPurchaseV2
case promotionImages
case state
case subscription
case visibleForAllUsers
}

public enum ReviewSubmissions: String, ParameterValue, CaseIterable {
case app
case appStoreVersionForReview
Expand All @@ -335,6 +368,18 @@ public enum ListAppsV1 {
case submittedDate
}

public enum SubscriptionGracePeriods: String, ParameterValue, CaseIterable {
case app
case optIn
}

public enum SubscriptionGroups: String, ParameterValue, CaseIterable {
case app
case referenceName
case subscriptionGroupLocalizations
case subscriptions
}

public enum Territories: String, ParameterValue, CaseIterable {
case currency
}
Expand Down Expand Up @@ -400,7 +445,7 @@ public enum ListAppsV1 {
Relationship data to include in the response.
*/
public enum Include: String, IncludeParameter {
case appClips, appCustomProductPages, appEvents, appInfos, appStoreVersions, availableTerritories, betaAppLocalizations, betaAppReviewDetail, betaGroups, betaLicenseAgreement, builds, ciProduct, endUserLicenseAgreement, gameCenterEnabledVersions, inAppPurchases, preOrder, preReleaseVersions, prices, reviewSubmissions
case appClips, appCustomProductPages, appEvents, appInfos, appStoreVersions, availableTerritories, betaAppLocalizations, betaAppReviewDetail, betaGroups, betaLicenseAgreement, builds, ciProduct, endUserLicenseAgreement, gameCenterEnabledVersions, inAppPurchases, inAppPurchasesV2, preOrder, preReleaseVersions, prices, promotedPurchases, reviewSubmissions, subscriptionGracePeriod, subscriptionGroups
}

/**
Expand Down Expand Up @@ -443,11 +488,17 @@ public enum ListAppsV1 {
case gameCenterEnabledVersions(Int)
/// Maximum number of related inAppPurchases returned (when they are included) - maximum 50
case inAppPurchases(Int)
/// Maximum number of related inAppPurchasesV2 returned (when they are included) - maximum 50
case inAppPurchasesV2(Int)
/// Maximum number of related preReleaseVersions returned (when they are included) - maximum 50
case preReleaseVersions(Int)
/// Maximum number of related prices returned (when they are included) - maximum 50
case prices(Int)
/// Maximum number of related promotedPurchases returned (when they are included) - maximum 50
case promotedPurchases(Int)
/// Maximum number of related reviewSubmissions returned (when they are included) - maximum 50
case reviewSubmissions(Int)
/// Maximum number of related subscriptionGroups returned (when they are included) - maximum 50
case subscriptionGroups(Int)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ public enum GetCiProductForAppV1 {
case bundleId
case ciProduct
case contentRightsDeclaration
case customerReviews
case endUserLicenseAgreement
case gameCenterEnabledVersions
case inAppPurchases
case inAppPurchasesV2
case isOrEverWasMadeForKids
case name
case perfPowerMetrics
Expand All @@ -65,8 +67,11 @@ public enum GetCiProductForAppV1 {
case pricePoints
case prices
case primaryLocale
case promotedPurchases
case reviewSubmissions
case sku
case subscriptionGracePeriod
case subscriptionGroups
case subscriptionStatusUrl
case subscriptionStatusUrlForSandbox
case subscriptionStatusUrlVersion
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
public extension Request {
/**
# No overview available

- Parameter id: The id of the requested resource
- Parameter fields: Fields to return for included related types
- Returns: A `Request` with to send to an instance of `BagbutikService`
*/
static func getSubscriptionGracePeriodForAppV1(id: String,
fields: [GetSubscriptionGracePeriodForAppV1.Field]? = nil) -> Request<SubscriptionGracePeriodResponse, ErrorResponse>
{
return .init(path: "/v1/apps/\(id)/subscriptionGracePeriod", method: .get, parameters: .init(fields: fields))
}
}

public enum GetSubscriptionGracePeriodForAppV1 {
/**
Fields to return for included related types.
*/
public enum Field: FieldParameter {
/// The fields to include for returned resources of type subscriptionGracePeriods
case subscriptionGracePeriods([SubscriptionGracePeriods])

public enum SubscriptionGracePeriods: String, ParameterValue, CaseIterable {
case app
case optIn
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ public enum ListAppClipsForAppV1 {
case bundleId
case ciProduct
case contentRightsDeclaration
case customerReviews
case endUserLicenseAgreement
case gameCenterEnabledVersions
case inAppPurchases
case inAppPurchasesV2
case isOrEverWasMadeForKids
case name
case perfPowerMetrics
Expand All @@ -82,8 +84,11 @@ public enum ListAppClipsForAppV1 {
case pricePoints
case prices
case primaryLocale
case promotedPurchases
case reviewSubmissions
case sku
case subscriptionGracePeriod
case subscriptionGroups
case subscriptionStatusUrl
case subscriptionStatusUrlForSandbox
case subscriptionStatusUrlVersion
Expand Down
Loading

0 comments on commit a0752c0

Please sign in to comment.