Skip to content

get_revenue_statistics_time_series async

get_revenue_statistics_time_series(
    statistic_type: TimeSeriesStatisticType,
    time_window: TimeWindow,
    scope: Scope,
    interval: IntervalType,
    currency: Currency,
    *,
    config_overrides: Optional[AsyncWAFV2ClientConfig] = None,
    group_by: Optional[GroupByType] = None,
    filters: Optional[MonetizationFilterList] = None,
    limit: Optional[MaxDataPoints] = None,
    next_marker: Optional[NextMarker] = None,
) -> GetRevenueStatisticsTimeSeriesResponse

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.

Parameters:

  • statistic_type (TimeSeriesStatisticType) –

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

  • time_window (TimeWindow) –

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

  • scope (Scope) –

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

  • interval (IntervalType) –

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

  • currency (Currency) –

    The currency for the amounts in the response.

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

    The dimension to group results by.

  • filters (Optional[MonetizationFilterList], default: None ) –

    Optional filters to narrow the results.

  • limit (Optional[MaxDataPoints], default: None ) –

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

  • next_marker (Optional[NextMarker], default: None ) –

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

Raises:

  • WAFInternalErrorException –

    Your request is valid, but WAF couldn’t perform the operation because of a system problem. Retry your request.

  • WAFInvalidOperationException –

    The operation isn't valid.

  • WAFInvalidParameterException –

    The operation failed because WAF didn't recognize a parameter in the request. For example:

    • You specified a parameter name or value that isn't valid.

    • Your nested statement isn't valid. You might have tried to nest a statement that can’t be nested.

    • You tried to update a WebACL with a DefaultAction that isn't among the types available at DefaultAction.

    • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL can't be associated.

  • WAFNonexistentItemException –

    WAF couldn’t perform the operation because your resource doesn't exist. If you've just created a resource that you're using in this operation, you might just need to wait a few minutes. It can take from a few seconds to a number of minutes for changes to propagate.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_wafv2/_services/async_wafv2.py
async def get_revenue_statistics_time_series(
    self,
    statistic_type: "capo_wafv2.types.time_series_statistic_type.TimeSeriesStatisticType",
    time_window: "capo_wafv2.types.time_window.TimeWindow",
    scope: "capo_wafv2.types.scope.Scope",
    interval: "capo_wafv2.types.interval_type.IntervalType",
    currency: "capo_wafv2.types.currency.Currency",
    *,
    config_overrides: Optional[AsyncWAFV2ClientConfig] = None,
    group_by: Optional["capo_wafv2.types.group_by_type.GroupByType"] = None,
    filters: Optional[
        "capo_wafv2.types.monetization_filter_list.MonetizationFilterList"
    ] = None,
    limit: Optional["capo_wafv2.types.max_data_points.MaxDataPoints"] = None,
    next_marker: Optional["capo_wafv2.types.next_marker.NextMarker"] = None,
) -> "capo_wafv2.types.get_revenue_statistics_time_series_response.GetRevenueStatisticsTimeSeriesResponse":
    """<p>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 <code>CLOUDFRONT</code> scope. The maximum supported time window is 90 days. When no <code>CurrencyMode</code> filter is provided, results default to <code>REAL</code>. To retrieve test data, include a <code>CurrencyMode</code> filter with the value <code>TEST</code>.</p>

    Args:
        statistic_type: <p>The type of time series data to retrieve: <code>DATE_HISTOGRAM</code> for revenue over time, or <code>PAYMENT_TRAFFIC</code> for payment traffic patterns.</p>
        time_window: <p>The time range for the query. Specify start and end timestamps.</p>
        scope: <p>Specifies whether this is for a Amazon CloudFront distribution (<code>CLOUDFRONT</code>) or for a regional application (<code>REGIONAL</code>).</p>
        interval: <p>The time interval for aggregating data points: <code>MINUTELY</code>, <code>FIVE_MINUTELY</code>, <code>HOURLY</code>, or <code>DAILY</code>.</p>
        currency: <p>The currency for the amounts in the response.</p>
        group_by: <p>The dimension to group results by.</p>
        filters: <p>Optional filters to narrow the results.</p>
        limit: <p>The maximum number of data points to return. Minimum: 1. Maximum: 10000.</p>
        next_marker: <p>When you get a paginated response, this marker indicates that additional results are available.</p>

    Raises:
        capo_wafv2.errors.waf_internal_error_exception.WAFInternalErrorException: <p>Your request is valid, but WAF couldn’t perform the operation because of a system problem. Retry your request. </p>
        capo_wafv2.errors.waf_invalid_operation_exception.WAFInvalidOperationException: <p>The operation isn't valid. </p>
        capo_wafv2.errors.waf_invalid_parameter_exception.WAFInvalidParameterException: <p>The operation failed because WAF didn't recognize a parameter in the request. For example: </p> <ul> <li> <p>You specified a parameter name or value that isn't valid.</p> </li> <li> <p>Your nested statement isn't valid. You might have tried to nest a statement that can’t be nested. </p> </li> <li> <p>You tried to update a <code>WebACL</code> with a <code>DefaultAction</code> that isn't among the types available at <a>DefaultAction</a>.</p> </li> <li> <p>Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL can't be associated.</p> </li> </ul>
        capo_wafv2.errors.waf_nonexistent_item_exception.WAFNonexistentItemException: <p>WAF couldn’t perform the operation because your resource doesn't exist. If you've just created a resource that you're using in this operation, you might just need to wait a few minutes. It can take from a few seconds to a number of minutes for changes to propagate. </p>
        capo_wafv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_wafv2.types.get_revenue_statistics_time_series_request.GetRevenueStatisticsTimeSeriesRequest]",
    ) -> AsyncOperationResponse[
        "capo_wafv2.types.get_revenue_statistics_time_series_response.GetRevenueStatisticsTimeSeriesResponse"
    ]:
        import capo_wafv2._operations.awswaf_20190729.get_revenue_statistics_time_series

        (
            output,
            http_response,
        ) = await capo_wafv2._operations.awswaf_20190729.get_revenue_statistics_time_series.async_get_revenue_statistics_time_series(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetRevenueStatisticsTimeSeries")
    )
    input_: capo_wafv2.types.get_revenue_statistics_time_series_request.GetRevenueStatisticsTimeSeriesRequest = {
        "statistic_type": statistic_type,
        "time_window": time_window,
        "scope": scope,
        "interval": interval,
        "currency": currency,
    }
    if group_by is not None:
        input_["group_by"] = group_by
    if filters is not None:
        input_["filters"] = filters
    if limit is not None:
        input_["limit"] = limit
    if next_marker is not None:
        input_["next_marker"] = next_marker

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