describeBudgetPerformanceHistory method

Future<DescribeBudgetPerformanceHistoryResponse> describeBudgetPerformanceHistory({
  1. required String accountId,
  2. required String budgetName,
  3. int? maxResults,
  4. String? nextToken,
  5. TimePeriod? timePeriod,
})

Describes the history for DAILY, MONTHLY, and QUARTERLY budgets. Budget history isn't available for ANNUAL budgets.

May throw AccessDeniedException. May throw BillingViewHealthStatusException. May throw ExpiredNextTokenException. May throw InternalErrorException. May throw InvalidNextTokenException. May throw InvalidParameterException. May throw NotFoundException. May throw ThrottlingException.

Parameter timePeriod : Retrieves how often the budget went into an ALARM state for the specified time period.

Implementation

Future<DescribeBudgetPerformanceHistoryResponse>
    describeBudgetPerformanceHistory({
  required String accountId,
  required String budgetName,
  int? maxResults,
  String? nextToken,
  TimePeriod? timePeriod,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSBudgetServiceGateway.DescribeBudgetPerformanceHistory'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AccountId': accountId,
      'BudgetName': budgetName,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (timePeriod != null) 'TimePeriod': timePeriod,
    },
  );

  return DescribeBudgetPerformanceHistoryResponse.fromJson(jsonResponse.body);
}