iamtheyammer

EntityBatchPreAuth.avsc

Jan 12th, 2019
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 16.60 KB | None | 0 0
  1. {
  2.   "namespace": "com.goguardian.events",
  3.   "type": "record",
  4.   "name": "EntityBatchPreAuth",
  5.   "doc": "Represents a batch of EntityPreAuths submitted by a single extension. There is a one-to-one mapping between this avro record and a kinesis record (i.e. the kinesis record payload contains JSON which we deserialize using this schema). Note that the kinesis record contains JSON and not serialized avro binary.",
  6.   "fields": [
  7.     {
  8.       "name": "type",
  9.       "type": {
  10.         "type": "enum",
  11.         "name": "KinesisRecordType",
  12.         "symbols": [
  13.           "ENTITIES"
  14.         ],
  15.         "doc": "What is the type of this kinesis record"
  16.       },
  17.       "default": "ENTITIES"
  18.     },
  19.     {
  20.       "name": "compRand",
  21.       "type": "string",
  22.       "doc": "The compRand from the extension"
  23.     },
  24.     {
  25.       "name": "submissionTime",
  26.       "type": "long",
  27.       "doc": "Epoch millis that this was submitted at"
  28.     },
  29.     {
  30.       "name": "extensionVersion",
  31.       "type": "string",
  32.       "doc": "The extension version (e.g. '2.0.2.9')"
  33.     },
  34.     {
  35.       "name": "userAgent",
  36.       "type": "string",
  37.       "doc": "The browser user agent"
  38.     },
  39.     {
  40.       "name": "ip",
  41.       "type": "long",
  42.       "doc": "The ipv4 represented as a long"
  43.     },
  44.     {
  45.       "name": "deviceId",
  46.       "type": [
  47.         "null",
  48.         "string"
  49.       ],
  50.       "default": null,
  51.       "doc": "The unique device identifier that this entity was written on"
  52.     },
  53.     {
  54.       "name": "payload",
  55.       "type": {
  56.         "type": "array",
  57.         "items": {
  58.           "type": "record",
  59.           "name": "EntityPreAuth",
  60.           "doc": "The pre-authenticated entity representation.",
  61.           "fields": [
  62.             {
  63.               "name": "seqId",
  64.               "type": "long",
  65.               "doc": "The entity sequence id according to the extension. Note this used to be an int before 8/14/2015"
  66.             },
  67.             {
  68.               "name": "url",
  69.               "type": "string",
  70.               "doc": "The URL that was visited"
  71.             },
  72.             {
  73.               "name": "flaggedActivity",
  74.               "type": {
  75.                 "type": "array",
  76.                 "items": {
  77.                   "type": "record",
  78.                   "name": "FlaggedActivityMetadata",
  79.                   "doc": "Metadata related to flagged activity",
  80.                   "fields": [
  81.                     {
  82.                       "name": "isNew",
  83.                       "type": "boolean",
  84.                       "doc": "Whether this metadata item is new"
  85.                     },
  86.                     {
  87.                       "name": "severity",
  88.                       "type": "double",
  89.                       "doc": "The extension-generated severity of this metadata"
  90.                     },
  91.                     {
  92.                       "name": "image",
  93.                       "type": [
  94.                         "null",
  95.                         "string"
  96.                       ],
  97.                       "default": null,
  98.                       "doc": "The UUID of the image associated with this flagged activity event this metadata"
  99.                     },
  100.                     {
  101.                       "name": "categoryId",
  102.                       "type": "int",
  103.                       "doc": "Category of this flagged activity, based on its flagged terms. E.g. pornography, drugs, etc."
  104.                     },
  105.                     {
  106.                       "name": "flags",
  107.                       "type": {
  108.                         "type": "array",
  109.                         "items": {
  110.                           "name": "FlaggedActivityMetadataFlag",
  111.                           "type": "record",
  112.                           "doc": "Represents a single flagged word",
  113.                           "fields": [
  114.                             {
  115.                               "name": "term",
  116.                               "type": "string",
  117.                               "doc": "The flagged word"
  118.                             },
  119.                             {
  120.                               "name": "count",
  121.                               "type": "int",
  122.                               "doc": "The number of times the word appears on the page "
  123.                             },
  124.                             {
  125.                               "name": "severity",
  126.                               "type": "double",
  127.                               "doc": "The default severity associated with the word"
  128.                             },
  129.                             {
  130.                               "name": "calculatedSeverity",
  131.                               "type": "double",
  132.                               "doc": "The computed severity of the word(s)"
  133.                             }
  134.                           ]
  135.                         }
  136.                       }
  137.                     }
  138.                   ]
  139.                 }
  140.               }
  141.             },
  142.             {
  143.               "name": "keyFlags",
  144.               "type": {
  145.                 "type": "array",
  146.                 "items": {
  147.                   "type": "record",
  148.                   "name": "KeyFlagMetadata",
  149.                   "doc": "Metadata related to key flags activity",
  150.                   "fields": [
  151.                     {
  152.                       "name": "isNew",
  153.                       "type": "boolean",
  154.                       "doc": "Whether this metadata item is new"
  155.                     },
  156.                     {
  157.                       "name": "needle",
  158.                       "type": {
  159.                         "type": "array",
  160.                         "items": {
  161.                           "type": "string",
  162.                           "name": "needleItem",
  163.                           "doc": "A keyflag needle found in this haystack"
  164.                         }
  165.                       },
  166.                       "doc": "An array of needles flagged in this haystack"
  167.                     },
  168.                     {
  169.                       "name": "haystack",
  170.                       "type": "string",
  171.                       "doc": "The context in which the needle was found"
  172.                     },
  173.                     {
  174.                       "name": "uuid",
  175.                       "type": "string",
  176.                       "doc": "A UUID corresponding to the input on the page. When the input changes, this UUID is regenerated"
  177.                     }
  178.                   ]
  179.                 }
  180.               }
  181.             },
  182.             {
  183.               "name": "searches",
  184.               "type": {
  185.                 "type": "array",
  186.                 "items": {
  187.                   "type": "record",
  188.                   "name": "SearchMetadata",
  189.                   "doc": "Metadata related to searches",
  190.                   "fields": [
  191.                     {
  192.                       "name": "isNew",
  193.                       "type": "boolean",
  194.                       "doc": "Whether this metadata item is new"
  195.                     },
  196.                     {
  197.                       "name": "searchTerms",
  198.                       "type": "string",
  199.                       "doc": "The terms that were searched"
  200.                     }
  201.                   ]
  202.                 }
  203.               }
  204.             },
  205.             {
  206.               "name": "videos",
  207.               "type": {
  208.                 "type": "array",
  209.                 "items": {
  210.                   "type": "record",
  211.                   "name": "VideoMetadata",
  212.                   "doc": "Metadata related to videos",
  213.                   "fields": [
  214.                     {
  215.                       "name": "isNew",
  216.                       "type": "boolean",
  217.                       "doc": "Whether this metadata item is new"
  218.                     },
  219.                     {
  220.                       "name": "title",
  221.                       "type": "string",
  222.                       "doc": "The title of the video"
  223.                     },
  224.                     {
  225.                       "name": "uploader",
  226.                       "type": "string",
  227.                       "doc": "The video uploader"
  228.                     },
  229.                     {
  230.                       "name": "categoryId",
  231.                       "type": "int",
  232.                       "doc": "The youtube category id"
  233.                     },
  234.                     {
  235.                       "name": "rating",
  236.                       "type": "int",
  237.                       "doc": "The youtube rating"
  238.                     },
  239.                     {
  240.                       "name": "description",
  241.                       "type": "string",
  242.                       "doc": "The description of the video"
  243.                     },
  244.                     {
  245.                       "name": "channelId",
  246.                       "type": "string",
  247.                       "doc": "The id of the youtube channel"
  248.                     },
  249.                     {
  250.                       "name": "category",
  251.                       "type": "string",
  252.                       "doc": "The verbose name of the category"
  253.                     },
  254.                     {
  255.                       "name": "uri",
  256.                       "type": "string",
  257.                       "doc": "The full youtube video URI"
  258.                     },
  259.                     {
  260.                       "name": "videoId",
  261.                       "type": "string",
  262.                       "doc": "The youtube video id"
  263.                     },
  264.                     {
  265.                       "name": "type",
  266.                       "type": {
  267.                         "type": "enum",
  268.                         "name": "VideoType",
  269.                         "symbols": [
  270.                           "YOUTUBE"
  271.                         ],
  272.                         "doc": "Where is this youtube video sourced from"
  273.                       }
  274.                     }
  275.                   ]
  276.                 }
  277.               }
  278.             },
  279.             {
  280.               "name": "docs",
  281.               "type": {
  282.                 "type": "array",
  283.                 "items": {
  284.                   "type": "record",
  285.                   "name": "DocMetadata",
  286.                   "doc": "Metadata related to docs",
  287.                   "fields": [
  288.                     {
  289.                       "name": "isNew",
  290.                       "type": "boolean",
  291.                       "doc": "Whether this metadata item is new"
  292.                     },
  293.                     {
  294.                       "name": "title",
  295.                       "type": "string",
  296.                       "doc": "The title of the document"
  297.                     }
  298.                   ]
  299.                 }
  300.               }
  301.             },
  302.             {
  303.               "name": "faviconUrl",
  304.               "type": [
  305.                 "null",
  306.                 "string"
  307.               ],
  308.               "default": null,
  309.               "doc": "The favicon url associated with this entity"
  310.             },
  311.             {
  312.               "name": "title",
  313.               "type": [
  314.                 "null",
  315.                 "string"
  316.               ],
  317.               "default": null,
  318.               "doc": "The title associated with this entity"
  319.             },
  320.             {
  321.               "name": "tabId",
  322.               "type": [
  323.                 "null",
  324.                 "int"
  325.               ],
  326.               "default": null,
  327.               "doc": "The tabId that this entity came from"
  328.             },
  329.             {
  330.               "name": "blockedSite",
  331.               "type": {
  332.                 "type": "array",
  333.                 "items": {
  334.                   "type": "record",
  335.                   "name": "BlockedMetadata",
  336.                   "doc": "Metadata related to blocked_sites",
  337.                   "fields": [
  338.                     {
  339.                       "name": "isNew",
  340.                       "type": [
  341.                         "null",
  342.                         "boolean"
  343.                       ],
  344.                       "default": null,
  345.                       "doc": "Whether this metadata item is new"
  346.                     },
  347.                     {
  348.                       "name": "categoryId",
  349.                       "type": "int",
  350.                       "doc": "The category id that blocked this entity"
  351.                     }
  352.                   ]
  353.                 }
  354.               },
  355.               "default": []
  356.             },
  357.             {
  358.               "name": "viewings",
  359.               "type": {
  360.                 "type": "array",
  361.                 "items": {
  362.                   "type": "record",
  363.                   "name": "ViewingMetadata",
  364.                   "doc": "Metadata related to viewings",
  365.                   "fields": [
  366.                     {
  367.                       "name": "startTimeMs",
  368.                       "type": "long",
  369.                       "doc": "The epoch timestamp when this viewing started"
  370.                     },
  371.                     {
  372.                       "name": "endTimeMs",
  373.                       "type": "long",
  374.                       "doc": "The epoch timestamp when this viewing ended"
  375.                     },
  376.                     {
  377.                       "name": "isDirty",
  378.                       "type": "boolean",
  379.                       "doc": "Whether this viewing needs to be updated/inserted in the database"
  380.                     },
  381.                     {
  382.                       "name": "lastSubmissionTimeMs",
  383.                       "type": [
  384.                         "null",
  385.                         "long"
  386.                       ],
  387.                       "default": null,
  388.                       "doc": "If present, represents the last time this viewing was sent to Kinesis"
  389.                     }
  390.                   ]
  391.                 }
  392.               },
  393.               "default": []
  394.             },
  395.             {
  396.               "name": "isNew",
  397.               "type": [
  398.                 "null",
  399.                 "boolean"
  400.               ],
  401.               "default": null,
  402.               "doc": "Represents whether this entity has been submitted to Kinesis before"
  403.             },
  404.             {
  405.               "name": "classroomIds",
  406.               "type": {
  407.                 "type": "array",
  408.                 "items": {
  409.                   "type": "int",
  410.                   "name": "classroomId",
  411.                   "doc": "A list of GG4T classroom IDs that this entity was generated in"
  412.                 }
  413.               },
  414.               "default": []
  415.             },
  416.             {
  417.               "name": "classroomSessionIds",
  418.               "type": {
  419.                 "type": "array",
  420.                 "items": {
  421.                   "type": "int",
  422.                   "name": "classroomSessionId",
  423.                   "doc": "A list of GG4T classroom session IDs that this entity was generated in"
  424.                 }
  425.               },
  426.               "default": []
  427.             },
  428.             {
  429.               "name": "isLocked",
  430.               "type": [
  431.                 "null",
  432.                 "boolean"
  433.               ],
  434.               "default": null,
  435.               "doc": "Represents whether the entity was generated in a locked state (GG4T)"
  436.             },
  437.             {
  438.               "name": "tabs",
  439.               "type": {
  440.                 "type": "array",
  441.                 "items": {
  442.                   "type": "record",
  443.                   "name": "TabMetadata",
  444.                   "doc": "Metadata related to open tabs",
  445.                   "fields": [
  446.                     {
  447.                       "name": "url",
  448.                       "type": "string",
  449.                       "doc": "The URL of the open tab"
  450.                     },
  451.                     {
  452.                       "name": "title",
  453.                       "type": "string",
  454.                       "doc": "The title of the open tab"
  455.                     },
  456.                     {
  457.                       "name": "faviconUrl",
  458.                       "type": "string",
  459.                       "doc": "The favicon url associated with this open tab"
  460.                     },
  461.                     {
  462.                       "name": "isActive",
  463.                       "type": "boolean",
  464.                       "doc": "Represents whether this tab is the active one"
  465.                     },
  466.                     {
  467.                       "name": "id",
  468.                       "type": "int",
  469.                       "doc": "A numeric identifier for this tab"
  470.                     }
  471.                   ]
  472.                 }
  473.               },
  474.               "default": [],
  475.               "doc": "An array representing the currently open tabs on the device (GG4T)"
  476.             },
  477.             {
  478.               "name": "isProxy",
  479.               "type": [
  480.                 "null",
  481.                 "boolean"
  482.               ],
  483.               "default": null,
  484.               "doc": "Whether this entity represents a proxy website"
  485.             }
  486.           ]
  487.         }
  488.       }
  489.     }
  490.   ]
  491. }
Advertisement
Add Comment
Please, Sign In to add comment