listSpeechSynthesisTasks method
Future<ListSpeechSynthesisTasksOutput>
listSpeechSynthesisTasks({
- int? maxResults,
- String? nextToken,
- TaskStatus? status,
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.
May throw InvalidNextTokenException. May throw ServiceFailureException.
Parameter maxResults
:
Maximum number of speech synthesis tasks returned in a List operation.
Parameter nextToken
:
The pagination token to use in the next request to continue the listing of
speech synthesis tasks.
Parameter status
:
Status of the speech synthesis tasks returned in a List operation
Implementation
Future<ListSpeechSynthesisTasksOutput> listSpeechSynthesisTasks({
int? maxResults,
String? nextToken,
TaskStatus? status,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
_s.validateStringLength(
'nextToken',
nextToken,
0,
4096,
);
final $query = <String, List<String>>{
if (maxResults != null) 'MaxResults': [maxResults.toString()],
if (nextToken != null) 'NextToken': [nextToken],
if (status != null) 'Status': [status.toValue()],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/v1/synthesisTasks',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListSpeechSynthesisTasksOutput.fromJson(response);
}