listInstances method

Future<ListInstancesResponse> listInstances({
  1. List<String>? instanceNameFilter,
  2. List<InstanceState>? instanceStateFilter,
  3. int? maxResults,
  4. String? nextToken,
})

List all Amazon Web Services Supply Chain instances for a specific account. Enables you to programmatically list all Amazon Web Services Supply Chain instances based on their account ID, instance name, and state of the instance (active or delete).

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

Parameter instanceNameFilter : The filter to ListInstances based on their names.

Parameter instanceStateFilter : The filter to ListInstances based on their state.

Parameter maxResults : Specify the maximum number of instances to fetch in this paginated request.

Parameter nextToken : The pagination token to fetch the next page of instances.

Implementation

Future<ListInstancesResponse> listInstances({
  List<String>? instanceNameFilter,
  List<InstanceState>? instanceStateFilter,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    20,
  );
  final $query = <String, List<String>>{
    if (instanceNameFilter != null) 'instanceNameFilter': instanceNameFilter,
    if (instanceStateFilter != null)
      'instanceStateFilter': instanceStateFilter.map((e) => e.value).toList(),
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/api/instance',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListInstancesResponse.fromJson(response);
}