listWorkloadEstimateUsage method

Future<ListWorkloadEstimateUsageResponse> listWorkloadEstimateUsage({
  1. required String workloadEstimateId,
  2. List<ListUsageFilter>? filters,
  3. int? maxResults,
  4. String? nextToken,
})

Lists the usage associated with a workload estimate.

May throw DataUnavailableException. May throw ResourceNotFoundException.

Parameter workloadEstimateId : The unique identifier of the workload estimate to list usage for.

Parameter filters : Filters to apply to the list of usage items.

Parameter maxResults : The maximum number of results to return per page.

Parameter nextToken : A token to retrieve the next page of results.

Implementation

Future<ListWorkloadEstimateUsageResponse> listWorkloadEstimateUsage({
  required String workloadEstimateId,
  List<ListUsageFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    300,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSBCMPricingCalculator.ListWorkloadEstimateUsage'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'workloadEstimateId': workloadEstimateId,
      if (filters != null) 'filters': filters,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListWorkloadEstimateUsageResponse.fromJson(jsonResponse.body);
}