updateChannelMessage method
Updates the content of a message.
May throw BadRequestException.
May throw ConflictException.
May throw ForbiddenException.
May throw ServiceFailureException.
May throw ServiceUnavailableException.
May throw ThrottledClientException.
May throw UnauthorizedClientException.
Parameter channelArn :
The ARN of the channel.
Parameter chimeBearer :
The ARN of the AppInstanceUser or AppInstanceBot
that makes the API call.
Parameter content :
The content of the channel message.
Parameter messageId :
The ID string of the message being updated.
Parameter contentType :
The content type of the channel message.
Parameter metadata :
The metadata of the message being updated.
Parameter subChannelId :
The ID of the SubChannel in the request.
Implementation
Future<UpdateChannelMessageResponse> updateChannelMessage({
required String channelArn,
required String chimeBearer,
required String content,
required String messageId,
String? contentType,
String? metadata,
String? subChannelId,
}) async {
final headers = <String, String>{
'x-amz-chime-bearer': chimeBearer.toString(),
};
final $payload = <String, dynamic>{
'Content': content,
if (contentType != null) 'ContentType': contentType,
if (metadata != null) 'Metadata': metadata,
if (subChannelId != null) 'SubChannelId': subChannelId,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/channels/${Uri.encodeComponent(channelArn)}/messages/${Uri.encodeComponent(messageId)}',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return UpdateChannelMessageResponse.fromJson(response);
}