Skip to content

Commit 2cdb0ea

Browse files
authored
feat!: Replace ListCursorOptions with ListIDPGroupsOptions in TeamsService.ListIDPGroupsInOrganization (#3197)
Fixes #3196. BREAKING CHANGE: Replace ListCursorOptions with ListIDPGroupsOptions in TeamsService.ListIDPGroupsInOrganization
1 parent ff0223d commit 2cdb0ea

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

github/teams.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,14 @@ func (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug st
796796
return s.client.Do(ctx, req, nil)
797797
}
798798

799+
// ListIDPGroupsOptions specifies the optional parameters to the ListIDPGroupsInOrganization method.
800+
type ListIDPGroupsOptions struct {
801+
// Filters the results to return only those that begin with the value specified by this parameter.
802+
Query string `url:"q,omitempty"`
803+
804+
ListCursorOptions
805+
}
806+
799807
// IDPGroupList represents a list of external identity provider (IDP) groups.
800808
type IDPGroupList struct {
801809
Groups []*IDPGroup `json:"groups"`
@@ -813,7 +821,7 @@ type IDPGroup struct {
813821
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-an-organization
814822
//
815823
//meta:operation GET /orgs/{org}/team-sync/groups
816-
func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListCursorOptions) (*IDPGroupList, *Response, error) {
824+
func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListIDPGroupsOptions) (*IDPGroupList, *Response, error) {
817825
u := fmt.Sprintf("orgs/%v/team-sync/groups", org)
818826
u, err := addOptions(u, opts)
819827
if err != nil {

github/teams_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,11 +1302,15 @@ func TestTeamsService_ListIDPGroupsInOrganization(t *testing.T) {
13021302
testMethod(t, r, "GET")
13031303
testFormValues(t, r, values{
13041304
"page": "url-encoded-next-page-token",
1305+
"q": "n",
13051306
})
13061307
fmt.Fprint(w, `{"groups": [{"group_id": "1", "group_name": "n", "group_description": "d"}]}`)
13071308
})
13081309

1309-
opt := &ListCursorOptions{Page: "url-encoded-next-page-token"}
1310+
opt := &ListIDPGroupsOptions{
1311+
Query: "n",
1312+
ListCursorOptions: ListCursorOptions{Page: "url-encoded-next-page-token"},
1313+
}
13101314
ctx := context.Background()
13111315
groups, _, err := client.Teams.ListIDPGroupsInOrganization(ctx, "o", opt)
13121316
if err != nil {

0 commit comments

Comments
 (0)