ListDocumentsResponse.fromJson constructor

ListDocumentsResponse.fromJson(
  1. Object? j
)

Implementation

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