getRetainedMessage method

Future<GetRetainedMessageResponse> getRetainedMessage({
  1. required String topic,
})

Gets the details of a single retained message for the specified topic.

This action returns the message payload of the retained message, which can incur messaging costs. To list only the topic names of the retained messages, call ListRetainedMessages.

Requires permission to access the GetRetainedMessage 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 ResourceNotFoundException. May throw ServiceUnavailableException. May throw ThrottlingException. May throw UnauthorizedException.

Parameter topic : The topic name of the retained message to retrieve.

Implementation

Future<GetRetainedMessageResponse> getRetainedMessage({
  required String topic,
}) async {
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/retainedMessage/${Uri.encodeComponent(topic)}',
    exceptionFnMap: _exceptionFns,
  );
  return GetRetainedMessageResponse.fromJson(response);
}