getCommentsForComparedCommit method

Future<GetCommentsForComparedCommitOutput> getCommentsForComparedCommit({
  1. required String afterCommitId,
  2. required String repositoryName,
  3. String? beforeCommitId,
  4. int? maxResults,
  5. String? nextToken,
})

Returns information about comments made on the comparison between two commits.

May throw RepositoryNameRequiredException. May throw RepositoryDoesNotExistException. May throw InvalidRepositoryNameException. May throw CommitIdRequiredException. May throw InvalidCommitIdException. May throw CommitDoesNotExistException. May throw InvalidMaxResultsException. May throw InvalidContinuationTokenException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException.

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

Parameter repositoryName : The name of the repository where you want to compare commits.

Parameter beforeCommitId : To establish the directionality of the comparison, the full commit ID of the before commit.

Parameter maxResults : A non-zero, non-negative integer used to limit the number of returned results. The default is 100 comments, but you can configure up to 500.

Parameter nextToken : An enumeration token that when provided in a request, returns the next batch of the results.

Implementation

Future<GetCommentsForComparedCommitOutput> getCommentsForComparedCommit({
  required String afterCommitId,
  required String repositoryName,
  String? beforeCommitId,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(afterCommitId, 'afterCommitId');
  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.GetCommentsForComparedCommit'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'afterCommitId': afterCommitId,
      'repositoryName': repositoryName,
      if (beforeCommitId != null) 'beforeCommitId': beforeCommitId,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return GetCommentsForComparedCommitOutput.fromJson(jsonResponse.body);
}