detachPolicy method

Future<void> detachPolicy({
  1. required String directoryArn,
  2. required ObjectReference objectReference,
  3. required ObjectReference policyReference,
})

Detaches a policy from an object.

May throw InternalServiceException. May throw InvalidArnException. May throw RetryableConflictException. May throw ValidationException. May throw LimitExceededException. May throw AccessDeniedException. May throw DirectoryNotEnabledException. May throw ResourceNotFoundException. May throw NotPolicyException.

Parameter directoryArn : The Amazon Resource Name (ARN) that is associated with the Directory where both objects reside. For more information, see arns.

Parameter objectReference : Reference that identifies the object whose policy object will be detached.

Parameter policyReference : Reference that identifies the policy object.

Implementation

Future<void> detachPolicy({
  required String directoryArn,
  required ObjectReference objectReference,
  required ObjectReference policyReference,
}) async {
  ArgumentError.checkNotNull(directoryArn, 'directoryArn');
  ArgumentError.checkNotNull(objectReference, 'objectReference');
  ArgumentError.checkNotNull(policyReference, 'policyReference');
  final headers = <String, String>{
    'x-amz-data-partition': directoryArn.toString(),
  };
  final $payload = <String, dynamic>{
    'ObjectReference': objectReference,
    'PolicyReference': policyReference,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/amazonclouddirectory/2017-01-11/policy/detach',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}