deleteRepository method
Deletes a repository. If the repository isn't empty, you must either
delete the contents of the repository or use the force option
to delete the repository and have Amazon ECR delete all of its contents on
your behalf.
May throw InvalidParameterException.
May throw KmsException.
May throw RepositoryNotEmptyException.
May throw RepositoryNotFoundException.
May throw ServerException.
Parameter repositoryName :
The name of the repository to delete.
Parameter force :
If true, deleting the repository force deletes the contents of the
repository. If false, the repository must be empty before attempting to
delete it.
Parameter registryId :
The Amazon Web Services account ID associated with the registry that
contains the repository to delete. If you do not specify a registry, the
default registry is assumed.
Implementation
Future<DeleteRepositoryResponse> deleteRepository({
required String repositoryName,
bool? force,
String? registryId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonEC2ContainerRegistry_V20150921.DeleteRepository'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'repositoryName': repositoryName,
if (force != null) 'force': force,
if (registryId != null) 'registryId': registryId,
},
);
return DeleteRepositoryResponse.fromJson(jsonResponse.body);
}