diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/CHANGELOG.md b/sdk/healthdataaiservices/Azure.Health.Deidentification/CHANGELOG.md index f72f8ddd3a99..178643db28bb 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/CHANGELOG.md +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/CHANGELOG.md @@ -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) diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/README.md b/sdk/healthdataaiservices/Azure.Health.Deidentification/README.md index 2fb2665db06f..959f91deac0e 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/README.md +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/README.md @@ -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 @@ -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 result = client.Deidentify(content); + Response result = client.DeidentifyText(content); string outputString = result.Value.OutputText; Console.WriteLine(outputString); // Hello, Tom! ``` diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/api/Azure.Health.Deidentification.net8.0.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/api/Azure.Health.Deidentification.net8.0.cs index ae11d3ada132..10e7a2f8f167 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/api/Azure.Health.Deidentification.net8.0.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/api/Azure.Health.Deidentification.net8.0.cs @@ -10,44 +10,43 @@ public DeidentificationClient(System.Uri endpoint, Azure.Core.TokenCredential cr public virtual Azure.Response CancelJob(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CancelJobAsync(string name, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> CancelJobAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation CreateJob(Azure.WaitUntil waitUntil, string name, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation CreateJob(Azure.WaitUntil waitUntil, string name, Azure.Health.Deidentification.DeidentificationJob resource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateJobAsync(Azure.WaitUntil waitUntil, string name, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CreateJobAsync(Azure.WaitUntil waitUntil, string name, Azure.Health.Deidentification.DeidentificationJob resource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Deidentify(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response Deidentify(Azure.Health.Deidentification.DeidentificationContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeidentifyAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> DeidentifyAsync(Azure.Health.Deidentification.DeidentificationContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation DeidentifyDocuments(Azure.WaitUntil waitUntil, string name, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeidentifyDocuments(Azure.WaitUntil waitUntil, string name, Azure.Health.Deidentification.DeidentificationJob resource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DeidentifyDocumentsAsync(Azure.WaitUntil waitUntil, string name, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> DeidentifyDocumentsAsync(Azure.WaitUntil waitUntil, string name, Azure.Health.Deidentification.DeidentificationJob resource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeidentifyText(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeidentifyText(Azure.Health.Deidentification.DeidentificationContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeidentifyTextAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> DeidentifyTextAsync(Azure.Health.Deidentification.DeidentificationContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response DeleteJob(string name, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task DeleteJobAsync(string name, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetJob(string name, Azure.RequestContext context) { throw null; } public virtual Azure.Response GetJob(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task GetJobAsync(string name, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> GetJobAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetJobDocuments(string name, int? maxpagesize, string continuationToken, Azure.RequestContext context) { throw null; } - public virtual Azure.Pageable GetJobDocuments(string name, int? maxpagesize = default(int?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetJobDocumentsAsync(string name, int? maxpagesize, string continuationToken, Azure.RequestContext context) { throw null; } - public virtual Azure.AsyncPageable GetJobDocumentsAsync(string name, int? maxpagesize = default(int?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetJobs(int? maxpagesize, string continuationToken, Azure.RequestContext context) { throw null; } - public virtual Azure.Pageable GetJobs(int? maxpagesize = default(int?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetJobsAsync(int? maxpagesize, string continuationToken, Azure.RequestContext context) { throw null; } - public virtual Azure.AsyncPageable GetJobsAsync(int? maxpagesize = default(int?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetJobDocuments(string jobName, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetJobDocuments(string jobName, int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetJobDocumentsAsync(string jobName, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetJobDocumentsAsync(string jobName, int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetJobs(int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetJobs(int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetJobsAsync(int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetJobsAsync(int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class DeidentificationClientOptions : Azure.Core.ClientOptions { - public DeidentificationClientOptions(Azure.Health.Deidentification.DeidentificationClientOptions.ServiceVersion version = Azure.Health.Deidentification.DeidentificationClientOptions.ServiceVersion.V2024_07_12_Preview) { } + public DeidentificationClientOptions(Azure.Health.Deidentification.DeidentificationClientOptions.ServiceVersion version = Azure.Health.Deidentification.DeidentificationClientOptions.ServiceVersion.V2024_11_15) { } public enum ServiceVersion { - V2024_07_12_Preview = 1, + V2024_11_15 = 1, } } public partial class DeidentificationContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeidentificationContent(string inputText) { } - public Azure.Health.Deidentification.DocumentDataType? DataType { get { throw null; } set { } } + public Azure.Health.Deidentification.DeidentificationCustomizationOptions Customizations { get { throw null; } set { } } public string InputText { get { throw null; } } - public Azure.Health.Deidentification.OperationType? Operation { get { throw null; } set { } } - public string RedactionFormat { get { throw null; } set { } } + public Azure.Health.Deidentification.DeidentificationOperationType? Operation { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Deidentification.DeidentificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -55,20 +54,58 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class DeidentificationCustomizationOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeidentificationCustomizationOptions() { } + public string RedactionFormat { get { throw null; } set { } } + public string SurrogateLocale { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationCustomizationOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationCustomizationOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeidentificationDocumentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeidentificationDocumentDetails() { } + public Azure.ResponseError Error { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Health.Deidentification.DeidentificationDocumentLocation Input { get { throw null; } } + public Azure.Health.Deidentification.DeidentificationDocumentLocation Output { get { throw null; } } + public Azure.Health.Deidentification.OperationState Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationDocumentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationDocumentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeidentificationDocumentLocation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeidentificationDocumentLocation() { } + public Azure.ETag Etag { get { throw null; } } + public System.Uri Location { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationDocumentLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationDocumentLocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class DeidentificationJob : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeidentificationJob(Azure.Health.Deidentification.SourceStorageLocation sourceLocation, Azure.Health.Deidentification.TargetStorageLocation targetLocation) { } public System.DateTimeOffset CreatedAt { get { throw null; } } - public Azure.Health.Deidentification.DocumentDataType? DataType { get { throw null; } set { } } + public Azure.Health.Deidentification.DeidentificationJobCustomizationOptions Customizations { get { throw null; } set { } } public Azure.ResponseError Error { get { throw null; } } public System.DateTimeOffset LastUpdatedAt { get { throw null; } } public string Name { get { throw null; } } - public Azure.Health.Deidentification.OperationType? Operation { get { throw null; } set { } } - public string RedactionFormat { get { throw null; } set { } } + public Azure.Health.Deidentification.DeidentificationOperationType? Operation { get { throw null; } set { } } public Azure.Health.Deidentification.SourceStorageLocation SourceLocation { get { throw null; } set { } } public System.DateTimeOffset? StartedAt { get { throw null; } } - public Azure.Health.Deidentification.JobStatus Status { get { throw null; } } - public Azure.Health.Deidentification.JobSummary Summary { get { throw null; } } + public Azure.Health.Deidentification.OperationState Status { get { throw null; } } + public Azure.Health.Deidentification.DeidentificationJobSummary Summary { get { throw null; } } public Azure.Health.Deidentification.TargetStorageLocation TargetLocation { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Deidentification.DeidentificationJob System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -77,112 +114,77 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DeidentificationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DeidentificationJobCustomizationOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DeidentificationResult() { } - public string OutputText { get { throw null; } } - public Azure.Health.Deidentification.PhiTaggerResult TaggerResult { get { throw null; } } + public DeidentificationJobCustomizationOptions() { } + public string RedactionFormat { get { throw null; } set { } } + public string SurrogateLocale { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.DeidentificationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.DeidentificationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.Health.Deidentification.DeidentificationJobCustomizationOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationJobCustomizationOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeidentificationJobSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeidentificationJobSummary() { } + public long BytesProcessed { get { throw null; } } + public int Canceled { get { throw null; } } + public int Failed { get { throw null; } } + public int Successful { get { throw null; } } + public int Total { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationJobSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationJobSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DocumentDataType : System.IEquatable + public readonly partial struct DeidentificationOperationType : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public DocumentDataType(string value) { throw null; } - public static Azure.Health.Deidentification.DocumentDataType Plaintext { get { throw null; } } - public bool Equals(Azure.Health.Deidentification.DocumentDataType other) { throw null; } + public DeidentificationOperationType(string value) { throw null; } + public static Azure.Health.Deidentification.DeidentificationOperationType Redact { get { throw null; } } + public static Azure.Health.Deidentification.DeidentificationOperationType Surrogate { get { throw null; } } + public static Azure.Health.Deidentification.DeidentificationOperationType Tag { get { throw null; } } + public bool Equals(Azure.Health.Deidentification.DeidentificationOperationType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Health.Deidentification.DocumentDataType left, Azure.Health.Deidentification.DocumentDataType right) { throw null; } - public static implicit operator Azure.Health.Deidentification.DocumentDataType (string value) { throw null; } - public static bool operator !=(Azure.Health.Deidentification.DocumentDataType left, Azure.Health.Deidentification.DocumentDataType right) { throw null; } + public static bool operator ==(Azure.Health.Deidentification.DeidentificationOperationType left, Azure.Health.Deidentification.DeidentificationOperationType right) { throw null; } + public static implicit operator Azure.Health.Deidentification.DeidentificationOperationType (string value) { throw null; } + public static bool operator !=(Azure.Health.Deidentification.DeidentificationOperationType left, Azure.Health.Deidentification.DeidentificationOperationType right) { throw null; } public override string ToString() { throw null; } } - public partial class DocumentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal DocumentDetails() { } - public Azure.ResponseError Error { get { throw null; } } - public string Id { get { throw null; } } - public Azure.Health.Deidentification.DocumentLocation Input { get { throw null; } } - public Azure.Health.Deidentification.DocumentLocation Output { get { throw null; } } - public Azure.Health.Deidentification.OperationState Status { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.DocumentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.DocumentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DocumentLocation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DeidentificationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentLocation() { } - public Azure.ETag Etag { get { throw null; } } - public string Path { get { throw null; } } + internal DeidentificationResult() { } + public string OutputText { get { throw null; } } + public Azure.Health.Deidentification.PhiTaggerResult TaggerResult { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.DocumentLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.DocumentLocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.Health.Deidentification.DeidentificationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public static partial class HealthDeidentificationModelFactory { - public static Azure.Health.Deidentification.DeidentificationContent DeidentificationContent(string inputText = null, Azure.Health.Deidentification.OperationType? operation = default(Azure.Health.Deidentification.OperationType?), Azure.Health.Deidentification.DocumentDataType? dataType = default(Azure.Health.Deidentification.DocumentDataType?), string redactionFormat = null) { throw null; } - public static Azure.Health.Deidentification.DeidentificationJob DeidentificationJob(string name = null, Azure.Health.Deidentification.SourceStorageLocation sourceLocation = null, Azure.Health.Deidentification.TargetStorageLocation targetLocation = null, Azure.Health.Deidentification.OperationType? operation = default(Azure.Health.Deidentification.OperationType?), Azure.Health.Deidentification.DocumentDataType? dataType = default(Azure.Health.Deidentification.DocumentDataType?), string redactionFormat = null, Azure.Health.Deidentification.JobStatus status = default(Azure.Health.Deidentification.JobStatus), Azure.ResponseError error = null, System.DateTimeOffset lastUpdatedAt = default(System.DateTimeOffset), System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset? startedAt = default(System.DateTimeOffset?), Azure.Health.Deidentification.JobSummary summary = null) { throw null; } + public static Azure.Health.Deidentification.DeidentificationContent DeidentificationContent(string inputText = null, Azure.Health.Deidentification.DeidentificationOperationType? operation = default(Azure.Health.Deidentification.DeidentificationOperationType?), Azure.Health.Deidentification.DeidentificationCustomizationOptions customizations = null) { throw null; } + public static Azure.Health.Deidentification.DeidentificationDocumentDetails DeidentificationDocumentDetails(string id = null, Azure.Health.Deidentification.DeidentificationDocumentLocation input = null, Azure.Health.Deidentification.DeidentificationDocumentLocation output = null, Azure.Health.Deidentification.OperationState status = default(Azure.Health.Deidentification.OperationState), Azure.ResponseError error = null) { throw null; } + public static Azure.Health.Deidentification.DeidentificationDocumentLocation DeidentificationDocumentLocation(System.Uri location = null, Azure.ETag etag = default(Azure.ETag)) { throw null; } + public static Azure.Health.Deidentification.DeidentificationJob DeidentificationJob(string name = null, Azure.Health.Deidentification.DeidentificationOperationType? operation = default(Azure.Health.Deidentification.DeidentificationOperationType?), Azure.Health.Deidentification.SourceStorageLocation sourceLocation = null, Azure.Health.Deidentification.TargetStorageLocation targetLocation = null, Azure.Health.Deidentification.DeidentificationJobCustomizationOptions customizations = null, Azure.Health.Deidentification.OperationState status = default(Azure.Health.Deidentification.OperationState), Azure.ResponseError error = null, System.DateTimeOffset lastUpdatedAt = default(System.DateTimeOffset), System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset? startedAt = default(System.DateTimeOffset?), Azure.Health.Deidentification.DeidentificationJobSummary summary = null) { throw null; } + public static Azure.Health.Deidentification.DeidentificationJobSummary DeidentificationJobSummary(int successful = 0, int failed = 0, int canceled = 0, int total = 0, long bytesProcessed = (long)0) { throw null; } public static Azure.Health.Deidentification.DeidentificationResult DeidentificationResult(string outputText = null, Azure.Health.Deidentification.PhiTaggerResult taggerResult = null) { throw null; } - public static Azure.Health.Deidentification.DocumentDetails DocumentDetails(string id = null, Azure.Health.Deidentification.DocumentLocation input = null, Azure.Health.Deidentification.DocumentLocation output = null, Azure.Health.Deidentification.OperationState status = default(Azure.Health.Deidentification.OperationState), Azure.ResponseError error = null) { throw null; } - public static Azure.Health.Deidentification.DocumentLocation DocumentLocation(string path = null, Azure.ETag etag = default(Azure.ETag)) { throw null; } - public static Azure.Health.Deidentification.JobSummary JobSummary(int successful = 0, int failed = 0, int canceled = 0, int total = 0, long bytesProcessed = (long)0) { throw null; } public static Azure.Health.Deidentification.PhiEntity PhiEntity(Azure.Health.Deidentification.PhiCategory category = default(Azure.Health.Deidentification.PhiCategory), Azure.Health.Deidentification.StringIndex offset = null, Azure.Health.Deidentification.StringIndex length = null, string text = null, double? confidenceScore = default(double?)) { throw null; } - public static Azure.Health.Deidentification.PhiTaggerResult PhiTaggerResult(System.Collections.Generic.IEnumerable entities = null, string path = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.Health.Deidentification.PhiTaggerResult PhiTaggerResult(System.Collections.Generic.IEnumerable entities = null) { throw null; } public static Azure.Health.Deidentification.StringIndex StringIndex(int utf8 = 0, int utf16 = 0, int codePoint = 0) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct JobStatus : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public JobStatus(string value) { throw null; } - public static Azure.Health.Deidentification.JobStatus Canceled { get { throw null; } } - public static Azure.Health.Deidentification.JobStatus Failed { get { throw null; } } - public static Azure.Health.Deidentification.JobStatus NotStarted { get { throw null; } } - public static Azure.Health.Deidentification.JobStatus PartialFailed { get { throw null; } } - public static Azure.Health.Deidentification.JobStatus Running { get { throw null; } } - public static Azure.Health.Deidentification.JobStatus Succeeded { get { throw null; } } - public bool Equals(Azure.Health.Deidentification.JobStatus other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Health.Deidentification.JobStatus left, Azure.Health.Deidentification.JobStatus right) { throw null; } - public static implicit operator Azure.Health.Deidentification.JobStatus (string value) { throw null; } - public static bool operator !=(Azure.Health.Deidentification.JobStatus left, Azure.Health.Deidentification.JobStatus right) { throw null; } - public override string ToString() { throw null; } - } - public partial class JobSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal JobSummary() { } - public long BytesProcessed { get { throw null; } } - public int Canceled { get { throw null; } } - public int Failed { get { throw null; } } - public int Successful { get { throw null; } } - public int Total { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.JobSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.JobSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct OperationState : System.IEquatable { private readonly object _dummy; @@ -204,25 +206,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct OperationType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public OperationType(string value) { throw null; } - public static Azure.Health.Deidentification.OperationType Redact { get { throw null; } } - public static Azure.Health.Deidentification.OperationType Surrogate { get { throw null; } } - public static Azure.Health.Deidentification.OperationType Tag { get { throw null; } } - public bool Equals(Azure.Health.Deidentification.OperationType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Health.Deidentification.OperationType left, Azure.Health.Deidentification.OperationType right) { throw null; } - public static implicit operator Azure.Health.Deidentification.OperationType (string value) { throw null; } - public static bool operator !=(Azure.Health.Deidentification.OperationType left, Azure.Health.Deidentification.OperationType right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct PhiCategory : System.IEquatable { private readonly object _dummy; @@ -286,8 +269,6 @@ public partial class PhiTaggerResult : System.ClientModel.Primitives.IJsonModel< { internal PhiTaggerResult() { } public System.Collections.Generic.IReadOnlyList Entities { get { throw null; } } - public Azure.ETag? Etag { get { throw null; } } - public string Path { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Deidentification.PhiTaggerResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -325,6 +306,7 @@ public partial class TargetStorageLocation : System.ClientModel.Primitives.IJson { public TargetStorageLocation(System.Uri location, string prefix) { } public System.Uri Location { get { throw null; } set { } } + public bool? Overwrite { get { throw null; } set { } } public string Prefix { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Deidentification.TargetStorageLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/api/Azure.Health.Deidentification.netstandard2.0.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/api/Azure.Health.Deidentification.netstandard2.0.cs index ae11d3ada132..10e7a2f8f167 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/api/Azure.Health.Deidentification.netstandard2.0.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/api/Azure.Health.Deidentification.netstandard2.0.cs @@ -10,44 +10,43 @@ public DeidentificationClient(System.Uri endpoint, Azure.Core.TokenCredential cr public virtual Azure.Response CancelJob(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CancelJobAsync(string name, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> CancelJobAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Operation CreateJob(Azure.WaitUntil waitUntil, string name, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation CreateJob(Azure.WaitUntil waitUntil, string name, Azure.Health.Deidentification.DeidentificationJob resource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateJobAsync(Azure.WaitUntil waitUntil, string name, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CreateJobAsync(Azure.WaitUntil waitUntil, string name, Azure.Health.Deidentification.DeidentificationJob resource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Deidentify(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response Deidentify(Azure.Health.Deidentification.DeidentificationContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeidentifyAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> DeidentifyAsync(Azure.Health.Deidentification.DeidentificationContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation DeidentifyDocuments(Azure.WaitUntil waitUntil, string name, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeidentifyDocuments(Azure.WaitUntil waitUntil, string name, Azure.Health.Deidentification.DeidentificationJob resource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DeidentifyDocumentsAsync(Azure.WaitUntil waitUntil, string name, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> DeidentifyDocumentsAsync(Azure.WaitUntil waitUntil, string name, Azure.Health.Deidentification.DeidentificationJob resource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeidentifyText(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeidentifyText(Azure.Health.Deidentification.DeidentificationContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeidentifyTextAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> DeidentifyTextAsync(Azure.Health.Deidentification.DeidentificationContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response DeleteJob(string name, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task DeleteJobAsync(string name, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetJob(string name, Azure.RequestContext context) { throw null; } public virtual Azure.Response GetJob(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task GetJobAsync(string name, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> GetJobAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetJobDocuments(string name, int? maxpagesize, string continuationToken, Azure.RequestContext context) { throw null; } - public virtual Azure.Pageable GetJobDocuments(string name, int? maxpagesize = default(int?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetJobDocumentsAsync(string name, int? maxpagesize, string continuationToken, Azure.RequestContext context) { throw null; } - public virtual Azure.AsyncPageable GetJobDocumentsAsync(string name, int? maxpagesize = default(int?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetJobs(int? maxpagesize, string continuationToken, Azure.RequestContext context) { throw null; } - public virtual Azure.Pageable GetJobs(int? maxpagesize = default(int?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetJobsAsync(int? maxpagesize, string continuationToken, Azure.RequestContext context) { throw null; } - public virtual Azure.AsyncPageable GetJobsAsync(int? maxpagesize = default(int?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetJobDocuments(string jobName, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetJobDocuments(string jobName, int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetJobDocumentsAsync(string jobName, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetJobDocumentsAsync(string jobName, int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetJobs(int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetJobs(int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetJobsAsync(int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetJobsAsync(int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class DeidentificationClientOptions : Azure.Core.ClientOptions { - public DeidentificationClientOptions(Azure.Health.Deidentification.DeidentificationClientOptions.ServiceVersion version = Azure.Health.Deidentification.DeidentificationClientOptions.ServiceVersion.V2024_07_12_Preview) { } + public DeidentificationClientOptions(Azure.Health.Deidentification.DeidentificationClientOptions.ServiceVersion version = Azure.Health.Deidentification.DeidentificationClientOptions.ServiceVersion.V2024_11_15) { } public enum ServiceVersion { - V2024_07_12_Preview = 1, + V2024_11_15 = 1, } } public partial class DeidentificationContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeidentificationContent(string inputText) { } - public Azure.Health.Deidentification.DocumentDataType? DataType { get { throw null; } set { } } + public Azure.Health.Deidentification.DeidentificationCustomizationOptions Customizations { get { throw null; } set { } } public string InputText { get { throw null; } } - public Azure.Health.Deidentification.OperationType? Operation { get { throw null; } set { } } - public string RedactionFormat { get { throw null; } set { } } + public Azure.Health.Deidentification.DeidentificationOperationType? Operation { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Deidentification.DeidentificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -55,20 +54,58 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class DeidentificationCustomizationOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeidentificationCustomizationOptions() { } + public string RedactionFormat { get { throw null; } set { } } + public string SurrogateLocale { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationCustomizationOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationCustomizationOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeidentificationDocumentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeidentificationDocumentDetails() { } + public Azure.ResponseError Error { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Health.Deidentification.DeidentificationDocumentLocation Input { get { throw null; } } + public Azure.Health.Deidentification.DeidentificationDocumentLocation Output { get { throw null; } } + public Azure.Health.Deidentification.OperationState Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationDocumentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationDocumentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeidentificationDocumentLocation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeidentificationDocumentLocation() { } + public Azure.ETag Etag { get { throw null; } } + public System.Uri Location { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationDocumentLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationDocumentLocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class DeidentificationJob : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeidentificationJob(Azure.Health.Deidentification.SourceStorageLocation sourceLocation, Azure.Health.Deidentification.TargetStorageLocation targetLocation) { } public System.DateTimeOffset CreatedAt { get { throw null; } } - public Azure.Health.Deidentification.DocumentDataType? DataType { get { throw null; } set { } } + public Azure.Health.Deidentification.DeidentificationJobCustomizationOptions Customizations { get { throw null; } set { } } public Azure.ResponseError Error { get { throw null; } } public System.DateTimeOffset LastUpdatedAt { get { throw null; } } public string Name { get { throw null; } } - public Azure.Health.Deidentification.OperationType? Operation { get { throw null; } set { } } - public string RedactionFormat { get { throw null; } set { } } + public Azure.Health.Deidentification.DeidentificationOperationType? Operation { get { throw null; } set { } } public Azure.Health.Deidentification.SourceStorageLocation SourceLocation { get { throw null; } set { } } public System.DateTimeOffset? StartedAt { get { throw null; } } - public Azure.Health.Deidentification.JobStatus Status { get { throw null; } } - public Azure.Health.Deidentification.JobSummary Summary { get { throw null; } } + public Azure.Health.Deidentification.OperationState Status { get { throw null; } } + public Azure.Health.Deidentification.DeidentificationJobSummary Summary { get { throw null; } } public Azure.Health.Deidentification.TargetStorageLocation TargetLocation { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Deidentification.DeidentificationJob System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -77,112 +114,77 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DeidentificationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DeidentificationJobCustomizationOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DeidentificationResult() { } - public string OutputText { get { throw null; } } - public Azure.Health.Deidentification.PhiTaggerResult TaggerResult { get { throw null; } } + public DeidentificationJobCustomizationOptions() { } + public string RedactionFormat { get { throw null; } set { } } + public string SurrogateLocale { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.DeidentificationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.DeidentificationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.Health.Deidentification.DeidentificationJobCustomizationOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationJobCustomizationOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeidentificationJobSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeidentificationJobSummary() { } + public long BytesProcessed { get { throw null; } } + public int Canceled { get { throw null; } } + public int Failed { get { throw null; } } + public int Successful { get { throw null; } } + public int Total { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationJobSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationJobSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DocumentDataType : System.IEquatable + public readonly partial struct DeidentificationOperationType : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public DocumentDataType(string value) { throw null; } - public static Azure.Health.Deidentification.DocumentDataType Plaintext { get { throw null; } } - public bool Equals(Azure.Health.Deidentification.DocumentDataType other) { throw null; } + public DeidentificationOperationType(string value) { throw null; } + public static Azure.Health.Deidentification.DeidentificationOperationType Redact { get { throw null; } } + public static Azure.Health.Deidentification.DeidentificationOperationType Surrogate { get { throw null; } } + public static Azure.Health.Deidentification.DeidentificationOperationType Tag { get { throw null; } } + public bool Equals(Azure.Health.Deidentification.DeidentificationOperationType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Health.Deidentification.DocumentDataType left, Azure.Health.Deidentification.DocumentDataType right) { throw null; } - public static implicit operator Azure.Health.Deidentification.DocumentDataType (string value) { throw null; } - public static bool operator !=(Azure.Health.Deidentification.DocumentDataType left, Azure.Health.Deidentification.DocumentDataType right) { throw null; } + public static bool operator ==(Azure.Health.Deidentification.DeidentificationOperationType left, Azure.Health.Deidentification.DeidentificationOperationType right) { throw null; } + public static implicit operator Azure.Health.Deidentification.DeidentificationOperationType (string value) { throw null; } + public static bool operator !=(Azure.Health.Deidentification.DeidentificationOperationType left, Azure.Health.Deidentification.DeidentificationOperationType right) { throw null; } public override string ToString() { throw null; } } - public partial class DocumentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal DocumentDetails() { } - public Azure.ResponseError Error { get { throw null; } } - public string Id { get { throw null; } } - public Azure.Health.Deidentification.DocumentLocation Input { get { throw null; } } - public Azure.Health.Deidentification.DocumentLocation Output { get { throw null; } } - public Azure.Health.Deidentification.OperationState Status { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.DocumentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.DocumentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class DocumentLocation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DeidentificationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentLocation() { } - public Azure.ETag Etag { get { throw null; } } - public string Path { get { throw null; } } + internal DeidentificationResult() { } + public string OutputText { get { throw null; } } + public Azure.Health.Deidentification.PhiTaggerResult TaggerResult { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.DocumentLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.DocumentLocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.Health.Deidentification.DeidentificationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Deidentification.DeidentificationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public static partial class HealthDeidentificationModelFactory { - public static Azure.Health.Deidentification.DeidentificationContent DeidentificationContent(string inputText = null, Azure.Health.Deidentification.OperationType? operation = default(Azure.Health.Deidentification.OperationType?), Azure.Health.Deidentification.DocumentDataType? dataType = default(Azure.Health.Deidentification.DocumentDataType?), string redactionFormat = null) { throw null; } - public static Azure.Health.Deidentification.DeidentificationJob DeidentificationJob(string name = null, Azure.Health.Deidentification.SourceStorageLocation sourceLocation = null, Azure.Health.Deidentification.TargetStorageLocation targetLocation = null, Azure.Health.Deidentification.OperationType? operation = default(Azure.Health.Deidentification.OperationType?), Azure.Health.Deidentification.DocumentDataType? dataType = default(Azure.Health.Deidentification.DocumentDataType?), string redactionFormat = null, Azure.Health.Deidentification.JobStatus status = default(Azure.Health.Deidentification.JobStatus), Azure.ResponseError error = null, System.DateTimeOffset lastUpdatedAt = default(System.DateTimeOffset), System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset? startedAt = default(System.DateTimeOffset?), Azure.Health.Deidentification.JobSummary summary = null) { throw null; } + public static Azure.Health.Deidentification.DeidentificationContent DeidentificationContent(string inputText = null, Azure.Health.Deidentification.DeidentificationOperationType? operation = default(Azure.Health.Deidentification.DeidentificationOperationType?), Azure.Health.Deidentification.DeidentificationCustomizationOptions customizations = null) { throw null; } + public static Azure.Health.Deidentification.DeidentificationDocumentDetails DeidentificationDocumentDetails(string id = null, Azure.Health.Deidentification.DeidentificationDocumentLocation input = null, Azure.Health.Deidentification.DeidentificationDocumentLocation output = null, Azure.Health.Deidentification.OperationState status = default(Azure.Health.Deidentification.OperationState), Azure.ResponseError error = null) { throw null; } + public static Azure.Health.Deidentification.DeidentificationDocumentLocation DeidentificationDocumentLocation(System.Uri location = null, Azure.ETag etag = default(Azure.ETag)) { throw null; } + public static Azure.Health.Deidentification.DeidentificationJob DeidentificationJob(string name = null, Azure.Health.Deidentification.DeidentificationOperationType? operation = default(Azure.Health.Deidentification.DeidentificationOperationType?), Azure.Health.Deidentification.SourceStorageLocation sourceLocation = null, Azure.Health.Deidentification.TargetStorageLocation targetLocation = null, Azure.Health.Deidentification.DeidentificationJobCustomizationOptions customizations = null, Azure.Health.Deidentification.OperationState status = default(Azure.Health.Deidentification.OperationState), Azure.ResponseError error = null, System.DateTimeOffset lastUpdatedAt = default(System.DateTimeOffset), System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset? startedAt = default(System.DateTimeOffset?), Azure.Health.Deidentification.DeidentificationJobSummary summary = null) { throw null; } + public static Azure.Health.Deidentification.DeidentificationJobSummary DeidentificationJobSummary(int successful = 0, int failed = 0, int canceled = 0, int total = 0, long bytesProcessed = (long)0) { throw null; } public static Azure.Health.Deidentification.DeidentificationResult DeidentificationResult(string outputText = null, Azure.Health.Deidentification.PhiTaggerResult taggerResult = null) { throw null; } - public static Azure.Health.Deidentification.DocumentDetails DocumentDetails(string id = null, Azure.Health.Deidentification.DocumentLocation input = null, Azure.Health.Deidentification.DocumentLocation output = null, Azure.Health.Deidentification.OperationState status = default(Azure.Health.Deidentification.OperationState), Azure.ResponseError error = null) { throw null; } - public static Azure.Health.Deidentification.DocumentLocation DocumentLocation(string path = null, Azure.ETag etag = default(Azure.ETag)) { throw null; } - public static Azure.Health.Deidentification.JobSummary JobSummary(int successful = 0, int failed = 0, int canceled = 0, int total = 0, long bytesProcessed = (long)0) { throw null; } public static Azure.Health.Deidentification.PhiEntity PhiEntity(Azure.Health.Deidentification.PhiCategory category = default(Azure.Health.Deidentification.PhiCategory), Azure.Health.Deidentification.StringIndex offset = null, Azure.Health.Deidentification.StringIndex length = null, string text = null, double? confidenceScore = default(double?)) { throw null; } - public static Azure.Health.Deidentification.PhiTaggerResult PhiTaggerResult(System.Collections.Generic.IEnumerable entities = null, string path = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.Health.Deidentification.PhiTaggerResult PhiTaggerResult(System.Collections.Generic.IEnumerable entities = null) { throw null; } public static Azure.Health.Deidentification.StringIndex StringIndex(int utf8 = 0, int utf16 = 0, int codePoint = 0) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct JobStatus : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public JobStatus(string value) { throw null; } - public static Azure.Health.Deidentification.JobStatus Canceled { get { throw null; } } - public static Azure.Health.Deidentification.JobStatus Failed { get { throw null; } } - public static Azure.Health.Deidentification.JobStatus NotStarted { get { throw null; } } - public static Azure.Health.Deidentification.JobStatus PartialFailed { get { throw null; } } - public static Azure.Health.Deidentification.JobStatus Running { get { throw null; } } - public static Azure.Health.Deidentification.JobStatus Succeeded { get { throw null; } } - public bool Equals(Azure.Health.Deidentification.JobStatus other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Health.Deidentification.JobStatus left, Azure.Health.Deidentification.JobStatus right) { throw null; } - public static implicit operator Azure.Health.Deidentification.JobStatus (string value) { throw null; } - public static bool operator !=(Azure.Health.Deidentification.JobStatus left, Azure.Health.Deidentification.JobStatus right) { throw null; } - public override string ToString() { throw null; } - } - public partial class JobSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal JobSummary() { } - public long BytesProcessed { get { throw null; } } - public int Canceled { get { throw null; } } - public int Failed { get { throw null; } } - public int Successful { get { throw null; } } - public int Total { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.JobSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Deidentification.JobSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct OperationState : System.IEquatable { private readonly object _dummy; @@ -204,25 +206,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct OperationType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public OperationType(string value) { throw null; } - public static Azure.Health.Deidentification.OperationType Redact { get { throw null; } } - public static Azure.Health.Deidentification.OperationType Surrogate { get { throw null; } } - public static Azure.Health.Deidentification.OperationType Tag { get { throw null; } } - public bool Equals(Azure.Health.Deidentification.OperationType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Health.Deidentification.OperationType left, Azure.Health.Deidentification.OperationType right) { throw null; } - public static implicit operator Azure.Health.Deidentification.OperationType (string value) { throw null; } - public static bool operator !=(Azure.Health.Deidentification.OperationType left, Azure.Health.Deidentification.OperationType right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct PhiCategory : System.IEquatable { private readonly object _dummy; @@ -286,8 +269,6 @@ public partial class PhiTaggerResult : System.ClientModel.Primitives.IJsonModel< { internal PhiTaggerResult() { } public System.Collections.Generic.IReadOnlyList Entities { get { throw null; } } - public Azure.ETag? Etag { get { throw null; } } - public string Path { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Deidentification.PhiTaggerResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -325,6 +306,7 @@ public partial class TargetStorageLocation : System.ClientModel.Primitives.IJson { public TargetStorageLocation(System.Uri location, string prefix) { } public System.Uri Location { get { throw null; } set { } } + public bool? Overwrite { get { throw null; } set { } } public string Prefix { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Deidentification.TargetStorageLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/assets.json b/sdk/healthdataaiservices/Azure.Health.Deidentification/assets.json index 6b99266787b7..e7c2b6ac99b7 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/assets.json +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/assets.json @@ -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" } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample1_HelloWorld.md b/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample1_HelloWorld.md index 52fd1a443025..08f1460ceb44 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample1_HelloWorld.md +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample1_HelloWorld.md @@ -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 result = client.Deidentify(content); +Response result = client.DeidentifyText(content); string outputString = result.Value.OutputText; Console.WriteLine(outputString); // Hello, Tom! ``` diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample1_HelloWorldAsync.md b/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample1_HelloWorldAsync.md index 644c7cbabe72..fc88a261985c 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample1_HelloWorldAsync.md +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample1_HelloWorldAsync.md @@ -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 result = await client.DeidentifyAsync(content); +Response result = await client.DeidentifyTextAsync(content); string outputString = result.Value.OutputText; Console.WriteLine(outputString); // Hello, Tom! ``` diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample2_CreateJob.md b/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample2_CreateJob.md index 97d4c98f9698..131a2b4d6b6c 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample2_CreateJob.md +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample2_CreateJob.md @@ -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 ``` diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample2_CreateJobAsync.md b/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample2_CreateJobAsync.md index 0a64e294e38a..75ca7a22e768 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample2_CreateJobAsync.md +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample2_CreateJobAsync.md @@ -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 ``` diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample4_ListCompletedFiles.md b/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample4_ListCompletedFiles.md index 438f6ce8f43c..82afb9470a4b 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample4_ListCompletedFiles.md +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample4_ListCompletedFiles.md @@ -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 files = client.GetJobDocuments("job-name-1"); +Pageable 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}"); } ``` diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample4_ListCompletedFilesAsync.md b/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample4_ListCompletedFilesAsync.md index 43447cd0f513..3e3cefa0b0e4 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample4_ListCompletedFilesAsync.md +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/samples/Sample4_ListCompletedFilesAsync.md @@ -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 files = client.GetJobDocumentsAsync("job-name-1"); +AsyncPageable 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}"); } ``` diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Azure.Health.Deidentification.csproj b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Azure.Health.Deidentification.csproj index 2acdc9bf6974..c485aad66499 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Azure.Health.Deidentification.csproj +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Azure.Health.Deidentification.csproj @@ -2,7 +2,7 @@ This is the Azure.Health.Deidentification client library for developing .NET applications with rich experience. Azure SDK Code Generation Azure.Health.Deidentification for Azure Data Plane - 1.0.0-beta.2 + 1.0.0 Azure.Health.Deidentification $(RequiredTargetFrameworks) true @@ -11,6 +11,7 @@ + diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/DeidentificationClient.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/DeidentificationClient.cs new file mode 100644 index 000000000000..a83ed65af420 --- /dev/null +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/DeidentificationClient.cs @@ -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. + /// The Deidentification service client. + public partial class DeidentificationClient + { + /// List de-identification jobs. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// Resource list operation template. + [ForwardsClientCalls] + public virtual AsyncPageable GetJobsAsync(int? maxpagesize = null, CancellationToken cancellationToken = default) + { + using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobs"); + scope.Start(); + return GetJobsInternalsAsync(maxpagesize, null, cancellationToken); + } + + /// List de-identification jobs. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// Resource list operation template. + [ForwardsClientCalls] + public virtual Pageable GetJobs(int? maxpagesize = null, CancellationToken cancellationToken = default) + { + using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobs"); + scope.Start(); + return GetJobsInternals(maxpagesize, null, cancellationToken); + } + + /// + /// [Protocol Method] List de-identification jobs. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + [ForwardsClientCalls] + public virtual AsyncPageable GetJobsAsync(int? maxpagesize, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobs"); + scope.Start(); + return GetJobsInternalsAsync(maxpagesize, null, context); + } + + /// + /// [Protocol Method] List de-identification jobs. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + [ForwardsClientCalls] + public virtual Pageable GetJobs(int? maxpagesize, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobs"); + scope.Start(); + return GetJobsInternals(maxpagesize, null, context); + } + + /// List processed documents within a job. + /// The name of a job. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// The most basic operation. + [ForwardsClientCalls] + public virtual AsyncPageable GetJobDocumentsAsync(string jobName, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobDocuments"); + scope.Start(); + return GetJobDocumentsInternalsAsync(jobName, maxpagesize, null, cancellationToken); + } + + /// List processed documents within a job. + /// The name of a job. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// The most basic operation. + [ForwardsClientCalls] + public virtual Pageable GetJobDocuments(string jobName, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobDocuments"); + scope.Start(); + return GetJobDocumentsInternals(jobName, maxpagesize, null, cancellationToken); + } + + /// + /// [Protocol Method] List processed documents within a job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of a job. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + [ForwardsClientCalls] + public virtual AsyncPageable GetJobDocumentsAsync(string jobName, int? maxpagesize, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobDocuments"); + scope.Start(); + return GetJobDocumentsInternalsAsync(jobName, maxpagesize, null, context); + } + + /// + /// [Protocol Method] List processed documents within a job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of a job. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + [ForwardsClientCalls] + public virtual Pageable GetJobDocuments(string jobName, int? maxpagesize, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.GetJobDocuments"); + scope.Start(); + return GetJobDocumentsInternals(jobName, maxpagesize, null, context); + } + } +} diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationClient.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationClient.cs index 9e8bd5d96d54..51009159901b 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationClient.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationClient.cs @@ -370,34 +370,34 @@ public virtual Response DeleteJob(string name, RequestContext context = null) } /// De-identify text. - /// Request body for de-identification operation. + /// Request body for de-identification operation. /// The cancellation token to use. - /// is null. + /// is null. /// A remote procedure call (RPC) operation. - /// - public virtual async Task> DeidentifyAsync(DeidentificationContent body, CancellationToken cancellationToken = default) + /// + public virtual async Task> DeidentifyTextAsync(DeidentificationContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNull(content, nameof(content)); - using RequestContent content = body.ToRequestContent(); + using RequestContent content0 = content.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DeidentifyAsync(content, context).ConfigureAwait(false); + Response response = await DeidentifyTextAsync(content0, context).ConfigureAwait(false); return Response.FromValue(DeidentificationResult.FromResponse(response), response); } /// De-identify text. - /// Request body for de-identification operation. + /// Request body for de-identification operation. /// The cancellation token to use. - /// is null. + /// is null. /// A remote procedure call (RPC) operation. - /// - public virtual Response Deidentify(DeidentificationContent body, CancellationToken cancellationToken = default) + /// + public virtual Response DeidentifyText(DeidentificationContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNull(content, nameof(content)); - using RequestContent content = body.ToRequestContent(); + using RequestContent content0 = content.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Deidentify(content, context); + Response response = DeidentifyText(content0, context); return Response.FromValue(DeidentificationResult.FromResponse(response), response); } @@ -411,7 +411,7 @@ public virtual Response Deidentify(DeidentificationConte /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -421,16 +421,16 @@ public virtual Response Deidentify(DeidentificationConte /// is null. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task DeidentifyAsync(RequestContent content, RequestContext context = null) + /// + public virtual async Task DeidentifyTextAsync(RequestContent content, RequestContext context = null) { Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.Deidentify"); + using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.DeidentifyText"); scope.Start(); try { - using HttpMessage message = CreateDeidentifyRequest(content, context); + using HttpMessage message = CreateDeidentifyTextRequest(content, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -450,7 +450,7 @@ public virtual async Task DeidentifyAsync(RequestContent content, Requ /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -460,16 +460,16 @@ public virtual async Task DeidentifyAsync(RequestContent content, Requ /// is null. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response Deidentify(RequestContent content, RequestContext context = null) + /// + public virtual Response DeidentifyText(RequestContent content, RequestContext context = null) { Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.Deidentify"); + using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.DeidentifyText"); scope.Start(); try { - using HttpMessage message = CreateDeidentifyRequest(content, context); + using HttpMessage message = CreateDeidentifyTextRequest(content, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -484,13 +484,12 @@ public virtual Response Deidentify(RequestContent content, RequestContext contex /// Token to continue a previous query. /// The cancellation token to use. /// Resource list operation template. - /// - public virtual AsyncPageable GetJobsAsync(int? maxpagesize = null, string continuationToken = null, CancellationToken cancellationToken = default) + internal virtual AsyncPageable GetJobsInternalsAsync(int? maxpagesize = null, string continuationToken = null, CancellationToken cancellationToken = default) { RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsRequest(pageSizeHint, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsNextPageRequest(nextLink, pageSizeHint, continuationToken, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DeidentificationJob.DeserializeDeidentificationJob(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobs", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsInternalsRequest(pageSizeHint, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsInternalsNextPageRequest(nextLink, pageSizeHint, continuationToken, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DeidentificationJob.DeserializeDeidentificationJob(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobsInternals", "value", "nextLink", maxpagesize, context); } /// List de-identification jobs. @@ -498,13 +497,12 @@ public virtual AsyncPageable GetJobsAsync(int? maxpagesize /// Token to continue a previous query. /// The cancellation token to use. /// Resource list operation template. - /// - public virtual Pageable GetJobs(int? maxpagesize = null, string continuationToken = null, CancellationToken cancellationToken = default) + internal virtual Pageable GetJobsInternals(int? maxpagesize = null, string continuationToken = null, CancellationToken cancellationToken = default) { RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsRequest(pageSizeHint, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsNextPageRequest(nextLink, pageSizeHint, continuationToken, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DeidentificationJob.DeserializeDeidentificationJob(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobs", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsInternalsRequest(pageSizeHint, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsInternalsNextPageRequest(nextLink, pageSizeHint, continuationToken, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DeidentificationJob.DeserializeDeidentificationJob(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobsInternals", "value", "nextLink", maxpagesize, context); } /// @@ -517,7 +515,7 @@ public virtual Pageable GetJobs(int? maxpagesize = null, st /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -527,12 +525,11 @@ public virtual Pageable GetJobs(int? maxpagesize = null, st /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// Service returned a non-success status code. /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetJobsAsync(int? maxpagesize, string continuationToken, RequestContext context) + internal virtual AsyncPageable GetJobsInternalsAsync(int? maxpagesize, string continuationToken, RequestContext context) { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsRequest(pageSizeHint, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsNextPageRequest(nextLink, pageSizeHint, continuationToken, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobs", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsInternalsRequest(pageSizeHint, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsInternalsNextPageRequest(nextLink, pageSizeHint, continuationToken, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobsInternals", "value", "nextLink", maxpagesize, context); } /// @@ -545,7 +542,7 @@ public virtual AsyncPageable GetJobsAsync(int? maxpagesize, string c /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -555,12 +552,11 @@ public virtual AsyncPageable GetJobsAsync(int? maxpagesize, string c /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// Service returned a non-success status code. /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetJobs(int? maxpagesize, string continuationToken, RequestContext context) + internal virtual Pageable GetJobsInternals(int? maxpagesize, string continuationToken, RequestContext context) { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsRequest(pageSizeHint, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsNextPageRequest(nextLink, pageSizeHint, continuationToken, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobs", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsInternalsRequest(pageSizeHint, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsInternalsNextPageRequest(nextLink, pageSizeHint, continuationToken, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobsInternals", "value", "nextLink", maxpagesize, context); } /// List processed documents within a job. @@ -571,15 +567,14 @@ public virtual Pageable GetJobs(int? maxpagesize, string continuatio /// is null. /// is an empty string, and was expected to be non-empty. /// Resource list operation template. - /// - public virtual AsyncPageable GetJobDocumentsAsync(string name, int? maxpagesize = null, string continuationToken = null, CancellationToken cancellationToken = default) + internal virtual AsyncPageable GetJobDocumentsInternalsAsync(string name, int? maxpagesize = null, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobDocumentsRequest(name, pageSizeHint, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsNextPageRequest(nextLink, name, pageSizeHint, continuationToken, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DocumentDetails.DeserializeDocumentDetails(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocuments", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobDocumentsInternalsRequest(name, pageSizeHint, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsInternalsNextPageRequest(nextLink, name, pageSizeHint, continuationToken, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DeidentificationDocumentDetails.DeserializeDeidentificationDocumentDetails(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocumentsInternals", "value", "nextLink", maxpagesize, context); } /// List processed documents within a job. @@ -590,15 +585,14 @@ public virtual AsyncPageable GetJobDocumentsAsync(string name, /// is null. /// is an empty string, and was expected to be non-empty. /// Resource list operation template. - /// - public virtual Pageable GetJobDocuments(string name, int? maxpagesize = null, string continuationToken = null, CancellationToken cancellationToken = default) + internal virtual Pageable GetJobDocumentsInternals(string name, int? maxpagesize = null, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobDocumentsRequest(name, pageSizeHint, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsNextPageRequest(nextLink, name, pageSizeHint, continuationToken, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DocumentDetails.DeserializeDocumentDetails(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocuments", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobDocumentsInternalsRequest(name, pageSizeHint, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsInternalsNextPageRequest(nextLink, name, pageSizeHint, continuationToken, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DeidentificationDocumentDetails.DeserializeDeidentificationDocumentDetails(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocumentsInternals", "value", "nextLink", maxpagesize, context); } /// @@ -611,7 +605,7 @@ public virtual Pageable GetJobDocuments(string name, int? maxpa /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -624,14 +618,13 @@ public virtual Pageable GetJobDocuments(string name, int? maxpa /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetJobDocumentsAsync(string name, int? maxpagesize, string continuationToken, RequestContext context) + internal virtual AsyncPageable GetJobDocumentsInternalsAsync(string name, int? maxpagesize, string continuationToken, RequestContext context) { Argument.AssertNotNullOrEmpty(name, nameof(name)); - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobDocumentsRequest(name, pageSizeHint, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsNextPageRequest(nextLink, name, pageSizeHint, continuationToken, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocuments", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobDocumentsInternalsRequest(name, pageSizeHint, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsInternalsNextPageRequest(nextLink, name, pageSizeHint, continuationToken, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocumentsInternals", "value", "nextLink", maxpagesize, context); } /// @@ -644,7 +637,7 @@ public virtual AsyncPageable GetJobDocumentsAsync(string name, int? /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -657,14 +650,13 @@ public virtual AsyncPageable GetJobDocumentsAsync(string name, int? /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetJobDocuments(string name, int? maxpagesize, string continuationToken, RequestContext context) + internal virtual Pageable GetJobDocumentsInternals(string name, int? maxpagesize, string continuationToken, RequestContext context) { Argument.AssertNotNullOrEmpty(name, nameof(name)); - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobDocumentsRequest(name, pageSizeHint, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsNextPageRequest(nextLink, name, pageSizeHint, continuationToken, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocuments", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobDocumentsInternalsRequest(name, pageSizeHint, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsInternalsNextPageRequest(nextLink, name, pageSizeHint, continuationToken, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocumentsInternals", "value", "nextLink", maxpagesize, context); } /// Create a de-identification job. @@ -675,16 +667,16 @@ public virtual Pageable GetJobDocuments(string name, int? maxpagesiz /// or is null. /// is an empty string, and was expected to be non-empty. /// Long-running resource create or replace operation template. - /// - public virtual async Task> CreateJobAsync(WaitUntil waitUntil, string name, DeidentificationJob resource, CancellationToken cancellationToken = default) + /// + public virtual async Task> DeidentifyDocumentsAsync(WaitUntil waitUntil, string name, DeidentificationJob resource, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNull(resource, nameof(resource)); using RequestContent content = resource.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await CreateJobAsync(waitUntil, name, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, DeidentificationJob.FromResponse, ClientDiagnostics, "DeidentificationClient.CreateJob"); + Operation response = await DeidentifyDocumentsAsync(waitUntil, name, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, DeidentificationJob.FromResponse, ClientDiagnostics, "DeidentificationClient.DeidentifyDocuments"); } /// Create a de-identification job. @@ -695,16 +687,16 @@ public virtual async Task> CreateJobAsync(WaitUnt /// or is null. /// is an empty string, and was expected to be non-empty. /// Long-running resource create or replace operation template. - /// - public virtual Operation CreateJob(WaitUntil waitUntil, string name, DeidentificationJob resource, CancellationToken cancellationToken = default) + /// + public virtual Operation DeidentifyDocuments(WaitUntil waitUntil, string name, DeidentificationJob resource, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNull(resource, nameof(resource)); using RequestContent content = resource.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Operation response = CreateJob(waitUntil, name, content, context); - return ProtocolOperationHelpers.Convert(response, DeidentificationJob.FromResponse, ClientDiagnostics, "DeidentificationClient.CreateJob"); + Operation response = DeidentifyDocuments(waitUntil, name, content, context); + return ProtocolOperationHelpers.Convert(response, DeidentificationJob.FromResponse, ClientDiagnostics, "DeidentificationClient.DeidentifyDocuments"); } /// @@ -717,7 +709,7 @@ public virtual Operation CreateJob(WaitUntil waitUntil, str /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -730,18 +722,18 @@ public virtual Operation CreateJob(WaitUntil waitUntil, str /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The representing an asynchronous operation on the service. - /// - public virtual async Task> CreateJobAsync(WaitUntil waitUntil, string name, RequestContent content, RequestContext context = null) + /// + public virtual async Task> DeidentifyDocumentsAsync(WaitUntil waitUntil, string name, RequestContent content, RequestContext context = null) { Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.CreateJob"); + using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.DeidentifyDocuments"); scope.Start(); try { - using HttpMessage message = CreateCreateJobRequest(name, content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DeidentificationClient.CreateJob", OperationFinalStateVia.OriginalUri, context, waitUntil).ConfigureAwait(false); + using HttpMessage message = CreateDeidentifyDocumentsRequest(name, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DeidentificationClient.DeidentifyDocuments", OperationFinalStateVia.OriginalUri, context, waitUntil).ConfigureAwait(false); } catch (Exception e) { @@ -760,7 +752,7 @@ public virtual async Task> CreateJobAsync(WaitUntil waitUn /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -773,18 +765,18 @@ public virtual async Task> CreateJobAsync(WaitUntil waitUn /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The representing an asynchronous operation on the service. - /// - public virtual Operation CreateJob(WaitUntil waitUntil, string name, RequestContent content, RequestContext context = null) + /// + public virtual Operation DeidentifyDocuments(WaitUntil waitUntil, string name, RequestContent content, RequestContext context = null) { Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.CreateJob"); + using var scope = ClientDiagnostics.CreateScope("DeidentificationClient.DeidentifyDocuments"); scope.Start(); try { - using HttpMessage message = CreateCreateJobRequest(name, content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DeidentificationClient.CreateJob", OperationFinalStateVia.OriginalUri, context, waitUntil); + using HttpMessage message = CreateDeidentifyDocumentsRequest(name, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DeidentificationClient.DeidentifyDocuments", OperationFinalStateVia.OriginalUri, context, waitUntil); } catch (Exception e) { @@ -799,7 +791,6 @@ internal HttpMessage CreateGetJobRequest(string name, RequestContext context) var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); - uri.AppendRaw("https://", false); uri.Reset(_endpoint); uri.AppendPath("/jobs/", false); uri.AppendPath(name, true); @@ -809,13 +800,12 @@ internal HttpMessage CreateGetJobRequest(string name, RequestContext context) return message; } - internal HttpMessage CreateCreateJobRequest(string name, RequestContent content, RequestContext context) + internal HttpMessage CreateDeidentifyDocumentsRequest(string name, RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200201); var request = message.Request; request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); - uri.AppendRaw("https://", false); uri.Reset(_endpoint); uri.AppendPath("/jobs/", false); uri.AppendPath(name, true); @@ -827,13 +817,12 @@ internal HttpMessage CreateCreateJobRequest(string name, RequestContent content, return message; } - internal HttpMessage CreateGetJobsRequest(int? maxpagesize, string continuationToken, RequestContext context) + internal HttpMessage CreateGetJobsInternalsRequest(int? maxpagesize, string continuationToken, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); - uri.AppendRaw("https://", false); uri.Reset(_endpoint); uri.AppendPath("/jobs", false); uri.AppendQuery("api-version", _apiVersion, true); @@ -850,13 +839,12 @@ internal HttpMessage CreateGetJobsRequest(int? maxpagesize, string continuationT return message; } - internal HttpMessage CreateGetJobDocumentsRequest(string name, int? maxpagesize, string continuationToken, RequestContext context) + internal HttpMessage CreateGetJobDocumentsInternalsRequest(string name, int? maxpagesize, string continuationToken, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); - uri.AppendRaw("https://", false); uri.Reset(_endpoint); uri.AppendPath("/jobs/", false); uri.AppendPath(name, true); @@ -881,7 +869,6 @@ internal HttpMessage CreateCancelJobRequest(string name, RequestContext context) var request = message.Request; request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); - uri.AppendRaw("https://", false); uri.Reset(_endpoint); uri.AppendPath("/jobs/", false); uri.AppendPath(name, true); @@ -898,7 +885,6 @@ internal HttpMessage CreateDeleteJobRequest(string name, RequestContext context) var request = message.Request; request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); - uri.AppendRaw("https://", false); uri.Reset(_endpoint); uri.AppendPath("/jobs/", false); uri.AppendPath(name, true); @@ -908,13 +894,12 @@ internal HttpMessage CreateDeleteJobRequest(string name, RequestContext context) return message; } - internal HttpMessage CreateDeidentifyRequest(RequestContent content, RequestContext context) + internal HttpMessage CreateDeidentifyTextRequest(RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); - uri.AppendRaw("https://", false); uri.Reset(_endpoint); uri.AppendPath("/deid", false); uri.AppendQuery("api-version", _apiVersion, true); @@ -925,13 +910,12 @@ internal HttpMessage CreateDeidentifyRequest(RequestContent content, RequestCont return message; } - internal HttpMessage CreateGetJobsNextPageRequest(string nextLink, int? maxpagesize, string continuationToken, RequestContext context) + internal HttpMessage CreateGetJobsInternalsNextPageRequest(string nextLink, int? maxpagesize, string continuationToken, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); - uri.AppendRaw("https://", false); uri.Reset(_endpoint); uri.AppendRawNextLink(nextLink, false); request.Uri = uri; @@ -939,13 +923,12 @@ internal HttpMessage CreateGetJobsNextPageRequest(string nextLink, int? maxpages return message; } - internal HttpMessage CreateGetJobDocumentsNextPageRequest(string nextLink, string name, int? maxpagesize, string continuationToken, RequestContext context) + internal HttpMessage CreateGetJobDocumentsInternalsNextPageRequest(string nextLink, string name, int? maxpagesize, string continuationToken, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); - uri.AppendRaw("https://", false); uri.Reset(_endpoint); uri.AppendRawNextLink(nextLink, false); request.Uri = uri; diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationClientOptions.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationClientOptions.cs index 175092a43a01..110084543c7f 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationClientOptions.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationClientOptions.cs @@ -13,13 +13,13 @@ namespace Azure.Health.Deidentification /// Client options for DeidentificationClient. public partial class DeidentificationClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2024_07_12_Preview; + private const ServiceVersion LatestVersion = ServiceVersion.V2024_11_15; /// The version of the service to use. public enum ServiceVersion { - /// Service version "2024-07-12-preview". - V2024_07_12_Preview = 1, + /// Service version "2024-11-15". + V2024_11_15 = 1, } internal string Version { get; } @@ -29,7 +29,7 @@ public DeidentificationClientOptions(ServiceVersion version = LatestVersion) { Version = version switch { - ServiceVersion.V2024_07_12_Preview => "2024-07-12-preview", + ServiceVersion.V2024_11_15 => "2024-11-15", _ => throw new NotSupportedException() }; } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationContent.Serialization.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationContent.Serialization.cs index 8461dbf7e715..8858fb33dc03 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationContent.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationContent.Serialization.cs @@ -41,15 +41,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("operation"u8); writer.WriteStringValue(Operation.Value.ToString()); } - if (Optional.IsDefined(DataType)) + if (Optional.IsDefined(Customizations)) { - writer.WritePropertyName("dataType"u8); - writer.WriteStringValue(DataType.Value.ToString()); - } - if (Optional.IsDefined(RedactionFormat)) - { - writer.WritePropertyName("redactionFormat"u8); - writer.WriteStringValue(RedactionFormat); + writer.WritePropertyName("customizations"u8); + writer.WriteObjectValue(Customizations, options); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -89,9 +84,8 @@ internal static DeidentificationContent DeserializeDeidentificationContent(JsonE return null; } string inputText = default; - OperationType? operation = default; - DocumentDataType? dataType = default; - string redactionFormat = default; + DeidentificationOperationType? operation = default; + DeidentificationCustomizationOptions customizations = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -107,21 +101,16 @@ internal static DeidentificationContent DeserializeDeidentificationContent(JsonE { continue; } - operation = new OperationType(property.Value.GetString()); + operation = new DeidentificationOperationType(property.Value.GetString()); continue; } - if (property.NameEquals("dataType"u8)) + if (property.NameEquals("customizations"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - dataType = new DocumentDataType(property.Value.GetString()); - continue; - } - if (property.NameEquals("redactionFormat"u8)) - { - redactionFormat = property.Value.GetString(); + customizations = DeidentificationCustomizationOptions.DeserializeDeidentificationCustomizationOptions(property.Value, options); continue; } if (options.Format != "W") @@ -130,7 +119,7 @@ internal static DeidentificationContent DeserializeDeidentificationContent(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new DeidentificationContent(inputText, operation, dataType, redactionFormat, serializedAdditionalRawData); + return new DeidentificationContent(inputText, operation, customizations, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationContent.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationContent.cs index 64d542e67a4c..c4986ddf0282 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationContent.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationContent.cs @@ -57,16 +57,14 @@ public DeidentificationContent(string inputText) /// Initializes a new instance of . /// Input text to de-identify. - /// Operation to perform on the input. - /// Data type of the input. - /// Format of the redacted output. Only valid when OperationType is "Redact". + /// Operation to perform on the input documents. + /// Customization parameters to override default service behaviors. /// Keeps track of any properties unknown to the library. - internal DeidentificationContent(string inputText, OperationType? operation, DocumentDataType? dataType, string redactionFormat, IDictionary serializedAdditionalRawData) + internal DeidentificationContent(string inputText, DeidentificationOperationType? operation, DeidentificationCustomizationOptions customizations, IDictionary serializedAdditionalRawData) { InputText = inputText; Operation = operation; - DataType = dataType; - RedactionFormat = redactionFormat; + Customizations = customizations; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -77,11 +75,9 @@ internal DeidentificationContent() /// Input text to de-identify. public string InputText { get; } - /// Operation to perform on the input. - public OperationType? Operation { get; set; } - /// Data type of the input. - public DocumentDataType? DataType { get; set; } - /// Format of the redacted output. Only valid when OperationType is "Redact". - public string RedactionFormat { get; set; } + /// Operation to perform on the input documents. + public DeidentificationOperationType? Operation { get; set; } + /// Customization parameters to override default service behaviors. + public DeidentificationCustomizationOptions Customizations { get; set; } } } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationCustomizationOptions.Serialization.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationCustomizationOptions.Serialization.cs new file mode 100644 index 000000000000..d39fc11d71df --- /dev/null +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationCustomizationOptions.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Deidentification +{ + public partial class DeidentificationCustomizationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeidentificationCustomizationOptions)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RedactionFormat)) + { + writer.WritePropertyName("redactionFormat"u8); + writer.WriteStringValue(RedactionFormat); + } + if (Optional.IsDefined(SurrogateLocale)) + { + writer.WritePropertyName("surrogateLocale"u8); + writer.WriteStringValue(SurrogateLocale); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeidentificationCustomizationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeidentificationCustomizationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeidentificationCustomizationOptions(document.RootElement, options); + } + + internal static DeidentificationCustomizationOptions DeserializeDeidentificationCustomizationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string redactionFormat = default; + string surrogateLocale = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("redactionFormat"u8)) + { + redactionFormat = property.Value.GetString(); + continue; + } + if (property.NameEquals("surrogateLocale"u8)) + { + surrogateLocale = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeidentificationCustomizationOptions(redactionFormat, surrogateLocale, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeidentificationCustomizationOptions)} does not support writing '{options.Format}' format."); + } + } + + DeidentificationCustomizationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeidentificationCustomizationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeidentificationCustomizationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeidentificationCustomizationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeidentificationCustomizationOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationCustomizationOptions.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationCustomizationOptions.cs new file mode 100644 index 000000000000..b54a3e2b4225 --- /dev/null +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationCustomizationOptions.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Deidentification +{ + /// Customizations options to override default service behaviors for synchronous usage. + public partial class DeidentificationCustomizationOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeidentificationCustomizationOptions() + { + } + + /// Initializes a new instance of . + /// + /// Format of the redacted output. Only valid when Operation is Redact. + /// Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details. + /// + /// Locale in which the output surrogates are written. + /// Keeps track of any properties unknown to the library. + internal DeidentificationCustomizationOptions(string redactionFormat, string surrogateLocale, IDictionary serializedAdditionalRawData) + { + RedactionFormat = redactionFormat; + SurrogateLocale = surrogateLocale; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Format of the redacted output. Only valid when Operation is Redact. + /// Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details. + /// + public string RedactionFormat { get; set; } + /// Locale in which the output surrogates are written. + public string SurrogateLocale { get; set; } + } +} diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentDetails.Serialization.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationDocumentDetails.Serialization.cs similarity index 68% rename from sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentDetails.Serialization.cs rename to sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationDocumentDetails.Serialization.cs index 69c6734b7c9d..d6eeaf3b83be 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentDetails.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationDocumentDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.Health.Deidentification { - public partial class DocumentDetails : IUtf8JsonSerializable, IJsonModel + public partial class DeidentificationDocumentDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DocumentDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeidentificationDocumentDetails)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -70,19 +70,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DocumentDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeidentificationDocumentDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DocumentDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeidentificationDocumentDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDocumentDetails(document.RootElement, options); + return DeserializeDeidentificationDocumentDetails(document.RootElement, options); } - internal static DocumentDetails DeserializeDocumentDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeidentificationDocumentDetails DeserializeDeidentificationDocumentDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -91,8 +91,8 @@ internal static DocumentDetails DeserializeDocumentDetails(JsonElement element, return null; } string id = default; - DocumentLocation input = default; - DocumentLocation output = default; + DeidentificationDocumentLocation input = default; + DeidentificationDocumentLocation output = default; OperationState status = default; ResponseError error = default; IDictionary serializedAdditionalRawData = default; @@ -106,7 +106,7 @@ internal static DocumentDetails DeserializeDocumentDetails(JsonElement element, } if (property.NameEquals("input"u8)) { - input = DocumentLocation.DeserializeDocumentLocation(property.Value, options); + input = DeidentificationDocumentLocation.DeserializeDeidentificationDocumentLocation(property.Value, options); continue; } if (property.NameEquals("output"u8)) @@ -115,7 +115,7 @@ internal static DocumentDetails DeserializeDocumentDetails(JsonElement element, { continue; } - output = DocumentLocation.DeserializeDocumentLocation(property.Value, options); + output = DeidentificationDocumentLocation.DeserializeDeidentificationDocumentLocation(property.Value, options); continue; } if (property.NameEquals("status"u8)) @@ -138,7 +138,7 @@ internal static DocumentDetails DeserializeDocumentDetails(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new DocumentDetails( + return new DeidentificationDocumentDetails( id, input, output, @@ -147,43 +147,43 @@ internal static DocumentDetails DeserializeDocumentDetails(JsonElement element, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DocumentDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeidentificationDocumentDetails)} does not support writing '{options.Format}' format."); } } - DocumentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeidentificationDocumentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDocumentDetails(document.RootElement, options); + return DeserializeDeidentificationDocumentDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DocumentDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeidentificationDocumentDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static DocumentDetails FromResponse(Response response) + internal static DeidentificationDocumentDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentDetails(document.RootElement); + return DeserializeDeidentificationDocumentDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentDetails.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationDocumentDetails.cs similarity index 81% rename from sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentDetails.cs rename to sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationDocumentDetails.cs index 59685c4d8e57..85a3b275b05f 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentDetails.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationDocumentDetails.cs @@ -11,7 +11,7 @@ namespace Azure.Health.Deidentification { /// Details of a single document in a job. - public partial class DocumentDetails + public partial class DeidentificationDocumentDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class DocumentDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Location for the input. /// Status of the document. /// is null. - internal DocumentDetails(DocumentLocation input, OperationState status) + internal DeidentificationDocumentDetails(DeidentificationDocumentLocation input, OperationState status) { Argument.AssertNotNull(input, nameof(input)); @@ -57,14 +57,14 @@ internal DocumentDetails(DocumentLocation input, OperationState status) Status = status; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Id of the document details. /// Location for the input. /// Location for the output. /// Status of the document. /// Error when document fails. /// Keeps track of any properties unknown to the library. - internal DocumentDetails(string id, DocumentLocation input, DocumentLocation output, OperationState status, ResponseError error, IDictionary serializedAdditionalRawData) + internal DeidentificationDocumentDetails(string id, DeidentificationDocumentLocation input, DeidentificationDocumentLocation output, OperationState status, ResponseError error, IDictionary serializedAdditionalRawData) { Id = id; Input = input; @@ -74,17 +74,17 @@ internal DocumentDetails(string id, DocumentLocation input, DocumentLocation out _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DocumentDetails() + /// Initializes a new instance of for deserialization. + internal DeidentificationDocumentDetails() { } /// Id of the document details. public string Id { get; } /// Location for the input. - public DocumentLocation Input { get; } + public DeidentificationDocumentLocation Input { get; } /// Location for the output. - public DocumentLocation Output { get; } + public DeidentificationDocumentLocation Output { get; } /// Status of the document. public OperationState Status { get; } /// Error when document fails. diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentLocation.Serialization.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationDocumentLocation.Serialization.cs similarity index 61% rename from sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentLocation.Serialization.cs rename to sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationDocumentLocation.Serialization.cs index 5d51f85ed05e..31ac45e2f71f 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentLocation.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationDocumentLocation.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.Health.Deidentification { - public partial class DocumentLocation : IUtf8JsonSerializable, IJsonModel + public partial class DeidentificationDocumentLocation : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,14 +28,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DocumentLocation)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeidentificationDocumentLocation)} does not support writing '{format}' format."); } - writer.WritePropertyName("path"u8); - writer.WriteStringValue(Path); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.AbsoluteUri); if (options.Format != "W") { writer.WritePropertyName("etag"u8); @@ -58,19 +58,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DocumentLocation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeidentificationDocumentLocation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DocumentLocation)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeidentificationDocumentLocation)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDocumentLocation(document.RootElement, options); + return DeserializeDeidentificationDocumentLocation(document.RootElement, options); } - internal static DocumentLocation DeserializeDocumentLocation(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeidentificationDocumentLocation DeserializeDeidentificationDocumentLocation(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,15 +78,15 @@ internal static DocumentLocation DeserializeDocumentLocation(JsonElement element { return null; } - string path = default; + Uri location = default; ETag etag = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("path"u8)) + if (property.NameEquals("location"u8)) { - path = property.Value.GetString(); + location = new Uri(property.Value.GetString()); continue; } if (property.NameEquals("etag"u8)) @@ -100,46 +100,46 @@ internal static DocumentLocation DeserializeDocumentLocation(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new DocumentLocation(path, etag, serializedAdditionalRawData); + return new DeidentificationDocumentLocation(location, etag, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DocumentLocation)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeidentificationDocumentLocation)} does not support writing '{options.Format}' format."); } } - DocumentLocation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeidentificationDocumentLocation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDocumentLocation(document.RootElement, options); + return DeserializeDeidentificationDocumentLocation(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DocumentLocation)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeidentificationDocumentLocation)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static DocumentLocation FromResponse(Response response) + internal static DeidentificationDocumentLocation FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentLocation(document.RootElement); + return DeserializeDeidentificationDocumentLocation(document.RootElement); } /// Convert into a . diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentLocation.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationDocumentLocation.cs similarity index 72% rename from sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentLocation.cs rename to sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationDocumentLocation.cs index 6ba76ad5f26b..62fe33d774ad 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentLocation.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationDocumentLocation.cs @@ -11,7 +11,7 @@ namespace Azure.Health.Deidentification { /// Location of a document. - public partial class DocumentLocation + public partial class DeidentificationDocumentLocation { /// /// Keeps track of any properties unknown to the library. @@ -45,34 +45,34 @@ public partial class DocumentLocation /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Path of document in storage. - /// is null. - internal DocumentLocation(string path) + /// Initializes a new instance of . + /// Location of document in storage. + /// is null. + internal DeidentificationDocumentLocation(Uri location) { - Argument.AssertNotNull(path, nameof(path)); + Argument.AssertNotNull(location, nameof(location)); - Path = path; + Location = location; } - /// Initializes a new instance of . - /// Path of document in storage. + /// Initializes a new instance of . + /// Location of document in storage. /// The entity tag for this resource. /// Keeps track of any properties unknown to the library. - internal DocumentLocation(string path, ETag etag, IDictionary serializedAdditionalRawData) + internal DeidentificationDocumentLocation(Uri location, ETag etag, IDictionary serializedAdditionalRawData) { - Path = path; + Location = location; Etag = etag; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DocumentLocation() + /// Initializes a new instance of for deserialization. + internal DeidentificationDocumentLocation() { } - /// Path of document in storage. - public string Path { get; } + /// Location of document in storage. + public Uri Location { get; } /// The entity tag for this resource. public ETag Etag { get; } } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJob.Serialization.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJob.Serialization.cs index 55ef7c11340e..039b869ab421 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJob.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJob.Serialization.cs @@ -39,24 +39,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - writer.WritePropertyName("sourceLocation"u8); - writer.WriteObjectValue(SourceLocation, options); - writer.WritePropertyName("targetLocation"u8); - writer.WriteObjectValue(TargetLocation, options); if (Optional.IsDefined(Operation)) { writer.WritePropertyName("operation"u8); writer.WriteStringValue(Operation.Value.ToString()); } - if (Optional.IsDefined(DataType)) - { - writer.WritePropertyName("dataType"u8); - writer.WriteStringValue(DataType.Value.ToString()); - } - if (Optional.IsDefined(RedactionFormat)) + writer.WritePropertyName("sourceLocation"u8); + writer.WriteObjectValue(SourceLocation, options); + writer.WritePropertyName("targetLocation"u8); + writer.WriteObjectValue(TargetLocation, options); + if (Optional.IsDefined(Customizations)) { - writer.WritePropertyName("redactionFormat"u8); - writer.WriteStringValue(RedactionFormat); + writer.WritePropertyName("customizations"u8); + writer.WriteObjectValue(Customizations, options); } if (options.Format != "W") { @@ -126,17 +121,16 @@ internal static DeidentificationJob DeserializeDeidentificationJob(JsonElement e return null; } string name = default; + DeidentificationOperationType? operation = default; SourceStorageLocation sourceLocation = default; TargetStorageLocation targetLocation = default; - OperationType? operation = default; - DocumentDataType? dataType = default; - string redactionFormat = default; - JobStatus status = default; + DeidentificationJobCustomizationOptions customizations = default; + OperationState status = default; ResponseError error = default; DateTimeOffset lastUpdatedAt = default; DateTimeOffset createdAt = default; DateTimeOffset? startedAt = default; - JobSummary summary = default; + DeidentificationJobSummary summary = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -146,6 +140,15 @@ internal static DeidentificationJob DeserializeDeidentificationJob(JsonElement e name = property.Value.GetString(); continue; } + if (property.NameEquals("operation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operation = new DeidentificationOperationType(property.Value.GetString()); + continue; + } if (property.NameEquals("sourceLocation"u8)) { sourceLocation = SourceStorageLocation.DeserializeSourceStorageLocation(property.Value, options); @@ -156,32 +159,18 @@ internal static DeidentificationJob DeserializeDeidentificationJob(JsonElement e targetLocation = TargetStorageLocation.DeserializeTargetStorageLocation(property.Value, options); continue; } - if (property.NameEquals("operation"u8)) + if (property.NameEquals("customizations"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - operation = new OperationType(property.Value.GetString()); - continue; - } - if (property.NameEquals("dataType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - dataType = new DocumentDataType(property.Value.GetString()); - continue; - } - if (property.NameEquals("redactionFormat"u8)) - { - redactionFormat = property.Value.GetString(); + customizations = DeidentificationJobCustomizationOptions.DeserializeDeidentificationJobCustomizationOptions(property.Value, options); continue; } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new OperationState(property.Value.GetString()); continue; } if (property.NameEquals("error"u8)) @@ -218,7 +207,7 @@ internal static DeidentificationJob DeserializeDeidentificationJob(JsonElement e { continue; } - summary = JobSummary.DeserializeJobSummary(property.Value, options); + summary = DeidentificationJobSummary.DeserializeDeidentificationJobSummary(property.Value, options); continue; } if (options.Format != "W") @@ -229,11 +218,10 @@ internal static DeidentificationJob DeserializeDeidentificationJob(JsonElement e serializedAdditionalRawData = rawDataDictionary; return new DeidentificationJob( name, + operation, sourceLocation, targetLocation, - operation, - dataType, - redactionFormat, + customizations, status, error, lastUpdatedAt, diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJob.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJob.cs index 14a040d4411e..338f5272e54c 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJob.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJob.cs @@ -60,11 +60,10 @@ public DeidentificationJob(SourceStorageLocation sourceLocation, TargetStorageLo /// Initializes a new instance of . /// The name of a job. + /// Operation to perform on the input documents. /// Storage location to perform the operation on. /// Target location to store output of operation. - /// Operation to perform on the input documents. - /// Data type of the input documents. - /// Format of the redacted output. Only valid when Operation is Redact. + /// Customization parameters to override default service behaviors. /// Current status of a job. /// Error when job fails in it's entirety. /// @@ -78,14 +77,13 @@ public DeidentificationJob(SourceStorageLocation sourceLocation, TargetStorageLo /// Date and time when the job was started. /// Summary of a job. Exists only when the job is completed. /// Keeps track of any properties unknown to the library. - internal DeidentificationJob(string name, SourceStorageLocation sourceLocation, TargetStorageLocation targetLocation, OperationType? operation, DocumentDataType? dataType, string redactionFormat, JobStatus status, ResponseError error, DateTimeOffset lastUpdatedAt, DateTimeOffset createdAt, DateTimeOffset? startedAt, JobSummary summary, IDictionary serializedAdditionalRawData) + internal DeidentificationJob(string name, DeidentificationOperationType? operation, SourceStorageLocation sourceLocation, TargetStorageLocation targetLocation, DeidentificationJobCustomizationOptions customizations, OperationState status, ResponseError error, DateTimeOffset lastUpdatedAt, DateTimeOffset createdAt, DateTimeOffset? startedAt, DeidentificationJobSummary summary, IDictionary serializedAdditionalRawData) { Name = name; + Operation = operation; SourceLocation = sourceLocation; TargetLocation = targetLocation; - Operation = operation; - DataType = dataType; - RedactionFormat = redactionFormat; + Customizations = customizations; Status = status; Error = error; LastUpdatedAt = lastUpdatedAt; @@ -102,18 +100,16 @@ internal DeidentificationJob() /// The name of a job. public string Name { get; } + /// Operation to perform on the input documents. + public DeidentificationOperationType? Operation { get; set; } /// Storage location to perform the operation on. public SourceStorageLocation SourceLocation { get; set; } /// Target location to store output of operation. public TargetStorageLocation TargetLocation { get; set; } - /// Operation to perform on the input documents. - public OperationType? Operation { get; set; } - /// Data type of the input documents. - public DocumentDataType? DataType { get; set; } - /// Format of the redacted output. Only valid when Operation is Redact. - public string RedactionFormat { get; set; } + /// Customization parameters to override default service behaviors. + public DeidentificationJobCustomizationOptions Customizations { get; set; } /// Current status of a job. - public JobStatus Status { get; } + public OperationState Status { get; } /// Error when job fails in it's entirety. public ResponseError Error { get; } /// @@ -129,6 +125,6 @@ internal DeidentificationJob() /// Date and time when the job was started. public DateTimeOffset? StartedAt { get; } /// Summary of a job. Exists only when the job is completed. - public JobSummary Summary { get; } + public DeidentificationJobSummary Summary { get; } } } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJobCustomizationOptions.Serialization.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJobCustomizationOptions.Serialization.cs new file mode 100644 index 000000000000..3a2d2043f633 --- /dev/null +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJobCustomizationOptions.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Deidentification +{ + public partial class DeidentificationJobCustomizationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeidentificationJobCustomizationOptions)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RedactionFormat)) + { + writer.WritePropertyName("redactionFormat"u8); + writer.WriteStringValue(RedactionFormat); + } + if (Optional.IsDefined(SurrogateLocale)) + { + writer.WritePropertyName("surrogateLocale"u8); + writer.WriteStringValue(SurrogateLocale); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeidentificationJobCustomizationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeidentificationJobCustomizationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeidentificationJobCustomizationOptions(document.RootElement, options); + } + + internal static DeidentificationJobCustomizationOptions DeserializeDeidentificationJobCustomizationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string redactionFormat = default; + string surrogateLocale = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("redactionFormat"u8)) + { + redactionFormat = property.Value.GetString(); + continue; + } + if (property.NameEquals("surrogateLocale"u8)) + { + surrogateLocale = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeidentificationJobCustomizationOptions(redactionFormat, surrogateLocale, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeidentificationJobCustomizationOptions)} does not support writing '{options.Format}' format."); + } + } + + DeidentificationJobCustomizationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeidentificationJobCustomizationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeidentificationJobCustomizationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeidentificationJobCustomizationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeidentificationJobCustomizationOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJobCustomizationOptions.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJobCustomizationOptions.cs new file mode 100644 index 000000000000..37f3fb7909bf --- /dev/null +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJobCustomizationOptions.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Deidentification +{ + /// Customizations options to override default service behaviors for job usage. + public partial class DeidentificationJobCustomizationOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeidentificationJobCustomizationOptions() + { + } + + /// Initializes a new instance of . + /// + /// Format of the redacted output. Only valid when Operation is Redact. + /// Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details. + /// + /// Locale in which the output surrogates are written. + /// Keeps track of any properties unknown to the library. + internal DeidentificationJobCustomizationOptions(string redactionFormat, string surrogateLocale, IDictionary serializedAdditionalRawData) + { + RedactionFormat = redactionFormat; + SurrogateLocale = surrogateLocale; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Format of the redacted output. Only valid when Operation is Redact. + /// Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details. + /// + public string RedactionFormat { get; set; } + /// Locale in which the output surrogates are written. + public string SurrogateLocale { get; set; } + } +} diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/JobSummary.Serialization.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJobSummary.Serialization.cs similarity index 72% rename from sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/JobSummary.Serialization.cs rename to sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJobSummary.Serialization.cs index 29d3f32e3de7..5f78e8e00685 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/JobSummary.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJobSummary.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.Health.Deidentification { - public partial class JobSummary : IUtf8JsonSerializable, IJsonModel + public partial class DeidentificationJobSummary : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(JobSummary)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeidentificationJobSummary)} does not support writing '{format}' format."); } writer.WritePropertyName("successful"u8); @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - JobSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeidentificationJobSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(JobSummary)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeidentificationJobSummary)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeJobSummary(document.RootElement, options); + return DeserializeDeidentificationJobSummary(document.RootElement, options); } - internal static JobSummary DeserializeJobSummary(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeidentificationJobSummary DeserializeDeidentificationJobSummary(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -121,7 +121,7 @@ internal static JobSummary DeserializeJobSummary(JsonElement element, ModelReade } } serializedAdditionalRawData = rawDataDictionary; - return new JobSummary( + return new DeidentificationJobSummary( successful, failed, canceled, @@ -130,43 +130,43 @@ internal static JobSummary DeserializeJobSummary(JsonElement element, ModelReade serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(JobSummary)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeidentificationJobSummary)} does not support writing '{options.Format}' format."); } } - JobSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeidentificationJobSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeJobSummary(document.RootElement, options); + return DeserializeDeidentificationJobSummary(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(JobSummary)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeidentificationJobSummary)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static JobSummary FromResponse(Response response) + internal static DeidentificationJobSummary FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeJobSummary(document.RootElement); + return DeserializeDeidentificationJobSummary(document.RootElement); } /// Convert into a . diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/JobSummary.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJobSummary.cs similarity index 83% rename from sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/JobSummary.cs rename to sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJobSummary.cs index b92ca749c320..86d2125c1618 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/JobSummary.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationJobSummary.cs @@ -11,7 +11,7 @@ namespace Azure.Health.Deidentification { /// Summary metrics of a job. - public partial class JobSummary + public partial class DeidentificationJobSummary { /// /// Keeps track of any properties unknown to the library. @@ -45,13 +45,13 @@ public partial class JobSummary /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Number of documents that have completed. /// Number of documents that have failed. /// Number of documents that have been canceled. /// Number of documents total. /// Number of bytes processed. - internal JobSummary(int successful, int failed, int canceled, int total, long bytesProcessed) + internal DeidentificationJobSummary(int successful, int failed, int canceled, int total, long bytesProcessed) { Successful = successful; Failed = failed; @@ -60,14 +60,14 @@ internal JobSummary(int successful, int failed, int canceled, int total, long by BytesProcessed = bytesProcessed; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Number of documents that have completed. /// Number of documents that have failed. /// Number of documents that have been canceled. /// Number of documents total. /// Number of bytes processed. /// Keeps track of any properties unknown to the library. - internal JobSummary(int successful, int failed, int canceled, int total, long bytesProcessed, IDictionary serializedAdditionalRawData) + internal DeidentificationJobSummary(int successful, int failed, int canceled, int total, long bytesProcessed, IDictionary serializedAdditionalRawData) { Successful = successful; Failed = failed; @@ -77,8 +77,8 @@ internal JobSummary(int successful, int failed, int canceled, int total, long by _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal JobSummary() + /// Initializes a new instance of for deserialization. + internal DeidentificationJobSummary() { } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationOperationType.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationOperationType.cs new file mode 100644 index 000000000000..6c484cc67a25 --- /dev/null +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationOperationType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Deidentification +{ + /// Enum of supported Operation Types. + public readonly partial struct DeidentificationOperationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DeidentificationOperationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RedactValue = "Redact"; + private const string SurrogateValue = "Surrogate"; + private const string TagValue = "Tag"; + + /// Redact Operation will remove all entities of PHI and replace them with a placeholder value. + public static DeidentificationOperationType Redact { get; } = new DeidentificationOperationType(RedactValue); + /// Surrogation Operation will replace all entities of PHI with a surrogate value. + public static DeidentificationOperationType Surrogate { get; } = new DeidentificationOperationType(SurrogateValue); + /// Tag Operation will detect all entities of PHI, their type, and return their locations in the document. + public static DeidentificationOperationType Tag { get; } = new DeidentificationOperationType(TagValue); + /// Determines if two values are the same. + public static bool operator ==(DeidentificationOperationType left, DeidentificationOperationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DeidentificationOperationType left, DeidentificationOperationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DeidentificationOperationType(string value) => new DeidentificationOperationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DeidentificationOperationType other && Equals(other); + /// + public bool Equals(DeidentificationOperationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/Docs/DeidentificationClient.xml b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/Docs/DeidentificationClient.xml index cc0b825e8a96..41927f808229 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/Docs/DeidentificationClient.xml +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/Docs/DeidentificationClient.xml @@ -9,7 +9,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -Response response = await client.GetJobAsync("documents_smith_1"); +Response response = await client.GetJobAsync("job_smith_documents_1"); ]]> @@ -20,7 +20,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -Response response = client.GetJob("documents_smith_1"); +Response response = client.GetJob("job_smith_documents_1"); ]]> @@ -31,7 +31,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -Response response = await client.GetJobAsync("documents_smith_1", null); +Response response = await client.GetJobAsync("job_smith_documents_1", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -52,7 +52,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -Response response = client.GetJob("documents_smith_1", null); +Response response = client.GetJob("job_smith_documents_1", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -73,7 +73,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -Response response = await client.CancelJobAsync("documents_smith_1"); +Response response = await client.CancelJobAsync("job_smith_documents_1"); ]]> @@ -84,7 +84,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -Response response = client.CancelJob("documents_smith_1"); +Response response = client.CancelJob("job_smith_documents_1"); ]]> @@ -95,7 +95,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -Response response = await client.CancelJobAsync("documents_smith_1", null); +Response response = await client.CancelJobAsync("job_smith_documents_1", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -116,7 +116,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -Response response = client.CancelJob("documents_smith_1", null); +Response response = client.CancelJob("job_smith_documents_1", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -137,7 +137,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -Response response = await client.DeleteJobAsync("documents_smith_1"); +Response response = await client.DeleteJobAsync("job_smith_documents_1"); Console.WriteLine(response.Status); ]]> @@ -150,48 +150,52 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -Response response = client.DeleteJob("documents_smith_1"); +Response response = client.DeleteJob("job_smith_documents_1"); Console.WriteLine(response.Status); ]]> - + -This sample shows how to call DeidentifyAsync. +This sample shows how to call DeidentifyTextAsync. "); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -DeidentificationContent body = new DeidentificationContent("Hello my name is John Smith.") +DeidentificationContent content = new DeidentificationContent("Hello my name is John Smith.") { - Operation = OperationType.Redact, - DataType = DocumentDataType.Plaintext, - RedactionFormat = "[{type}]", + Operation = DeidentificationOperationType.Redact, + Customizations = new DeidentificationCustomizationOptions + { + RedactionFormat = "[{type}]", + }, }; -Response response = await client.DeidentifyAsync(body); +Response response = await client.DeidentifyTextAsync(content); ]]> - + -This sample shows how to call Deidentify. +This sample shows how to call DeidentifyText. "); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -DeidentificationContent body = new DeidentificationContent("Hello my name is John Smith.") +DeidentificationContent content = new DeidentificationContent("Hello my name is John Smith.") { - Operation = OperationType.Redact, - DataType = DocumentDataType.Plaintext, - RedactionFormat = "[{type}]", + Operation = DeidentificationOperationType.Redact, + Customizations = new DeidentificationCustomizationOptions + { + RedactionFormat = "[{type}]", + }, }; -Response response = client.Deidentify(body); +Response response = client.DeidentifyText(content); ]]> - + -This sample shows how to call DeidentifyAsync and parse the result. +This sample shows how to call DeidentifyTextAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); @@ -201,18 +205,20 @@ using RequestContent content = RequestContent.Create(new { inputText = "Hello my name is John Smith.", operation = "Redact", - dataType = "Plaintext", - redactionFormat = "[{type}]", + customizations = new + { + redactionFormat = "[{type}]", + }, }); -Response response = await client.DeidentifyAsync(content); +Response response = await client.DeidentifyTextAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.ToString()); ]]> - + -This sample shows how to call Deidentify and parse the result. +This sample shows how to call DeidentifyText and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); @@ -222,192 +228,66 @@ using RequestContent content = RequestContent.Create(new { inputText = "Hello my name is John Smith.", operation = "Redact", - dataType = "Plaintext", - redactionFormat = "[{type}]", + customizations = new + { + redactionFormat = "[{type}]", + }, }); -Response response = client.Deidentify(content); +Response response = client.DeidentifyText(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.ToString()); ]]> - - -This sample shows how to call GetJobsAsync. -"); -TokenCredential credential = new DefaultAzureCredential(); -DeidentificationClient client = new DeidentificationClient(endpoint, credential); - -await foreach (DeidentificationJob item in client.GetJobsAsync()) -{ -} -]]> - - - -This sample shows how to call GetJobs. -"); -TokenCredential credential = new DefaultAzureCredential(); -DeidentificationClient client = new DeidentificationClient(endpoint, credential); - -foreach (DeidentificationJob item in client.GetJobs()) -{ -} -]]> - - - -This sample shows how to call GetJobsAsync and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -DeidentificationClient client = new DeidentificationClient(endpoint, credential); - -await foreach (BinaryData item in client.GetJobsAsync(10, "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==", null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("sourceLocation").GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("sourceLocation").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("targetLocation").GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("targetLocation").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedAt").ToString()); - Console.WriteLine(result.GetProperty("createdAt").ToString()); -} -]]> - - - -This sample shows how to call GetJobs and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -DeidentificationClient client = new DeidentificationClient(endpoint, credential); - -foreach (BinaryData item in client.GetJobs(10, "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==", null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("sourceLocation").GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("sourceLocation").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("targetLocation").GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("targetLocation").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedAt").ToString()); - Console.WriteLine(result.GetProperty("createdAt").ToString()); -} -]]> - - - -This sample shows how to call GetJobDocumentsAsync. -"); -TokenCredential credential = new DefaultAzureCredential(); -DeidentificationClient client = new DeidentificationClient(endpoint, credential); - -await foreach (DocumentDetails item in client.GetJobDocumentsAsync("documents_smith_1")) -{ -} -]]> - - - -This sample shows how to call GetJobDocuments. -"); -TokenCredential credential = new DefaultAzureCredential(); -DeidentificationClient client = new DeidentificationClient(endpoint, credential); - -foreach (DocumentDetails item in client.GetJobDocuments("documents_smith_1")) -{ -} -]]> - - - -This sample shows how to call GetJobDocumentsAsync and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -DeidentificationClient client = new DeidentificationClient(endpoint, credential); - -await foreach (BinaryData item in client.GetJobDocumentsAsync("documents_smith_1", 10, "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==", null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("input").GetProperty("path").ToString()); - Console.WriteLine(result.GetProperty("input").GetProperty("etag").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); -} -]]> - - - -This sample shows how to call GetJobDocuments and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -DeidentificationClient client = new DeidentificationClient(endpoint, credential); - -foreach (BinaryData item in client.GetJobDocuments("documents_smith_1", 10, "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==", null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("input").GetProperty("path").ToString()); - Console.WriteLine(result.GetProperty("input").GetProperty("etag").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); -} -]]> - - + -This sample shows how to call CreateJobAsync. +This sample shows how to call DeidentifyDocumentsAsync. "); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -DeidentificationJob resource = new DeidentificationJob(new SourceStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D"), "/documents") +DeidentificationJob resource = new DeidentificationJob(new SourceStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container"), "documents/"), new TargetStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container"), "_output/") { - Extensions = { "*" }, -}, new TargetStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D"), "/documents")) + Overwrite = true, +}) { - Operation = OperationType.Redact, - DataType = DocumentDataType.Plaintext, - RedactionFormat = "[{type}]", + Operation = DeidentificationOperationType.Redact, + Customizations = new DeidentificationJobCustomizationOptions + { + RedactionFormat = "[{type}]", + }, }; -Operation operation = await client.CreateJobAsync(WaitUntil.Completed, "documents_smith_1", resource); +Operation operation = await client.DeidentifyDocumentsAsync(WaitUntil.Completed, "job_smith_documents_1", resource); DeidentificationJob responseData = operation.Value; ]]> - + -This sample shows how to call CreateJob. +This sample shows how to call DeidentifyDocuments. "); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); -DeidentificationJob resource = new DeidentificationJob(new SourceStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D"), "/documents") +DeidentificationJob resource = new DeidentificationJob(new SourceStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container"), "documents/"), new TargetStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container"), "_output/") { - Extensions = { "*" }, -}, new TargetStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D"), "/documents")) + Overwrite = true, +}) { - Operation = OperationType.Redact, - DataType = DocumentDataType.Plaintext, - RedactionFormat = "[{type}]", + Operation = DeidentificationOperationType.Redact, + Customizations = new DeidentificationJobCustomizationOptions + { + RedactionFormat = "[{type}]", + }, }; -Operation operation = client.CreateJob(WaitUntil.Completed, "documents_smith_1", resource); +Operation operation = client.DeidentifyDocuments(WaitUntil.Completed, "job_smith_documents_1", resource); DeidentificationJob responseData = operation.Value; ]]> - + -This sample shows how to call CreateJobAsync and parse the result. +This sample shows how to call DeidentifyDocumentsAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); @@ -415,26 +295,24 @@ DeidentificationClient client = new DeidentificationClient(endpoint, credential) using RequestContent content = RequestContent.Create(new { + operation = "Redact", sourceLocation = new { - location = "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", - prefix = "/documents", - extensions = new object[] - { - "*" - }, + location = "https://blobtest.blob.core.windows.net/container", + prefix = "documents/", }, targetLocation = new { - location = "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", - prefix = "/documents", + location = "https://blobtest.blob.core.windows.net/container", + prefix = "_output/", + overwrite = true, + }, + customizations = new + { + redactionFormat = "[{type}]", }, - operation = "Redact", - dataType = "Plaintext", - redactionFormat = "[{type}]", - status = "NotStarted", }); -Operation operation = await client.CreateJobAsync(WaitUntil.Completed, "documents_smith_1", content); +Operation operation = await client.DeidentifyDocumentsAsync(WaitUntil.Completed, "job_smith_documents_1", content); BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; @@ -448,9 +326,9 @@ Console.WriteLine(result.GetProperty("lastUpdatedAt").ToString()); Console.WriteLine(result.GetProperty("createdAt").ToString()); ]]> - + -This sample shows how to call CreateJob and parse the result. +This sample shows how to call DeidentifyDocuments and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); @@ -458,26 +336,24 @@ DeidentificationClient client = new DeidentificationClient(endpoint, credential) using RequestContent content = RequestContent.Create(new { + operation = "Redact", sourceLocation = new { - location = "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", - prefix = "/documents", - extensions = new object[] - { - "*" - }, + location = "https://blobtest.blob.core.windows.net/container", + prefix = "documents/", }, targetLocation = new { - location = "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", - prefix = "/documents", + location = "https://blobtest.blob.core.windows.net/container", + prefix = "_output/", + overwrite = true, + }, + customizations = new + { + redactionFormat = "[{type}]", }, - operation = "Redact", - dataType = "Plaintext", - redactionFormat = "[{type}]", - status = "NotStarted", }); -Operation operation = client.CreateJob(WaitUntil.Completed, "documents_smith_1", content); +Operation operation = client.DeidentifyDocuments(WaitUntil.Completed, "job_smith_documents_1", content); BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentDataType.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentDataType.cs deleted file mode 100644 index f2fdea3d8313..000000000000 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DocumentDataType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.Health.Deidentification -{ - /// Enum of supported Data Types. - public readonly partial struct DocumentDataType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DocumentDataType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PlaintextValue = "Plaintext"; - - /// Plain text data type. - public static DocumentDataType Plaintext { get; } = new DocumentDataType(PlaintextValue); - /// Determines if two values are the same. - public static bool operator ==(DocumentDataType left, DocumentDataType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DocumentDataType left, DocumentDataType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator DocumentDataType(string value) => new DocumentDataType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DocumentDataType other && Equals(other); - /// - public bool Equals(DocumentDataType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/HealthDeidentificationModelFactory.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/HealthDeidentificationModelFactory.cs index decf093fc8f0..f721eef20356 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/HealthDeidentificationModelFactory.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/HealthDeidentificationModelFactory.cs @@ -16,11 +16,10 @@ public static partial class HealthDeidentificationModelFactory { /// Initializes a new instance of . /// The name of a job. + /// Operation to perform on the input documents. /// Storage location to perform the operation on. /// Target location to store output of operation. - /// Operation to perform on the input documents. - /// Data type of the input documents. - /// Format of the redacted output. Only valid when Operation is Redact. + /// Customization parameters to override default service behaviors. /// Current status of a job. /// Error when job fails in it's entirety. /// @@ -34,15 +33,14 @@ public static partial class HealthDeidentificationModelFactory /// Date and time when the job was started. /// Summary of a job. Exists only when the job is completed. /// A new instance for mocking. - public static DeidentificationJob DeidentificationJob(string name = null, SourceStorageLocation sourceLocation = null, TargetStorageLocation targetLocation = null, OperationType? operation = null, DocumentDataType? dataType = null, string redactionFormat = null, JobStatus status = default, ResponseError error = null, DateTimeOffset lastUpdatedAt = default, DateTimeOffset createdAt = default, DateTimeOffset? startedAt = null, JobSummary summary = null) + public static DeidentificationJob DeidentificationJob(string name = null, DeidentificationOperationType? operation = null, SourceStorageLocation sourceLocation = null, TargetStorageLocation targetLocation = null, DeidentificationJobCustomizationOptions customizations = null, OperationState status = default, ResponseError error = null, DateTimeOffset lastUpdatedAt = default, DateTimeOffset createdAt = default, DateTimeOffset? startedAt = null, DeidentificationJobSummary summary = null) { return new DeidentificationJob( name, + operation, sourceLocation, targetLocation, - operation, - dataType, - redactionFormat, + customizations, status, error, lastUpdatedAt, @@ -52,16 +50,16 @@ public static DeidentificationJob DeidentificationJob(string name = null, Source serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Number of documents that have completed. /// Number of documents that have failed. /// Number of documents that have been canceled. /// Number of documents total. /// Number of bytes processed. - /// A new instance for mocking. - public static JobSummary JobSummary(int successful = default, int failed = default, int canceled = default, int total = default, long bytesProcessed = default) + /// A new instance for mocking. + public static DeidentificationJobSummary DeidentificationJobSummary(int successful = default, int failed = default, int canceled = default, int total = default, long bytesProcessed = default) { - return new JobSummary( + return new DeidentificationJobSummary( successful, failed, canceled, @@ -70,16 +68,16 @@ public static JobSummary JobSummary(int successful = default, int failed = defau serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Id of the document details. /// Location for the input. /// Location for the output. /// Status of the document. /// Error when document fails. - /// A new instance for mocking. - public static DocumentDetails DocumentDetails(string id = null, DocumentLocation input = null, DocumentLocation output = null, OperationState status = default, ResponseError error = null) + /// A new instance for mocking. + public static DeidentificationDocumentDetails DeidentificationDocumentDetails(string id = null, DeidentificationDocumentLocation input = null, DeidentificationDocumentLocation output = null, OperationState status = default, ResponseError error = null) { - return new DocumentDetails( + return new DeidentificationDocumentDetails( id, input, output, @@ -88,24 +86,23 @@ public static DocumentDetails DocumentDetails(string id = null, DocumentLocation serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Path of document in storage. + /// Initializes a new instance of . + /// Location of document in storage. /// The entity tag for this resource. - /// A new instance for mocking. - public static DocumentLocation DocumentLocation(string path = null, ETag etag = default) + /// A new instance for mocking. + public static DeidentificationDocumentLocation DeidentificationDocumentLocation(Uri location = null, ETag etag = default) { - return new DocumentLocation(path, etag, serializedAdditionalRawData: null); + return new DeidentificationDocumentLocation(location, etag, serializedAdditionalRawData: null); } /// Initializes a new instance of . /// Input text to de-identify. - /// Operation to perform on the input. - /// Data type of the input. - /// Format of the redacted output. Only valid when OperationType is "Redact". + /// Operation to perform on the input documents. + /// Customization parameters to override default service behaviors. /// A new instance for mocking. - public static DeidentificationContent DeidentificationContent(string inputText = null, OperationType? operation = null, DocumentDataType? dataType = null, string redactionFormat = null) + public static DeidentificationContent DeidentificationContent(string inputText = null, DeidentificationOperationType? operation = null, DeidentificationCustomizationOptions customizations = null) { - return new DeidentificationContent(inputText, operation, dataType, redactionFormat, serializedAdditionalRawData: null); + return new DeidentificationContent(inputText, operation, customizations, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -119,14 +116,12 @@ public static DeidentificationResult DeidentificationResult(string outputText = /// Initializes a new instance of . /// List of entities detected in the input. - /// Path to the document in storage. - /// The entity tag for this resource. /// A new instance for mocking. - public static PhiTaggerResult PhiTaggerResult(IEnumerable entities = null, string path = null, ETag? etag = null) + public static PhiTaggerResult PhiTaggerResult(IEnumerable entities = null) { entities ??= new List(); - return new PhiTaggerResult(entities?.ToList(), path, etag, serializedAdditionalRawData: null); + return new PhiTaggerResult(entities?.ToList(), serializedAdditionalRawData: null); } /// Initializes a new instance of . diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/JobStatus.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/JobStatus.cs deleted file mode 100644 index d5557327f1f8..000000000000 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/JobStatus.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.Health.Deidentification -{ - /// List of statuses a job can have. - public readonly partial struct JobStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public JobStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NotStartedValue = "NotStarted"; - private const string RunningValue = "Running"; - private const string SucceededValue = "Succeeded"; - private const string PartialFailedValue = "PartialFailed"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; - - /// Job has been submitted and is waiting to be processed. - public static JobStatus NotStarted { get; } = new JobStatus(NotStartedValue); - /// Job has been started. - public static JobStatus Running { get; } = new JobStatus(RunningValue); - /// Job has completed successfully. All documents have succeeded. - public static JobStatus Succeeded { get; } = new JobStatus(SucceededValue); - /// Job has completed with at least a single document failing. - public static JobStatus PartialFailed { get; } = new JobStatus(PartialFailedValue); - /// Job has completed with all documents failing, or a validation failure. - public static JobStatus Failed { get; } = new JobStatus(FailedValue); - /// Job has been canceled after user request. - public static JobStatus Canceled { get; } = new JobStatus(CanceledValue); - /// Determines if two values are the same. - public static bool operator ==(JobStatus left, JobStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(JobStatus left, JobStatus right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator JobStatus(string value) => new JobStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is JobStatus other && Equals(other); - /// - public bool Equals(JobStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/OperationType.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/OperationType.cs deleted file mode 100644 index 48d38467adb3..000000000000 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/OperationType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.Health.Deidentification -{ - /// Enum of supported Operation Types. - public readonly partial struct OperationType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public OperationType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RedactValue = "Redact"; - private const string SurrogateValue = "Surrogate"; - private const string TagValue = "Tag"; - - /// Redact Operation will remove all entities of PHI and replace them with a placeholder value. - public static OperationType Redact { get; } = new OperationType(RedactValue); - /// Surrogation Operation will replace all entities of PHI with a surrogate value. - public static OperationType Surrogate { get; } = new OperationType(SurrogateValue); - /// Tag Operation will detect all entities of PHI, their type, and return their locations in the document. - public static OperationType Tag { get; } = new OperationType(TagValue); - /// Determines if two values are the same. - public static bool operator ==(OperationType left, OperationType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(OperationType left, OperationType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator OperationType(string value) => new OperationType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is OperationType other && Equals(other); - /// - public bool Equals(OperationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/PhiTaggerResult.Serialization.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/PhiTaggerResult.Serialization.cs index b1c475d59184..d723a1e2ce15 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/PhiTaggerResult.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/PhiTaggerResult.Serialization.cs @@ -41,16 +41,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - if (Optional.IsDefined(Path)) - { - writer.WritePropertyName("path"u8); - writer.WriteStringValue(Path); - } - if (Optional.IsDefined(Etag)) - { - writer.WritePropertyName("etag"u8); - writer.WriteStringValue(Etag.Value.ToString()); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -89,8 +79,6 @@ internal static PhiTaggerResult DeserializePhiTaggerResult(JsonElement element, return null; } IReadOnlyList entities = default; - string path = default; - ETag? etag = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -105,27 +93,13 @@ internal static PhiTaggerResult DeserializePhiTaggerResult(JsonElement element, entities = array; continue; } - if (property.NameEquals("path"u8)) - { - path = property.Value.GetString(); - continue; - } - if (property.NameEquals("etag"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new PhiTaggerResult(entities, path, etag, serializedAdditionalRawData); + return new PhiTaggerResult(entities, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/PhiTaggerResult.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/PhiTaggerResult.cs index 8650addf15ca..45d8e6843411 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/PhiTaggerResult.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/PhiTaggerResult.cs @@ -58,14 +58,10 @@ internal PhiTaggerResult(IEnumerable entities) /// Initializes a new instance of . /// List of entities detected in the input. - /// Path to the document in storage. - /// The entity tag for this resource. /// Keeps track of any properties unknown to the library. - internal PhiTaggerResult(IReadOnlyList entities, string path, ETag? etag, IDictionary serializedAdditionalRawData) + internal PhiTaggerResult(IReadOnlyList entities, IDictionary serializedAdditionalRawData) { Entities = entities; - Path = path; - Etag = etag; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -76,9 +72,5 @@ internal PhiTaggerResult() /// List of entities detected in the input. public IReadOnlyList Entities { get; } - /// Path to the document in storage. - public string Path { get; } - /// The entity tag for this resource. - public ETag? Etag { get; } } } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/TargetStorageLocation.Serialization.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/TargetStorageLocation.Serialization.cs index c7fbc73299ff..c5bbe63c555a 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/TargetStorageLocation.Serialization.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/TargetStorageLocation.Serialization.cs @@ -38,6 +38,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(Location.AbsoluteUri); writer.WritePropertyName("prefix"u8); writer.WriteStringValue(Prefix); + if (Optional.IsDefined(Overwrite)) + { + writer.WritePropertyName("overwrite"u8); + writer.WriteBooleanValue(Overwrite.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,6 +82,7 @@ internal static TargetStorageLocation DeserializeTargetStorageLocation(JsonEleme } Uri location = default; string prefix = default; + bool? overwrite = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -91,13 +97,22 @@ internal static TargetStorageLocation DeserializeTargetStorageLocation(JsonEleme prefix = property.Value.GetString(); continue; } + if (property.NameEquals("overwrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + overwrite = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new TargetStorageLocation(location, prefix, serializedAdditionalRawData); + return new TargetStorageLocation(location, prefix, overwrite, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/TargetStorageLocation.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/TargetStorageLocation.cs index 1d72da87487d..fdcccbc8bd45 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/TargetStorageLocation.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/TargetStorageLocation.cs @@ -47,7 +47,16 @@ public partial class TargetStorageLocation /// Initializes a new instance of . /// URL to storage location. - /// Prefix to filter path by. + /// + /// Replaces the input prefix of a file path with the output prefix, preserving the rest of the path structure. + /// + /// Example: + /// File full path: documents/user/note.txt + /// Input Prefix: "documents/user/" + /// Output Prefix: "output_docs/" + /// + /// Output file: "output_docs/note.txt" + /// /// or is null. public TargetStorageLocation(Uri location, string prefix) { @@ -60,12 +69,23 @@ public TargetStorageLocation(Uri location, string prefix) /// Initializes a new instance of . /// URL to storage location. - /// Prefix to filter path by. + /// + /// Replaces the input prefix of a file path with the output prefix, preserving the rest of the path structure. + /// + /// Example: + /// File full path: documents/user/note.txt + /// Input Prefix: "documents/user/" + /// Output Prefix: "output_docs/" + /// + /// Output file: "output_docs/note.txt" + /// + /// When set to true during a job, the service will overwrite the output location if it already exists. /// Keeps track of any properties unknown to the library. - internal TargetStorageLocation(Uri location, string prefix, IDictionary serializedAdditionalRawData) + internal TargetStorageLocation(Uri location, string prefix, bool? overwrite, IDictionary serializedAdditionalRawData) { Location = location; Prefix = prefix; + Overwrite = overwrite; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -76,7 +96,18 @@ internal TargetStorageLocation() /// URL to storage location. public Uri Location { get; set; } - /// Prefix to filter path by. + /// + /// Replaces the input prefix of a file path with the output prefix, preserving the rest of the path structure. + /// + /// Example: + /// File full path: documents/user/note.txt + /// Input Prefix: "documents/user/" + /// Output Prefix: "output_docs/" + /// + /// Output file: "output_docs/note.txt" + /// public string Prefix { get; set; } + /// When set to true during a job, the service will overwrite the output location if it already exists. + public bool? Overwrite { get; set; } } } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Data/example_patient_1/row-2-data.txt b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Data/example_patient_1/row-2-data.txt new file mode 100644 index 000000000000..6fc315d75c92 --- /dev/null +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Data/example_patient_1/row-2-data.txt @@ -0,0 +1,54 @@ +"CHIEF COMPLAINT + +Follow-up of chronic problems. + +HISTORY OF PRESENT ILLNESS + +Brian White is a 58-year-old male with a past medical history significant for congestive heart failure and hypertension, who presents today for follow-up of his chronic problems. + +The patient states he has been feeling out of sorts lately. He is not sure if it is due to the change in the seasons or due to performing lots of projects and some construction on his home. He reports fatigue and lightheadedness. This has been going on for about 5 weeks. While exerting energy, he has experienced some shortness of breath and chest cramps. The patient also notes a slight cough, but he is not sure if it is just the change in seasons. + +He feels bloated every once in a while. His diet has been a little bit of a struggle. They had construction on their kitchen begin over Labor Day weekend, and have been eating less healthy food as a result. + +Regarding his heart failure, he has been pretty good with his salt intake. He has been pretty good about his diet since the last year and is staying on top of that as much as possible. The patient has continued to utilize Lasix daily. + +For his hypertension, this has been well controlled with lisinopril 20 mg a day. He has continued to monitor his blood pressure regularly. + +The patient did the review of systems sheet when he checked in. He denies weight gain, swelling in the lower extremities, fevers, chills, dizziness, nausea, vomiting, and diarrhea. + +REVIEW OF SYSTEMS + + Constitutional: Endorses fatigue. Denies fevers, chills, or weight loss. + Cardiovascular: Endorses chest pain or dyspnea on exertion. + Respiratory: Endorses cough and shortness of breath. + Gastrointestinal: Endorses bloating. + +PHYSICAL EXAMINATION + + Neck: JVD 8 cm. + Respiratory: Rales bilateral bases. + Cardiovascular: 3/6 systolic ejection murmur. + Musculoskeletal: 1+ pitting edema bilateral lower extremities. + +RESULTS + +X-ray of the chest demonstrates a mild amount of fluid in the lungs. + +Echocardiogram demonstrates decreased ejection fraction of 45% and mild mitral regurgitation. + +ASSESSMENT AND PLAN + +Brian White is a 58-year-old male with a past medical history significant for congestive heart failure and hypertension, who presents today for follow up of his chronic problems. + +Congestive heart failure. + Medical Reasoning: The patient reports increased fatigue, dizziness, and chest discomfort on exertion. He also exhibits some jugular venous distention, lung base crackles, and lower extremity edema on exam today. He has been compliant with his current medications but admits to dietary indiscretion lately. His recent echocardiogram demonstrated a reduced ejection fraction of 45%, as well as mitral regurgitation. + Additional Testing: We will order a repeat echocardiogram. + Medical Treatment: Increase Lasix to 80 mg daily. + Patient Education and Counseling: I advised the patient to monitor and record his daily weight and report those to me via the patient portal. He will contact me should he continue to experience any dyspnea. + +Hypertension. + Medical Reasoning: This is well controlled based on home monitoring. + Medical Treatment: Continue lisinopril 20 mg daily. + Patient Education and Counseling: I advised him to monitor and record his blood pressures at home and report these to me via the patient portal. + +Patient Agreements: The patient understands and agrees with the recommended medical treatment plan." \ No newline at end of file diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Generated/Samples/Samples_DeidentificationClient.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Generated/Samples/Samples_DeidentificationClient.cs index f882101c78b9..5d9fe9e592a0 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Generated/Samples/Samples_DeidentificationClient.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Generated/Samples/Samples_DeidentificationClient.cs @@ -24,7 +24,7 @@ public void Example_DeidentificationJob_GetJob_GetADeIdentificationJob() TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - Response response = client.GetJob("documents_smith_1", null); + Response response = client.GetJob("job_smith_documents_1", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -45,7 +45,7 @@ public async Task Example_DeidentificationJob_GetJob_GetADeIdentificationJob_Asy TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - Response response = await client.GetJobAsync("documents_smith_1", null); + Response response = await client.GetJobAsync("job_smith_documents_1", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -66,7 +66,7 @@ public void Example_DeidentificationJob_GetJob_GetADeIdentificationJob_Convenien TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - Response response = client.GetJob("documents_smith_1"); + Response response = client.GetJob("job_smith_documents_1"); } [Test] @@ -77,7 +77,7 @@ public async Task Example_DeidentificationJob_GetJob_GetADeIdentificationJob_Con TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - Response response = await client.GetJobAsync("documents_smith_1"); + Response response = await client.GetJobAsync("job_smith_documents_1"); } [Test] @@ -88,7 +88,7 @@ public void Example_DeidServices_CancelJob_CancelADeIdentificationJob() TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - Response response = client.CancelJob("documents_smith_1", null); + Response response = client.CancelJob("job_smith_documents_1", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -109,7 +109,7 @@ public async Task Example_DeidServices_CancelJob_CancelADeIdentificationJob_Asyn TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - Response response = await client.CancelJobAsync("documents_smith_1", null); + Response response = await client.CancelJobAsync("job_smith_documents_1", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -130,7 +130,7 @@ public void Example_DeidServices_CancelJob_CancelADeIdentificationJob_Convenienc TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - Response response = client.CancelJob("documents_smith_1"); + Response response = client.CancelJob("job_smith_documents_1"); } [Test] @@ -141,7 +141,7 @@ public async Task Example_DeidServices_CancelJob_CancelADeIdentificationJob_Conv TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - Response response = await client.CancelJobAsync("documents_smith_1"); + Response response = await client.CancelJobAsync("job_smith_documents_1"); } [Test] @@ -152,7 +152,7 @@ public void Example_DeidentificationJob_DeleteJob_DeleteADeIdentificationJob() TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - Response response = client.DeleteJob("documents_smith_1"); + Response response = client.DeleteJob("job_smith_documents_1"); Console.WriteLine(response.Status); } @@ -165,14 +165,14 @@ public async Task Example_DeidentificationJob_DeleteJob_DeleteADeIdentificationJ TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - Response response = await client.DeleteJobAsync("documents_smith_1"); + Response response = await client.DeleteJobAsync("job_smith_documents_1"); Console.WriteLine(response.Status); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DeidServices_Deidentify_DeIdentifyText() + public void Example_DeidServices_DeidentifyText_DeIdentifyText() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -182,10 +182,12 @@ public void Example_DeidServices_Deidentify_DeIdentifyText() { inputText = "Hello my name is John Smith.", operation = "Redact", - dataType = "Plaintext", - redactionFormat = "[{type}]", + customizations = new + { + redactionFormat = "[{type}]", + }, }); - Response response = client.Deidentify(content); + Response response = client.DeidentifyText(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.ToString()); @@ -193,7 +195,7 @@ public void Example_DeidServices_Deidentify_DeIdentifyText() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DeidServices_Deidentify_DeIdentifyText_Async() + public async Task Example_DeidServices_DeidentifyText_DeIdentifyText_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -203,10 +205,12 @@ public async Task Example_DeidServices_Deidentify_DeIdentifyText_Async() { inputText = "Hello my name is John Smith.", operation = "Redact", - dataType = "Plaintext", - redactionFormat = "[{type}]", + customizations = new + { + redactionFormat = "[{type}]", + }, }); - Response response = await client.DeidentifyAsync(content); + Response response = await client.DeidentifyTextAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.ToString()); @@ -214,173 +218,45 @@ public async Task Example_DeidServices_Deidentify_DeIdentifyText_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_DeidServices_Deidentify_DeIdentifyText_Convenience() + public void Example_DeidServices_DeidentifyText_DeIdentifyText_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - DeidentificationContent body = new DeidentificationContent("Hello my name is John Smith.") + DeidentificationContent content = new DeidentificationContent("Hello my name is John Smith.") { - Operation = OperationType.Redact, - DataType = DocumentDataType.Plaintext, - RedactionFormat = "[{type}]", + Operation = DeidentificationOperationType.Redact, + Customizations = new DeidentificationCustomizationOptions + { + RedactionFormat = "[{type}]", + }, }; - Response response = client.Deidentify(body); + Response response = client.DeidentifyText(content); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DeidServices_Deidentify_DeIdentifyText_Convenience_Async() + public async Task Example_DeidServices_DeidentifyText_DeIdentifyText_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - DeidentificationContent body = new DeidentificationContent("Hello my name is John Smith.") + DeidentificationContent content = new DeidentificationContent("Hello my name is John Smith.") { - Operation = OperationType.Redact, - DataType = DocumentDataType.Plaintext, - RedactionFormat = "[{type}]", + Operation = DeidentificationOperationType.Redact, + Customizations = new DeidentificationCustomizationOptions + { + RedactionFormat = "[{type}]", + }, }; - Response response = await client.DeidentifyAsync(body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DeidentificationJob_GetJobs_ListDeIdentificationJobs() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - DeidentificationClient client = new DeidentificationClient(endpoint, credential); - - foreach (BinaryData item in client.GetJobs(10, "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==", null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("sourceLocation").GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("sourceLocation").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("targetLocation").GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("targetLocation").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedAt").ToString()); - Console.WriteLine(result.GetProperty("createdAt").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DeidentificationJob_GetJobs_ListDeIdentificationJobs_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - DeidentificationClient client = new DeidentificationClient(endpoint, credential); - - await foreach (BinaryData item in client.GetJobsAsync(10, "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==", null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("sourceLocation").GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("sourceLocation").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("targetLocation").GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("targetLocation").GetProperty("prefix").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedAt").ToString()); - Console.WriteLine(result.GetProperty("createdAt").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DeidentificationJob_GetJobs_ListDeIdentificationJobs_Convenience() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - DeidentificationClient client = new DeidentificationClient(endpoint, credential); - - foreach (DeidentificationJob item in client.GetJobs()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DeidentificationJob_GetJobs_ListDeIdentificationJobs_Convenience_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - DeidentificationClient client = new DeidentificationClient(endpoint, credential); - - await foreach (DeidentificationJob item in client.GetJobsAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DocumentDetails_GetJobDocuments_ListProcessedDocumentsWithinAJob() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - DeidentificationClient client = new DeidentificationClient(endpoint, credential); - - foreach (BinaryData item in client.GetJobDocuments("documents_smith_1", 10, "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==", null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("input").GetProperty("path").ToString()); - Console.WriteLine(result.GetProperty("input").GetProperty("etag").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DocumentDetails_GetJobDocuments_ListProcessedDocumentsWithinAJob_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - DeidentificationClient client = new DeidentificationClient(endpoint, credential); - - await foreach (BinaryData item in client.GetJobDocumentsAsync("documents_smith_1", 10, "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==", null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("input").GetProperty("path").ToString()); - Console.WriteLine(result.GetProperty("input").GetProperty("etag").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } + Response response = await client.DeidentifyTextAsync(content); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DocumentDetails_GetJobDocuments_ListProcessedDocumentsWithinAJob_Convenience() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - DeidentificationClient client = new DeidentificationClient(endpoint, credential); - - foreach (DocumentDetails item in client.GetJobDocuments("documents_smith_1")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DocumentDetails_GetJobDocuments_ListProcessedDocumentsWithinAJob_Convenience_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - DeidentificationClient client = new DeidentificationClient(endpoint, credential); - - await foreach (DocumentDetails item in client.GetJobDocumentsAsync("documents_smith_1")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DeidentificationJob_CreateJob_CreateADeIdentificationJob() + public void Example_DeidentificationJob_DeidentifyDocuments_CreateADeIdentificationJob() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -388,26 +264,24 @@ public void Example_DeidentificationJob_CreateJob_CreateADeIdentificationJob() using RequestContent content = RequestContent.Create(new { + operation = "Redact", sourceLocation = new { - location = "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", - prefix = "/documents", - extensions = new object[] - { -"*" - }, + location = "https://blobtest.blob.core.windows.net/container", + prefix = "documents/", }, targetLocation = new { - location = "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", - prefix = "/documents", + location = "https://blobtest.blob.core.windows.net/container", + prefix = "_output/", + overwrite = true, + }, + customizations = new + { + redactionFormat = "[{type}]", }, - operation = "Redact", - dataType = "Plaintext", - redactionFormat = "[{type}]", - status = "NotStarted", }); - Operation operation = client.CreateJob(WaitUntil.Completed, "documents_smith_1", content); + Operation operation = client.DeidentifyDocuments(WaitUntil.Completed, "job_smith_documents_1", content); BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; @@ -423,7 +297,7 @@ public void Example_DeidentificationJob_CreateJob_CreateADeIdentificationJob() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DeidentificationJob_CreateJob_CreateADeIdentificationJob_Async() + public async Task Example_DeidentificationJob_DeidentifyDocuments_CreateADeIdentificationJob_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -431,26 +305,24 @@ public async Task Example_DeidentificationJob_CreateJob_CreateADeIdentificationJ using RequestContent content = RequestContent.Create(new { + operation = "Redact", sourceLocation = new { - location = "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", - prefix = "/documents", - extensions = new object[] - { -"*" - }, + location = "https://blobtest.blob.core.windows.net/container", + prefix = "documents/", }, targetLocation = new { - location = "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", - prefix = "/documents", + location = "https://blobtest.blob.core.windows.net/container", + prefix = "_output/", + overwrite = true, + }, + customizations = new + { + redactionFormat = "[{type}]", }, - operation = "Redact", - dataType = "Plaintext", - redactionFormat = "[{type}]", - status = "NotStarted", }); - Operation operation = await client.CreateJobAsync(WaitUntil.Completed, "documents_smith_1", content); + Operation operation = await client.DeidentifyDocumentsAsync(WaitUntil.Completed, "job_smith_documents_1", content); BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; @@ -466,43 +338,47 @@ public async Task Example_DeidentificationJob_CreateJob_CreateADeIdentificationJ [Test] [Ignore("Only validating compilation of examples")] - public void Example_DeidentificationJob_CreateJob_CreateADeIdentificationJob_Convenience() + public void Example_DeidentificationJob_DeidentifyDocuments_CreateADeIdentificationJob_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - DeidentificationJob resource = new DeidentificationJob(new SourceStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D"), "/documents") + DeidentificationJob resource = new DeidentificationJob(new SourceStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container"), "documents/"), new TargetStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container"), "_output/") { - Extensions = { "*" }, - }, new TargetStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D"), "/documents")) + Overwrite = true, + }) { - Operation = OperationType.Redact, - DataType = DocumentDataType.Plaintext, - RedactionFormat = "[{type}]", + Operation = DeidentificationOperationType.Redact, + Customizations = new DeidentificationJobCustomizationOptions + { + RedactionFormat = "[{type}]", + }, }; - Operation operation = client.CreateJob(WaitUntil.Completed, "documents_smith_1", resource); + Operation operation = client.DeidentifyDocuments(WaitUntil.Completed, "job_smith_documents_1", resource); DeidentificationJob responseData = operation.Value; } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DeidentificationJob_CreateJob_CreateADeIdentificationJob_Convenience_Async() + public async Task Example_DeidentificationJob_DeidentifyDocuments_CreateADeIdentificationJob_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); DeidentificationClient client = new DeidentificationClient(endpoint, credential); - DeidentificationJob resource = new DeidentificationJob(new SourceStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D"), "/documents") + DeidentificationJob resource = new DeidentificationJob(new SourceStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container"), "documents/"), new TargetStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container"), "_output/") { - Extensions = { "*" }, - }, new TargetStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D"), "/documents")) + Overwrite = true, + }) { - Operation = OperationType.Redact, - DataType = DocumentDataType.Plaintext, - RedactionFormat = "[{type}]", + Operation = DeidentificationOperationType.Redact, + Customizations = new DeidentificationJobCustomizationOptions + { + RedactionFormat = "[{type}]", + }, }; - Operation operation = await client.CreateJobAsync(WaitUntil.Completed, "documents_smith_1", resource); + Operation operation = await client.DeidentifyDocumentsAsync(WaitUntil.Completed, "job_smith_documents_1", resource); DeidentificationJob responseData = operation.Value; } } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/Helpers/DeidentificationTestBase.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/Helpers/DeidentificationTestBase.cs index 9a173d3f4693..359b7f07bbb6 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/Helpers/DeidentificationTestBase.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/Helpers/DeidentificationTestBase.cs @@ -12,9 +12,11 @@ public class DeidentificationTestBase : RecordedTestBase GetRecordedVariable("DEID_SERVICE_ENDPOINT"); + public string SasUri => GetRecordedVariable("SAS_URI", options => options.IsSecret()); - public static string FakeNextLink => "https://deidservicetest.api.deid.azure.com/jobs?api-version=2000-01-01-preview&continuationToken=1234"; + public static string FakeNextLink => "https://localhost:5020/jobs/net-sdk-job-1234/documents?api-version=2024-11-15&maxpagesize=2&continuationToken=1234"; public static string FakeStorageLocation => "https://fakeblobstorage.blob.core.windows.net/container"; public static string FakeJobName => "net-sdk-job-1234"; + public static string FakeContinuationTokenSegment => "continuationToken=1234"; public string GetStorageAccountLocation() { + if (!string.IsNullOrEmpty(SasUri)) + { + // In playback mode, the SAS URI is sanitized to avoid sharing secrets. + if (string.Equals(SasUri, "Sanitized", System.StringComparison.OrdinalIgnoreCase)) + { + return FakeStorageLocation; + } + return SasUri; + } return $"https://{GetRecordedVariable("STORAGE_ACCOUNT_NAME")}.blob.core.windows.net/{GetRecordedVariable("STORAGE_CONTAINER_NAME")}"; } } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/JobOperationsTest.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/JobOperationsTest.cs index 657363de759a..63ef082e09da 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/JobOperationsTest.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/JobOperationsTest.cs @@ -4,6 +4,10 @@ // using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Runtime.CompilerServices; +using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; using Azure.Core.TestFramework; @@ -15,7 +19,7 @@ namespace Azure.Health.Deidentification.Tests [TestFixture] public class JobOperationsTest : DeidentificationTestBase { - private const string OUTPUT_FOLDER = "_output"; + private const string OUTPUT_FOLDER = "_output/"; public JobOperationsTest() : base(true) { @@ -37,21 +41,19 @@ public async Task CreateJobAsync_SucceedsWithExpectedFields() { SourceLocation = new SourceStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), inputPrefix), TargetLocation = new TargetStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), OUTPUT_FOLDER), - DataType = DocumentDataType.Plaintext, - Operation = OperationType.Surrogate + Operation = DeidentificationOperationType.Surrogate }; - job = (await client.CreateJobAsync(WaitUntil.Started, jobName, job)).Value; + job = (await client.DeidentifyDocumentsAsync(WaitUntil.Started, jobName, job)).Value; Assert.IsNotNull(job); Assert.AreEqual(jobName, job.Name); Assert.IsNotNull(job.CreatedAt); Assert.IsNotNull(job.LastUpdatedAt); Assert.IsNull(job.StartedAt); - Assert.AreEqual(JobStatus.NotStarted, job.Status); + Assert.AreEqual(OperationState.NotStarted, job.Status); Assert.IsNull(job.Error); - Assert.IsNull(job.RedactionFormat); - Assert.IsNull(job.Summary); + Assert.AreEqual("en-US", job.Customizations.SurrogateLocale); Assert.AreEqual(inputPrefix, job.SourceLocation.Prefix); Assert.IsTrue(job.SourceLocation.Location.ToString().Contains("blob.core.windows.net")); Assert.AreEqual(OUTPUT_FOLDER, job.TargetLocation.Prefix); @@ -70,14 +72,12 @@ public async Task CreateThenList_JobExists_ContainsExpectedFields() { SourceLocation = new SourceStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), inputPrefix), TargetLocation = new TargetStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), OUTPUT_FOLDER), - DataType = DocumentDataType.Plaintext, - Operation = OperationType.Surrogate + Operation = DeidentificationOperationType.Surrogate }; - job = (await client.CreateJobAsync(WaitUntil.Started, jobName, job)).Value; + job = (await client.DeidentifyDocumentsAsync(WaitUntil.Started, jobName, job)).Value; - // Test list jobs - var jobs = client.GetJobsAsync().GetAsyncEnumerator(); + var jobs = client.GetJobsAsync(2).GetAsyncEnumerator(); bool jobFound = false; int jobsToLookThrough = 10; @@ -89,9 +89,9 @@ 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(OperationState.NotStarted, jobs.Current.Status); Assert.IsNull(jobs.Current.Error); - Assert.IsNull(jobs.Current.RedactionFormat); + Assert.AreEqual("en-US", job.Customizations.SurrogateLocale); Assert.IsNull(jobs.Current.Summary); Assert.AreEqual(inputPrefix, jobs.Current.SourceLocation.Prefix); Assert.IsTrue(jobs.Current.SourceLocation.Location.ToString().Contains("blob.core.windows.net")); @@ -114,36 +114,58 @@ public async Task JobE2E_WaitUntil_Success() string jobName = GenerateJobName(); const string inputPrefix = "example_patient_1"; + const int expectedReportCount = 3; + const int maxPageSize = 2; DeidentificationJob job = new() { SourceLocation = new SourceStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), inputPrefix), TargetLocation = new TargetStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), OUTPUT_FOLDER), - DataType = DocumentDataType.Plaintext, - Operation = OperationType.Surrogate + Operation = DeidentificationOperationType.Surrogate }; + job.TargetLocation.Overwrite = true; - job = (await client.CreateJobAsync(WaitUntil.Completed, jobName, job)).Value; + job = (await client.DeidentifyDocumentsAsync(WaitUntil.Completed, jobName, job)).Value; job = await client.GetJobAsync(jobName); - Assert.AreEqual(JobStatus.Succeeded, job.Status); + Assert.AreEqual(OperationState.Succeeded, job.Status); Assert.IsNotNull(job.StartedAt); Assert.IsNotNull(job.Summary); - Assert.AreEqual(2, job.Summary.Total); - Assert.AreEqual(2, job.Summary.Successful); + Assert.AreEqual(expectedReportCount, job.Summary.Total); + Assert.AreEqual(expectedReportCount, job.Summary.Successful); - // Check file reports. - var reports = client.GetJobDocumentsAsync(jobName).GetAsyncEnumerator(); - int reportCount = 0; - while (await reports.MoveNextAsync()) + // Check file reports, using maxpagesize parameter to test pagination. + var reportIds = new List(); + int numPages = 0; + int maxPages = 10; + + IAsyncEnumerable> pages = client.GetJobDocumentsAsync(jobName, maxPageSize).AsPages(); + IAsyncEnumerator> enumerator = pages.GetAsyncEnumerator(); + + while (numPages < maxPages && await enumerator.MoveNextAsync()) { - reportCount++; - Assert.IsTrue(reports.Current.Input.Path.StartsWith(inputPrefix)); - Assert.AreEqual(OperationState.Succeeded, reports.Current.Status); - Assert.IsTrue(reports.Current.Output.Path.StartsWith(OUTPUT_FOLDER)); - Assert.IsTrue(reports.Current.Id.Length == 36); // Is Guid. + Page page = enumerator.Current; + numPages++; + + Assert.IsTrue(page.Values.Count <= maxPageSize); + foreach (DeidentificationDocumentDetails report in page.Values) + { + if (reportIds.Contains(report.Id)) + { + Assert.Fail("Duplicate report ID found."); + } + reportIds.Add(report.Id); + Assert.IsTrue(report.Input.Location.ToString().Contains(inputPrefix), + $"Input location {report.Input.Location.ToString()} does not contain input prefix."); + Assert.IsTrue(report.Output.Location.ToString().Contains(OUTPUT_FOLDER)); + Assert.IsNotNull(report.Input.Etag); + Assert.AreEqual(OperationState.Succeeded, report.Status); + Assert.IsNotNull(report.Output.Etag); + Assert.IsTrue(report.Id.Length == 36); // Is Guid. + } } - Assert.AreEqual(2, reportCount); + Assert.AreEqual(Math.Ceiling((1.0 * expectedReportCount) / maxPageSize), numPages); + Assert.AreEqual(expectedReportCount, reportIds.Count); } [Test] @@ -158,27 +180,26 @@ public async Task JobE2E_CancelDeleteFlow_DeletesJob() { SourceLocation = new SourceStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), inputPrefix), TargetLocation = new TargetStorageLocation(new Uri(TestEnvironment.GetStorageAccountLocation()), OUTPUT_FOLDER), - DataType = DocumentDataType.Plaintext, - Operation = OperationType.Surrogate + Operation = DeidentificationOperationType.Surrogate }; - job = (await client.CreateJobAsync(WaitUntil.Started, jobName, job)).Value; + job = (await client.DeidentifyDocumentsAsync(WaitUntil.Started, jobName, job)).Value; do { job = await client.GetJobAsync(jobName); if (Mode != RecordedTestMode.Playback) { - await Task.Delay(2000); + await Task.Delay(1000); } } - while (job.Status == JobStatus.NotStarted); + while (job.Status == OperationState.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(OperationState.Running, job.Status, $"Job should be running. Error: {errorMessage}"); job = await client.CancelJobAsync(jobName); - Assert.AreEqual(JobStatus.Canceled, job.Status); + Assert.AreEqual(OperationState.Canceled, job.Status); await client.DeleteJobAsync(jobName); @@ -199,17 +220,16 @@ public async Task JobE2E_CannotAccessStorage_ThrowsExpectedException() { SourceLocation = new SourceStorageLocation(new Uri(disfunctionalStorageUri), inputPrefix), TargetLocation = new TargetStorageLocation(new Uri(disfunctionalStorageUri), OUTPUT_FOLDER), - DataType = DocumentDataType.Plaintext, - Operation = OperationType.Surrogate + Operation = DeidentificationOperationType.Surrogate }; Type expectedExceptionType = Mode == RecordedTestMode.Playback ? typeof(InvalidOperationException) : typeof(RequestFailedException); - Assert.ThrowsAsync(expectedExceptionType, async () => await client.CreateJobAsync(WaitUntil.Completed, jobName, job)); + Assert.ThrowsAsync(expectedExceptionType, async () => await client.DeidentifyDocumentsAsync(WaitUntil.Completed, jobName, job)); job = await client.GetJobAsync(jobName); - Assert.AreEqual(JobStatus.Failed, job.Status); + Assert.AreEqual(OperationState.Failed, job.Status); Assert.IsNotNull(job.Error); - Assert.AreEqual("JobValidationError", job.Error.Code); + Assert.AreEqual("StorageAccessDenied", job.Error.Code); Assert.IsTrue(job.Error.Message.Length > 10); // Arbitrary length choice. } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/RealtimeOperationsTest.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/RealtimeOperationsTest.cs index 5968b1606ae5..03a8813c0c34 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/RealtimeOperationsTest.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/Tests/RealtimeOperationsTest.cs @@ -31,7 +31,7 @@ public async Task Realtime_Surrogate_ReturnsExcepted() string input = "Hello, my name is John Smith."; DeidentificationContent content = new(input); - DeidentificationResult result = await client.DeidentifyAsync(content); + DeidentificationResult result = await client.DeidentifyTextAsync(content); Assert.IsNull(result.TaggerResult, "On Surrogate Operation, expect TaggerResult to be null."); Assert.IsNotNull(result.OutputText, "On Surrogate Operation, expect OutputText to be not null."); @@ -46,14 +46,12 @@ 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, null); + DeidentificationContent content = new(input, DeidentificationOperationType.Tag, null, null); - DeidentificationResult result = await client.DeidentifyAsync(content); + DeidentificationResult result = await client.DeidentifyTextAsync(content); Assert.IsNotNull(result.TaggerResult, "On Tag Operation, expect TaggerResult to be not null."); Assert.IsNull(result.OutputText, "On Tag Operation, expect OutputText to be null."); - Assert.IsNull(result.TaggerResult.Etag, "Expected Etag to be null."); - Assert.IsNull(result.TaggerResult.Path, "Expected Path to be null."); Assert.IsTrue(result.TaggerResult.Entities.Count > 0, "Expected TaggerResult to have at least one tag."); Assert.IsTrue(result.TaggerResult.Entities[0].Category == PhiCategory.Doctor || result.TaggerResult.Entities[0].Category == PhiCategory.Patient, "Expected first tag to be a patient/doctor."); diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample1_HelloWorld.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample1_HelloWorld.cs index 92713d80bcb2..adf32d1a3797 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample1_HelloWorld.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample1_HelloWorld.cs @@ -31,9 +31,9 @@ public void HelloWorld() #endregion #region Snippet:AzHealthDeidSample1_CreateRequest - DeidentificationContent content = new("Hello, John!", OperationType.Surrogate, DocumentDataType.Plaintext, null, null); + DeidentificationContent content = new("Hello, John!"); - Response result = client.Deidentify(content); + Response result = client.DeidentifyText(content); string outputString = result.Value.OutputText; Console.WriteLine(outputString); // Hello, Tom! #endregion diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample1_HelloWorldAsync.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample1_HelloWorldAsync.cs index f104ede8ba51..ef8314ddb05b 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample1_HelloWorldAsync.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample1_HelloWorldAsync.cs @@ -31,9 +31,9 @@ public async void HelloWorldAsync() #endregion #region Snippet:AzHealthDeidSample1Async_CreateRequest - DeidentificationContent content = new("Hello, John!", OperationType.Surrogate, DocumentDataType.Plaintext, null, null); + DeidentificationContent content = new("Hello, John!"); - Response result = await client.DeidentifyAsync(content); + Response result = await client.DeidentifyTextAsync(content); string outputString = result.Value.OutputText; Console.WriteLine(outputString); // Hello, Tom! #endregion diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample2_CreateAndRunJob.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample2_CreateAndRunJob.cs index b59716824607..e4195e1e3788 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample2_CreateAndRunJob.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample2_CreateAndRunJob.cs @@ -34,12 +34,11 @@ public void CreateAndRunJob() 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 #endregion } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample2_CreateAndRunJobAsync.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample2_CreateAndRunJobAsync.cs index d18c054a1d45..7f06caadcbfb 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample2_CreateAndRunJobAsync.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample2_CreateAndRunJobAsync.cs @@ -34,12 +34,11 @@ public async void CreateAndRunJobAsync() 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 #endregion } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample4_ListCompletedFiles.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample4_ListCompletedFiles.cs index a2f710f8411e..1c2eb0b7d014 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample4_ListCompletedFiles.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample4_ListCompletedFiles.cs @@ -26,13 +26,13 @@ public void ListCompletedFiles() ); #region Snippet:AzHealthDeidSample4_ListCompletedFiles - Pageable files = client.GetJobDocuments("job-name-1"); + Pageable 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}"); } #endregion } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample4_ListCompletedFilesAsync.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample4_ListCompletedFilesAsync.cs index 7b6d6e67adac..fffeb9847d50 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample4_ListCompletedFilesAsync.cs +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tests/samples/Sample4_ListCompletedFilesAsync.cs @@ -26,13 +26,13 @@ public async void ListCompletedFilesAsync() ); #region Snippet:AzHealthDeidSample4Async_ListCompletedFiles - AsyncPageable files = client.GetJobDocumentsAsync("job-name-1"); + AsyncPageable 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}"); } #endregion } diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/tsp-location.yaml b/sdk/healthdataaiservices/Azure.Health.Deidentification/tsp-location.yaml index 909f38668483..5feffc1106d3 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/tsp-location.yaml +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tsp-location.yaml @@ -1,5 +1,5 @@ -additionalDirectories: [] -repo: Azure/azure-rest-api-specs -commit: 2771da5baeee73dfd70b2a5f2813a55549c2aa73 directory: specification/healthdataaiservices/HealthDataAIServices.DeidServices +repo: Azure/azure-rest-api-specs +commit: 45baf6e76beba3c271f839c8e3c2d2fffa209ab8 +additionalDirectories: [] diff --git a/sdk/healthdataaiservices/test-resources-post.ps1 b/sdk/healthdataaiservices/test-resources-post.ps1 index 997e08d463d7..dfb336d16fe2 100644 --- a/sdk/healthdataaiservices/test-resources-post.ps1 +++ b/sdk/healthdataaiservices/test-resources-post.ps1 @@ -36,6 +36,7 @@ Import-Module Az.Storage $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -UseConnectedAccount # FIXME Remove once vpn team fixes the network acl issue +# TODO: disable local storage account auth $networkRuleSet = New-Object -TypeName Microsoft.Azure.Commands.Management.Storage.Models.PSNetworkRuleSet $networkRuleSet.DefaultAction = "Allow" Set-AzStorageAccount -ResourceGroupName $resourceGroup -Name $storageAccountName -NetworkRuleSet $networkRuleSet