Partilhar via


DocumentIntelligenceAdministrationClient.GetClassifiersAsync Method

Definition

Overloads

GetClassifiersAsync(RequestContext)

[Protocol Method] List all document classifiers.

GetClassifiersAsync(CancellationToken)

List all document classifiers.

GetClassifiersAsync(RequestContext)

Source:
DocumentIntelligenceAdministrationClient.cs

[Protocol Method] List all document classifiers.

public virtual Azure.AsyncPageable<BinaryData> GetClassifiersAsync (Azure.RequestContext context);
abstract member GetClassifiersAsync : Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetClassifiersAsync : Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetClassifiersAsync (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 GetClassifiersAsync and parse the result.

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

await foreach (BinaryData item in client.GetClassifiersAsync(null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("classifierId").ToString());
    Console.WriteLine(result.GetProperty("createdDateTime").ToString());
    Console.WriteLine(result.GetProperty("apiVersion").ToString());
    Console.WriteLine(result.GetProperty("docTypes").GetProperty("<key>").ToString());
}

This sample shows how to call GetClassifiersAsync 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);

await foreach (BinaryData item in client.GetClassifiersAsync(null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("classifierId").ToString());
    Console.WriteLine(result.GetProperty("description").ToString());
    Console.WriteLine(result.GetProperty("createdDateTime").ToString());
    Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
    Console.WriteLine(result.GetProperty("apiVersion").ToString());
    Console.WriteLine(result.GetProperty("baseClassifierId").ToString());
    Console.WriteLine(result.GetProperty("docTypes").GetProperty("<key>").GetProperty("sourceKind").ToString());
    Console.WriteLine(result.GetProperty("docTypes").GetProperty("<key>").GetProperty("azureBlobSource").GetProperty("containerUrl").ToString());
    Console.WriteLine(result.GetProperty("docTypes").GetProperty("<key>").GetProperty("azureBlobSource").GetProperty("prefix").ToString());
    Console.WriteLine(result.GetProperty("docTypes").GetProperty("<key>").GetProperty("azureBlobFileListSource").GetProperty("containerUrl").ToString());
    Console.WriteLine(result.GetProperty("docTypes").GetProperty("<key>").GetProperty("azureBlobFileListSource").GetProperty("fileList").ToString());
    Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString());
    Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString());
    Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("target").ToString());
}

Applies to

GetClassifiersAsync(CancellationToken)

Source:
DocumentIntelligenceAdministrationClient.cs

List all document classifiers.

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

Parameters

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetClassifiersAsync.

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

await foreach (DocumentClassifierDetails item in client.GetClassifiersAsync())
{
}

This sample shows how to call GetClassifiersAsync with all parameters.

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

await foreach (DocumentClassifierDetails item in client.GetClassifiersAsync())
{
}

Applies to