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..6f260ac4d6d8 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,35 @@ 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 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 +46,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 +106,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 +198,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 +261,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 +298,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..6f260ac4d6d8 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,35 @@ 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 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 +46,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 +106,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 +198,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 +261,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 +298,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/src/Generated/DeidentificationClient.cs b/sdk/healthdataaiservices/Azure.Health.Deidentification/src/Generated/DeidentificationClient.cs index cf93beb8499e..7513e341e749 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(maxpagesize, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsNextPageRequest(nextLink, maxpagesize, continuationToken, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DeidentificationJob.DeserializeDeidentificationJob(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobs", "value", "nextLink", context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsInternalsRequest(maxpagesize, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsInternalsNextPageRequest(nextLink, maxpagesize, continuationToken, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DeidentificationJob.DeserializeDeidentificationJob(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobsInternals", "value", "nextLink", 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(maxpagesize, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsNextPageRequest(nextLink, maxpagesize, continuationToken, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DeidentificationJob.DeserializeDeidentificationJob(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobs", "value", "nextLink", context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsInternalsRequest(maxpagesize, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsInternalsNextPageRequest(nextLink, maxpagesize, continuationToken, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DeidentificationJob.DeserializeDeidentificationJob(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobsInternals", "value", "nextLink", 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(maxpagesize, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsNextPageRequest(nextLink, maxpagesize, continuationToken, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobs", "value", "nextLink", context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsInternalsRequest(maxpagesize, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsInternalsNextPageRequest(nextLink, maxpagesize, continuationToken, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobsInternals", "value", "nextLink", 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(maxpagesize, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsNextPageRequest(nextLink, maxpagesize, continuationToken, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobs", "value", "nextLink", context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobsInternalsRequest(maxpagesize, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobsInternalsNextPageRequest(nextLink, maxpagesize, continuationToken, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobsInternals", "value", "nextLink", 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, maxpagesize, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsNextPageRequest(nextLink, name, maxpagesize, continuationToken, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DocumentDetails.DeserializeDocumentDetails(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocuments", "value", "nextLink", context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobDocumentsInternalsRequest(name, maxpagesize, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsInternalsNextPageRequest(nextLink, name, maxpagesize, continuationToken, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DeidentificationDocumentDetails.DeserializeDeidentificationDocumentDetails(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocumentsInternals", "value", "nextLink", 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, maxpagesize, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsNextPageRequest(nextLink, name, maxpagesize, continuationToken, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DocumentDetails.DeserializeDocumentDetails(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocuments", "value", "nextLink", context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobDocumentsInternalsRequest(name, maxpagesize, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsInternalsNextPageRequest(nextLink, name, maxpagesize, continuationToken, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DeidentificationDocumentDetails.DeserializeDeidentificationDocumentDetails(e), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocumentsInternals", "value", "nextLink", 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, maxpagesize, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsNextPageRequest(nextLink, name, maxpagesize, continuationToken, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocuments", "value", "nextLink", context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobDocumentsInternalsRequest(name, maxpagesize, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsInternalsNextPageRequest(nextLink, name, maxpagesize, continuationToken, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocumentsInternals", "value", "nextLink", 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, maxpagesize, continuationToken, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsNextPageRequest(nextLink, name, maxpagesize, continuationToken, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocuments", "value", "nextLink", context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetJobDocumentsInternalsRequest(name, maxpagesize, continuationToken, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetJobDocumentsInternalsNextPageRequest(nextLink, name, maxpagesize, continuationToken, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DeidentificationClient.GetJobDocumentsInternals", "value", "nextLink", 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/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/tsp-location.yaml b/sdk/healthdataaiservices/Azure.Health.Deidentification/tsp-location.yaml index 909f38668483..2514ba399f29 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/tsp-location.yaml +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/tsp-location.yaml @@ -1,5 +1,4 @@ -additionalDirectories: [] -repo: Azure/azure-rest-api-specs -commit: 2771da5baeee73dfd70b2a5f2813a55549c2aa73 directory: specification/healthdataaiservices/HealthDataAIServices.DeidServices - +commit: d308ccfc5ababbeefc3e0884435674935eb493ab +repo: Azure/azure-rest-api-specs +additionalDirectories: