DeidentificationClient.DeidentifyDocuments Method

Definition

Overloads

Name Description
DeidentifyDocuments(WaitUntil, String, RequestContent, RequestContext)

Long-running resource create or replace operation template.

DeidentifyDocuments(WaitUntil, String, DeidentificationJob, CancellationToken)

Long-running resource create or replace operation template.

DeidentifyDocuments(WaitUntil, String, RequestContent, RequestContext)

Source:
DeidentificationClient.cs
Source:
DeidentificationClient.cs

Long-running resource create or replace operation template.

public virtual Azure.Operation<BinaryData> DeidentifyDocuments(Azure.WaitUntil waitUntil, string jobName, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member DeidentifyDocuments : Azure.WaitUntil * string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Operation<BinaryData>
override this.DeidentifyDocuments : Azure.WaitUntil * string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Operation<BinaryData>
Public Overridable Function DeidentifyDocuments (waitUntil As WaitUntil, jobName As String, content As RequestContent, Optional context As RequestContext = Nothing) As 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 DeidentifyDocuments 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 = client.DeidentifyDocuments(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

DeidentifyDocuments(WaitUntil, String, DeidentificationJob, CancellationToken)

Source:
DeidentificationClient.cs
Source:
DeidentificationClient.cs

Long-running resource create or replace operation template.

public virtual Azure.Operation<Azure.Health.Deidentification.DeidentificationJob> DeidentifyDocuments(Azure.WaitUntil waitUntil, string jobName, Azure.Health.Deidentification.DeidentificationJob resource, System.Threading.CancellationToken cancellationToken = default);
abstract member DeidentifyDocuments : Azure.WaitUntil * string * Azure.Health.Deidentification.DeidentificationJob * System.Threading.CancellationToken -> Azure.Operation<Azure.Health.Deidentification.DeidentificationJob>
override this.DeidentifyDocuments : Azure.WaitUntil * string * Azure.Health.Deidentification.DeidentificationJob * System.Threading.CancellationToken -> Azure.Operation<Azure.Health.Deidentification.DeidentificationJob>
Public Overridable Function DeidentifyDocuments (waitUntil As WaitUntil, jobName As String, resource As DeidentificationJob, Optional cancellationToken As CancellationToken = Nothing) As 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 DeidentifyDocuments.

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 = client.DeidentifyDocuments(WaitUntil.Completed, "job_smith_documents_1", resource);
DeidentificationJob responseData = operation.Value;

Remarks

Long-running resource create or replace operation template.

Applies to