detachPolicy method
Detaches a policy from the specified target.
May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException. May throw LimitExceededException.
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 {
ArgumentError.checkNotNull(policyName, 'policyName');
_s.validateStringLength(
'policyName',
policyName,
1,
128,
isRequired: true,
);
ArgumentError.checkNotNull(target, 'target');
final $payload = <String, dynamic>{
'target': target,
};
await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/target-policies/${Uri.encodeComponent(policyName)}',
exceptionFnMap: _exceptionFns,
);
}