sendMessages method
Future<SendMessagesResponse>
sendMessages({
- required String applicationId,
- required MessageRequest messageRequest,
Creates and sends a direct message.
May throw BadRequestException. May throw InternalServerErrorException. May throw PayloadTooLargeException. May throw ForbiddenException. May throw NotFoundException. May throw MethodNotAllowedException. May throw TooManyRequestsException.
Parameter applicationId
:
The unique identifier for the application. This identifier is displayed as
the Project ID on the Amazon Pinpoint console.
Implementation
Future<SendMessagesResponse> sendMessages({
required String applicationId,
required MessageRequest messageRequest,
}) async {
ArgumentError.checkNotNull(applicationId, 'applicationId');
ArgumentError.checkNotNull(messageRequest, 'messageRequest');
final response = await _protocol.sendRaw(
payload: messageRequest,
method: 'POST',
requestUri: '/v1/apps/${Uri.encodeComponent(applicationId)}/messages',
exceptionFnMap: _exceptionFns,
);
final $json = await _s.jsonFromResponse(response);
return SendMessagesResponse(
messageResponse: MessageResponse.fromJson($json),
);
}