Share via


DeidentificationClient.GetJobsAsync Method

Definition

Overloads

GetJobsAsync(Nullable<Int32>, String, CancellationToken)

List de-identification jobs.

GetJobsAsync(Nullable<Int32>, String, RequestContext)

[Protocol Method] List de-identification jobs.

GetJobsAsync(Nullable<Int32>, String, CancellationToken)

Source:
DeidentificationClient.cs

List de-identification jobs.

public virtual Azure.AsyncPageable<Azure.Health.Deidentification.DeidentificationJob> GetJobsAsync (int? maxpagesize = default, string continuationToken = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetJobsAsync : Nullable<int> * string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Health.Deidentification.DeidentificationJob>
override this.GetJobsAsync : Nullable<int> * string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Health.Deidentification.DeidentificationJob>
Public Overridable Function GetJobsAsync (Optional maxpagesize As Nullable(Of Integer) = Nothing, Optional continuationToken As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of DeidentificationJob)

Parameters

maxpagesize
Nullable<Int32>

The maximum number of result items per page.

continuationToken
String

Token to continue a previous query.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetJobsAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeidentificationClient client = new DeidentificationClient(endpoint, credential);

await foreach (DeidentificationJob item in client.GetJobsAsync())
{
}

This sample shows how to call GetJobsAsync with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeidentificationClient client = new DeidentificationClient(endpoint, credential);

await foreach (DeidentificationJob item in client.GetJobsAsync(maxpagesize: 1234, continuationToken: "<continuationToken>"))
{
}

Remarks

Resource list operation template.

Applies to

GetJobsAsync(Nullable<Int32>, String, RequestContext)

Source:
DeidentificationClient.cs

[Protocol Method] List de-identification jobs.

public virtual Azure.AsyncPageable<BinaryData> GetJobsAsync (int? maxpagesize, string continuationToken, Azure.RequestContext context);
abstract member GetJobsAsync : Nullable<int> * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetJobsAsync : Nullable<int> * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetJobsAsync (maxpagesize As Nullable(Of Integer), continuationToken As String, context As RequestContext) As AsyncPageable(Of BinaryData)

Parameters

maxpagesize
Nullable<Int32>

The maximum number of result items per page.

continuationToken
String

Token to continue a previous query.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The AsyncPageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.

Exceptions

Service returned a non-success status code.

Examples

This sample shows how to call GetJobsAsync and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeidentificationClient client = new DeidentificationClient(endpoint, credential);

await foreach (BinaryData item in client.GetJobsAsync(null, null, 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 GetJobsAsync with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeidentificationClient client = new DeidentificationClient(endpoint, credential);

await foreach (BinaryData item in client.GetJobsAsync(1234, "<continuationToken>", 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("sourceLocation").GetProperty("extensions")[0].ToString());
    Console.WriteLine(result.GetProperty("targetLocation").GetProperty("location").ToString());
    Console.WriteLine(result.GetProperty("targetLocation").GetProperty("prefix").ToString());
    Console.WriteLine(result.GetProperty("operation").ToString());
    Console.WriteLine(result.GetProperty("dataType").ToString());
    Console.WriteLine(result.GetProperty("redactionFormat").ToString());
    Console.WriteLine(result.GetProperty("status").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString());
    Console.WriteLine(result.GetProperty("lastUpdatedAt").ToString());
    Console.WriteLine(result.GetProperty("createdAt").ToString());
    Console.WriteLine(result.GetProperty("startedAt").ToString());
    Console.WriteLine(result.GetProperty("summary").GetProperty("successful").ToString());
    Console.WriteLine(result.GetProperty("summary").GetProperty("failed").ToString());
    Console.WriteLine(result.GetProperty("summary").GetProperty("canceled").ToString());
    Console.WriteLine(result.GetProperty("summary").GetProperty("total").ToString());
    Console.WriteLine(result.GetProperty("summary").GetProperty("bytesProcessed").ToString());
}

Applies to