tile.proto 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. syntax = "proto3";
  5. option optimize_for = LITE_RUNTIME;
  6. package query_tiles.proto;
  7. // The Tile is the schema to represent data in entries.
  8. // Next tag: 7
  9. message Tile {
  10. // Metadata about the image.
  11. // Next tag: 2
  12. message ImageMetadata {
  13. // URL of the image.
  14. string url = 1;
  15. }
  16. // Unique id of a query tile entry.
  17. string id = 1;
  18. // Text of query that send to the search engine.
  19. string query_text = 2;
  20. // Text for accessibility purposes.
  21. string display_text = 3;
  22. // Counterpart of |display_text| for accessibility purposes.
  23. string accessibility_text = 4;
  24. // A list of image metadatas.
  25. repeated ImageMetadata image_metadatas = 5;
  26. // Sub level children.
  27. repeated Tile sub_tiles = 6;
  28. // Additional params for the search query.
  29. repeated string search_params = 7;
  30. }
  31. // Stats of the tile. Used for ranking tiles.
  32. // Next tag: 3
  33. message TileStats {
  34. // Timestamp when the tile is last clicked, in ms.
  35. int64 last_clicked_time_ms = 1;
  36. // Score of the tile, used for ranking.
  37. double score = 2;
  38. }
  39. // Data schema of a group of entries and its metadata.
  40. // Next tag: 6
  41. message TileGroup {
  42. // Unique id of each group.
  43. string id = 1;
  44. // Locale setting of this group.
  45. string locale = 2;
  46. // Last updated timestamp in ms;
  47. int64 last_updated_time_ms = 3;
  48. // Top level tiles;
  49. repeated Tile tiles = 4;
  50. // Map from tile id to its stats.
  51. map<string, TileStats> tile_stats = 5;
  52. }