Condividi tramite


DocumentIntelligenceAdministrationClient.GetModelsAsync Method

Definition

Overloads

GetModelsAsync(RequestContext)

[Protocol Method] List all document models

GetModelsAsync(CancellationToken)

List all document models.

GetModelsAsync(RequestContext)

Source:
DocumentIntelligenceAdministrationClient.cs
Source:
DocumentIntelligenceAdministrationClient.cs

[Protocol Method] List all document models

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

Parameters

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 GetModelsAsync and parse the result.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential);

await foreach (BinaryData item in client.GetModelsAsync(null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("modelId").ToString());
    Console.WriteLine(result.GetProperty("createdDateTime").ToString());
}

Applies to

GetModelsAsync(CancellationToken)

Source:
DocumentIntelligenceAdministrationClient.cs
Source:
DocumentIntelligenceAdministrationClient.cs

List all document models.

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

Parameters

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetModelsAsync.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential);

await foreach (DocumentModelDetails item in client.GetModelsAsync())
{
}

Applies to