cloudymsgraph

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Azure = "azure"
View Source
const MSGraphVersionBeta = "beta"
View Source
const MSGraphVersionV1 = "v1.0"

Variables

View Source
var AzurePublic = MSGraphInstance{
	Name:  "Public",
	Login: "https://login.microsoftonline.com/",
	Base:  "https://graph.microsoft.com/",
}
View Source
var DefaultUserSelectFields = []string{
	"businessPhones",
	"displayName",
	"givenName",
	"id",
	"jobTitle",
	"mail",
	"mobilePhone",
	"officeLocation",
	"surname",
	"userPrincipalName",
	"assignedLicenses",
	"companyName",
}
View Source
var GCCHighOffice365E3 = "aea38a85-9bd5-4981-aa00-616b411205bf"
View Source
var GCCHighProjectPlan3 = "64758d81-92b7-4855-bcac-06617becb3e8"
View Source
var GCCHighTeamsAudio = "4dee1f32-0808-4fd2-a2ed-fdd575e3a45f"
View Source
var GCCHighTeamsPhone = "985fcb26-7b94-475b-b512-89356697be71"
View Source
var GCCHighVisioPlan1 = "50a4284d-f0b2-4779-8de6-72c5f9b4349f"
View Source
var InvalidInstanceName = errors.New("invalid instance name")
View Source
var USGovernment = MSGraphInstance{
	Name:  "USGovernment",
	Login: "https://login.microsoftonline.us/",
	Base:  "https://graph.microsoft.us/",
}

Functions

This section is empty.

Types

type AzureUserConfig

type AzureUserConfig struct {
	TenantID     string
	ClientID     string
	ClientSecret string
	Region       string
	APIBase      string
	Version      string
	SelectFields []string
}

func (*AzureUserConfig) SetInstance

func (azcfg *AzureUserConfig) SetInstance(instance *MSGraphInstance)

func (*AzureUserConfig) SetInstanceName

func (azcfg *AzureUserConfig) SetInstanceName(name string) error

type AzureUserManager

type AzureUserManager struct {
	Client  *msgraphsdk.GraphServiceClient
	Adapter *msgraphsdk.GraphRequestAdapter
	Cfg     *AzureUserConfig
}

func (*AzureUserManager) AddRemoveLicenses

func (azum *AzureUserManager) AddRemoveLicenses(ctx context.Context, uid string, skusToAdd []string, skusToRemove []string) error

func (*AzureUserManager) Configure

func (azum *AzureUserManager) Configure(cfg interface{}) error

func (*AzureUserManager) DebugSerialize

func (azum *AzureUserManager) DebugSerialize(v serialization.Parsable)

func (*AzureUserManager) DeleteUser

func (azum *AzureUserManager) DeleteUser(ctx context.Context, uid string) (bool, error)

func (*AzureUserManager) Disable

func (azum *AzureUserManager) Disable(ctx context.Context, uid string) (bool, error)

func (*AzureUserManager) Enable

func (azum *AzureUserManager) Enable(ctx context.Context, uid string) (bool, error)

func (*AzureUserManager) GetUser

func (azum *AzureUserManager) GetUser(ctx context.Context, uid string) (*models.User, error)

func (*AzureUserManager) ListUsers

func (azum *AzureUserManager) ListUsers(ctx context.Context, page interface{}, filter interface{}) ([]*models.User, interface{}, error)

func (*AzureUserManager) NewUser

func (azum *AzureUserManager) NewUser(ctx context.Context, newUser *cloudymodels.User) (*cloudymodels.User, error)

func (*AzureUserManager) SetLicenses

func (azum *AzureUserManager) SetLicenses(ctx context.Context, uid string, skus []string) error

func (*AzureUserManager) ToAzure

func (azum *AzureUserManager) ToAzure(user *cloudymodels.User) *models.User

func (*AzureUserManager) ToCloudy

func (azum *AzureUserManager) ToCloudy(user models.Userable) *cloudymodels.User

func (*AzureUserManager) UpdateUser

func (azum *AzureUserManager) UpdateUser(ctx context.Context, usr *models.User) (bool, error)

type LicenseManager

type LicenseManager struct {
	// contains filtered or unexported fields
}

func (*LicenseManager) AssignLicense

func (lm *LicenseManager) AssignLicense(ctx context.Context, userId string, licenseSku string) error

func (*LicenseManager) GetAssigned

func (lm *LicenseManager) GetAssigned(ctx context.Context, licenseSku string) ([]string, error)

func (*LicenseManager) GetLicenses

func (lm *LicenseManager) GetLicenses(ctx context.Context, userId string, licenseSku string) ([]string, error)

func (*LicenseManager) RemoveLicense

func (lm *LicenseManager) RemoveLicense(ctx context.Context, userId string, licenseSku string) error

type MSGraph

type MSGraph struct {
	Client  *msgraphsdk.GraphServiceClient
	Adapter *msgraphsdk.GraphRequestAdapter
}

func NewGraph

func NewGraph(ctx context.Context, tenantID string, clientID string, clientSecret string) (*MSGraph, error)

func (*MSGraph) AssignLicenses

func (graph *MSGraph) AssignLicenses(ctx context.Context, userId string, licenseSkus ...string) error

func (*MSGraph) CreateGroup

func (graph *MSGraph) CreateGroup(ctx context.Context, groupId string, groupName string) error

func (*MSGraph) CreateUser

func (graph *MSGraph) CreateUser(ctx context.Context, userId string) error

func (*MSGraph) DebugSerialize

func (graph *MSGraph) DebugSerialize(v serialization.Parsable)

func (*MSGraph) GetAllGroups

func (graph *MSGraph) GetAllGroups(ctx context.Context)

func (*MSGraph) GetGroupMembers

func (graph *MSGraph) GetGroupMembers(ctx context.Context, groupId string) ([]string, error)

func (*MSGraph) GetGroups

func (graph *MSGraph) GetGroups(ctx context.Context, userId string)

func (*MSGraph) GetUserByID

func (graph *MSGraph) GetUserByID(id string) (models.Userable, error)

func (*MSGraph) RemoveLicenses

func (graph *MSGraph) RemoveLicenses(ctx context.Context, userId string, licenseSkus ...string) error

func (*MSGraph) SetLicenses

func (graph *MSGraph) SetLicenses(ctx context.Context, userId string, licenseSkus []string) error

type MSGraphInstance

type MSGraphInstance struct {
	Name  string
	Login string
	Base  string
}

Jump to

Keyboard shortcuts

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