AnalyzeOperationExtensions.GetUsage(Operation<AnalysisResult>) Method

Definition

Gets the usage details from a completed analyze operation.

public static Azure.AI.ContentUnderstanding.AnalyzeUsageDetails? GetUsage(this Azure.Operation<Azure.AI.ContentUnderstanding.AnalysisResult> operation);
static member GetUsage : Azure.Operation<Azure.AI.ContentUnderstanding.AnalysisResult> -> Azure.AI.ContentUnderstanding.AnalyzeUsageDetails
<Extension()>
Public Function GetUsage (operation As Operation(Of AnalysisResult)) As AnalyzeUsageDetails

Parameters

operation
Operation<AnalysisResult>

The completed analyze operation.

Returns

The AnalyzeUsageDetails if the operation has completed and usage information is available; null if the operation has not completed or usage data is not present in the response.

Remarks

The REST API returns a usage field as a sibling of result in the LRO response envelope. This extension method reads usage from the operation's final response and deserializes it into an AnalyzeUsageDetails instance. The operation must have completed successfully before calling this method.

Applies to