ListTrialsResponse.fromJson constructor

ListTrialsResponse.fromJson(
  1. Object? j
)

Implementation

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