Share via


EasmClient.GetBillableAsync Method

Definition

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.

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