describeCostCategoryDefinition method

Future<DescribeCostCategoryDefinitionResponse> describeCostCategoryDefinition({
  1. required String costCategoryArn,
  2. String? effectiveOn,
})

Returns the name, ARN, rules, definition, and effective dates of a Cost Category that's defined in the account.

You have the option to use EffectiveOn to return a Cost Category that is active on a specific date. If there is no EffectiveOn specified, you’ll see a Cost Category that is effective on the current date. If Cost Category is still effective, EffectiveEnd is omitted in the response.

May throw ResourceNotFoundException. May throw LimitExceededException.

Parameter costCategoryArn : The unique identifier for your Cost Category.

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

Implementation

Future<DescribeCostCategoryDefinitionResponse>
    describeCostCategoryDefinition({
  required String costCategoryArn,
  String? effectiveOn,
}) async {
  ArgumentError.checkNotNull(costCategoryArn, 'costCategoryArn');
  _s.validateStringLength(
    'costCategoryArn',
    costCategoryArn,
    20,
    2048,
    isRequired: true,
  );
  _s.validateStringLength(
    'effectiveOn',
    effectiveOn,
    20,
    25,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSInsightsIndexService.DescribeCostCategoryDefinition'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'CostCategoryArn': costCategoryArn,
      if (effectiveOn != null) 'EffectiveOn': effectiveOn,
    },
  );

  return DescribeCostCategoryDefinitionResponse.fromJson(jsonResponse.body);
}