Partilhar via


DocumentIntelligenceAdministrationClient.GetResourceInfoAsync Method

Definition

Overloads

GetResourceInfoAsync(CancellationToken)

Return information about the current resource.

GetResourceInfoAsync(RequestContext)

[Protocol Method] Return information about the current resource.

GetResourceInfoAsync(CancellationToken)

Source:
DocumentIntelligenceAdministrationClient.cs

Return information about the current resource.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.DocumentIntelligence.ResourceDetails>> GetResourceInfoAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member GetResourceInfoAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.DocumentIntelligence.ResourceDetails>>
override this.GetResourceInfoAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.DocumentIntelligence.ResourceDetails>>
Public Overridable Function GetResourceInfoAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ResourceDetails))

Parameters

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetResourceInfoAsync.

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

Response<ResourceDetails> response = await client.GetResourceInfoAsync();

This sample shows how to call GetResourceInfoAsync with all parameters.

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

Response<ResourceDetails> response = await client.GetResourceInfoAsync();

Applies to

GetResourceInfoAsync(RequestContext)

Source:
DocumentIntelligenceAdministrationClient.cs

[Protocol Method] Return information about the current resource.

public virtual System.Threading.Tasks.Task<Azure.Response> GetResourceInfoAsync (Azure.RequestContext context);
abstract member GetResourceInfoAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetResourceInfoAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetResourceInfoAsync (context As RequestContext) As Task(Of Response)

Parameters

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

Service returned a non-success status code.

Examples

This sample shows how to call GetResourceInfoAsync 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.GetResourceInfoAsync(null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString());
Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("limit").ToString());

This sample shows how to call GetResourceInfoAsync 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.GetResourceInfoAsync(null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString());
Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("limit").ToString());

Applies to