DeidentificationClient.DeidentifyDocumentsAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| DeidentifyDocumentsAsync(WaitUntil, String, RequestContent, RequestContext) |
Long-running resource create or replace operation template. |
| DeidentifyDocumentsAsync(WaitUntil, String, DeidentificationJob, CancellationToken) |
Long-running resource create or replace operation template. |
DeidentifyDocumentsAsync(WaitUntil, String, RequestContent, RequestContext)
- Source:
- DeidentificationClient.cs
- Source:
- DeidentificationClient.cs
Long-running resource create or replace operation template.
public virtual System.Threading.Tasks.Task<Azure.Operation<BinaryData>> DeidentifyDocumentsAsync(Azure.WaitUntil waitUntil, string jobName, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member DeidentifyDocumentsAsync : Azure.WaitUntil * string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>
override this.DeidentifyDocumentsAsync : Azure.WaitUntil * string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>
Public Overridable Function DeidentifyDocumentsAsync (waitUntil As WaitUntil, jobName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Operation(Of BinaryData))
Parameters
- waitUntil
- WaitUntil
Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- jobName
- String
The name of a job.
- content
- RequestContent
The content to send as the body of the request.
- context
- RequestContext
The request options, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
Service returned a non-success status code.
jobName or content is null.
jobName is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call DeidentifyDocumentsAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
DeidentificationClient client = new DeidentificationClient(endpoint, credential);
using RequestContent content = RequestContent.Create(new
{
operation = "Redact",
sourceLocation = new
{
location = "https://blobtest.blob.core.windows.net/container",
prefix = "documents/",
},
targetLocation = new
{
location = "https://blobtest.blob.core.windows.net/container",
prefix = "_output/",
overwrite = true,
},
customizations = new
{
redactionFormat = "[{type}]",
},
});
Operation<BinaryData> operation = await client.DeidentifyDocumentsAsync(WaitUntil.Completed, "job_smith_documents_1", content);
BinaryData responseData = operation.Value;
JsonElement result = JsonDocument.Parse(responseData.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());
Applies to
DeidentifyDocumentsAsync(WaitUntil, String, DeidentificationJob, CancellationToken)
- Source:
- DeidentificationClient.cs
- Source:
- DeidentificationClient.cs
Long-running resource create or replace operation template.
public virtual System.Threading.Tasks.Task<Azure.Operation<Azure.Health.Deidentification.DeidentificationJob>> DeidentifyDocumentsAsync(Azure.WaitUntil waitUntil, string jobName, Azure.Health.Deidentification.DeidentificationJob resource, System.Threading.CancellationToken cancellationToken = default);
abstract member DeidentifyDocumentsAsync : Azure.WaitUntil * string * Azure.Health.Deidentification.DeidentificationJob * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Operation<Azure.Health.Deidentification.DeidentificationJob>>
override this.DeidentifyDocumentsAsync : Azure.WaitUntil * string * Azure.Health.Deidentification.DeidentificationJob * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Operation<Azure.Health.Deidentification.DeidentificationJob>>
Public Overridable Function DeidentifyDocumentsAsync (waitUntil As WaitUntil, jobName As String, resource As DeidentificationJob, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Operation(Of DeidentificationJob))
Parameters
- waitUntil
- WaitUntil
Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- jobName
- String
The name of a job.
- resource
- DeidentificationJob
The resource instance.
- cancellationToken
- CancellationToken
The cancellation token that can be used to cancel the operation.
Returns
Exceptions
jobName or resource is null.
jobName is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call DeidentifyDocumentsAsync.
Uri endpoint = new Uri("<endpoint>");
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"), "documents/"), new TargetStorageLocation(new Uri("https://blobtest.blob.core.windows.net/container"), "_output/")
{
Overwrite = true,
})
{
OperationType = DeidentificationOperationType.Redact,
Customizations = new DeidentificationJobCustomizationOptions
{
RedactionFormat = "[{type}]",
},
};
Operation<DeidentificationJob> operation = await client.DeidentifyDocumentsAsync(WaitUntil.Completed, "job_smith_documents_1", resource);
DeidentificationJob responseData = operation.Value;
Remarks
Long-running resource create or replace operation template.