DocumentIntelligenceAdministrationClient.GetClassifier Method

Definition

Overloads

GetClassifier(String, RequestContext)

[Protocol Method] Gets detailed document classifier information.

GetClassifier(String, CancellationToken)

Gets detailed document classifier information.

GetClassifier(String, RequestContext)

Source:
DocumentIntelligenceAdministrationClient.cs

[Protocol Method] Gets detailed document classifier information.

public virtual Azure.Response GetClassifier (string classifierId, Azure.RequestContext context);
abstract member GetClassifier : string * Azure.RequestContext -> Azure.Response
override this.GetClassifier : string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetClassifier (classifierId As String, context As RequestContext) As 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 GetClassifier 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 = client.GetClassifier("<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 GetClassifier 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 = client.GetClassifier("<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

GetClassifier(String, CancellationToken)

Source:
DocumentIntelligenceAdministrationClient.cs

Gets detailed document classifier information.

public virtual Azure.Response<Azure.AI.DocumentIntelligence.DocumentClassifierDetails> GetClassifier (string classifierId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetClassifier : string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.DocumentIntelligence.DocumentClassifierDetails>
override this.GetClassifier : string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.DocumentIntelligence.DocumentClassifierDetails>
Public Overridable Function GetClassifier (classifierId As String, Optional cancellationToken As CancellationToken = Nothing) As 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 GetClassifier.

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

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

This sample shows how to call GetClassifier 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 = client.GetClassifier("<classifierId>");

Applies to