msgraph

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: Apache-2.0 Imports: 15 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 *[]string `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 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"`
	DeletedDateTime            *time.Time                `json:"deletedDateTime,omitempty"`
	DisplayName                *string                   `json:"displayName,omitempty"`
	GroupMembershipClaims      *string                   `json:"groupMembershipClaims,omitempty"`
	IdentifierUris             *[]string                 `json:"identifierUris,omitempty"`
	Info                       *InformationalUrl         `json:"info,omitempty"`
	IsFallbackPublicClient     *bool                     `json:"isFallbackPublicCLient,omitempty"`
	KeyCredentials             *[]KeyCredential          `json:"keyCredentials,omitempty"`
	Oauth2RequiredPostResponse *bool                     `json:"oauth2RequiredPostResponse,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"`
	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) RemoveAppRole

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

RemoveAppRole removes an AppRole from an Application.

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 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) AddKey

func (c *ApplicationsClient) AddKey(ctx context.Context, applicationId string, keyCredential KeyCredential) (*KeyCredential, int, error)

AddKey appends a new key credential to an Application.

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) 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) Get

Get retrieves an Application manifest.

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) 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) Update

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

Update amends the manifest of an existing Application.

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 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 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 GraphClient

type GraphClient = *http.Client

GraphClient is any suitable HTTP client.

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"`

	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 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) Get

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

Get retrieves a Group.

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) 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 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 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                *string    `json:"type,omitempty"`
	Usage               *string    `json:"usage,omitempty"`
	Key                 *string    `json:"key,omitempty"`
}

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

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.

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                    *string `json:"type,omitempty"`
	UserConsentDescription  *string `json:"userConsentDescription,omitempty"`
	UserConsentDisplayName  *string `json:"userConsentDisplayName,omitempty"`
	Value                   *string `json:"value,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 *string `json:"type,omitempty"`
}

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) 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) 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) 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) 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) 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 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"`
	CreationType                 *string   `json:"creationType,omitempty"`
	Department                   *string   `json:"department,omitempty"`
	DisplayName                  *string   `json:"displayName,omitempty"`
	EmployeeId                   *string   `json:"employeeId,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"`
	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"`
	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"`
	Responsibilities             *[]string `json:"responsibilities,omitempty"`
	Schools                      *[]string `json:"schools,omitempty"`
	ShowInAddressList            *bool     `json:"showInAddressList,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) Get

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

Get retrieves a 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) 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) 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