deletePolicyVersion method

Future<void> deletePolicyVersion({
  1. required String policyName,
  2. required String policyVersionId,
})

Deletes the specified version of the specified policy. You cannot delete the default version of a policy using this action. To delete the default version of a policy, use DeletePolicy. To find out which version of a policy is marked as the default version, use ListPolicyVersions.

Requires permission to access the DeletePolicyVersion action.

May throw DeleteConflictException. May throw InternalFailureException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ServiceUnavailableException. May throw ThrottlingException. May throw UnauthorizedException.

Parameter policyName : The name of the policy.

Parameter policyVersionId : The policy version ID.

Implementation

Future<void> deletePolicyVersion({
  required String policyName,
  required String policyVersionId,
}) async {
  await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/policies/${Uri.encodeComponent(policyName)}/version/${Uri.encodeComponent(policyVersionId)}',
    exceptionFnMap: _exceptionFns,
  );
}