EasmClient.GetBillableAsync 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
GetBillableAsync(RequestContext) |
[Protocol Method] Get billable assets summary for the workspace.
|
GetBillableAsync(CancellationToken) |
Get billable assets summary for the workspace. |
GetBillableAsync(RequestContext)
- Source:
- EasmClient.cs
[Protocol Method] Get billable assets summary for the workspace.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetBillableAsync(CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> GetBillableAsync(Azure.RequestContext context);
abstract member GetBillableAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetBillableAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetBillableAsync (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 GetBillableAsync and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);
Response response = await client.GetBillableAsync(null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call GetBillableAsync with all parameters and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);
Response response = await client.GetBillableAsync(null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("date").ToString());
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("total").ToString());
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("assetBreakdown")[0].GetProperty("kind").ToString());
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("assetBreakdown")[0].GetProperty("count").ToString());
Applies to
GetBillableAsync(CancellationToken)
- Source:
- EasmClient.cs
Get billable assets summary for the workspace.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Defender.Easm.ReportBillableAssetSummaryResult>> GetBillableAsync(System.Threading.CancellationToken cancellationToken = default);
abstract member GetBillableAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Defender.Easm.ReportBillableAssetSummaryResult>>
override this.GetBillableAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Defender.Easm.ReportBillableAssetSummaryResult>>
Public Overridable Function GetBillableAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ReportBillableAssetSummaryResult))
Parameters
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Examples
This sample shows how to call GetBillableAsync.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);
Response<ReportBillableAssetSummaryResult> response = await client.GetBillableAsync();
This sample shows how to call GetBillableAsync with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);
Response<ReportBillableAssetSummaryResult> response = await client.GetBillableAsync();
Applies to
Azure SDK for .NET