Skip to content

list_speech_synthesis_tasks

list_speech_synthesis_tasks(
    *,
    config_overrides: Optional[PollyClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    status: Optional[TaskStatus] = None,
) -> ListSpeechSynthesisTasksOutput

Returns a list of SpeechSynthesisTask objects ordered by their creation date. This operation can filter the tasks by their status, for example, allowing users to list only tasks that are completed.

Parameters:

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

    Maximum number of speech synthesis tasks returned in a List operation.

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

    The pagination token to use in the next request to continue the listing of speech synthesis tasks.

  • status (Optional[TaskStatus], default: None ) –

    Status of the speech synthesis tasks returned in a List operation

Raises:

Source code in docs_src/capo_polly/_services/polly.py
def list_speech_synthesis_tasks(
    self,
    *,
    config_overrides: Optional[PollyClientConfig] = None,
    max_results: Optional["capo_polly.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_polly.types.next_token.NextToken"] = None,
    status: Optional["capo_polly.types.task_status.TaskStatus"] = None,
) -> "capo_polly.types.list_speech_synthesis_tasks_output.ListSpeechSynthesisTasksOutput":
    """<p>Returns a list of SpeechSynthesisTask objects ordered by their creation date. This operation can filter the tasks by their status, for example, allowing users to list only tasks that are completed.</p>

    Args:
        max_results: <p>Maximum number of speech synthesis tasks returned in a List operation.</p>
        next_token: <p>The pagination token to use in the next request to continue the listing of speech synthesis tasks. </p>
        status: <p>Status of the speech synthesis tasks returned in a List operation</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.
    """

    def _handler(
        req: "OperationRequest[capo_polly.types.list_speech_synthesis_tasks_input.ListSpeechSynthesisTasksInput]",
    ) -> OperationResponse[
        "capo_polly.types.list_speech_synthesis_tasks_output.ListSpeechSynthesisTasksOutput"
    ]:
        import capo_polly._operations.parrot_v1.list_speech_synthesis_tasks

        output, http_response = (
            capo_polly._operations.parrot_v1.list_speech_synthesis_tasks.list_speech_synthesis_tasks(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSpeechSynthesisTasks")
    )
    input_: capo_polly.types.list_speech_synthesis_tasks_input.ListSpeechSynthesisTasksInput = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if status is not None:
        input_["status"] = status

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