Documentation
¶
Index ¶
- Constants
- Variables
- func GroupToAzure(cg *models.Group) *graphmodels.Group
- func GroupToCloudy(g graphmodels.Groupable) *models.Group
- func UserToAzure(user *cloudymodels.User) *models.User
- func UserToCloudy(user models.Userable) *cloudymodels.User
- type MsGraph
- type MsGraphConfig
- type MsGraphGroupManager
- func (gm *MsGraphGroupManager) AddMembers(ctx context.Context, groupId string, userIds []string) error
- func (gm *MsGraphGroupManager) DeleteGroup(ctx context.Context, groupId string) error
- func (gm *MsGraphGroupManager) GetGroup(ctx context.Context, id string) (*models.Group, error)
- func (gm *MsGraphGroupManager) GetGroupMembers(ctx context.Context, grpId string) ([]*models.User, error)
- func (gm *MsGraphGroupManager) GetUserGroups(ctx context.Context, uid string) ([]*cloudymodels.Group, error)
- func (gm *MsGraphGroupManager) ListGroups(ctx context.Context) ([]*models.Group, error)
- func (gm *MsGraphGroupManager) NewGroup(ctx context.Context, grp *models.Group) (*models.Group, error)
- func (gm *MsGraphGroupManager) RemoveMembers(ctx context.Context, groupId string, userIds []string) error
- func (gm *MsGraphGroupManager) UpdateGroup(ctx context.Context, grp *models.Group) (bool, error)
- type MsGraphGroupManagerFactory
- type MsGraphInstance
- type MsGraphLicenseManager
- func (lm *MsGraphLicenseManager) AssignLicense(ctx context.Context, userId string, licenseSkus ...string) error
- func (lm *MsGraphLicenseManager) GetAssigned(ctx context.Context, licenseSku string) ([]*cloudymodels.User, error)
- func (lm *MsGraphLicenseManager) GetUserAssigned(ctx context.Context, uid string) ([]*licenses.LicenseDescription, error)
- func (lm *MsGraphLicenseManager) ListLicenses(ctx context.Context) ([]*licenses.LicenseDescription, error)
- func (lm *MsGraphLicenseManager) RemoveLicense(ctx context.Context, userId string, licenseSkus ...string) error
- type MsGraphLicenseManagerFactory
- type MsGraphUserManager
- func (um *MsGraphUserManager) AssocateCerificateMFA(ctx context.Context, uid string, certId string, replace bool) error
- func (um *MsGraphUserManager) DeleteUser(ctx context.Context, uid string) error
- func (um *MsGraphUserManager) Disable(ctx context.Context, uid string) error
- func (um *MsGraphUserManager) Enable(ctx context.Context, uid string) error
- func (um *MsGraphUserManager) ForceUserName(ctx context.Context, name string) (string, bool, error)
- func (um *MsGraphUserManager) GetCertificateMFA(ctx context.Context, uid string) ([]string, error)
- func (um *MsGraphUserManager) GetProfilePicture(ctx context.Context, uid string) ([]byte, error)
- func (um *MsGraphUserManager) GetUser(ctx context.Context, uid string) (*cloudymodels.User, error)
- func (um *MsGraphUserManager) ListUsers(ctx context.Context, page interface{}, filter interface{}) ([]*cloudymodels.User, interface{}, error)
- func (um *MsGraphUserManager) NewUser(ctx context.Context, newUser *cloudymodels.User) (*cloudymodels.User, error)
- func (um *MsGraphUserManager) UpdateUser(ctx context.Context, usr *cloudymodels.User) error
- func (um *MsGraphUserManager) UploadProfilePicture(ctx context.Context, uid string, picture []byte) error
- type MsGraphUserManagerFactory
Constants ¶
const MsGraphName = "msgraph"
const MsGraphVersionBeta = "beta"
const MsGraphVersionV1 = "v1.0"
Variables ¶
var AzurePublic = MsGraphInstance{
Name: "Public",
Login: "https://login.microsoftonline.com/",
Base: "https://graph.microsoft.com/",
}
var DefaultUserSelectFields = []string{
"businessPhones",
"displayName",
"givenName",
"id",
"jobTitle",
"mail",
"mobilePhone",
"officeLocation",
"surname",
"userPrincipalName",
"assignedLicenses",
"companyName",
"authorizationInfo",
}
var ErrInvalidInstanceName = errors.New("invalid instance name")
var GCCHighOffice365E3 = "aea38a85-9bd5-4981-aa00-616b411205bf"
var GCCHighProjectPlan3 = "64758d81-92b7-4855-bcac-06617becb3e8"
var GCCHighTeamsAudio = "4dee1f32-0808-4fd2-a2ed-fdd575e3a45f"
var GCCHighTeamsPhone = "985fcb26-7b94-475b-b512-89356697be71"
var GCCHighVisioPlan1 = "50a4284d-f0b2-4779-8de6-72c5f9b4349f"
var USGovernment = MsGraphInstance{
Name: "USGovernment",
Login: "https://login.microsoftonline.us/",
Base: "https://graph.microsoft.us/",
}
Functions ¶
func GroupToAzure ¶ added in v0.0.9
func GroupToAzure(cg *models.Group) *graphmodels.Group
func GroupToCloudy ¶ added in v0.0.9
func GroupToCloudy(g graphmodels.Groupable) *models.Group
func UserToAzure ¶ added in v0.0.2
func UserToAzure(user *cloudymodels.User) *models.User
func UserToCloudy ¶ added in v0.0.2
func UserToCloudy(user models.Userable) *cloudymodels.User
Types ¶
type MsGraph ¶ added in v0.0.9
type MsGraph struct {
Client *msgraphsdk.GraphServiceClient
Adapter *msgraphsdk.GraphRequestAdapter
Cfg *MsGraphConfig
}
func (*MsGraph) Configure ¶ added in v0.0.9
func (azum *MsGraph) Configure(azCfg *MsGraphConfig) error
func (*MsGraph) DebugSerialize ¶ added in v0.0.9
func (graph *MsGraph) DebugSerialize(v serialization.Parsable)
type MsGraphConfig ¶ added in v0.0.9
type MsGraphConfig struct {
TenantID string
ClientID string
ClientSecret string
Region string
APIBase string
Version string
SelectFields []string
}
func (*MsGraphConfig) SetInstance ¶ added in v0.0.9
func (azcfg *MsGraphConfig) SetInstance(instance *MsGraphInstance)
func (*MsGraphConfig) SetInstanceName ¶ added in v0.0.9
func (azcfg *MsGraphConfig) SetInstanceName(name string) error
type MsGraphGroupManager ¶ added in v0.0.9
type MsGraphGroupManager struct {
*MsGraph
}
func NewMsGraphGroupManager ¶ added in v0.0.9
func NewMsGraphGroupManager(ctx context.Context, cfg *MsGraphConfig) (*MsGraphGroupManager, error)
func (*MsGraphGroupManager) AddMembers ¶ added in v0.0.9
func (gm *MsGraphGroupManager) AddMembers(ctx context.Context, groupId string, userIds []string) error
Add member(s) to a group
func (*MsGraphGroupManager) DeleteGroup ¶ added in v0.0.9
func (gm *MsGraphGroupManager) DeleteGroup(ctx context.Context, groupId string) error
func (*MsGraphGroupManager) GetGroupMembers ¶ added in v0.0.9
func (gm *MsGraphGroupManager) GetGroupMembers(ctx context.Context, grpId string) ([]*models.User, error)
Get all the members of a group. This returns partial users only, typically just the user id, name and email fields
func (*MsGraphGroupManager) GetUserGroups ¶ added in v0.0.9
func (gm *MsGraphGroupManager) GetUserGroups(ctx context.Context, uid string) ([]*cloudymodels.Group, error)
Get all the groups for a single user
func (*MsGraphGroupManager) ListGroups ¶ added in v0.0.9
List all the groups available
func (*MsGraphGroupManager) NewGroup ¶ added in v0.0.9
func (gm *MsGraphGroupManager) NewGroup(ctx context.Context, grp *models.Group) (*models.Group, error)
Create a new Group
func (*MsGraphGroupManager) RemoveMembers ¶ added in v0.0.9
func (gm *MsGraphGroupManager) RemoveMembers(ctx context.Context, groupId string, userIds []string) error
Remove members from a group
func (*MsGraphGroupManager) UpdateGroup ¶ added in v0.0.9
Update a group. This is generally just the name of the group.
type MsGraphGroupManagerFactory ¶ added in v0.0.2
type MsGraphGroupManagerFactory struct {
MsGraph
}
func (*MsGraphGroupManagerFactory) Create ¶ added in v0.0.2
func (ms *MsGraphGroupManagerFactory) Create(cfg interface{}) (cloudy.GroupManager, error)
func (*MsGraphGroupManagerFactory) FromEnv ¶ added in v0.0.5
func (ms *MsGraphGroupManagerFactory) FromEnv(env *cloudy.Environment) (interface{}, error)
type MsGraphInstance ¶ added in v0.0.9
type MsGraphLicenseManager ¶ added in v0.0.9
type MsGraphLicenseManager struct {
*MsGraph
}
func NewMsGraphLicenseManager ¶ added in v0.0.2
func NewMsGraphLicenseManager(ctx context.Context, cfg *MsGraphConfig) (*MsGraphLicenseManager, error)
func (*MsGraphLicenseManager) AssignLicense ¶ added in v0.0.9
func (*MsGraphLicenseManager) GetAssigned ¶ added in v0.0.9
func (lm *MsGraphLicenseManager) GetAssigned(ctx context.Context, licenseSku string) ([]*cloudymodels.User, error)
GetAssigned gets a list of all the users with licenses https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/any(s:s/skuId eq 184efa21-98c3-4e5d-95ab-d07053a96e67) SEE : https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter
func (*MsGraphLicenseManager) GetUserAssigned ¶ added in v0.0.9
func (lm *MsGraphLicenseManager) GetUserAssigned(ctx context.Context, uid string) ([]*licenses.LicenseDescription, error)
func (*MsGraphLicenseManager) ListLicenses ¶ added in v0.0.9
func (lm *MsGraphLicenseManager) ListLicenses(ctx context.Context) ([]*licenses.LicenseDescription, error)
ListLicenses List all the managed licenses
func (*MsGraphLicenseManager) RemoveLicense ¶ added in v0.0.9
type MsGraphLicenseManagerFactory ¶ added in v0.0.4
type MsGraphLicenseManagerFactory struct {
MsGraph
}
func (*MsGraphLicenseManagerFactory) Create ¶ added in v0.0.4
func (lm *MsGraphLicenseManagerFactory) Create(cfg interface{}) (licenses.LicenseManager, error)
func (*MsGraphLicenseManagerFactory) FromEnv ¶ added in v0.0.5
func (lm *MsGraphLicenseManagerFactory) FromEnv(env *cloudy.Environment) (interface{}, error)
type MsGraphUserManager ¶ added in v0.0.9
type MsGraphUserManager struct {
*MsGraph
}
func NewMsGraphUserManager ¶ added in v0.0.2
func NewMsGraphUserManager(ctx context.Context, cfg *MsGraphConfig) (*MsGraphUserManager, error)
func NewMsGraphUserManagerFromEnv ¶ added in v0.0.9
func NewMsGraphUserManagerFromEnv(ctx context.Context, env *cloudy.Environment) (*MsGraphUserManager, error)
func (*MsGraphUserManager) AssocateCerificateMFA ¶ added in v0.0.9
func (um *MsGraphUserManager) AssocateCerificateMFA(ctx context.Context, uid string, certId string, replace bool) error
Associates a certificate ID as a second factor authentication
func (*MsGraphUserManager) DeleteUser ¶ added in v0.0.9
func (um *MsGraphUserManager) DeleteUser(ctx context.Context, uid string) error
func (*MsGraphUserManager) Disable ¶ added in v0.0.9
func (um *MsGraphUserManager) Disable(ctx context.Context, uid string) error
func (*MsGraphUserManager) Enable ¶ added in v0.0.9
func (um *MsGraphUserManager) Enable(ctx context.Context, uid string) error
func (*MsGraphUserManager) ForceUserName ¶ added in v0.0.9
func (*MsGraphUserManager) GetCertificateMFA ¶ added in v0.0.9
Associates a certificate ID as a second factor authentication
func (*MsGraphUserManager) GetProfilePicture ¶ added in v0.0.9
func (*MsGraphUserManager) GetUser ¶ added in v0.0.9
func (um *MsGraphUserManager) GetUser(ctx context.Context, uid string) (*cloudymodels.User, error)
func (*MsGraphUserManager) ListUsers ¶ added in v0.0.9
func (um *MsGraphUserManager) ListUsers(ctx context.Context, page interface{}, filter interface{}) ([]*cloudymodels.User, interface{}, error)
func (*MsGraphUserManager) NewUser ¶ added in v0.0.9
func (um *MsGraphUserManager) NewUser(ctx context.Context, newUser *cloudymodels.User) (*cloudymodels.User, error)
func (*MsGraphUserManager) UpdateUser ¶ added in v0.0.9
func (um *MsGraphUserManager) UpdateUser(ctx context.Context, usr *cloudymodels.User) error
func (*MsGraphUserManager) UploadProfilePicture ¶ added in v0.0.9
type MsGraphUserManagerFactory ¶ added in v0.0.2
type MsGraphUserManagerFactory struct {
MsGraph
}
func (*MsGraphUserManagerFactory) Create ¶ added in v0.0.2
func (umf *MsGraphUserManagerFactory) Create(cfg interface{}) (cloudy.UserManager, error)
func (*MsGraphUserManagerFactory) FromEnv ¶ added in v0.0.5
func (umf *MsGraphUserManagerFactory) FromEnv(env *cloudy.Environment) (interface{}, error)