Skip to content

list_template_versions async

list_template_versions(
    template_name: __string,
    template_type: __string,
    *,
    config_overrides: Optional[AsyncPinpointClientConfig] = None,
    next_token: Optional[__string] = None,
    page_size: Optional[__string] = None,
) -> ListTemplateVersionsResponse

Retrieves information about all the versions of a specific message template.

Parameters:

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

    The string that specifies which page of results to return in a paginated response. This parameter is not supported for application, campaign, and journey metrics.

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

    The maximum number of items to include in each page of a paginated response. This parameter is not supported for application, campaign, and journey metrics.

  • template_name (__string) –

    The name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.

  • template_type (__string) –

    The type of channel that the message template is designed for. Valid values are: EMAIL, PUSH, SMS, and VOICE.

Raises:

Source code in docs_src/capo_pinpoint/_services/async_pinpoint.py
async def list_template_versions(
    self,
    template_name: "capo_pinpoint.types.__string.__string",
    template_type: "capo_pinpoint.types.__string.__string",
    *,
    config_overrides: Optional[AsyncPinpointClientConfig] = None,
    next_token: Optional["capo_pinpoint.types.__string.__string"] = None,
    page_size: Optional["capo_pinpoint.types.__string.__string"] = None,
) -> "capo_pinpoint.types.list_template_versions_response.ListTemplateVersionsResponse":
    """<p>Retrieves information about all the versions of a specific message template.</p>

    Args:
        next_token: <p>The string that specifies which page of results to return in a paginated response. This parameter is not supported for application, campaign, and journey metrics.</p>
        page_size: <p>The maximum number of items to include in each page of a paginated response. This parameter is not supported for application, campaign, and journey metrics.</p>
        template_name: <p>The name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.</p>
        template_type: <p>The type of channel that the message template is designed for. Valid values are: EMAIL, PUSH, SMS, and VOICE.</p>

    Raises:
        capo_pinpoint.errors.bad_request_exception.BadRequestException: <p>Provides information about an API request or response.</p>
        capo_pinpoint.errors.forbidden_exception.ForbiddenException: <p>Provides information about an API request or response.</p>
        capo_pinpoint.errors.internal_server_error_exception.InternalServerErrorException: <p>Provides information about an API request or response.</p>
        capo_pinpoint.errors.method_not_allowed_exception.MethodNotAllowedException: <p>Provides information about an API request or response.</p>
        capo_pinpoint.errors.not_found_exception.NotFoundException: <p>Provides information about an API request or response.</p>
        capo_pinpoint.errors.payload_too_large_exception.PayloadTooLargeException: <p>Provides information about an API request or response.</p>
        capo_pinpoint.errors.too_many_requests_exception.TooManyRequestsException: <p>Provides information about an API request or response.</p>
        capo_pinpoint.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_pinpoint.types.list_template_versions_request.ListTemplateVersionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_pinpoint.types.list_template_versions_response.ListTemplateVersionsResponse"
    ]:
        import capo_pinpoint._operations.pinpoint.list_template_versions

        (
            output,
            http_response,
        ) = await capo_pinpoint._operations.pinpoint.list_template_versions.async_list_template_versions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTemplateVersions")
    )
    input_: capo_pinpoint.types.list_template_versions_request.ListTemplateVersionsRequest = {
        "template_name": template_name,
        "template_type": template_type,
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if page_size is not None:
        input_["page_size"] = page_size

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