Skip to content

list_suppressed_destinations

list_suppressed_destinations(
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
    tenant_name: Optional[TenantName] = None,
    reasons: Optional[SuppressionListReasons] = None,
    start_date: Optional[Timestamp] = None,
    end_date: Optional[Timestamp] = None,
    next_token: Optional[NextToken] = None,
    page_size: Optional[MaxItems] = None,
) -> ListSuppressedDestinationsResponse

Retrieves a list of email addresses that are on the suppression list for your account or for a specific tenant. To target a tenant's suppression list, specify the TenantName parameter. If you omit TenantName, the operation targets the account-level suppression list.

Parameters:

  • tenant_name (Optional[TenantName], default: None ) –

    The name of the tenant whose suppression list you want to retrieve. If you omit this parameter, the operation targets the account-level suppression list.

  • reasons (Optional[SuppressionListReasons], default: None ) –

    The factors that caused the email address to be added to the suppression list for your account or for a specific tenant.

  • start_date (Optional[Timestamp], default: None ) –

    Used to filter the list of suppressed email destinations so that it only includes addresses that were added to the list after a specific date.

  • end_date (Optional[Timestamp], default: None ) –

    Used to filter the list of suppressed email destinations so that it only includes addresses that were added to the list before a specific date.

  • next_token (Optional[NextToken], default: None ) –

    A token returned from a previous call to ListSuppressedDestinations to indicate the position in the list of suppressed email addresses.

  • page_size (Optional[MaxItems], default: None ) –

    The number of results to show in a single call to ListSuppressedDestinations. If the number of results is larger than the number you specified in this parameter, then the response includes a NextToken element, which you can use to obtain additional results.

Raises:

Source code in docs_src/capo_sesv2/_services/se_sv2.py
def list_suppressed_destinations(
    self,
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
    tenant_name: Optional["capo_sesv2.types.tenant_name.TenantName"] = None,
    reasons: Optional[
        "capo_sesv2.types.suppression_list_reasons.SuppressionListReasons"
    ] = None,
    start_date: Optional["capo_sesv2.types.timestamp.Timestamp"] = None,
    end_date: Optional["capo_sesv2.types.timestamp.Timestamp"] = None,
    next_token: Optional["capo_sesv2.types.next_token.NextToken"] = None,
    page_size: Optional["capo_sesv2.types.max_items.MaxItems"] = None,
) -> "capo_sesv2.types.list_suppressed_destinations_response.ListSuppressedDestinationsResponse":
    """<p>Retrieves a list of email addresses that are on the suppression list for your account or for a specific tenant. To target a tenant's suppression list, specify the <code>TenantName</code> parameter. If you omit <code>TenantName</code>, the operation targets the account-level suppression list.</p>

    Args:
        tenant_name: <p>The name of the tenant whose suppression list you want to retrieve. If you omit this parameter, the operation targets the account-level suppression list.</p>
        reasons: <p>The factors that caused the email address to be added to the suppression list for your account or for a specific tenant.</p>
        start_date: <p>Used to filter the list of suppressed email destinations so that it only includes addresses that were added to the list after a specific date.</p>
        end_date: <p>Used to filter the list of suppressed email destinations so that it only includes addresses that were added to the list before a specific date.</p>
        next_token: <p>A token returned from a previous call to <code>ListSuppressedDestinations</code> to indicate the position in the list of suppressed email addresses.</p>
        page_size: <p>The number of results to show in a single call to <code>ListSuppressedDestinations</code>. If the number of results is larger than the number you specified in this parameter, then the response includes a <code>NextToken</code> element, which you can use to obtain additional results.</p>

    Raises:
        capo_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_sesv2.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The specified request includes an invalid or expired token.</p>
        capo_sesv2.errors.not_found_exception.NotFoundException: <p>The resource you attempted to access doesn't exist.</p>
        capo_sesv2.errors.too_many_requests_exception.TooManyRequestsException: <p>Too many requests have been made to the operation.</p>
        capo_sesv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sesv2.types.list_suppressed_destinations_request.ListSuppressedDestinationsRequest]",
    ) -> OperationResponse[
        "capo_sesv2.types.list_suppressed_destinations_response.ListSuppressedDestinationsResponse"
    ]:
        import capo_sesv2._operations.simple_email_service_v2.list_suppressed_destinations

        output, http_response = (
            capo_sesv2._operations.simple_email_service_v2.list_suppressed_destinations.list_suppressed_destinations(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSuppressedDestinations")
    )
    input_: capo_sesv2.types.list_suppressed_destinations_request.ListSuppressedDestinationsRequest = {}
    if tenant_name is not None:
        input_["tenant_name"] = tenant_name
    if reasons is not None:
        input_["reasons"] = reasons
    if start_date is not None:
        input_["start_date"] = start_date
    if end_date is not None:
        input_["end_date"] = end_date
    if next_token is not None:
        input_["next_token"] = next_token
    if page_size is not None:
        input_["page_size"] = page_size

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