google

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrGoogleClientScopeNil is returned when the scope is nil.
	ErrGoogleClientScopeNil = fmt.Errorf("google: google client scope is required")

	// ErrUserIDNil is returned when the user ID is nil.
	ErrUserIDNil = fmt.Errorf("google: user id is required")

	// ErrGroupIDNil is returned when the group ID is nil.
	ErrGroupIDNil = fmt.Errorf("google: group id is required")
)

Functions

Types

type DirectoryService

type DirectoryService struct {
	// contains filtered or unexported fields
}

DirectoryService represent the Google Directory API client.

func NewDirectoryService

func NewDirectoryService(svc *admin.Service) (*DirectoryService, error)

NewDirectoryService create a Google Directory API client. References: - https://developers.google.com/admin-sdk/directory/v1/guides/delegation?utm_source=pocket_mylist#go

func (*DirectoryService) GetGroup

func (ds *DirectoryService) GetGroup(ctx context.Context, groupID string) (*admin.Group, error)

GetGroup return a group given a group ID.

func (*DirectoryService) GetUser

func (ds *DirectoryService) GetUser(ctx context.Context, userID string) (*admin.User, error)

GetUser return a user given a user ID. userID: the user's primary email address, alias email address, or unique user ID.

func (*DirectoryService) ListGroups

func (ds *DirectoryService) ListGroups(ctx context.Context, query []string) ([]*admin.Group, error)

ListGroups list all groups in a Google Directory filtered by query. References: - https://developers.google.com/admin-sdk/directory/reference/rest/v1/groups

func (*DirectoryService) ListUsers

func (ds *DirectoryService) ListUsers(ctx context.Context, query []string) ([]*admin.User, error)

ListUsers list all users in a Google Directory filtered by query.

type GetGroupMembersOption added in v0.0.5

type GetGroupMembersOption func(*getGroupMembersOptions)

GetGroupMembersOption is a function that can be used to configure the Google provider following the Option pattern.

func WithIncludeDerivedMembership added in v0.0.5

func WithIncludeDerivedMembership(include bool) GetGroupMembersOption

WithIncludeDerivedMembership is a GetGroupMembersOption that can be used to provide a filter for members by include derived membership. includeDerivedMembership Whether to list indirect memberships. Default: false.

func WithMaxResults added in v0.0.5

func WithMaxResults(maxResults int64) GetGroupMembersOption

WithMaxResults is a GetGroupMembersOption that can be used to provide a filter for members by max results. maxResults Maximum number of results to return. Max allowed value is 200.

func WithPageToken added in v0.0.5

func WithPageToken(pageToken string) GetGroupMembersOption

WithPageToken is a GetGroupMembersOption that can be used to provide a filter for members by page token. pageToken to specify next page in the list.

func WithRoles added in v0.0.5

func WithRoles(role string) GetGroupMembersOption

WithRoles is a GetGroupMembersOption that can be used to provide a filter for members by roles. roles=one or more of OWNER,MANAGER,MEMBER separated by a comma

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL