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 API. 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.

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

Parameter policyName : The name of the policy.

Parameter policyVersionId : The policy version ID.

Implementation

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