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

Code before:

	return members, resp, nil
}

// BulkAddTeamMembers adds multiple members to a team in an enterprise team.
//
// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#bulk-add-team-members
//
//meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add
func (s *EnterpriseService) BulkAddTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, username []string) ([]*User, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/add", enterprise, enterpriseTeam)
	req, err := s.client.NewRequest("POST", u, map[string][]string{"usernames": username})
	if err != nil {
		return nil, nil, err
	}

	var members []*User
	resp, err := s.client.Do(ctx, req, &members)
	if err != nil {
		return nil, resp, err
	}

	return members, resp, nil
}

// BulkRemoveTeamMembers removes multiple members from a team in an enterprise team.
//
// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#bulk-remove-team-members
//
//meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove
func (s *EnterpriseService) BulkRemoveTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, username []string) ([]*User, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/remove", enterprise, enterpriseTeam)
	req, err := s.client.NewRequest("POST", u, map[string][]string{"usernames": username})
	if err != nil {
		return nil, nil, err
	}

	var members []*User
	resp, err := s.client.Do(ctx, req, &members)
	if err != nil {
		return nil, resp, err
	}

	return members, resp, nil
}

// GetTeamMembership retrieves a team membership for a user in an enterprise team.
//
// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#get-enterprise-team-membership
//
//meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}

Review comment (suggestion):
```suggestion
// BulkRemoveTeamMembers removes multiple members from an enterprise team.
```

Code after:

	return members, resp, nil
}

// BulkAddTeamMembers adds multiple members to an enterprise team.
//
// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#bulk-add-team-members
//
//meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add
func (s *EnterpriseService) BulkAddTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, username []string) ([]*User, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/add", enterprise, enterpriseTeam)
	req, err := s.client.NewRequest("POST", u, map[string][]string{"usernames": username})
	if err != nil {
		return nil, nil, err
	}

	var members []*User
	resp, err := s.client.Do(ctx, req, &members)
	if err != nil {
		return nil, resp, err
	}

	return members, resp, nil
}

// BulkRemoveTeamMembers removes multiple members from an enterprise team.
//
// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#bulk-remove-team-members
//
//meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove
func (s *EnterpriseService) BulkRemoveTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, username []string) ([]*User, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/remove", enterprise, enterpriseTeam)
	req, err := s.client.NewRequest("POST", u, map[string][]string{"usernames": username})
	if err != nil {
		return nil, nil, err
	}

	var members []*User
	resp, err := s.client.Do(ctx, req, &members)
	if err != nil {
		return nil, resp, err
	}

	return members, resp, nil
}

// GetTeamMembership retrieves a team membership for a user in an enterprise team.
//
// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#get-enterprise-team-membership
//
//meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}