glib

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 9 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

func AddNewMember

func AddNewMember(srv admin.Service, groupEmail string, member *config.MemberConfig) error

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

func DeleteGroup(srv admin.Service, group *admin.Group) error

DeleteGroup deletes a group in GSuite via their API

func DeleteOrgUnit

func DeleteOrgUnit(srv admin.Service, ou *admin.OrgUnit) error

DeleteOrgUnit deletes a group in GSuite via their API

func DeleteUser

func DeleteUser(srv admin.Service, user *admin.User) error

DeleteUser deletes a user in GSuite via their API

func GetListOfGroups

func GetListOfGroups(srv *admin.Service) ([]*admin.Group, error)

GetListOfGroups returns a list of all current groups from the API

func GetListOfMembers

func GetListOfMembers(srv *admin.Service, group *admin.Group) ([]*admin.Member, error)

GetListOfMembers returns a list of all current group members form the API

func GetListOfOrgUnits

func GetListOfOrgUnits(srv *admin.Service) ([]*admin.OrgUnit, error)

GetListOfOrgUnits returns a list of all current organizational units form the API

func GetListOfUsers

func GetListOfUsers(srv admin.Service) ([]*admin.User, error)

GetListOfUsers returns a list of all current users form the API

func GetUserEmails

func GetUserEmails(user *admin.User) (string, string)

GetUserEmails retrieves primary and secondary (type: work) user email addresses

func MemberExists

func MemberExists(srv admin.Service, group *admin.Group, member *config.MemberConfig) bool

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

func RemoveMember(srv admin.Service, groupEmail string, member *admin.Member) error

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

func UpdateMembership(srv admin.Service, groupEmail string, member *config.MemberConfig) error

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.

Jump to

Keyboard shortcuts

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