updateComment method

Future<UpdateCommentOutput> updateComment({
  1. required String commentId,
  2. required String content,
})

Replaces the contents of a comment.

May throw CommentContentRequiredException. May throw CommentContentSizeLimitExceededException. May throw CommentDoesNotExistException. May throw CommentIdRequiredException. May throw InvalidCommentIdException. May throw CommentNotCreatedByCallerException. May throw CommentDeletedException.

Parameter commentId : The system-generated ID of the comment you want to update. To get this ID, use GetCommentsForComparedCommit or GetCommentsForPullRequest.

Parameter content : The updated content to replace the existing content of the comment.

Implementation

Future<UpdateCommentOutput> updateComment({
  required String commentId,
  required String content,
}) async {
  ArgumentError.checkNotNull(commentId, 'commentId');
  ArgumentError.checkNotNull(content, 'content');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeCommit_20150413.UpdateComment'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'commentId': commentId,
      'content': content,
    },
  );

  return UpdateCommentOutput.fromJson(jsonResponse.body);
}