From adfeffee4bbfc637d5eea260313d850d4bcc84d2 Mon Sep 17 00:00:00 2001 From: Aaron Sky Date: Mon, 14 Sep 2020 22:44:20 -0400 Subject: [PATCH] Fixed a regression around the way linkages were written to the request object --- asc/apps.go | 2 +- asc/apps_metadata_game_center.go | 6 +++--- asc/apps_metadata_preview_sets.go | 2 +- asc/apps_metadata_screenshot_sets.go | 2 +- asc/builds.go | 8 ++++---- asc/builds_app_encryption_declarations.go | 2 +- asc/testflight_beta_groups.go | 8 ++++---- asc/testflight_beta_testers.go | 10 +++++----- asc/users.go | 6 +++--- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/asc/apps.go b/asc/apps.go index 0109f13..7b34994 100644 --- a/asc/apps.go +++ b/asc/apps.go @@ -372,7 +372,7 @@ func (s *AppsService) UpdateApp(ctx context.Context, id string, attributes *AppU func (s *AppsService) RemoveBetaTestersFromApp(ctx context.Context, id string, betaTesterIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(betaTesterIDs, "betaTesters") url := fmt.Sprintf("apps/%s/relationships/betaTesters", id) - return s.client.delete(ctx, url, newRequestBody(linkages)) + return s.client.delete(ctx, url, newRequestBody(linkages.Data)) } // ListInAppPurchasesForApp lists the in-app purchases that are available for your app. diff --git a/asc/apps_metadata_game_center.go b/asc/apps_metadata_game_center.go index 725d12f..a50a85a 100644 --- a/asc/apps_metadata_game_center.go +++ b/asc/apps_metadata_game_center.go @@ -125,7 +125,7 @@ func (s *AppsService) ListCompatibleVersionIDsForGameCenterEnabledVersion(ctx co func (s *AppsService) CreateCompatibleVersionsForGameCenterEnabledVersion(ctx context.Context, id string, gameCenterCompatibleVersionIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(gameCenterCompatibleVersionIDs, "gameCenterEnabledVersions") url := fmt.Sprintf("gameCenterEnabledVersions/%s/relationships/compatibleVersions", id) - return s.client.post(ctx, url, newRequestBody(linkages), nil) + return s.client.post(ctx, url, newRequestBody(linkages.Data), nil) } // UpdateCompatibleVersionsForGameCenterEnabledVersion updates the relationship between a given version and a Game Center enabled version @@ -134,7 +134,7 @@ func (s *AppsService) CreateCompatibleVersionsForGameCenterEnabledVersion(ctx co func (s *AppsService) UpdateCompatibleVersionsForGameCenterEnabledVersion(ctx context.Context, id string, gameCenterCompatibleVersionIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(gameCenterCompatibleVersionIDs, "gameCenterEnabledVersions") url := fmt.Sprintf("gameCenterEnabledVersions/%s/relationships/compatibleVersions", id) - return s.client.patch(ctx, url, newRequestBody(linkages), nil) + return s.client.patch(ctx, url, newRequestBody(linkages.Data), nil) } // RemoveCompatibleVersionsForGameCenterEnabledVersion deletes the relationship between a given version and a Game Center enabled version @@ -143,5 +143,5 @@ func (s *AppsService) UpdateCompatibleVersionsForGameCenterEnabledVersion(ctx co func (s *AppsService) RemoveCompatibleVersionsForGameCenterEnabledVersion(ctx context.Context, id string, gameCenterCompatibleVersionIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(gameCenterCompatibleVersionIDs, "gameCenterEnabledVersions") url := fmt.Sprintf("gameCenterEnabledVersions/%s/relationships/compatibleVersions", id) - return s.client.delete(ctx, url, newRequestBody(linkages)) + return s.client.delete(ctx, url, newRequestBody(linkages.Data)) } diff --git a/asc/apps_metadata_preview_sets.go b/asc/apps_metadata_preview_sets.go index 4b38286..8d3e0e8 100644 --- a/asc/apps_metadata_preview_sets.go +++ b/asc/apps_metadata_preview_sets.go @@ -178,5 +178,5 @@ func (s *AppsService) ListAppPreviewIDsForSet(ctx context.Context, id string, pa func (s *AppsService) ReplaceAppPreviewsForSet(ctx context.Context, id string, appPreviewIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(appPreviewIDs, "appPreviews") url := fmt.Sprintf("appPreviewSets/%s/relationships/appPreviews", id) - return s.client.patch(ctx, url, newRequestBody(linkages), nil) + return s.client.patch(ctx, url, newRequestBody(linkages.Data), nil) } diff --git a/asc/apps_metadata_screenshot_sets.go b/asc/apps_metadata_screenshot_sets.go index 230ef92..762a1e3 100644 --- a/asc/apps_metadata_screenshot_sets.go +++ b/asc/apps_metadata_screenshot_sets.go @@ -235,5 +235,5 @@ func (s *AppsService) ListAppScreenshotIDsForSet(ctx context.Context, id string, func (s *AppsService) ReplaceAppScreenshotsForSet(ctx context.Context, id string, appScreenshotIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(appScreenshotIDs, "appScreenshots") url := fmt.Sprintf("appScreenshotSets/%s/relationships/appScreenshots", id) - return s.client.patch(ctx, url, newRequestBody(linkages), nil) + return s.client.patch(ctx, url, newRequestBody(linkages.Data), nil) } diff --git a/asc/builds.go b/asc/builds.go index 0331220..b094ff8 100644 --- a/asc/builds.go +++ b/asc/builds.go @@ -320,7 +320,7 @@ func (s *BuildsService) UpdateAppEncryptionDeclarationForBuild(ctx context.Conte func (s *BuildsService) CreateAccessForBetaGroupsToBuild(ctx context.Context, id string, betaGroupIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(betaGroupIDs, "betaGroups") url := fmt.Sprintf("builds/%s/relationships/betaGroups", id) - return s.client.post(ctx, url, newRequestBody(linkages), nil) + return s.client.post(ctx, url, newRequestBody(linkages.Data), nil) } // RemoveAccessForBetaGroupsFromBuild removes access to a specific build for all beta testers in one or more beta groups. @@ -329,7 +329,7 @@ func (s *BuildsService) CreateAccessForBetaGroupsToBuild(ctx context.Context, id func (s *BuildsService) RemoveAccessForBetaGroupsFromBuild(ctx context.Context, id string, betaGroupIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(betaGroupIDs, "betaGroups") url := fmt.Sprintf("builds/%s/relationships/betaGroups", id) - return s.client.delete(ctx, url, newRequestBody(linkages)) + return s.client.delete(ctx, url, newRequestBody(linkages.Data)) } // CreateAccessForIndividualTestersToBuild enables a beta tester who is not a part of a beta group to test a build. @@ -338,7 +338,7 @@ func (s *BuildsService) RemoveAccessForBetaGroupsFromBuild(ctx context.Context, func (s *BuildsService) CreateAccessForIndividualTestersToBuild(ctx context.Context, id string, betaTesterIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(betaTesterIDs, "betaTesters") url := fmt.Sprintf("builds/%s/relationships/individualTesters", id) - return s.client.post(ctx, url, newRequestBody(linkages), nil) + return s.client.post(ctx, url, newRequestBody(linkages.Data), nil) } // RemoveAccessForIndividualTestersFromBuild removes access to test a specific build from one or more individually assigned testers. @@ -347,7 +347,7 @@ func (s *BuildsService) CreateAccessForIndividualTestersToBuild(ctx context.Cont func (s *BuildsService) RemoveAccessForIndividualTestersFromBuild(ctx context.Context, id string, betaTesterIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(betaTesterIDs, "betaTesters") url := fmt.Sprintf("builds/%s/relationships/individualTesters", id) - return s.client.delete(ctx, url, newRequestBody(linkages)) + return s.client.delete(ctx, url, newRequestBody(linkages.Data)) } // ListResourceIDsForIndividualTestersForBuild gets a list of resource IDs of individual testers associated with a build. diff --git a/asc/builds_app_encryption_declarations.go b/asc/builds_app_encryption_declarations.go index 7eb04dd..4ad31e1 100644 --- a/asc/builds_app_encryption_declarations.go +++ b/asc/builds_app_encryption_declarations.go @@ -143,5 +143,5 @@ func (s *BuildsService) GetAppForAppEncryptionDeclaration(ctx context.Context, i func (s *BuildsService) AssignBuildsToAppEncryptionDeclaration(ctx context.Context, id string, buildIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(buildIDs, "builds") url := fmt.Sprintf("appStoreVersionSubmissions/%s", id) - return s.client.post(ctx, url, newRequestBody(linkages), nil) + return s.client.post(ctx, url, newRequestBody(linkages.Data), nil) } diff --git a/asc/testflight_beta_groups.go b/asc/testflight_beta_groups.go index 73d0b68..be312a2 100644 --- a/asc/testflight_beta_groups.go +++ b/asc/testflight_beta_groups.go @@ -309,7 +309,7 @@ func (s *TestflightService) ListBetaGroupsForApp(ctx context.Context, id string, func (s *TestflightService) AddBetaTestersToBetaGroup(ctx context.Context, id string, betaTesterIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(betaTesterIDs, "betaTesters") url := fmt.Sprintf("betaGroups/%s/relationships/betaTesters", id) - return s.client.post(ctx, url, newRequestBody(linkages), nil) + return s.client.post(ctx, url, newRequestBody(linkages.Data), nil) } // RemoveBetaTestersFromBetaGroup removes a specific beta tester from a one or more beta groups, revoking their access to test builds associated with those groups. @@ -318,7 +318,7 @@ func (s *TestflightService) AddBetaTestersToBetaGroup(ctx context.Context, id st func (s *TestflightService) RemoveBetaTestersFromBetaGroup(ctx context.Context, id string, betaTesterIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(betaTesterIDs, "betaTesters") url := fmt.Sprintf("betaGroups/%s/relationships/betaTesters", id) - return s.client.delete(ctx, url, newRequestBody(linkages)) + return s.client.delete(ctx, url, newRequestBody(linkages.Data)) } // AddBuildsToBetaGroup associates builds with a beta group to enable the group to test the builds. @@ -327,7 +327,7 @@ func (s *TestflightService) RemoveBetaTestersFromBetaGroup(ctx context.Context, func (s *TestflightService) AddBuildsToBetaGroup(ctx context.Context, id string, buildIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(buildIDs, "builds") url := fmt.Sprintf("betaGroups/%s/relationships/builds", id) - return s.client.post(ctx, url, newRequestBody(linkages), nil) + return s.client.post(ctx, url, newRequestBody(linkages.Data), nil) } // RemoveBuildsFromBetaGroup removes access to test one or more builds from beta testers in a specific beta group. @@ -336,7 +336,7 @@ func (s *TestflightService) AddBuildsToBetaGroup(ctx context.Context, id string, func (s *TestflightService) RemoveBuildsFromBetaGroup(ctx context.Context, id string, buildIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(buildIDs, "builds") url := fmt.Sprintf("betaGroups/%s/relationships/builds", id) - return s.client.delete(ctx, url, newRequestBody(linkages)) + return s.client.delete(ctx, url, newRequestBody(linkages.Data)) } // ListBuildsForBetaGroup gets a list of builds associated with a specific beta group. diff --git a/asc/testflight_beta_testers.go b/asc/testflight_beta_testers.go index 14a0b64..f0538d3 100644 --- a/asc/testflight_beta_testers.go +++ b/asc/testflight_beta_testers.go @@ -280,7 +280,7 @@ func (s *TestflightService) GetBetaTester(ctx context.Context, id string, params func (s *TestflightService) AddBetaTesterToBetaGroups(ctx context.Context, id string, betaGroupIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(betaGroupIDs, "betaGroups") url := fmt.Sprintf("betaTesters/%s/relationships/betaGroups", id) - return s.client.post(ctx, url, newRequestBody(linkages), nil) + return s.client.post(ctx, url, newRequestBody(linkages.Data), nil) } // RemoveBetaTesterFromBetaGroups removes a specific beta tester from one or more beta groups, revoking their access to test builds associated with those groups. @@ -289,7 +289,7 @@ func (s *TestflightService) AddBetaTesterToBetaGroups(ctx context.Context, id st func (s *TestflightService) RemoveBetaTesterFromBetaGroups(ctx context.Context, id string, betaGroupIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(betaGroupIDs, "betaGroups") url := fmt.Sprintf("betaTesters/%s/relationships/betaGroups", id) - return s.client.delete(ctx, url, newRequestBody(linkages)) + return s.client.delete(ctx, url, newRequestBody(linkages.Data)) } // AssignSingleBetaTesterToBuilds individually assign a beta tester to a build. @@ -298,7 +298,7 @@ func (s *TestflightService) RemoveBetaTesterFromBetaGroups(ctx context.Context, func (s *TestflightService) AssignSingleBetaTesterToBuilds(ctx context.Context, id string, buildIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(buildIDs, "builds") url := fmt.Sprintf("betaTesters/%s/relationships/builds", id) - return s.client.post(ctx, url, newRequestBody(linkages), nil) + return s.client.post(ctx, url, newRequestBody(linkages.Data), nil) } // UnassignSingleBetaTesterFromBuilds removes an individually assigned beta tester's ability to test a build. @@ -307,7 +307,7 @@ func (s *TestflightService) AssignSingleBetaTesterToBuilds(ctx context.Context, func (s *TestflightService) UnassignSingleBetaTesterFromBuilds(ctx context.Context, id string, buildIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(buildIDs, "builds") url := fmt.Sprintf("betaTesters/%s/relationships/builds", id) - return s.client.delete(ctx, url, newRequestBody(linkages)) + return s.client.delete(ctx, url, newRequestBody(linkages.Data)) } // RemoveSingleBetaTesterAccessApps removes a specific beta tester's access to test any builds of one or more apps. @@ -316,7 +316,7 @@ func (s *TestflightService) UnassignSingleBetaTesterFromBuilds(ctx context.Conte func (s *TestflightService) RemoveSingleBetaTesterAccessApps(ctx context.Context, id string, appIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(appIDs, "apps") url := fmt.Sprintf("betaTesters/%s/relationships/apps", id) - return s.client.delete(ctx, url, newRequestBody(linkages)) + return s.client.delete(ctx, url, newRequestBody(linkages.Data)) } // ListAppsForBetaTester gets a list of apps that a beta tester can test. diff --git a/asc/users.go b/asc/users.go index e206e5f..33c750b 100644 --- a/asc/users.go +++ b/asc/users.go @@ -242,7 +242,7 @@ func (s *UsersService) ListVisibleAppsByResourceIDForUser(ctx context.Context, i // https://developer.apple.com/documentation/appstoreconnectapi/add_visible_apps_to_a_user func (s *UsersService) AddVisibleAppsForUser(ctx context.Context, id string, appIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(appIDs, "apps") - return s.client.post(ctx, "appStoreReviewDetails", newRequestBody(linkages), nil) + return s.client.post(ctx, "appStoreReviewDetails", newRequestBody(linkages.Data), nil) } // UpdateVisibleAppsForUser replaces the list of apps a user on your team can see. @@ -251,7 +251,7 @@ func (s *UsersService) AddVisibleAppsForUser(ctx context.Context, id string, app func (s *UsersService) UpdateVisibleAppsForUser(ctx context.Context, id string, appIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(appIDs, "apps") url := fmt.Sprintf("users/%s/relationships/visibleApps", id) - return s.client.patch(ctx, url, newRequestBody(linkages), nil) + return s.client.patch(ctx, url, newRequestBody(linkages.Data), nil) } // RemoveVisibleAppsFromUser removes a user on your team’s access to one or more apps. @@ -260,5 +260,5 @@ func (s *UsersService) UpdateVisibleAppsForUser(ctx context.Context, id string, func (s *UsersService) RemoveVisibleAppsFromUser(ctx context.Context, id string, appIDs []string) (*Response, error) { linkages := newPagedRelationshipDeclaration(appIDs, "apps") url := fmt.Sprintf("users/%s/relationships/visibleApps", id) - return s.client.delete(ctx, url, newRequestBody(linkages)) + return s.client.delete(ctx, url, newRequestBody(linkages.Data)) }