Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
2f11bab
Regenerated with customization-options typespec
Nov 2, 2024
0871c0a
Fixes + pagedDocumentDetails
Nov 5, 2024
eb8e384
Revert pagedDocumentDetails
Nov 5, 2024
00e0916
nextLink in DocumentDetails
Nov 5, 2024
8c110d1
DocumentDetail
Nov 5, 2024
82f194c
Regenerated with no continuationToken
Nov 5, 2024
f37ca92
OperationType
Nov 5, 2024
6937f98
CustomizationOptions and suppression
Nov 6, 2024
06ba6c0
Change Config to Options
Nov 6, 2024
f75627b
Regenerated after marking ListJobs and ListJobDocuments as internal
Nov 7, 2024
4c64491
Customizations to remove continuationToken
Nov 7, 2024
f305ca1
Update tests and samples for new API version
Nov 9, 2024
57c60a4
Samples
Nov 9, 2024
ef59807
Updating tests for new API version
Nov 12, 2024
5067ed6
Enable local testing
Nov 12, 2024
b7380a8
Add sanitizers
Nov 13, 2024
199f464
Update tests and sanitizers
Nov 13, 2024
e8e9985
Rename "body" to "content"
Nov 14, 2024
623f9ff
Merge branch 'main' into healthdataaiservices/stable
alexathomases Nov 14, 2024
eb6753c
Tests working in all modes
Nov 14, 2024
e490678
Merge branch 'healthdataaiservices/stable' of https://github.com/alex…
Nov 14, 2024
134976c
Update commit in tsp-location.yaml
Nov 15, 2024
bf8e765
Updated serialization with dotnet build codegen
Nov 15, 2024
7ba7c42
Version 1.0.0
Nov 15, 2024
e52e6f5
GA installation instructions
Nov 15, 2024
d7e9a30
Use Deidentification prefix naming convention
Nov 15, 2024
62e2a71
Update tsp-location.yaml commit
Nov 15, 2024
ac4e2ca
Updates tests and samples with new prefix
Nov 15, 2024
142c9b1
Ran dotnet build /t:GenerateCode
Nov 16, 2024
8152401
Deidentification prefix for CustomizationOptions
Nov 18, 2024
0131961
Update tsp-location.yaml
Nov 18, 2024
61d91cb
Improve samples
Nov 20, 2024
9246bee
Update commit in tsp-location
Nov 20, 2024
07eaa32
Update commit again
Nov 20, 2024
7fb69d2
Update README sample
Nov 20, 2024
12f0438
Regenerated with customization-options typespec
Nov 2, 2024
f2c431d
Fixes + pagedDocumentDetails
Nov 5, 2024
8307736
Revert pagedDocumentDetails
Nov 5, 2024
e37663d
nextLink in DocumentDetails
Nov 5, 2024
d9eb65c
DocumentDetail
Nov 5, 2024
f33da6e
Regenerated with no continuationToken
Nov 5, 2024
7b8eb7d
OperationType
Nov 5, 2024
9785c66
CustomizationOptions and suppression
Nov 6, 2024
3515140
Change Config to Options
Nov 6, 2024
0538d3a
Regenerated after marking ListJobs and ListJobDocuments as internal
Nov 7, 2024
6fb16bb
Customizations to remove continuationToken
Nov 7, 2024
a222446
Update tests and samples for new API version
Nov 9, 2024
616cd32
Samples
Nov 9, 2024
3fe7be6
Updating tests for new API version
Nov 12, 2024
c5d3ce6
Enable local testing
Nov 12, 2024
a96760d
Add sanitizers
Nov 13, 2024
3f78d55
Update tests and sanitizers
Nov 13, 2024
116c7ee
Rename "body" to "content"
Nov 14, 2024
3d830f6
Tests working in all modes
Nov 14, 2024
4463ec7
Update commit in tsp-location.yaml
Nov 15, 2024
16394d2
Updated serialization with dotnet build codegen
Nov 15, 2024
7d3b8ac
Version 1.0.0
Nov 15, 2024
e75e82a
GA installation instructions
Nov 15, 2024
6d6ef8a
Use Deidentification prefix naming convention
Nov 15, 2024
58c00a4
Update tsp-location.yaml commit
Nov 15, 2024
242223e
Updates tests and samples with new prefix
Nov 15, 2024
d516e24
Ran dotnet build /t:GenerateCode
Nov 16, 2024
2f1413f
Deidentification prefix for CustomizationOptions
Nov 18, 2024
2051357
Update tsp-location.yaml
Nov 18, 2024
7fcdc72
Improve samples
Nov 20, 2024
ddb76f4
Update commit in tsp-location
Nov 20, 2024
b6f9d0b
Update commit again
Nov 20, 2024
123161d
Update README sample
Nov 20, 2024
e5c2553
Merge branch 'healthdataaiservices/stable' of https://github.com/alex…
Nov 20, 2024
1fe5b90
Export API
Nov 20, 2024
770c98d
Switch back to ResourceList
Nov 22, 2024
8ee84f1
Update commit hash
Nov 23, 2024
6f51847
New tests with overwrite
Nov 23, 2024
e0a0200
Use public setter for overwrite
Nov 24, 2024
21c4469
Regenerated after removing PartialFailed
Nov 26, 2024
272ed13
Rm DeidentificationJobStatus from tests
Nov 26, 2024
f999515
Regenerated with merged typespec
Dec 7, 2024
7999c11
Update changelog.md
Dec 8, 2024
ec2fd4c
Merge branch 'main' into healthdataaiservices/stable
alexathomases Jan 3, 2025
149ad78
Updating generated code
Jan 3, 2025
3d442bf
Update changelog
Jan 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updates tests and samples with new prefix
  • Loading branch information
Alexa Thomases committed Nov 20, 2024
commit 242223e7bc8f51a4135103740341f2ca986a364b
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DeidentificationClient client = new(
## Build Request and Call Function

```C# Snippet:AzHealthDeidSample1_CreateRequest
DeidentificationContent content = new("Hello, John!", OperationType.Surrogate, null, null);
DeidentificationContent content = new("Hello, John!", DeidentificationOperationType.Surrogate, null, null);

Response<DeidentificationResult> result = client.DeidentifyText(content);
string outputString = result.Value.OutputText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DeidentificationClient client = new(
## Build Request and Call Function

```C# Snippet:AzHealthDeidSample1Async_CreateRequest
DeidentificationContent content = new("Hello, John!", OperationType.Surrogate, null, null);
DeidentificationContent content = new("Hello, John!", DeidentificationOperationType.Surrogate, null, null);

Response<DeidentificationResult> result = await client.DeidentifyTextAsync(content);
string outputString = result.Value.OutputText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DeidentificationJob job = new()
{
SourceLocation = new SourceStorageLocation(new Uri(storageAccountUrl), "folder1/"),
TargetLocation = new TargetStorageLocation(new Uri(storageAccountUrl), "output_path"),
Operation = OperationType.Surrogate
Operation = DeidentificationOperationType.Surrogate
};

job = client.DeidentifyDocuments(WaitUntil.Started, "my-job-1", job).Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DeidentificationJob job = new()
{
SourceLocation = new SourceStorageLocation(new Uri(storageAccountUrl), "folder1/"),
TargetLocation = new TargetStorageLocation(new Uri(storageAccountUrl), "output_path"),
Operation = OperationType.Surrogate
Operation = DeidentificationOperationType.Surrogate
};

job = (await client.DeidentifyDocumentsAsync(WaitUntil.Completed, "my-job-1", job)).Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ This sample demonstrates how to list files that were completed by a job.
## List Completed Files and iterate over in a for loop

```C# Snippet:AzHealthDeidSample4_ListCompletedFiles
Pageable<DocumentDetails> files = client.GetJobDocuments("job-name-1");
Pageable<DeidentificationDocumentDetails> files = client.GetJobDocuments("job-name-1");

foreach (DocumentDetails file in files)
foreach (DeidentificationDocumentDetails file in files)
{
Console.WriteLine($"File Name: {file.Input.Location}");
Console.WriteLine($"File Status: {file.Status}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ This sample demonstrates how to list files that were completed by a job.
## List Completed Files and iterate over in a for loop

```C# Snippet:AzHealthDeidSample4Async_ListCompletedFiles
AsyncPageable<DocumentDetails> files = client.GetJobDocumentsAsync("job-name-1");
AsyncPageable<DeidentificationDocumentDetails> files = client.GetJobDocumentsAsync("job-name-1");

await foreach (DocumentDetails file in files)
await foreach (DeidentificationDocumentDetails file in files)
{
Console.WriteLine($"File Name: {file.Input.Location}");
Console.WriteLine($"File Status: {file.Status}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task CreateJobAsync_SucceedsWithExpectedFields()
{
SourceLocation = new SourceStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), inputPrefix),
TargetLocation = new TargetStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), OUTPUT_FOLDER),
Operation = OperationType.Surrogate
Operation = DeidentificationOperationType.Surrogate
};

job = (await client.DeidentifyDocumentsAsync(WaitUntil.Started, jobName, job)).Value;
Expand All @@ -51,7 +51,7 @@ public async Task CreateJobAsync_SucceedsWithExpectedFields()
Assert.IsNotNull(job.CreatedAt);
Assert.IsNotNull(job.LastUpdatedAt);
Assert.IsNull(job.StartedAt);
Assert.AreEqual(JobStatus.NotStarted, job.Status);
Assert.AreEqual(DeidentificationJobStatus.NotStarted, job.Status);
Assert.IsNull(job.Error);
Assert.AreEqual("en-US", job.Customizations.SurrogateLocale);
Assert.AreEqual(inputPrefix, job.SourceLocation.Prefix);
Expand All @@ -72,7 +72,7 @@ public async Task CreateThenList_JobExists_ContainsExpectedFields()
{
SourceLocation = new SourceStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), inputPrefix),
TargetLocation = new TargetStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), OUTPUT_FOLDER),
Operation = OperationType.Surrogate
Operation = DeidentificationOperationType.Surrogate
};

job = (await client.DeidentifyDocumentsAsync(WaitUntil.Started, jobName, job)).Value;
Expand All @@ -89,7 +89,7 @@ public async Task CreateThenList_JobExists_ContainsExpectedFields()
Assert.IsNotNull(jobs.Current.CreatedAt);
Assert.IsNotNull(jobs.Current.LastUpdatedAt);
Assert.IsNull(jobs.Current.StartedAt);
Assert.AreEqual(JobStatus.NotStarted, jobs.Current.Status);
Assert.AreEqual(DeidentificationJobStatus.NotStarted, jobs.Current.Status);
Assert.IsNull(jobs.Current.Error);
Assert.AreEqual("en-US", job.Customizations.SurrogateLocale);
Assert.IsNull(jobs.Current.Summary);
Expand Down Expand Up @@ -121,13 +121,13 @@ public async Task JobE2E_WaitUntil_Success()
{
SourceLocation = new SourceStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), inputPrefix),
TargetLocation = new TargetStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), OUTPUT_FOLDER),
Operation = OperationType.Surrogate
Operation = DeidentificationOperationType.Surrogate
};

job = (await client.DeidentifyDocumentsAsync(WaitUntil.Completed, jobName, job)).Value;
job = await client.GetJobAsync(jobName);

Assert.AreEqual(JobStatus.Succeeded, job.Status);
Assert.AreEqual(DeidentificationJobStatus.Succeeded, job.Status);
Assert.IsNotNull(job.StartedAt);
Assert.IsNotNull(job.Summary);
Assert.AreEqual(expectedReportCount, job.Summary.Total);
Expand All @@ -138,16 +138,16 @@ public async Task JobE2E_WaitUntil_Success()
int numPages = 0;
int maxPages = 10;

IAsyncEnumerable<Page<DocumentDetails>> pages = client.GetJobDocumentsAsync(jobName, maxPageSize).AsPages();
IAsyncEnumerator<Page<DocumentDetails>> enumerator = pages.GetAsyncEnumerator();
IAsyncEnumerable<Page<DeidentificationDocumentDetails>> pages = client.GetJobDocumentsAsync(jobName, maxPageSize).AsPages();
IAsyncEnumerator<Page<DeidentificationDocumentDetails>> enumerator = pages.GetAsyncEnumerator();

while (numPages < maxPages && await enumerator.MoveNextAsync())
{
Page<DocumentDetails> page = enumerator.Current;
Page<DeidentificationDocumentDetails> page = enumerator.Current;
numPages++;

Assert.IsTrue(page.Values.Count <= maxPageSize);
foreach (DocumentDetails report in page.Values)
foreach (DeidentificationDocumentDetails report in page.Values)
{
if (reportIds.Contains(report.Id))
{
Expand Down Expand Up @@ -179,7 +179,7 @@ public async Task JobE2E_CancelDeleteFlow_DeletesJob()
{
SourceLocation = new SourceStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), inputPrefix),
TargetLocation = new TargetStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), OUTPUT_FOLDER),
Operation = OperationType.Surrogate
Operation = DeidentificationOperationType.Surrogate
};

job = (await client.DeidentifyDocumentsAsync(WaitUntil.Started, jobName, job)).Value;
Expand All @@ -192,13 +192,13 @@ public async Task JobE2E_CancelDeleteFlow_DeletesJob()
await Task.Delay(1000);
}
}
while (job.Status == JobStatus.NotStarted);
while (job.Status == DeidentificationJobStatus.NotStarted);

string errorMessage = job.Error is not null ? job.Error.Message : "No Error Message Available.";
Assert.AreEqual(JobStatus.Running, job.Status, $"Job should be running. Error: {errorMessage}");
Assert.AreEqual(DeidentificationJobStatus.Running, job.Status, $"Job should be running. Error: {errorMessage}");

job = await client.CancelJobAsync(jobName);
Assert.AreEqual(JobStatus.Canceled, job.Status);
Assert.AreEqual(DeidentificationJobStatus.Canceled, job.Status);

await client.DeleteJobAsync(jobName);

Expand All @@ -219,14 +219,14 @@ public async Task JobE2E_CannotAccessStorage_ThrowsExpectedException()
{
SourceLocation = new SourceStorageLocation(new Uri(disfunctionalStorageUri), inputPrefix),
TargetLocation = new TargetStorageLocation(new Uri(disfunctionalStorageUri), OUTPUT_FOLDER),
Operation = OperationType.Surrogate
Operation = DeidentificationOperationType.Surrogate
};

Type expectedExceptionType = Mode == RecordedTestMode.Playback ? typeof(InvalidOperationException) : typeof(RequestFailedException);
Assert.ThrowsAsync(expectedExceptionType, async () => await client.DeidentifyDocumentsAsync(WaitUntil.Completed, jobName, job));
job = await client.GetJobAsync(jobName);

Assert.AreEqual(JobStatus.Failed, job.Status);
Assert.AreEqual(DeidentificationJobStatus.Failed, job.Status);
Assert.IsNotNull(job.Error);
Assert.AreEqual("StorageAccessDenied", job.Error.Code);
Assert.IsTrue(job.Error.Message.Length > 10); // Arbitrary length choice.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async Task Realtime_Tag_ReturnsExcepted()
DeidentificationClient client = GetDeidClient();

string input = "Hello, my name is John Smith.";
DeidentificationContent content = new(input, OperationType.Tag, null, null);
DeidentificationContent content = new(input, DeidentificationOperationType.Tag, null, null);

DeidentificationResult result = await client.DeidentifyTextAsync(content);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void HelloWorld()
#endregion

#region Snippet:AzHealthDeidSample1_CreateRequest
DeidentificationContent content = new("Hello, John!", OperationType.Surrogate, null, null);
DeidentificationContent content = new("Hello, John!", DeidentificationOperationType.Surrogate, null, null);

Response<DeidentificationResult> result = client.DeidentifyText(content);
string outputString = result.Value.OutputText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async void HelloWorldAsync()
#endregion

#region Snippet:AzHealthDeidSample1Async_CreateRequest
DeidentificationContent content = new("Hello, John!", OperationType.Surrogate, null, null);
DeidentificationContent content = new("Hello, John!", DeidentificationOperationType.Surrogate, null, null);

Response<DeidentificationResult> result = await client.DeidentifyTextAsync(content);
string outputString = result.Value.OutputText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void CreateAndRunJob()
{
SourceLocation = new SourceStorageLocation(new Uri(storageAccountUrl), "folder1/"),
TargetLocation = new TargetStorageLocation(new Uri(storageAccountUrl), "output_path"),
Operation = OperationType.Surrogate
Operation = DeidentificationOperationType.Surrogate
};

job = client.DeidentifyDocuments(WaitUntil.Started, "my-job-1", job).Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async void CreateAndRunJobAsync()
{
SourceLocation = new SourceStorageLocation(new Uri(storageAccountUrl), "folder1/"),
TargetLocation = new TargetStorageLocation(new Uri(storageAccountUrl), "output_path"),
Operation = OperationType.Surrogate
Operation = DeidentificationOperationType.Surrogate
};

job = (await client.DeidentifyDocumentsAsync(WaitUntil.Completed, "my-job-1", job)).Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public void ListCompletedFiles()
);

#region Snippet:AzHealthDeidSample4_ListCompletedFiles
Pageable<DocumentDetails> files = client.GetJobDocuments("job-name-1");
Pageable<DeidentificationDocumentDetails> files = client.GetJobDocuments("job-name-1");

foreach (DocumentDetails file in files)
foreach (DeidentificationDocumentDetails file in files)
{
Console.WriteLine($"File Name: {file.Input.Location}");
Console.WriteLine($"File Status: {file.Status}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public async void ListCompletedFilesAsync()
);

#region Snippet:AzHealthDeidSample4Async_ListCompletedFiles
AsyncPageable<DocumentDetails> files = client.GetJobDocumentsAsync("job-name-1");
AsyncPageable<DeidentificationDocumentDetails> files = client.GetJobDocumentsAsync("job-name-1");

await foreach (DocumentDetails file in files)
await foreach (DeidentificationDocumentDetails file in files)
{
Console.WriteLine($"File Name: {file.Input.Location}");
Console.WriteLine($"File Status: {file.Status}");
Expand Down