glib

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package glib contains methods for interactions with GSuite API

Index

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) CreateSchema added in v0.6.0

func (ds *DirectoryService) CreateSchema(ctx context.Context, schema *directoryv1.Schema) (*directoryv1.Schema, 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) GetSchema added in v0.6.0

func (ds *DirectoryService) GetSchema(ctx context.Context, name string) (*directoryv1.Schema, 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) UpdateSchema added in v0.6.0

func (ds *DirectoryService) UpdateSchema(ctx context.Context, oldSchema *directoryv1.Schema, newSchema *directoryv1.Schema) (*directoryv1.Schema, 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

type LicenseStatus added in v0.5.0

type LicenseStatus struct {
	Assignments map[string][]string
	Licenses    map[string]config.License
}

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

Jump to

Keyboard shortcuts

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