batchPutMessage method

Future<BatchPutMessageResponse> batchPutMessage({
  1. required List<Message> messages,
})

Sends a set of messages to the AWS IoT Events system. Each message payload is transformed into the input you specify ("inputName") and ingested into any detectors that monitor that input. If multiple messages are sent, the order in which the messages are processed isn't guaranteed. To guarantee ordering, you must send messages one at a time and wait for a successful response.

May throw InvalidRequestException. May throw InternalFailureException. May throw ServiceUnavailableException. May throw ThrottlingException.

Parameter messages : The list of messages to send. Each message has the following format: '{ "messageId": "string", "inputName": "string", "payload": "string"}'

Implementation

Future<BatchPutMessageResponse> batchPutMessage({
  required List<Message> messages,
}) async {
  ArgumentError.checkNotNull(messages, 'messages');
  final $payload = <String, dynamic>{
    'messages': messages,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/inputs/messages',
    exceptionFnMap: _exceptionFns,
  );
  return BatchPutMessageResponse.fromJson(response);
}