Interface IProjectService
Manages Roster projects.
Namespace: Microsoft.GNS.Roster.Service
Assembly: Microsoft.GNS.Roster.Service.dll
Syntax
public interface IProjectService
Methods
View SourceCreateProjectAsync(String, String, Scope, IEnumerable<IRosterPrincipal>, Nullable<IEnumerable<IRosterPrincipal>>)
Creates a Roster project.
Declaration
Task<IRosterProject> CreateProjectAsync(string name, string description, Scope scope, IEnumerable<IRosterPrincipal> projectAdmins, IEnumerable<IRosterPrincipal>? projectMembers = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The project name. |
System.String | description | The project description. |
Scope | scope | The Roster scope. |
IEnumerable<IRosterPrincipal> | projectAdmins | The project admin(s). |
System.Nullable<IEnumerable<IRosterPrincipal>> | projectMembers | The project members(s). |
Returns
Type | Description |
---|---|
Task<IRosterProject> | An object representing the Roster project. |
DeleteProjectAsync(IRosterProject)
Deletes a Roster project.
Declaration
Task DeleteProjectAsync(IRosterProject project)
Parameters
Type | Name | Description |
---|---|---|
IRosterProject | project | The project to delete. |
Returns
Type | Description |
---|---|
Task | A task representing the work to delete the project. |
GetAllProjectsAsync(Scope)
Gets all projects the current user has access to for a given scope.
Declaration
IAsyncEnumerable<IRosterProject> GetAllProjectsAsync(Scope scope)
Parameters
Type | Name | Description |
---|---|---|
Scope | scope | The project scope. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IRosterProject> | An enumeration of all projects the given principal has access to. |
GetProjectByIdAsync(Guid, AccessLevel, Boolean)
Gets a project by Id.
Declaration
Task<IRosterProject> GetProjectByIdAsync(Guid id, AccessLevel accessLevel = AccessLevel.Admin, bool throwIfNotFound = false)
Parameters
Type | Name | Description |
---|---|---|
Guid | id | The Id of the project. |
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 project does not exist. If false will return |
Returns
Type | Description |
---|---|
Task<IRosterProject> | An object that represents an project in Roster. |
GetProjectByNameAsync(String, Scope, AccessLevel, Boolean)
Gets a project by name.
Declaration
Task<IRosterProject> GetProjectByNameAsync(string name, Scope scope, AccessLevel accessLevel = AccessLevel.Admin, bool throwIfNotFound = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the project. |
Scope | scope | The project scope. |
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 project does not exist. If false will return |
Returns
Type | Description |
---|---|
Task<IRosterProject> | An object that represents an project in Roster. |
IsCurrentUserProjectAdminAsync(IRosterProject)
Checks if a principal is a project admin.
Declaration
Task<bool> IsCurrentUserProjectAdminAsync(IRosterProject project)
Parameters
Type | Name | Description |
---|---|---|
IRosterProject | project |
Returns
Type | Description |
---|---|
Task<System.Boolean> |
SearchProjectsByNameAsync(String, Scope, Boolean, Int32)
Searches projects by name.
Declaration
IAsyncEnumerable<IRosterProject> SearchProjectsByNameAsync(string name, Scope scope, bool caseSensitive = false, int take = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name to search for. |
Scope | scope | The Roster scope. |
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<IRosterProject> | An enumerable list of Roster projects. |
SetProjectAdminsAsync(IRosterProject, Nullable<IEnumerable<IRosterPrincipal>>, Nullable<IEnumerable<IRosterPrincipal>>)
Sets admins in a project.
Declaration
Task SetProjectAdminsAsync(IRosterProject project, IEnumerable<IRosterPrincipal>? adminsToAdd = null, IEnumerable<IRosterPrincipal>? adminsToRemove = null)
Parameters
Type | Name | Description |
---|---|---|
IRosterProject | project | The project 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 project admins. |
SetProjectMembersAsync(IRosterProject, Nullable<IEnumerable<IRosterPrincipal>>, Nullable<IEnumerable<IRosterPrincipal>>)
Sets members in a project.
Declaration
Task SetProjectMembersAsync(IRosterProject project, IEnumerable<IRosterPrincipal>? membersToAdd = null, IEnumerable<IRosterPrincipal>? membersToRemove = null)
Parameters
Type | Name | Description |
---|---|---|
IRosterProject | project | The project 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 project members. |
SetProjectRolesAsync(IRosterProject, Nullable<IEnumerable<IRosterRole>>, Nullable<IEnumerable<IRosterRole>>)
Sets roles in a project.
Declaration
Task SetProjectRolesAsync(IRosterProject project, IEnumerable<IRosterRole>? rolesToAdd = null, IEnumerable<IRosterRole>? rolesToRemove = null)
Parameters
Type | Name | Description |
---|---|---|
IRosterProject | project | The project 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 project roles. |
SetProjectToolsAsync(IRosterProject, Nullable<IEnumerable<IRosterTool>>, Nullable<IEnumerable<IRosterTool>>)
Sets tools in a project.
Declaration
Task SetProjectToolsAsync(IRosterProject project, IEnumerable<IRosterTool>? toolsToAdd = null, IEnumerable<IRosterTool>? toolsToRemove = null)
Parameters
Type | Name | Description |
---|---|---|
IRosterProject | project | The project 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 project tools. |
UpdateProjectAsync(IRosterProject)
Updates a project.
Declaration
Task<IRosterProject> UpdateProjectAsync(IRosterProject project)
Parameters
Type | Name | Description |
---|---|---|
IRosterProject | project | The project to update. |
Returns
Type | Description |
---|---|
Task<IRosterProject> | The updated project object. |