Repository: google/go-github
File: github/enterprise_team.go (Go)

Code before:
// license that can be found in the LICENSE file.

package github

import (
	"context"
	"fmt"
)

// EnterpriseTeam represent a team in a GitHub Enterprise.
type EnterpriseTeam struct {
	ID                        int64     `json:"id"`
	URL                       string    `json:"url"`
	MemberURL                 string    `json:"member_url"`
	Name                      string    `json:"name"`
	HTMLURL                   string    `json:"html_url"`
	Slug                      string    `json:"slug"`
	CreatedAt                 Timestamp `json:"created_at"`
	UpdatedAt                 Timestamp `json:"updated_at"`
	GroupID                   int64     `json:"group_id"`
	OrganizationSelectionType *string   `json:"organization_selection_type,omitempty"`
}

// EnterpriseTeamCreateOrUpdateRequest is used to create or update an enterprise team.
type EnterpriseTeamCreateOrUpdateRequest struct {
	// The name of the team.
	Name string `json:"name"`
	// A description of the team.
	Description *string `json:"description,omitempty"`
	// Specifies which organizations in the enterprise should have access to this team.
	// Possible values are "disabled" , "all" and "selected". If not specified, the default is "disabled".
	OrganizationSelectionType *string `json:"organization_selection_type,omitempty"`
	// The ID of the IdP group to assign team membership with.
	GroupID *int64 `json:"group_id,omitempty"`
}

// ListTeams lists all teams in an enterprise.
//
// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#list-enterprise-teams
//
//meta:operation GET /enterprises/{enterprise}/teams
func (s *EnterpriseService) ListTeams(ctx context.Context, enterprise string, opt *ListOptions) ([]*EnterpriseTeam, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/teams", enterprise)
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err

Review comment (suggestion):
This request struct has one field, `sync_to_organizations`, which isn’t added yet.
Its description says “Retired” Should I add it or leave it out?

<img width="589" height="157" alt="Image" src="https://github.com/user-attachments/assets/303250c5-f96f-4994-b643-8e4c62bca761" />

Similarly, the EnterpriseTeam has two fields, `sync_to_organizations` and `group_name`, which are marked as Retired.
```json
    "group_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Retired: this field will not be returned with GHEC enterprise teams.",
      "examples": [
        "Justice League"
      ]
    },
    "sync_to_organizations": {
      "type": "string",
      "description": "Retired: this field will not be returned with GHEC enterprise teams.",
      "examples": [
        "disabled | all"
      ]
    },

```

Code after:
// license that can be found in the LICENSE file.

package github

import (
	"context"
	"fmt"
)

// EnterpriseTeam represent a team in a GitHub Enterprise.
type EnterpriseTeam struct {
	ID                        int64     `json:"id"`
	URL                       string    `json:"url"`
	MemberURL                 string    `json:"member_url"`
	Name                      string    `json:"name"`
	Description               *string   `json:"description,omitempty"`
	HTMLURL                   string    `json:"html_url"`
	Slug                      string    `json:"slug"`
	CreatedAt                 Timestamp `json:"created_at"`
	UpdatedAt                 Timestamp `json:"updated_at"`
	GroupID                   string    `json:"group_id"`
	OrganizationSelectionType *string   `json:"organization_selection_type,omitempty"`
}

// EnterpriseTeamCreateOrUpdateRequest is used to create or update an enterprise team.
type EnterpriseTeamCreateOrUpdateRequest struct {
	// The name of the team.
	Name string `json:"name"`
	// A description of the team.
	Description *string `json:"description,omitempty"`
	// Specifies which organizations in the enterprise should have access to this team.
	// Possible values are "disabled" , "all" and "selected". If not specified, the default is "disabled".
	OrganizationSelectionType *string `json:"organization_selection_type,omitempty"`
	// The ID of the IdP group to assign team membership with.
	GroupID *string `json:"group_id,omitempty"`
}

// ListTeams lists all teams in an enterprise.
//
// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#list-enterprise-teams
//
//meta:operation GET /enterprises/{enterprise}/teams
func (s *EnterpriseService) ListTeams(ctx context.Context, enterprise string, opt *ListOptions) ([]*EnterpriseTeam, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/teams", enterprise)
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {