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

Code before:
	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}
func (s *EnterpriseService) GetTeamMembership(ctx context.Context, enterprise, enterpriseTeam, username string) (*User, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/%v", enterprise, enterpriseTeam, username)

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

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

	return membership, resp, nil
}

// AddTeamMember adds a member to a team in an enterprise team.
//
// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#add-team-member
//
//meta:operation PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}
func (s *EnterpriseService) AddTeamMember(ctx context.Context, enterprise, enterpriseTeam, username string) (*User, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/%v", enterprise, enterpriseTeam, username)

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

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

	return member, resp, nil
}

// RemoveTeamMember removes a member from a team in an enterprise team.
//
// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#remove-team-membership
//

Review comment (suggestion):
```suggestion
// AddTeamMember adds a member to an enterprise team.
```

Code after:
	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}
func (s *EnterpriseService) GetTeamMembership(ctx context.Context, enterprise, enterpriseTeam, username string) (*User, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/%v", enterprise, enterpriseTeam, username)

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

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

	return membership, resp, nil
}

// AddTeamMember adds a member to an enterprise team.
//
// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#add-team-member
//
//meta:operation PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}
func (s *EnterpriseService) AddTeamMember(ctx context.Context, enterprise, enterpriseTeam, username string) (*User, *Response, error) {
	u := fmt.Sprintf("enterprises/%v/teams/%v/memberships/%v", enterprise, enterpriseTeam, username)

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

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

	return member, resp, nil
}

// RemoveTeamMember removes a member from an enterprise team.
//
// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#remove-team-membership
//