listInstalledComponents method

Future<ListInstalledComponentsResponse> listInstalledComponents({
  1. required String coreDeviceThingName,
  2. int? maxResults,
  3. String? nextToken,
})

Retrieves a paginated list of the components that a AWS IoT Greengrass core device runs.

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

Parameter coreDeviceThingName : The name of the core device. This is also the name of the AWS IoT thing.

Parameter maxResults : The maximum number of results to be returned per paginated request.

Parameter nextToken : The token to be used for the next set of paginated results.

Implementation

Future<ListInstalledComponentsResponse> listInstalledComponents({
  required String coreDeviceThingName,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(coreDeviceThingName, 'coreDeviceThingName');
  _s.validateStringLength(
    'coreDeviceThingName',
    coreDeviceThingName,
    1,
    128,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  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:
        '/greengrass/v2/coreDevices/${Uri.encodeComponent(coreDeviceThingName)}/installedComponents',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListInstalledComponentsResponse.fromJson(response);
}