ListStudiesResponse.fromJson constructor

ListStudiesResponse.fromJson(
  1. Object? j
)

Implementation

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