Interface IOrgService
Manages Roster organizations.
Namespace: Microsoft.GNS.Roster.Service
Assembly: Microsoft.GNS.Roster.Service.dll
Syntax
public interface IOrgService
Methods
View SourceCreateOrgAsync(string, string, IEnumerable<IRosterPrincipal>, IEnumerable<IRosterPrincipal>)
Creates an org.
Declaration
Task<IRosterOrg> CreateOrgAsync(string name, string description, IEnumerable<IRosterPrincipal> orgAdmins, IEnumerable<IRosterPrincipal> orgMembers)
Parameters
Type | Name | Description |
---|---|---|
string | name | The org name. |
string | description | The org description. |
IEnumerable<IRosterPrincipal> | orgAdmins | The org admin(s). |
IEnumerable<IRosterPrincipal> | orgMembers | The org members(s). |
Returns
Type | Description |
---|---|
Task<IRosterOrg> | An object representing the Roster org. |
DeleteOrgAsync(IRosterOrg)
Deletes an org.
Declaration
Task DeleteOrgAsync(IRosterOrg org)
Parameters
Type | Name | Description |
---|---|---|
IRosterOrg | org | The org to delete. |
Returns
Type | Description |
---|---|
Task | A task representing the work to delete the org. |
GetAllOrgsAsync()
Gets all orgs a the current user has access to.
Declaration
IAsyncEnumerable<IRosterOrg> GetAllOrgsAsync()
Returns
Type | Description |
---|---|
IAsyncEnumerable<IRosterOrg> | An enumeration of all orgs the given principal has access to. |
GetOrgByIdAsync(Guid, AccessLevel, bool)
Get an org by Id.
Declaration
Task<IRosterOrg> GetOrgByIdAsync(Guid id, AccessLevel accessLevel = AccessLevel.Admin, bool throwIfNotFound = false)
Parameters
Type | Name | Description |
---|---|---|
Guid | id | The Id of the org. |
AccessLevel | accessLevel | The level of access for the current user in which to check for. |
bool | throwIfNotFound | If true throws an EntityNotFoundException if the org does not exist. If false will return Microsoft.GNS.Roster.Internal.RosterOrg.Empty. |
Returns
Type | Description |
---|---|
Task<IRosterOrg> | An object that represents an org in Roster. |
GetOrgByNameAsync(string, AccessLevel, bool)
Get an org by name.
Declaration
Task<IRosterOrg> GetOrgByNameAsync(string orgName, AccessLevel accessLevel = AccessLevel.Admin, bool throwIfNotFound = false)
Parameters
Type | Name | Description |
---|---|---|
string | orgName | The name of the org. |
AccessLevel | accessLevel | The level of access for the current user in which to check for. |
bool | throwIfNotFound | If true throws an EntityNotFoundException if the org does not exist. If false will return Microsoft.GNS.Roster.Internal.RosterOrg.Empty. |
Returns
Type | Description |
---|---|
Task<IRosterOrg> | An object that represents an org in Roster. |
IsCurrentUserOrgAdminAsync(IRosterOrg)
Checks if a principal is an org admin.
Declaration
Task<bool> IsCurrentUserOrgAdminAsync(IRosterOrg org)
Parameters
Type | Name | Description |
---|---|---|
IRosterOrg | org |
Returns
Type | Description |
---|---|
Task<bool> |
SearchOrgsByNameAsync(string, bool, int)
Searches orgs by name.
Declaration
IAsyncEnumerable<IRosterOrg> SearchOrgsByNameAsync(string name, bool caseSensitive = false, int take = 0)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name to search for. |
bool | caseSensitive | True for a case sensitive search. Otherwise, false. |
int | take | The number of items to take. Default of 0 returns all results. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IRosterOrg> | An enumerable list of Roster orgs. |
SetOrgAdminsAsync(IRosterOrg, IEnumerable<IRosterPrincipal>?, IEnumerable<IRosterPrincipal>?)
Sets admins in an org.
Declaration
Task SetOrgAdminsAsync(IRosterOrg org, IEnumerable<IRosterPrincipal>? adminsToAdd = null, IEnumerable<IRosterPrincipal>? adminsToRemove = null)
Parameters
Type | Name | Description |
---|---|---|
IRosterOrg | org | The org in which to modify admins. |
IEnumerable<IRosterPrincipal> | adminsToAdd | An optional enumerable list of admins to add. |
IEnumerable<IRosterPrincipal> | adminsToRemove | An optional enumerable list of admins to remove. |
Returns
Type | Description |
---|---|
Task | A task representing the work to set org admins. |
SetOrgMembersAsync(IRosterOrg, IEnumerable<IRosterPrincipal>?, IEnumerable<IRosterPrincipal>?)
Sets members of an org.
Declaration
Task SetOrgMembersAsync(IRosterOrg org, IEnumerable<IRosterPrincipal>? membersToAdd = null, IEnumerable<IRosterPrincipal>? membersToRemove = null)
Parameters
Type | Name | Description |
---|---|---|
IRosterOrg | org | The org in which to modify members. |
IEnumerable<IRosterPrincipal> | membersToAdd | An optional enumerable list of members to add. |
IEnumerable<IRosterPrincipal> | membersToRemove | An optional enumerable list of members to remove. |
Returns
Type | Description |
---|---|
Task | A task representing the work to set org members. |
SetOrgRolesAsync(IRosterOrg, IEnumerable<IRosterRole>?, IEnumerable<IRosterRole>?)
Sets roles in an org.
Declaration
Task SetOrgRolesAsync(IRosterOrg org, IEnumerable<IRosterRole>? rolesToAdd = null, IEnumerable<IRosterRole>? rolesToRemove = null)
Parameters
Type | Name | Description |
---|---|---|
IRosterOrg | org | The org in which to modify roles. |
IEnumerable<IRosterRole> | rolesToAdd | An optional enumerable list of roles to add. |
IEnumerable<IRosterRole> | rolesToRemove | An optional enumerable list of roles to remove. |
Returns
Type | Description |
---|---|
Task | A task representing the work to set org roles. |
SetOrgToolsAsync(IRosterOrg, IEnumerable<IRosterTool>?, IEnumerable<IRosterTool>?)
Sets tools in an org.
Declaration
Task SetOrgToolsAsync(IRosterOrg org, IEnumerable<IRosterTool>? toolsToAdd = null, IEnumerable<IRosterTool>? toolsToRemove = null)
Parameters
Type | Name | Description |
---|---|---|
IRosterOrg | org | The org in which to modify tools. |
IEnumerable<IRosterTool> | toolsToAdd | An optional enumerable list of tools to add. |
IEnumerable<IRosterTool> | toolsToRemove | An optional enumerable list of tools to remove. |
Returns
Type | Description |
---|---|
Task | A task representing the work to set org tools. |
UpdateOrgAsync(IRosterOrg)
Updates an org.
Declaration
Task<IRosterOrg> UpdateOrgAsync(IRosterOrg org)
Parameters
Type | Name | Description |
---|---|---|
IRosterOrg | org | The org to update. |
Returns
Type | Description |
---|---|
Task<IRosterOrg> | The updated org object. |