Documentation ¶
Overview ¶
Package glib contains methods for interactions with GSuite API
Index ¶
- func AddNewMember(srv admin.Service, groupEmail string, member *config.MemberConfig) error
- func CreateGroup(srv admin.Service, group *config.GroupConfig) error
- func CreateOrgUnit(srv admin.Service, ou *config.OrgUnitConfig) error
- func CreateUser(srv admin.Service, user *config.UserConfig) error
- func DeleteGroup(srv admin.Service, group *admin.Group) error
- func DeleteOrgUnit(srv admin.Service, ou *admin.OrgUnit) error
- func DeleteUser(srv admin.Service, user *admin.User) error
- func GetListOfGroups(srv *admin.Service) ([]*admin.Group, error)
- func GetListOfMembers(srv *admin.Service, group *admin.Group) ([]*admin.Member, error)
- func GetListOfOrgUnits(srv *admin.Service) ([]*admin.OrgUnit, error)
- func GetListOfUsers(srv admin.Service) ([]*admin.User, error)
- func GetUserEmails(user *admin.User) (string, string)
- func MemberExists(srv admin.Service, group *admin.Group, member *config.MemberConfig) bool
- func NewDirectoryService(clientSecretFile string, impersonatedUserEmail string) (*admin.Service, error)
- func RemoveMember(srv admin.Service, groupEmail string, member *admin.Member) error
- func UpdateGroup(srv admin.Service, group *config.GroupConfig) error
- func UpdateMembership(srv admin.Service, groupEmail string, member *config.MemberConfig) error
- func UpdateOrgUnit(srv admin.Service, ou *config.OrgUnitConfig) error
- func UpdateUser(srv admin.Service, user *config.UserConfig) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNewMember ¶
AddNewMember adds a new member to a group in GSuite
func CreateGroup ¶
func CreateGroup(srv admin.Service, group *config.GroupConfig) error
CreateGroup creates a new group in GSuite via their API
func CreateOrgUnit ¶
func CreateOrgUnit(srv admin.Service, ou *config.OrgUnitConfig) error
CreateOrgUnit creates a new org unit in GSuite via their API
func CreateUser ¶
func CreateUser(srv admin.Service, user *config.UserConfig) error
CreateUser creates a new user in GSuite via their API
func DeleteGroup ¶
DeleteGroup deletes a group in GSuite via their API
func DeleteOrgUnit ¶
DeleteOrgUnit deletes a group in GSuite via their API
func DeleteUser ¶
DeleteUser deletes a user in GSuite via their API
func GetListOfGroups ¶
GetListOfGroups returns a list of all current groups from the API
func GetListOfMembers ¶
GetListOfMembers returns a list of all current group members form the API
func GetListOfOrgUnits ¶
GetListOfOrgUnits returns a list of all current organizational units form the API
func GetListOfUsers ¶
GetListOfUsers returns a list of all current users form the API
func GetUserEmails ¶
GetUserEmails retrieves primary and secondary (type: work) user email addresses
func MemberExists ¶
MemberExists checks if member exists in group
func NewDirectoryService ¶
func NewDirectoryService(clientSecretFile string, impersonatedUserEmail string) (*admin.Service, error)
CreateDirectoryService() creates a client for communicating with Google APIs, returns an Admin SDK Directory service object authorized with.
func RemoveMember ¶
RemoveMember removes a member from a group in Gsuite
func UpdateGroup ¶
func UpdateGroup(srv admin.Service, group *config.GroupConfig) error
UpdateGroup updates the remote group with config
func UpdateMembership ¶
UpdateMembership changes the role of the member Update(groupKey string, memberKey string, member *Member)
func UpdateOrgUnit ¶
func UpdateOrgUnit(srv admin.Service, ou *config.OrgUnitConfig) error
UpdateOrgUnit updates the remote org unit with config
func UpdateUser ¶
func UpdateUser(srv admin.Service, user *config.UserConfig) error
UpdateUser updates the remote user with config
Types ¶
This section is empty.