listBillingViews method

Future<ListBillingViewsResponse> listBillingViews({
  1. ActiveTimeRange? activeTimeRange,
  2. List<String>? arns,
  3. List<BillingViewType>? billingViewTypes,
  4. int? maxResults,
  5. List<StringSearch>? names,
  6. String? nextToken,
  7. String? ownerAccountId,
  8. String? sourceAccountId,
})

Lists the billing views available for a given time period.

Every Amazon Web Services account has a unique PRIMARY billing view that represents the billing data available by default. Accounts that use Billing Conductor also have BILLING_GROUP billing views representing pro forma costs associated with each created billing group.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter activeTimeRange : The time range for the billing views listed. PRIMARY billing view is always listed. BILLING_GROUP billing views are listed for time ranges when the associated billing group resource in Billing Conductor is active. The time range must be within one calendar month.

Parameter arns : The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.

Parameter billingViewTypes : The type of billing view.

Parameter maxResults : The maximum number of billing views to retrieve. Default is 100.

Parameter names : Filters the list of billing views by name. You can specify search criteria to match billing view names based on the search option provided.

Parameter nextToken : The pagination token that is used on subsequent calls to list billing views.

Parameter ownerAccountId : The list of owners of the billing view.

Parameter sourceAccountId : Filters the results to include only billing views that use the specified account as a source.

Implementation

Future<ListBillingViewsResponse> listBillingViews({
  ActiveTimeRange? activeTimeRange,
  List<String>? arns,
  List<BillingViewType>? billingViewTypes,
  int? maxResults,
  List<StringSearch>? names,
  String? nextToken,
  String? ownerAccountId,
  String? sourceAccountId,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSBilling.ListBillingViews'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (activeTimeRange != null) 'activeTimeRange': activeTimeRange,
      if (arns != null) 'arns': arns,
      if (billingViewTypes != null)
        'billingViewTypes': billingViewTypes.map((e) => e.value).toList(),
      if (maxResults != null) 'maxResults': maxResults,
      if (names != null) 'names': names,
      if (nextToken != null) 'nextToken': nextToken,
      if (ownerAccountId != null) 'ownerAccountId': ownerAccountId,
      if (sourceAccountId != null) 'sourceAccountId': sourceAccountId,
    },
  );

  return ListBillingViewsResponse.fromJson(jsonResponse.body);
}