deleteRepository method
Deletes a repository in a public registry. If the repository contains
images, you must either manually delete all images in the repository or
use the force option. This option deletes all images on your
behalf before deleting the repository.
May throw InvalidParameterException.
May throw RepositoryNotEmptyException.
May throw RepositoryNotFoundException.
May throw ServerException.
May throw UnsupportedCommandException.
Parameter repositoryName :
The name of the repository to delete.
Parameter force :
The force option can be used to delete a repository that contains images.
If the force option is not used, the repository must be empty prior to
deletion.
Parameter registryId :
The Amazon Web Services account ID that's associated with the public
registry that contains the repository to delete. If you do not specify a
registry, the default public 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': 'SpencerFrontendService.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);
}