- Add `gog groups list` to list groups user belongs to - Add `gog groups members <email>` to list group members - Add `gog calendar team <group-email>` for team calendar queries - Support --freebusy flag for faster availability checks - Parallel fetching with event deduplication - Cloud Identity API client for non-admin group access - Update README with new commands and examples 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
25 lines
819 B
Go
25 lines
819 B
Go
package googleapi
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"google.golang.org/api/cloudidentity/v1"
|
|
)
|
|
|
|
const (
|
|
scopeCloudIdentityGroupsRO = "https://www.googleapis.com/auth/cloud-identity.groups.readonly"
|
|
)
|
|
|
|
// NewCloudIdentityGroups creates a Cloud Identity service for reading groups.
|
|
// This API allows non-admin users to list groups they belong to and view group members.
|
|
func NewCloudIdentityGroups(ctx context.Context, email string) (*cloudidentity.Service, error) {
|
|
if opts, err := optionsForAccountScopes(ctx, "cloudidentity", email, []string{scopeCloudIdentityGroupsRO}); err != nil {
|
|
return nil, fmt.Errorf("cloudidentity options: %w", err)
|
|
} else if svc, err := cloudidentity.NewService(ctx, opts...); err != nil {
|
|
return nil, fmt.Errorf("create cloudidentity service: %w", err)
|
|
} else {
|
|
return svc, nil
|
|
}
|
|
}
|