listDevices method
Returns a list of devices.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ValidationException.
Parameter deviceAggregatedStatusFilter :
Filter based on a device's status.
Parameter maxResults :
The maximum number of devices to return in one page of results.
Parameter nameFilter :
Filter based on device's name. Prefixes supported.
Parameter nextToken :
Specify the pagination token from a previous request to retrieve the next
page of results.
Parameter sortBy :
The target column to be sorted on. Default column sort is CREATED_TIME.
Parameter sortOrder :
The sorting order for the returned list. SortOrder is DESCENDING by
default based on CREATED_TIME. Otherwise, SortOrder is ASCENDING.
Implementation
Future<ListDevicesResponse> listDevices({
DeviceAggregatedStatus? deviceAggregatedStatusFilter,
int? maxResults,
String? nameFilter,
String? nextToken,
ListDevicesSortBy? sortBy,
SortOrder? sortOrder,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
0,
25,
);
final $query = <String, List<String>>{
if (deviceAggregatedStatusFilter != null)
'DeviceAggregatedStatusFilter': [deviceAggregatedStatusFilter.value],
if (maxResults != null) 'MaxResults': [maxResults.toString()],
if (nameFilter != null) 'NameFilter': [nameFilter],
if (nextToken != null) 'NextToken': [nextToken],
if (sortBy != null) 'SortBy': [sortBy.value],
if (sortOrder != null) 'SortOrder': [sortOrder.value],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/devices',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListDevicesResponse.fromJson(response);
}