Skip to content

list_templates

list_templates(
    *,
    config_overrides: Optional[SESClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_items: Optional[MaxItems] = None,
) -> ListTemplatesResponse

Lists the email templates present in your Amazon SES account in the current Amazon Web Services Region.

You can execute this operation no more than once per second.

Parameters:

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

    A token returned from a previous call to ListTemplates to indicate the position in the list of email templates.

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

    The maximum number of templates to return. This value must be at least 1 and less than or equal to 100. If more than 100 items are requested, the page size will automatically set to 100. If you do not specify a value, 10 is the default page size.

Raises:

Source code in docs_src/capo_ses/_services/ses.py
def list_templates(
    self,
    *,
    config_overrides: Optional[SESClientConfig] = None,
    next_token: Optional["capo_ses.types.next_token.NextToken"] = None,
    max_items: Optional["capo_ses.types.max_items.MaxItems"] = None,
) -> "capo_ses.types.list_templates_response.ListTemplatesResponse":
    """<p>Lists the email templates present in your Amazon SES account in the current Amazon Web Services Region.</p> <p>You can execute this operation no more than once per second.</p>

    Args:
        next_token: <p>A token returned from a previous call to <code>ListTemplates</code> to indicate the position in the list of email templates.</p>
        max_items: <p>The maximum number of templates to return. This value must be at least 1 and less than or equal to 100. If more than 100 items are requested, the page size will automatically set to 100. If you do not specify a value, 10 is the default page size. </p>

    Raises:
        capo_ses.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ses.types.list_templates_request.ListTemplatesRequest]",
    ) -> OperationResponse[
        "capo_ses.types.list_templates_response.ListTemplatesResponse"
    ]:
        import capo_ses._operations.simple_email_service.list_templates

        output, http_response = (
            capo_ses._operations.simple_email_service.list_templates.list_templates(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTemplates")
    )
    input_: capo_ses.types.list_templates_request.ListTemplatesRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_items is not None:
        input_["max_items"] = max_items

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