listCapacityTasks method
Lists the capacity tasks for your Amazon Web Services account.
Use filters to return specific results. If you specify multiple filters, the results include only the resources that match all of the specified filters. For a filter where you can specify multiple values, the results include items that match any of the values that you specify for the filter.
May throw AccessDeniedException.
May throw InternalServerException.
May throw NotFoundException.
May throw ValidationException.
Parameter capacityTaskStatusFilter :
A list of statuses. For example, REQUESTED or
WAITING_FOR_EVACUATION.
Parameter outpostIdentifierFilter :
Filters the results by an Outpost ID or an Outpost ARN.
Implementation
Future<ListCapacityTasksOutput> listCapacityTasks({
List<CapacityTaskStatus>? capacityTaskStatusFilter,
int? maxResults,
String? nextToken,
String? outpostIdentifierFilter,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
1000,
);
final $query = <String, List<String>>{
if (capacityTaskStatusFilter != null)
'CapacityTaskStatusFilter':
capacityTaskStatusFilter.map((e) => e.value).toList(),
if (maxResults != null) 'MaxResults': [maxResults.toString()],
if (nextToken != null) 'NextToken': [nextToken],
if (outpostIdentifierFilter != null)
'OutpostIdentifierFilter': [outpostIdentifierFilter],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/capacity/tasks',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListCapacityTasksOutput.fromJson(response);
}