ReadIndexDatapointsResponse.fromJson constructor

ReadIndexDatapointsResponse.fromJson(
  1. Object? j
)

Implementation

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