postCommentForComparedCommit method

Future<PostCommentForComparedCommitOutput> postCommentForComparedCommit({
  1. required String afterCommitId,
  2. required String content,
  3. required String repositoryName,
  4. String? beforeCommitId,
  5. String? clientRequestToken,
  6. Location? location,
})

Posts a comment on the comparison between two commits.

May throw RepositoryNameRequiredException. May throw RepositoryDoesNotExistException. May throw InvalidRepositoryNameException. May throw ClientRequestTokenRequiredException. May throw InvalidClientRequestTokenException. May throw IdempotencyParameterMismatchException. May throw CommentContentRequiredException. May throw CommentContentSizeLimitExceededException. May throw InvalidFileLocationException. May throw InvalidRelativeFileVersionEnumException. May throw PathRequiredException. May throw InvalidFilePositionException. May throw CommitIdRequiredException. May throw InvalidCommitIdException. May throw BeforeCommitIdAndAfterCommitIdAreSameException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException. May throw CommitDoesNotExistException. May throw InvalidPathException. May throw PathDoesNotExistException. May throw PathRequiredException.

Parameter afterCommitId : To establish the directionality of the comparison, the full commit ID of the after commit.

Parameter content : The content of the comment you want to make.

Parameter repositoryName : The name of the repository where you want to post a comment on the comparison between commits.

Parameter beforeCommitId : To establish the directionality of the comparison, the full commit ID of the before commit. Required for commenting on any commit unless that commit is the initial commit.

Parameter clientRequestToken : A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

Parameter location : The location of the comparison where you want to comment.

Implementation

Future<PostCommentForComparedCommitOutput> postCommentForComparedCommit({
  required String afterCommitId,
  required String content,
  required String repositoryName,
  String? beforeCommitId,
  String? clientRequestToken,
  Location? location,
}) async {
  ArgumentError.checkNotNull(afterCommitId, 'afterCommitId');
  ArgumentError.checkNotNull(content, 'content');
  ArgumentError.checkNotNull(repositoryName, 'repositoryName');
  _s.validateStringLength(
    'repositoryName',
    repositoryName,
    1,
    100,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeCommit_20150413.PostCommentForComparedCommit'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'afterCommitId': afterCommitId,
      'content': content,
      'repositoryName': repositoryName,
      if (beforeCommitId != null) 'beforeCommitId': beforeCommitId,
      'clientRequestToken':
          clientRequestToken ?? _s.generateIdempotencyToken(),
      if (location != null) 'location': location,
    },
  );

  return PostCommentForComparedCommitOutput.fromJson(jsonResponse.body);
}