Skip to content

get_estimated_water_allocation async

get_estimated_water_allocation(
    time_period: TimePeriod,
    *,
    config_overrides: Optional[AsyncSustainabilityClientConfig] = None,
    group_by: Optional[DimensionList] = None,
    filter_by: Optional[FilterExpression] = None,
    allocation_types: Optional[WaterAllocationTypeList] = None,
    granularity: Optional[TimeGranularity] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> GetEstimatedWaterAllocationResponse

Returns estimated water allocation values based on customer grouping and filtering parameters. We recommend using pagination to ensure that the operation returns quickly and successfully.

Parameters:

  • time_period (TimePeriod) –

    The date range for fetching estimated water allocation. The range must include the start date of a year for that year's data to be included in the response.

  • group_by (Optional[DimensionList], default: None ) –

    The dimensions available for grouping estimated water allocation.

  • filter_by (Optional[FilterExpression], default: None ) –

    The criteria for filtering estimated water allocation. To determine which dimensions are available to be filtered by, you can first call GetEstimatedWaterAllocationDimensionValues

  • allocation_types (Optional[WaterAllocationTypeList], default: None ) –

    The allocation types to include in the results. If absent, returns TOTAL_WATER_WITHDRAWALS allocation types.

  • granularity (Optional[TimeGranularity], default: None ) –

    The time granularity for the results. Only YEARLY_CALENDAR time granularity is currently supported for water allocation. Defaults to YEARLY_CALENDAR if absent.

    If requesting partial time periods, data will be returned based on the smallest supported granularity. For example, requesting 2025-04-01T00:00:00Z to 2026-04-01T00:00:00Z with YEARLY_CALENDAR will return all the data for 2026 only.

  • 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:

GetEstimatedWaterAllocationSuccess

>>> await client.get_estimated_water_allocation(time_period={'Start': '2025-01-01T00:00:00.00Z', 'End': '2026-01-01T00:00:00.00Z'}, group_by=['SERVICE'], allocation_types=['TOTAL_WATER_WITHDRAWALS'], granularity='YEARLY_CALENDAR')
Source code in docs_src/capo_sustainability/_services/async_sustainability.py
async def get_estimated_water_allocation(
    self,
    time_period: "capo_sustainability.types.time_period.TimePeriod",
    *,
    config_overrides: Optional[AsyncSustainabilityClientConfig] = None,
    group_by: Optional[
        "capo_sustainability.types.dimension_list.DimensionList"
    ] = None,
    filter_by: Optional[
        "capo_sustainability.types.filter_expression.FilterExpression"
    ] = None,
    allocation_types: Optional[
        "capo_sustainability.types.water_allocation_type_list.WaterAllocationTypeList"
    ] = None,
    granularity: Optional[
        "capo_sustainability.types.time_granularity.TimeGranularity"
    ] = 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_water_allocation_response.GetEstimatedWaterAllocationResponse":
    """<p>Returns estimated water allocation values based on customer grouping and filtering parameters. We recommend using pagination to ensure that the operation returns quickly and successfully. </p>

    Args:
        time_period: <p> The date range for fetching estimated water allocation. The range must include the start date of a year for that year's data to be included in the response. </p>
        group_by: <p>The dimensions available for grouping estimated water allocation.</p>
        filter_by: <p> The criteria for filtering estimated water allocation. To determine which dimensions are available to be filtered by, you can first call <a>GetEstimatedWaterAllocationDimensionValues</a> </p>
        allocation_types: <p>The allocation types to include in the results. If absent, returns <code>TOTAL_WATER_WITHDRAWALS</code> allocation types. </p>
        granularity: <p>The time granularity for the results. Only <code>YEARLY_CALENDAR</code> time granularity is currently supported for water allocation. Defaults to <code>YEARLY_CALENDAR</code> if absent.</p> <p> If requesting partial time periods, data will be returned based on the smallest supported granularity. For example, requesting <code>2025-04-01T00:00:00Z</code> to <code>2026-04-01T00:00:00Z</code> with <code>YEARLY_CALENDAR</code> will return all the data for 2026 only. </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:
        GetEstimatedWaterAllocationSuccess

        >>> await client.get_estimated_water_allocation(time_period={'Start': '2025-01-01T00:00:00.00Z', 'End': '2026-01-01T00:00:00.00Z'}, group_by=['SERVICE'], allocation_types=['TOTAL_WATER_WITHDRAWALS'], granularity='YEARLY_CALENDAR')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sustainability.types.get_estimated_water_allocation_request.GetEstimatedWaterAllocationRequest]",
    ) -> AsyncOperationResponse[
        "capo_sustainability.types.get_estimated_water_allocation_response.GetEstimatedWaterAllocationResponse"
    ]:
        import capo_sustainability._operations.aws_sustainability_api_service.get_estimated_water_allocation

        (
            output,
            http_response,
        ) = await capo_sustainability._operations.aws_sustainability_api_service.get_estimated_water_allocation.async_get_estimated_water_allocation(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetEstimatedWaterAllocation")
    )
    input_: capo_sustainability.types.get_estimated_water_allocation_request.GetEstimatedWaterAllocationRequest = {
        "time_period": time_period
    }
    if group_by is not None:
        input_["group_by"] = group_by
    if filter_by is not None:
        input_["filter_by"] = filter_by
    if allocation_types is not None:
        input_["allocation_types"] = allocation_types
    if granularity is not None:
        input_["granularity"] = granularity
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output