Skip to content

Commit

Permalink
Health Data AI Service GA release (#46998)
Browse files Browse the repository at this point in the history
* Regenerated with customization-options typespec

* Fixes + pagedDocumentDetails

* Revert pagedDocumentDetails

* nextLink in DocumentDetails

* DocumentDetail

* Regenerated with no continuationToken

* OperationType

* CustomizationOptions and suppression

* Change Config to Options

* Regenerated after marking ListJobs and ListJobDocuments as internal

* Customizations to remove continuationToken

* Update tests and samples for new API version

* Samples

* Updating tests for new API version

* Enable local testing

* Add sanitizers

* Update tests and sanitizers

* Rename "body" to "content"

* Tests working in all modes

* Update commit in tsp-location.yaml

* Updated serialization with dotnet build codegen

* Version 1.0.0

* GA installation instructions

* Use Deidentification prefix naming convention

* Update tsp-location.yaml commit

* Updates tests and samples with new prefix

* Ran dotnet build /t:GenerateCode

* Deidentification prefix for CustomizationOptions

* Update tsp-location.yaml

* Improve samples

* Update commit in tsp-location

* Update commit again

* Update README sample

* Regenerated with customization-options typespec

* Fixes + pagedDocumentDetails

* Revert pagedDocumentDetails

* nextLink in DocumentDetails

* DocumentDetail

* Regenerated with no continuationToken

* OperationType

* CustomizationOptions and suppression

* Change Config to Options

* Regenerated after marking ListJobs and ListJobDocuments as internal

* Customizations to remove continuationToken

* Update tests and samples for new API version

* Samples

* Updating tests for new API version

* Enable local testing

* Add sanitizers

* Update tests and sanitizers

* Rename "body" to "content"

* Tests working in all modes

* Update commit in tsp-location.yaml

* Updated serialization with dotnet build codegen

* Version 1.0.0

* GA installation instructions

* Use Deidentification prefix naming convention

* Update tsp-location.yaml commit

* Updates tests and samples with new prefix

* Ran dotnet build /t:GenerateCode

* Deidentification prefix for CustomizationOptions

* Update tsp-location.yaml

* Improve samples

* Update commit in tsp-location

* Update commit again

* Update README sample

* Export API

* Switch back to ResourceList

* Update commit hash

* New tests with overwrite

* Use public setter for overwrite

* Regenerated after removing PartialFailed

* Rm DeidentificationJobStatus from tests

* Regenerated with merged typespec

* Update changelog.md

* Updating generated code

* Update changelog

---------

Co-authored-by: Alexa Thomases <[email protected]>
  • Loading branch information
alexathomases and Alexa Thomases authored Jan 8, 2025
1 parent a4572df commit 42ad564
Show file tree
Hide file tree
Showing 53 changed files with 1,613 additions and 1,311 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0 (2025-01-14)

### Features Added

### Breaking Changes
- Introduced `DeidentificationCustomizationOptions` and `DeidentificationJobCustomizationOptions` models
- Created `SurrogateLocale` field in these models
- Moved `RedactionFormat` field into these models
- Introduced `Overwrite` flag in `TargetStorageLocation` model

### Bugs Fixed
### Breaking Changes

### Other Changes
- Changed `outputPrefix` behavior from including `jobName` to prefix replacement method
- Changed `Path` field to `Location` in `SourceStorageLocation` and `TargetStorageLocation`
- Deprecated `DocumentDataType`
- Deprecated `Path` and `Location` from `TaggerResult` model

## 1.0.0-beta.1 (2024-08-15)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Azure.Health.Deidentification is a managed service that enables users to tag, re
Install the client library for .NET with [NuGet](https://www.nuget.org/ ):

```dotnetcli
dotnet add package Azure.Health.Deidentification --prerelease
dotnet add package Azure.Health.Deidentification
```

### Prerequisites
Expand All @@ -40,9 +40,9 @@ Basic code snippet to create your Deidentification Client and Deidentify a strin
new DeidentificationClientOptions()
);

DeidentificationContent content = new("Hello, John!", OperationType.Surrogate, DocumentDataType.Plaintext);
DeidentificationContent content = new("Hello, John!");

Response<DeidentificationResult> result = client.Deidentify(content);
Response<DeidentificationResult> result = client.DeidentifyText(content);
string outputString = result.Value.OutputText;
Console.WriteLine(outputString); // Hello, Tom!
```
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/healthdataaiservices/Azure.Health.Deidentification",
"Tag": "net/healthdataaiservices/Azure.Health.Deidentification_d8c55b7fa6"
"Tag": "net/healthdataaiservices/Azure.Health.Deidentification_dd33e2c279"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ DeidentificationClient client = new(
## Build Request and Call Function

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

Response<DeidentificationResult> result = client.Deidentify(content);
Response<DeidentificationResult> result = client.DeidentifyText(content);
string outputString = result.Value.OutputText;
Console.WriteLine(outputString); // Hello, Tom!
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ DeidentificationClient client = new(
## Build Request and Call Function

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

Response<DeidentificationResult> result = await client.DeidentifyAsync(content);
Response<DeidentificationResult> result = await client.DeidentifyTextAsync(content);
string outputString = result.Value.OutputText;
Console.WriteLine(outputString); // Hello, Tom!
```
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ This sample demonstrates how to create a job which will deidentify all files wit
DeidentificationJob job = new()
{
SourceLocation = new SourceStorageLocation(new Uri(storageAccountUrl), "folder1/"),
TargetLocation = new TargetStorageLocation(new Uri(storageAccountUrl), "output_path"),
DataType = DocumentDataType.Plaintext,
Operation = OperationType.Surrogate
TargetLocation = new TargetStorageLocation(new Uri(storageAccountUrl), "output_folder1/"),
Operation = DeidentificationOperationType.Redact,
};

job = client.CreateJob(WaitUntil.Started, "my-job-1", job).Value;
job = client.DeidentifyDocuments(WaitUntil.Started, "my-job-1", job).Value;
Console.WriteLine($"Job status: {job.Status}"); // Job status: NotStarted
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ This sample demonstrates how to create a job which will deidentify all files wit
DeidentificationJob job = new()
{
SourceLocation = new SourceStorageLocation(new Uri(storageAccountUrl), "folder1/"),
TargetLocation = new TargetStorageLocation(new Uri(storageAccountUrl), "output_path"),
DataType = DocumentDataType.Plaintext,
Operation = OperationType.Surrogate
TargetLocation = new TargetStorageLocation(new Uri(storageAccountUrl), "output_folder1/"),
Operation = DeidentificationOperationType.Redact,
};

job = (await client.CreateJobAsync(WaitUntil.Completed, "my-job-1", job)).Value;
job = (await client.DeidentifyDocumentsAsync(WaitUntil.Completed, "my-job-1", job)).Value;
Console.WriteLine($"Job Status: {job.Status}"); // Job Status: Completed
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ 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.Path}");
Console.WriteLine($"File Name: {file.Input.Location}");
Console.WriteLine($"File Status: {file.Status}");
Console.WriteLine($"File Output Path: {file.Output.Path}");
Console.WriteLine($"File Output Path: {file.Output.Location}");
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ 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.Path}");
Console.WriteLine($"File Name: {file.Input.Location}");
Console.WriteLine($"File Status: {file.Status}");
Console.WriteLine($"File Output Path: {file.Output.Path}");
Console.WriteLine($"File Output Path: {file.Output.Location}");
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<Description>This is the Azure.Health.Deidentification client library for developing .NET applications with rich experience.</Description>
<AssemblyTitle>Azure SDK Code Generation Azure.Health.Deidentification for Azure Data Plane</AssemblyTitle>
<Version>1.0.0-beta.2</Version>
<Version>1.0.0</Version>
<PackageTags>Azure.Health.Deidentification</PackageTags>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
Expand All @@ -11,6 +11,7 @@

<ItemGroup>
<Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" LinkBase="Shared/Core" />
<Compile Include="$(AzureCoreSharedSources)ForwardsClientCallsAttribute.cs" LinkBase="Shared/Core" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

using System;
using System.Threading;
using System.Threading.Tasks;
using Autorest.CSharp.Core;
using Azure.Core;
using Azure.Core.Pipeline;

namespace Azure.Health.Deidentification
{
// Data plane customized client.
/// <summary> The Deidentification service client. </summary>
public partial class DeidentificationClient
{
/// <summary> List de-identification jobs. </summary>
/// <param name="maxpagesize"> The maximum number of result items per page. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <remarks> Resource list operation template. </remarks>
[ForwardsClientCalls]
public virtual AsyncPageable<DeidentificationJob> GetJobsAsync(int? maxpagesize = null, CancellationToken cancellationToken = default)
{
using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobs");
scope.Start();
return GetJobsInternalsAsync(maxpagesize, null, cancellationToken);
}

/// <summary> List de-identification jobs. </summary>
/// <param name="maxpagesize"> The maximum number of result items per page. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <remarks> Resource list operation template. </remarks>
[ForwardsClientCalls]
public virtual Pageable<DeidentificationJob> GetJobs(int? maxpagesize = null, CancellationToken cancellationToken = default)
{
using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobs");
scope.Start();
return GetJobsInternals(maxpagesize, null, cancellationToken);
}

/// <summary>
/// [Protocol Method] List de-identification jobs.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// <item>
/// <description>
/// Please try the simpler <see cref="GetJobsAsync(int?,CancellationToken)"/> convenience overload with strongly typed models first.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="maxpagesize"> The maximum number of result items per page. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The <see cref="AsyncPageable{T}"/> from the service containing a list of <see cref="BinaryData"/> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
[ForwardsClientCalls]
public virtual AsyncPageable<BinaryData> GetJobsAsync(int? maxpagesize, RequestContext context)
{
using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobs");
scope.Start();
return GetJobsInternalsAsync(maxpagesize, null, context);
}

/// <summary>
/// [Protocol Method] List de-identification jobs.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// <item>
/// <description>
/// Please try the simpler <see cref="GetJobs(int?,CancellationToken)"/> convenience overload with strongly typed models first.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="maxpagesize"> The maximum number of result items per page. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The <see cref="Pageable{T}"/> from the service containing a list of <see cref="BinaryData"/> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
[ForwardsClientCalls]
public virtual Pageable<BinaryData> GetJobs(int? maxpagesize, RequestContext context)
{
using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobs");
scope.Start();
return GetJobsInternals(maxpagesize, null, context);
}

/// <summary> List processed documents within a job. </summary>
/// <param name="jobName"> The name of a job. </param>
/// <param name="maxpagesize"> The maximum number of result items per page. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="jobName"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="jobName"/> is an empty string, and was expected to be non-empty. </exception>
/// <remarks> The most basic operation. </remarks>
[ForwardsClientCalls]
public virtual AsyncPageable<DeidentificationDocumentDetails> GetJobDocumentsAsync(string jobName, int? maxpagesize = null, CancellationToken cancellationToken = default)
{
using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobDocuments");
scope.Start();
return GetJobDocumentsInternalsAsync(jobName, maxpagesize, null, cancellationToken);
}

/// <summary> List processed documents within a job. </summary>
/// <param name="jobName"> The name of a job. </param>
/// <param name="maxpagesize"> The maximum number of result items per page. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="jobName"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="jobName"/> is an empty string, and was expected to be non-empty. </exception>
/// <remarks> The most basic operation. </remarks>
[ForwardsClientCalls]
public virtual Pageable<DeidentificationDocumentDetails> GetJobDocuments(string jobName, int? maxpagesize = null, CancellationToken cancellationToken = default)
{
using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobDocuments");
scope.Start();
return GetJobDocumentsInternals(jobName, maxpagesize, null, cancellationToken);
}

/// <summary>
/// [Protocol Method] List processed documents within a job.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// <item>
/// <description>
/// Please try the simpler <see cref="GetJobDocumentsAsync(string,int?,CancellationToken)"/> convenience overload with strongly typed models first.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="jobName"> The name of a job. </param>
/// <param name="maxpagesize"> The maximum number of result items per page. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="ArgumentNullException"> <paramref name="jobName"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="jobName"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The <see cref="AsyncPageable{T}"/> from the service containing a list of <see cref="BinaryData"/> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
[ForwardsClientCalls]
public virtual AsyncPageable<BinaryData> GetJobDocumentsAsync(string jobName, int? maxpagesize, RequestContext context)
{
using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobDocuments");
scope.Start();
return GetJobDocumentsInternalsAsync(jobName, maxpagesize, null, context);
}

/// <summary>
/// [Protocol Method] List processed documents within a job.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// <item>
/// <description>
/// Please try the simpler <see cref="GetJobDocuments(string,int?,CancellationToken)"/> convenience overload with strongly typed models first.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="jobName"> The name of a job. </param>
/// <param name="maxpagesize"> The maximum number of result items per page. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="ArgumentNullException"> <paramref name="jobName"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="jobName"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The <see cref="Pageable{T}"/> from the service containing a list of <see cref="BinaryData"/> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
[ForwardsClientCalls]
public virtual Pageable<BinaryData> GetJobDocuments(string jobName, int? maxpagesize, RequestContext context)
{
using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobDocuments");
scope.Start();
return GetJobDocumentsInternals(jobName, maxpagesize, null, context);
}
}
}
Loading

0 comments on commit 42ad564

Please sign in to comment.