getDevices method

Future<GetDevicesResponse> getDevices({
  1. required String globalNetworkId,
  2. List<String>? deviceIds,
  3. int? maxResults,
  4. String? nextToken,
  5. String? siteId,
})

Gets information about one or more of your devices in a global network.

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

Parameter globalNetworkId : The ID of the global network.

Parameter deviceIds : One or more device IDs. The maximum is 10.

Parameter maxResults : The maximum number of results to return.

Parameter nextToken : The token for the next page of results.

Parameter siteId : The ID of the site.

Implementation

Future<GetDevicesResponse> getDevices({
  required String globalNetworkId,
  List<String>? deviceIds,
  int? maxResults,
  String? nextToken,
  String? siteId,
}) async {
  ArgumentError.checkNotNull(globalNetworkId, 'globalNetworkId');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    500,
  );
  final $query = <String, List<String>>{
    if (deviceIds != null) 'deviceIds': deviceIds,
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (siteId != null) 'siteId': [siteId],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/global-networks/${Uri.encodeComponent(globalNetworkId)}/devices',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetDevicesResponse.fromJson(response);
}