listBillingGroups method

Future<ListBillingGroupsResponse> listBillingGroups({
  1. int? maxResults,
  2. String? namePrefixFilter,
  3. String? nextToken,
})

Lists the billing groups you have created.

May throw InvalidRequestException. May throw InternalFailureException. May throw ResourceNotFoundException. May throw ThrottlingException.

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

Parameter namePrefixFilter : Limit the results to billing groups whose names have the given prefix.

Parameter nextToken : To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.

Implementation

Future<ListBillingGroupsResponse> listBillingGroups({
  int? maxResults,
  String? namePrefixFilter,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  _s.validateStringLength(
    'namePrefixFilter',
    namePrefixFilter,
    1,
    128,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (namePrefixFilter != null) 'namePrefixFilter': [namePrefixFilter],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/billing-groups',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListBillingGroupsResponse.fromJson(response);
}