updateChannelMessage method

Future<UpdateChannelMessageResponse> updateChannelMessage({
  1. required String channelArn,
  2. required String messageId,
  3. String? content,
  4. String? metadata,
})

Updates the content of a message.

May throw BadRequestException. May throw ConflictException. May throw ForbiddenException. May throw UnauthorizedClientException. May throw ThrottledClientException. May throw ServiceUnavailableException. May throw ServiceFailureException.

Parameter channelArn : The ARN of the channel.

Parameter messageId : The ID string of the message being updated.

Parameter content : The content of the message being updated.

Parameter metadata : The metadata of the message being updated.

Implementation

Future<UpdateChannelMessageResponse> updateChannelMessage({
  required String channelArn,
  required String messageId,
  String? content,
  String? metadata,
}) async {
  ArgumentError.checkNotNull(channelArn, 'channelArn');
  _s.validateStringLength(
    'channelArn',
    channelArn,
    5,
    1600,
    isRequired: true,
  );
  ArgumentError.checkNotNull(messageId, 'messageId');
  _s.validateStringLength(
    'messageId',
    messageId,
    1,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'content',
    content,
    0,
    4096,
  );
  _s.validateStringLength(
    'metadata',
    metadata,
    0,
    1024,
  );
  final $payload = <String, dynamic>{
    if (content != null) 'Content': content,
    if (metadata != null) 'Metadata': metadata,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/channels/${Uri.encodeComponent(channelArn)}/messages/${Uri.encodeComponent(messageId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateChannelMessageResponse.fromJson(response);
}