getBlob method

Future<GetBlobOutput> getBlob({
  1. required String blobId,
  2. required String repositoryName,
})

Returns the base-64 encoded content of an individual blob in a repository.

May throw RepositoryNameRequiredException. May throw InvalidRepositoryNameException. May throw RepositoryDoesNotExistException. May throw BlobIdRequiredException. May throw InvalidBlobIdException. May throw BlobIdDoesNotExistException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException. May throw FileTooLargeException.

Parameter blobId : The ID of the blob, which is its SHA-1 pointer.

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

Implementation

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

  return GetBlobOutput.fromJson(jsonResponse.body);
}