KeysAndAttributes.fromJson constructor

KeysAndAttributes.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory KeysAndAttributes.fromJson(Map<String, dynamic> json) {
  return KeysAndAttributes(
    keys: (json['Keys'] as List)
        .whereNotNull()
        .map((e) => (e as Map<String, dynamic>).map((k, e) =>
            MapEntry(k, AttributeValue.fromJson(e as Map<String, dynamic>))))
        .toList(),
    attributesToGet: (json['AttributesToGet'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    consistentRead: json['ConsistentRead'] as bool?,
    expressionAttributeNames:
        (json['ExpressionAttributeNames'] as Map<String, dynamic>?)
            ?.map((k, e) => MapEntry(k, e as String)),
    projectionExpression: json['ProjectionExpression'] as String?,
  );
}