getCommit method

Future<GetCommitOutput> getCommit({
  1. required String commitId,
  2. required String repositoryName,
})

Returns information about a commit, including commit message and committer information.

May throw RepositoryNameRequiredException. May throw InvalidRepositoryNameException. May throw RepositoryDoesNotExistException. May throw CommitIdRequiredException. May throw InvalidCommitIdException. May throw CommitIdDoesNotExistException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException.

Parameter commitId : The commit ID. Commit IDs are the full SHA ID of the commit.

Parameter repositoryName : The name of the repository to which the commit was made.

Implementation

Future<GetCommitOutput> getCommit({
  required String commitId,
  required String repositoryName,
}) async {
  ArgumentError.checkNotNull(commitId, 'commitId');
  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.GetCommit'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'commitId': commitId,
      'repositoryName': repositoryName,
    },
  );

  return GetCommitOutput.fromJson(jsonResponse.body);
}