Documentation
¶
Index ¶
- type GoogleWorkspaceClient
- func (c *GoogleWorkspaceClient) BuildSAMLProfileMap(ctx context.Context, customerID string) (map[string]string, error)
- func (c *GoogleWorkspaceClient) DeleteAsp(ctx context.Context, userId string, codeId int64) error
- func (c *GoogleWorkspaceClient) DeleteGroup(ctx context.Context, groupId string) error
- func (c *GoogleWorkspaceClient) DeleteMember(ctx context.Context, groupId, memberKey string) error
- func (c *GoogleWorkspaceClient) DeleteRoleAssignment(ctx context.Context, customerId, assignmentId string) error
- func (c *GoogleWorkspaceClient) DeleteToken(ctx context.Context, userId, clientId string) error
- func (c *GoogleWorkspaceClient) DeleteUser(ctx context.Context, userId string) error
- func (c *GoogleWorkspaceClient) GetGroup(ctx context.Context, groupKey string) (*directoryAdmin.Group, error)
- func (c *GoogleWorkspaceClient) GetGroupSettings(ctx context.Context, groupEmail string) (*groupssettings.Groups, error)
- func (c *GoogleWorkspaceClient) GetMember(ctx context.Context, groupId, memberKey string) (*directoryAdmin.Member, error)
- func (c *GoogleWorkspaceClient) GetRole(ctx context.Context, customerId, roleId string) (*directoryAdmin.Role, error)
- func (c *GoogleWorkspaceClient) GetUser(ctx context.Context, userId string) (*directoryAdmin.User, error)
- func (c *GoogleWorkspaceClient) GetUserForProvisioning(ctx context.Context, userId string) (*directoryAdmin.User, error)
- func (c *GoogleWorkspaceClient) GetUserFullForProvisioning(ctx context.Context, userId string) (*directoryAdmin.User, error)
- func (c *GoogleWorkspaceClient) InsertDataTransfer(ctx context.Context, transfer *datatransferAdmin.DataTransfer) (*datatransferAdmin.DataTransfer, error)
- func (c *GoogleWorkspaceClient) InsertGroup(ctx context.Context, group *directoryAdmin.Group) (*directoryAdmin.Group, error)
- func (c *GoogleWorkspaceClient) InsertMember(ctx context.Context, groupId string, member *directoryAdmin.Member) (*directoryAdmin.Member, error)
- func (c *GoogleWorkspaceClient) InsertRoleAssignment(ctx context.Context, customerId string, ...) (*directoryAdmin.RoleAssignment, error)
- func (c *GoogleWorkspaceClient) InsertUser(ctx context.Context, user *directoryAdmin.User) (*directoryAdmin.User, error)
- func (c *GoogleWorkspaceClient) ListActivities(ctx context.Context, ...) (*reportsAdmin.Activities, error)
- func (c *GoogleWorkspaceClient) ListAsps(ctx context.Context, userId string) (*directoryAdmin.Asps, error)
- func (c *GoogleWorkspaceClient) ListDataTransfers(ctx context.Context, oldOwnerUserId, newOwnerUserId, pageToken string) (*datatransferAdmin.DataTransfersListResponse, error)
- func (c *GoogleWorkspaceClient) ListDomains(ctx context.Context, customerId string) (*directoryAdmin.Domains2, error)
- func (c *GoogleWorkspaceClient) ListGroups(ctx context.Context, customerId, domain, pageToken string) (*directoryAdmin.Groups, error)
- func (c *GoogleWorkspaceClient) ListInboundSamlProfiles(ctx context.Context, customerID string, ...) error
- func (c *GoogleWorkspaceClient) ListMembers(ctx context.Context, groupId, pageToken string) (*directoryAdmin.Members, error)
- func (c *GoogleWorkspaceClient) ListRoleAssignments(ctx context.Context, customerId, roleId, pageToken string) (*directoryAdmin.RoleAssignments, error)
- func (c *GoogleWorkspaceClient) ListRoles(ctx context.Context, customerId, pageToken string) (*directoryAdmin.Roles, error)
- func (c *GoogleWorkspaceClient) ListTokens(ctx context.Context, userId string) (*directoryAdmin.Tokens, error)
- func (c *GoogleWorkspaceClient) ListUserIDsPage(ctx context.Context, customerID, domain, pageToken string) (*directoryAdmin.Users, error)
- func (c *GoogleWorkspaceClient) ListUsers(ctx context.Context, customerId, domain, pageToken string) (*directoryAdmin.Users, error)
- func (c *GoogleWorkspaceClient) PatchGroupSettings(ctx context.Context, groupEmail string, settings *groupssettings.Groups) (*groupssettings.Groups, error)
- func (c *GoogleWorkspaceClient) RequireUserProvisioning() error
- func (c *GoogleWorkspaceClient) SignOutUser(ctx context.Context, userId string) error
- func (c *GoogleWorkspaceClient) UpdateUser(ctx context.Context, userId string, user *directoryAdmin.User) (*directoryAdmin.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoogleWorkspaceClient ¶
type GoogleWorkspaceClient struct {
// Directory – users
UserService *directoryAdmin.Service
UserProvisioningService *directoryAdmin.Service
UserSecurityService *directoryAdmin.Service
// Directory – groups
GroupService *directoryAdmin.Service
GroupMemberService *directoryAdmin.Service
GroupMemberProvisioningService *directoryAdmin.Service
GroupProvisioningService *directoryAdmin.Service
// Directory – roles
RoleService *directoryAdmin.Service
RoleProvisioningService *directoryAdmin.Service
// Directory – domains (connector-level)
DomainService *directoryAdmin.Service
// Other services
GroupsSettingsService *groupssettings.Service
DataTransferService *datatransferAdmin.Service
ReportService *reportsAdmin.Service
// Cloud Identity – SAML profiles (optional; nil when scope not granted)
CloudIdentityService *cloudidentity.Service
}
GoogleWorkspaceClient wraps all Google API service instances and handles error wrapping via wrapGoogleApiErrorWithContext so callers don't need to.
Fields may be nil when the corresponding OAuth scope was not granted; callers are responsible for nil-checking before use.
func (*GoogleWorkspaceClient) BuildSAMLProfileMap ¶ added in v0.2.47
func (c *GoogleWorkspaceClient) BuildSAMLProfileMap(ctx context.Context, customerID string) (map[string]string, error)
BuildSAMLProfileMap returns a displayName → profile.Name mapping for all Cloud Identity SAML profiles. profile.Name is the stable server-assigned ID that survives admin renames. OIDC profiles are excluded. Returns errServiceNotAvailable if CloudIdentityService is nil.
func (*GoogleWorkspaceClient) DeleteGroup ¶
func (c *GoogleWorkspaceClient) DeleteGroup(ctx context.Context, groupId string) error
func (*GoogleWorkspaceClient) DeleteMember ¶
func (c *GoogleWorkspaceClient) DeleteMember(ctx context.Context, groupId, memberKey string) error
func (*GoogleWorkspaceClient) DeleteRoleAssignment ¶
func (c *GoogleWorkspaceClient) DeleteRoleAssignment(ctx context.Context, customerId, assignmentId string) error
func (*GoogleWorkspaceClient) DeleteToken ¶
func (c *GoogleWorkspaceClient) DeleteToken(ctx context.Context, userId, clientId string) error
func (*GoogleWorkspaceClient) DeleteUser ¶
func (c *GoogleWorkspaceClient) DeleteUser(ctx context.Context, userId string) error
func (*GoogleWorkspaceClient) GetGroup ¶
func (c *GoogleWorkspaceClient) GetGroup(ctx context.Context, groupKey string) (*directoryAdmin.Group, error)
func (*GoogleWorkspaceClient) GetGroupSettings ¶
func (c *GoogleWorkspaceClient) GetGroupSettings(ctx context.Context, groupEmail string) (*groupssettings.Groups, error)
func (*GoogleWorkspaceClient) GetMember ¶
func (c *GoogleWorkspaceClient) GetMember(ctx context.Context, groupId, memberKey string) (*directoryAdmin.Member, error)
func (*GoogleWorkspaceClient) GetRole ¶
func (c *GoogleWorkspaceClient) GetRole(ctx context.Context, customerId, roleId string) (*directoryAdmin.Role, error)
func (*GoogleWorkspaceClient) GetUser ¶
func (c *GoogleWorkspaceClient) GetUser(ctx context.Context, userId string) (*directoryAdmin.User, error)
func (*GoogleWorkspaceClient) GetUserForProvisioning ¶
func (c *GoogleWorkspaceClient) GetUserForProvisioning(ctx context.Context, userId string) (*directoryAdmin.User, error)
func (*GoogleWorkspaceClient) GetUserFullForProvisioning ¶
func (c *GoogleWorkspaceClient) GetUserFullForProvisioning(ctx context.Context, userId string) (*directoryAdmin.User, error)
func (*GoogleWorkspaceClient) InsertDataTransfer ¶
func (c *GoogleWorkspaceClient) InsertDataTransfer(ctx context.Context, transfer *datatransferAdmin.DataTransfer) (*datatransferAdmin.DataTransfer, error)
func (*GoogleWorkspaceClient) InsertGroup ¶
func (c *GoogleWorkspaceClient) InsertGroup(ctx context.Context, group *directoryAdmin.Group) (*directoryAdmin.Group, error)
func (*GoogleWorkspaceClient) InsertMember ¶
func (c *GoogleWorkspaceClient) InsertMember(ctx context.Context, groupId string, member *directoryAdmin.Member) (*directoryAdmin.Member, error)
func (*GoogleWorkspaceClient) InsertRoleAssignment ¶
func (c *GoogleWorkspaceClient) InsertRoleAssignment(ctx context.Context, customerId string, assignment *directoryAdmin.RoleAssignment) (*directoryAdmin.RoleAssignment, error)
func (*GoogleWorkspaceClient) InsertUser ¶
func (c *GoogleWorkspaceClient) InsertUser(ctx context.Context, user *directoryAdmin.User) (*directoryAdmin.User, error)
func (*GoogleWorkspaceClient) ListActivities ¶
func (c *GoogleWorkspaceClient) ListActivities(ctx context.Context, userKey, applicationName, eventName, startTime, pageToken string, maxResults int64) (*reportsAdmin.Activities, error)
func (*GoogleWorkspaceClient) ListAsps ¶
func (c *GoogleWorkspaceClient) ListAsps(ctx context.Context, userId string) (*directoryAdmin.Asps, error)
func (*GoogleWorkspaceClient) ListDataTransfers ¶
func (c *GoogleWorkspaceClient) ListDataTransfers(ctx context.Context, oldOwnerUserId, newOwnerUserId, pageToken string) (*datatransferAdmin.DataTransfersListResponse, error)
func (*GoogleWorkspaceClient) ListDomains ¶
func (c *GoogleWorkspaceClient) ListDomains(ctx context.Context, customerId string) (*directoryAdmin.Domains2, error)
func (*GoogleWorkspaceClient) ListGroups ¶
func (c *GoogleWorkspaceClient) ListGroups(ctx context.Context, customerId, domain, pageToken string) (*directoryAdmin.Groups, error)
func (*GoogleWorkspaceClient) ListInboundSamlProfiles ¶ added in v0.2.47
func (c *GoogleWorkspaceClient) ListInboundSamlProfiles(ctx context.Context, customerID string, fn func(*cloudidentity.ListInboundSamlSsoProfilesResponse) error) error
ListInboundSamlProfiles paginates InboundSamlSsoProfiles for the given customer, calling fn for each page. Returns errServiceNotAvailable if CloudIdentityService is nil.
func (*GoogleWorkspaceClient) ListMembers ¶
func (c *GoogleWorkspaceClient) ListMembers(ctx context.Context, groupId, pageToken string) (*directoryAdmin.Members, error)
func (*GoogleWorkspaceClient) ListRoleAssignments ¶
func (c *GoogleWorkspaceClient) ListRoleAssignments(ctx context.Context, customerId, roleId, pageToken string) (*directoryAdmin.RoleAssignments, error)
func (*GoogleWorkspaceClient) ListRoles ¶
func (c *GoogleWorkspaceClient) ListRoles(ctx context.Context, customerId, pageToken string) (*directoryAdmin.Roles, error)
func (*GoogleWorkspaceClient) ListTokens ¶
func (c *GoogleWorkspaceClient) ListTokens(ctx context.Context, userId string) (*directoryAdmin.Tokens, error)
func (*GoogleWorkspaceClient) ListUserIDsPage ¶ added in v0.2.47
func (c *GoogleWorkspaceClient) ListUserIDsPage(ctx context.Context, customerID, domain, pageToken string) (*directoryAdmin.Users, error)
ListUserIDsPage lists users returning only id and primaryEmail fields, optimized for high-volume app discovery where full user profiles are not needed.
func (*GoogleWorkspaceClient) ListUsers ¶
func (c *GoogleWorkspaceClient) ListUsers(ctx context.Context, customerId, domain, pageToken string) (*directoryAdmin.Users, error)
func (*GoogleWorkspaceClient) PatchGroupSettings ¶
func (c *GoogleWorkspaceClient) PatchGroupSettings(ctx context.Context, groupEmail string, settings *groupssettings.Groups) (*groupssettings.Groups, error)
func (*GoogleWorkspaceClient) RequireUserProvisioning ¶
func (c *GoogleWorkspaceClient) RequireUserProvisioning() error
RequireUserProvisioning returns an error if the user provisioning service is not available, keeping the capability check and scope context inside the client.
func (*GoogleWorkspaceClient) SignOutUser ¶
func (c *GoogleWorkspaceClient) SignOutUser(ctx context.Context, userId string) error
func (*GoogleWorkspaceClient) UpdateUser ¶
func (c *GoogleWorkspaceClient) UpdateUser(ctx context.Context, userId string, user *directoryAdmin.User) (*directoryAdmin.User, error)