ReadIndexDatapointsRequest.fromJson constructor

ReadIndexDatapointsRequest.fromJson(
  1. Object? j
)

Implementation

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