deletePolicyStoreAlias method
Deletes the specified policy store alias.
This operation is idempotent. If you specify a policy store alias that does not exist, the request response will still return a successful HTTP 200 status code.
By default, when a policy store alias is deleted, it enters the
PendingDeletion state. When a policy store alias is in the
PendingDeletion state, new policy store aliases cannot be
created with the same name. If the policy store alias is used in an API
that has a policyStoreId field, the operation will fail with
a ResourceNotFound exception.
To immediately delete a policy store alias and bypass the
PendingDeletion state, set the deletionMode
parameter to HardDelete.
May throw InvalidStateException.
Parameter aliasName :
Specifies the name of the policy store alias that you want to delete.
Parameter deletionMode :
Specifies the deletion mode for the policy store alias. The valid values
are:
-
SoftDelete – The policy store alias enters the
PendingDeletionstate. This is the default behavior when nodeletionModeis specified. -
HardDelete – The policy store alias is immediately deleted,
bypassing the
PendingDeletionstate.
Implementation
Future<void> deletePolicyStoreAlias({
required String aliasName,
DeletionMode? deletionMode,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'VerifiedPermissions.DeletePolicyStoreAlias'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'aliasName': aliasName,
if (deletionMode != null) 'deletionMode': deletionMode.value,
},
);
}