getEstimatedCarbonEmissionsDimensionValues method

Future<GetEstimatedCarbonEmissionsDimensionValuesResponse> getEstimatedCarbonEmissionsDimensionValues({
  1. required List<Dimension> dimensions,
  2. required TimePeriod timePeriod,
  3. int? maxResults,
  4. String? nextToken,
})

Returns the possible dimension values available for a customer's account. We recommend using pagination to ensure that the operation returns quickly and successfully.

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

Parameter dimensions : The dimensions available for grouping estimated carbon emissions.

Parameter timePeriod : The date range for fetching the dimension values.

Parameter maxResults : The maximum number of results to return in a single call. Default is 40.

Parameter nextToken : The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.

Implementation

Future<GetEstimatedCarbonEmissionsDimensionValuesResponse>
    getEstimatedCarbonEmissionsDimensionValues({
  required List<Dimension> dimensions,
  required TimePeriod timePeriod,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    5000,
  );
  final $payload = <String, dynamic>{
    'Dimensions': dimensions.map((e) => e.value).toList(),
    'TimePeriod': timePeriod,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/estimated-carbon-emissions-dimension-values',
    exceptionFnMap: _exceptionFns,
  );
  return GetEstimatedCarbonEmissionsDimensionValuesResponse.fromJson(
      response);
}