Skip to content

list_contact_lists async

list_contact_lists(
    *,
    config_overrides: Optional[AsyncSESv2ClientConfig] = None,
    page_size: Optional[MaxItems] = None,
    next_token: Optional[NextToken] = None,
) -> ListContactListsResponse

Lists all of the contact lists available.

If your output includes a "NextToken" field with a string value, this indicates there may be additional contacts on the filtered list - regardless of the number of contacts returned.

Parameters:

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

    Maximum number of contact lists to return at once. Use this parameter to paginate results. If additional contact lists exist beyond the specified limit, the NextToken element is sent in the response. Use the NextToken value in subsequent requests to retrieve additional lists.

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

    A string token indicating that there might be additional contact lists available to be listed. Use the token provided in the Response to use in the subsequent call to ListContactLists with the same parameters to retrieve the next page of contact lists.

Raises:

Source code in docs_src/capo_sesv2/_services/async_se_sv2.py
async def list_contact_lists(
    self,
    *,
    config_overrides: Optional[AsyncSESv2ClientConfig] = None,
    page_size: Optional["capo_sesv2.types.max_items.MaxItems"] = None,
    next_token: Optional["capo_sesv2.types.next_token.NextToken"] = None,
) -> "capo_sesv2.types.list_contact_lists_response.ListContactListsResponse":
    """<p>Lists all of the contact lists available.</p> <p>If your output includes a "NextToken" field with a string value, this indicates there may be additional contacts on the filtered list - regardless of the number of contacts returned.</p>

    Args:
        page_size: <p>Maximum number of contact lists to return at once. Use this parameter to paginate results. If additional contact lists exist beyond the specified limit, the <code>NextToken</code> element is sent in the response. Use the <code>NextToken</code> value in subsequent requests to retrieve additional lists.</p>
        next_token: <p>A string token indicating that there might be additional contact lists available to be listed. Use the token provided in the Response to use in the subsequent call to ListContactLists with the same parameters to retrieve the next page of contact lists.</p>

    Raises:
        capo_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sesv2.types.list_contact_lists_request.ListContactListsRequest]",
    ) -> AsyncOperationResponse[
        "capo_sesv2.types.list_contact_lists_response.ListContactListsResponse"
    ]:
        import capo_sesv2._operations.simple_email_service_v2.list_contact_lists

        (
            output,
            http_response,
        ) = await capo_sesv2._operations.simple_email_service_v2.list_contact_lists.async_list_contact_lists(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListContactLists")
    )
    input_: capo_sesv2.types.list_contact_lists_request.ListContactListsRequest = {}
    if page_size is not None:
        input_["page_size"] = page_size
    if next_token is not None:
        input_["next_token"] = next_token

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