Documentation ¶
Overview ¶
Package glib contains methods for interactions with GSuite API
Index ¶
- type DirectoryService
- func (ds *DirectoryService) AddNewMember(ctx context.Context, group *directoryv1.Group, member *directoryv1.Member) error
- func (ds *DirectoryService) CreateGroup(ctx context.Context, group *directoryv1.Group) (*directoryv1.Group, error)
- func (ds *DirectoryService) CreateOrgUnit(ctx context.Context, orgUnit *directoryv1.OrgUnit) error
- func (ds *DirectoryService) CreateUser(ctx context.Context, user *directoryv1.User) (*directoryv1.User, error)
- func (ds *DirectoryService) CreateUserAlias(ctx context.Context, user *directoryv1.User, alias string) error
- func (ds *DirectoryService) DeleteGroup(ctx context.Context, group *directoryv1.Group) error
- func (ds *DirectoryService) DeleteOrgUnit(ctx context.Context, orgUnit *directoryv1.OrgUnit) error
- func (ds *DirectoryService) DeleteUser(ctx context.Context, user *directoryv1.User) error
- func (ds *DirectoryService) DeleteUserAlias(ctx context.Context, user *directoryv1.User, alias string) error
- func (ds *DirectoryService) GetUserAliases(ctx context.Context, user *directoryv1.User) ([]string, error)
- func (ds *DirectoryService) ListGroups(ctx context.Context) ([]*directoryv1.Group, error)
- func (ds *DirectoryService) ListMembers(ctx context.Context, group *directoryv1.Group) ([]*directoryv1.Member, error)
- func (ds *DirectoryService) ListOrgUnits(ctx context.Context) ([]*directoryv1.OrgUnit, error)
- func (ds *DirectoryService) ListUsers(ctx context.Context) ([]*directoryv1.User, error)
- func (ds *DirectoryService) RemoveMember(ctx context.Context, group *directoryv1.Group, member *directoryv1.Member) error
- func (ds *DirectoryService) UpdateGroup(ctx context.Context, oldGroup *directoryv1.Group, newGroup *directoryv1.Group) (*directoryv1.Group, error)
- func (ds *DirectoryService) UpdateMembership(ctx context.Context, group *directoryv1.Group, member *directoryv1.Member) error
- func (ds *DirectoryService) UpdateOrgUnit(ctx context.Context, oldUnit *directoryv1.OrgUnit, ...) error
- func (ds *DirectoryService) UpdateUser(ctx context.Context, oldUser *directoryv1.User, newUser *directoryv1.User) (*directoryv1.User, error)
- type GroupsSettingsService
- type LicenseStatus
- type LicensingService
- func (ls *LicensingService) AssignLicense(ctx context.Context, user *directoryv1.User, license config.License) error
- func (ls *LicensingService) GetLicenseByName(name string) *config.License
- func (ls *LicensingService) GetLicenseStatus(ctx context.Context) (*LicenseStatus, error)
- func (ls *LicensingService) GetLicenses() ([]config.License, error)
- func (ls *LicensingService) LicenseUsages(ctx context.Context, license config.License) ([]string, error)
- func (ls *LicensingService) UnassignLicense(ctx context.Context, user *directoryv1.User, license config.License) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirectoryService ¶ added in v0.5.0
type DirectoryService struct { *directoryv1.Service // contains filtered or unexported fields }
func NewDirectoryService ¶
func NewDirectoryService(ctx context.Context, organization string, clientSecretFile string, impersonatedUserEmail string, delay time.Duration, scopes ...string) (*DirectoryService, error)
NewDirectoryService() creates a client for communicating with Google Directory API.
func (*DirectoryService) AddNewMember ¶ added in v0.5.0
func (ds *DirectoryService) AddNewMember(ctx context.Context, group *directoryv1.Group, member *directoryv1.Member) error
AddNewMember adds a new member to a group in GSuite
func (*DirectoryService) CreateGroup ¶ added in v0.5.0
func (ds *DirectoryService) CreateGroup(ctx context.Context, group *directoryv1.Group) (*directoryv1.Group, error)
CreateGroup creates a new group in GSuite via their API
func (*DirectoryService) CreateOrgUnit ¶ added in v0.5.0
func (ds *DirectoryService) CreateOrgUnit(ctx context.Context, orgUnit *directoryv1.OrgUnit) error
func (*DirectoryService) CreateUser ¶ added in v0.5.0
func (ds *DirectoryService) CreateUser(ctx context.Context, user *directoryv1.User) (*directoryv1.User, error)
func (*DirectoryService) CreateUserAlias ¶ added in v0.5.0
func (ds *DirectoryService) CreateUserAlias(ctx context.Context, user *directoryv1.User, alias string) error
func (*DirectoryService) DeleteGroup ¶ added in v0.5.0
func (ds *DirectoryService) DeleteGroup(ctx context.Context, group *directoryv1.Group) error
DeleteGroup deletes a group in GSuite via their API
func (*DirectoryService) DeleteOrgUnit ¶ added in v0.5.0
func (ds *DirectoryService) DeleteOrgUnit(ctx context.Context, orgUnit *directoryv1.OrgUnit) error
func (*DirectoryService) DeleteUser ¶ added in v0.5.0
func (ds *DirectoryService) DeleteUser(ctx context.Context, user *directoryv1.User) error
func (*DirectoryService) DeleteUserAlias ¶ added in v0.5.0
func (ds *DirectoryService) DeleteUserAlias(ctx context.Context, user *directoryv1.User, alias string) error
func (*DirectoryService) GetUserAliases ¶ added in v0.5.0
func (ds *DirectoryService) GetUserAliases(ctx context.Context, user *directoryv1.User) ([]string, error)
func (*DirectoryService) ListGroups ¶ added in v0.5.0
func (ds *DirectoryService) ListGroups(ctx context.Context) ([]*directoryv1.Group, error)
ListGroups returns a list of all current groups from the API
func (*DirectoryService) ListMembers ¶ added in v0.5.0
func (ds *DirectoryService) ListMembers(ctx context.Context, group *directoryv1.Group) ([]*directoryv1.Member, error)
ListMembers returns a list of all current group members form the API
func (*DirectoryService) ListOrgUnits ¶ added in v0.5.0
func (ds *DirectoryService) ListOrgUnits(ctx context.Context) ([]*directoryv1.OrgUnit, error)
func (*DirectoryService) ListUsers ¶ added in v0.5.0
func (ds *DirectoryService) ListUsers(ctx context.Context) ([]*directoryv1.User, error)
func (*DirectoryService) RemoveMember ¶ added in v0.5.0
func (ds *DirectoryService) RemoveMember(ctx context.Context, group *directoryv1.Group, member *directoryv1.Member) error
RemoveMember removes a member from a group in Gsuite
func (*DirectoryService) UpdateGroup ¶ added in v0.5.0
func (ds *DirectoryService) UpdateGroup(ctx context.Context, oldGroup *directoryv1.Group, newGroup *directoryv1.Group) (*directoryv1.Group, error)
UpdateGroup updates the remote group with config
func (*DirectoryService) UpdateMembership ¶ added in v0.5.0
func (ds *DirectoryService) UpdateMembership(ctx context.Context, group *directoryv1.Group, member *directoryv1.Member) error
UpdateMembership changes the role of the member
func (*DirectoryService) UpdateOrgUnit ¶ added in v0.5.0
func (ds *DirectoryService) UpdateOrgUnit(ctx context.Context, oldUnit *directoryv1.OrgUnit, newUnit *directoryv1.OrgUnit) error
func (*DirectoryService) UpdateUser ¶ added in v0.5.0
func (ds *DirectoryService) UpdateUser(ctx context.Context, oldUser *directoryv1.User, newUser *directoryv1.User) (*directoryv1.User, error)
type GroupsSettingsService ¶ added in v0.5.0
type GroupsSettingsService struct { *groupssettingsv1.Service // contains filtered or unexported fields }
func NewGroupsSettingsService ¶ added in v0.5.0
func NewGroupsSettingsService(ctx context.Context, clientSecretFile string, impersonatedUserEmail string, delay time.Duration) (*GroupsSettingsService, error)
NewGroupsSettingsService() creates a client for communicating with Google Groupssettings API.
func (*GroupsSettingsService) GetSettings ¶ added in v0.5.0
func (gs *GroupsSettingsService) GetSettings(ctx context.Context, groupId string) (*groupssettingsv1.Groups, error)
func (*GroupsSettingsService) UpdateSettings ¶ added in v0.5.0
func (gs *GroupsSettingsService) UpdateSettings(ctx context.Context, group *directoryv1.Group, settings *groupssettingsv1.Groups) (*groupssettingsv1.Groups, error)
type LicenseStatus ¶ added in v0.5.0
func (*LicenseStatus) GetLicense ¶ added in v0.5.0
func (ls *LicenseStatus) GetLicense(identifier string) *config.License
func (*LicenseStatus) GetLicensesForUser ¶ added in v0.5.0
func (ls *LicenseStatus) GetLicensesForUser(user *directoryv1.User) []config.License
type LicensingService ¶ added in v0.0.5
type LicensingService struct { *licensing.Service // contains filtered or unexported fields }
func NewLicensingService ¶ added in v0.0.4
func NewLicensingService(ctx context.Context, organization string, clientSecretFile string, impersonatedUserEmail string, delay time.Duration, licenses []config.License) (*LicensingService, error)
NewLicensingService() creates a client for communicating with Google Licensing API.
func (*LicensingService) AssignLicense ¶ added in v0.5.0
func (ls *LicensingService) AssignLicense(ctx context.Context, user *directoryv1.User, license config.License) error
func (*LicensingService) GetLicenseByName ¶ added in v0.5.0
func (ls *LicensingService) GetLicenseByName(name string) *config.License
func (*LicensingService) GetLicenseStatus ¶ added in v0.5.0
func (ls *LicensingService) GetLicenseStatus(ctx context.Context) (*LicenseStatus, error)
func (*LicensingService) GetLicenses ¶ added in v0.5.0
func (ls *LicensingService) GetLicenses() ([]config.License, error)
func (*LicensingService) LicenseUsages ¶ added in v0.5.0
func (ls *LicensingService) LicenseUsages(ctx context.Context, license config.License) ([]string, error)
LicenseUsages lists all user IDs assigned licenses for a specific product SKU.
func (*LicensingService) UnassignLicense ¶ added in v0.5.0
func (ls *LicensingService) UnassignLicense(ctx context.Context, user *directoryv1.User, license config.License) error