putImageTagMutability method
Updates the image tag mutability settings for the specified repository. For more information, see Image tag mutability in the Amazon Elastic Container Registry User Guide.
May throw InvalidParameterException.
May throw RepositoryNotFoundException.
May throw ServerException.
Parameter imageTagMutability :
The tag mutability setting for the repository. If MUTABLE is
specified, image tags can be overwritten. If IMMUTABLE is
specified, all image tags within the repository will be immutable which
will prevent them from being overwritten.
Parameter repositoryName :
The name of the repository in which to update the image tag mutability
settings.
Parameter imageTagMutabilityExclusionFilters :
A list of filters that specify which image tags should be excluded from
the image tag mutability setting being applied.
Parameter registryId :
The Amazon Web Services account ID associated with the registry that
contains the repository in which to update the image tag mutability
settings. If you do not specify a registry, the default registry is
assumed.
Implementation
Future<PutImageTagMutabilityResponse> putImageTagMutability({
required ImageTagMutability imageTagMutability,
required String repositoryName,
List<ImageTagMutabilityExclusionFilter>? imageTagMutabilityExclusionFilters,
String? registryId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'AmazonEC2ContainerRegistry_V20150921.PutImageTagMutability'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'imageTagMutability': imageTagMutability.value,
'repositoryName': repositoryName,
if (imageTagMutabilityExclusionFilters != null)
'imageTagMutabilityExclusionFilters':
imageTagMutabilityExclusionFilters,
if (registryId != null) 'registryId': registryId,
},
);
return PutImageTagMutabilityResponse.fromJson(jsonResponse.body);
}