ListChunksResponse.fromJson constructor

ListChunksResponse.fromJson(
  1. Object? j
)

Implementation

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