Skip to content

get_revenue_statistics_summary

get_revenue_statistics_summary(
    time_window: TimeWindow,
    scope: Scope,
    currency: Currency,
    *,
    config_overrides: Optional[WAFV2ClientConfig] = None,
    filters: Optional[MonetizationFilterList] = None,
) -> GetRevenueStatisticsSummaryResponse

Retrieves a summary of monetization revenue for the specified time window. Returns total revenue, revenue by verification tier, total settlements, and total HTTP 402 responses served. 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:

  • time_window (TimeWindow) –

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

  • scope (Scope) –

    Specifies whether this is for a Amazon CloudFront distribution (CLOUDFRONT) or for a regional application (REGIONAL). AI bot monetization is only available for CLOUDFRONT scope.

  • currency (Currency) –

    The currency for the revenue amounts in the response. Currently only USDC is supported.

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

    Optional filters to narrow the results. You can filter by source name, category, organization, intent, verified status, content path, web ACL ARN, or currency mode.

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/wafv2.py
def get_revenue_statistics_summary(
    self,
    time_window: "capo_wafv2.types.time_window.TimeWindow",
    scope: "capo_wafv2.types.scope.Scope",
    currency: "capo_wafv2.types.currency.Currency",
    *,
    config_overrides: Optional[WAFV2ClientConfig] = None,
    filters: Optional[
        "capo_wafv2.types.monetization_filter_list.MonetizationFilterList"
    ] = None,
) -> "capo_wafv2.types.get_revenue_statistics_summary_response.GetRevenueStatisticsSummaryResponse":
    """<p>Retrieves a summary of monetization revenue for the specified time window. Returns total revenue, revenue by verification tier, total settlements, and total HTTP 402 responses served. 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:
        time_window: <p>The time range for the revenue summary 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>). AI bot monetization is only available for <code>CLOUDFRONT</code> scope.</p>
        currency: <p>The currency for the revenue amounts in the response. Currently only <code>USDC</code> is supported.</p>
        filters: <p>Optional filters to narrow the results. You can filter by source name, category, organization, intent, verified status, content path, web ACL ARN, or currency mode.</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.
    """

    def _handler(
        req: "OperationRequest[capo_wafv2.types.get_revenue_statistics_summary_request.GetRevenueStatisticsSummaryRequest]",
    ) -> OperationResponse[
        "capo_wafv2.types.get_revenue_statistics_summary_response.GetRevenueStatisticsSummaryResponse"
    ]:
        import capo_wafv2._operations.awswaf_20190729.get_revenue_statistics_summary

        output, http_response = (
            capo_wafv2._operations.awswaf_20190729.get_revenue_statistics_summary.get_revenue_statistics_summary(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetRevenueStatisticsSummary")
    )
    input_: capo_wafv2.types.get_revenue_statistics_summary_request.GetRevenueStatisticsSummaryRequest = {
        "time_window": time_window,
        "scope": scope,
        "currency": currency,
    }
    if filters is not None:
        input_["filters"] = filters

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output