msgraph

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 16 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddIn

type AddIn struct {
	ID         *string          `json:"id,omitempty"`
	Properties *[]AddInKeyValue `json:"properties,omitempty"`
	Type       *string          `json:"type,omitempty"`
}

type AddInKeyValue

type AddInKeyValue struct {
	Key   *string `json:"key,omitempty"`
	Value *string `json:"value,omitempty"`
}

type ApiPreAuthorizedApplication

type ApiPreAuthorizedApplication struct {
	AppId         *string   `json:"appId,omitempty"`
	PermissionIds *[]string `json:"permissionIds,omitempty"`
}

type ApiVersion

type ApiVersion string
const (
	Version10   ApiVersion = "v1.0"
	VersionBeta ApiVersion = "beta"
)

type AppRole

type AppRole struct {
	ID                 *string                     `json:"id,omitempty"`
	AllowedMemberTypes *[]AppRoleAllowedMemberType `json:"allowedMemberTypes,omitempty"`
	Description        *string                     `json:"description,omitempty"`
	DisplayName        *string                     `json:"displayName,omitempty"`
	IsEnabled          *bool                       `json:"isEnabled,omitempty"`
	Origin             *string                     `json:"origin,omitempty"`
	Value              *string                     `json:"value,omitempty"`
}

type AppRoleAllowedMemberType added in v0.12.0

type AppRoleAllowedMemberType string
const (
	AppRoleAllowedMemberTypeApplication AppRoleAllowedMemberType = "Application"
	AppRoleAllowedMemberTypeUser        AppRoleAllowedMemberType = "User"
)

type AppRoleAssignment added in v0.12.0

type AppRoleAssignment struct {
	Id                   *string    `json:"id,omitempty"`
	DeletedDateTime      *time.Time `json:"deletedDateTime,omitempty"`
	AppRoleId            *string    `json:"appRoleId,omitempty"`
	CreatedDateTime      *time.Time `json:"createdDateTime,omitempty"`
	PrincipalDisplayName *string    `json:"principalDisplayName,omitempty"`
	PrincipalId          *string    `json:"principalId,omitempty"`
	PrincipalType        *string    `json:"principalType,omitempty"`
	ResourceDisplayName  *string    `json:"resourceDisplayName,omitempty"`
	ResourceId           *string    `json:"resourceId,omitempty"`
}

type AppRoleAssignmentsClient added in v0.12.0

type AppRoleAssignmentsClient struct {
	BaseClient Client
	// contains filtered or unexported fields
}

AppRoleAssignmentsClient performs operations on AppRoleAssignments.

func NewGroupsAppRoleAssignmentsClient added in v0.14.0

func NewGroupsAppRoleAssignmentsClient(tenantId string) *AppRoleAssignmentsClient

NewGroupsAppRoleAssignmentsClient returns a new AppRoleAssignmentsClient for groups assignments

func NewServicePrincipalsAppRoleAssignmentsClient added in v0.14.0

func NewServicePrincipalsAppRoleAssignmentsClient(tenantId string) *AppRoleAssignmentsClient

NewServicePrincipalsAppRoleAssignmentsClient returns a new AppRoleAssignmentsClient for service principal assignments

func NewUsersAppRoleAssignmentsClient added in v0.14.0

func NewUsersAppRoleAssignmentsClient(tenantId string) *AppRoleAssignmentsClient

NewUsersAppRoleAssignmentsClient returns a new AppRoleAssignmentsClient for users assignments

func (*AppRoleAssignmentsClient) Assign added in v0.12.0

func (c *AppRoleAssignmentsClient) Assign(ctx context.Context, clientServicePrincipalId, resourceServicePrincipalId, appRoleId string) (*AppRoleAssignment, int, error)

Assign assigns an app role to a user, group or service principal depending on client resource type.

func (*AppRoleAssignmentsClient) List added in v0.12.0

List returns a list of app role assignments.

func (*AppRoleAssignmentsClient) Remove added in v0.12.0

func (c *AppRoleAssignmentsClient) Remove(ctx context.Context, id, appRoleAssignmentId string) (int, error)

Remove removes a app role assignment.

type Application

type Application struct {
	ID                            *string                   `json:"id,omitempty"`
	AddIns                        *[]AddIn                  `json:"addIns,omitempty"`
	Api                           *ApplicationApi           `json:"api,omitempty"`
	AppId                         *string                   `json:"appId,omitempty"`
	AppRoles                      *[]AppRole                `json:"appRoles,omitempty"`
	CreatedDateTime               *time.Time                `json:"createdDateTime,omitempty"`
	DefaultRedirectUri            *string                   `json:"defaultRedirectUri,omitempty"`
	DeletedDateTime               *time.Time                `json:"deletedDateTime,omitempty"`
	DisabledByMicrosoftStatus     interface{}               `json:"disabledByMicrosoftStatus,omitempty"`
	DisplayName                   *string                   `json:"displayName,omitempty"`
	GroupMembershipClaims         *[]GroupMembershipClaim   `json:"groupMembershipClaims,omitempty"`
	IdentifierUris                *[]string                 `json:"identifierUris,omitempty"`
	Info                          *InformationalUrl         `json:"info,omitempty"`
	IsAuthorizationServiceEnabled *bool                     `json:"isAuthorizationServiceEnabled,omitempty"`
	IsDeviceOnlyAuthSupported     *bool                     `json:"isDeviceOnlyAuthSupported,omitempty"`
	IsFallbackPublicClient        *bool                     `json:"isFallbackPublicClient,omitempty"`
	IsManagementRestricted        *bool                     `json:"isManagementRestricted,omitempty"`
	KeyCredentials                *[]KeyCredential          `json:"keyCredentials,omitempty"`
	Oauth2RequirePostResponse     *bool                     `json:"oauth2RequirePostResponse,omitempty"`
	OnPremisesPublishing          *OnPremisesPublishing     `json:"onPremisePublishing,omitempty"`
	OptionalClaims                *OptionalClaims           `json:"optionalClaims,omitempty"`
	ParentalControlSettings       *ParentalControlSettings  `json:"parentalControlSettings,omitempty"`
	PasswordCredentials           *[]PasswordCredential     `json:"passwordCredentials,omitempty"`
	PublicClient                  *PublicClient             `json:"publicClient,omitempty"`
	PublisherDomain               *string                   `json:"publisherDomain,omitempty"`
	RequiredResourceAccess        *[]RequiredResourceAccess `json:"requiredResourceAccess,omitempty"`
	SignInAudience                SignInAudience            `json:"signInAudience,omitempty"`
	Tags                          *[]string                 `json:"tags,omitempty"`
	TokenEncryptionKeyId          *string                   `json:"tokenEncryptionKeyId,omitempty"`
	UniqueName                    *string                   `json:"uniqueName,omitempty"`
	VerifiedPublisher             *VerifiedPublisher        `json:"verifiedPublisher,omitempty"`
	Web                           *ApplicationWeb           `json:"web,omitempty"`

	Owners *[]string `json:"owners@odata.bind,omitempty"`
}

Application describes an Application object.

func (*Application) AppendAppRole

func (a *Application) AppendAppRole(role AppRole) error

AppendAppRole adds a new AppRole to an Application, checking to see if it already exists.

func (*Application) AppendOwner

func (a *Application) AppendOwner(endpoint environments.ApiEndpoint, apiVersion ApiVersion, id string)

AppendOwner appends a new owner object URI to the Owners slice.

func (Application) MarshalJSON added in v0.12.0

func (a Application) MarshalJSON() ([]byte, error)

func (*Application) RemoveAppRole

func (a *Application) RemoveAppRole(role AppRole) error

RemoveAppRole removes an AppRole from an Application.

func (*Application) UnmarshalJSON added in v0.12.0

func (a *Application) UnmarshalJSON(data []byte) error

func (*Application) UnmarshalJSON2 added in v0.12.0

func (a *Application) UnmarshalJSON2(data []byte) error

func (*Application) UpdateAppRole

func (a *Application) UpdateAppRole(role AppRole) error

UpdateAppRole amends an existing AppRole defined in an Application.

type ApplicationApi

type ApplicationApi struct {
	AcceptMappedClaims          *bool                          `json:"acceptMappedClaims,omitempty"`
	KnownClientApplications     *[]string                      `json:"knownClientApplications,omitempty"`
	OAuth2PermissionScopes      *[]PermissionScope             `json:"oauth2PermissionScopes,omitempty"`
	PreAuthorizedApplications   *[]ApiPreAuthorizedApplication `json:"preAuthorizedApplications,omitempty"`
	RequestedAccessTokenVersion *int32                         `json:"requestedAccessTokenVersion,omitempty"`
}

func (*ApplicationApi) AppendOAuth2PermissionScope

func (a *ApplicationApi) AppendOAuth2PermissionScope(scope PermissionScope) error

AppendOAuth2PermissionScope adds a new ApplicationOAuth2PermissionScope to an ApplicationApi, checking to see if it already exists.

func (*ApplicationApi) RemoveOAuth2PermissionScope

func (a *ApplicationApi) RemoveOAuth2PermissionScope(scope PermissionScope) error

RemoveOAuth2PermissionScope removes an ApplicationOAuth2PermissionScope from an ApplicationApi.

func (*ApplicationApi) UpdateOAuth2PermissionScope

func (a *ApplicationApi) UpdateOAuth2PermissionScope(scope PermissionScope) error

UpdateOAuth2PermissionScope amends an existing ApplicationOAuth2PermissionScope defined in an ApplicationApi.

type ApplicationEnforcedRestrictionsSessionControl added in v0.11.0

type ApplicationEnforcedRestrictionsSessionControl struct {
	IsEnabled *bool `json:"isEnabled,omitempty"`
}

type ApplicationWeb

type ApplicationWeb struct {
	HomePageUrl           *string                `json:"homePageUrl"`
	ImplicitGrantSettings *ImplicitGrantSettings `json:"implicitGrantSettings,omitempty"`
	LogoutUrl             *string                `json:"logoutUrl"`
	RedirectUris          *[]string              `json:"redirectUris,omitempty"`
}

type ApplicationsClient

type ApplicationsClient struct {
	BaseClient Client
}

ApplicationsClient performs operations on Applications.

func NewApplicationsClient

func NewApplicationsClient(tenantId string) *ApplicationsClient

NewApplicationsClient returns a new ApplicationsClient

func (*ApplicationsClient) AddOwners

func (c *ApplicationsClient) AddOwners(ctx context.Context, application *Application) (int, error)

AddOwners adds a new owner to an Application. First populate the Owners field of the Application using the AppendOwner method of the model, then call this method.

func (*ApplicationsClient) AddPassword added in v0.13.0

func (c *ApplicationsClient) AddPassword(ctx context.Context, applicationId string, passwordCredential PasswordCredential) (*PasswordCredential, int, error)

AddPassword appends a new password credential to an Application.

func (*ApplicationsClient) Create

func (c *ApplicationsClient) Create(ctx context.Context, application Application) (*Application, int, error)

Create creates a new Application.

func (*ApplicationsClient) Delete

func (c *ApplicationsClient) Delete(ctx context.Context, id string) (int, error)

Delete removes an Application.

func (*ApplicationsClient) DeletePermanently added in v0.15.0

func (c *ApplicationsClient) DeletePermanently(ctx context.Context, id string) (int, error)

DeletePermanently removes a deleted Application permanently. id is the object ID of the application.

func (*ApplicationsClient) Get

Get retrieves an Application manifest.

func (*ApplicationsClient) GetDeleted added in v0.14.0

func (c *ApplicationsClient) GetDeleted(ctx context.Context, id string) (*Application, int, error)

GetDeleted retrieves a deleted Application manifest. id is the object ID of the application.

func (*ApplicationsClient) GetOwner

func (c *ApplicationsClient) GetOwner(ctx context.Context, applicationId, ownerId string) (*string, int, error)

GetOwner retrieves a single owner for the specified Application. applicationId is the object ID of the application. ownerId is the object ID of the owning object.

func (*ApplicationsClient) List

func (c *ApplicationsClient) List(ctx context.Context, filter string) (*[]Application, int, error)

List returns a list of Applications, optionally filtered using OData.

func (*ApplicationsClient) ListDeleted added in v0.14.0

func (c *ApplicationsClient) ListDeleted(ctx context.Context, filter string) (*[]Application, int, error)

ListDeleted retrieves a list of recently deleted applications, optionally filtered using OData.

func (*ApplicationsClient) ListOwners

func (c *ApplicationsClient) ListOwners(ctx context.Context, id string) (*[]string, int, error)

ListOwners retrieves the owners of the specified Application. id is the object ID of the application.

func (*ApplicationsClient) RemoveOwners

func (c *ApplicationsClient) RemoveOwners(ctx context.Context, applicationId string, ownerIds *[]string) (int, error)

RemoveOwners removes owners from an Application. applicationId is the object ID of the application. ownerIds is a *[]string containing object IDs of owners to remove.

func (*ApplicationsClient) RemovePassword added in v0.13.0

func (c *ApplicationsClient) RemovePassword(ctx context.Context, applicationId string, keyId string) (int, error)

RemovePassword removes a password credential from an Application.

func (*ApplicationsClient) Update

func (c *ApplicationsClient) Update(ctx context.Context, application Application) (int, error)

Update amends the manifest of an existing Application.

type BaseNamedLocation added in v0.11.0

type BaseNamedLocation struct {
	ODataType        *string    `json:"@odata.type,omitempty"`
	ID               *string    `json:"id,omitempty"`
	DisplayName      *string    `json:"displayName,omitempty"`
	CreatedDateTime  *time.Time `json:"createdDateTime,omitempty"`
	ModifiedDateTime *time.Time `json:"modifiedDateTime,omitempty"`
}

type BodyType added in v0.13.0

type BodyType string
const (
	BodyTypeText BodyType = "text"
	BodyTypeHtml BodyType = "html"
)

type Client

type Client struct {
	// Endpoint is the base endpoint for Microsoft Graph, usually "https://graph.microsoft.com".
	Endpoint environments.ApiEndpoint

	// ApiVersion is the Microsoft Graph API version to use.
	ApiVersion ApiVersion

	// TenantId is the tenant ID to use in requests.
	TenantId string

	// UserAgent is the HTTP user agent string to send in requests.
	UserAgent string

	// Authorizer is anything that can provide an access token with which to authorize requests.
	Authorizer auth.Authorizer
	// contains filtered or unexported fields
}

Client is a base client to be used by clients for specific entities. It can send GET, POST, PUT, PATCH and DELETE requests to Microsoft Graph and is API version and tenant aware.

func NewClient

func NewClient(apiVersion ApiVersion, tenantId string) Client

NewClient returns a new Client configured with the specified API version and tenant ID.

func (Client) Delete

Delete performs a DELETE request.

func (Client) Get

Get performs a GET request.

func (Client) Patch

Patch performs a PATCH request.

func (Client) Post

Post performs a POST request.

func (Client) Put

Put performs a PUT request.

type CloudAppSecurityControl added in v0.11.0

type CloudAppSecurityControl struct {
	IsEnabled            *bool   `json:"isEnabled,omitempty"`
	CloudAppSecurityType *string `json:"cloudAppSecurityType,omitempty"`
}

type ConditionalAccessApplications added in v0.11.0

type ConditionalAccessApplications struct {
	IncludeApplications *[]string `json:"includeApplications,omitempty"`
	ExcludeApplications *[]string `json:"excludeApplications,omitempty"`
	IncludeUserActions  *[]string `json:"includeUserActions,omitempty"`
}

type ConditionalAccessConditionSet added in v0.11.0

type ConditionalAccessConditionSet struct {
	Applications     *ConditionalAccessApplications `json:"applications,omitempty"`
	Users            *ConditionalAccessUsers        `json:"users,omitempty"`
	ClientAppTypes   *[]string                      `json:"clientAppTypes,omitempty"`
	Locations        *ConditionalAccessLocations    `json:"locations,omitempty"`
	Platforms        *ConditionalAccessPlatforms    `json:"platforms,omitempty"`
	SignInRiskLevels *[]string                      `json:"signInRiskLevels,omitempty"`
	UserRiskLevels   *[]string                      `json:"userRiskLevels,omitempty"`
}

type ConditionalAccessGrantControls added in v0.11.0

type ConditionalAccessGrantControls struct {
	Operator                    *string   `json:"operator,omitempty"`
	BuiltInControls             *[]string `json:"builtInControls,omitempty"`
	CustomAuthenticationFactors *[]string `json:"customAuthenticationFactors,omitempty"`
	TermsOfUse                  *[]string `json:"termsOfUse,omitempty"`
}

type ConditionalAccessLocations added in v0.11.0

type ConditionalAccessLocations struct {
	IncludeLocations *[]string `json:"includeLocations,omitempty"`
	ExcludeLocations *[]string `json:"excludeLocations,omitempty"`
}

type ConditionalAccessPlatforms added in v0.11.0

type ConditionalAccessPlatforms struct {
	IncludePlatforms *[]string `json:"includePlatforms,omitempty"`
	ExcludePlatforms *[]string `json:"excludePlatforms,omitempty"`
}

type ConditionalAccessPolicy added in v0.11.0

type ConditionalAccessPolicy struct {
	Conditions       *ConditionalAccessConditionSet    `json:"conditions,omitempty"`
	CreatedDateTime  *time.Time                        `json:"createdDateTime,omitempty"`
	DisplayName      *string                           `json:"displayName,omitempty"`
	GrantControls    *ConditionalAccessGrantControls   `json:"grantControls,omitempty"`
	ID               *string                           `json:"id,omitempty"`
	ModifiedDateTime *time.Time                        `json:"modifiedDateTime,omitempty"`
	SessionControls  *ConditionalAccessSessionControls `json:"sessionControls,omitempty"`
	State            *string                           `json:"state,omitempty"`
}

ConditionalAccessPolicy describes an Conditional Access Policy object.

type ConditionalAccessPolicyClient added in v0.11.0

type ConditionalAccessPolicyClient struct {
	BaseClient Client
}

ConditionalAccessPolicyClient performs operations on ConditionalAccessPolicy.

func NewConditionalAccessPolicyClient added in v0.11.0

func NewConditionalAccessPolicyClient(tenantId string) *ConditionalAccessPolicyClient

NewConditionalAccessPolicyClient returns a new ConditionalAccessPolicyClient

func (*ConditionalAccessPolicyClient) Create added in v0.11.0

Create creates a new ConditionalAccessPolicy.

func (*ConditionalAccessPolicyClient) Delete added in v0.11.0

Delete removes a ConditionalAccessPolicy.

func (*ConditionalAccessPolicyClient) Get added in v0.11.0

Get retrieves an ConditionalAccessPolicy.

func (*ConditionalAccessPolicyClient) List added in v0.11.0

List returns a list of ConditionalAccessPolicys, optionally filtered using OData.

func (*ConditionalAccessPolicyClient) Update added in v0.11.0

func (c *ConditionalAccessPolicyClient) Update(ctx context.Context, conditionalAccessPolicy ConditionalAccessPolicy) (int, error)

Update amends an existing ConditionalAccessPolicy.

type ConditionalAccessSessionControls added in v0.11.0

type ConditionalAccessSessionControls struct {
	ApplicationEnforcedRestrictions *ApplicationEnforcedRestrictionsSessionControl `json:"applicationEnforcedRestrictions,omitempty"`
	CloudAppSecurity                *CloudAppSecurityControl                       `json:"cloudAppSecurity,omitempty"`
	PersistentBrowser               *PersistentBrowserSessionControl               `json:"persistentBrowser,omitempty"`
	SignInFrequency                 *SignInFrequencySessionControl                 `json:"signInFrequency,omitempty"`
}

type ConditionalAccessUsers added in v0.11.0

type ConditionalAccessUsers struct {
	IncludeUsers  *[]string `json:"includeUsers,omitempty"`
	ExcludeUsers  *[]string `json:"excludeUsers,omitempty"`
	IncludeGroups *[]string `json:"includeGroups,omitempty"`
	ExcludeGroups *[]string `json:"excludeGroups,omitempty"`
	IncludeRoles  *[]string `json:"includeRoles,omitempty"`
	ExcludeRoles  *[]string `json:"excludeRoles,omitempty"`
}

type CountryNamedLocation added in v0.11.0

type CountryNamedLocation struct {
	*BaseNamedLocation
	CountriesAndRegions               *[]string `json:"countriesAndRegions,omitempty"`
	IncludeUnknownCountriesAndRegions *bool     `json:"includeUnknownCountriesAndRegions,omitempty"`
}

CountryNamedLocation describes an Country Named Location object.

type DeleteHttpRequestInput

type DeleteHttpRequestInput struct {
	ValidStatusCodes []int
	ValidStatusFunc  ValidStatusFunc
	Uri              Uri
}

DeleteHttpRequestInput configures a DELETE request.

func (DeleteHttpRequestInput) GetValidStatusCodes

func (i DeleteHttpRequestInput) GetValidStatusCodes() []int

GetValidStatusCodes returns a []int of status codes considered valid for a DELETE request.

func (DeleteHttpRequestInput) GetValidStatusFunc

func (i DeleteHttpRequestInput) GetValidStatusFunc() ValidStatusFunc

GetValidStatusFunc returns a function used to evaluate whether the response to a DELETE request is considered valid.

type DirectoryRole added in v0.12.0

type DirectoryRole struct {
	ID             *string `json:"id,omitempty"`
	Description    *string `json:"description,omitempty"`
	DisplayName    *string `json:"displayName,omitempty"`
	RoleTemplateId *string `json:"roleTemplateId,omitempty"`

	Members *[]string `json:"-"`
}

func (*DirectoryRole) AppendMember added in v0.12.0

func (d *DirectoryRole) AppendMember(endpoint environments.ApiEndpoint, apiVersion ApiVersion, id string)

AppendMember appends a new member object URI to the Members slice.

type DirectoryRoleTemplate added in v0.11.0

type DirectoryRoleTemplate struct {
	ID              *string    `json:"id,omitempty"`
	DeletedDateTime *time.Time `json:"deletedDateTime,omitempty"`
	Description     *string    `json:"description,omitempty"`
	DisplayName     *string    `json:"displayName,omitempty"`
}

DirectoryRoleTemplate describes a Directory Role Template.

type DirectoryRoleTemplatesClient added in v0.11.0

type DirectoryRoleTemplatesClient struct {
	BaseClient Client
}

DirectoryRoleTemplatesClient performs operations on DirectoryRoleTemplates.

func NewDirectoryRoleTemplatesClient added in v0.11.0

func NewDirectoryRoleTemplatesClient(tenantId string) *DirectoryRoleTemplatesClient

NewDirectoryRoleTemplatesClient returns a new DirectoryRoleTemplatesClient

func (*DirectoryRoleTemplatesClient) Get added in v0.11.0

Get retrieves an DirectoryRoleTemplates manifest.

func (*DirectoryRoleTemplatesClient) List added in v0.11.0

List returns a list of DirectoryRoleTemplates.

type DirectoryRolesClient added in v0.12.0

type DirectoryRolesClient struct {
	BaseClient Client
}

DirectoryRolesClient performs operations on DirectoryRoles.

func NewDirectoryRolesClient added in v0.12.0

func NewDirectoryRolesClient(tenantId string) *DirectoryRolesClient

NewDirectoryRolesClient returns a new DirectoryRolesClient

func (*DirectoryRolesClient) Activate added in v0.12.0

func (c *DirectoryRolesClient) Activate(ctx context.Context, roleTemplateID string) (*DirectoryRole, int, error)

Activate activates a directory role. To read a directory role or update its members, it must first be activated in the tenant using role template id. This method will attempt to detect whether a role is already activated in the tenant, but may fail in some circumstances.

func (*DirectoryRolesClient) AddMembers added in v0.12.0

func (c *DirectoryRolesClient) AddMembers(ctx context.Context, directoryRole *DirectoryRole) (int, error)

AddMembers adds a new member to a Directory Role. First populate the Members field of the DirectoryRole using the AppendMember method of the model, then call this method.

func (*DirectoryRolesClient) Get added in v0.12.0

Get retrieves an DirectoryRoles manifest.

func (*DirectoryRolesClient) GetMember added in v0.12.0

func (c *DirectoryRolesClient) GetMember(ctx context.Context, directoryRoleId, memberId string) (*string, int, error)

GetMember retrieves a single member of the specified DirectoryRole. directoryRoleId is the object ID of the directory role. memberId is the object ID of the member object.

func (*DirectoryRolesClient) List added in v0.12.0

List returns a list of DirectoryRoles activated in the tenant.

func (*DirectoryRolesClient) ListMembers added in v0.12.0

func (c *DirectoryRolesClient) ListMembers(ctx context.Context, id string) (*[]string, int, error)

ListMembers retrieves the members of the specified directory role. id is the object ID of the directory role.

func (*DirectoryRolesClient) RemoveMembers added in v0.12.0

func (c *DirectoryRolesClient) RemoveMembers(ctx context.Context, directoryRoleId string, memberIds *[]string) (int, error)

RemoveMembers removes members from a Directory Role. id is the object ID of the Directory Role. memberIds is a *[]string containing object IDs of members to remove.

type Domain

type Domain struct {
	ID                               *string   `json:"id,omitempty"`
	AuthenticationType               *string   `json:"authenticationType,omitempty"`
	IsAdminManaged                   *bool     `json:"isAdminManaged,omitempty"`
	IsDefault                        *bool     `json:"isDefault,omitempty"`
	IsInitial                        *bool     `json:"isInitial,omitempty"`
	IsRoot                           *bool     `json:"isRoot,omitempty"`
	IsVerified                       *bool     `json:"isVerified,omitempty"`
	PasswordNotificationWindowInDays *int      `json:"passwordNotificationWindowInDays,omitempty"`
	PasswordValidityPeriodInDays     *int      `json:"passwordValidityPeriodInDays,omitempty"`
	SupportedServices                *[]string `json:"supportedServices,omitempty"`

	State *DomainState `json:"state,omitempty"`
}

Domain describes a Domain object.

type DomainState

type DomainState struct {
	LastActionDateTime *time.Time `json:"lastActionDateTime,omitempty"`
	Operation          *string    `json:"operation,omitempty"`
	Status             *string    `json:"status,omitempty"`
}

type DomainsClient

type DomainsClient struct {
	BaseClient Client
}

DomainsClient performs operations on Domains.

func NewDomainsClient

func NewDomainsClient(tenantId string) *DomainsClient

NewDomainsClient returns a new DomainsClient.

func (*DomainsClient) Get

func (c *DomainsClient) Get(ctx context.Context, id string) (*Domain, int, error)

Get retrieves a Domain.

func (*DomainsClient) List

func (c *DomainsClient) List(ctx context.Context) (*[]Domain, int, error)

List returns a list of Domains.

type EmailAddress

type EmailAddress struct {
	Address *string `json:"address,omitempty"`
	Name    *string `json:"name,omitempty"`
}

type GetHttpRequestInput

type GetHttpRequestInput struct {
	ValidStatusCodes []int
	ValidStatusFunc  ValidStatusFunc
	Uri              Uri
	// contains filtered or unexported fields
}

GetHttpRequestInput configures a GET request.

func (GetHttpRequestInput) GetValidStatusCodes

func (i GetHttpRequestInput) GetValidStatusCodes() []int

GetValidStatusCodes returns a []int of status codes considered valid for a GET request.

func (GetHttpRequestInput) GetValidStatusFunc

func (i GetHttpRequestInput) GetValidStatusFunc() ValidStatusFunc

GetValidStatusFunc returns a function used to evaluate whether the response to a GET request is considered valid.

type Group

type Group struct {
	ID                            *string                             `json:"id,omitempty"`
	AllowExternalSenders          *string                             `json:"allowExternalSenders,omitempty"`
	AssignedLabels                *[]GroupAssignedLabel               `json:"assignedLabels,omitempty"`
	AssignedLicenses              *[]GroupAssignedLicense             `json:"assignLicenses,omitempty"`
	AutoSubscribeNewMembers       *bool                               `json:"autoSubscribeNewMembers,omitempty"`
	Classification                *string                             `json:"classification,omitempty"`
	CreatedDateTime               *time.Time                          `json:"createdDateTime,omitempty"`
	DeletedDateTime               *time.Time                          `json:"deletedDateTime,omitempty"`
	Description                   *string                             `json:"description,omitempty"`
	DisplayName                   *string                             `json:"displayName,omitempty"`
	ExpirationDateTime            *time.Time                          `json:"expirationDateTime,omitempty"`
	GroupTypes                    *[]string                           `json:"groupTypes,omitempty"`
	HasMembersWithLicenseErrors   *bool                               `json:"hasMembersWithLicenseErrors,omitempty"`
	HideFromAddressLists          *bool                               `json:"hideFromAddressLists,omitempty"`
	HideFromOutlookClients        *bool                               `json:"hideFromOutlookClients,omitempty"`
	IsSubscribedByMail            *bool                               `json:"isSubscribedByMail,omitempty"`
	LicenseProcessingState        *string                             `json:"licenseProcessingState,omitempty"`
	Mail                          *string                             `json:"mail,omitempty"`
	MailEnabled                   *bool                               `json:"mailEnabled,omitempty"`
	MailNickname                  *string                             `json:"mailNickname,omitempty"`
	MembershipRule                *string                             `json:"membershipRule,omitempty"`
	MembershipRuleProcessingState *string                             `json:"membershipRuleProcessingState,omitempty"`
	OnPremisesDomainName          *string                             `json:"onPremisesDomainName,omitempty"`
	OnPremisesLastSyncDateTime    *time.Time                          `json:"onPremisesLastSyncDateTime,omitempty"`
	OnPremisesNetBiosName         *string                             `json:"onPremisesNetBiosName,omitempty"`
	OnPremisesProvisioningErrors  *[]GroupOnPremisesProvisioningError `json:"onPremisesProvisioningErrors,omitempty"`
	OnPremisesSamAccountName      *string                             `json:"onPremisesSamAccountName,omitempty"`
	OnPremisesSecurityIdentifier  *string                             `json:"onPremisesSecurityIdentifier,omitempty"`
	OnPremisesSyncEnabled         *bool                               `json:"onPremisesSyncEnabled,omitempty"`
	PreferredDataLocation         *string                             `json:"preferredDataLocation,omitempty"`
	PreferredLanguage             *string                             `json:"preferredLanguage,omitempty"`
	ProxyAddresses                *[]string                           `json:"proxyAddresses,omitempty"`
	RenewedDateTime               *time.Time                          `json:"renewedDateTime,omitempty"`
	SecurityEnabled               *bool                               `json:"securityEnabled,omitempty"`
	SecurityIdentifier            *string                             `json:"securityIdentifier,omitempty"`
	Theme                         *string                             `json:"theme,omitempty"`
	UnseenCount                   *int                                `json:"unseenCount,omitempty"`
	Visibility                    *string                             `json:"visibility,omitempty"`
	IsAssignableToRole            *bool                               `json:"isAssignableToRole,omitempty"`

	Members *[]string `json:"members@odata.bind,omitempty"`
	Owners  *[]string `json:"owners@odata.bind,omitempty"`
}

Group describes a Group object.

func (*Group) AppendMember

func (g *Group) AppendMember(endpoint environments.ApiEndpoint, apiVersion ApiVersion, id string)

AppendMember appends a new member object URI to the Members slice.

func (*Group) AppendOwner

func (g *Group) AppendOwner(endpoint environments.ApiEndpoint, apiVersion ApiVersion, id string)

AppendOwner appends a new owner object URI to the Owners slice.

type GroupAssignedLabel

type GroupAssignedLabel struct {
	LabelId     *string `json:"labelId,omitempty"`
	DisplayName *string `json:"displayNanme,omitempty"`
}

type GroupAssignedLicense

type GroupAssignedLicense struct {
	DisabledPlans *[]string `json:"disabledPlans,omitempty"`
	SkuId         *string   `json:"skuId,omitempty"`
}

type GroupMembershipClaim added in v0.12.0

type GroupMembershipClaim string
const (
	GroupMembershipClaimAll              GroupMembershipClaim = "All"
	GroupMembershipClaimNone             GroupMembershipClaim = "None"
	GroupMembershipClaimApplicationGroup GroupMembershipClaim = "ApplicationGroup"
	GroupMembershipClaimDirectoryRole    GroupMembershipClaim = "DirectoryRole"
	GroupMembershipClaimSecurityGroup    GroupMembershipClaim = "SecurityGroup"
)

type GroupOnPremisesProvisioningError

type GroupOnPremisesProvisioningError struct {
	Category             *string   `json:"category,omitempty"`
	OccurredDateTime     time.Time `json:"occurredDateTime,omitempty"`
	PropertyCausingError *string   `json:"propertyCausingError,omitempty"`
	Value                *string   `json:"value,omitempty"`
}

type GroupsClient

type GroupsClient struct {
	BaseClient Client
}

GroupsClient performs operations on Groups.

func NewGroupsClient

func NewGroupsClient(tenantId string) *GroupsClient

NewGroupsClient returns a new GroupsClient.

func (*GroupsClient) AddMembers

func (c *GroupsClient) AddMembers(ctx context.Context, group *Group) (int, error)

AddMembers adds a new member to a Group. First populate the Members field of the Group using the AppendMember method of the model, then call this method.

func (*GroupsClient) AddOwners

func (c *GroupsClient) AddOwners(ctx context.Context, group *Group) (int, error)

AddOwners adds a new owner to a Group. First populate the Owners field of the Group using the AppendOwner method of the model, then call this method.

func (*GroupsClient) Create

func (c *GroupsClient) Create(ctx context.Context, group Group) (*Group, int, error)

Create creates a new Group.

func (*GroupsClient) Delete

func (c *GroupsClient) Delete(ctx context.Context, id string) (int, error)

Delete removes a Group.

func (*GroupsClient) DeletePermanently added in v0.15.0

func (c *GroupsClient) DeletePermanently(ctx context.Context, id string) (int, error)

DeletePermanently removes a deleted O365 Group permanently. TODO: add test coverage once API supports creating O365 groups.

func (*GroupsClient) Get

func (c *GroupsClient) Get(ctx context.Context, id string) (*Group, int, error)

Get retrieves a Group.

func (*GroupsClient) GetDeleted added in v0.14.0

func (c *GroupsClient) GetDeleted(ctx context.Context, id string) (*Group, int, error)

GetDeleted retrieves a deleted O365 Group. TODO: add test coverage once API supports creating O365 groups.

func (*GroupsClient) GetMember

func (c *GroupsClient) GetMember(ctx context.Context, groupId, memberId string) (*string, int, error)

GetMember retrieves a single member of the specified Group. groupId is the object ID of the group. memberId is the object ID of the member object.

func (*GroupsClient) GetOwner

func (c *GroupsClient) GetOwner(ctx context.Context, groupId, ownerId string) (*string, int, error)

GetOwner retrieves a single owner for the specified Group. groupId is the object ID of the group. ownerId is the object ID of the owning object.

func (*GroupsClient) List

func (c *GroupsClient) List(ctx context.Context, filter string) (*[]Group, int, error)

List returns a list of Groups, optionally filtered using OData.

func (*GroupsClient) ListDeleted added in v0.14.0

func (c *GroupsClient) ListDeleted(ctx context.Context, filter string) (*[]Group, int, error)

ListDeleted retrieves a list of recently deleted O365 groups, optionally filtered using OData. TODO: add test coverage once API supports creating O365 groups

func (*GroupsClient) ListMembers

func (c *GroupsClient) ListMembers(ctx context.Context, id string) (*[]string, int, error)

ListMembers retrieves the members of the specified Group. id is the object ID of the group.

func (*GroupsClient) ListOwners

func (c *GroupsClient) ListOwners(ctx context.Context, id string) (*[]string, int, error)

ListOwners retrieves the owners of the specified Group. id is the object ID of the group.

func (*GroupsClient) RemoveMembers

func (c *GroupsClient) RemoveMembers(ctx context.Context, id string, memberIds *[]string) (int, error)

RemoveMembers removes members from a Group. groupId is the object ID of the group. memberIds is a *[]string containing object IDs of members to remove.

func (*GroupsClient) RemoveOwners

func (c *GroupsClient) RemoveOwners(ctx context.Context, id string, ownerIds *[]string) (int, error)

RemoveOwners removes owners from a Group. groupId is the object ID of the group. ownerIds is a *[]string containing object IDs of owners to remove.

func (*GroupsClient) Update

func (c *GroupsClient) Update(ctx context.Context, group Group) (int, error)

Update amends an existing Group.

type HttpRequestInput

type HttpRequestInput interface {
	GetValidStatusCodes() []int
	GetValidStatusFunc() ValidStatusFunc
}

HttpRequestInput is any type that can validate the response to an HTTP request.

type IPNamedLocation added in v0.11.0

type IPNamedLocation struct {
	*BaseNamedLocation
	IPRanges  *[]IPNamedLocationIPRange `json:"ipRanges,omitempty"`
	IsTrusted *bool                     `json:"isTrusted,omitempty"`
}

IPNamedLocation describes an IP Named Location object.

type IPNamedLocationIPRange added in v0.11.0

type IPNamedLocationIPRange struct {
	CIDRAddress *string `json:"cidrAddress,omitempty"`
}

type IdentityProvider added in v0.13.0

type IdentityProvider struct {
	ODataType    *string `json:"@odata.type,omitempty"`
	ID           *string `json:"id,omitempty"`
	ClientId     *string `json:"clientId,omitempty"`
	ClientSecret *string `json:"clientSecret,omitempty"`
	Type         *string `json:"identityProviderType,omitempty"`
	Name         *string `json:"displayName,omitempty"`
}

type IdentityProvidersClient added in v0.13.0

type IdentityProvidersClient struct {
	BaseClient Client
}

IdentityProvidersClient performs operations on IdentityProviders.

func NewIdentityProvidersClient added in v0.13.0

func NewIdentityProvidersClient(tenantId string) *IdentityProvidersClient

NewIdentityProvidersClient returns a new IdentityProvidersClient

func (*IdentityProvidersClient) Create added in v0.13.0

Create creates a new IdentityProvider.

func (*IdentityProvidersClient) Delete added in v0.13.0

func (c *IdentityProvidersClient) Delete(ctx context.Context, id string) (int, error)

Delete removes a IdentityProvider.

func (*IdentityProvidersClient) Get added in v0.13.0

Get retrieves an IdentityProvider.

func (*IdentityProvidersClient) List added in v0.13.0

List returns a list of IdentityProviders.

func (*IdentityProvidersClient) ListAvailableProviderTypes added in v0.13.0

func (c *IdentityProvidersClient) ListAvailableProviderTypes(ctx context.Context) (*[]string, int, error)

List returns a list of all available identity provider types.

func (*IdentityProvidersClient) Update added in v0.13.0

func (c *IdentityProvidersClient) Update(ctx context.Context, provider IdentityProvider) (int, error)

Update amends an existing IdentityProvider.

type ImplicitGrantSettings

type ImplicitGrantSettings struct {
	EnableAccessTokenIssuance *bool `json:"enableAccessTokenIssuance,omitempty"`
	EnableIdTokenIssuance     *bool `json:"enableIdTokenIssuance,omitempty"`
}

type InformationalUrl

type InformationalUrl struct {
	LogoUrl             *string `json:"logoUrl,omitempty"`
	MarketingUrl        *string `json:"marketingUrl"`
	PrivacyStatementUrl *string `json:"privacyStatementUrl"`
	SupportUrl          *string `json:"supportUrl"`
	TermsOfServiceUrl   *string `json:"termsOfServiceUrl"`
}

type Invitation

type Invitation struct {
	ID                      *string `json:"id,omitempty"`
	InvitedUserDisplayName  *string `json:"invitedUserDisplayName,omitempty"`
	InvitedUserEmailAddress *string `json:"invitedUserEmailAddress,omitempty"`
	SendInvitationMessage   *bool   `json:"sendInvitationMessage,omitempty"`
	InviteRedirectURL       *string `json:"inviteRedirectUrl,omitempty"`
	InviteRedeemURL         *string `json:"inviteRedeemUrl,omitempty"`
	Status                  *string `json:"status,omitempty"`
	InvitedUserType         *string `json:"invitedUserType,omitempty"`

	InvitedUserMessageInfo *InvitedUserMessageInfo `json:"invitedUserMessageInfo,omitempty"`
	InvitedUser            *User                   `json:"invitedUser,omitempty"`
}

Invitation describes a Invitation object.

type InvitationsClient

type InvitationsClient struct {
	BaseClient Client
}

InvitationsClient performs operations on Invitations.

func NewInvitationsClient

func NewInvitationsClient(tenantId string) *InvitationsClient

NewInvitationsClient returns a new InvitationsClient.

func (*InvitationsClient) Create

func (c *InvitationsClient) Create(ctx context.Context, invitation Invitation) (*Invitation, int, error)

Create creates a new Invitation.

type InvitedUserMessageInfo

type InvitedUserMessageInfo struct {
	CCRecipients          *[]Recipient `json:"ccRecipients,omitempty"`
	CustomizedMessageBody *string      `json:"customizedMessageBody,omitempty"`
	MessageLanguage       *string      `json:"messageLanguage,omitempty"`
}

type ItemBody added in v0.13.0

type ItemBody struct {
	Content     *string   `json:"content,omitempty"`
	ContentType *BodyType `json:"contentType,omitempty"`
}

type KerberosSignOnSettings

type KerberosSignOnSettings struct {
	ServicePrincipalName       *string `json:"kerberosServicePrincipalName,omitempty"`
	SignOnMappingAttributeType *string `jsonL:"kerberosSignOnMappingAttributeType,omitempty"`
}

type KeyCredential

type KeyCredential struct {
	CustomKeyIdentifier *string            `json:"customKeyIdentifier,omitempty"`
	DisplayName         *string            `json:"displayName,omitempty"`
	EndDateTime         *time.Time         `json:"endDateTime,omitempty"`
	KeyId               *string            `json:"keyId,omitempty"`
	StartDateTime       *time.Time         `json:"startDateTime,omitempty"`
	Type                KeyCredentialType  `json:"type"`
	Usage               KeyCredentialUsage `json:"usage"`
	Key                 *string            `json:"key,omitempty"`
}

KeyCredential describes a key (certificate) credential for an object.

type KeyCredentialType added in v0.13.0

type KeyCredentialType string
const (
	KeyCredentialTypeAsymmetricX509Cert  KeyCredentialType = "AsymmetricX509Cert"
	KeyCredentialTypeX509CertAndPassword KeyCredentialType = "X509CertAndPassword"
)

type KeyCredentialUsage added in v0.12.0

type KeyCredentialUsage string
const (
	KeyCredentialUsageSign   KeyCredentialUsage = "Sign"
	KeyCredentialUsageVerify KeyCredentialUsage = "Verify"
)

type MailMessage added in v0.13.0

type MailMessage struct {
	Message *Message `json:"message,omitempty"`
}

type Me

type Me struct {
	ID                *string `json:"id"`
	DisplayName       *string `json:"displayName"`
	UserPrincipalName *string `json:"userPrincipalName"`
}

Me describes the authenticated user.

type MeClient

type MeClient struct {
	BaseClient Client
}

MeClient performs operations on the authenticated user.

func NewMeClient

func NewMeClient(tenantId string) *MeClient

NewMeClient returns a new MeClient.

func (*MeClient) Get

func (c *MeClient) Get(ctx context.Context) (*Me, int, error)

Get retrieves information about the authenticated user.

func (*MeClient) GetProfile

func (c *MeClient) GetProfile(ctx context.Context) (*Me, int, error)

GetProfile retrieves the profile of the authenticated user.

func (*MeClient) Sendmail added in v0.13.0

func (c *MeClient) Sendmail(ctx context.Context, message MailMessage) (int, error)

SendMail sends message specified in the request body. TODO: Needs testing with an O365 user principal

type Message added in v0.13.0

type Message struct {
	ID            *string      `json:"id,omitempty"`
	Subject       *string      `json:"subject,omitempty"`
	Body          *ItemBody    `json:"body,omitempty"`
	From          *Recipient   `json:"from,omitempty"`
	ToRecipients  *[]Recipient `json:"toRecipients,omitempty"`
	CcRecipients  *[]Recipient `json:"ccRecipients,omitempty"`
	BccRecipients *[]Recipient `json:"bccRecipients,omitempty"`
}

type NamedLocation added in v0.11.0

type NamedLocation interface{}

type NamedLocationsClient added in v0.11.0

type NamedLocationsClient struct {
	BaseClient Client
}

NamedLocationsClient performs operations on Named Locations.

func NewNamedLocationsClient added in v0.11.0

func NewNamedLocationsClient(tenantId string) *NamedLocationsClient

NewNamedLocationsClient returns a new NamedLocationsClient.

func (*NamedLocationsClient) CreateCountry added in v0.11.0

func (c *NamedLocationsClient) CreateCountry(ctx context.Context, countryNamedLocation CountryNamedLocation) (*CountryNamedLocation, int, error)

CreateCountry creates a new Country Named Location.

func (*NamedLocationsClient) CreateIP added in v0.11.0

func (c *NamedLocationsClient) CreateIP(ctx context.Context, ipNamedLocation IPNamedLocation) (*IPNamedLocation, int, error)

CreateIP creates a new IP Named Location.

func (*NamedLocationsClient) Delete added in v0.11.0

func (c *NamedLocationsClient) Delete(ctx context.Context, id string) (int, error)

Delete removes a Named Location.

func (*NamedLocationsClient) Get added in v0.15.0

Get retrieves a Named Location which can be type asserted back to IP or Country Named Location.

func (*NamedLocationsClient) GetCountry added in v0.11.0

GetCountry retrieves an Country Named Location.

func (*NamedLocationsClient) GetIP added in v0.11.0

GetIP retrieves an IP Named Location.

func (*NamedLocationsClient) List added in v0.11.0

func (c *NamedLocationsClient) List(ctx context.Context, filter string) (*[]NamedLocation, int, error)

List returns a list of Named Locations, optionally filtered using OData.

func (*NamedLocationsClient) UpdateCountry added in v0.11.0

func (c *NamedLocationsClient) UpdateCountry(ctx context.Context, countryNamedLocation CountryNamedLocation) (int, error)

UpdateCountry amends an existing Country Named Location.

func (*NamedLocationsClient) UpdateIP added in v0.11.0

func (c *NamedLocationsClient) UpdateIP(ctx context.Context, ipNamedLocation IPNamedLocation) (int, error)

UpdateIP amends an existing IP Named Location.

type OnPremisesPublishing

type OnPremisesPublishing struct {
	AlternateUrl                  *string `json:"alternateUrl,omitempty"`
	ApplicationServerTimeout      *string `json:"applicationServerTimeout,omitempty"`
	ApplicationType               *string `json:"applicationType,omitempty"`
	ExternalAuthenticationType    *string `json:"externalAuthenticationType,omitempty"`
	ExternalUrl                   *string `json:"externalUrl,omitempty"`
	InternalUrl                   *string `json:"internalUrl,omitempty"`
	IsHttpOnlyCookieEnabled       *bool   `json:"isHttpOnlyCookieEnabled,omitempty"`
	IsOnPremPublishingEnabled     *bool   `json:"isOnPremPublishingEnabled,omitempty"`
	IsPersistentCookieEnabled     *bool   `json:"isPersistentCookieEnabled,omitempty"`
	IsSecureCookieEnabled         *bool   `json:"isSecureCookieEnabled,omitempty"`
	IsTranslateHostHeaderEnabled  *bool   `json:"isTranslateHostHeaderEnabled,omitempty"`
	IsTranslateLinksInBodyEnabled *bool   `json:"isTranslateLinksInBodyEnabled,omitempty"`

	SingleSignOnSettings                     *OnPremisesPublishingSingleSignOn                             `json:"singleSignOnSettings,omitempty"`
	VerifiedCustomDomainCertificatesMetadata *OnPremisesPublishingVerifiedCustomDomainCertificatesMetadata `json:"verifiedCustomDomainCertificatesMetadata,omitempty"`
	VerifiedCustomDomainKeyCredential        *KeyCredential                                                `json:"verifiedCustomDomainKeyCredential,omitempty"`
	VerifiedCustomDomainPasswordCredential   *PasswordCredential                                           `json:"verifiedCustomDomainPasswordCredential,omitempty"`
}

type OnPremisesPublishingSingleSignOn

type OnPremisesPublishingSingleSignOn struct {
	KerberosSignOnSettings *KerberosSignOnSettings `json:"kerberosSignOnSettings,omitempty"`
	SingleSignOnMode       *string                 `json:"singleSignOnMode,omitempty"`
}

type OnPremisesPublishingVerifiedCustomDomainCertificatesMetadata

type OnPremisesPublishingVerifiedCustomDomainCertificatesMetadata struct {
	ExpiryDate  *time.Time `json:"expiryDate,omitempty"`
	IssueDate   *time.Time `json:"issueDate,omitempty"`
	IssuerName  *string    `json:"issuerName,omitempty"`
	SubjectName *string    `json:"subjectName,omitempty"`
	Thumbprint  *string    `json:"thumbprint,omitempty"`
}

type OptionalClaim

type OptionalClaim struct {
	AdditionalProperties *[]string `json:"additionalProperties,omitempty"`
	Essential            *bool     `json:"essential,omitempty"`
	Name                 *string   `json:"name,omitempty"`
	Source               *string   `json:"source,omitempty"`
}

type OptionalClaims

type OptionalClaims struct {
	AccessToken *[]OptionalClaim `json:"accessToken,omitempty"`
	IdToken     *[]OptionalClaim `json:"idToken,omitempty"`
	Saml2Token  *[]OptionalClaim `json:"saml2Token,omitempty"`
}

type ParentalControlSettings

type ParentalControlSettings struct {
	CountriesBlockedForMinors *[]string `json:"countriesBlockedForMinors,omitempty"`
	LegalAgeGroupRule         *string   `json:"legalAgeGroupRule,omitempty"`
}

type PasswordCredential

type PasswordCredential struct {
	CustomKeyIdentifier *string    `json:"customKeyIdentifier,omitempty"`
	DisplayName         *string    `json:"displayName,omitempty"`
	EndDateTime         *time.Time `json:"endDateTime,omitempty"`
	Hint                *string    `json:"hint,omitempty"`
	KeyId               *string    `json:"keyId,omitempty"`
	SecretText          *string    `json:"secretText,omitempty"`
	StartDateTime       *time.Time `json:"startDateTime,omitempty"`
}

PasswordCredential describes a password credential for an object.

type PasswordSingleSignOnSettings

type PasswordSingleSignOnSettings struct {
	Fields *[]SingleSignOnField `json:"fields,omitempty"`
}

type PatchHttpRequestInput

type PatchHttpRequestInput struct {
	Body             []byte
	ValidStatusCodes []int
	ValidStatusFunc  ValidStatusFunc
	Uri              Uri
}

PatchHttpRequestInput configures a PATCH request.

func (PatchHttpRequestInput) GetValidStatusCodes

func (i PatchHttpRequestInput) GetValidStatusCodes() []int

GetValidStatusCodes returns a []int of status codes considered valid for a PATCH request.

func (PatchHttpRequestInput) GetValidStatusFunc

func (i PatchHttpRequestInput) GetValidStatusFunc() ValidStatusFunc

GetValidStatusFunc returns a function used to evaluate whether the response to a PATCH request is considered valid.

type PermissionScope

type PermissionScope struct {
	ID                      *string             `json:"id,omitempty"`
	AdminConsentDescription *string             `json:"adminConsentDescription,omitempty"`
	AdminConsentDisplayName *string             `json:"adminConsentDisplayName,omitempty"`
	IsEnabled               *bool               `json:"isEnabled,omitempty"`
	Type                    PermissionScopeType `json:"type,omitempty"`
	UserConsentDescription  *string             `json:"userConsentDescription,omitempty"`
	UserConsentDisplayName  *string             `json:"userConsentDisplayName,omitempty"`
	Value                   *string             `json:"value,omitempty"`
}

type PermissionScopeType added in v0.12.0

type PermissionScopeType string
const (
	PermissionScopeTypeAdmin PermissionScopeType = "Admin"
	PermissionScopeTypeUser  PermissionScopeType = "User"
)

type PersistentBrowserSessionControl added in v0.11.0

type PersistentBrowserSessionControl struct {
	IsEnabled *bool   `json:"isEnabled,omitempty"`
	Mode      *string `json:"mode,omitempty"`
}

type PostHttpRequestInput

type PostHttpRequestInput struct {
	Body             []byte
	ValidStatusCodes []int
	ValidStatusFunc  ValidStatusFunc
	Uri              Uri
}

PostHttpRequestInput configures a POST request.

func (PostHttpRequestInput) GetValidStatusCodes

func (i PostHttpRequestInput) GetValidStatusCodes() []int

GetValidStatusCodes returns a []int of status codes considered valid for a POST request.

func (PostHttpRequestInput) GetValidStatusFunc

func (i PostHttpRequestInput) GetValidStatusFunc() ValidStatusFunc

GetValidStatusFunc returns a function used to evaluate whether the response to a POST request is considered valid.

type PublicClient

type PublicClient struct {
	RedirectUris *[]string `json:"redirectUris,omitempty"`
}

type PutHttpRequestInput

type PutHttpRequestInput struct {
	Body             []byte
	ValidStatusCodes []int
	ValidStatusFunc  ValidStatusFunc
	Uri              Uri
}

PutHttpRequestInput configures a PUT request.

func (PutHttpRequestInput) GetValidStatusCodes

func (i PutHttpRequestInput) GetValidStatusCodes() []int

GetValidStatusCodes returns a []int of status codes considered valid for a PUT request.

func (PutHttpRequestInput) GetValidStatusFunc

func (i PutHttpRequestInput) GetValidStatusFunc() ValidStatusFunc

GetValidStatusFunc returns a function used to evaluate whether the response to a PUT request is considered valid.

type Recipient

type Recipient struct {
	EmailAddress *EmailAddress `json:"emailAddress,omitempty"`
}

type RequiredResourceAccess

type RequiredResourceAccess struct {
	ResourceAccess *[]ResourceAccess `json:"resourceAccess,omitempty"`
	ResourceAppId  *string           `json:"resourceAppId,omitempty"`
}

type ResourceAccess

type ResourceAccess struct {
	ID   *string            `json:"id,omitempty"`
	Type ResourceAccessType `json:"type,omitempty"`
}

type ResourceAccessType added in v0.12.0

type ResourceAccessType string
const (
	ResourceAccessTypeRole  ResourceAccessType = "Role"
	ResourceAccessTypeScope ResourceAccessType = "Scope"
)

type SamlSingleSignOnSettings

type SamlSingleSignOnSettings struct {
	RelayState *string `json:"relayState,omitempty"`
}

type ServicePrincipal

type ServicePrincipal struct {
	ID                                  *string                       `json:"id,omitempty"`
	AccountEnabled                      *bool                         `json:"accountEnabled,omitempty"`
	AddIns                              *[]AddIn                      `json:"addIns,omitempty"`
	AlternativeNames                    *[]string                     `json:"alternativeNames,omitempty"`
	AppDisplayName                      *string                       `json:"appDisplayName,omitempty"`
	AppId                               *string                       `json:"appId,omitempty"`
	ApplicationTemplateId               *string                       `json:"applicationTemplateId,omitempty"`
	AppOwnerOrganizationId              *string                       `json:"appOwnerOrganizationId,omitempty"`
	AppRoleAssignmentRequired           *bool                         `json:"appRoleAssignmentRequired,omitempty"`
	AppRoles                            *[]AppRole                    `json:"appRoles,omitempty"`
	DeletedDateTime                     *time.Time                    `json:"deletedDateTime,omitempty"`
	DisplayName                         *string                       `json:"displayName,omitempty"`
	Homepage                            *string                       `json:"homepage,omitempty"`
	Info                                *InformationalUrl             `json:"info,omitempty"`
	KeyCredentials                      *[]KeyCredential              `json:"keyCredentials,omitempty"`
	LoginUrl                            *string                       `json:"loginUrl,omitempty"`
	LogoutUrl                           *string                       `json:"logoutUrl,omitempty"`
	NotificationEmailAddresses          *[]string                     `json:"notificationEmailAddresses,omitempty"`
	PasswordCredentials                 *[]PasswordCredential         `json:"passwordCredentials,omitempty"`
	PasswordSingleSignOnSettings        *PasswordSingleSignOnSettings `json:"passwordSingleSignOnSettings,omitempty"`
	PreferredSingleSignOnMode           *string                       `json:"preferredSingleSignOnMode,omitempty"`
	PreferredTokenSigningKeyEndDateTime *time.Time                    `json:"preferredTokenSigningKeyEndDateTime,omitempty"`
	PublishedPermissionScopes           *[]PermissionScope            `json:"publishedPermissionScopes,omitempty"`
	ReplyUrls                           *[]string                     `json:"replyUrls,omitempty"`
	SamlSingleSignOnSettings            *SamlSingleSignOnSettings     `json:"samlSingleSignOnSettings,omitempty"`
	ServicePrincipalNames               *[]string                     `json:"servicePrincipalNames,omitempty"`
	ServicePrincipalType                *string                       `json:"servicePrincipalType,omitempty"`
	SignInAudience                      SignInAudience                `json:"signInAudience,omitempty"`
	Tags                                *[]string                     `json:"tags,omitempty"`
	TokenEncryptionKeyId                *string                       `json:"tokenEncryptionKeyId,omitempty"`
	VerifiedPublisher                   *VerifiedPublisher            `json:"verifiedPublisher,omitempty"`

	Owners *[]string `json:"owners@odata.bind,omitempty"`
}

ServicePrincipal describes a Service Principal object.

func (*ServicePrincipal) AppendOwner

func (a *ServicePrincipal) AppendOwner(endpoint string, apiVersion string, id string)

AppendOwner appends a new owner object URI to the Owners slice.

type ServicePrincipalsClient

type ServicePrincipalsClient struct {
	BaseClient Client
}

ServicePrincipalsClient performs operations on Service Principals.

func NewServicePrincipalsClient

func NewServicePrincipalsClient(tenantId string) *ServicePrincipalsClient

NewServicePrincipalsClient returns a new ServicePrincipalsClient.

func (*ServicePrincipalsClient) AddOwners

func (c *ServicePrincipalsClient) AddOwners(ctx context.Context, servicePrincipal *ServicePrincipal) (int, error)

AddOwners adds a new owner to a Service Principal. First populate the Owners field of the ServicePrincipal using the AppendOwner method of the model, then call this method.

func (*ServicePrincipalsClient) AddPassword added in v0.13.0

func (c *ServicePrincipalsClient) AddPassword(ctx context.Context, servicePrincipalId string, passwordCredential PasswordCredential) (*PasswordCredential, int, error)

AddPassword appends a new password credential to a Service Principal.

func (*ServicePrincipalsClient) AssignAppRoleForResource added in v0.14.0

func (c *ServicePrincipalsClient) AssignAppRoleForResource(ctx context.Context, principalId, resourceId, appRoleId string) (*AppRoleAssignment, int, error)

AssignAppRoleForResource assigns an app role for a resource service principal, to a user, group, or client service principal. To grant an app role assignment, you need three identifiers:

principalId: The id of the user, group or client servicePrincipal to which you are assigning the app role. resourceId: The id of the resource servicePrincipal which has defined the app role. appRoleId: The id of the appRole (defined on the resource service principal) to assign to a user, group, or service principal.

func (*ServicePrincipalsClient) Create

func (c *ServicePrincipalsClient) Create(ctx context.Context, servicePrincipal ServicePrincipal) (*ServicePrincipal, int, error)

Create creates a new Service Principal.

func (*ServicePrincipalsClient) Delete

func (c *ServicePrincipalsClient) Delete(ctx context.Context, id string) (int, error)

Delete removes a Service Principal.

func (*ServicePrincipalsClient) Get

Get retrieves a Service Principal.

func (*ServicePrincipalsClient) GetOwner

func (c *ServicePrincipalsClient) GetOwner(ctx context.Context, servicePrincipalId, ownerId string) (*string, int, error)

GetOwner retrieves a single owner for the specified Service Principal. servicePrincipalId is the object ID of the service principal. ownerId is the object ID of the owning object.

func (*ServicePrincipalsClient) List

List returns a list of Service Principals, optionally filtered using OData.

func (*ServicePrincipalsClient) ListAppRoleAssignments added in v0.14.0

func (c *ServicePrincipalsClient) ListAppRoleAssignments(ctx context.Context, resourceId string) (*[]AppRoleAssignment, int, error)

ListAppRoleAssignments retrieves a list of appRoleAssignment that users, groups, or client service principals have been granted for the given resource service principal.

func (*ServicePrincipalsClient) ListGroupMemberships

func (c *ServicePrincipalsClient) ListGroupMemberships(ctx context.Context, id string, filter string) (*[]Group, int, error)

ListGroupMemberships returns a list of Groups the Service Principal is member of, optionally filtered using OData.

func (*ServicePrincipalsClient) ListOwnedObjects added in v0.13.0

func (c *ServicePrincipalsClient) ListOwnedObjects(ctx context.Context, id string) (*[]string, int, error)

ListOwnedObjects retrieves the owned objects of the specified Service Principal. id is the object ID of the service principal.

func (*ServicePrincipalsClient) ListOwners

func (c *ServicePrincipalsClient) ListOwners(ctx context.Context, id string) (*[]string, int, error)

ListOwners retrieves the owners of the specified Service Principal. id is the object ID of the service principal.

func (*ServicePrincipalsClient) RemoveAppRoleAssignment added in v0.14.0

func (c *ServicePrincipalsClient) RemoveAppRoleAssignment(ctx context.Context, resourceId, appRoleAssignmentId string) (int, error)

RemoveAppRoleAssignment deletes an appRoleAssignment that a user, group, or client service principal has been granted for a resource service principal.

func (*ServicePrincipalsClient) RemoveOwners

func (c *ServicePrincipalsClient) RemoveOwners(ctx context.Context, servicePrincipalId string, ownerIds *[]string) (int, error)

RemoveOwners removes owners from a Service Principal. servicePrincipalId is the object ID of the service principal. ownerIds is a *[]string containing object IDs of owners to remove.

func (*ServicePrincipalsClient) RemovePassword added in v0.13.0

func (c *ServicePrincipalsClient) RemovePassword(ctx context.Context, servicePrincipalId string, keyId string) (int, error)

RemovePassword removes a password credential from a Service Principal.

func (*ServicePrincipalsClient) Update

func (c *ServicePrincipalsClient) Update(ctx context.Context, servicePrincipal ServicePrincipal) (int, error)

Update amends an existing Service Principal.

type SignInAudience

type SignInAudience string
const (
	SignInAudienceAzureADMyOrg                       SignInAudience = "AzureADMyOrg"
	SignInAudienceAzureADMultipleOrgs                SignInAudience = "AzureADMultipleOrgs"
	SignInAudienceAzureADandPersonalMicrosoftAccount SignInAudience = "AzureADandPersonalMicrosoftAccount"
)

type SignInFrequencySessionControl added in v0.11.0

type SignInFrequencySessionControl struct {
	IsEnabled *bool   `json:"isEnabled,omitempty"`
	Type      *string `json:"type,omitempty"`
	Value     *int32  `json:"value,omitempty"`
}

type SingleSignOnField

type SingleSignOnField struct {
	CustomizedLabel *string `json:"customizedLabel,omitempty"`
	DefaultLabel    *string `json:"defaultLabel,omitempty"`
	FieldId         *string `json:"fieldId,omitempty"`
	Type            *string `json:"type,omitempty"`
}

type Uri

type Uri struct {
	Entity      string
	Params      url.Values
	HasTenantId bool
}

Uri represents a Microsoft Graph endpoint.

type User

type User struct {
	ID                              *string    `json:"id,omitempty"`
	AboutMe                         *string    `json:"aboutMe,omitempty"`
	AccountEnabled                  *bool      `json:"accountEnabled,omitempty"`
	BusinessPhones                  *[]string  `json:"businessPhones,omitempty"`
	City                            *string    `json:"city,omitempty"`
	CompanyName                     *string    `json:"companyName,omitempty"`
	Country                         *string    `json:"country,omitempty"`
	CreatedDateTime                 *time.Time `json:"createdDateTime,omitempty"`
	CreationType                    *string    `json:"creationType,omitempty"`
	DeletedDateTime                 *time.Time `json:"deletedDateTime,omitempty"`
	Department                      *string    `json:"department,omitempty"`
	DisplayName                     *string    `json:"displayName,omitempty"`
	EmployeeHireDate                *time.Time `json:"employeeHireDate,omitempty"`
	EmployeeId                      *string    `json:"employeeId,omitempty"`
	EmployeeType                    *string    `json:"employeeType,omitempty"`
	ExternalUserState               *string    `json:"externalUserState,omitempty"`
	FaxNumber                       *string    `json:"faxNumber,omitempty"`
	GivenName                       *string    `json:"givenName,omitempty"`
	ImAddresses                     *[]string  `json:"imAddresses,omitempty"`
	Interests                       *[]string  `json:"interests,omitempty"`
	IsManagementRestricted          *bool      `json:"isManagementRestricted,omitempty"`
	IsResourceAccount               *bool      `json:"isResourceAccount,omitempty"`
	JobTitle                        *string    `json:"jobTitle,omitempty"`
	Mail                            *string    `json:"mail,omitempty"`
	MailNickname                    *string    `json:"mailNickname,omitempty"`
	MobilePhone                     *string    `json:"mobilePhone,omitempty"`
	MySite                          *string    `json:"mySite,omitempty"`
	OfficeLocation                  *string    `json:"officeLocation,omitempty"`
	OnPremisesDistinguishedName     *string    `json:"onPremisesDistinguishedName,omitempty"`
	OnPremisesDomainName            *string    `json:"onPremisesDomainName,omitempty"`
	OnPremisesImmutableId           *string    `json:"onPremisesImmutableId,omitempty"`
	OnPremisesLastSyncDateTime      *string    `json:"onPremisesLastSyncDateTime,omitempty"`
	OnPremisesSamAccountName        *string    `json:"onPremisesSamAccountName,omitempty"`
	OnPremisesSecurityIdentifier    *string    `json:"onPremisesSecurityIdentifier,omitempty"`
	OnPremisesSyncEnabled           *bool      `json:"onPremisesSyncEnabled,omitempty"`
	OnPremisesUserPrincipalName     *string    `json:"onPremisesUserPrincipalName,omitempty"`
	OtherMails                      *[]string  `json:"otherMails,omitempty"`
	PasswordPolicies                *string    `json:"passwordPolicies,omitempty"`
	PastProjects                    *[]string  `json:"pastProjects,omitempty"`
	PostalCode                      *string    `json:"postalCode,omitempty"`
	PreferredDataLocation           *string    `json:"preferredDataLocation,omitempty"`
	PreferredLanguage               *string    `json:"preferredLanguage,omitempty"`
	PreferredName                   *string    `json:"preferredName,omitempty"`
	ProxyAddresses                  *[]string  `json:"proxyAddresses,omitempty"`
	RefreshTokensValidFromDateTime  *time.Time `json:"refreshTokensValidFromDateTime,omitempty"`
	Responsibilities                *[]string  `json:"responsibilities,omitempty"`
	Schools                         *[]string  `json:"schools,omitempty"`
	ShowInAddressList               *bool      `json:"showInAddressList,omitempty"`
	SignInSessionsValidFromDateTime *time.Time `json:"signInSessionsValidFromDateTime,omitempty"`
	Skills                          *[]string  `json:"skills,omitempty"`
	State                           *string    `json:"state,omitempty"`
	StreetAddress                   *string    `json:"streetAddress,omitempty"`
	Surname                         *string    `json:"surname,omitempty"`
	UsageLocation                   *string    `json:"usageLocation,omitempty"`
	UserPrincipalName               *string    `json:"userPrincipalName,omitempty"`
	UserType                        *string    `json:"userType,omitempty"`

	PasswordProfile *UserPasswordProfile `json:"passwordProfile,omitempty"`
}

User describes a User object.

type UserPasswordProfile

type UserPasswordProfile struct {
	ForceChangePasswordNextSignIn        *bool   `json:"forceChangePasswordNextSignIn,omitempty"`
	ForceChangePasswordNextSignInWithMfa *bool   `json:"forceChangePasswordNextSignInWithMfa,omitempty"`
	Password                             *string `json:"password,omitempty"`
}

type UsersClient

type UsersClient struct {
	BaseClient Client
}

UsersClient performs operations on Users.

func NewUsersClient

func NewUsersClient(tenantId string) *UsersClient

NewUsersClient returns a new UsersClient.

func (*UsersClient) Create

func (c *UsersClient) Create(ctx context.Context, user User) (*User, int, error)

Create creates a new User.

func (*UsersClient) Delete

func (c *UsersClient) Delete(ctx context.Context, id string) (int, error)

Delete removes a User.

func (*UsersClient) DeletePermanently added in v0.15.0

func (c *UsersClient) DeletePermanently(ctx context.Context, id string) (int, error)

DeletePermanently removes a deleted User permanently.

func (*UsersClient) Get

func (c *UsersClient) Get(ctx context.Context, id string) (*User, int, error)

Get retrieves a User.

func (*UsersClient) GetDeleted added in v0.14.0

func (c *UsersClient) GetDeleted(ctx context.Context, id string) (*User, int, error)

GetDeleted retrieves a deleted User.

func (*UsersClient) List

func (c *UsersClient) List(ctx context.Context, filter string) (*[]User, int, error)

List returns a list of Users, optionally filtered using OData.

func (*UsersClient) ListDeleted added in v0.14.0

func (c *UsersClient) ListDeleted(ctx context.Context, filter string) (*[]User, int, error)

ListDeleted retrieves a list of recently deleted users, optionally filtered using OData.

func (*UsersClient) ListGroupMemberships

func (c *UsersClient) ListGroupMemberships(ctx context.Context, id string, filter string) (*[]Group, int, error)

ListGroupMemberships returns a list of Groups the user is member of, optionally filtered using OData.

func (*UsersClient) Sendmail added in v0.13.0

func (c *UsersClient) Sendmail(ctx context.Context, id string, message MailMessage) (int, error)

SendMail sends message specified in the request body. TODO: Needs testing with an O365 user principal

func (*UsersClient) Update

func (c *UsersClient) Update(ctx context.Context, user User) (int, error)

Update amends an existing User.

type ValidStatusFunc

type ValidStatusFunc func(response *http.Response, o *odata.OData) bool

ValidStatusFunc is a function that tests whether an HTTP response is considered valid for the particular request.

type VerifiedPublisher

type VerifiedPublisher struct {
	AddedDateTime       *time.Time `json:"addedDateTime,omitempty"`
	DisplayName         *string    `json:"displayName,omitempty"`
	VerifiedPublisherId *string    `json:"verifiedPublisherId,omitempty"`
}

Jump to

Keyboard shortcuts

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