updateAlias method
Associates an existing Amazon Web Services Payment Cryptography alias with a different key. Each alias is associated with only one Amazon Web Services Payment Cryptography key at a time, although a key can have multiple aliases. The alias and the Amazon Web Services Payment Cryptography key must be in the same Amazon Web Services account and Amazon Web Services Region
Cross-account use: This operation can't be used across different Amazon Web Services accounts.
Related operations:
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
May throw ValidationException.
Parameter aliasName :
The alias whose associated key is changing.
Parameter keyArn :
The KeyARN for the key that you are updating or removing from
the alias.
Implementation
Future<UpdateAliasOutput> updateAlias({
required String aliasName,
String? keyArn,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'PaymentCryptographyControlPlane.UpdateAlias'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AliasName': aliasName,
if (keyArn != null) 'KeyArn': keyArn,
},
);
return UpdateAliasOutput.fromJson(jsonResponse.body);
}