setDefaultPolicyVersion method

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

Sets the specified version of the specified policy as the policy's default (operative) version. This action affects all certificates to which the policy is attached. To list the principals the policy is attached to, use the ListPrincipalPolicies action.

Requires permission to access the SetDefaultPolicyVersion action.

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

Parameter policyName : The policy name.

Parameter policyVersionId : The policy version ID.

Implementation

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