DocumentIntelligenceAdministrationClient.GetResourceInfo 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
GetResourceInfo(RequestContext) |
[Protocol Method] Return information about the current resource.
|
GetResourceInfo(CancellationToken) |
Return information about the current resource. |
GetResourceInfo(RequestContext)
[Protocol Method] Return information about the current resource.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetResourceInfo(CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response GetResourceInfo (Azure.RequestContext context);
abstract member GetResourceInfo : Azure.RequestContext -> Azure.Response
override this.GetResourceInfo : Azure.RequestContext -> Azure.Response
Public Overridable Function GetResourceInfo (context As RequestContext) As 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 GetResourceInfo 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.GetResourceInfo(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 GetResourceInfo 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.GetResourceInfo(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
GetResourceInfo(CancellationToken)
Return information about the current resource.
public virtual Azure.Response<Azure.AI.DocumentIntelligence.ResourceDetails> GetResourceInfo (System.Threading.CancellationToken cancellationToken = default);
abstract member GetResourceInfo : System.Threading.CancellationToken -> Azure.Response<Azure.AI.DocumentIntelligence.ResourceDetails>
override this.GetResourceInfo : System.Threading.CancellationToken -> Azure.Response<Azure.AI.DocumentIntelligence.ResourceDetails>
Public Overridable Function GetResourceInfo (Optional cancellationToken As CancellationToken = Nothing) As Response(Of ResourceDetails)
Parameters
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Examples
This sample shows how to call GetResourceInfo.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential);
Response<ResourceDetails> response = client.GetResourceInfo();
This sample shows how to call GetResourceInfo 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 = client.GetResourceInfo();
Applies to
Azure SDK for .NET