getEstimatedWaterAllocation method

Future<GetEstimatedWaterAllocationResponse> getEstimatedWaterAllocation({
  1. required TimePeriod timePeriod,
  2. List<WaterAllocationType>? allocationTypes,
  3. FilterExpression? filterBy,
  4. TimeGranularity? granularity,
  5. List<Dimension>? groupBy,
  6. int? maxResults,
  7. String? nextToken,
})

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.

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

Parameter 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.

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

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

Parameter granularity : 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.

Parameter groupBy : The dimensions available for grouping estimated water allocation.

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

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<GetEstimatedWaterAllocationResponse> getEstimatedWaterAllocation({
  required TimePeriod timePeriod,
  List<WaterAllocationType>? allocationTypes,
  FilterExpression? filterBy,
  TimeGranularity? granularity,
  List<Dimension>? groupBy,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    5000,
  );
  final $payload = <String, dynamic>{
    'TimePeriod': timePeriod,
    if (allocationTypes != null)
      'AllocationTypes': allocationTypes.map((e) => e.value).toList(),
    if (filterBy != null) 'FilterBy': filterBy,
    if (granularity != null) 'Granularity': granularity.value,
    if (groupBy != null) 'GroupBy': groupBy.map((e) => e.value).toList(),
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/estimated-water-allocation',
    exceptionFnMap: _exceptionFns,
  );
  return GetEstimatedWaterAllocationResponse.fromJson(response);
}