+
Skip to content

feat!: Replace ListCursorOptions with ListIDPGroupsOptions in TeamsService.ListIDPGroupsInOrganization #3197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion github/teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,14 @@ func (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug st
return s.client.Do(ctx, req, nil)
}

// ListIDPGroupsOptions specifies the optional parameters to the ListIDPGroupsInOrganization method.
type ListIDPGroupsOptions struct {
// Filters the results to return only those that begin with the value specified by this parameter.
Query string `url:"q,omitempty"`

ListCursorOptions
}

// IDPGroupList represents a list of external identity provider (IDP) groups.
type IDPGroupList struct {
Groups []*IDPGroup `json:"groups"`
Expand All @@ -813,7 +821,7 @@ type IDPGroup struct {
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-an-organization
//
//meta:operation GET /orgs/{org}/team-sync/groups
func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListCursorOptions) (*IDPGroupList, *Response, error) {
func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListIDPGroupsOptions) (*IDPGroupList, *Response, error) {
u := fmt.Sprintf("orgs/%v/team-sync/groups", org)
u, err := addOptions(u, opts)
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion github/teams_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1302,11 +1302,15 @@ func TestTeamsService_ListIDPGroupsInOrganization(t *testing.T) {
testMethod(t, r, "GET")
testFormValues(t, r, values{
"page": "url-encoded-next-page-token",
"q": "n",
})
fmt.Fprint(w, `{"groups": [{"group_id": "1", "group_name": "n", "group_description": "d"}]}`)
})

opt := &ListCursorOptions{Page: "url-encoded-next-page-token"}
opt := &ListIDPGroupsOptions{
Query: "n",
ListCursorOptions: ListCursorOptions{Page: "url-encoded-next-page-token"},
}
ctx := context.Background()
groups, _, err := client.Teams.ListIDPGroupsInOrganization(ctx, "o", opt)
if err != nil {
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载