Skip to content

Commit

Permalink
Minor code fixes (#8)
Browse files Browse the repository at this point in the history
* Change endpoint name

* Change names and comments

* Comment changes

* Change samples names

* Correct spaces

* Correct spaces
  • Loading branch information
annasojkapal authored Jan 13, 2023
1 parent 64ff45c commit a4cb3a8
Show file tree
Hide file tree
Showing 33 changed files with 61 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static class RelativityImportEndpoints

public static string GetImportSourceProgressUri(int workspaceId, Guid importId, Guid sourceId) => $"api/import-service/v1/workspaces/{workspaceId}/import-jobs/{importId}/sources/{sourceId}/progress";

public static string GetImportSourcesItemErrorsUri(int workspaceId, Guid importId, Guid sourceId, int start, int length) => $"api/import-service/v1/workspaces/{workspaceId}/import-jobs/{importId}/sources/{sourceId}/itemerrors?start={start}&length={length}";
public static string GetImportSourceItemErrorsUri(int workspaceId, Guid importId, Guid sourceId, int start, int length) => $"api/import-service/v1/workspaces/{workspaceId}/import-jobs/{importId}/sources/{sourceId}/itemerrors?start={start}&length={length}";

}
}
6 changes: 3 additions & 3 deletions Samples/.Net7ClientConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ private static void Main(string[] args)

// await sampleCollection.Sample06_ImportDocumentsToSelectedFolder();

// await sampleCollection.Sample07_ImportDocumentSettingsForNatives();
// await sampleCollection.Sample07_DirectImportSettingsForDocuments();

// await sampleCollection.Sample08_ImportImages();

// await sampleCollection.Sample09_ImportProductionFiles();

// await sampleCollection.Sample10_ImportImagesInAppendOverlayMode();

//await sampleCollection.Sample11_ImportDocumentSettingsForImages();
//await sampleCollection.Sample11_DirectImportSettingsForImages();

// await sampleCollection.Sample12_ImportRelativityDynamicObject();

// await sampleCollection.Sample13_ImportRdoWithParent();

// await sampleCollection.Sample14_ImportRdoSettings();
// await sampleCollection.Sample14_DirectImportSettingsForRdo();

// await sampleCollection.Sample15_ReadImportRdoSettings();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="Sample07_ImportDocumentSettingsForNatives.cs" company="Relativity ODA LLC">
// <copyright file="Sample07_DirectImportSettingsForDocuments.cs" company="Relativity ODA LLC">
// © Relativity All Rights Reserved.
// </copyright>

Expand Down Expand Up @@ -26,9 +26,9 @@ public partial class ImportServiceSample
/// Settings dedicated for image import.
/// </summary>
/// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
public async Task Sample07_ImportDocumentSettingsForNatives()
public async Task Sample07_DirectImportSettingsForDocuments()
{
Console.WriteLine($"Running {nameof(Sample07_ImportDocumentSettingsForNatives)}");
Console.WriteLine($"Running {nameof(Sample07_DirectImportSettingsForDocuments)}");

// GUID identifiers for import job and data source.
Guid importId = Guid.NewGuid();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="Sample11_ImportDocumentSettingsForImages.cs" company="Relativity ODA LLC">
// <copyright file="Sample11_DirectImportSettingsForImages.cs" company="Relativity ODA LLC">
// © Relativity All Rights Reserved.
// </copyright>

Expand All @@ -25,9 +25,9 @@ public partial class ImportServiceSample
/// Example of creating ImportDocumentSettings for image import manually - without using ImportDocumentSettingsBuilder.
/// </summary>
/// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
public async Task Sample11_ImportDocumentSettingsForImages()
public async Task Sample11_DirectImportSettingsForImages()
{
Console.WriteLine($"Running {nameof(Sample11_ImportDocumentSettingsForImages)}");
Console.WriteLine($"Running {nameof(Sample11_DirectImportSettingsForImages)}");

// GUID identifiers for import job and data source.
Guid importId = Guid.NewGuid();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="Sample14_ImportRdoSettings.cs" company="Relativity ODA LLC">
// <copyright file="Sample14_DirectImportSettingsForRdo.cs" company="Relativity ODA LLC">
// © Relativity All Rights Reserved.
// </copyright>

Expand Down Expand Up @@ -26,9 +26,9 @@ public partial class ImportServiceSample
/// NOTE: Existing RDO "Domain" is used in this example. Please insert documents from sample01 first.
/// </summary>
/// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
public async Task Sample14_ImportRdoSettings()
public async Task Sample14_DirectImportSettingsForRdo()
{
Console.WriteLine($"Running {nameof(Sample14_ImportRdoSettings)}");
Console.WriteLine($"Running {nameof(Sample14_DirectImportSettingsForRdo)}");

// GUID identifiers for import job and data source.
Guid importId = Guid.NewGuid();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ await ImportJobSampleHelper.WaitImportJobToBeFinished(

// Get Item Errors for each source.
// GET import-jobs/{importId}/sources/{sourceId}/itemerrors?{start}&{length}"
var getItemErrorUrl = RelativityImportEndpoints.GetImportSourcesItemErrorsUri(workspaceId, importId, sourceId,0 , 20);
var getItemErrorUrl = RelativityImportEndpoints.GetImportSourceItemErrorsUri(workspaceId, importId, sourceId,0 , 20);
ValueResponse<ImportErrors>? valueResponseErrors = await httpClient.GetFromJsonAsync<ValueResponse<ImportErrors>>(getItemErrorUrl);

if (valueResponseErrors is {IsSuccess: true})
Expand Down
6 changes: 3 additions & 3 deletions Samples/KeplerClientConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ private static void Main(string[] args)

// await sampleCollection.Sample06_ImportDocumentsToSelectedFolder();

// await sampleCollection.Sample07_ImportDocumentSettingsForNatives();
// await sampleCollection.Sample07_DirectImportSettingsForDocuments();

// await sampleCollection.Sample08_ImportImages();

// await sampleCollection.Sample09_ImportProductionFiles();

// await sampleCollection.Sample10_ImportImagesInAppendOverlayMode();

// await sampleCollection.Sample11_ImportDocumentSettingsForImages();
// await sampleCollection.Sample11_DirectImportSettingsForImages();

// await sampleCollection.Sample12_ImportRelativityDynamicObject();

// await sampleCollection.Sample13_ImportRdoWithParent();

// await sampleCollection.Sample14_ImportRdoSettings();
// await sampleCollection.Sample14_DirectImportSettingsForRdo();

// await sampleCollection.Sample15_ReadImportRdoSettings();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="Sample07_ImportDocumentSettingsForNatives.cs" company="Relativity ODA LLC">
// <copyright file="Sample07_DirectImportSettingsForDocuments.cs" company="Relativity ODA LLC">
// © Relativity All Rights Reserved.
// </copyright>

Expand All @@ -21,9 +21,9 @@ public partial class ImportServiceSample
/// Settings to be used to import images.
/// </summary>
/// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
public async Task Sample07_ImportDocumentSettingsForNatives()
public async Task Sample07_DirectImportSettingsForDocuments()
{
Console.WriteLine($"Running {nameof(Sample07_ImportDocumentSettingsForNatives)}");
Console.WriteLine($"Running {nameof(Sample07_DirectImportSettingsForDocuments)}");

// GUID identifiers for import job and data source.
Guid importId = Guid.NewGuid();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="Sample11_ImportDocumentSettingsForImages.cs" company="Relativity ODA LLC">
// <copyright file="Sample11_DirectImportSettingsForImages.cs" company="Relativity ODA LLC">
// © Relativity All Rights Reserved.
// </copyright>

Expand All @@ -21,9 +21,9 @@ public partial class ImportServiceSample
/// Example of creating ImportDocumentSettings for image import manually - without using ImportDocumentSettingsBuilder.
/// </summary>
/// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
public async Task Sample11_ImportDocumentSettingsForImages()
public async Task Sample11_DirectImportSettingsForImages()
{
Console.WriteLine($"Running {nameof(Sample11_ImportDocumentSettingsForImages)}");
Console.WriteLine($"Running {nameof(Sample11_DirectImportSettingsForImages)}");

// GUID identifiers for import job and data source.
Guid importId = Guid.NewGuid();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="Sample14_ImportRdoSettings.cs" company="Relativity ODA LLC">
// <copyright file="Sample14_DirectImportSettingsForRdo.cs" company="Relativity ODA LLC">
// © Relativity All Rights Reserved.
// </copyright>

Expand All @@ -21,9 +21,9 @@ public partial class ImportServiceSample
/// NOTE: Existing RDO "Domain" is used in this example. Please insert documents from sample01 first.
/// </summary>
/// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
public async Task Sample14_ImportRdoSettings()
public async Task Sample14_DirectImportSettingsForRdo()
{
Console.WriteLine($"Running {nameof(Sample14_ImportRdoSettings)}");
Console.WriteLine($"Running {nameof(Sample14_DirectImportSettingsForRdo)}");

// GUID identifiers for import job and data source.
Guid importId = Guid.NewGuid();
Expand Down
4 changes: 2 additions & 2 deletions Samples/RestSamples/Helpers/EndpointsClass.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Endpoints {
return $this.baseAddress + "/import-jobs/$importId/sources"
}

[String] importSourceUri($importId, $sourceId){
[String] importSourceAddUri($importId, $sourceId){
return $this.baseAddress + "/import-jobs/$importId/sources/$sourceId"
}

Expand All @@ -53,7 +53,7 @@ class Endpoints {
return $this.baseAddress + "/import-jobs/$importId/sources/$sourceId/progress"
}

[String] importSourcesItemErrorsUri($importId, $sourceId){
[String] importSourceItemErrorsUri($importId, $sourceId){
return $this.baseAddress + "/import-jobs/$importId/sources/$sourceId/itemerrors"
}

Expand Down
2 changes: 1 addition & 1 deletion Samples/RestSamples/Helpers/WriteInformationClass.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class WriteInformation {
Write-Information -MessageData "Data source failed due to errors: $jobLevelErrors" -InformationAction Continue
}
elseif ($state -eq "CompletedWithItemErrors") {
$itemErrorsUri = $global:Endpoints.importSourcesItemErrorsUri($importId, $sourceId)
$itemErrorsUri = $global:Endpoints.importSourceItemErrorsUri($importId, $sourceId)
$sourceItemErrorsResponse = $global:WebRequest.callGet($itemErrorsUri)
$errors = $sourceItemErrorsResponse."Value"."Errors" | ConvertTo-Json -Depth 10
Write-Information -MessageData "Data source item errors: $errors" -InformationAction Continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Context "Sample01 Import native files" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
path = $loadFilePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Context "Sample 02 Import documents in overlay mode" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
path = $loadFilePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Context "Sample03 Import from two data sources" {
}

Describe "Add Source 01" {
$uri = $global:Endpoints.importSourceUri($importId, $source01Id)
$uri = $global:Endpoints.importSourceAddUri($importId, $source01Id)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
path = $loadFile01Path
Expand All @@ -81,7 +81,7 @@ Context "Sample03 Import from two data sources" {
}

Describe "Add Source 02" {
$uri = $global:Endpoints.importSourceUri($importId, $source02Id)
$uri = $global:Endpoints.importSourceAddUri($importId, $source02Id)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
path = $loadFile02Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Context "Sample04 Add data source to running import job" {
}

Describe "Add Source 01" {
$uri = $global:Endpoints.importSourceUri($importId, $source01Id)
$uri = $global:Endpoints.importSourceAddUri($importId, $source01Id)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
path = $loadFile01Path
Expand Down Expand Up @@ -90,7 +90,7 @@ Context "Sample04 Add data source to running import job" {
}

Describe "Add Source 02" {
$uri = $global:Endpoints.importSourceUri($importId, $source02Id)
$uri = $global:Endpoints.importSourceAddUri($importId, $source02Id)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
path = $loadFile02Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Context "Sample05 Import documents with extracted text" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
path = $loadFilePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Context "Sample06 Import documents to selected folder" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)

$loadFilePath = $loadFilePath.replace('\','\\')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $sourceId = New-Guid
$global:Endpoints = [Endpoints]::new($workspaceId)
$global:WriteInformation = [WriteInformation]::new()

Context "Sample07 Import document settings for natives" {
Context "Sample07 Direct import settings for documents" {
Describe "Create job" {
$uri = $global:Endpoints.importJobCreateUri($importId)

Expand Down Expand Up @@ -86,7 +86,7 @@ Context "Sample07 Import document settings for natives" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
path = $loadFilePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Context "Sample08 Import images" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
Path = $opticonFilePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Context "Sample09 Import production files" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
Path = $opticonFilePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Context "Sample10 Import images in append overlay mode" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
Path = $opticonFilePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $sourceId = New-Guid
$global:Endpoints = [Endpoints]::new($workspaceId)
$global:WriteInformation = [WriteInformation]::new()

Context "Sample11 Import document settings for images" {
Context "Sample11 Direct import settings for images" {
Describe "Create job" {
$uri = $global:Endpoints.importJobCreateUri($importId)

Expand Down Expand Up @@ -57,7 +57,7 @@ Context "Sample11 Import document settings for images" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
Path = $opticonFilePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Context "Sample12 Import relativity dynamic object" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)

$loadFilePath = $loadFilePath.replace('\','\\')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Context "Sample13 Import RDO with parent" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)

$loadFilePath = $loadFilePath.replace('\','\\')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $global:WriteInformation = [WriteInformation]::new()

# Example of import Relativity Dynamic Object (RDO).
# NOTE: Existing RDO "Domain" is used in this example. Please insert documents from sample01 first.
Context "Sample14 Import RDO settings" {
Context "Sample14 Direct import settings for RDO" {
Describe "Create job" {
$uri = $global:Endpoints.importJobCreateUri($importId)

Expand Down Expand Up @@ -80,7 +80,7 @@ Context "Sample14 Import RDO settings" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
path = $loadFilePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Context "Sample18 Read Data sources for Import Job" {
Describe "Add n data sources to the existing job." {
for ($i = 0; $i -lt $sourcesCount; $i++) {
$sourceId = New-Guid
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
path = $loadFilePath + $i
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Context "Sample19 Get import job progress" {
}

Describe "Add Source" {
$uri = $global:Endpoints.importSourceUri($importId, $sourceId)
$uri = $global:Endpoints.importSourceAddUri($importId, $sourceId)
$dataSourceConfigurationBody = @{
dataSourceSettings = @{
path = $loadFilePath
Expand Down
Loading

0 comments on commit a4cb3a8

Please sign in to comment.