Skip to content

Commit

Permalink
Fixed a regression around the way linkages were written to the reques…
Browse files Browse the repository at this point in the history
…t object
  • Loading branch information
aaronsky committed Sep 15, 2020
1 parent 73cc490 commit adfeffe
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion asc/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions asc/apps_metadata_game_center.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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))
}
2 changes: 1 addition & 1 deletion asc/apps_metadata_preview_sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion asc/apps_metadata_screenshot_sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
8 changes: 4 additions & 4 deletions asc/builds.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion asc/builds_app_encryption_declarations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
8 changes: 4 additions & 4 deletions asc/testflight_beta_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions asc/testflight_beta_testers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions asc/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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))
}

0 comments on commit adfeffe

Please sign in to comment.