listEffectiveDeployments method

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

Retrieves a paginated list of deployment jobs that AWS IoT Greengrass sends to AWS IoT Greengrass core devices.

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<ListEffectiveDeploymentsResponse> listEffectiveDeployments({
  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)}/effectiveDeployments',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListEffectiveDeploymentsResponse.fromJson(response);
}