Show / Hide Table of Contents

Interface IOrgService

Manages Roster organizations.

Namespace: Microsoft.GNS.Roster.Service
Assembly: Microsoft.GNS.Roster.Service.dll
Syntax
public interface IOrgService

Methods

View Source

CreateOrgAsync(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
System.String name

The org name.

System.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.

View Source

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.

View Source

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.

View Source

GetOrgByIdAsync(Guid, AccessLevel, Boolean)

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.

System.Boolean throwIfNotFound

If true throws an EntityNotFoundException if the org does not exist. If false will return .

Returns
Type Description
Task<IRosterOrg>

An object that represents an org in Roster.

View Source

GetOrgByNameAsync(String, AccessLevel, Boolean)

Get an org by name.

Declaration
Task<IRosterOrg> GetOrgByNameAsync(string orgName, AccessLevel accessLevel = AccessLevel.Admin, bool throwIfNotFound = false)
Parameters
Type Name Description
System.String orgName

The name of the org.

AccessLevel accessLevel

The level of access for the current user in which to check for.

System.Boolean throwIfNotFound

If true throws an EntityNotFoundException if the org does not exist. If false will return .

Returns
Type Description
Task<IRosterOrg>

An object that represents an org in Roster.

View Source

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<System.Boolean>
View Source

SearchOrgsByNameAsync(String, Boolean, Int32)

Searches orgs by name.

Declaration
IAsyncEnumerable<IRosterOrg> SearchOrgsByNameAsync(string name, bool caseSensitive = false, int take = 0)
Parameters
Type Name Description
System.String name

The name to search for.

System.Boolean caseSensitive

True for a case sensitive search. Otherwise, false.

System.Int32 take

The number of items to take. Default of 0 returns all results.

Returns
Type Description
IAsyncEnumerable<IRosterOrg>

An enumerable list of Roster orgs.

View Source

SetOrgAdminsAsync(IRosterOrg, Nullable<IEnumerable<IRosterPrincipal>>, Nullable<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.

System.Nullable<IEnumerable<IRosterPrincipal>> adminsToAdd

An optional enumerable list of admins to add.

System.Nullable<IEnumerable<IRosterPrincipal>> adminsToRemove

An optional enumerable list of admins to remove.

Returns
Type Description
Task

A task representing the work to set org admins.

View Source

SetOrgMembersAsync(IRosterOrg, Nullable<IEnumerable<IRosterPrincipal>>, Nullable<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.

System.Nullable<IEnumerable<IRosterPrincipal>> membersToAdd

An optional enumerable list of members to add.

System.Nullable<IEnumerable<IRosterPrincipal>> membersToRemove

An optional enumerable list of members to remove.

Returns
Type Description
Task

A task representing the work to set org members.

View Source

SetOrgRolesAsync(IRosterOrg, Nullable<IEnumerable<IRosterRole>>, Nullable<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.

System.Nullable<IEnumerable<IRosterRole>> rolesToAdd

An optional enumerable list of roles to add.

System.Nullable<IEnumerable<IRosterRole>> rolesToRemove

An optional enumerable list of roles to remove.

Returns
Type Description
Task

A task representing the work to set org roles.

View Source

SetOrgToolsAsync(IRosterOrg, Nullable<IEnumerable<IRosterTool>>, Nullable<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.

System.Nullable<IEnumerable<IRosterTool>> toolsToAdd

An optional enumerable list of tools to add.

System.Nullable<IEnumerable<IRosterTool>> toolsToRemove

An optional enumerable list of tools to remove.

Returns
Type Description
Task

A task representing the work to set org tools.

View Source

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.

  • View Source
In This Article
Back to top Generated by DocFX