Returns the possible dimension values available for a customer's account. We recommend using pagination to ensure that the operation returns quickly and successfully.
Parameters:
-
time_period
(TimePeriod)
–
The date range for fetching the dimension values. The range must include the start date of a month for that month's dimensions to be included in the response.
-
dimensions
(DimensionList)
–
The dimensions available for grouping estimated carbon emissions.
-
max_results
(Optional[MaxResults], default:
None
)
–
The maximum number of results to return in a single call. Default is 1000.
-
next_token
(Optional[NextToken], default:
None
)
–
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.
Raises:
Examples:
GetEstimatedCarbonEmissionsDimensionValuesSuccess
>>> client.get_estimated_carbon_emissions_dimension_values(time_period={'Start': '2025-01-01T00:00:00.000Z', 'End': '2025-12-31T23:59:59.999Z'}, dimensions=['REGION', 'SERVICE', 'USAGE_ACCOUNT_ID'])
Source code in docs_src/capo_sustainability/_services/sustainability.py
| def get_estimated_carbon_emissions_dimension_values(
self,
time_period: "capo_sustainability.types.time_period.TimePeriod",
dimensions: "capo_sustainability.types.dimension_list.DimensionList",
*,
config_overrides: Optional[SustainabilityClientConfig] = None,
max_results: Optional[
"capo_sustainability.types.max_results.MaxResults"
] = None,
next_token: Optional["capo_sustainability.types.next_token.NextToken"] = None,
) -> "capo_sustainability.types.get_estimated_carbon_emissions_dimension_values_response.GetEstimatedCarbonEmissionsDimensionValuesResponse":
"""<p>Returns the possible dimension values available for a customer's account. We recommend using pagination to ensure that the operation returns quickly and successfully. </p>
Args:
time_period: <p> The date range for fetching the dimension values. The range must include the start date of a month for that month's dimensions to be included in the response. </p>
dimensions: <p>The dimensions available for grouping estimated carbon emissions.</p>
max_results: <p>The maximum number of results to return in a single call. Default is 1000.</p>
next_token: <p>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. </p>
Raises:
capo_sustainability.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_sustainability.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure.</p>
capo_sustainability.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_sustainability.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
capo_sustainability.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
GetEstimatedCarbonEmissionsDimensionValuesSuccess
>>> client.get_estimated_carbon_emissions_dimension_values(time_period={'Start': '2025-01-01T00:00:00.000Z', 'End': '2025-12-31T23:59:59.999Z'}, dimensions=['REGION', 'SERVICE', 'USAGE_ACCOUNT_ID'])
"""
def _handler(
req: "OperationRequest[capo_sustainability.types.get_estimated_carbon_emissions_dimension_values_request.GetEstimatedCarbonEmissionsDimensionValuesRequest]",
) -> OperationResponse[
"capo_sustainability.types.get_estimated_carbon_emissions_dimension_values_response.GetEstimatedCarbonEmissionsDimensionValuesResponse"
]:
import capo_sustainability._operations.aws_sustainability_api_service.get_estimated_carbon_emissions_dimension_values
output, http_response = (
capo_sustainability._operations.aws_sustainability_api_service.get_estimated_carbon_emissions_dimension_values.get_estimated_carbon_emissions_dimension_values(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("GetEstimatedCarbonEmissionsDimensionValues"),
)
input_: capo_sustainability.types.get_estimated_carbon_emissions_dimension_values_request.GetEstimatedCarbonEmissionsDimensionValuesRequest = {
"time_period": time_period,
"dimensions": dimensions,
}
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|