listRetainedMessages method
Lists summary information about the retained messages stored for the account.
This action returns only the topic names of the retained messages. It doesn't return any message payloads. Although this action doesn't return a message payload, it can still incur messaging costs.
To get the message payload of a retained message, call GetRetainedMessage with the topic name of the retained message.
Requires permission to access the ListRetainedMessages action.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw MethodNotAllowedException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
May throw UnauthorizedException.
Parameter maxResults :
The maximum number of results to return at one time.
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.
Implementation
Future<ListRetainedMessagesResponse> listRetainedMessages({
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
200,
);
final $query = <String, List<String>>{
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/retainedMessage',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListRetainedMessagesResponse.fromJson(response);
}