Freigeben über


DocumentIntelligenceAdministrationClient.GetClassifierAsync Method

Definition

Overloads

GetClassifierAsync(String, RequestContext)

[Protocol Method] Gets detailed document classifier information.

GetClassifierAsync(String, CancellationToken)

Gets detailed document classifier information.

GetClassifierAsync(String, RequestContext)

Source:
DocumentIntelligenceAdministrationClient.cs

[Protocol Method] Gets detailed document classifier information.

public virtual System.Threading.Tasks.Task<Azure.Response> GetClassifierAsync (string classifierId, Azure.RequestContext context);
abstract member GetClassifierAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetClassifierAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetClassifierAsync (classifierId As String, context As RequestContext) As Task(Of Response)

Parameters

classifierId
String

Unique document classifier name.

context
RequestContext

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

Returns

The response returned from the service.

Exceptions

classifierId is null.

classifierId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

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

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

Response response = await client.GetClassifierAsync("<classifierId>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).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 GetClassifierAsync 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);

Response response = await client.GetClassifierAsync("<classifierId>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).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

GetClassifierAsync(String, CancellationToken)

Source:
DocumentIntelligenceAdministrationClient.cs

Gets detailed document classifier information.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.DocumentIntelligence.DocumentClassifierDetails>> GetClassifierAsync (string classifierId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetClassifierAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.DocumentIntelligence.DocumentClassifierDetails>>
override this.GetClassifierAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.DocumentIntelligence.DocumentClassifierDetails>>
Public Overridable Function GetClassifierAsync (classifierId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of DocumentClassifierDetails))

Parameters

classifierId
String

Unique document classifier name.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

classifierId is null.

classifierId is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetClassifierAsync.

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

Response<DocumentClassifierDetails> response = await client.GetClassifierAsync("<classifierId>");

This sample shows how to call GetClassifierAsync with all parameters.

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

Response<DocumentClassifierDetails> response = await client.GetClassifierAsync("<classifierId>");

Applies to