listInstances method

Future<ListInstancesResponse> listInstances({
  1. int? maxResults,
  2. String? nextToken,
})

Lists the SSO instances that the caller has access to.

May throw InternalServerException. May throw ThrottlingException. May throw AccessDeniedException. May throw ValidationException.

Parameter maxResults : The maximum number of results to display for the instance.

Parameter nextToken : The pagination token for the list API. Initially the value is null. Use the output of previous API calls to make subsequent calls.

Implementation

Future<ListInstancesResponse> listInstances({
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SWBExternalService.ListInstances'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListInstancesResponse.fromJson(jsonResponse.body);
}