detachObject method

Future<DetachObjectResponse> detachObject({
  1. required String directoryArn,
  2. required String linkName,
  3. required ObjectReference parentReference,
})

Detaches a given object from the parent object. The object that is to be detached from the parent is specified by the link name.

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

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

Parameter linkName : The link name associated with the object that needs to be detached.

Parameter parentReference : The parent reference from which the object with the specified link name is detached.

Implementation

Future<DetachObjectResponse> detachObject({
  required String directoryArn,
  required String linkName,
  required ObjectReference parentReference,
}) async {
  ArgumentError.checkNotNull(directoryArn, 'directoryArn');
  ArgumentError.checkNotNull(linkName, 'linkName');
  _s.validateStringLength(
    'linkName',
    linkName,
    1,
    64,
    isRequired: true,
  );
  ArgumentError.checkNotNull(parentReference, 'parentReference');
  final headers = <String, String>{
    'x-amz-data-partition': directoryArn.toString(),
  };
  final $payload = <String, dynamic>{
    'LinkName': linkName,
    'ParentReference': parentReference,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/amazonclouddirectory/2017-01-11/object/detach',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return DetachObjectResponse.fromJson(response);
}