BatchWriteResponse.fromJson constructor

BatchWriteResponse.fromJson(
  1. Object? j
)

Implementation

factory BatchWriteResponse.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return BatchWriteResponse(
    writeResults: switch (json['writeResults']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) WriteResult.fromJson(i)],
      _ => throw const FormatException('"writeResults" is not a list'),
    },
    status: switch (json['status']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Status.fromJson(i)],
      _ => throw const FormatException('"status" is not a list'),
    },
  );
}