listCostCategoryDefinitions method

Future<ListCostCategoryDefinitionsResponse> listCostCategoryDefinitions({
  1. String? effectiveOn,
  2. int? maxResults,
  3. String? nextToken,
})

Returns the name, ARN, NumberOfRules and effective dates of all Cost Categories defined in the account. You have the option to use EffectiveOn to return a list of Cost Categories that were active on a specific date. If there is no EffectiveOn specified, you’ll see Cost Categories that are effective on the current date. If Cost Category is still effective, EffectiveEnd is omitted in the response. ListCostCategoryDefinitions supports pagination. The request can have a MaxResults range up to 100.

May throw LimitExceededException.

Parameter effectiveOn : The date when the Cost Category was effective.

Parameter maxResults : The number of entries a paginated response contains.

Parameter nextToken : The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

Implementation

Future<ListCostCategoryDefinitionsResponse> listCostCategoryDefinitions({
  String? effectiveOn,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateStringLength(
    'effectiveOn',
    effectiveOn,
    20,
    25,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    8192,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSInsightsIndexService.ListCostCategoryDefinitions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (effectiveOn != null) 'EffectiveOn': effectiveOn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListCostCategoryDefinitionsResponse.fromJson(jsonResponse.body);
}