listDevices method

Future<ListDevicesResponse> listDevices({
  1. String? deviceType,
  2. int? maxResults,
  3. String? nextToken,
})

Lists the 1-Click compatible devices associated with your AWS account.

May throw RangeNotSatisfiableException. May throw InvalidRequestException. May throw InternalFailureException.

Parameter deviceType : The type of the device, such as "button".

Parameter maxResults : The maximum number of results to return per request. If not set, a default value of 100 is used.

Parameter nextToken : The token to retrieve the next set of results.

Implementation

Future<ListDevicesResponse> listDevices({
  String? deviceType,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  final $query = <String, List<String>>{
    if (deviceType != null) 'deviceType': [deviceType],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/devices',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListDevicesResponse.fromJson(response);
}