From f2a33f93f55a841fd17ba4e44b27c80165a8f6d9 Mon Sep 17 00:00:00 2001 From: Aaron Sky Date: Sun, 9 Aug 2020 23:01:50 -0400 Subject: [PATCH] Removed remaining anonymous structs for easier type composition --- asc/apps.go | 100 ++++++++++------- asc/apps_metadata_categories.go | 30 +++-- asc/apps_metadata_eula.go | 30 +++-- asc/apps_metadata_game_center.go | 34 ++++-- asc/apps_metadata_info_localizations.go | 36 +++--- asc/apps_metadata_infos.go | 48 ++++---- asc/apps_metadata_preview_sets.go | 30 +++-- asc/apps_metadata_previews.go | 44 +++++--- asc/apps_metadata_routing.go | 36 +++--- asc/apps_metadata_screenshot_sets.go | 30 +++-- asc/apps_metadata_screenshots.go | 42 ++++--- asc/apps_metadata_version_localizations.go | 44 +++++--- asc/apps_metadata_versions.go | 103 ++++++++++-------- asc/builds.go | 58 ++++++---- asc/builds_app_encryption_declarations.go | 50 +++++---- asc/builds_build_icons.go | 19 ++-- asc/pricing.go | 19 ++-- asc/pricing_territories.go | 17 ++- asc/pricing_tiers.go | 49 ++++++--- asc/provisioning_bundle_ids.go | 38 ++++--- asc/provisioning_capabilities.go | 19 ++-- asc/provisioning_certificates.go | 29 +++-- asc/provisioning_devices.go | 29 +++-- asc/provisioning_profiles.go | 46 +++++--- asc/publishing_phased_release.go | 23 ++-- asc/publishing_preorder.go | 30 +++-- asc/reporting_power_performance_metrics.go | 42 ++++--- ...ubmission_app_store_version_submissions.go | 17 ++- asc/submission_idfa_declarations.go | 34 ++++-- asc/submission_review_attachments.go | 36 +++--- asc/submission_review_details.go | 44 +++++--- asc/testflight_beta_app_localizations.go | 38 ++++--- asc/testflight_beta_app_review_detail.go | 42 ++++--- asc/testflight_beta_app_review_submissions.go | 28 +++-- asc/testflight_beta_build_localizations.go | 30 +++-- asc/testflight_beta_groups.go | 48 ++++---- asc/testflight_beta_license_agreements.go | 28 +++-- asc/testflight_beta_testers.go | 38 ++++--- asc/testflight_beta_testers_test.go | 7 +- asc/testflight_build_beta_details.go | 32 ++++-- asc/testflight_prerelease_versions.go | 32 ++++-- asc/users.go | 38 ++++--- asc/users_invitations.go | 40 ++++--- asc/users_invitations_test.go | 31 +----- 44 files changed, 1004 insertions(+), 634 deletions(-) diff --git a/asc/apps.go b/asc/apps.go index 279a616..60cbbac 100644 --- a/asc/apps.go +++ b/asc/apps.go @@ -27,34 +27,44 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/app type App struct { - Attributes *struct { - AvailableInNewTerritories *bool `json:"availableInNewTerritories,omitempty"` - BundleID *string `json:"bundleId,omitempty"` - ContentRightsDeclaration *string `json:"contentRightsDeclaration,omitempty"` - IsOrEverWasMadeForKids *bool `json:"isOrEverWasMadeForKids,omitempty"` - Name *string `json:"name,omitempty"` - PrimaryLocale *string `json:"primaryLocale,omitempty"` - Sku *string `json:"sku,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AppInfos *PagedRelationship `json:"appInfos,omitempty"` - AppStoreVersions *PagedRelationship `json:"appStoreVersions,omitempty"` - AvailableTerritories *PagedRelationship `json:"availableTerritories,omitempty"` - BetaAppLocalizations *PagedRelationship `json:"betaAppLocalizations,omitempty"` - BetaAppReviewDetail *Relationship `json:"betaAppReviewDetail,omitempty"` - BetaGroups *PagedRelationship `json:"betaGroups,omitempty"` - BetaLicenseAgreement *Relationship `json:"betaLicenseAgreement,omitempty"` - Builds *PagedRelationship `json:"builds,omitempty"` - EndUserLicenseAgreement *Relationship `json:"endUserLicenseAgreement,omitempty"` - GameCenterEnabledVersions *PagedRelationship `json:"gameCenterEnabledVersions,omitempty"` - InAppPurchases *PagedRelationship `json:"inAppPurchases,omitempty"` - PreOrder *Relationship `json:"preOrder,omitempty"` - PreReleaseVersions *PagedRelationship `json:"preReleaseVersions,omitempty"` - Prices *PagedRelationship `json:"prices,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppAttributes defines model for App.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/app/attributes +type AppAttributes struct { + AvailableInNewTerritories *bool `json:"availableInNewTerritories,omitempty"` + BundleID *string `json:"bundleId,omitempty"` + ContentRightsDeclaration *string `json:"contentRightsDeclaration,omitempty"` + IsOrEverWasMadeForKids *bool `json:"isOrEverWasMadeForKids,omitempty"` + Name *string `json:"name,omitempty"` + PrimaryLocale *string `json:"primaryLocale,omitempty"` + Sku *string `json:"sku,omitempty"` +} + +// AppRelationships defines model for App.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/app/relationships +type AppRelationships struct { + AppInfos *PagedRelationship `json:"appInfos,omitempty"` + AppStoreVersions *PagedRelationship `json:"appStoreVersions,omitempty"` + AvailableTerritories *PagedRelationship `json:"availableTerritories,omitempty"` + BetaAppLocalizations *PagedRelationship `json:"betaAppLocalizations,omitempty"` + BetaAppReviewDetail *Relationship `json:"betaAppReviewDetail,omitempty"` + BetaGroups *PagedRelationship `json:"betaGroups,omitempty"` + BetaLicenseAgreement *Relationship `json:"betaLicenseAgreement,omitempty"` + Builds *PagedRelationship `json:"builds,omitempty"` + EndUserLicenseAgreement *Relationship `json:"endUserLicenseAgreement,omitempty"` + GameCenterEnabledVersions *PagedRelationship `json:"gameCenterEnabledVersions,omitempty"` + InAppPurchases *PagedRelationship `json:"inAppPurchases,omitempty"` + PreOrder *Relationship `json:"preOrder,omitempty"` + PreReleaseVersions *PagedRelationship `json:"preReleaseVersions,omitempty"` + Prices *PagedRelationship `json:"prices,omitempty"` } // AppUpdateRequest defines model for AppUpdateRequest. @@ -108,18 +118,28 @@ type AppsResponse struct { // // https://developer.apple.com/documentation/appstoreconnectapi/inapppurchase type InAppPurchase struct { - Attributes *struct { - InAppPurchaseType *string `json:"inAppPurchaseType,omitempty"` - ProductID *string `json:"productId,omitempty"` - ReferenceName *string `json:"referenceName,omitempty"` - State *string `json:"state,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - Apps *PagedRelationship `json:"apps,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *InAppPurchaseAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *InAppPurchaseRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// InAppPurchaseAttributes defines model for InAppPurchase.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/inapppurchase/attributes +type InAppPurchaseAttributes struct { + InAppPurchaseType *string `json:"inAppPurchaseType,omitempty"` + ProductID *string `json:"productId,omitempty"` + ReferenceName *string `json:"referenceName,omitempty"` + State *string `json:"state,omitempty"` +} + +// InAppPurchaseRelationships defines model for InAppPurchase.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/inapppurchase/relationships +type InAppPurchaseRelationships struct { + Apps *PagedRelationship `json:"apps,omitempty"` } // InAppPurchaseResponse defines model for InAppPurchaseResponse. diff --git a/asc/apps_metadata_categories.go b/asc/apps_metadata_categories.go index 142d0df..3391825 100644 --- a/asc/apps_metadata_categories.go +++ b/asc/apps_metadata_categories.go @@ -9,16 +9,26 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/appcategory type AppCategory struct { - Attributes *struct { - Platforms *[]Platform `json:"platforms,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - Parent *Relationship `json:"parent,omitempty"` - Subcategories *PagedRelationship `json:"subcategories,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppCategoryAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppCategoryRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppCategoryAttributes defines model for AppCategory.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/appcategory/attributes +type AppCategoryAttributes struct { + Platforms *[]Platform `json:"platforms,omitempty"` +} + +// AppCategoryRelationships defines model for AppCategory.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/appcategory/relationships +type AppCategoryRelationships struct { + Parent *Relationship `json:"parent,omitempty"` + Subcategories *PagedRelationship `json:"subcategories,omitempty"` } // AppCategoriesResponse defines model for AppCategoriesResponse. diff --git a/asc/apps_metadata_eula.go b/asc/apps_metadata_eula.go index 7fc715d..6ff4f75 100644 --- a/asc/apps_metadata_eula.go +++ b/asc/apps_metadata_eula.go @@ -9,16 +9,26 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/enduserlicenseagreement type EndUserLicenseAgreement struct { - Attributes *struct { - AgreementText *string `json:"agreementText,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - Territories *PagedRelationship `json:"territories,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *EndUserLicenseAgreementAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *EndUserLicenseAgreementRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// EndUserLicenseAgreementAttributes defines model for EndUserLicenseAgreement.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/enduserlicenseagreement/attributes +type EndUserLicenseAgreementAttributes struct { + AgreementText *string `json:"agreementText,omitempty"` +} + +// EndUserLicenseAgreementRelationships defines model for EndUserLicenseAgreement.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/enduserlicenseagreement/relationships +type EndUserLicenseAgreementRelationships struct { + App *Relationship `json:"app,omitempty"` + Territories *PagedRelationship `json:"territories,omitempty"` } // EndUserLicenseAgreementCreateRequest defines model for EndUserLicenseAgreementCreateRequest. diff --git a/asc/apps_metadata_game_center.go b/asc/apps_metadata_game_center.go index 326198d..edb6a9c 100644 --- a/asc/apps_metadata_game_center.go +++ b/asc/apps_metadata_game_center.go @@ -9,18 +9,28 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/gamecenterenabledversion type GameCenterEnabledVersion struct { - Attributes *struct { - IconAsset *ImageAsset `json:"iconAsset,omitempty"` - Platform *Platform `json:"platform,omitempty"` - VersionString *string `json:"versionString,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - CompatibleVersions *PagedRelationship `json:"compatibleVersions,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *GameCenterEnabledVersionAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *GameCenterEnabledVersionRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// GameCenterEnabledVersionAttributes defines model for GameCenterEnabledVersion.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/gamecenterenabledversion/attributes +type GameCenterEnabledVersionAttributes struct { + IconAsset *ImageAsset `json:"iconAsset,omitempty"` + Platform *Platform `json:"platform,omitempty"` + VersionString *string `json:"versionString,omitempty"` +} + +// GameCenterEnabledVersionRelationships defines model for GameCenterEnabledVersion.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/gamecenterenabledversion/relationships +type GameCenterEnabledVersionRelationships struct { + App *Relationship `json:"app,omitempty"` + CompatibleVersions *PagedRelationship `json:"compatibleVersions,omitempty"` } // GameCenterEnabledVersionCompatibleVersionsLinkagesResponse defines model for GameCenterEnabledVersionCompatibleVersionsLinkagesResponse. diff --git a/asc/apps_metadata_info_localizations.go b/asc/apps_metadata_info_localizations.go index b75a573..b86956a 100644 --- a/asc/apps_metadata_info_localizations.go +++ b/asc/apps_metadata_info_localizations.go @@ -9,19 +9,29 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/appinfolocalization type AppInfoLocalization struct { - Attributes *struct { - Locale *string `json:"locale,omitempty"` - Name *string `json:"name,omitempty"` - PrivacyPolicyText *string `json:"privacyPolicyText,omitempty"` - PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"` - Subtitle *string `json:"subtitle,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AppInfo *Relationship `json:"appInfo,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppInfoLocalizationAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppInfoLocalizationRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppInfoLocalizationAttributes defines model for AppInfoLocalization.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/appinfolocalization/attributes +type AppInfoLocalizationAttributes struct { + Locale *string `json:"locale,omitempty"` + Name *string `json:"name,omitempty"` + PrivacyPolicyText *string `json:"privacyPolicyText,omitempty"` + PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"` + Subtitle *string `json:"subtitle,omitempty"` +} + +// AppInfoLocalizationRelationships defines model for AppInfoLocalization.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/appinfolocalization/relationships +type AppInfoLocalizationRelationships struct { + AppInfo *Relationship `json:"appInfo,omitempty"` } // AppInfoLocalizationCreateRequest defines model for AppInfoLocalizationCreateRequest. diff --git a/asc/apps_metadata_infos.go b/asc/apps_metadata_infos.go index 59ae104..ff1f9c9 100644 --- a/asc/apps_metadata_infos.go +++ b/asc/apps_metadata_infos.go @@ -9,25 +9,35 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/appinfo type AppInfo struct { - Attributes *struct { - AppStoreAgeRating *AppStoreAgeRating `json:"appStoreAgeRating,omitempty"` - AppStoreState *AppStoreVersionState `json:"appStoreState,omitempty"` - BrazilAgeRating *BrazilAgeRating `json:"brazilAgeRating,omitempty"` - KidsAgeBand *KidsAgeBand `json:"kidsAgeBand,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - AppInfoLocalizations *PagedRelationship `json:"appInfoLocalizations,omitempty"` - PrimaryCategory *Relationship `json:"primaryCategory,omitempty"` - PrimarySubcategoryOne *Relationship `json:"primarySubcategoryOne,omitempty"` - PrimarySubcategoryTwo *Relationship `json:"primarySubcategoryTwo,omitempty"` - SecondaryCategory *Relationship `json:"secondaryCategory,omitempty"` - SecondarySubcategoryOne *Relationship `json:"secondarySubcategoryOne,omitempty"` - SecondarySubcategoryTwo *Relationship `json:"secondarySubcategoryTwo,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppInfoAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppInfoRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppInfoAttributes defines model for AppInfo.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/appinfo/attributes +type AppInfoAttributes struct { + AppStoreAgeRating *AppStoreAgeRating `json:"appStoreAgeRating,omitempty"` + AppStoreState *AppStoreVersionState `json:"appStoreState,omitempty"` + BrazilAgeRating *BrazilAgeRating `json:"brazilAgeRating,omitempty"` + KidsAgeBand *KidsAgeBand `json:"kidsAgeBand,omitempty"` +} + +// AppInfoRelationships defines model for AppInfo.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/appinfo/relationships +type AppInfoRelationships struct { + App *Relationship `json:"app,omitempty"` + AppInfoLocalizations *PagedRelationship `json:"appInfoLocalizations,omitempty"` + PrimaryCategory *Relationship `json:"primaryCategory,omitempty"` + PrimarySubcategoryOne *Relationship `json:"primarySubcategoryOne,omitempty"` + PrimarySubcategoryTwo *Relationship `json:"primarySubcategoryTwo,omitempty"` + SecondaryCategory *Relationship `json:"secondaryCategory,omitempty"` + SecondarySubcategoryOne *Relationship `json:"secondarySubcategoryOne,omitempty"` + SecondarySubcategoryTwo *Relationship `json:"secondarySubcategoryTwo,omitempty"` } // AppInfoResponse defines model for AppInfoResponse. diff --git a/asc/apps_metadata_preview_sets.go b/asc/apps_metadata_preview_sets.go index 0e9f5a6..a3d6775 100644 --- a/asc/apps_metadata_preview_sets.go +++ b/asc/apps_metadata_preview_sets.go @@ -9,16 +9,26 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/apppreviewset type AppPreviewSet struct { - Attributes *struct { - PreviewType *PreviewType `json:"previewType,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AppPreviews *PagedRelationship `json:"appPreviews,omitempty"` - AppStoreVersionLocalization *Relationship `json:"appStoreVersionLocalization,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppPreviewSetAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppPreviewSetRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppPreviewSetAttributes defines model for AppPreviewSet.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/apppreviewset/attributes +type AppPreviewSetAttributes struct { + PreviewType *PreviewType `json:"previewType,omitempty"` +} + +// AppPreviewSetRelationships defines model for AppPreviewSet.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/apppreviewset/relationships +type AppPreviewSetRelationships struct { + AppPreviews *PagedRelationship `json:"appPreviews,omitempty"` + AppStoreVersionLocalization *Relationship `json:"appStoreVersionLocalization,omitempty"` } // AppPreviewSetCreateRequest defines model for AppPreviewSetCreateRequest. diff --git a/asc/apps_metadata_previews.go b/asc/apps_metadata_previews.go index 6f1e492..6966664 100644 --- a/asc/apps_metadata_previews.go +++ b/asc/apps_metadata_previews.go @@ -33,23 +33,33 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/apppreview type AppPreview struct { - Attributes *struct { - AssetDeliveryState *AppMediaAssetState `json:"assetDeliveryState,omitempty"` - FileName *string `json:"fileName,omitempty"` - FileSize *int64 `json:"fileSize,omitempty"` - MimeType *string `json:"mimeType,omitempty"` - PreviewFrameTimeCode *string `json:"previewFrameTimeCode,omitempty"` - PreviewImage *ImageAsset `json:"previewImage,omitempty"` - SourceFileChecksum *string `json:"sourceFileChecksum,omitempty"` - UploadOperations *UploadOperations `json:"uploadOperations,omitempty"` - VideoURL *string `json:"videoUrl,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AppPreviewSet *Relationship `json:"appPreviewSet,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppPreviewAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppPreviewRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppPreviewAttributes defines model for AppPreview.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/apppreview/attributes +type AppPreviewAttributes struct { + AssetDeliveryState *AppMediaAssetState `json:"assetDeliveryState,omitempty"` + FileName *string `json:"fileName,omitempty"` + FileSize *int64 `json:"fileSize,omitempty"` + MimeType *string `json:"mimeType,omitempty"` + PreviewFrameTimeCode *string `json:"previewFrameTimeCode,omitempty"` + PreviewImage *ImageAsset `json:"previewImage,omitempty"` + SourceFileChecksum *string `json:"sourceFileChecksum,omitempty"` + UploadOperations *UploadOperations `json:"uploadOperations,omitempty"` + VideoURL *string `json:"videoUrl,omitempty"` +} + +// AppPreviewRelationships defines model for AppPreview.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/apppreview/relationships +type AppPreviewRelationships struct { + AppPreviewSet *Relationship `json:"appPreviewSet,omitempty"` } // AppPreviewCreateRequest defines model for AppPreviewCreateRequest. diff --git a/asc/apps_metadata_routing.go b/asc/apps_metadata_routing.go index 2d66ba6..c663f82 100644 --- a/asc/apps_metadata_routing.go +++ b/asc/apps_metadata_routing.go @@ -9,19 +9,29 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/routingappcoverage type RoutingAppCoverage struct { - Attributes *struct { - AssetDeliveryState *AppMediaAssetState `json:"assetDeliveryState,omitempty"` - FileName *string `json:"fileName,omitempty"` - FileSize *int64 `json:"fileSize,omitempty"` - SourceFileChecksum *string `json:"sourceFileChecksum,omitempty"` - UploadOperations *UploadOperations `json:"uploadOperations,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AppStoreVersion *Relationship `json:"appStoreVersion,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *RoutingAppCoverageAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *RoutingAppCoverageRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// RoutingAppCoverageAttributes defines model for RoutingAppCoverage.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/routingappcoverage/attributes +type RoutingAppCoverageAttributes struct { + AssetDeliveryState *AppMediaAssetState `json:"assetDeliveryState,omitempty"` + FileName *string `json:"fileName,omitempty"` + FileSize *int64 `json:"fileSize,omitempty"` + SourceFileChecksum *string `json:"sourceFileChecksum,omitempty"` + UploadOperations *UploadOperations `json:"uploadOperations,omitempty"` +} + +// RoutingAppCoverageRelationships defines model for RoutingAppCoverage.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/routingappcoverage/relationships +type RoutingAppCoverageRelationships struct { + AppStoreVersion *Relationship `json:"appStoreVersion,omitempty"` } // RoutingAppCoverageCreateRequest defines model for RoutingAppCoverageCreateRequest. diff --git a/asc/apps_metadata_screenshot_sets.go b/asc/apps_metadata_screenshot_sets.go index 6bb19cb..897ca5e 100644 --- a/asc/apps_metadata_screenshot_sets.go +++ b/asc/apps_metadata_screenshot_sets.go @@ -43,16 +43,26 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/appscreenshotset type AppScreenshotSet struct { - Attributes *struct { - ScreenshotDisplayType *ScreenshotDisplayType `json:"screenshotDisplayType,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AppScreenshots *PagedRelationship `json:"appScreenshots,omitempty"` - AppStoreVersionLocalization *Relationship `json:"appStoreVersionLocalization,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppScreenshotSetAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppScreenshotSetRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppScreenshotSetAttributes defines model for AppScreenshotSet.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/appscreenshotset/attributes +type AppScreenshotSetAttributes struct { + ScreenshotDisplayType *ScreenshotDisplayType `json:"screenshotDisplayType,omitempty"` +} + +// AppScreenshotSetRelationships defines model for AppScreenshotSet.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/appscreenshotset/relationships +type AppScreenshotSetRelationships struct { + AppScreenshots *PagedRelationship `json:"appScreenshots,omitempty"` + AppStoreVersionLocalization *Relationship `json:"appStoreVersionLocalization,omitempty"` } // AppScreenshotSetCreateRequest defines model for AppScreenshotSetCreateRequest. diff --git a/asc/apps_metadata_screenshots.go b/asc/apps_metadata_screenshots.go index cf93006..665e36f 100644 --- a/asc/apps_metadata_screenshots.go +++ b/asc/apps_metadata_screenshots.go @@ -9,22 +9,32 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/appscreenshot type AppScreenshot struct { - Attributes *struct { - AssetDeliveryState *AppMediaAssetState `json:"assetDeliveryState,omitempty"` - AssetToken *string `json:"assetToken,omitempty"` - AssetType *string `json:"assetType,omitempty"` - FileName *string `json:"fileName,omitempty"` - FileSize *int64 `json:"fileSize,omitempty"` - ImageAsset *ImageAsset `json:"imageAsset,omitempty"` - SourceFileChecksum *string `json:"sourceFileChecksum,omitempty"` - UploadOperations *UploadOperations `json:"uploadOperations,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AppScreenshotSet *Relationship `json:"appScreenshotSet,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppScreenshotAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppScreenshotRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppScreenshotAttributes defines model for AppScreenshot.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/appscreenshot/attributes +type AppScreenshotAttributes struct { + AssetDeliveryState *AppMediaAssetState `json:"assetDeliveryState,omitempty"` + AssetToken *string `json:"assetToken,omitempty"` + AssetType *string `json:"assetType,omitempty"` + FileName *string `json:"fileName,omitempty"` + FileSize *int64 `json:"fileSize,omitempty"` + ImageAsset *ImageAsset `json:"imageAsset,omitempty"` + SourceFileChecksum *string `json:"sourceFileChecksum,omitempty"` + UploadOperations *UploadOperations `json:"uploadOperations,omitempty"` +} + +// AppScreenshotRelationships defines model for AppScreenshot.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/appscreenshot/relationships +type AppScreenshotRelationships struct { + AppScreenshotSet *Relationship `json:"appScreenshotSet,omitempty"` } // AppScreenshotCreateRequest defines model for AppScreenshotCreateRequest. diff --git a/asc/apps_metadata_version_localizations.go b/asc/apps_metadata_version_localizations.go index 67190dc..c0e963e 100644 --- a/asc/apps_metadata_version_localizations.go +++ b/asc/apps_metadata_version_localizations.go @@ -9,23 +9,33 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/appstoreversionlocalization type AppStoreVersionLocalization struct { - Attributes *struct { - Description *string `json:"description,omitempty"` - Keywords *string `json:"keywords,omitempty"` - Locale *string `json:"locale,omitempty"` - MarketingURL *string `json:"marketingUrl,omitempty"` - PromotionalText *string `json:"promotionalText,omitempty"` - SupportURL *string `json:"supportUrl,omitempty"` - WhatsNew *string `json:"whatsNew,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AppPreviewSets *PagedRelationship `json:"appPreviewSets,omitempty"` - AppScreenshotSets *PagedRelationship `json:"appScreenshotSets,omitempty"` - AppStoreVersion *Relationship `json:"appStoreVersion,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppStoreVersionLocalizationAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppStoreVersionLocalizationRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppStoreVersionLocalizationAttributes defines model for AppStoreVersionLocalization.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/appstoreversionlocalization/attributes +type AppStoreVersionLocalizationAttributes struct { + Description *string `json:"description,omitempty"` + Keywords *string `json:"keywords,omitempty"` + Locale *string `json:"locale,omitempty"` + MarketingURL *string `json:"marketingUrl,omitempty"` + PromotionalText *string `json:"promotionalText,omitempty"` + SupportURL *string `json:"supportUrl,omitempty"` + WhatsNew *string `json:"whatsNew,omitempty"` +} + +// AppStoreVersionLocalizationRelationships defines model for AppStoreVersionLocalization.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/appstoreversionlocalization/relationships +type AppStoreVersionLocalizationRelationships struct { + AppPreviewSets *PagedRelationship `json:"appPreviewSets,omitempty"` + AppScreenshotSets *PagedRelationship `json:"appScreenshotSets,omitempty"` + AppStoreVersion *Relationship `json:"appStoreVersion,omitempty"` } // AppStoreVersionLocalizationCreateRequest defines model for AppStoreVersionLocalizationCreateRequest. diff --git a/asc/apps_metadata_versions.go b/asc/apps_metadata_versions.go index a8478fa..b05514f 100644 --- a/asc/apps_metadata_versions.go +++ b/asc/apps_metadata_versions.go @@ -65,56 +65,71 @@ type AppStoreVersionUpdateRequestRelationships struct { // // https://developer.apple.com/documentation/appstoreconnectapi/ageratingdeclaration type AgeRatingDeclaration struct { - Attributes *struct { - AlcoholTobaccoOrDrugUseOrReferences *string `json:"alcoholTobaccoOrDrugUseOrReferences,omitempty"` - GamblingAndContests *bool `json:"gamblingAndContests,omitempty"` - GamblingSimulated *string `json:"gamblingSimulated,omitempty"` - HorrorOrFearThemes *string `json:"horrorOrFearThemes,omitempty"` - KidsAgeBand *KidsAgeBand `json:"kidsAgeBand,omitempty"` - MatureOrSuggestiveThemes *string `json:"matureOrSuggestiveThemes,omitempty"` - MedicalOrTreatmentInformation *string `json:"medicalOrTreatmentInformation,omitempty"` - ProfanityOrCrudeHumor *string `json:"profanityOrCrudeHumor,omitempty"` - SexualContentGraphicAndNudity *string `json:"sexualContentGraphicAndNudity,omitempty"` - SexualContentOrNudity *string `json:"sexualContentOrNudity,omitempty"` - UnrestrictedWebAccess *bool `json:"unrestrictedWebAccess,omitempty"` - ViolenceCartoonOrFantasy *string `json:"violenceCartoonOrFantasy,omitempty"` - ViolenceRealistic *string `json:"violenceRealistic,omitempty"` - ViolenceRealisticProlongedGraphicOrSadistic *string `json:"violenceRealisticProlongedGraphicOrSadistic,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Type string `json:"type"` + Attributes *AgeRatingDeclarationAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Type string `json:"type"` +} + +// AgeRatingDeclarationAttributes defines model for AgeRatingDeclaration.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/ageratingdeclaration/attributes +type AgeRatingDeclarationAttributes struct { + AlcoholTobaccoOrDrugUseOrReferences *string `json:"alcoholTobaccoOrDrugUseOrReferences,omitempty"` + GamblingAndContests *bool `json:"gamblingAndContests,omitempty"` + GamblingSimulated *string `json:"gamblingSimulated,omitempty"` + HorrorOrFearThemes *string `json:"horrorOrFearThemes,omitempty"` + KidsAgeBand *KidsAgeBand `json:"kidsAgeBand,omitempty"` + MatureOrSuggestiveThemes *string `json:"matureOrSuggestiveThemes,omitempty"` + MedicalOrTreatmentInformation *string `json:"medicalOrTreatmentInformation,omitempty"` + ProfanityOrCrudeHumor *string `json:"profanityOrCrudeHumor,omitempty"` + SexualContentGraphicAndNudity *string `json:"sexualContentGraphicAndNudity,omitempty"` + SexualContentOrNudity *string `json:"sexualContentOrNudity,omitempty"` + UnrestrictedWebAccess *bool `json:"unrestrictedWebAccess,omitempty"` + ViolenceCartoonOrFantasy *string `json:"violenceCartoonOrFantasy,omitempty"` + ViolenceRealistic *string `json:"violenceRealistic,omitempty"` + ViolenceRealisticProlongedGraphicOrSadistic *string `json:"violenceRealisticProlongedGraphicOrSadistic,omitempty"` } // AppStoreVersion defines model for AppStoreVersion. // // https://developer.apple.com/documentation/appstoreconnectapi/appstoreversion type AppStoreVersion struct { - Attributes *struct { - AppStoreState *AppStoreVersionState `json:"appStoreState,omitempty"` - Copyright *string `json:"copyright,omitempty"` - CreatedDate *time.Time `json:"createdDate,omitempty"` - Downloadable *bool `json:"downloadable,omitempty"` - EarliestReleaseDate *time.Time `json:"earliestReleaseDate,omitempty"` - Platform *Platform `json:"platform,omitempty"` - ReleaseType *string `json:"releaseType,omitempty"` - UsesIDFA *bool `json:"usesIdfa,omitempty"` - VersionString *string `json:"versionString,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AgeRatingDeclaration *Relationship `json:"ageRatingDeclaration,omitempty"` - App *Relationship `json:"app,omitempty"` - AppStoreReviewDetail *Relationship `json:"appStoreReviewDetail,omitempty"` - AppStoreVersionLocalizations *PagedRelationship `json:"appStoreVersionLocalizations,omitempty"` - AppStoreVersionPhasedRelease *Relationship `json:"appStoreVersionPhasedRelease,omitempty"` - AppStoreVersionSubmission *Relationship `json:"appStoreVersionSubmission,omitempty"` - Build *Relationship `json:"build,omitempty"` - IDFADeclaration *Relationship `json:"idfaDeclaration,omitempty"` - RoutingAppCoverage *Relationship `json:"routingAppCoverage,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppStoreVersionAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppStoreVersionRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppStoreVersionAttributes defines model for AppStoreVersion.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/appstoreversion/attributes +type AppStoreVersionAttributes struct { + AppStoreState *AppStoreVersionState `json:"appStoreState,omitempty"` + Copyright *string `json:"copyright,omitempty"` + CreatedDate *time.Time `json:"createdDate,omitempty"` + Downloadable *bool `json:"downloadable,omitempty"` + EarliestReleaseDate *time.Time `json:"earliestReleaseDate,omitempty"` + Platform *Platform `json:"platform,omitempty"` + ReleaseType *string `json:"releaseType,omitempty"` + UsesIDFA *bool `json:"usesIdfa,omitempty"` + VersionString *string `json:"versionString,omitempty"` +} + +// AppStoreVersionRelationships defines model for AppStoreVersion.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/appstoreversion/relationships +type AppStoreVersionRelationships struct { + AgeRatingDeclaration *Relationship `json:"ageRatingDeclaration,omitempty"` + App *Relationship `json:"app,omitempty"` + AppStoreReviewDetail *Relationship `json:"appStoreReviewDetail,omitempty"` + AppStoreVersionLocalizations *PagedRelationship `json:"appStoreVersionLocalizations,omitempty"` + AppStoreVersionPhasedRelease *Relationship `json:"appStoreVersionPhasedRelease,omitempty"` + AppStoreVersionSubmission *Relationship `json:"appStoreVersionSubmission,omitempty"` + Build *Relationship `json:"build,omitempty"` + IDFADeclaration *Relationship `json:"idfaDeclaration,omitempty"` + RoutingAppCoverage *Relationship `json:"routingAppCoverage,omitempty"` } // AppStoreVersionResponse defines model for AppStoreVersionResponse. diff --git a/asc/builds.go b/asc/builds.go index 1243a00..14b0a7f 100644 --- a/asc/builds.go +++ b/asc/builds.go @@ -17,30 +17,40 @@ type BuildsService service // // https://developer.apple.com/documentation/appstoreconnectapi/build type Build struct { - Attributes *struct { - ExpirationDate *time.Time `json:"expirationDate,omitempty"` - Expired *bool `json:"expired,omitempty"` - IconAssetToken *ImageAsset `json:"iconAssetToken,omitempty"` - MinOsVersion *string `json:"minOsVersion,omitempty"` - ProcessingState *string `json:"processingState,omitempty"` - UploadedDate *time.Time `json:"uploadedDate,omitempty"` - UsesNonExemptEncryption *bool `json:"usesNonExemptEncryption,omitempty"` - Version *string `json:"version,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - AppEncryptionDeclaration *Relationship `json:"appEncryptionDeclaration,omitempty"` - AppStoreVersion *Relationship `json:"appStoreVersion,omitempty"` - BetaAppReviewSubmission *Relationship `json:"betaAppReviewSubmission,omitempty"` - BetaBuildLocalizations *PagedRelationship `json:"betaBuildLocalizations,omitempty"` - BuildBetaDetail *Relationship `json:"buildBetaDetail,omitempty"` - Icons *PagedRelationship `json:"icons,omitempty"` - IndividualTesters *PagedRelationship `json:"individualTesters,omitempty"` - PreReleaseVersion *Relationship `json:"preReleaseVersion,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *BuildAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *BuildRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// BuildAttributes defines model for Build.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/build/attributes +type BuildAttributes struct { + ExpirationDate *time.Time `json:"expirationDate,omitempty"` + Expired *bool `json:"expired,omitempty"` + IconAssetToken *ImageAsset `json:"iconAssetToken,omitempty"` + MinOsVersion *string `json:"minOsVersion,omitempty"` + ProcessingState *string `json:"processingState,omitempty"` + UploadedDate *time.Time `json:"uploadedDate,omitempty"` + UsesNonExemptEncryption *bool `json:"usesNonExemptEncryption,omitempty"` + Version *string `json:"version,omitempty"` +} + +// BuildRelationships defines model for Build.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/build/relationships +type BuildRelationships struct { + App *Relationship `json:"app,omitempty"` + AppEncryptionDeclaration *Relationship `json:"appEncryptionDeclaration,omitempty"` + AppStoreVersion *Relationship `json:"appStoreVersion,omitempty"` + BetaAppReviewSubmission *Relationship `json:"betaAppReviewSubmission,omitempty"` + BetaBuildLocalizations *PagedRelationship `json:"betaBuildLocalizations,omitempty"` + BuildBetaDetail *Relationship `json:"buildBetaDetail,omitempty"` + Icons *PagedRelationship `json:"icons,omitempty"` + IndividualTesters *PagedRelationship `json:"individualTesters,omitempty"` + PreReleaseVersion *Relationship `json:"preReleaseVersion,omitempty"` } // BuildResponse defines model for BuildResponse. diff --git a/asc/builds_app_encryption_declarations.go b/asc/builds_app_encryption_declarations.go index e6f6386..911bb82 100644 --- a/asc/builds_app_encryption_declarations.go +++ b/asc/builds_app_encryption_declarations.go @@ -24,26 +24,36 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/appencryptiondeclaration type AppEncryptionDeclaration struct { - Attributes *struct { - AppEncryptionDeclarationState *AppEncryptionDeclarationState `json:"appEncryptionDeclarationState,omitempty"` - AvailableOnFrenchStore *bool `json:"availableOnFrenchStore,omitempty"` - CodeValue *string `json:"codeValue,omitempty"` - ContainsProprietaryCryptography *bool `json:"containsProprietaryCryptography,omitempty"` - ContainsThirdPartyCryptography *bool `json:"containsThirdPartyCryptography,omitempty"` - DocumentName *string `json:"documentName,omitempty"` - DocumentType *string `json:"documentType,omitempty"` - DocumentURL *string `json:"documentUrl,omitempty"` - Exempt *bool `json:"exempt,omitempty"` - Platform *Platform `json:"platform,omitempty"` - UploadedDate *time.Time `json:"uploadedDate,omitempty"` - UsesEncryption *bool `json:"usesEncryption,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppEncryptionDeclarationAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppEncryptionDeclarationRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppEncryptionDeclarationAttributes defines model for AppEncryptionDeclaration.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/appencryptiondeclaration/attributes +type AppEncryptionDeclarationAttributes struct { + AppEncryptionDeclarationState *AppEncryptionDeclarationState `json:"appEncryptionDeclarationState,omitempty"` + AvailableOnFrenchStore *bool `json:"availableOnFrenchStore,omitempty"` + CodeValue *string `json:"codeValue,omitempty"` + ContainsProprietaryCryptography *bool `json:"containsProprietaryCryptography,omitempty"` + ContainsThirdPartyCryptography *bool `json:"containsThirdPartyCryptography,omitempty"` + DocumentName *string `json:"documentName,omitempty"` + DocumentType *string `json:"documentType,omitempty"` + DocumentURL *string `json:"documentUrl,omitempty"` + Exempt *bool `json:"exempt,omitempty"` + Platform *Platform `json:"platform,omitempty"` + UploadedDate *time.Time `json:"uploadedDate,omitempty"` + UsesEncryption *bool `json:"usesEncryption,omitempty"` +} + +// AppEncryptionDeclarationRelationships defines model for AppEncryptionDeclaration.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/appencryptiondeclaration/relationships +type AppEncryptionDeclarationRelationships struct { + App *Relationship `json:"app,omitempty"` } // AppEncryptionDeclarationResponse defines model for AppEncryptionDeclarationResponse. diff --git a/asc/builds_build_icons.go b/asc/builds_build_icons.go index 2e76810..2fa0bff 100644 --- a/asc/builds_build_icons.go +++ b/asc/builds_build_icons.go @@ -23,13 +23,18 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/buildicon type BuildIcon struct { - Attributes *struct { - IconAsset *ImageAsset `json:"iconAsset,omitempty"` - IconType *IconAssetType `json:"iconType,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Type string `json:"type"` + Attributes *BuildIconAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Type string `json:"type"` +} + +// BuildIconAttributes defines model for BuildIcon.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/buildicon/attributes +type BuildIconAttributes struct { + IconAsset *ImageAsset `json:"iconAsset,omitempty"` + IconType *IconAssetType `json:"iconType,omitempty"` } // BuildIconsResponse defines model for BuildIconsResponse. diff --git a/asc/pricing.go b/asc/pricing.go index 1bde3e3..316bd6b 100644 --- a/asc/pricing.go +++ b/asc/pricing.go @@ -16,13 +16,18 @@ type PricingService service // // https://developer.apple.com/documentation/appstoreconnectapi/appprice type AppPrice struct { - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - PriceTier *Relationship `json:"priceTier,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppPriceRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppPriceRelationships defines model for AppPrice.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/appprice/relationships +type AppPriceRelationships struct { + App *Relationship `json:"app,omitempty"` + PriceTier *Relationship `json:"priceTier,omitempty"` } // AppPriceResponse defines model for AppPriceResponse. diff --git a/asc/pricing_territories.go b/asc/pricing_territories.go index 6704ac7..163742f 100644 --- a/asc/pricing_territories.go +++ b/asc/pricing_territories.go @@ -9,12 +9,17 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/territory type Territory struct { - Attributes *struct { - Currency *string `json:"currency,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Type string `json:"type"` + Attributes *TerritoryAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Type string `json:"type"` +} + +// TerritoryAttributes defines model for Territory.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/territory/attributes +type TerritoryAttributes struct { + Currency *string `json:"currency,omitempty"` } // TerritoryResponse defines model for TerritoryResponse. diff --git a/asc/pricing_tiers.go b/asc/pricing_tiers.go index 083b38b..c041331 100644 --- a/asc/pricing_tiers.go +++ b/asc/pricing_tiers.go @@ -9,12 +9,17 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/apppricetier type AppPriceTier struct { - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - PricePoints *PagedRelationship `json:"pricePoints,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppPriceTierRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppPriceTierRelationships defines model for AppPriceTier.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/apppricetier/relationships +type AppPriceTierRelationships struct { + PricePoints *PagedRelationship `json:"pricePoints,omitempty"` } // AppPriceTierResponse defines model for AppPriceTierResponse. @@ -40,17 +45,27 @@ type AppPriceTiersResponse struct { // // https://developer.apple.com/documentation/appstoreconnectapi/apppricepoint type AppPricePoint struct { - Attributes *struct { - CustomerPrice *string `json:"customerPrice,omitempty"` - Proceeds *string `json:"proceeds,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - PriceTier *Relationship `json:"priceTier,omitempty"` - Territory *Relationship `json:"territory,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppPricePointAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppPricePointRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppPricePointAttributes defines model for AppPricePoint.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/apppricepoint/attributes +type AppPricePointAttributes struct { + CustomerPrice *string `json:"customerPrice,omitempty"` + Proceeds *string `json:"proceeds,omitempty"` +} + +// AppPricePointRelationships defines model for AppPricePoint.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/apppricepoint/relationships +type AppPricePointRelationships struct { + PriceTier *Relationship `json:"priceTier,omitempty"` + Territory *Relationship `json:"territory,omitempty"` } // AppPricePointResponse defines model for AppPricePointResponse. diff --git a/asc/provisioning_bundle_ids.go b/asc/provisioning_bundle_ids.go index 36fd758..09a5c10 100644 --- a/asc/provisioning_bundle_ids.go +++ b/asc/provisioning_bundle_ids.go @@ -21,20 +21,30 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/bundleid type BundleID struct { - Attributes *struct { - IDentifier *string `json:"identifier,omitempty"` - Name *string `json:"name,omitempty"` - Platform *BundleIDPlatform `json:"platform,omitempty"` - SeedID *string `json:"seedId,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - BundleIDCapabilities *PagedRelationship `json:"bundleIdCapabilities,omitempty"` - Profiles *PagedRelationship `json:"profiles,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *BundleIDAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *BundleIDRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// BundleIDAttributes defines model for BundleId.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/bundleid/attributes +type BundleIDAttributes struct { + IDentifier *string `json:"identifier,omitempty"` + Name *string `json:"name,omitempty"` + Platform *BundleIDPlatform `json:"platform,omitempty"` + SeedID *string `json:"seedId,omitempty"` +} + +// BundleIDRelationships defines model for BundleId.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/bundleid/relationships +type BundleIDRelationships struct { + App *Relationship `json:"app,omitempty"` + BundleIDCapabilities *PagedRelationship `json:"bundleIdCapabilities,omitempty"` + Profiles *PagedRelationship `json:"profiles,omitempty"` } // BundleIDCreateRequest defines model for BundleIdCreateRequest. diff --git a/asc/provisioning_capabilities.go b/asc/provisioning_capabilities.go index cc41308..db09955 100644 --- a/asc/provisioning_capabilities.go +++ b/asc/provisioning_capabilities.go @@ -46,13 +46,18 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/bundleidcapability type BundleIDCapability struct { - Attributes *struct { - CapabilityType *CapabilityType `json:"capabilityType,omitempty"` - Settings *[]CapabilitySetting `json:"settings,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Type string `json:"type"` + Attributes *BundleIDCapabilityAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Type string `json:"type"` +} + +// BundleIDCapabilityAttributes defines model for BundleIdCapability.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/bundleidcapability/attributes +type BundleIDCapabilityAttributes struct { + CapabilityType *CapabilityType `json:"capabilityType,omitempty"` + Settings *[]CapabilitySetting `json:"settings,omitempty"` } // BundleIDCapabilityCreateRequest defines model for BundleIdCapabilityCreateRequest. diff --git a/asc/provisioning_certificates.go b/asc/provisioning_certificates.go index 730ff5e..af6f761 100644 --- a/asc/provisioning_certificates.go +++ b/asc/provisioning_certificates.go @@ -28,18 +28,23 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/certificate type Certificate struct { - Attributes *struct { - CertificateContent *string `json:"certificateContent,omitempty"` - CertificateType *CertificateType `json:"certificateType,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - ExpirationDate *time.Time `json:"expirationDate,omitempty"` - Name *string `json:"name,omitempty"` - Platform *BundleIDPlatform `json:"platform,omitempty"` - SerialNumber *string `json:"serialNumber,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Type string `json:"type"` + Attributes *CertificateAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Type string `json:"type"` +} + +// CertificateAttributes defines model for Certificate.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/certificate/attributes +type CertificateAttributes struct { + CertificateContent *string `json:"certificateContent,omitempty"` + CertificateType *CertificateType `json:"certificateType,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExpirationDate *time.Time `json:"expirationDate,omitempty"` + Name *string `json:"name,omitempty"` + Platform *BundleIDPlatform `json:"platform,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` } // CertificateCreateRequest defines model for CertificateCreateRequest. diff --git a/asc/provisioning_devices.go b/asc/provisioning_devices.go index beec90f..0e8d336 100644 --- a/asc/provisioning_devices.go +++ b/asc/provisioning_devices.go @@ -10,18 +10,23 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/device type Device struct { - Attributes *struct { - AddedDate *time.Time `json:"addedDate,omitempty"` - DeviceClass *string `json:"deviceClass,omitempty"` - Model *string `json:"model,omitempty"` - Name *string `json:"name,omitempty"` - Platform *BundleIDPlatform `json:"platform,omitempty"` - Status *string `json:"status,omitempty"` - UDID *string `json:"udid,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Type string `json:"type"` + Attributes *DeviceAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Type string `json:"type"` +} + +// DeviceAttributes defines model for Device.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/device/attributes +type DeviceAttributes struct { + AddedDate *time.Time `json:"addedDate,omitempty"` + DeviceClass *string `json:"deviceClass,omitempty"` + Model *string `json:"model,omitempty"` + Name *string `json:"name,omitempty"` + Platform *BundleIDPlatform `json:"platform,omitempty"` + Status *string `json:"status,omitempty"` + UDID *string `json:"udid,omitempty"` } // DeviceCreateRequest defines model for DeviceCreateRequest. diff --git a/asc/provisioning_profiles.go b/asc/provisioning_profiles.go index de96595..dbad7d6 100644 --- a/asc/provisioning_profiles.go +++ b/asc/provisioning_profiles.go @@ -10,24 +10,34 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/profile type Profile struct { - Attributes *struct { - CreatedDate *time.Time `json:"createdDate,omitempty"` - ExpirationDate *time.Time `json:"expirationDate,omitempty"` - Name *string `json:"name,omitempty"` - Platform *BundleIDPlatform `json:"platform,omitempty"` - ProfileContent *string `json:"profileContent,omitempty"` - ProfileState *string `json:"profileState,omitempty"` - ProfileType *string `json:"profileType,omitempty"` - UUID *string `json:"uuid,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - BundleID *Relationship `json:"bundleId,omitempty"` - Certificates *PagedRelationship `json:"certificates,omitempty"` - Devices *PagedRelationship `json:"devices,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *ProfileAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *ProfileRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// ProfileAttributes defines model for Profile.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/profile/attributes +type ProfileAttributes struct { + CreatedDate *time.Time `json:"createdDate,omitempty"` + ExpirationDate *time.Time `json:"expirationDate,omitempty"` + Name *string `json:"name,omitempty"` + Platform *BundleIDPlatform `json:"platform,omitempty"` + ProfileContent *string `json:"profileContent,omitempty"` + ProfileState *string `json:"profileState,omitempty"` + ProfileType *string `json:"profileType,omitempty"` + UUID *string `json:"uuid,omitempty"` +} + +// ProfileRelationships defines model for Profile.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/profile/relationships +type ProfileRelationships struct { + BundleID *Relationship `json:"bundleId,omitempty"` + Certificates *PagedRelationship `json:"certificates,omitempty"` + Devices *PagedRelationship `json:"devices,omitempty"` } // ProfileCreateRequest defines model for ProfileCreateRequest. diff --git a/asc/publishing_phased_release.go b/asc/publishing_phased_release.go index c873d4a..51d635b 100644 --- a/asc/publishing_phased_release.go +++ b/asc/publishing_phased_release.go @@ -26,15 +26,20 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/appstoreversionphasedrelease type AppStoreVersionPhasedRelease struct { - Attributes *struct { - CurrentDayNumber *int `json:"currentDayNumber,omitempty"` - PhasedReleaseState *PhasedReleaseState `json:"phasedReleaseState,omitempty"` - StartDate *time.Time `json:"startDate,omitempty"` - TotalPauseDuration *int `json:"totalPauseDuration,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Type string `json:"type"` + Attributes *AppStoreVersionPhasedReleaseAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Type string `json:"type"` +} + +// AppStoreVersionPhasedReleaseAttributes defines model for AppStoreVersionPhasedRelease.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/appstoreversionphasedrelease/attributes +type AppStoreVersionPhasedReleaseAttributes struct { + CurrentDayNumber *int `json:"currentDayNumber,omitempty"` + PhasedReleaseState *PhasedReleaseState `json:"phasedReleaseState,omitempty"` + StartDate *time.Time `json:"startDate,omitempty"` + TotalPauseDuration *int `json:"totalPauseDuration,omitempty"` } // AppStoreVersionPhasedReleaseCreateRequest defines model for AppStoreVersionPhasedReleaseCreateRequest. diff --git a/asc/publishing_preorder.go b/asc/publishing_preorder.go index 97a1150..64ef7d6 100644 --- a/asc/publishing_preorder.go +++ b/asc/publishing_preorder.go @@ -9,16 +9,26 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/apppreorder type AppPreOrder struct { - Attributes *struct { - AppReleaseDate *Date `json:"appReleaseDate,omitempty"` - PreOrderAvailableDate *Date `json:"preOrderAvailableDate,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppPreOrderAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppPreOrderRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppPreOrderAttributes defines model for AppPreOrder.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/apppreorder/attributes +type AppPreOrderAttributes struct { + AppReleaseDate *Date `json:"appReleaseDate,omitempty"` + PreOrderAvailableDate *Date `json:"preOrderAvailableDate,omitempty"` +} + +// AppPreOrderRelationships defines model for AppPreOrder.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/apppreorder/relationships +type AppPreOrderRelationships struct { + App *Relationship `json:"app,omitempty"` } // AppPreOrderCreateRequest defines model for AppPreOrderCreateRequest. diff --git a/asc/reporting_power_performance_metrics.go b/asc/reporting_power_performance_metrics.go index c2ca4ab..371a6c4 100644 --- a/asc/reporting_power_performance_metrics.go +++ b/asc/reporting_power_performance_metrics.go @@ -27,14 +27,19 @@ type DiagnosticLogsResponse struct { // // https://developer.apple.com/documentation/appstoreconnectapi/diagnosticsignature type DiagnosticSignature struct { - Attributes *struct { - DiagnosticType *string `json:"diagnosticType,omitempty"` - Signature *string `json:"signature,omitempty"` - Weight *float32 `json:"weight,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Type string `json:"type"` + Attributes *DiagnosticSignatureAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Type string `json:"type"` +} + +// DiagnosticSignatureAttributes defines model for DiagnosticSignature.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/diagnosticsignature/attributes +type DiagnosticSignatureAttributes struct { + DiagnosticType *string `json:"diagnosticType,omitempty"` + Signature *string `json:"signature,omitempty"` + Weight *float32 `json:"weight,omitempty"` } // DiagnosticSignaturesResponse defines model for DiagnosticSignaturesResponse. @@ -51,14 +56,19 @@ type DiagnosticSignaturesResponse struct { // // https://developer.apple.com/documentation/appstoreconnectapi/perfpowermetric type PerfPowerMetric struct { - Attributes *struct { - DeviceType *string `json:"deviceType,omitempty"` - MetricType *string `json:"metricType,omitempty"` - Platform *string `json:"platform,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Type string `json:"type"` + Attributes *PerfPowerMetricAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Type string `json:"type"` +} + +// PerfPowerMetricAttributes defines model for PerfPowerMetric.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/perfpowermetric/attributes +type PerfPowerMetricAttributes struct { + DeviceType *string `json:"deviceType,omitempty"` + MetricType *string `json:"metricType,omitempty"` + Platform *string `json:"platform,omitempty"` } // PerfPowerMetricsResponse defines model for PerfPowerMetricsResponse. diff --git a/asc/submission_app_store_version_submissions.go b/asc/submission_app_store_version_submissions.go index 3570157..edbe1b7 100644 --- a/asc/submission_app_store_version_submissions.go +++ b/asc/submission_app_store_version_submissions.go @@ -9,12 +9,17 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/appstoreversionsubmission type AppStoreVersionSubmission struct { - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AppStoreVersion *Relationship `json:"appStoreVersion,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppStoreVersionSubmissionRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppStoreVersionSubmissionRelationships defines model for AppStoreVersionSubmission.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/appstoreversionsubmission/relationships +type AppStoreVersionSubmissionRelationships struct { + AppStoreVersion *Relationship `json:"appStoreVersion,omitempty"` } // AppStoreVersionSubmissionCreateRequest defines model for AppStoreVersionSubmissionCreateRequest. diff --git a/asc/submission_idfa_declarations.go b/asc/submission_idfa_declarations.go index 10ed7c0..7118108 100644 --- a/asc/submission_idfa_declarations.go +++ b/asc/submission_idfa_declarations.go @@ -9,18 +9,28 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/idfadeclaration type IDFADeclaration struct { - Attributes *struct { - AttributesActionWithPreviousAd *bool `json:"attributesActionWithPreviousAd,omitempty"` - AttributesAppInstallationToPreviousAd *bool `json:"attributesAppInstallationToPreviousAd,omitempty"` - HonorsLimitedAdTracking *bool `json:"honorsLimitedAdTracking,omitempty"` - ServesAds *bool `json:"servesAds,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AppStoreVersion *Relationship `json:"appStoreVersion,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *IDFADeclarationAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *IDFADeclarationRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// IDFADeclarationAttributes defines model for IDFADeclaration.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/idfadeclaration/attributes +type IDFADeclarationAttributes struct { + AttributesActionWithPreviousAd *bool `json:"attributesActionWithPreviousAd,omitempty"` + AttributesAppInstallationToPreviousAd *bool `json:"attributesAppInstallationToPreviousAd,omitempty"` + HonorsLimitedAdTracking *bool `json:"honorsLimitedAdTracking,omitempty"` + ServesAds *bool `json:"servesAds,omitempty"` +} + +// IDFADeclarationRelationships defines model for IDFADeclaration.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/idfadeclaration/relationships +type IDFADeclarationRelationships struct { + AppStoreVersion *Relationship `json:"appStoreVersion,omitempty"` } // IDFADeclarationCreateRequest defines model for IDFADeclarationCreateRequest. diff --git a/asc/submission_review_attachments.go b/asc/submission_review_attachments.go index edfa85d..f5ad36c 100644 --- a/asc/submission_review_attachments.go +++ b/asc/submission_review_attachments.go @@ -9,19 +9,29 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/appstorereviewattachment type AppStoreReviewAttachment struct { - Attributes *struct { - AssetDeliveryState *AppMediaAssetState `json:"assetDeliveryState,omitempty"` - FileName *string `json:"fileName,omitempty"` - FileSize *int64 `json:"fileSize,omitempty"` - SourceFileChecksum *string `json:"sourceFileChecksum,omitempty"` - UploadOperations *UploadOperations `json:"uploadOperations,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AppStoreReviewDetail *Relationship `json:"appStoreReviewDetail,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppStoreReviewAttachmentAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppStoreReviewAttachmentRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppStoreReviewAttachmentAttributes defines model for AppStoreReviewAttachment.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/appstorereviewattachment/attributes +type AppStoreReviewAttachmentAttributes struct { + AssetDeliveryState *AppMediaAssetState `json:"assetDeliveryState,omitempty"` + FileName *string `json:"fileName,omitempty"` + FileSize *int64 `json:"fileSize,omitempty"` + SourceFileChecksum *string `json:"sourceFileChecksum,omitempty"` + UploadOperations *UploadOperations `json:"uploadOperations,omitempty"` +} + +// AppStoreReviewAttachmentRelationships defines model for AppStoreReviewAttachment.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/appstorereviewattachment/relationships +type AppStoreReviewAttachmentRelationships struct { + AppStoreReviewDetail *Relationship `json:"appStoreReviewDetail,omitempty"` } // AppStoreReviewAttachmentCreateRequest defines model for AppStoreReviewAttachmentCreateRequest. diff --git a/asc/submission_review_details.go b/asc/submission_review_details.go index 04c1f4d..9cb6908 100644 --- a/asc/submission_review_details.go +++ b/asc/submission_review_details.go @@ -9,23 +9,33 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/appstorereviewdetail type AppStoreReviewDetail struct { - Attributes *struct { - ContactEmail *string `json:"contactEmail,omitempty"` - ContactFirstName *string `json:"contactFirstName,omitempty"` - ContactLastName *string `json:"contactLastName,omitempty"` - ContactPhone *string `json:"contactPhone,omitempty"` - DemoAccountName *string `json:"demoAccountName,omitempty"` - DemoAccountPassword *string `json:"demoAccountPassword,omitempty"` - DemoAccountRequired *bool `json:"demoAccountRequired,omitempty"` - Notes *string `json:"notes,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - AppStoreReviewAttachments *PagedRelationship `json:"appStoreReviewAttachments,omitempty"` - AppStoreVersion *Relationship `json:"appStoreVersion,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *AppStoreReviewDetailAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *AppStoreReviewDetailRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// AppStoreReviewDetailAttributes defines model for AppStoreReviewDetail.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/appstorereviewdetail/attributes +type AppStoreReviewDetailAttributes struct { + ContactEmail *string `json:"contactEmail,omitempty"` + ContactFirstName *string `json:"contactFirstName,omitempty"` + ContactLastName *string `json:"contactLastName,omitempty"` + ContactPhone *string `json:"contactPhone,omitempty"` + DemoAccountName *string `json:"demoAccountName,omitempty"` + DemoAccountPassword *string `json:"demoAccountPassword,omitempty"` + DemoAccountRequired *bool `json:"demoAccountRequired,omitempty"` + Notes *string `json:"notes,omitempty"` +} + +// AppStoreReviewDetailRelationships defines model for AppStoreReviewDetail.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/appstorereviewdetail/relationships +type AppStoreReviewDetailRelationships struct { + AppStoreReviewAttachments *PagedRelationship `json:"appStoreReviewAttachments,omitempty"` + AppStoreVersion *Relationship `json:"appStoreVersion,omitempty"` } // AppStoreReviewDetailCreateRequest defines model for AppStoreReviewDetailCreateRequest. diff --git a/asc/testflight_beta_app_localizations.go b/asc/testflight_beta_app_localizations.go index 8ca6f98..497cdb4 100644 --- a/asc/testflight_beta_app_localizations.go +++ b/asc/testflight_beta_app_localizations.go @@ -9,20 +9,30 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/betaapplocalization type BetaAppLocalization struct { - Attributes *struct { - Description *string `json:"description,omitempty"` - FeedbackEmail *string `json:"feedbackEmail,omitempty"` - Locale *string `json:"locale,omitempty"` - MarketingURL *string `json:"marketingUrl,omitempty"` - PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"` - TVOSPrivacyPolicy *string `json:"tvOsPrivacyPolicy,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *BetaAppLocalizationAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *BetaAppLocalizationRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// BetaAppLocalizationAttributes defines model for BetaAppLocalization.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/betaapplocalization/attributes +type BetaAppLocalizationAttributes struct { + Description *string `json:"description,omitempty"` + FeedbackEmail *string `json:"feedbackEmail,omitempty"` + Locale *string `json:"locale,omitempty"` + MarketingURL *string `json:"marketingUrl,omitempty"` + PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"` + TVOSPrivacyPolicy *string `json:"tvOsPrivacyPolicy,omitempty"` +} + +// BetaAppLocalizationRelationships defines model for BetaAppLocalization.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/betaapplocalization/relationships +type BetaAppLocalizationRelationships struct { + App *Relationship `json:"app,omitempty"` } // BetaAppLocalizationCreateRequest defines model for BetaAppLocalizationCreateRequest. diff --git a/asc/testflight_beta_app_review_detail.go b/asc/testflight_beta_app_review_detail.go index b906049..536d3fa 100644 --- a/asc/testflight_beta_app_review_detail.go +++ b/asc/testflight_beta_app_review_detail.go @@ -9,22 +9,32 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/betaappreviewdetail type BetaAppReviewDetail struct { - Attributes *struct { - ContactEmail *string `json:"contactEmail,omitempty"` - ContactFirstName *string `json:"contactFirstName,omitempty"` - ContactLastName *string `json:"contactLastName,omitempty"` - ContactPhone *string `json:"contactPhone,omitempty"` - DemoAccountName *string `json:"demoAccountName,omitempty"` - DemoAccountPassword *string `json:"demoAccountPassword,omitempty"` - DemoAccountRequired *bool `json:"demoAccountRequired,omitempty"` - Notes *string `json:"notes,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *BetaAppReviewDetailAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *BetaAppReviewDetailRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// BetaAppReviewDetailAttributes defines model for BetaAppReviewDetail.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/betaappreviewdetail/attributes +type BetaAppReviewDetailAttributes struct { + ContactEmail *string `json:"contactEmail,omitempty"` + ContactFirstName *string `json:"contactFirstName,omitempty"` + ContactLastName *string `json:"contactLastName,omitempty"` + ContactPhone *string `json:"contactPhone,omitempty"` + DemoAccountName *string `json:"demoAccountName,omitempty"` + DemoAccountPassword *string `json:"demoAccountPassword,omitempty"` + DemoAccountRequired *bool `json:"demoAccountRequired,omitempty"` + Notes *string `json:"notes,omitempty"` +} + +// BetaAppReviewDetailRelationships defines model for BetaAppReviewDetail.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/betaappreviewdetail/relationships +type BetaAppReviewDetailRelationships struct { + App *Relationship `json:"app,omitempty"` } // BetaAppReviewDetailUpdateRequest defines model for BetaAppReviewDetailUpdateRequest. diff --git a/asc/testflight_beta_app_review_submissions.go b/asc/testflight_beta_app_review_submissions.go index 213cc04..beca120 100644 --- a/asc/testflight_beta_app_review_submissions.go +++ b/asc/testflight_beta_app_review_submissions.go @@ -22,15 +22,25 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/betaappreviewsubmission type BetaAppReviewSubmission struct { - Attributes *struct { - BetaReviewState *BetaReviewState `json:"betaReviewState,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - Build *Relationship `json:"build,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *BetaAppReviewSubmissionAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *BetaAppReviewSubmissionRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// BetaAppReviewSubmissionAttributes defines model for BetaAppReviewSubmission.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/betaappreviewsubmission/attributes +type BetaAppReviewSubmissionAttributes struct { + BetaReviewState *BetaReviewState `json:"betaReviewState,omitempty"` +} + +// BetaAppReviewSubmissionRelationships defines model for BetaAppReviewSubmission.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/betaappreviewsubmission/relationships +type BetaAppReviewSubmissionRelationships struct { + Build *Relationship `json:"build,omitempty"` } // BetaAppReviewSubmissionCreateRequest defines model for BetaAppReviewSubmissionCreateRequest. diff --git a/asc/testflight_beta_build_localizations.go b/asc/testflight_beta_build_localizations.go index 47f1907..103cae6 100644 --- a/asc/testflight_beta_build_localizations.go +++ b/asc/testflight_beta_build_localizations.go @@ -9,16 +9,26 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/betabuildlocalization type BetaBuildLocalization struct { - Attributes *struct { - Locale *string `json:"locale,omitempty"` - WhatsNew *string `json:"whatsNew,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - Build *Relationship `json:"build,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *BetaBuildLocalizationAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *BetaBuildLocalizationRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// BetaBuildLocalizationAttributes defines model for BetaBuildLocalization.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/betabuildlocalization/attributes +type BetaBuildLocalizationAttributes struct { + Locale *string `json:"locale,omitempty"` + WhatsNew *string `json:"whatsNew,omitempty"` +} + +// BetaBuildLocalizationRelationships defines model for BetaBuildLocalization.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/betabuildlocalization/relationships +type BetaBuildLocalizationRelationships struct { + Build *Relationship `json:"build,omitempty"` } // BetaBuildLocalizationResponse defines model for BetaBuildLocalizationResponse. diff --git a/asc/testflight_beta_groups.go b/asc/testflight_beta_groups.go index 901f693..bfaebf7 100644 --- a/asc/testflight_beta_groups.go +++ b/asc/testflight_beta_groups.go @@ -10,25 +10,35 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/betagroup type BetaGroup struct { - Attributes *struct { - CreatedDate *time.Time `json:"createdDate,omitempty"` - FeedbackEnabled *bool `json:"feedbackEnabled,omitempty"` - IsInternalGroup *bool `json:"isInternalGroup,omitempty"` - Name *string `json:"name,omitempty"` - PublicLink *string `json:"publicLink,omitempty"` - PublicLinkEnabled *bool `json:"publicLinkEnabled,omitempty"` - PublicLinkID *string `json:"publicLinkId,omitempty"` - PublicLinkLimit *int `json:"publicLinkLimit,omitempty"` - PublicLinkLimitEnabled *bool `json:"publicLinkLimitEnabled,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - BetaTesters *PagedRelationship `json:"betaTesters,omitempty"` - Builds *PagedRelationship `json:"builds,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *BetaGroupAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *BetaGroupRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// BetaGroupAttributes defines model for BetaGroup.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/betagroup/attributes +type BetaGroupAttributes struct { + CreatedDate *time.Time `json:"createdDate,omitempty"` + FeedbackEnabled *bool `json:"feedbackEnabled,omitempty"` + IsInternalGroup *bool `json:"isInternalGroup,omitempty"` + Name *string `json:"name,omitempty"` + PublicLink *string `json:"publicLink,omitempty"` + PublicLinkEnabled *bool `json:"publicLinkEnabled,omitempty"` + PublicLinkID *string `json:"publicLinkId,omitempty"` + PublicLinkLimit *int `json:"publicLinkLimit,omitempty"` + PublicLinkLimitEnabled *bool `json:"publicLinkLimitEnabled,omitempty"` +} + +// BetaGroupRelationships defines model for BetaGroup.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/betagroup/relationships +type BetaGroupRelationships struct { + App *Relationship `json:"app,omitempty"` + BetaTesters *PagedRelationship `json:"betaTesters,omitempty"` + Builds *PagedRelationship `json:"builds,omitempty"` } // BetaGroupResponse defines model for BetaGroupResponse. diff --git a/asc/testflight_beta_license_agreements.go b/asc/testflight_beta_license_agreements.go index 5b5f7b0..a673470 100644 --- a/asc/testflight_beta_license_agreements.go +++ b/asc/testflight_beta_license_agreements.go @@ -9,15 +9,25 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/betalicenseagreement type BetaLicenseAgreement struct { - Attributes *struct { - AgreementText *string `json:"agreementText,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *BetaLicenseAgreementAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *BetaLicenseAgreementRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// BetaLicenseAgreementAttributes defines model for BetaLicenseAgreement.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/betalicenseagreement/attributes +type BetaLicenseAgreementAttributes struct { + AgreementText *string `json:"agreementText,omitempty"` +} + +// BetaLicenseAgreementRelationships defines model for BetaLicenseAgreement.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/betalicenseagreement/relationships +type BetaLicenseAgreementRelationships struct { + App *Relationship `json:"app,omitempty"` } // BetaLicenseAgreementUpdateRequest defines model for BetaLicenseAgreementUpdateRequest. diff --git a/asc/testflight_beta_testers.go b/asc/testflight_beta_testers.go index fe51d80..337310b 100644 --- a/asc/testflight_beta_testers.go +++ b/asc/testflight_beta_testers.go @@ -20,20 +20,30 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/betatester type BetaTester struct { - Attributes *struct { - Email *Email `json:"email,omitempty"` - FirstName *string `json:"firstName,omitempty"` - InviteType *BetaInviteType `json:"inviteType,omitempty"` - LastName *string `json:"lastName,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - Apps *PagedRelationship `json:"apps,omitempty"` - BetaGroups *PagedRelationship `json:"betaGroups,omitempty"` - Builds *PagedRelationship `json:"builds,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *BetaTesterAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *BetaTesterRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// BetaTesterAttributes defines model for BetaTester.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/betatester/attributes +type BetaTesterAttributes struct { + Email *Email `json:"email,omitempty"` + FirstName *string `json:"firstName,omitempty"` + InviteType *BetaInviteType `json:"inviteType,omitempty"` + LastName *string `json:"lastName,omitempty"` +} + +// BetaTesterRelationships defines model for BetaTester.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/betatester/relationships +type BetaTesterRelationships struct { + Apps *PagedRelationship `json:"apps,omitempty"` + BetaGroups *PagedRelationship `json:"betaGroups,omitempty"` + Builds *PagedRelationship `json:"builds,omitempty"` } // BetaTesterAppsLinkagesResponse defines model for BetaTesterAppsLinkagesResponse. diff --git a/asc/testflight_beta_testers_test.go b/asc/testflight_beta_testers_test.go index 2bc1d62..6fef356 100644 --- a/asc/testflight_beta_testers_test.go +++ b/asc/testflight_beta_testers_test.go @@ -9,12 +9,7 @@ func TestCreateBetaTester(t *testing.T) { email := Email("me@email.com") want := &BetaTesterResponse{ Data: BetaTester{ - Attributes: &struct { - Email *Email "json:\"email,omitempty\"" - FirstName *string "json:\"firstName,omitempty\"" - InviteType *BetaInviteType "json:\"inviteType,omitempty\"" - LastName *string "json:\"lastName,omitempty\"" - }{ + Attributes: &BetaTesterAttributes{ Email: &email, }, }, diff --git a/asc/testflight_build_beta_details.go b/asc/testflight_build_beta_details.go index de7a4fb..acf7a2f 100644 --- a/asc/testflight_build_beta_details.go +++ b/asc/testflight_build_beta_details.go @@ -46,17 +46,27 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/buildbetadetail type BuildBetaDetail struct { - Attributes *struct { - AutoNotifyEnabled *bool `json:"autoNotifyEnabled,omitempty"` - ExternalBuildState *ExternalBetaState `json:"externalBuildState,omitempty"` - InternalBuildState *InternalBetaState `json:"internalBuildState,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - Build *Relationship `json:"build,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *BuildBetaDetailAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *BuildBetaDetailRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// BuildBetaDetailAttributes defines model for BuildBetaDetail.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/buildbetadetail/attributes +type BuildBetaDetailAttributes struct { + AutoNotifyEnabled *bool `json:"autoNotifyEnabled,omitempty"` + ExternalBuildState *ExternalBetaState `json:"externalBuildState,omitempty"` + InternalBuildState *InternalBetaState `json:"internalBuildState,omitempty"` +} + +// BuildBetaDetailRelationships defines model for BuildBetaDetail.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/buildbetadetail/relationships +type BuildBetaDetailRelationships struct { + Build *Relationship `json:"build,omitempty"` } // BuildBetaDetailUpdateRequest defines model for BuildBetaDetailUpdateRequest. diff --git a/asc/testflight_prerelease_versions.go b/asc/testflight_prerelease_versions.go index d175bca..328d95d 100644 --- a/asc/testflight_prerelease_versions.go +++ b/asc/testflight_prerelease_versions.go @@ -9,17 +9,27 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/prereleaseversion type PrereleaseVersion struct { - Attributes *struct { - Platform *Platform `json:"platform,omitempty"` - Version *string `json:"version,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - App *Relationship `json:"app,omitempty"` - Builds *PagedRelationship `json:"builds,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *PrereleaseVersionAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *PrereleaseVersionRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// PrereleaseVersionAttributes defines model for PrereleaseVersion.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/prereleaseversion/attributes +type PrereleaseVersionAttributes struct { + Platform *Platform `json:"platform,omitempty"` + Version *string `json:"version,omitempty"` +} + +// PrereleaseVersionRelationships defines model for PrereleaseVersion.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/prereleaseversion/relationships +type PrereleaseVersionRelationships struct { + App *Relationship `json:"app,omitempty"` + Builds *PagedRelationship `json:"builds,omitempty"` } // PrereleaseVersionResponse defines model for PrereleaseVersionResponse. diff --git a/asc/users.go b/asc/users.go index 8503551..43bda66 100644 --- a/asc/users.go +++ b/asc/users.go @@ -46,20 +46,30 @@ const ( // // https://developer.apple.com/documentation/appstoreconnectapi/user type User struct { - Attributes *struct { - AllAppsVisible *bool `json:"allAppsVisible,omitempty"` - FirstName *string `json:"firstName,omitempty"` - LastName *string `json:"lastName,omitempty"` - ProvisioningAllowed *bool `json:"provisioningAllowed,omitempty"` - Roles *[]UserRole `json:"roles,omitempty"` - Username *string `json:"username,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - VisibleApps *PagedRelationship `json:"visibleApps,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *UserAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *UserRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// UserAttributes defines model for User.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/user/attributes +type UserAttributes struct { + AllAppsVisible *bool `json:"allAppsVisible,omitempty"` + FirstName *string `json:"firstName,omitempty"` + LastName *string `json:"lastName,omitempty"` + ProvisioningAllowed *bool `json:"provisioningAllowed,omitempty"` + Roles *[]UserRole `json:"roles,omitempty"` + Username *string `json:"username,omitempty"` +} + +// UserRelationships defines model for User.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/user/relationships +type UserRelationships struct { + VisibleApps *PagedRelationship `json:"visibleApps,omitempty"` } // UserUpdateRequest defines model for UserUpdateRequest. diff --git a/asc/users_invitations.go b/asc/users_invitations.go index 2acc621..3cf2e20 100644 --- a/asc/users_invitations.go +++ b/asc/users_invitations.go @@ -10,21 +10,31 @@ import ( // // https://developer.apple.com/documentation/appstoreconnectapi/userinvitation type UserInvitation struct { - Attributes *struct { - AllAppsVisible *bool `json:"allAppsVisible,omitempty"` - Email *Email `json:"email,omitempty"` - ExpirationDate *time.Time `json:"expirationDate,omitempty"` - FirstName *string `json:"firstName,omitempty"` - LastName *string `json:"lastName,omitempty"` - ProvisioningAllowed *bool `json:"provisioningAllowed,omitempty"` - Roles *[]UserRole `json:"roles,omitempty"` - } `json:"attributes,omitempty"` - ID string `json:"id"` - Links ResourceLinks `json:"links"` - Relationships *struct { - VisibleApps *PagedRelationship `json:"visibleApps,omitempty"` - } `json:"relationships,omitempty"` - Type string `json:"type"` + Attributes *UserInvitationAttributes `json:"attributes,omitempty"` + ID string `json:"id"` + Links ResourceLinks `json:"links"` + Relationships *UserInvitationRelationships `json:"relationships,omitempty"` + Type string `json:"type"` +} + +// UserInvitationAttributes defines model for UserInvitation.Attributes +// +// https://developer.apple.com/documentation/appstoreconnectapi/userinvitation/attributes +type UserInvitationAttributes struct { + AllAppsVisible *bool `json:"allAppsVisible,omitempty"` + Email *Email `json:"email,omitempty"` + ExpirationDate *time.Time `json:"expirationDate,omitempty"` + FirstName *string `json:"firstName,omitempty"` + LastName *string `json:"lastName,omitempty"` + ProvisioningAllowed *bool `json:"provisioningAllowed,omitempty"` + Roles *[]UserRole `json:"roles,omitempty"` +} + +// UserInvitationRelationships defines model for UserInvitation.Relationships +// +// https://developer.apple.com/documentation/appstoreconnectapi/userinvitation/relationships +type UserInvitationRelationships struct { + VisibleApps *PagedRelationship `json:"visibleApps,omitempty"` } // UserInvitationCreateRequest defines model for UserInvitationCreateRequest. diff --git a/asc/users_invitations_test.go b/asc/users_invitations_test.go index a81cac0..015de4b 100644 --- a/asc/users_invitations_test.go +++ b/asc/users_invitations_test.go @@ -3,7 +3,6 @@ package asc import ( "context" "testing" - "time" ) func TestListInvitations(t *testing.T) { @@ -11,15 +10,7 @@ func TestListInvitations(t *testing.T) { want := &UserInvitationsResponse{ Data: []UserInvitation{ { - Attributes: &struct { - AllAppsVisible *bool "json:\"allAppsVisible,omitempty\"" - Email *Email "json:\"email,omitempty\"" - ExpirationDate *time.Time "json:\"expirationDate,omitempty\"" - FirstName *string "json:\"firstName,omitempty\"" - LastName *string "json:\"lastName,omitempty\"" - ProvisioningAllowed *bool "json:\"provisioningAllowed,omitempty\"" - Roles *[]UserRole "json:\"roles,omitempty\"" - }{ + Attributes: &UserInvitationAttributes{ Email: &email, }, }, @@ -34,15 +25,7 @@ func TestGetInvitation(t *testing.T) { email := Email("me@email.com") want := &UserInvitationResponse{ Data: UserInvitation{ - Attributes: &struct { - AllAppsVisible *bool "json:\"allAppsVisible,omitempty\"" - Email *Email "json:\"email,omitempty\"" - ExpirationDate *time.Time "json:\"expirationDate,omitempty\"" - FirstName *string "json:\"firstName,omitempty\"" - LastName *string "json:\"lastName,omitempty\"" - ProvisioningAllowed *bool "json:\"provisioningAllowed,omitempty\"" - Roles *[]UserRole "json:\"roles,omitempty\"" - }{ + Attributes: &UserInvitationAttributes{ Email: &email, }, }, @@ -56,15 +39,7 @@ func TestCreateInvitation(t *testing.T) { email := Email("me@email.com") want := &UserInvitationResponse{ Data: UserInvitation{ - Attributes: &struct { - AllAppsVisible *bool "json:\"allAppsVisible,omitempty\"" - Email *Email "json:\"email,omitempty\"" - ExpirationDate *time.Time "json:\"expirationDate,omitempty\"" - FirstName *string "json:\"firstName,omitempty\"" - LastName *string "json:\"lastName,omitempty\"" - ProvisioningAllowed *bool "json:\"provisioningAllowed,omitempty\"" - Roles *[]UserRole "json:\"roles,omitempty\"" - }{ + Attributes: &UserInvitationAttributes{ Email: &email, }, },