Skip to content

list_settlement_records async

list_settlement_records(
    time_window: TimeWindow,
    scope: Scope,
    currency: Currency,
    *,
    config_overrides: Optional[AsyncWAFV2ClientConfig] = None,
    filters: Optional[MonetizationFilterList] = None,
    sort_by: Optional[SettlementSortBy] = None,
    sort_order: Optional[SortOrder] = None,
    limit: Optional[SettlementRecordLimit] = None,
    next_marker: Optional[NextMarker] = None,
) -> ListSettlementRecordsResponse

Retrieves individual settlement transaction records for monetization. Each record represents a single payment transaction between a client and your protected resource. 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 query. Specify start and end timestamps.

  • scope (Scope) –

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

  • currency (Currency) –

    The currency for the amounts in the response.

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

    Optional filters to narrow the results. You can filter by payer address, status, source name, network, or other settlement fields.

  • sort_by (Optional[SettlementSortBy], default: None ) –

    The field to sort settlement records by: TIMESTAMP, AMOUNT, NAME, or STATUS.

  • sort_order (Optional[SortOrder], default: None ) –

    The sort order: ASC for ascending or DESC for descending.

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

    The maximum number of settlement records to return. Minimum: 1. Maximum: 100.

  • 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 list_settlement_records(
    self,
    time_window: "capo_wafv2.types.time_window.TimeWindow",
    scope: "capo_wafv2.types.scope.Scope",
    currency: "capo_wafv2.types.currency.Currency",
    *,
    config_overrides: Optional[AsyncWAFV2ClientConfig] = None,
    filters: Optional[
        "capo_wafv2.types.monetization_filter_list.MonetizationFilterList"
    ] = None,
    sort_by: Optional[
        "capo_wafv2.types.settlement_sort_by.SettlementSortBy"
    ] = None,
    sort_order: Optional["capo_wafv2.types.sort_order.SortOrder"] = None,
    limit: Optional[
        "capo_wafv2.types.settlement_record_limit.SettlementRecordLimit"
    ] = None,
    next_marker: Optional["capo_wafv2.types.next_marker.NextMarker"] = None,
) -> "capo_wafv2.types.list_settlement_records_response.ListSettlementRecordsResponse":
    """<p>Retrieves individual settlement transaction records for monetization. Each record represents a single payment transaction between a client and your protected resource. 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 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>
        currency: <p>The currency for the amounts in the response.</p>
        filters: <p>Optional filters to narrow the results. You can filter by payer address, status, source name, network, or other settlement fields.</p>
        sort_by: <p>The field to sort settlement records by: <code>TIMESTAMP</code>, <code>AMOUNT</code>, <code>NAME</code>, or <code>STATUS</code>.</p>
        sort_order: <p>The sort order: <code>ASC</code> for ascending or <code>DESC</code> for descending.</p>
        limit: <p>The maximum number of settlement records to return. Minimum: 1. Maximum: 100.</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.list_settlement_records_request.ListSettlementRecordsRequest]",
    ) -> AsyncOperationResponse[
        "capo_wafv2.types.list_settlement_records_response.ListSettlementRecordsResponse"
    ]:
        import capo_wafv2._operations.awswaf_20190729.list_settlement_records

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSettlementRecords")
    )
    input_: capo_wafv2.types.list_settlement_records_request.ListSettlementRecordsRequest = {
        "time_window": time_window,
        "scope": scope,
        "currency": currency,
    }
    if filters is not None:
        input_["filters"] = filters
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order
    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