listInstances method
This API is in preview release for Amazon Connect and is subject to change.
Return a list of instances which are in active state, creation-in-progress state, and failed state. Instances that aren't successfully created (they are in a failed state) are returned only for 24 hours after the CreateInstance API was invoked.
May throw InvalidRequestException. May throw InternalServiceException.
Parameter maxResults
:
The maximimum number of results to return per page.
Parameter nextToken
:
The token for the next set of results. Use the value returned in the
previous response in the next request to retrieve the next set of results.
Implementation
Future<ListInstancesResponse> listInstances({
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
10,
);
final $query = <String, List<String>>{
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/instance',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListInstancesResponse.fromJson(response);
}