• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5  margin: 0;
6  padding: 0;
7  border: 0;
8  font-weight: inherit;
9  font-style: inherit;
10  font-size: 100%;
11  font-family: inherit;
12  vertical-align: baseline;
13}
14
15body {
16  font-size: 13px;
17  padding: 1em;
18}
19
20h1 {
21  font-size: 26px;
22  margin-bottom: 1em;
23}
24
25h2 {
26  font-size: 24px;
27  margin-bottom: 1em;
28}
29
30h3 {
31  font-size: 20px;
32  margin-bottom: 1em;
33  margin-top: 1em;
34}
35
36pre, code {
37  line-height: 1.5;
38  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42  margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46  font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50  border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54  margin-top: 0.5em;
55}
56
57.firstline {
58  margin-left: 2 em;
59}
60
61.method  {
62  margin-top: 1em;
63  border: solid 1px #CCC;
64  padding: 1em;
65  background: #EEE;
66}
67
68.details {
69  font-weight: bold;
70  font-size: 14px;
71}
72
73</style>
74
75<h1><a href="safebrowsing_v4.html">Safe Browsing API</a> . <a href="safebrowsing_v4.threatListUpdates.html">threatListUpdates</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78  <code><a href="#fetch">fetch(body, x__xgafv=None)</a></code></p>
79<p class="firstline">Fetches the most recent threat list updates. A client can request updates</p>
80<h3>Method Details</h3>
81<div class="method">
82    <code class="details" id="fetch">fetch(body, x__xgafv=None)</code>
83  <pre>Fetches the most recent threat list updates. A client can request updates
84for multiple lists at once.
85
86Args:
87  body: object, The request body. (required)
88    The object takes the form of:
89
90{ # Describes a Safe Browsing API update request. Clients can request updates for
91      # multiple lists in a single request.
92      # NOTE: Field index 2 is unused.
93      # NEXT: 5
94    "client": { # The client metadata associated with Safe Browsing API requests. # The client metadata.
95      "clientVersion": "A String", # The version of the client implementation.
96      "clientId": "A String", # A client ID that (hopefully) uniquely identifies the client implementation
97          # of the Safe Browsing API.
98    },
99    "listUpdateRequests": [ # The requested threat list updates.
100      { # A single list update request.
101        "threatType": "A String", # The type of threat posed by entries present in the list.
102        "state": "A String", # The current state of the client for the requested list (the encrypted
103            # client state that was received from the last successful list update).
104        "threatEntryType": "A String", # The types of entries present in the list.
105        "platformType": "A String", # The type of platform at risk by entries present in the list.
106        "constraints": { # The constraints for this update. # The constraints associated with this request.
107          "language": "A String", # Requests the lists for a specific language. Expects ISO 639 alpha-2
108              # format.
109          "maxDatabaseEntries": 42, # Sets the maximum number of entries that the client is willing to have
110              # in the local database. This should be a power of 2 between 2**10 and
111              # 2**20. If zero, no database size limit is set.
112          "region": "A String", # Requests the list for a specific geographic location. If not set the
113              # server may pick that value based on the user's IP address. Expects ISO
114              # 3166-1 alpha-2 format.
115          "maxUpdateEntries": 42, # The maximum size in number of entries. The update will not contain more
116              # entries than this value.  This should be a power of 2 between 2**10 and
117              # 2**20.  If zero, no update size limit is set.
118          "supportedCompressions": [ # The compression types supported by the client.
119            "A String",
120          ],
121          "deviceLocation": "A String", # A client's physical location, expressed as a ISO 31166-1 alpha-2
122              # region code.
123        },
124      },
125    ],
126  }
127
128  x__xgafv: string, V1 error format.
129    Allowed values
130      1 - v1 error format
131      2 - v2 error format
132
133Returns:
134  An object of the form:
135
136    {
137    "listUpdateResponses": [ # The list updates requested by the clients.
138      { # An update to an individual list.
139        "responseType": "A String", # The type of response. This may indicate that an action is required by the
140            # client when the response is received.
141        "threatType": "A String", # The threat type for which data is returned.
142        "removals": [ # A set of entries to remove from a local threat type's list. In practice,
143            # this field is empty or contains exactly one ThreatEntrySet.
144          { # A set of threats that should be added or removed from a client's local
145              # database.
146            "compressionType": "A String", # The compression type for the entries in this set.
147            "rawIndices": { # A set of raw indices to remove from a local list. # The raw removal indices for a local list.
148              "indices": [ # The indices to remove from a lexicographically-sorted local list.
149                42,
150              ],
151            },
152            "rawHashes": { # The uncompressed threat entries in hash format of a particular prefix length. # The raw SHA256-formatted entries.
153                # Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4
154                # bytes, but some hashes are lengthened if they collide with the hash of a
155                # popular URL.
156                #
157                # Used for sending ThreatEntrySet to clients that do not support compression,
158                # or when sending non-4-byte hashes to clients that do support compression.
159              "prefixSize": 42, # The number of bytes for each prefix encoded below.  This field can be
160                  # anywhere from 4 (shortest prefix) to 32 (full SHA256 hash).
161              "rawHashes": "A String", # The hashes, in binary format, concatenated into one long string. Hashes are
162                  # sorted in lexicographic order. For JSON API users, hashes are
163                  # base64-encoded.
164            },
165            "riceHashes": { # The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or # The encoded 4-byte prefixes of SHA256-formatted entries, using a
166                # Golomb-Rice encoding. The hashes are converted to uint32, sorted in
167                # ascending order, then delta encoded and stored as encoded_data.
168                # compressed removal indices.
169              "riceParameter": 42, # The Golomb-Rice parameter, which is a number between 2 and 28. This field
170                  # is missing (that is, zero) if `num_entries` is zero.
171              "numEntries": 42, # The number of entries that are delta encoded in the encoded data. If only a
172                  # single integer was encoded, this will be zero and the single value will be
173                  # stored in `first_value`.
174              "encodedData": "A String", # The encoded deltas that are encoded using the Golomb-Rice coder.
175              "firstValue": "A String", # The offset of the first entry in the encoded data, or, if only a single
176                  # integer was encoded, that single integer's value. If the field is empty or
177                  # missing, assume zero.
178            },
179            "riceIndices": { # The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or # The encoded local, lexicographically-sorted list indices, using a
180                # Golomb-Rice encoding. Used for sending compressed removal indices. The
181                # removal indices (uint32) are sorted in ascending order, then delta encoded
182                # and stored as encoded_data.
183                # compressed removal indices.
184              "riceParameter": 42, # The Golomb-Rice parameter, which is a number between 2 and 28. This field
185                  # is missing (that is, zero) if `num_entries` is zero.
186              "numEntries": 42, # The number of entries that are delta encoded in the encoded data. If only a
187                  # single integer was encoded, this will be zero and the single value will be
188                  # stored in `first_value`.
189              "encodedData": "A String", # The encoded deltas that are encoded using the Golomb-Rice coder.
190              "firstValue": "A String", # The offset of the first entry in the encoded data, or, if only a single
191                  # integer was encoded, that single integer's value. If the field is empty or
192                  # missing, assume zero.
193            },
194          },
195        ],
196        "newClientState": "A String", # The new client state, in encrypted format. Opaque to clients.
197        "checksum": { # The expected state of a client's local database. # The expected SHA256 hash of the client state; that is, of the sorted list
198            # of all hashes present in the database after applying the provided update.
199            # If the client state doesn't match the expected state, the client must
200            # disregard this update and retry later.
201          "sha256": "A String", # The SHA256 hash of the client state; that is, of the sorted list of all
202              # hashes present in the database.
203        },
204        "threatEntryType": "A String", # The format of the threats.
205        "additions": [ # A set of entries to add to a local threat type's list. Repeated to allow
206            # for a combination of compressed and raw data to be sent in a single
207            # response.
208          { # A set of threats that should be added or removed from a client's local
209              # database.
210            "compressionType": "A String", # The compression type for the entries in this set.
211            "rawIndices": { # A set of raw indices to remove from a local list. # The raw removal indices for a local list.
212              "indices": [ # The indices to remove from a lexicographically-sorted local list.
213                42,
214              ],
215            },
216            "rawHashes": { # The uncompressed threat entries in hash format of a particular prefix length. # The raw SHA256-formatted entries.
217                # Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4
218                # bytes, but some hashes are lengthened if they collide with the hash of a
219                # popular URL.
220                #
221                # Used for sending ThreatEntrySet to clients that do not support compression,
222                # or when sending non-4-byte hashes to clients that do support compression.
223              "prefixSize": 42, # The number of bytes for each prefix encoded below.  This field can be
224                  # anywhere from 4 (shortest prefix) to 32 (full SHA256 hash).
225              "rawHashes": "A String", # The hashes, in binary format, concatenated into one long string. Hashes are
226                  # sorted in lexicographic order. For JSON API users, hashes are
227                  # base64-encoded.
228            },
229            "riceHashes": { # The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or # The encoded 4-byte prefixes of SHA256-formatted entries, using a
230                # Golomb-Rice encoding. The hashes are converted to uint32, sorted in
231                # ascending order, then delta encoded and stored as encoded_data.
232                # compressed removal indices.
233              "riceParameter": 42, # The Golomb-Rice parameter, which is a number between 2 and 28. This field
234                  # is missing (that is, zero) if `num_entries` is zero.
235              "numEntries": 42, # The number of entries that are delta encoded in the encoded data. If only a
236                  # single integer was encoded, this will be zero and the single value will be
237                  # stored in `first_value`.
238              "encodedData": "A String", # The encoded deltas that are encoded using the Golomb-Rice coder.
239              "firstValue": "A String", # The offset of the first entry in the encoded data, or, if only a single
240                  # integer was encoded, that single integer's value. If the field is empty or
241                  # missing, assume zero.
242            },
243            "riceIndices": { # The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or # The encoded local, lexicographically-sorted list indices, using a
244                # Golomb-Rice encoding. Used for sending compressed removal indices. The
245                # removal indices (uint32) are sorted in ascending order, then delta encoded
246                # and stored as encoded_data.
247                # compressed removal indices.
248              "riceParameter": 42, # The Golomb-Rice parameter, which is a number between 2 and 28. This field
249                  # is missing (that is, zero) if `num_entries` is zero.
250              "numEntries": 42, # The number of entries that are delta encoded in the encoded data. If only a
251                  # single integer was encoded, this will be zero and the single value will be
252                  # stored in `first_value`.
253              "encodedData": "A String", # The encoded deltas that are encoded using the Golomb-Rice coder.
254              "firstValue": "A String", # The offset of the first entry in the encoded data, or, if only a single
255                  # integer was encoded, that single integer's value. If the field is empty or
256                  # missing, assume zero.
257            },
258          },
259        ],
260        "platformType": "A String", # The platform type for which data is returned.
261      },
262    ],
263    "minimumWaitDuration": "A String", # The minimum duration the client must wait before issuing any update
264        # request. If this field is not set clients may update as soon as they want.
265  }</pre>
266</div>
267
268</body></html>