Retrieves a specific SpeechSynthesisTask object based on its TaskID. This object contains information about the given speech synthesis task, including the status of the task, and a link to the S3 bucket containing the output of the task.
Parameters:
-
task_id
(TaskId)
–
The Amazon Polly generated identifier for a speech synthesis task.
Raises:
Source code in docs_src/capo_polly/_services/async_polly.py
| async def get_speech_synthesis_task(
self,
task_id: "capo_polly.types.task_id.TaskId",
*,
config_overrides: Optional[AsyncPollyClientConfig] = None,
) -> (
"capo_polly.types.get_speech_synthesis_task_output.GetSpeechSynthesisTaskOutput"
):
"""<p>Retrieves a specific SpeechSynthesisTask object based on its TaskID. This object contains information about the given speech synthesis task, including the status of the task, and a link to the S3 bucket containing the output of the task.</p>
Args:
task_id: <p>The Amazon Polly generated identifier for a speech synthesis task.</p>
Raises:
capo_polly.errors.invalid_task_id_exception.InvalidTaskIdException: <p>The provided Task ID is not valid. Please provide a valid Task ID and try again.</p>
capo_polly.errors.service_failure_exception.ServiceFailureException: <p>An unknown condition has caused a service failure.</p>
capo_polly.errors.synthesis_task_not_found_exception.SynthesisTaskNotFoundException: <p>The Speech Synthesis task with requested Task ID cannot be found.</p>
capo_polly.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_polly.types.get_speech_synthesis_task_input.GetSpeechSynthesisTaskInput]",
) -> AsyncOperationResponse[
"capo_polly.types.get_speech_synthesis_task_output.GetSpeechSynthesisTaskOutput"
]:
import capo_polly._operations.parrot_v1.get_speech_synthesis_task
(
output,
http_response,
) = await capo_polly._operations.parrot_v1.get_speech_synthesis_task.async_get_speech_synthesis_task(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetSpeechSynthesisTask")
)
input_: capo_polly.types.get_speech_synthesis_task_input.GetSpeechSynthesisTaskInput = {
"task_id": task_id
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|