ConsumedCapacity.fromJson constructor

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

Implementation

factory ConsumedCapacity.fromJson(Map<String, dynamic> json) {
  return ConsumedCapacity(
    capacityUnits: json['CapacityUnits'] as double?,
    globalSecondaryIndexes:
        (json['GlobalSecondaryIndexes'] as Map<String, dynamic>?)?.map(
            (k, e) =>
                MapEntry(k, Capacity.fromJson(e as Map<String, dynamic>))),
    localSecondaryIndexes:
        (json['LocalSecondaryIndexes'] as Map<String, dynamic>?)?.map(
            (k, e) =>
                MapEntry(k, Capacity.fromJson(e as Map<String, dynamic>))),
    readCapacityUnits: json['ReadCapacityUnits'] as double?,
    table: json['Table'] != null
        ? Capacity.fromJson(json['Table'] as Map<String, dynamic>)
        : null,
    tableName: json['TableName'] as String?,
    writeCapacityUnits: json['WriteCapacityUnits'] as double?,
  );
}