deleteObject method

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

Deletes an object and its associated attributes. Only objects with no children and no parents can be deleted.

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

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

Parameter objectReference : A reference that identifies the object.

Implementation

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