searchSystemInstances method

Future<SearchSystemInstancesResponse> searchSystemInstances({
  1. List<SystemInstanceFilter>? filters,
  2. int? maxResults,
  3. String? nextToken,
})

Searches for system instances in the user's account.

May throw InvalidRequestException. May throw ThrottlingException. May throw InternalFailureException.

Parameter filters : Optional filter to apply to the search. Valid filters are SYSTEM_TEMPLATE_ID, STATUS, and GREENGRASS_GROUP_NAME.

Multiple filters function as OR criteria in the query. Multiple values passed inside the filter function as AND criteria.

Parameter maxResults : The maximum number of results to return in the response.

Parameter nextToken : The string that specifies the next page of results. Use this when you're paginating results.

Implementation

Future<SearchSystemInstancesResponse> searchSystemInstances({
  List<SystemInstanceFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'IotThingsGraphFrontEndService.SearchSystemInstances'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (filters != null) 'filters': filters,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return SearchSystemInstancesResponse.fromJson(jsonResponse.body);
}