detachPolicy method

Future<void> detachPolicy({
  1. required String policyName,
  2. required String target,
})

Detaches a policy from the specified target. Requires permission to access the DetachPolicy action.

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

Parameter policyName : The policy to detach.

Parameter target : The target from which the policy will be detached.

Implementation

Future<void> detachPolicy({
  required String policyName,
  required String target,
}) async {
  final $payload = <String, dynamic>{
    'target': target,
  };
  await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/target-policies/${Uri.encodeComponent(policyName)}',
    exceptionFnMap: _exceptionFns,
  );
}