DocumentIntelligenceAdministrationClient.GetOperations Method

Definition

Overloads

GetOperations(RequestContext)

[Protocol Method] Lists all operations.

GetOperations(CancellationToken)

Lists all operations.

GetOperations(RequestContext)

Source:
DocumentIntelligenceAdministrationClient.cs

[Protocol Method] Lists all operations.

public virtual Azure.Pageable<BinaryData> GetOperations (Azure.RequestContext context);
abstract member GetOperations : Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetOperations : Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetOperations (context As RequestContext) As Pageable(Of BinaryData)

Parameters

context
RequestContext

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

Returns

The Pageable<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 GetOperations and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential);

foreach (BinaryData item in client.GetOperations(null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("operationId").ToString());
    Console.WriteLine(result.GetProperty("status").ToString());
    Console.WriteLine(result.GetProperty("createdDateTime").ToString());
    Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
    Console.WriteLine(result.GetProperty("kind").ToString());
    Console.WriteLine(result.GetProperty("resourceLocation").ToString());
}

This sample shows how to call GetOperations with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential);

foreach (BinaryData item in client.GetOperations(null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("operationId").ToString());
    Console.WriteLine(result.GetProperty("status").ToString());
    Console.WriteLine(result.GetProperty("percentCompleted").ToString());
    Console.WriteLine(result.GetProperty("createdDateTime").ToString());
    Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
    Console.WriteLine(result.GetProperty("kind").ToString());
    Console.WriteLine(result.GetProperty("resourceLocation").ToString());
    Console.WriteLine(result.GetProperty("apiVersion").ToString());
    Console.WriteLine(result.GetProperty("tags").GetProperty("<key>").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("error").GetProperty("innererror").GetProperty("message").ToString());
}

Applies to

GetOperations(CancellationToken)

Source:
DocumentIntelligenceAdministrationClient.cs

Lists all operations.

public virtual Azure.Pageable<Azure.AI.DocumentIntelligence.OperationDetails> GetOperations (System.Threading.CancellationToken cancellationToken = default);
abstract member GetOperations : System.Threading.CancellationToken -> Azure.Pageable<Azure.AI.DocumentIntelligence.OperationDetails>
override this.GetOperations : System.Threading.CancellationToken -> Azure.Pageable<Azure.AI.DocumentIntelligence.OperationDetails>
Public Overridable Function GetOperations (Optional cancellationToken As CancellationToken = Nothing) As Pageable(Of OperationDetails)

Parameters

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetOperations.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential);

foreach (OperationDetails item in client.GetOperations())
{
}

This sample shows how to call GetOperations with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential);

foreach (OperationDetails item in client.GetOperations())
{
}

Applies to