Skip to content

list_email_contacts

list_email_contacts(
    *,
    config_overrides: Optional[NotificationsContactsClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional[str] = None,
) -> ListEmailContactsResponse

Lists all email contacts created under the Account.

Parameters:

  • max_results (Optional[int], default: None ) –

    The maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

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

    An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

Raises:

Source code in docs_src/capo_notificationscontacts/_services/notifications_contacts.py
def list_email_contacts(
    self,
    *,
    config_overrides: Optional[NotificationsContactsClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional[str] = None,
) -> "capo_notificationscontacts.types.list_email_contacts_response.ListEmailContactsResponse":
    """<p>Lists all email contacts created under the Account.</p>

    Args:
        max_results: <p>The maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.</p>
        next_token: <p>An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.</p>

    Raises:
        capo_notificationscontacts.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_notificationscontacts.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_notificationscontacts.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_notificationscontacts.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_notificationscontacts.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_notificationscontacts.types.list_email_contacts_request.ListEmailContactsRequest]",
    ) -> OperationResponse[
        "capo_notificationscontacts.types.list_email_contacts_response.ListEmailContactsResponse"
    ]:
        import capo_notificationscontacts._operations.notifications_contacts.list_email_contacts

        output, http_response = (
            capo_notificationscontacts._operations.notifications_contacts.list_email_contacts.list_email_contacts(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_notificationscontacts.types.list_email_contacts_response.ListEmailContactsResponse",
    ) -> dict[str, Any]:
        import capo_notificationscontacts.types.list_email_contacts_response

        return capo_notificationscontacts.types.list_email_contacts_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListEmailContacts", redact_output=_redact_output),
    )
    input_: capo_notificationscontacts.types.list_email_contacts_request.ListEmailContactsRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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