DocumentIntelligenceAdministrationClient.GetClassifiers Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetClassifiers(RequestContext) |
[Protocol Method] List all document classifiers.
|
GetClassifiers(CancellationToken) |
List all document classifiers. |
GetClassifiers(RequestContext)
[Protocol Method] List all document classifiers.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetClassifiers(CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Pageable<BinaryData> GetClassifiers (Azure.RequestContext context);
abstract member GetClassifiers : Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetClassifiers : Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetClassifiers (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 GetClassifiers 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.GetClassifiers(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 GetClassifiers 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.GetClassifiers(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
GetClassifiers(CancellationToken)
List all document classifiers.
public virtual Azure.Pageable<Azure.AI.DocumentIntelligence.DocumentClassifierDetails> GetClassifiers (System.Threading.CancellationToken cancellationToken = default);
abstract member GetClassifiers : System.Threading.CancellationToken -> Azure.Pageable<Azure.AI.DocumentIntelligence.DocumentClassifierDetails>
override this.GetClassifiers : System.Threading.CancellationToken -> Azure.Pageable<Azure.AI.DocumentIntelligence.DocumentClassifierDetails>
Public Overridable Function GetClassifiers (Optional cancellationToken As CancellationToken = Nothing) As Pageable(Of DocumentClassifierDetails)
Parameters
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Examples
This sample shows how to call GetClassifiers.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential);
foreach (DocumentClassifierDetails item in client.GetClassifiers())
{
}
This sample shows how to call GetClassifiers with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential);
foreach (DocumentClassifierDetails item in client.GetClassifiers())
{
}
Applies to
Azure SDK for .NET