Skip to content

feat: add ListTeamsOptions with type filter for ListTeams#4061

Closed
turanalmammadov wants to merge 1 commit intogoogle:masterfrom
turanalmammadov:feature/team-type-field
Closed

feat: add ListTeamsOptions with type filter for ListTeams#4061
turanalmammadov wants to merge 1 commit intogoogle:masterfrom
turanalmammadov:feature/team-type-field

Conversation

@turanalmammadov
Copy link
Copy Markdown

Summary

The GitHub Teams API now returns a type field and supports filtering teams by ownership type to distinguish between organization-level and enterprise-level teams (see changelog announcement).

The type field was already added to the Team struct. This PR adds the ability to filter by team type when listing teams:

Changes

  • ListTeamsOptions — new struct embedding ListOptions with a Type field accepting:
    • "all" — returns all teams (default)
    • "organization" — returns only organization-level teams
    • "enterprise" — returns only enterprise-level teams
  • ListTeams updated to accept *ListTeamsOptions instead of *ListOptions
  • ListTeamsIter updated to match
  • Tests added for the new type filter behavior

Usage

// List only enterprise teams
teams, _, err := client.Teams.ListTeams(ctx, "my-org", &github.ListTeamsOptions{
    Type: "enterprise",
})

Closes #4033

Made with Cursor

The GitHub Teams API now supports filtering teams by ownership type to
distinguish between organization-level and enterprise-level teams.

This change introduces:
- ListTeamsOptions struct embedding ListOptions with a Type field that
  accepts "all", "organization", or "enterprise" as values
- Updates ListTeams and ListTeamsIter to accept *ListTeamsOptions
  instead of *ListOptions so callers can filter by team type

Relates to google#4033

Made-with: Cursor
@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 3, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented Mar 3, 2026

@turanalmammadov - #4037 already closed #4033. I think we can close this PR.
Please read CONTRIBUTING.md and note that we appreciate it when people comment on issues that they wish to work on it, mainly to avoid duplicated effort.

@gmlewis gmlewis closed this Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for team type field

2 participants