getRevenueStatisticsTimeSeries method

Future<GetRevenueStatisticsTimeSeriesResponse> getRevenueStatisticsTimeSeries({
  1. required Currency currency,
  2. required IntervalType interval,
  3. required Scope scope,
  4. required TimeSeriesStatisticType statisticType,
  5. required TimeWindow timeWindow,
  6. List<MonetizationFilter>? filters,
  7. GroupByType? groupBy,
  8. int? limit,
  9. String? nextMarker,
})

Retrieves time series data for monetization revenue. Returns data points aggregated at the specified interval for the given time window. This operation is only available for CLOUDFRONT scope. The maximum supported time window is 90 days. When no CurrencyMode filter is provided, results default to REAL. To retrieve test data, include a CurrencyMode filter with the value TEST.

May throw WAFInternalErrorException. May throw WAFInvalidOperationException. May throw WAFInvalidParameterException. May throw WAFNonexistentItemException.

Parameter currency : The currency for the amounts in the response.

Parameter interval : The time interval for aggregating data points: MINUTELY, FIVE_MINUTELY, HOURLY, or DAILY.

Parameter scope : Specifies whether this is for a Amazon CloudFront distribution (CLOUDFRONT) or for a regional application (REGIONAL).

Parameter statisticType : The type of time series data to retrieve: DATE_HISTOGRAM for revenue over time, or PAYMENT_TRAFFIC for payment traffic patterns.

Parameter timeWindow : The time range for the query. Specify start and end timestamps.

Parameter filters : Optional filters to narrow the results.

Parameter groupBy : The dimension to group results by.

Parameter limit : The maximum number of data points to return. Minimum: 1. Maximum: 10000.

Parameter nextMarker : When you get a paginated response, this marker indicates that additional results are available.

Implementation

Future<GetRevenueStatisticsTimeSeriesResponse>
    getRevenueStatisticsTimeSeries({
  required Currency currency,
  required IntervalType interval,
  required Scope scope,
  required TimeSeriesStatisticType statisticType,
  required TimeWindow timeWindow,
  List<MonetizationFilter>? filters,
  GroupByType? groupBy,
  int? limit,
  String? nextMarker,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    1,
    10000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSWAF_20190729.GetRevenueStatisticsTimeSeries'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Currency': currency.value,
      'Interval': interval.value,
      'Scope': scope.value,
      'StatisticType': statisticType.value,
      'TimeWindow': timeWindow,
      if (filters != null) 'Filters': filters,
      if (groupBy != null) 'GroupBy': groupBy.value,
      if (limit != null) 'Limit': limit,
      if (nextMarker != null) 'NextMarker': nextMarker,
    },
  );

  return GetRevenueStatisticsTimeSeriesResponse.fromJson(jsonResponse.body);
}