Skip to content

list_lexicons async

list_lexicons(
    *,
    config_overrides: Optional[AsyncPollyClientConfig] = None,
    next_token: Optional[NextToken] = None,
) -> ListLexiconsOutput

Returns a list of pronunciation lexicons stored in an Amazon Web Services Region. For more information, see Managing Lexicons.

Parameters:

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

    An opaque pagination token returned from previous ListLexicons operation. If present, indicates where to continue the list of lexicons.

Raises:

Examples:

To list all lexicons in a region Returns a list of pronunciation lexicons stored in an AWS Region.

>>> await client.list_lexicons()
Source code in docs_src/capo_polly/_services/async_polly.py
async def list_lexicons(
    self,
    *,
    config_overrides: Optional[AsyncPollyClientConfig] = None,
    next_token: Optional["capo_polly.types.next_token.NextToken"] = None,
) -> "capo_polly.types.list_lexicons_output.ListLexiconsOutput":
    """<p>Returns a list of pronunciation lexicons stored in an Amazon Web Services Region. For more information, see <a href="https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html">Managing Lexicons</a>.</p>

    Args:
        next_token: <p>An opaque pagination token returned from previous <code>ListLexicons</code> operation. If present, indicates where to continue the list of lexicons.</p>

    Raises:
        capo_polly.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The NextToken is invalid. Verify that it's spelled correctly, and then try again.</p>
        capo_polly.errors.service_failure_exception.ServiceFailureException: <p>An unknown condition has caused a service failure.</p>
        capo_polly.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To list all lexicons in a region
        Returns a list of pronunciation lexicons stored in an AWS Region.

        >>> await client.list_lexicons()
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_polly.types.list_lexicons_input.ListLexiconsInput]",
    ) -> AsyncOperationResponse[
        "capo_polly.types.list_lexicons_output.ListLexiconsOutput"
    ]:
        import capo_polly._operations.parrot_v1.list_lexicons

        (
            output,
            http_response,
        ) = await capo_polly._operations.parrot_v1.list_lexicons.async_list_lexicons(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListLexicons")
    )
    input_: capo_polly.types.list_lexicons_input.ListLexiconsInput = {}
    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