deleteAttributes method

Future<void> deleteAttributes({
  1. required String domainName,
  2. required String itemName,
  3. List<DeletableAttribute>? attributes,
  4. UpdateCondition? expected,
})

Deletes one or more attributes associated with an item. If all attributes of the item are deleted, the item is deleted. DeleteAttributes is an idempotent operation; running it multiple times on the same item or attribute does not result in an error response.

Because Amazon SimpleDB makes multiple copies of item data and uses an eventual consistency update model, performing a GetAttributes or Select operation (read) immediately after a DeleteAttributes or PutAttributes operation (write) might not return updated item data.

May throw InvalidParameterValue. May throw MissingParameter. May throw NoSuchDomain. May throw AttributeDoesNotExist.

Parameter domainName : The name of the domain in which to perform the operation.

Parameter itemName : The name of the item. Similar to rows on a spreadsheet, items represent individual objects that contain one or more value-attribute pairs.

Parameter attributes : A list of Attributes. Similar to columns on a spreadsheet, attributes represent categories of data that can be assigned to items.

Parameter expected : The update condition which, if specified, determines whether the specified attributes will be deleted or not. The update condition must be satisfied in order for this request to be processed and the attributes to be deleted.

Implementation

Future<void> deleteAttributes({
  required String domainName,
  required String itemName,
  List<DeletableAttribute>? attributes,
  UpdateCondition? expected,
}) async {
  ArgumentError.checkNotNull(domainName, 'domainName');
  ArgumentError.checkNotNull(itemName, 'itemName');
  final $request = <String, dynamic>{};
  $request['DomainName'] = domainName;
  $request['ItemName'] = itemName;
  attributes?.also((arg) => $request['Attributes'] = arg);
  expected?.also((arg) => $request['Expected'] = arg);
  await _protocol.send(
    $request,
    action: 'DeleteAttributes',
    version: '2009-04-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['DeleteAttributesRequest'],
    shapes: shapes,
  );
}