Share via


EasmClient.GetBillable Method

Definition

Overloads

GetBillable(RequestContext)

[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 GetBillable(CancellationToken) convenience overload with strongly typed models first.
GetBillable(CancellationToken)

Get billable assets summary for the workspace.

GetBillable(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 GetBillable(CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response GetBillable (Azure.RequestContext context);
abstract member GetBillable : Azure.RequestContext -> Azure.Response
override this.GetBillable : Azure.RequestContext -> Azure.Response
Public Overridable Function GetBillable (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 GetBillable 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 = client.GetBillable(null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

This sample shows how to call GetBillable 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 = client.GetBillable(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

GetBillable(CancellationToken)

Source:
EasmClient.cs

Get billable assets summary for the workspace.

public virtual Azure.Response<Azure.Analytics.Defender.Easm.ReportBillableAssetSummaryResult> GetBillable (System.Threading.CancellationToken cancellationToken = default);
abstract member GetBillable : System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Defender.Easm.ReportBillableAssetSummaryResult>
override this.GetBillable : System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Defender.Easm.ReportBillableAssetSummaryResult>
Public Overridable Function GetBillable (Optional cancellationToken As CancellationToken = Nothing) As Response(Of ReportBillableAssetSummaryResult)

Parameters

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetBillable.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);

Response<ReportBillableAssetSummaryResult> response = client.GetBillable();

This sample shows how to call GetBillable 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 = client.GetBillable();

Applies to