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

Code before:
	}

	return resp, nil
}

// AddUsersToOrgAccess adds users to Codespaces access for an organization
//
// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#add-users-to-codespaces-access-for-an-organization
//
//meta:operation POST /orgs/{org}/codespaces/access/selected_users
func (s *CodespacesService) AddUsersToOrgAccess(ctx context.Context, org string, usernames []string) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/codespaces/access/selected_users", org)
	req, err := s.client.NewRequest("POST", u, map[string][]string{"selected_usernames": usernames})
	if err != nil {
		return nil, err
	}

	resp, err := s.client.Do(ctx, req, nil)
	if err != nil {
		return resp, err
	}

	return resp, nil
}

// RemoveUsersFromOrgAccess removes users from Codespaces access for an organization
//
// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#remove-users-from-codespaces-access-for-an-organization
//
//meta:operation DELETE /orgs/{org}/codespaces/access/selected_users
func (s *CodespacesService) RemoveUsersFromOrgAccess(ctx context.Context, org string, usernames []string) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/codespaces/access/selected_users", org)
	req, err := s.client.NewRequest("DELETE", u, map[string][]string{"selected_usernames": usernames})
	if err != nil {
		return nil, err
	}

	resp, err := s.client.Do(ctx, req, nil)
	if err != nil {
		return resp, err
	}

	return resp, nil
}

// ListUserCodespacesInOrg lists the codespaces that a member of an organization has for repositories in that organization.
//
// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization
//
//meta:operation GET /orgs/{org}/members/{username}/codespaces
func (s *CodespacesService) ListUserCodespacesInOrg(ctx context.Context, org, username string, opts *ListOptions) (*ListCodespaces, *Response, error) {

Review comment (suggestion):
```suggestion
// RemoveUsersFromOrgAccess removes users from Codespaces access for an organization.
```

Code after:
	}

	return resp, nil
}

// AddUsersToOrgAccess adds users to Codespaces access for an organization.
//
// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#add-users-to-codespaces-access-for-an-organization
//
//meta:operation POST /orgs/{org}/codespaces/access/selected_users
func (s *CodespacesService) AddUsersToOrgAccess(ctx context.Context, org string, usernames []string) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/codespaces/access/selected_users", org)
	req, err := s.client.NewRequest("POST", u, map[string][]string{"selected_usernames": usernames})
	if err != nil {
		return nil, err
	}

	resp, err := s.client.Do(ctx, req, nil)
	if err != nil {
		return resp, err
	}

	return resp, nil
}

// RemoveUsersFromOrgAccess removes users from Codespaces access for an organization.
//
// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#remove-users-from-codespaces-access-for-an-organization
//
//meta:operation DELETE /orgs/{org}/codespaces/access/selected_users
func (s *CodespacesService) RemoveUsersFromOrgAccess(ctx context.Context, org string, usernames []string) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/codespaces/access/selected_users", org)
	req, err := s.client.NewRequest("DELETE", u, map[string][]string{"selected_usernames": usernames})
	if err != nil {
		return nil, err
	}

	resp, err := s.client.Do(ctx, req, nil)
	if err != nil {
		return resp, err
	}

	return resp, nil
}

// ListUserCodespacesInOrg lists the codespaces that a member of an organization has for repositories in that organization.
//
// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization
//
//meta:operation GET /orgs/{org}/members/{username}/codespaces
func (s *CodespacesService) ListUserCodespacesInOrg(ctx context.Context, org, username string, opts *ListOptions) (*ListCodespaces, *Response, error) {