listDeployments method
Retrieves a paginated list of deployments.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ThrottlingException.
May throw ValidationException.
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.
LATEST_ONLY
Parameter maxResults :
The maximum number of results to be returned per paginated request.
Default: 50
Parameter nextToken :
The token to be used for the next set of paginated results.
Parameter parentTargetArn :
The parent deployment's target ARN
within a subdeployment.
Parameter targetArn :
The ARN
of the target IoT thing or thing group.
Implementation
Future<ListDeploymentsResponse> listDeployments({
DeploymentHistoryFilter? historyFilter,
int? maxResults,
String? nextToken,
String? parentTargetArn,
String? targetArn,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final $query = <String, List<String>>{
if (historyFilter != null) 'historyFilter': [historyFilter.value],
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
if (parentTargetArn != null) 'parentTargetArn': [parentTargetArn],
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);
}