listFileCommitHistory method

Future<ListFileCommitHistoryResponse> listFileCommitHistory({
  1. required String filePath,
  2. required String repositoryName,
  3. String? commitSpecifier,
  4. int? maxResults,
  5. String? nextToken,
})

Retrieves a list of commits and changes to a specified file.

May throw CommitDoesNotExistException. May throw CommitRequiredException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException. May throw InvalidCommitException. May throw InvalidContinuationTokenException. May throw InvalidMaxResultsException. May throw InvalidRepositoryNameException. May throw RepositoryDoesNotExistException. May throw RepositoryNameRequiredException. May throw TipsDivergenceExceededException.

Parameter filePath : The full path of the file whose history you want to retrieve, including the name of the file.

Parameter repositoryName : The name of the repository that contains the file.

Parameter commitSpecifier : The fully quaified reference that identifies the commit that contains the file. For example, you can specify a full commit ID, a tag, a branch name, or a reference such as refs/heads/main. If none is provided, the head commit is used.

Parameter maxResults : A non-zero, non-negative integer used to limit the number of returned results.

Parameter nextToken : An enumeration token that allows the operation to batch the results.

Implementation

Future<ListFileCommitHistoryResponse> listFileCommitHistory({
  required String filePath,
  required String repositoryName,
  String? commitSpecifier,
  int? maxResults,
  String? nextToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeCommit_20150413.ListFileCommitHistory'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'filePath': filePath,
      'repositoryName': repositoryName,
      if (commitSpecifier != null) 'commitSpecifier': commitSpecifier,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListFileCommitHistoryResponse.fromJson(jsonResponse.body);
}