getAttributes method

Future<GetAttributesResult> getAttributes({
  1. required String domainName,
  2. required String itemName,
  3. List<String>? attributeNames,
  4. bool? consistentRead,
})

Returns all of the attributes associated with the specified item. Optionally, the attributes returned can be limited to one or more attributes by specifying an attribute name parameter.

If the item does not exist on the replica that was accessed for this operation, an empty set is returned. The system does not return an error as it cannot guarantee the item does not exist on other replicas.

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

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

Parameter itemName : The name of the item.

Parameter attributeNames : The names of the attributes.

Parameter consistentRead : Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If true, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.

Implementation

Future<GetAttributesResult> getAttributes({
  required String domainName,
  required String itemName,
  List<String>? attributeNames,
  bool? consistentRead,
}) async {
  ArgumentError.checkNotNull(domainName, 'domainName');
  ArgumentError.checkNotNull(itemName, 'itemName');
  final $request = <String, dynamic>{};
  $request['DomainName'] = domainName;
  $request['ItemName'] = itemName;
  attributeNames?.also((arg) => $request['AttributeNames'] = arg);
  consistentRead?.also((arg) => $request['ConsistentRead'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'GetAttributes',
    version: '2009-04-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['GetAttributesRequest'],
    shapes: shapes,
    resultWrapper: 'GetAttributesResult',
  );
  return GetAttributesResult.fromXml($result);
}