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

Code before:
	}

	return codespaces, resp, nil
}

// SetOrgAccessControl sets which users can access codespaces in an organization.
//
// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces
//
//meta:operation PUT /orgs/{org}/codespaces/access
func (s *CodespacesService) SetOrgAccessControl(ctx context.Context, org string, request CodespaceOrgAccessControlRequest) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/codespaces/access", org)
	req, err := s.client.NewRequest("PUT", u, request)
	if err != nil {
		return nil, err
	}

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

	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) {

Review comment (suggestion):
```suggestion
// AddUsersToOrgAccess adds users to Codespaces access for an organization.
```

Code after:
	}

	return codespaces, resp, nil
}

// SetOrgAccessControl sets which users can access codespaces in an organization.
//
// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces
//
//meta:operation PUT /orgs/{org}/codespaces/access
func (s *CodespacesService) SetOrgAccessControl(ctx context.Context, org string, request CodespacesOrgAccessControlRequest) (*Response, error) {
	u := fmt.Sprintf("orgs/%v/codespaces/access", org)
	req, err := s.client.NewRequest("PUT", u, request)
	if err != nil {
		return nil, err
	}

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

	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) {