listQueuedMessages method

Future<ListQueuedMessagesResponse> listQueuedMessages({
  1. required String id,
  2. int? maxResults,
  3. String? nextToken,
  4. WirelessDeviceType? wirelessDeviceType,
})

List queued messages in the downlink queue.

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

Parameter id : The ID of a given wireless device which the downlink message packets are being sent.

Parameter maxResults : The maximum number of results to return in this operation.

Parameter nextToken : To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.

Parameter wirelessDeviceType : The wireless device type, whic can be either Sidewalk or LoRaWAN.

Implementation

Future<ListQueuedMessagesResponse> listQueuedMessages({
  required String id,
  int? maxResults,
  String? nextToken,
  WirelessDeviceType? wirelessDeviceType,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    250,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (wirelessDeviceType != null)
      'WirelessDeviceType': [wirelessDeviceType.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/wireless-devices/${Uri.encodeComponent(id)}/data',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListQueuedMessagesResponse.fromJson(response);
}