SearchPageResponseSearchResult.fromJson constructor

SearchPageResponseSearchResult.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory SearchPageResponseSearchResult.fromJson(Map<String, Object?> json) {
  return SearchPageResponseSearchResult(
    results: (json[r'results'] as List<Object?>?)
            ?.map((i) =>
                SearchResult.fromJson(i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    start: (json[r'start'] as num?)?.toInt() ?? 0,
    limit: (json[r'limit'] as num?)?.toInt() ?? 0,
    size: (json[r'size'] as num?)?.toInt() ?? 0,
    totalSize: (json[r'totalSize'] as num?)?.toInt() ?? 0,
    cqlQuery: json[r'cqlQuery'] as String? ?? '',
    searchDuration: (json[r'searchDuration'] as num?)?.toInt() ?? 0,
    archivedResultCount: (json[r'archivedResultCount'] as num?)?.toInt(),
    links: GenericLinks.fromJson(
        json[r'_links'] as Map<String, Object?>? ?? const {}),
  );
}