Documentation
¶
Index ¶
- Constants
- type AppRoleAssignmentResponse
- type AppRoleAssignmentsResponse
- type Client
- type DirectoryRoleResponse
- type DirectoryRoleTemplateResponse
- type DirectoryRoleTemplatesResponse
- type DirectoryRoleTemplatesService
- type DirectoryRolesResponse
- type DirectoryRolesService
- func (s *DirectoryRolesService) ActivateDirectoryRole(ctx context.Context, roleTemplateID string) (*DirectoryRoleResponse, error)
- func (s *DirectoryRolesService) AddMember(ctx context.Context, ...) error
- func (s *DirectoryRolesService) GetDirectoryRole(ctx context.Context, id string) (*DirectoryRoleResponse, error)
- func (s *DirectoryRolesService) ListAll(ctx context.Context) (*DirectoryRolesResponse, error)
- type GroupListOptions
- type GroupResponse
- type GroupsResponse
- type GroupsService
- func (s *GroupsService) AddAppRoleAssignments(ctx context.Context, groupID, principalID, resourceID, appRoleID string) (*AppRoleAssignmentResponse, error)
- func (s *GroupsService) AddMember(ctx context.Context, groupID, userID string) error
- func (s *GroupsService) AddOwner(ctx context.Context, groupID, userID string) error
- func (s *GroupsService) CreateGroup(ctx context.Context, r *models.Group) (*GroupResponse, error)
- func (s *GroupsService) DeleteAppRoleAssignment(ctx context.Context, groupID, appRoleAssignmentID string) error
- func (s *GroupsService) DeleteGroup(ctx context.Context, groupID string) error
- func (s *GroupsService) GetGroup(ctx context.Context, groupID string, opts *GroupListOptions) (*GroupResponse, error)
- func (s *GroupsService) ListAll(ctx context.Context, opts *GroupListOptions) (*GroupsResponse, error)
- func (s *GroupsService) ListAppRoleAssignments(ctx context.Context, groupID string, opts *GroupListOptions) (*AppRoleAssignmentsResponse, error)
- func (s *GroupsService) ListMembers(ctx context.Context, groupID string, opts *GroupListOptions) (*UsersResponse, error)
- func (s *GroupsService) ListOwners(ctx context.Context, groupID string, opts *GroupListOptions) (*UsersResponse, error)
- func (s *GroupsService) RemoveMember(ctx context.Context, groupID, userID string) error
- func (s *GroupsService) RemoveOwner(ctx context.Context, groupID, userID string) error
- func (s *GroupsService) UpdateGroup(ctx context.Context, r *models.Group) error
- type SchemaExtensionListOptions
- type SchemaExtensionResponse
- type SchemaExtensionsResponse
- type SchemaExtensionsService
- func (s *SchemaExtensionsService) CreateSchemaExtension(ctx context.Context, r *models.SchemaExtension) (*SchemaExtensionResponse, error)
- func (s *SchemaExtensionsService) DeleteSchemaExtension(ctx context.Context, schemaExtensionID string) error
- func (s *SchemaExtensionsService) GetSchemaExtension(ctx context.Context, schemaExtensionID string, ...) (*SchemaExtensionResponse, error)
- func (s *SchemaExtensionsService) ListAll(ctx context.Context, opts *SchemaExtensionListOptions) (*SchemaExtensionsResponse, error)
- func (s *SchemaExtensionsService) UpdateSchemaExtension(ctx context.Context, r *models.SchemaExtension) error
- type UserListOptions
- type UserResponse
- type UsersResponse
- type UsersService
- func (s *UsersService) CreateUser(ctx context.Context, r *models.User) (*UserResponse, error)
- func (s *UsersService) DeleteUser(ctx context.Context, userID string) error
- func (s *UsersService) GetUser(ctx context.Context, userID string, opts *UserListOptions) (*UserResponse, error)
- func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) (*UsersResponse, error)
- func (s *UsersService) UpdateSchemaExtensions(ctx context.Context, userID, schemaExtensionID string, ...) error
- func (s *UsersService) UpdateUser(ctx context.Context, u *models.User) error
Constants ¶
const (
SchemaExtensionsResourceName = "schemaExtensions"
)
const (
UsersResourceName = "users"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppRoleAssignmentResponse ¶
type AppRoleAssignmentResponse struct {
models.OData
models.AppRoleAssignment
}
type AppRoleAssignmentsResponse ¶
type AppRoleAssignmentsResponse struct {
models.OData
AppRoleAssignments []*models.AppRoleAssignment `json:"value"`
}
type Client ¶
type Client struct {
core.BaseClient
Users *UsersService
Groups *GroupsService
DirectoryRoles *DirectoryRolesService
DirectoryRoleTemplates *DirectoryRoleTemplatesService
SchemaExtensions *SchemaExtensionsService
// contains filtered or unexported fields
}
A Client manages communication with the MS Graph API.
type DirectoryRoleResponse ¶
type DirectoryRoleResponse struct {
models.OData
models.DirectoryRole
}
type DirectoryRoleTemplateResponse ¶
type DirectoryRoleTemplateResponse struct {
models.OData
models.DirectoryRoleTemplate
}
type DirectoryRoleTemplatesResponse ¶
type DirectoryRoleTemplatesResponse struct {
models.OData
DirectoryRoleTemplates []*models.DirectoryRoleTemplate `json:"value"`
}
type DirectoryRoleTemplatesService ¶
type DirectoryRoleTemplatesService service
func (*DirectoryRoleTemplatesService) GetDirectoryRoleTemplate ¶
func (s *DirectoryRoleTemplatesService) GetDirectoryRoleTemplate(ctx context.Context, objectOrTemplateID string) (*DirectoryRoleResponse, error)
Retrieve the properties and relationships of a directory role template object.
You can use both the object ID and template ID of the directoryRole with this API. The template ID of a built-in role is immutable and can be seen in the role description on the Azure portal. For details, see Role template IDs.
GET /directoryRoleTemplates/{id}
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/directoryrole-get?view=graph-rest-1.0&tabs=http
func (*DirectoryRoleTemplatesService) ListAll ¶
func (s *DirectoryRoleTemplatesService) ListAll(ctx context.Context) (*DirectoryRoleTemplatesResponse, error)
Retrieve a list of directoryRoleTemplate objects.
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/directoryroletemplate-list?view=graph-rest-1.0&tabs=http
type DirectoryRolesResponse ¶
type DirectoryRolesResponse struct {
models.OData
DirectoryRoles []*models.DirectoryRole `json:"value"`
}
type DirectoryRolesService ¶
type DirectoryRolesService service
func (*DirectoryRolesService) ActivateDirectoryRole ¶
func (s *DirectoryRolesService) ActivateDirectoryRole(ctx context.Context, roleTemplateID string) (*DirectoryRoleResponse, error)
Activate a directory role. To read a directory role or update its members, it must first be activated in the tenant.
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/directoryrole-post-directoryroles?view=graph-rest-1.0&tabs=http
func (*DirectoryRolesService) AddMember ¶
func (s *DirectoryRolesService) AddMember(ctx context.Context, objectOrTemplateIDOfDirectoryRole, directoryObjectID string) error
Use this API to create a new directory role member. You can use both the object ID and template ID of the directoryRole with this API. The template ID of a built-in role is immutable and can be seen in the role description on the Azure portal. For details, see Role template IDs.
POST /directoryRoles/{id}/members/$ref
objectOrTemplateIDOfDirectoryRole - the object ID and template ID of the directoryRole directoryObjectID - the directory object ID e.g. user ID, group ID etc.
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/directoryrole-post-members?view=graph-rest-1.0&tabs=http
func (*DirectoryRolesService) GetDirectoryRole ¶
func (s *DirectoryRolesService) GetDirectoryRole(ctx context.Context, id string) (*DirectoryRoleResponse, error)
Retrieve the properties of a directoryRole object. The role must be activated in tenant for a successful response.
GET /directoryRoles/{id}
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/directoryrole-get?view=graph-rest-1.0&tabs=http
func (*DirectoryRolesService) ListAll ¶
func (s *DirectoryRolesService) ListAll(ctx context.Context) (*DirectoryRolesResponse, error)
List the directory roles that are activated in the tenant.
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/directoryrole-list?view=graph-rest-1.0&tabs=http
type GroupListOptions ¶
type GroupsResponse ¶
type GroupsService ¶
type GroupsService service
func (*GroupsService) AddAppRoleAssignments ¶
func (s *GroupsService) AddAppRoleAssignments(ctx context.Context, groupID, principalID, resourceID, appRoleID string) (*AppRoleAssignmentResponse, error)
Use this API to assign an app role to a group. All direct members of the group will be considered assigned. To grant an app role assignment to a group, you need three identifiers:
principalId: The id of the group 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 the group.
POST /groups/{id}/appRoleAssignments
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-post-approleassignments?view=graph-rest-1.0&tabs=http
func (*GroupsService) AddMember ¶
func (s *GroupsService) AddMember(ctx context.Context, groupID, userID string) error
Add a member to a Microsoft 365 group or a security group through the members navigation property. You can add users, organizational contacts, service principals or other groups.
POST /groups/{group-id}/members/$ref
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http
func (*GroupsService) AddOwner ¶
func (s *GroupsService) AddOwner(ctx context.Context, groupID, userID string) error
Add a user or service principal to the group's owners. The owners are a set of users or service principals who are allowed to modify the group object.
POST /groups/{id}/owners/$ref
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-post-owners?view=graph-rest-1.0&tabs=http
func (*GroupsService) CreateGroup ¶
func (s *GroupsService) CreateGroup(ctx context.Context, r *models.Group) (*GroupResponse, error)
Create a new group as specified in the request body. You can create the following types of groups:
Microsoft 365 group (unified group) Security group MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-post-groups?view=graph-rest-1.0&tabs=http
func (*GroupsService) DeleteAppRoleAssignment ¶
func (s *GroupsService) DeleteAppRoleAssignment(ctx context.Context, groupID, appRoleAssignmentID string) error
Deletes an appRoleAssignment that a group has been granted.
DELETE /groups/{id}/appRoleAssignments/{id}
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-delete-approleassignments?view=graph-rest-1.0&tabs=http
func (*GroupsService) DeleteGroup ¶
func (s *GroupsService) DeleteGroup(ctx context.Context, groupID string) error
Delete group.
When deleted, Microsoft 365 groups are moved to a temporary container and can be restored within 30 days. After that time, they are permanently deleted. To learn more, see deletedItems. This applies only to Microsoft 365 groups. DELETE /groups/{id}
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-delete?view=graph-rest-1.0&tabs=http
func (*GroupsService) GetGroup ¶
func (s *GroupsService) GetGroup(ctx context.Context, groupID string, opts *GroupListOptions) (*GroupResponse, error)
Get the properties and relationships of a group object.
GET /groups/{id}
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-get?view=graph-rest-1.0&tabs=http
func (*GroupsService) ListAll ¶
func (s *GroupsService) ListAll(ctx context.Context, opts *GroupListOptions) (*GroupsResponse, error)
List all the groups in an organization, including but not limited to Microsoft 365 groups.
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-list?view=graph-rest-1.0&tabs=http
func (*GroupsService) ListAppRoleAssignments ¶
func (s *GroupsService) ListAppRoleAssignments(ctx context.Context, groupID string, opts *GroupListOptions) (*AppRoleAssignmentsResponse, error)
Retrieve the list of appRoleAssignment that have been granted to a group.
GET /groups/{id}/appRoleAssignments
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-list-owners?view=graph-rest-1.0&tabs=http
func (*GroupsService) ListMembers ¶
func (s *GroupsService) ListMembers(ctx context.Context, groupID string, opts *GroupListOptions) (*UsersResponse, error)
Get a list of the group's direct members. A group can have users, organizational contacts, devices, service principals and other groups as members. Currently service principals are not listed as group members due to staged roll-out of service principals on Graph V1.0 endpoint. This operation is not transitive.
GET /groups/{id}/members
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=http
func (*GroupsService) ListOwners ¶
func (s *GroupsService) ListOwners(ctx context.Context, groupID string, opts *GroupListOptions) (*UsersResponse, error)
Retrieve a list of the group's owners. The owners are a set of users or service principals who are allowed to modify the group object. Owners are currently not available in Microsoft Graph for groups that were created in Exchange or groups that are synchronized from an on-premises environment.
GET /groups/{id}/owners
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-list-owners?view=graph-rest-1.0&tabs=http
func (*GroupsService) RemoveMember ¶
func (s *GroupsService) RemoveMember(ctx context.Context, groupID, userID string) error
Use this API to remove a member from a group via the members navigation property.
DELETE /groups/{id}/members/{id}/$ref
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-delete-members?view=graph-rest-1.0&tabs=http
func (*GroupsService) RemoveOwner ¶
func (s *GroupsService) RemoveOwner(ctx context.Context, groupID, userID string) error
Use this API to remove an owner from a Microsoft 365 group, a security group, or a mail-enabled security group through the owners navigation property. Once owners are assigned to a group, the last owner of the group cannot be removed.
DELETE /groups/{id}/owners/{id}/$ref
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-delete-owners?view=graph-rest-1.0&tabs=http
func (*GroupsService) UpdateGroup ¶
Update the properties of a group object.
PATCH /groups/{id}
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/group-update?view=graph-rest-1.0&tabs=http
type SchemaExtensionListOptions ¶
type SchemaExtensionListOptions struct {
// The $count and $search parameters are currently not available in Azure AD B2C tenants.
//Search string `url:"$search,omitempty"`
//Count bool `url:"$count,omitempty"`
Filter string `url:"$filter,omitempty"`
Select string `url:"$select,omitempty"`
Top int `url:"$top,omitempty"`
NextLink string `url:"-"`
}
type SchemaExtensionResponse ¶
type SchemaExtensionResponse struct {
models.OData
models.SchemaExtension
}
type SchemaExtensionsResponse ¶
type SchemaExtensionsResponse struct {
models.OData
SchemaExtensions []*models.SchemaExtension `json:"value"`
}
type SchemaExtensionsService ¶
type SchemaExtensionsService service
func (*SchemaExtensionsService) CreateSchemaExtension ¶
func (s *SchemaExtensionsService) CreateSchemaExtension(ctx context.Context, r *models.SchemaExtension) (*SchemaExtensionResponse, error)
Create a new schemaExtension definition to extend a supporting resource type.
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/schemaextension-post-schemaextensions?view=graph-rest-1.0&tabs=http
func (*SchemaExtensionsService) DeleteSchemaExtension ¶
func (s *SchemaExtensionsService) DeleteSchemaExtension(ctx context.Context, schemaExtensionID string) error
Delete the definition of a schema extension. Only the app that created the schema extension (owner app) can delete the schema extension definition, and only when the extension is in the InDevelopment state. Deleting a schema extension definition does not affect accessing custom data that has been added to resource instances based on that definition.
DELETE /schemaExtensions/{id}
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/schemaextension-delete?view=graph-rest-1.0&tabs=http
func (*SchemaExtensionsService) GetSchemaExtension ¶
func (s *SchemaExtensionsService) GetSchemaExtension(ctx context.Context, schemaExtensionID string, opts *SchemaExtensionListOptions) (*SchemaExtensionResponse, error)
Get the properties of the specified schemaExtension definition.
GET /schemaExtensions/{id}
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/schemaextension-get?view=graph-rest-1.0&tabs=http
func (*SchemaExtensionsService) ListAll ¶
func (s *SchemaExtensionsService) ListAll(ctx context.Context, opts *SchemaExtensionListOptions) (*SchemaExtensionsResponse, error)
Get a list of schemaExtension objects created by any apps you own in the current tenant (that can be InDevelopment, Available, or Deprecated), and all other schema extensions owned by other apps that are marked as Available.
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/schemaextension-list?view=graph-rest-1.0&tabs=http
func (*SchemaExtensionsService) UpdateSchemaExtension ¶
func (s *SchemaExtensionsService) UpdateSchemaExtension(ctx context.Context, r *models.SchemaExtension) error
Update properties in the definition of the specified schemaExtension. This means custom properties or target resource types cannot be removed from the definition, but new custom properties can be added and the description of the extension changed. Additive updates to the extension can only be made when the extension is in the InDevelopment or Available status.
PATCH /schemaExtensions/{id}
Warning: * One application can only create up to 5 schema extensions. Keep that in mind! * Extension schema can be deleted only if the status is not set to "Available". (InDevelopment=>Available=>Deprecated)
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/schemaextension-update?view=graph-rest-1.0&tabs=http
type UserListOptions ¶
type UserListOptions struct {
// The $count and $search parameters are currently not available in Azure AD B2C tenants.
//Search string `url:"$search,omitempty"`
//Count bool `url:"$count,omitempty"`
Filter string `url:"$filter,omitempty"`
Select string `url:"$select,omitempty"`
Top int `url:"$top,omitempty"`
NextLink string `url:"-"`
}
type UserResponse ¶
func (*UserResponse) UnmarshalJSON ¶
func (u *UserResponse) UnmarshalJSON(data []byte) error
type UsersService ¶
type UsersService service
func (*UsersService) CreateUser ¶
func (s *UsersService) CreateUser(ctx context.Context, r *models.User) (*UserResponse, error)
Create a new user. The request body contains the user to create. At a minimum, you must specify the required properties for the user. You can optionally specify any other writable properties.
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/user-post-users?view=graph-rest-1.0&tabs=http
func (*UsersService) DeleteUser ¶
func (s *UsersService) DeleteUser(ctx context.Context, userID string) error
Delete user. When deleted, user resources are moved to a temporary container and can be restored within 30 days. After that time, they are permanently deleted. To learn more, see deletedItems. At a minimum, you must specify the required properties for the user. You can optionally specify any other writable properties.
DELETE /users/{id | userPrincipalName}
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/user-delete?view=graph-rest-1.0&tabs=http
func (*UsersService) GetUser ¶
func (s *UsersService) GetUser(ctx context.Context, userID string, opts *UserListOptions) (*UserResponse, error)
Retrieve the properties and relationships of user object.
GET /users/{id | userPrincipalName}
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http
func (*UsersService) ListAll ¶
func (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) (*UsersResponse, error)
Retrieve a list of user objects.
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http
func (*UsersService) UpdateSchemaExtensions ¶
func (s *UsersService) UpdateSchemaExtensions(ctx context.Context, userID, schemaExtensionID string, schemaExtensionData map[string]string) error
Update the schema extensions of a user object. You can extend and add custom data to an existing group instance with the additional graphlearn_courses complex type extension defined in the body of a PATCH request. If you want to update the values of the extension data, put the entire extension complex type in the body of a PATCH request (similar to adding custom data to an existing resource). You can also remove custom data added to a resource instance by setting the corresponding extension property to null. To remove a schema extension from a resource instance, set the extension complex type in that instance to null.
PATCH /users/{id | userPrincipalName}
Warning: * One application can only create up to 5 schema extensions. Keep that in mind! * Extension schema can be deleted only if the status is not set to "Available". (InDevelopment=>Available=>Deprecated)
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/user-update?view=graph-rest-1.0&tabs=http
func (*UsersService) UpdateUser ¶
Update the properties of a user object. Not all properties can be updated by Member or Guest users with their default permissions without Administrator roles. Compare member and guest default permissions to see properties they can manage.
PATCH /users/{id | userPrincipalName}
MS Graph API doc: https://docs.microsoft.com/en-us/graph/api/user-update?view=graph-rest-1.0&tabs=http