Interface IWorkspaceService
Represents the workspace API service.
Namespace: Relativity.Testing.Framework.Api.Services
Assembly: Relativity.Testing.Framework.Api.dll
Syntax
public interface IWorkspaceService
Examples
_workspaceService = relativityFacade.Resolve<IWorkspaceService>();
Methods
| Improve this Doc View SourceCreate(Workspace)
Creates the specified Workspace. If properties are not specified in the entity, the first value found for each property will be used. It is the responsibility of the user writing/running the tests to ensure that they are adhering to all environment related best practices and rules.
Declaration
Workspace Create(Workspace entity)
Parameters
Type | Name | Description |
---|---|---|
Workspace | entity | The entity to create. |
Returns
Type | Description |
---|---|
Workspace | The created entity. |
Examples
Create any old workspace.
Workspace workspace = _workspaceService.Create(Workspace());
Create a workspace with specific properties.
Client client = new Client
{
Name = "MI6"
};
client = _clientService.Create(client);
Matter matter = new Matter
{
Name = "Moonraker",
Client = client
};
matter = _matterService.Create(matter);
Workspace topSecretWorkspace = new Workspace
{
Name = "Top Secret [Don't Delete] [Don't Look Inside] [Don't Even Read This]",
Client = client,
Matter = matter
};
topSecretWorkspace = _workspaceService.Create(workspace);
Create a workspace that uses a specific base template.
Workspace workspace = new Workspace
{
Name = "MyNewWorkspace",
TemplateWorkspace = new Workspace { Name = "MyOldWorkspace" }
};
Workspace workspace = _workspaceService.Create(workspace);
Create a workspace that is compliant with the configuration of the Regression environments (at least as of 2021/08/05).
Note that the dependent artifacts are assumed to exist on the Regression enviornments. If they do not exist, the environment is probably not intended/ready to be tested against.
string applicationName = "YourApplicationNameHere";
Client aeroClient = _clientService.Get("Aero CI/CD");
Matter aeroMatter = _matterService.Get($"{applicationName} CI/CD", aeroClient.ArtifactID);
Group aeroGroup = _groupService.Get($"{applicationName} CI/CD");
Workspace templateWorkspace = new Workspace { Name = "Base Template" };
ResourcePool aeroResourcePool = _objectService.GetAll<ResourcePool>().Where(x => x.Name == "RelativityOne Pool").First();
Workspace workspace = new Workspace
{
Name = $"{applicationName} - Aero CD",
Client = client,
Matter = matter,
Status = "Active",
TemplateWorkspace = templateWorkspace,
WorkspaceAdminGroup = adminGroup,
ResourcePool = resourcePool,
SqlServer = resourcePool.SqlServers.First(),
DefaultCacheLocation = resourcePool.CacheLocationServers.First(),
DefaultFileRepository = resourcePool.FileRepositories.First(),
DownloadHandlerUrl = "Relativity.Distributed"
};
Workspace workspace = _workspaceService.Create(workspace);
| Improve this Doc View Source
CreateWithDocs(Workspace, Int32)
Creates the specified Workspace with generated documents. If properties are not specified in the entity, the first value found for each property will be used. It is the responsibility of the user writing/running the tests to ensure that they are adhering to all environment related best practices and rules.
Declaration
Workspace CreateWithDocs(Workspace entity, int numberOfDocuments = 10)
Parameters
Type | Name | Description |
---|---|---|
Workspace | entity | The entity to create. |
System.Int32 | numberOfDocuments | Number of documents to create. |
Returns
Type | Description |
---|---|
Workspace | The created entity. |
Examples
Workspace workspace = _workspaceService.CreateWithDocs(Workspace(), 100);
|
Improve this Doc
View Source
Delete(Int32)
Delete the Workspace by ArtifactID.
Declaration
void Delete(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The ArtifactID of the workspace to delete. |
Examples
_workspaceService.Delete(1234567);
|
Improve this Doc
View Source
Exists(Int32)
Determines whether the Workspace with the specified ArtifactID exists.
Declaration
bool Exists(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The ArtifactID of the workspace to check the existence of. |
Returns
Type | Description |
---|---|
System.Boolean | true if the workspace exists, otherwise false. |
Examples
bool workspaceExists = _workspaceService.Exists(1234567);
|
Improve this Doc
View Source
Get(Int32)
Gets the Workspace by ArtifactID.
Declaration
Workspace Get(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The ArtifactID of the workspace to get. |
Returns
Type | Description |
---|---|
Workspace | The Workspace if it exists, otherwise null. |
Examples
Workspace workspace = _workspaceService.Get(1234567);
|
Improve this Doc
View Source
Get(String)
Gets the Workspace by the specified name.
Declaration
Workspace Get(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the workspace to get. |
Returns
Type | Description |
---|---|
Workspace | The Workspace if it exists, otherwise null. |
Examples
Workspace lowSecretWorkspace = _workspaceService.Get("Low Secret[Feel Free To Look Inside] [But Still Don't Delete]");
|
Improve this Doc
View Source
GetAll()
Get all Workspaces in the environment.
Declaration
Workspace[] GetAll()
Returns
Type | Description |
---|---|
Workspace[] | An array of Workspaces. |
Examples
Workspace[] workspace = _workspaceService.GetAll();
|
Improve this Doc
View Source
GetAllByClientName(String)
Gets all Workspaces that are associated with the specified client.
Declaration
IEnumerable<Workspace> GetAllByClientName(string clientName)
Parameters
Type | Name | Description |
---|---|---|
System.String | clientName | The client name. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Workspace> | The collection of Workspace entities. |
Examples
List<Workspace> workspace = _workspaceService.GetAllByClientName(existingClientName).ToList();
|
Improve this Doc
View Source
Update(Workspace)
Updates the specified Workspace.
Declaration
void Update(Workspace entity)
Parameters
Type | Name | Description |
---|---|---|
Workspace | entity | The workspace to update. |
Examples
int workspaceId = 1234;
Workspace workspace = _workspaceService.Get(workspaceId);
workspace.Name = "updatedName";
_workspaceService.Update(workspace);