beta

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	core.BaseClient

	//Users                  *UsersService
	Groups         *GroupsService
	DirectoryRoles *DirectoryRolesService
	// contains filtered or unexported fields
}

A Client manages communication with the MS Graph API.

func NewClient

func NewClient(httpClient *http.Client) *Client

type DirectoryRoleResponse

type DirectoryRoleResponse struct {
	models.OData
	models.DirectoryRole
}

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

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 GroupListOptions struct {
	Filter string `url:"$filter,omitempty"`
	Select string `url:"$select,omitempty"`
	Top    int    `url:"$top,omitempty"`
}

type GroupResponse

type GroupResponse struct {
	models.OData
	models.Group
}

type GroupsResponse

type GroupsResponse struct {
	models.OData
	Groups []*models.Group `json:"value"`
}

type GroupsService

type GroupsService service

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

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

func (s *GroupsService) UpdateGroup(ctx context.Context, r *models.Group) error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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