listDeployments method

Future<ListDeploymentsResponse> listDeployments({
  1. DeploymentHistoryFilter? historyFilter,
  2. int? maxResults,
  3. String? nextToken,
  4. String? targetArn,
})

Retrieves a paginated list of deployments.

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

Parameter historyFilter : The filter for the list of deployments. Choose one of the following options:

  • ALL – The list includes all deployments.
  • LATEST_ONLY – The list includes only the latest revision of each deployment.
Default: LATEST_ONLY

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.

Parameter targetArn : The ARN of the target AWS IoT thing or thing group.

Implementation

Future<ListDeploymentsResponse> listDeployments({
  DeploymentHistoryFilter? historyFilter,
  int? maxResults,
  String? nextToken,
  String? targetArn,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (historyFilter != null) 'historyFilter': [historyFilter.toValue()],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (targetArn != null) 'targetArn': [targetArn],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/greengrass/v2/deployments',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListDeploymentsResponse.fromJson(response);
}