OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.safebrowsing.v4; | 3 library googleapis.safebrowsing.v4; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
11 | 11 |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
13 ApiRequestError, DetailedApiRequestError; | 13 show ApiRequestError, DetailedApiRequestError; |
14 | 14 |
15 const core.String USER_AGENT = 'dart-api-client safebrowsing/v4'; | 15 const core.String USER_AGENT = 'dart-api-client safebrowsing/v4'; |
16 | 16 |
17 /** | 17 /// Enables client applications to check web resources (most commonly URLs) |
18 * Enables client applications to check web resources (most commonly URLs) | 18 /// against Google-generated lists of unsafe web resources. |
19 * against Google-generated lists of unsafe web resources. | |
20 */ | |
21 class SafebrowsingApi { | 19 class SafebrowsingApi { |
22 | |
23 final commons.ApiRequester _requester; | 20 final commons.ApiRequester _requester; |
24 | 21 |
25 EncodedFullHashesResourceApi get encodedFullHashes => new EncodedFullHashesRes
ourceApi(_requester); | 22 EncodedFullHashesResourceApi get encodedFullHashes => |
26 EncodedUpdatesResourceApi get encodedUpdates => new EncodedUpdatesResourceApi(
_requester); | 23 new EncodedFullHashesResourceApi(_requester); |
| 24 EncodedUpdatesResourceApi get encodedUpdates => |
| 25 new EncodedUpdatesResourceApi(_requester); |
27 FullHashesResourceApi get fullHashes => new FullHashesResourceApi(_requester); | 26 FullHashesResourceApi get fullHashes => new FullHashesResourceApi(_requester); |
28 ThreatListUpdatesResourceApi get threatListUpdates => new ThreatListUpdatesRes
ourceApi(_requester); | 27 ThreatListUpdatesResourceApi get threatListUpdates => |
29 ThreatListsResourceApi get threatLists => new ThreatListsResourceApi(_requeste
r); | 28 new ThreatListUpdatesResourceApi(_requester); |
30 ThreatMatchesResourceApi get threatMatches => new ThreatMatchesResourceApi(_re
quester); | 29 ThreatListsResourceApi get threatLists => |
| 30 new ThreatListsResourceApi(_requester); |
| 31 ThreatMatchesResourceApi get threatMatches => |
| 32 new ThreatMatchesResourceApi(_requester); |
31 | 33 |
32 SafebrowsingApi(http.Client client, {core.String rootUrl: "https://safebrowsin
g.googleapis.com/", core.String servicePath: ""}) : | 34 SafebrowsingApi(http.Client client, |
33 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 35 {core.String rootUrl: "https://safebrowsing.googleapis.com/", |
| 36 core.String servicePath: ""}) |
| 37 : _requester = |
| 38 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
34 } | 39 } |
35 | 40 |
36 | |
37 class EncodedFullHashesResourceApi { | 41 class EncodedFullHashesResourceApi { |
38 final commons.ApiRequester _requester; | 42 final commons.ApiRequester _requester; |
39 | 43 |
40 EncodedFullHashesResourceApi(commons.ApiRequester client) : | 44 EncodedFullHashesResourceApi(commons.ApiRequester client) |
41 _requester = client; | 45 : _requester = client; |
42 | 46 |
43 /** | 47 /// Request parameters: |
44 * Request parameters: | 48 /// |
45 * | 49 /// [encodedRequest] - A serialized FindFullHashesRequest proto. |
46 * [encodedRequest] - A serialized FindFullHashesRequest proto. | 50 /// |
47 * | 51 /// [clientVersion] - The version of the client implementation. |
48 * [clientId] - A client ID that (hopefully) uniquely identifies the client | 52 /// |
49 * implementation | 53 /// [clientId] - A client ID that (hopefully) uniquely identifies the client |
50 * of the Safe Browsing API. | 54 /// implementation |
51 * | 55 /// of the Safe Browsing API. |
52 * [clientVersion] - The version of the client implementation. | 56 /// |
53 * | 57 /// Completes with a [FindFullHashesResponse]. |
54 * Completes with a [FindFullHashesResponse]. | 58 /// |
55 * | 59 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
56 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 60 /// an error. |
57 * error. | 61 /// |
58 * | 62 /// If the used [http.Client] completes with an error when making a REST |
59 * If the used [http.Client] completes with an error when making a REST call, | 63 /// call, this method will complete with the same error. |
60 * this method will complete with the same error. | 64 async.Future<FindFullHashesResponse> get(core.String encodedRequest, |
61 */ | 65 {core.String clientVersion, core.String clientId}) { |
62 async.Future<FindFullHashesResponse> get(core.String encodedRequest, {core.Str
ing clientId, core.String clientVersion}) { | |
63 var _url = null; | 66 var _url = null; |
64 var _queryParams = new core.Map(); | 67 var _queryParams = new core.Map(); |
65 var _uploadMedia = null; | 68 var _uploadMedia = null; |
66 var _uploadOptions = null; | 69 var _uploadOptions = null; |
67 var _downloadOptions = commons.DownloadOptions.Metadata; | 70 var _downloadOptions = commons.DownloadOptions.Metadata; |
68 var _body = null; | 71 var _body = null; |
69 | 72 |
70 if (encodedRequest == null) { | 73 if (encodedRequest == null) { |
71 throw new core.ArgumentError("Parameter encodedRequest is required."); | 74 throw new core.ArgumentError("Parameter encodedRequest is required."); |
72 } | 75 } |
| 76 if (clientVersion != null) { |
| 77 _queryParams["clientVersion"] = [clientVersion]; |
| 78 } |
73 if (clientId != null) { | 79 if (clientId != null) { |
74 _queryParams["clientId"] = [clientId]; | 80 _queryParams["clientId"] = [clientId]; |
75 } | 81 } |
76 if (clientVersion != null) { | |
77 _queryParams["clientVersion"] = [clientVersion]; | |
78 } | |
79 | 82 |
80 _url = 'v4/encodedFullHashes/' + commons.Escaper.ecapeVariable('$encodedRequ
est'); | 83 _url = 'v4/encodedFullHashes/' + |
| 84 commons.Escaper.ecapeVariable('$encodedRequest'); |
81 | 85 |
82 var _response = _requester.request(_url, | 86 var _response = _requester.request(_url, "GET", |
83 "GET", | 87 body: _body, |
84 body: _body, | 88 queryParams: _queryParams, |
85 queryParams: _queryParams, | 89 uploadOptions: _uploadOptions, |
86 uploadOptions: _uploadOptions, | 90 uploadMedia: _uploadMedia, |
87 uploadMedia: _uploadMedia, | 91 downloadOptions: _downloadOptions); |
88 downloadOptions: _downloadOptions); | |
89 return _response.then((data) => new FindFullHashesResponse.fromJson(data)); | 92 return _response.then((data) => new FindFullHashesResponse.fromJson(data)); |
90 } | 93 } |
91 | |
92 } | 94 } |
93 | 95 |
94 | |
95 class EncodedUpdatesResourceApi { | 96 class EncodedUpdatesResourceApi { |
96 final commons.ApiRequester _requester; | 97 final commons.ApiRequester _requester; |
97 | 98 |
98 EncodedUpdatesResourceApi(commons.ApiRequester client) : | 99 EncodedUpdatesResourceApi(commons.ApiRequester client) : _requester = client; |
99 _requester = client; | |
100 | 100 |
101 /** | 101 /// Request parameters: |
102 * Request parameters: | 102 /// |
103 * | 103 /// [encodedRequest] - A serialized FetchThreatListUpdatesRequest proto. |
104 * [encodedRequest] - A serialized FetchThreatListUpdatesRequest proto. | 104 /// |
105 * | 105 /// [clientId] - A client ID that uniquely identifies the client |
106 * [clientId] - A client ID that uniquely identifies the client implementation | 106 /// implementation of the Safe |
107 * of the Safe | 107 /// Browsing API. |
108 * Browsing API. | 108 /// |
109 * | 109 /// [clientVersion] - The version of the client implementation. |
110 * [clientVersion] - The version of the client implementation. | 110 /// |
111 * | 111 /// Completes with a [FetchThreatListUpdatesResponse]. |
112 * Completes with a [FetchThreatListUpdatesResponse]. | 112 /// |
113 * | 113 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
114 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 114 /// an error. |
115 * error. | 115 /// |
116 * | 116 /// If the used [http.Client] completes with an error when making a REST |
117 * If the used [http.Client] completes with an error when making a REST call, | 117 /// call, this method will complete with the same error. |
118 * this method will complete with the same error. | 118 async.Future<FetchThreatListUpdatesResponse> get(core.String encodedRequest, |
119 */ | 119 {core.String clientId, core.String clientVersion}) { |
120 async.Future<FetchThreatListUpdatesResponse> get(core.String encodedRequest, {
core.String clientId, core.String clientVersion}) { | |
121 var _url = null; | 120 var _url = null; |
122 var _queryParams = new core.Map(); | 121 var _queryParams = new core.Map(); |
123 var _uploadMedia = null; | 122 var _uploadMedia = null; |
124 var _uploadOptions = null; | 123 var _uploadOptions = null; |
125 var _downloadOptions = commons.DownloadOptions.Metadata; | 124 var _downloadOptions = commons.DownloadOptions.Metadata; |
126 var _body = null; | 125 var _body = null; |
127 | 126 |
128 if (encodedRequest == null) { | 127 if (encodedRequest == null) { |
129 throw new core.ArgumentError("Parameter encodedRequest is required."); | 128 throw new core.ArgumentError("Parameter encodedRequest is required."); |
130 } | 129 } |
131 if (clientId != null) { | 130 if (clientId != null) { |
132 _queryParams["clientId"] = [clientId]; | 131 _queryParams["clientId"] = [clientId]; |
133 } | 132 } |
134 if (clientVersion != null) { | 133 if (clientVersion != null) { |
135 _queryParams["clientVersion"] = [clientVersion]; | 134 _queryParams["clientVersion"] = [clientVersion]; |
136 } | 135 } |
137 | 136 |
138 _url = 'v4/encodedUpdates/' + commons.Escaper.ecapeVariable('$encodedRequest
'); | 137 _url = |
| 138 'v4/encodedUpdates/' + commons.Escaper.ecapeVariable('$encodedRequest'); |
139 | 139 |
140 var _response = _requester.request(_url, | 140 var _response = _requester.request(_url, "GET", |
141 "GET", | 141 body: _body, |
142 body: _body, | 142 queryParams: _queryParams, |
143 queryParams: _queryParams, | 143 uploadOptions: _uploadOptions, |
144 uploadOptions: _uploadOptions, | 144 uploadMedia: _uploadMedia, |
145 uploadMedia: _uploadMedia, | 145 downloadOptions: _downloadOptions); |
146 downloadOptions: _downloadOptions); | 146 return _response |
147 return _response.then((data) => new FetchThreatListUpdatesResponse.fromJson(
data)); | 147 .then((data) => new FetchThreatListUpdatesResponse.fromJson(data)); |
148 } | 148 } |
149 | |
150 } | 149 } |
151 | 150 |
152 | |
153 class FullHashesResourceApi { | 151 class FullHashesResourceApi { |
154 final commons.ApiRequester _requester; | 152 final commons.ApiRequester _requester; |
155 | 153 |
156 FullHashesResourceApi(commons.ApiRequester client) : | 154 FullHashesResourceApi(commons.ApiRequester client) : _requester = client; |
157 _requester = client; | |
158 | 155 |
159 /** | 156 /// Finds the full hashes that match the requested hash prefixes. |
160 * Finds the full hashes that match the requested hash prefixes. | 157 /// |
161 * | 158 /// [request] - The metadata request object. |
162 * [request] - The metadata request object. | 159 /// |
163 * | 160 /// Request parameters: |
164 * Request parameters: | 161 /// |
165 * | 162 /// Completes with a [FindFullHashesResponse]. |
166 * Completes with a [FindFullHashesResponse]. | 163 /// |
167 * | 164 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
168 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 165 /// an error. |
169 * error. | 166 /// |
170 * | 167 /// If the used [http.Client] completes with an error when making a REST |
171 * If the used [http.Client] completes with an error when making a REST call, | 168 /// call, this method will complete with the same error. |
172 * this method will complete with the same error. | |
173 */ | |
174 async.Future<FindFullHashesResponse> find(FindFullHashesRequest request) { | 169 async.Future<FindFullHashesResponse> find(FindFullHashesRequest request) { |
175 var _url = null; | 170 var _url = null; |
176 var _queryParams = new core.Map(); | 171 var _queryParams = new core.Map(); |
177 var _uploadMedia = null; | 172 var _uploadMedia = null; |
178 var _uploadOptions = null; | 173 var _uploadOptions = null; |
179 var _downloadOptions = commons.DownloadOptions.Metadata; | 174 var _downloadOptions = commons.DownloadOptions.Metadata; |
180 var _body = null; | 175 var _body = null; |
181 | 176 |
182 if (request != null) { | 177 if (request != null) { |
183 _body = convert.JSON.encode((request).toJson()); | 178 _body = convert.JSON.encode((request).toJson()); |
184 } | 179 } |
185 | 180 |
186 _url = 'v4/fullHashes:find'; | 181 _url = 'v4/fullHashes:find'; |
187 | 182 |
188 var _response = _requester.request(_url, | 183 var _response = _requester.request(_url, "POST", |
189 "POST", | 184 body: _body, |
190 body: _body, | 185 queryParams: _queryParams, |
191 queryParams: _queryParams, | 186 uploadOptions: _uploadOptions, |
192 uploadOptions: _uploadOptions, | 187 uploadMedia: _uploadMedia, |
193 uploadMedia: _uploadMedia, | 188 downloadOptions: _downloadOptions); |
194 downloadOptions: _downloadOptions); | |
195 return _response.then((data) => new FindFullHashesResponse.fromJson(data)); | 189 return _response.then((data) => new FindFullHashesResponse.fromJson(data)); |
196 } | 190 } |
197 | |
198 } | 191 } |
199 | 192 |
200 | |
201 class ThreatListUpdatesResourceApi { | 193 class ThreatListUpdatesResourceApi { |
202 final commons.ApiRequester _requester; | 194 final commons.ApiRequester _requester; |
203 | 195 |
204 ThreatListUpdatesResourceApi(commons.ApiRequester client) : | 196 ThreatListUpdatesResourceApi(commons.ApiRequester client) |
205 _requester = client; | 197 : _requester = client; |
206 | 198 |
207 /** | 199 /// Fetches the most recent threat list updates. A client can request updates |
208 * Fetches the most recent threat list updates. A client can request updates | 200 /// for multiple lists at once. |
209 * for multiple lists at once. | 201 /// |
210 * | 202 /// [request] - The metadata request object. |
211 * [request] - The metadata request object. | 203 /// |
212 * | 204 /// Request parameters: |
213 * Request parameters: | 205 /// |
214 * | 206 /// Completes with a [FetchThreatListUpdatesResponse]. |
215 * Completes with a [FetchThreatListUpdatesResponse]. | 207 /// |
216 * | 208 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
217 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 209 /// an error. |
218 * error. | 210 /// |
219 * | 211 /// If the used [http.Client] completes with an error when making a REST |
220 * If the used [http.Client] completes with an error when making a REST call, | 212 /// call, this method will complete with the same error. |
221 * this method will complete with the same error. | 213 async.Future<FetchThreatListUpdatesResponse> fetch( |
222 */ | 214 FetchThreatListUpdatesRequest request) { |
223 async.Future<FetchThreatListUpdatesResponse> fetch(FetchThreatListUpdatesReque
st request) { | |
224 var _url = null; | 215 var _url = null; |
225 var _queryParams = new core.Map(); | 216 var _queryParams = new core.Map(); |
226 var _uploadMedia = null; | 217 var _uploadMedia = null; |
227 var _uploadOptions = null; | 218 var _uploadOptions = null; |
228 var _downloadOptions = commons.DownloadOptions.Metadata; | 219 var _downloadOptions = commons.DownloadOptions.Metadata; |
229 var _body = null; | 220 var _body = null; |
230 | 221 |
231 if (request != null) { | 222 if (request != null) { |
232 _body = convert.JSON.encode((request).toJson()); | 223 _body = convert.JSON.encode((request).toJson()); |
233 } | 224 } |
234 | 225 |
235 _url = 'v4/threatListUpdates:fetch'; | 226 _url = 'v4/threatListUpdates:fetch'; |
236 | 227 |
237 var _response = _requester.request(_url, | 228 var _response = _requester.request(_url, "POST", |
238 "POST", | 229 body: _body, |
239 body: _body, | 230 queryParams: _queryParams, |
240 queryParams: _queryParams, | 231 uploadOptions: _uploadOptions, |
241 uploadOptions: _uploadOptions, | 232 uploadMedia: _uploadMedia, |
242 uploadMedia: _uploadMedia, | 233 downloadOptions: _downloadOptions); |
243 downloadOptions: _downloadOptions); | 234 return _response |
244 return _response.then((data) => new FetchThreatListUpdatesResponse.fromJson(
data)); | 235 .then((data) => new FetchThreatListUpdatesResponse.fromJson(data)); |
245 } | 236 } |
246 | |
247 } | 237 } |
248 | 238 |
249 | |
250 class ThreatListsResourceApi { | 239 class ThreatListsResourceApi { |
251 final commons.ApiRequester _requester; | 240 final commons.ApiRequester _requester; |
252 | 241 |
253 ThreatListsResourceApi(commons.ApiRequester client) : | 242 ThreatListsResourceApi(commons.ApiRequester client) : _requester = client; |
254 _requester = client; | |
255 | 243 |
256 /** | 244 /// Lists the Safe Browsing threat lists available for download. |
257 * Lists the Safe Browsing threat lists available for download. | 245 /// |
258 * | 246 /// Request parameters: |
259 * Request parameters: | 247 /// |
260 * | 248 /// Completes with a [ListThreatListsResponse]. |
261 * Completes with a [ListThreatListsResponse]. | 249 /// |
262 * | 250 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
263 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 251 /// an error. |
264 * error. | 252 /// |
265 * | 253 /// If the used [http.Client] completes with an error when making a REST |
266 * If the used [http.Client] completes with an error when making a REST call, | 254 /// call, this method will complete with the same error. |
267 * this method will complete with the same error. | |
268 */ | |
269 async.Future<ListThreatListsResponse> list() { | 255 async.Future<ListThreatListsResponse> list() { |
270 var _url = null; | 256 var _url = null; |
271 var _queryParams = new core.Map(); | 257 var _queryParams = new core.Map(); |
272 var _uploadMedia = null; | 258 var _uploadMedia = null; |
273 var _uploadOptions = null; | 259 var _uploadOptions = null; |
274 var _downloadOptions = commons.DownloadOptions.Metadata; | 260 var _downloadOptions = commons.DownloadOptions.Metadata; |
275 var _body = null; | 261 var _body = null; |
276 | 262 |
277 | |
278 _url = 'v4/threatLists'; | 263 _url = 'v4/threatLists'; |
279 | 264 |
280 var _response = _requester.request(_url, | 265 var _response = _requester.request(_url, "GET", |
281 "GET", | 266 body: _body, |
282 body: _body, | 267 queryParams: _queryParams, |
283 queryParams: _queryParams, | 268 uploadOptions: _uploadOptions, |
284 uploadOptions: _uploadOptions, | 269 uploadMedia: _uploadMedia, |
285 uploadMedia: _uploadMedia, | 270 downloadOptions: _downloadOptions); |
286 downloadOptions: _downloadOptions); | |
287 return _response.then((data) => new ListThreatListsResponse.fromJson(data)); | 271 return _response.then((data) => new ListThreatListsResponse.fromJson(data)); |
288 } | 272 } |
289 | |
290 } | 273 } |
291 | 274 |
292 | |
293 class ThreatMatchesResourceApi { | 275 class ThreatMatchesResourceApi { |
294 final commons.ApiRequester _requester; | 276 final commons.ApiRequester _requester; |
295 | 277 |
296 ThreatMatchesResourceApi(commons.ApiRequester client) : | 278 ThreatMatchesResourceApi(commons.ApiRequester client) : _requester = client; |
297 _requester = client; | |
298 | 279 |
299 /** | 280 /// Finds the threat entries that match the Safe Browsing lists. |
300 * Finds the threat entries that match the Safe Browsing lists. | 281 /// |
301 * | 282 /// [request] - The metadata request object. |
302 * [request] - The metadata request object. | 283 /// |
303 * | 284 /// Request parameters: |
304 * Request parameters: | 285 /// |
305 * | 286 /// Completes with a [FindThreatMatchesResponse]. |
306 * Completes with a [FindThreatMatchesResponse]. | 287 /// |
307 * | 288 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
308 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 289 /// an error. |
309 * error. | 290 /// |
310 * | 291 /// If the used [http.Client] completes with an error when making a REST |
311 * If the used [http.Client] completes with an error when making a REST call, | 292 /// call, this method will complete with the same error. |
312 * this method will complete with the same error. | 293 async.Future<FindThreatMatchesResponse> find( |
313 */ | 294 FindThreatMatchesRequest request) { |
314 async.Future<FindThreatMatchesResponse> find(FindThreatMatchesRequest request)
{ | |
315 var _url = null; | 295 var _url = null; |
316 var _queryParams = new core.Map(); | 296 var _queryParams = new core.Map(); |
317 var _uploadMedia = null; | 297 var _uploadMedia = null; |
318 var _uploadOptions = null; | 298 var _uploadOptions = null; |
319 var _downloadOptions = commons.DownloadOptions.Metadata; | 299 var _downloadOptions = commons.DownloadOptions.Metadata; |
320 var _body = null; | 300 var _body = null; |
321 | 301 |
322 if (request != null) { | 302 if (request != null) { |
323 _body = convert.JSON.encode((request).toJson()); | 303 _body = convert.JSON.encode((request).toJson()); |
324 } | 304 } |
325 | 305 |
326 _url = 'v4/threatMatches:find'; | 306 _url = 'v4/threatMatches:find'; |
327 | 307 |
328 var _response = _requester.request(_url, | 308 var _response = _requester.request(_url, "POST", |
329 "POST", | 309 body: _body, |
330 body: _body, | 310 queryParams: _queryParams, |
331 queryParams: _queryParams, | 311 uploadOptions: _uploadOptions, |
332 uploadOptions: _uploadOptions, | 312 uploadMedia: _uploadMedia, |
333 uploadMedia: _uploadMedia, | 313 downloadOptions: _downloadOptions); |
334 downloadOptions: _downloadOptions); | 314 return _response |
335 return _response.then((data) => new FindThreatMatchesResponse.fromJson(data)
); | 315 .then((data) => new FindThreatMatchesResponse.fromJson(data)); |
336 } | 316 } |
337 | |
338 } | 317 } |
339 | 318 |
340 | 319 /// The expected state of a client's local database. |
341 | |
342 /** The expected state of a client's local database. */ | |
343 class Checksum { | 320 class Checksum { |
344 /** | 321 /// The SHA256 hash of the client state; that is, of the sorted list of all |
345 * The SHA256 hash of the client state; that is, of the sorted list of all | 322 /// hashes present in the database. |
346 * hashes present in the database. | |
347 */ | |
348 core.String sha256; | 323 core.String sha256; |
349 core.List<core.int> get sha256AsBytes { | 324 core.List<core.int> get sha256AsBytes { |
350 return convert.BASE64.decode(sha256); | 325 return convert.BASE64.decode(sha256); |
351 } | 326 } |
352 | 327 |
353 void set sha256AsBytes(core.List<core.int> _bytes) { | 328 void set sha256AsBytes(core.List<core.int> _bytes) { |
354 sha256 = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+",
"-"); | 329 sha256 = |
| 330 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
355 } | 331 } |
356 | 332 |
357 Checksum(); | 333 Checksum(); |
358 | 334 |
359 Checksum.fromJson(core.Map _json) { | 335 Checksum.fromJson(core.Map _json) { |
360 if (_json.containsKey("sha256")) { | 336 if (_json.containsKey("sha256")) { |
361 sha256 = _json["sha256"]; | 337 sha256 = _json["sha256"]; |
362 } | 338 } |
363 } | 339 } |
364 | 340 |
365 core.Map<core.String, core.Object> toJson() { | 341 core.Map<core.String, core.Object> toJson() { |
366 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 342 final core.Map<core.String, core.Object> _json = |
| 343 new core.Map<core.String, core.Object>(); |
367 if (sha256 != null) { | 344 if (sha256 != null) { |
368 _json["sha256"] = sha256; | 345 _json["sha256"] = sha256; |
369 } | 346 } |
370 return _json; | 347 return _json; |
371 } | 348 } |
372 } | 349 } |
373 | 350 |
374 /** The client metadata associated with Safe Browsing API requests. */ | 351 /// The client metadata associated with Safe Browsing API requests. |
375 class ClientInfo { | 352 class ClientInfo { |
376 /** | 353 /// A client ID that (hopefully) uniquely identifies the client |
377 * A client ID that (hopefully) uniquely identifies the client implementation | 354 /// implementation |
378 * of the Safe Browsing API. | 355 /// of the Safe Browsing API. |
379 */ | |
380 core.String clientId; | 356 core.String clientId; |
381 /** The version of the client implementation. */ | 357 |
| 358 /// The version of the client implementation. |
382 core.String clientVersion; | 359 core.String clientVersion; |
383 | 360 |
384 ClientInfo(); | 361 ClientInfo(); |
385 | 362 |
386 ClientInfo.fromJson(core.Map _json) { | 363 ClientInfo.fromJson(core.Map _json) { |
387 if (_json.containsKey("clientId")) { | 364 if (_json.containsKey("clientId")) { |
388 clientId = _json["clientId"]; | 365 clientId = _json["clientId"]; |
389 } | 366 } |
390 if (_json.containsKey("clientVersion")) { | 367 if (_json.containsKey("clientVersion")) { |
391 clientVersion = _json["clientVersion"]; | 368 clientVersion = _json["clientVersion"]; |
392 } | 369 } |
393 } | 370 } |
394 | 371 |
395 core.Map<core.String, core.Object> toJson() { | 372 core.Map<core.String, core.Object> toJson() { |
396 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 373 final core.Map<core.String, core.Object> _json = |
| 374 new core.Map<core.String, core.Object>(); |
397 if (clientId != null) { | 375 if (clientId != null) { |
398 _json["clientId"] = clientId; | 376 _json["clientId"] = clientId; |
399 } | 377 } |
400 if (clientVersion != null) { | 378 if (clientVersion != null) { |
401 _json["clientVersion"] = clientVersion; | 379 _json["clientVersion"] = clientVersion; |
402 } | 380 } |
403 return _json; | 381 return _json; |
404 } | 382 } |
405 } | 383 } |
406 | 384 |
407 /** The constraints for this update. */ | 385 /// The constraints for this update. |
408 class Constraints { | 386 class Constraints { |
409 /** | 387 /// Sets the maximum number of entries that the client is willing to have |
410 * Sets the maximum number of entries that the client is willing to have | 388 /// in the local database. This should be a power of 2 between 2**10 and |
411 * in the local database. This should be a power of 2 between 2**10 and | 389 /// 2**20. If zero, no database size limit is set. |
412 * 2**20. If zero, no database size limit is set. | |
413 */ | |
414 core.int maxDatabaseEntries; | 390 core.int maxDatabaseEntries; |
415 /** | 391 |
416 * The maximum size in number of entries. The update will not contain more | 392 /// The maximum size in number of entries. The update will not contain more |
417 * entries than this value. This should be a power of 2 between 2**10 and | 393 /// entries than this value. This should be a power of 2 between 2**10 and |
418 * 2**20. If zero, no update size limit is set. | 394 /// 2**20. If zero, no update size limit is set. |
419 */ | |
420 core.int maxUpdateEntries; | 395 core.int maxUpdateEntries; |
421 /** | 396 |
422 * Requests the list for a specific geographic location. If not set the | 397 /// Requests the list for a specific geographic location. If not set the |
423 * server may pick that value based on the user's IP address. Expects ISO | 398 /// server may pick that value based on the user's IP address. Expects ISO |
424 * 3166-1 alpha-2 format. | 399 /// 3166-1 alpha-2 format. |
425 */ | |
426 core.String region; | 400 core.String region; |
427 /** The compression types supported by the client. */ | 401 |
| 402 /// The compression types supported by the client. |
428 core.List<core.String> supportedCompressions; | 403 core.List<core.String> supportedCompressions; |
429 | 404 |
430 Constraints(); | 405 Constraints(); |
431 | 406 |
432 Constraints.fromJson(core.Map _json) { | 407 Constraints.fromJson(core.Map _json) { |
433 if (_json.containsKey("maxDatabaseEntries")) { | 408 if (_json.containsKey("maxDatabaseEntries")) { |
434 maxDatabaseEntries = _json["maxDatabaseEntries"]; | 409 maxDatabaseEntries = _json["maxDatabaseEntries"]; |
435 } | 410 } |
436 if (_json.containsKey("maxUpdateEntries")) { | 411 if (_json.containsKey("maxUpdateEntries")) { |
437 maxUpdateEntries = _json["maxUpdateEntries"]; | 412 maxUpdateEntries = _json["maxUpdateEntries"]; |
438 } | 413 } |
439 if (_json.containsKey("region")) { | 414 if (_json.containsKey("region")) { |
440 region = _json["region"]; | 415 region = _json["region"]; |
441 } | 416 } |
442 if (_json.containsKey("supportedCompressions")) { | 417 if (_json.containsKey("supportedCompressions")) { |
443 supportedCompressions = _json["supportedCompressions"]; | 418 supportedCompressions = _json["supportedCompressions"]; |
444 } | 419 } |
445 } | 420 } |
446 | 421 |
447 core.Map<core.String, core.Object> toJson() { | 422 core.Map<core.String, core.Object> toJson() { |
448 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 423 final core.Map<core.String, core.Object> _json = |
| 424 new core.Map<core.String, core.Object>(); |
449 if (maxDatabaseEntries != null) { | 425 if (maxDatabaseEntries != null) { |
450 _json["maxDatabaseEntries"] = maxDatabaseEntries; | 426 _json["maxDatabaseEntries"] = maxDatabaseEntries; |
451 } | 427 } |
452 if (maxUpdateEntries != null) { | 428 if (maxUpdateEntries != null) { |
453 _json["maxUpdateEntries"] = maxUpdateEntries; | 429 _json["maxUpdateEntries"] = maxUpdateEntries; |
454 } | 430 } |
455 if (region != null) { | 431 if (region != null) { |
456 _json["region"] = region; | 432 _json["region"] = region; |
457 } | 433 } |
458 if (supportedCompressions != null) { | 434 if (supportedCompressions != null) { |
459 _json["supportedCompressions"] = supportedCompressions; | 435 _json["supportedCompressions"] = supportedCompressions; |
460 } | 436 } |
461 return _json; | 437 return _json; |
462 } | 438 } |
463 } | 439 } |
464 | 440 |
465 /** | 441 /// Describes a Safe Browsing API update request. Clients can request updates |
466 * Describes a Safe Browsing API update request. Clients can request updates for | 442 /// for |
467 * multiple lists in a single request. | 443 /// multiple lists in a single request. |
468 * NOTE: Field index 2 is unused. | 444 /// NOTE: Field index 2 is unused. |
469 * NEXT: 5 | 445 /// NEXT: 5 |
470 */ | |
471 class FetchThreatListUpdatesRequest { | 446 class FetchThreatListUpdatesRequest { |
472 /** The client metadata. */ | 447 /// The client metadata. |
473 ClientInfo client; | 448 ClientInfo client; |
474 /** The requested threat list updates. */ | 449 |
| 450 /// The requested threat list updates. |
475 core.List<ListUpdateRequest> listUpdateRequests; | 451 core.List<ListUpdateRequest> listUpdateRequests; |
476 | 452 |
477 FetchThreatListUpdatesRequest(); | 453 FetchThreatListUpdatesRequest(); |
478 | 454 |
479 FetchThreatListUpdatesRequest.fromJson(core.Map _json) { | 455 FetchThreatListUpdatesRequest.fromJson(core.Map _json) { |
480 if (_json.containsKey("client")) { | 456 if (_json.containsKey("client")) { |
481 client = new ClientInfo.fromJson(_json["client"]); | 457 client = new ClientInfo.fromJson(_json["client"]); |
482 } | 458 } |
483 if (_json.containsKey("listUpdateRequests")) { | 459 if (_json.containsKey("listUpdateRequests")) { |
484 listUpdateRequests = _json["listUpdateRequests"].map((value) => new ListUp
dateRequest.fromJson(value)).toList(); | 460 listUpdateRequests = _json["listUpdateRequests"] |
| 461 .map((value) => new ListUpdateRequest.fromJson(value)) |
| 462 .toList(); |
485 } | 463 } |
486 } | 464 } |
487 | 465 |
488 core.Map<core.String, core.Object> toJson() { | 466 core.Map<core.String, core.Object> toJson() { |
489 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 467 final core.Map<core.String, core.Object> _json = |
| 468 new core.Map<core.String, core.Object>(); |
490 if (client != null) { | 469 if (client != null) { |
491 _json["client"] = (client).toJson(); | 470 _json["client"] = (client).toJson(); |
492 } | 471 } |
493 if (listUpdateRequests != null) { | 472 if (listUpdateRequests != null) { |
494 _json["listUpdateRequests"] = listUpdateRequests.map((value) => (value).to
Json()).toList(); | 473 _json["listUpdateRequests"] = |
| 474 listUpdateRequests.map((value) => (value).toJson()).toList(); |
495 } | 475 } |
496 return _json; | 476 return _json; |
497 } | 477 } |
498 } | 478 } |
499 | 479 |
500 class FetchThreatListUpdatesResponse { | 480 class FetchThreatListUpdatesResponse { |
501 /** The list updates requested by the clients. */ | 481 /// The list updates requested by the clients. |
502 core.List<ListUpdateResponse> listUpdateResponses; | 482 core.List<ListUpdateResponse> listUpdateResponses; |
503 /** | 483 |
504 * The minimum duration the client must wait before issuing any update | 484 /// The minimum duration the client must wait before issuing any update |
505 * request. If this field is not set clients may update as soon as they want. | 485 /// request. If this field is not set clients may update as soon as they |
506 */ | 486 /// want. |
507 core.String minimumWaitDuration; | 487 core.String minimumWaitDuration; |
508 | 488 |
509 FetchThreatListUpdatesResponse(); | 489 FetchThreatListUpdatesResponse(); |
510 | 490 |
511 FetchThreatListUpdatesResponse.fromJson(core.Map _json) { | 491 FetchThreatListUpdatesResponse.fromJson(core.Map _json) { |
512 if (_json.containsKey("listUpdateResponses")) { | 492 if (_json.containsKey("listUpdateResponses")) { |
513 listUpdateResponses = _json["listUpdateResponses"].map((value) => new List
UpdateResponse.fromJson(value)).toList(); | 493 listUpdateResponses = _json["listUpdateResponses"] |
| 494 .map((value) => new ListUpdateResponse.fromJson(value)) |
| 495 .toList(); |
514 } | 496 } |
515 if (_json.containsKey("minimumWaitDuration")) { | 497 if (_json.containsKey("minimumWaitDuration")) { |
516 minimumWaitDuration = _json["minimumWaitDuration"]; | 498 minimumWaitDuration = _json["minimumWaitDuration"]; |
517 } | 499 } |
518 } | 500 } |
519 | 501 |
520 core.Map<core.String, core.Object> toJson() { | 502 core.Map<core.String, core.Object> toJson() { |
521 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 503 final core.Map<core.String, core.Object> _json = |
| 504 new core.Map<core.String, core.Object>(); |
522 if (listUpdateResponses != null) { | 505 if (listUpdateResponses != null) { |
523 _json["listUpdateResponses"] = listUpdateResponses.map((value) => (value).
toJson()).toList(); | 506 _json["listUpdateResponses"] = |
| 507 listUpdateResponses.map((value) => (value).toJson()).toList(); |
524 } | 508 } |
525 if (minimumWaitDuration != null) { | 509 if (minimumWaitDuration != null) { |
526 _json["minimumWaitDuration"] = minimumWaitDuration; | 510 _json["minimumWaitDuration"] = minimumWaitDuration; |
527 } | 511 } |
528 return _json; | 512 return _json; |
529 } | 513 } |
530 } | 514 } |
531 | 515 |
532 /** Request to return full hashes matched by the provided hash prefixes. */ | 516 /// Request to return full hashes matched by the provided hash prefixes. |
533 class FindFullHashesRequest { | 517 class FindFullHashesRequest { |
534 /** | 518 /// Client metadata associated with callers of higher-level APIs built on top |
535 * Client metadata associated with callers of higher-level APIs built on top | 519 /// of the client's implementation. |
536 * of the client's implementation. | |
537 */ | |
538 ClientInfo apiClient; | 520 ClientInfo apiClient; |
539 /** The client metadata. */ | 521 |
| 522 /// The client metadata. |
540 ClientInfo client; | 523 ClientInfo client; |
541 /** The current client states for each of the client's local threat lists. */ | 524 |
| 525 /// The current client states for each of the client's local threat lists. |
542 core.List<core.String> clientStates; | 526 core.List<core.String> clientStates; |
543 /** The lists and hashes to be checked. */ | 527 |
| 528 /// The lists and hashes to be checked. |
544 ThreatInfo threatInfo; | 529 ThreatInfo threatInfo; |
545 | 530 |
546 FindFullHashesRequest(); | 531 FindFullHashesRequest(); |
547 | 532 |
548 FindFullHashesRequest.fromJson(core.Map _json) { | 533 FindFullHashesRequest.fromJson(core.Map _json) { |
549 if (_json.containsKey("apiClient")) { | 534 if (_json.containsKey("apiClient")) { |
550 apiClient = new ClientInfo.fromJson(_json["apiClient"]); | 535 apiClient = new ClientInfo.fromJson(_json["apiClient"]); |
551 } | 536 } |
552 if (_json.containsKey("client")) { | 537 if (_json.containsKey("client")) { |
553 client = new ClientInfo.fromJson(_json["client"]); | 538 client = new ClientInfo.fromJson(_json["client"]); |
554 } | 539 } |
555 if (_json.containsKey("clientStates")) { | 540 if (_json.containsKey("clientStates")) { |
556 clientStates = _json["clientStates"]; | 541 clientStates = _json["clientStates"]; |
557 } | 542 } |
558 if (_json.containsKey("threatInfo")) { | 543 if (_json.containsKey("threatInfo")) { |
559 threatInfo = new ThreatInfo.fromJson(_json["threatInfo"]); | 544 threatInfo = new ThreatInfo.fromJson(_json["threatInfo"]); |
560 } | 545 } |
561 } | 546 } |
562 | 547 |
563 core.Map<core.String, core.Object> toJson() { | 548 core.Map<core.String, core.Object> toJson() { |
564 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 549 final core.Map<core.String, core.Object> _json = |
| 550 new core.Map<core.String, core.Object>(); |
565 if (apiClient != null) { | 551 if (apiClient != null) { |
566 _json["apiClient"] = (apiClient).toJson(); | 552 _json["apiClient"] = (apiClient).toJson(); |
567 } | 553 } |
568 if (client != null) { | 554 if (client != null) { |
569 _json["client"] = (client).toJson(); | 555 _json["client"] = (client).toJson(); |
570 } | 556 } |
571 if (clientStates != null) { | 557 if (clientStates != null) { |
572 _json["clientStates"] = clientStates; | 558 _json["clientStates"] = clientStates; |
573 } | 559 } |
574 if (threatInfo != null) { | 560 if (threatInfo != null) { |
575 _json["threatInfo"] = (threatInfo).toJson(); | 561 _json["threatInfo"] = (threatInfo).toJson(); |
576 } | 562 } |
577 return _json; | 563 return _json; |
578 } | 564 } |
579 } | 565 } |
580 | 566 |
581 class FindFullHashesResponse { | 567 class FindFullHashesResponse { |
582 /** The full hashes that matched the requested prefixes. */ | 568 /// The full hashes that matched the requested prefixes. |
583 core.List<ThreatMatch> matches; | 569 core.List<ThreatMatch> matches; |
584 /** | 570 |
585 * The minimum duration the client must wait before issuing any find hashes | 571 /// The minimum duration the client must wait before issuing any find hashes |
586 * request. If this field is not set, clients can issue a request as soon as | 572 /// request. If this field is not set, clients can issue a request as soon as |
587 * they want. | 573 /// they want. |
588 */ | |
589 core.String minimumWaitDuration; | 574 core.String minimumWaitDuration; |
590 /** | 575 |
591 * For requested entities that did not match the threat list, how long to | 576 /// For requested entities that did not match the threat list, how long to |
592 * cache the response. | 577 /// cache the response. |
593 */ | |
594 core.String negativeCacheDuration; | 578 core.String negativeCacheDuration; |
595 | 579 |
596 FindFullHashesResponse(); | 580 FindFullHashesResponse(); |
597 | 581 |
598 FindFullHashesResponse.fromJson(core.Map _json) { | 582 FindFullHashesResponse.fromJson(core.Map _json) { |
599 if (_json.containsKey("matches")) { | 583 if (_json.containsKey("matches")) { |
600 matches = _json["matches"].map((value) => new ThreatMatch.fromJson(value))
.toList(); | 584 matches = _json["matches"] |
| 585 .map((value) => new ThreatMatch.fromJson(value)) |
| 586 .toList(); |
601 } | 587 } |
602 if (_json.containsKey("minimumWaitDuration")) { | 588 if (_json.containsKey("minimumWaitDuration")) { |
603 minimumWaitDuration = _json["minimumWaitDuration"]; | 589 minimumWaitDuration = _json["minimumWaitDuration"]; |
604 } | 590 } |
605 if (_json.containsKey("negativeCacheDuration")) { | 591 if (_json.containsKey("negativeCacheDuration")) { |
606 negativeCacheDuration = _json["negativeCacheDuration"]; | 592 negativeCacheDuration = _json["negativeCacheDuration"]; |
607 } | 593 } |
608 } | 594 } |
609 | 595 |
610 core.Map<core.String, core.Object> toJson() { | 596 core.Map<core.String, core.Object> toJson() { |
611 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 597 final core.Map<core.String, core.Object> _json = |
| 598 new core.Map<core.String, core.Object>(); |
612 if (matches != null) { | 599 if (matches != null) { |
613 _json["matches"] = matches.map((value) => (value).toJson()).toList(); | 600 _json["matches"] = matches.map((value) => (value).toJson()).toList(); |
614 } | 601 } |
615 if (minimumWaitDuration != null) { | 602 if (minimumWaitDuration != null) { |
616 _json["minimumWaitDuration"] = minimumWaitDuration; | 603 _json["minimumWaitDuration"] = minimumWaitDuration; |
617 } | 604 } |
618 if (negativeCacheDuration != null) { | 605 if (negativeCacheDuration != null) { |
619 _json["negativeCacheDuration"] = negativeCacheDuration; | 606 _json["negativeCacheDuration"] = negativeCacheDuration; |
620 } | 607 } |
621 return _json; | 608 return _json; |
622 } | 609 } |
623 } | 610 } |
624 | 611 |
625 /** Request to check entries against lists. */ | 612 /// Request to check entries against lists. |
626 class FindThreatMatchesRequest { | 613 class FindThreatMatchesRequest { |
627 /** The client metadata. */ | 614 /// The client metadata. |
628 ClientInfo client; | 615 ClientInfo client; |
629 /** The lists and entries to be checked for matches. */ | 616 |
| 617 /// The lists and entries to be checked for matches. |
630 ThreatInfo threatInfo; | 618 ThreatInfo threatInfo; |
631 | 619 |
632 FindThreatMatchesRequest(); | 620 FindThreatMatchesRequest(); |
633 | 621 |
634 FindThreatMatchesRequest.fromJson(core.Map _json) { | 622 FindThreatMatchesRequest.fromJson(core.Map _json) { |
635 if (_json.containsKey("client")) { | 623 if (_json.containsKey("client")) { |
636 client = new ClientInfo.fromJson(_json["client"]); | 624 client = new ClientInfo.fromJson(_json["client"]); |
637 } | 625 } |
638 if (_json.containsKey("threatInfo")) { | 626 if (_json.containsKey("threatInfo")) { |
639 threatInfo = new ThreatInfo.fromJson(_json["threatInfo"]); | 627 threatInfo = new ThreatInfo.fromJson(_json["threatInfo"]); |
640 } | 628 } |
641 } | 629 } |
642 | 630 |
643 core.Map<core.String, core.Object> toJson() { | 631 core.Map<core.String, core.Object> toJson() { |
644 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 632 final core.Map<core.String, core.Object> _json = |
| 633 new core.Map<core.String, core.Object>(); |
645 if (client != null) { | 634 if (client != null) { |
646 _json["client"] = (client).toJson(); | 635 _json["client"] = (client).toJson(); |
647 } | 636 } |
648 if (threatInfo != null) { | 637 if (threatInfo != null) { |
649 _json["threatInfo"] = (threatInfo).toJson(); | 638 _json["threatInfo"] = (threatInfo).toJson(); |
650 } | 639 } |
651 return _json; | 640 return _json; |
652 } | 641 } |
653 } | 642 } |
654 | 643 |
655 class FindThreatMatchesResponse { | 644 class FindThreatMatchesResponse { |
656 /** The threat list matches. */ | 645 /// The threat list matches. |
657 core.List<ThreatMatch> matches; | 646 core.List<ThreatMatch> matches; |
658 | 647 |
659 FindThreatMatchesResponse(); | 648 FindThreatMatchesResponse(); |
660 | 649 |
661 FindThreatMatchesResponse.fromJson(core.Map _json) { | 650 FindThreatMatchesResponse.fromJson(core.Map _json) { |
662 if (_json.containsKey("matches")) { | 651 if (_json.containsKey("matches")) { |
663 matches = _json["matches"].map((value) => new ThreatMatch.fromJson(value))
.toList(); | 652 matches = _json["matches"] |
| 653 .map((value) => new ThreatMatch.fromJson(value)) |
| 654 .toList(); |
664 } | 655 } |
665 } | 656 } |
666 | 657 |
667 core.Map<core.String, core.Object> toJson() { | 658 core.Map<core.String, core.Object> toJson() { |
668 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 659 final core.Map<core.String, core.Object> _json = |
| 660 new core.Map<core.String, core.Object>(); |
669 if (matches != null) { | 661 if (matches != null) { |
670 _json["matches"] = matches.map((value) => (value).toJson()).toList(); | 662 _json["matches"] = matches.map((value) => (value).toJson()).toList(); |
671 } | 663 } |
672 return _json; | 664 return _json; |
673 } | 665 } |
674 } | 666 } |
675 | 667 |
676 class ListThreatListsResponse { | 668 class ListThreatListsResponse { |
677 /** The lists available for download by the client. */ | 669 /// The lists available for download by the client. |
678 core.List<ThreatListDescriptor> threatLists; | 670 core.List<ThreatListDescriptor> threatLists; |
679 | 671 |
680 ListThreatListsResponse(); | 672 ListThreatListsResponse(); |
681 | 673 |
682 ListThreatListsResponse.fromJson(core.Map _json) { | 674 ListThreatListsResponse.fromJson(core.Map _json) { |
683 if (_json.containsKey("threatLists")) { | 675 if (_json.containsKey("threatLists")) { |
684 threatLists = _json["threatLists"].map((value) => new ThreatListDescriptor
.fromJson(value)).toList(); | 676 threatLists = _json["threatLists"] |
| 677 .map((value) => new ThreatListDescriptor.fromJson(value)) |
| 678 .toList(); |
685 } | 679 } |
686 } | 680 } |
687 | 681 |
688 core.Map<core.String, core.Object> toJson() { | 682 core.Map<core.String, core.Object> toJson() { |
689 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 683 final core.Map<core.String, core.Object> _json = |
| 684 new core.Map<core.String, core.Object>(); |
690 if (threatLists != null) { | 685 if (threatLists != null) { |
691 _json["threatLists"] = threatLists.map((value) => (value).toJson()).toList
(); | 686 _json["threatLists"] = |
| 687 threatLists.map((value) => (value).toJson()).toList(); |
692 } | 688 } |
693 return _json; | 689 return _json; |
694 } | 690 } |
695 } | 691 } |
696 | 692 |
697 /** A single list update request. */ | 693 /// A single list update request. |
698 class ListUpdateRequest { | 694 class ListUpdateRequest { |
699 /** The constraints associated with this request. */ | 695 /// The constraints associated with this request. |
700 Constraints constraints; | 696 Constraints constraints; |
701 /** | 697 |
702 * The type of platform at risk by entries present in the list. | 698 /// The type of platform at risk by entries present in the list. |
703 * Possible string values are: | 699 /// Possible string values are: |
704 * - "PLATFORM_TYPE_UNSPECIFIED" : Unknown platform. | 700 /// - "PLATFORM_TYPE_UNSPECIFIED" : Unknown platform. |
705 * - "WINDOWS" : Threat posed to Windows. | 701 /// - "WINDOWS" : Threat posed to Windows. |
706 * - "LINUX" : Threat posed to Linux. | 702 /// - "LINUX" : Threat posed to Linux. |
707 * - "ANDROID" : Threat posed to Android. | 703 /// - "ANDROID" : Threat posed to Android. |
708 * - "OSX" : Threat posed to OS X. | 704 /// - "OSX" : Threat posed to OS X. |
709 * - "IOS" : Threat posed to iOS. | 705 /// - "IOS" : Threat posed to iOS. |
710 * - "ANY_PLATFORM" : Threat posed to at least one of the defined platforms. | 706 /// - "ANY_PLATFORM" : Threat posed to at least one of the defined platforms. |
711 * - "ALL_PLATFORMS" : Threat posed to all defined platforms. | 707 /// - "ALL_PLATFORMS" : Threat posed to all defined platforms. |
712 * - "CHROME" : Threat posed to Chrome. | 708 /// - "CHROME" : Threat posed to Chrome. |
713 */ | |
714 core.String platformType; | 709 core.String platformType; |
715 /** | 710 |
716 * The current state of the client for the requested list (the encrypted | 711 /// The current state of the client for the requested list (the encrypted |
717 * client state that was received from the last successful list update). | 712 /// client state that was received from the last successful list update). |
718 */ | |
719 core.String state; | 713 core.String state; |
720 core.List<core.int> get stateAsBytes { | 714 core.List<core.int> get stateAsBytes { |
721 return convert.BASE64.decode(state); | 715 return convert.BASE64.decode(state); |
722 } | 716 } |
723 | 717 |
724 void set stateAsBytes(core.List<core.int> _bytes) { | 718 void set stateAsBytes(core.List<core.int> _bytes) { |
725 state = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "
-"); | 719 state = |
| 720 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
726 } | 721 } |
727 /** | 722 |
728 * The types of entries present in the list. | 723 /// The types of entries present in the list. |
729 * Possible string values are: | 724 /// Possible string values are: |
730 * - "THREAT_ENTRY_TYPE_UNSPECIFIED" : Unspecified. | 725 /// - "THREAT_ENTRY_TYPE_UNSPECIFIED" : Unspecified. |
731 * - "URL" : A URL. | 726 /// - "URL" : A URL. |
732 * - "EXECUTABLE" : An executable program. | 727 /// - "EXECUTABLE" : An executable program. |
733 * - "IP_RANGE" : An IP range. | 728 /// - "IP_RANGE" : An IP range. |
734 * - "CHROME_EXTENSION" : Chrome extension. | 729 /// - "CHROME_EXTENSION" : Chrome extension. |
735 * - "FILENAME" : Filename. | 730 /// - "FILENAME" : Filename. |
736 * - "CERT" : CERT | 731 /// - "CERT" : CERT |
737 */ | |
738 core.String threatEntryType; | 732 core.String threatEntryType; |
739 /** | 733 |
740 * The type of threat posed by entries present in the list. | 734 /// The type of threat posed by entries present in the list. |
741 * Possible string values are: | 735 /// Possible string values are: |
742 * - "THREAT_TYPE_UNSPECIFIED" : Unknown. | 736 /// - "THREAT_TYPE_UNSPECIFIED" : Unknown. |
743 * - "MALWARE" : Malware threat type. | 737 /// - "MALWARE" : Malware threat type. |
744 * - "SOCIAL_ENGINEERING" : Social engineering threat type. | 738 /// - "SOCIAL_ENGINEERING" : Social engineering threat type. |
745 * - "UNWANTED_SOFTWARE" : Unwanted software threat type. | 739 /// - "UNWANTED_SOFTWARE" : Unwanted software threat type. |
746 * - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application | 740 /// - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application |
747 * threat type. | 741 /// threat type. |
748 * - "SOCIAL_ENGINEERING_INTERNAL" : Social engineering threat type for | 742 /// - "SOCIAL_ENGINEERING_INTERNAL" : Social engineering threat type for |
749 * internal use. | 743 /// internal use. |
750 * - "API_ABUSE" : API abuse threat type. | 744 /// - "API_ABUSE" : API abuse threat type. |
751 * - "MALICIOUS_BINARY" : Malicious binary threat type. | 745 /// - "MALICIOUS_BINARY" : Malicious binary threat type. |
752 * - "CSD_WHITELIST" : Client side detection whitelist threat type. | 746 /// - "CSD_WHITELIST" : Client side detection whitelist threat type. |
753 * - "CSD_DOWNLOAD_WHITELIST" : Client side download detection whitelist | 747 /// - "CSD_DOWNLOAD_WHITELIST" : Client side download detection whitelist |
754 * threat type. | 748 /// threat type. |
755 * - "CLIENT_INCIDENT" : Client incident threat type. | 749 /// - "CLIENT_INCIDENT" : Client incident threat type. |
756 * - "CLIENT_INCIDENT_WHITELIST" : Whitelist used when detecting client | 750 /// - "CLIENT_INCIDENT_WHITELIST" : Whitelist used when detecting client |
757 * incident threats. | 751 /// incident threats. |
758 * This enum was never launched and should be re-used for the next list. | 752 /// This enum was never launched and should be re-used for the next list. |
759 * - "APK_MALWARE_OFFLINE" : List used for offline APK checks in PAM. | 753 /// - "APK_MALWARE_OFFLINE" : List used for offline APK checks in PAM. |
760 * - "SUBRESOURCE_FILTER" : Patterns to be used for activating the subresource | 754 /// - "SUBRESOURCE_FILTER" : Patterns to be used for activating the |
761 * filter. Interstitial | 755 /// subresource filter. Interstitial |
762 * will not be shown for patterns from this list. | 756 /// will not be shown for patterns from this list. |
763 */ | |
764 core.String threatType; | 757 core.String threatType; |
765 | 758 |
766 ListUpdateRequest(); | 759 ListUpdateRequest(); |
767 | 760 |
768 ListUpdateRequest.fromJson(core.Map _json) { | 761 ListUpdateRequest.fromJson(core.Map _json) { |
769 if (_json.containsKey("constraints")) { | 762 if (_json.containsKey("constraints")) { |
770 constraints = new Constraints.fromJson(_json["constraints"]); | 763 constraints = new Constraints.fromJson(_json["constraints"]); |
771 } | 764 } |
772 if (_json.containsKey("platformType")) { | 765 if (_json.containsKey("platformType")) { |
773 platformType = _json["platformType"]; | 766 platformType = _json["platformType"]; |
774 } | 767 } |
775 if (_json.containsKey("state")) { | 768 if (_json.containsKey("state")) { |
776 state = _json["state"]; | 769 state = _json["state"]; |
777 } | 770 } |
778 if (_json.containsKey("threatEntryType")) { | 771 if (_json.containsKey("threatEntryType")) { |
779 threatEntryType = _json["threatEntryType"]; | 772 threatEntryType = _json["threatEntryType"]; |
780 } | 773 } |
781 if (_json.containsKey("threatType")) { | 774 if (_json.containsKey("threatType")) { |
782 threatType = _json["threatType"]; | 775 threatType = _json["threatType"]; |
783 } | 776 } |
784 } | 777 } |
785 | 778 |
786 core.Map<core.String, core.Object> toJson() { | 779 core.Map<core.String, core.Object> toJson() { |
787 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 780 final core.Map<core.String, core.Object> _json = |
| 781 new core.Map<core.String, core.Object>(); |
788 if (constraints != null) { | 782 if (constraints != null) { |
789 _json["constraints"] = (constraints).toJson(); | 783 _json["constraints"] = (constraints).toJson(); |
790 } | 784 } |
791 if (platformType != null) { | 785 if (platformType != null) { |
792 _json["platformType"] = platformType; | 786 _json["platformType"] = platformType; |
793 } | 787 } |
794 if (state != null) { | 788 if (state != null) { |
795 _json["state"] = state; | 789 _json["state"] = state; |
796 } | 790 } |
797 if (threatEntryType != null) { | 791 if (threatEntryType != null) { |
798 _json["threatEntryType"] = threatEntryType; | 792 _json["threatEntryType"] = threatEntryType; |
799 } | 793 } |
800 if (threatType != null) { | 794 if (threatType != null) { |
801 _json["threatType"] = threatType; | 795 _json["threatType"] = threatType; |
802 } | 796 } |
803 return _json; | 797 return _json; |
804 } | 798 } |
805 } | 799 } |
806 | 800 |
807 /** An update to an individual list. */ | 801 /// An update to an individual list. |
808 class ListUpdateResponse { | 802 class ListUpdateResponse { |
809 /** | 803 /// A set of entries to add to a local threat type's list. Repeated to allow |
810 * A set of entries to add to a local threat type's list. Repeated to allow | 804 /// for a combination of compressed and raw data to be sent in a single |
811 * for a combination of compressed and raw data to be sent in a single | 805 /// response. |
812 * response. | |
813 */ | |
814 core.List<ThreatEntrySet> additions; | 806 core.List<ThreatEntrySet> additions; |
815 /** | 807 |
816 * The expected SHA256 hash of the client state; that is, of the sorted list | 808 /// The expected SHA256 hash of the client state; that is, of the sorted list |
817 * of all hashes present in the database after applying the provided update. | 809 /// of all hashes present in the database after applying the provided update. |
818 * If the client state doesn't match the expected state, the client must | 810 /// If the client state doesn't match the expected state, the client must |
819 * disregard this update and retry later. | 811 /// disregard this update and retry later. |
820 */ | |
821 Checksum checksum; | 812 Checksum checksum; |
822 /** The new client state, in encrypted format. Opaque to clients. */ | 813 |
| 814 /// The new client state, in encrypted format. Opaque to clients. |
823 core.String newClientState; | 815 core.String newClientState; |
824 core.List<core.int> get newClientStateAsBytes { | 816 core.List<core.int> get newClientStateAsBytes { |
825 return convert.BASE64.decode(newClientState); | 817 return convert.BASE64.decode(newClientState); |
826 } | 818 } |
827 | 819 |
828 void set newClientStateAsBytes(core.List<core.int> _bytes) { | 820 void set newClientStateAsBytes(core.List<core.int> _bytes) { |
829 newClientState = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceA
ll("+", "-"); | 821 newClientState = |
| 822 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
830 } | 823 } |
831 /** | 824 |
832 * The platform type for which data is returned. | 825 /// The platform type for which data is returned. |
833 * Possible string values are: | 826 /// Possible string values are: |
834 * - "PLATFORM_TYPE_UNSPECIFIED" : Unknown platform. | 827 /// - "PLATFORM_TYPE_UNSPECIFIED" : Unknown platform. |
835 * - "WINDOWS" : Threat posed to Windows. | 828 /// - "WINDOWS" : Threat posed to Windows. |
836 * - "LINUX" : Threat posed to Linux. | 829 /// - "LINUX" : Threat posed to Linux. |
837 * - "ANDROID" : Threat posed to Android. | 830 /// - "ANDROID" : Threat posed to Android. |
838 * - "OSX" : Threat posed to OS X. | 831 /// - "OSX" : Threat posed to OS X. |
839 * - "IOS" : Threat posed to iOS. | 832 /// - "IOS" : Threat posed to iOS. |
840 * - "ANY_PLATFORM" : Threat posed to at least one of the defined platforms. | 833 /// - "ANY_PLATFORM" : Threat posed to at least one of the defined platforms. |
841 * - "ALL_PLATFORMS" : Threat posed to all defined platforms. | 834 /// - "ALL_PLATFORMS" : Threat posed to all defined platforms. |
842 * - "CHROME" : Threat posed to Chrome. | 835 /// - "CHROME" : Threat posed to Chrome. |
843 */ | |
844 core.String platformType; | 836 core.String platformType; |
845 /** | 837 |
846 * A set of entries to remove from a local threat type's list. In practice, | 838 /// A set of entries to remove from a local threat type's list. In practice, |
847 * this field is empty or contains exactly one ThreatEntrySet. | 839 /// this field is empty or contains exactly one ThreatEntrySet. |
848 */ | |
849 core.List<ThreatEntrySet> removals; | 840 core.List<ThreatEntrySet> removals; |
850 /** | 841 |
851 * The type of response. This may indicate that an action is required by the | 842 /// The type of response. This may indicate that an action is required by the |
852 * client when the response is received. | 843 /// client when the response is received. |
853 * Possible string values are: | 844 /// Possible string values are: |
854 * - "RESPONSE_TYPE_UNSPECIFIED" : Unknown. | 845 /// - "RESPONSE_TYPE_UNSPECIFIED" : Unknown. |
855 * - "PARTIAL_UPDATE" : Partial updates are applied to the client's existing | 846 /// - "PARTIAL_UPDATE" : Partial updates are applied to the client's existing |
856 * local database. | 847 /// local database. |
857 * - "FULL_UPDATE" : Full updates replace the client's entire local database. | 848 /// - "FULL_UPDATE" : Full updates replace the client's entire local |
858 * This means | 849 /// database. This means |
859 * that either the client was seriously out-of-date or the client is | 850 /// that either the client was seriously out-of-date or the client is |
860 * believed to be corrupt. | 851 /// believed to be corrupt. |
861 */ | |
862 core.String responseType; | 852 core.String responseType; |
863 /** | 853 |
864 * The format of the threats. | 854 /// The format of the threats. |
865 * Possible string values are: | 855 /// Possible string values are: |
866 * - "THREAT_ENTRY_TYPE_UNSPECIFIED" : Unspecified. | 856 /// - "THREAT_ENTRY_TYPE_UNSPECIFIED" : Unspecified. |
867 * - "URL" : A URL. | 857 /// - "URL" : A URL. |
868 * - "EXECUTABLE" : An executable program. | 858 /// - "EXECUTABLE" : An executable program. |
869 * - "IP_RANGE" : An IP range. | 859 /// - "IP_RANGE" : An IP range. |
870 * - "CHROME_EXTENSION" : Chrome extension. | 860 /// - "CHROME_EXTENSION" : Chrome extension. |
871 * - "FILENAME" : Filename. | 861 /// - "FILENAME" : Filename. |
872 * - "CERT" : CERT | 862 /// - "CERT" : CERT |
873 */ | |
874 core.String threatEntryType; | 863 core.String threatEntryType; |
875 /** | 864 |
876 * The threat type for which data is returned. | 865 /// The threat type for which data is returned. |
877 * Possible string values are: | 866 /// Possible string values are: |
878 * - "THREAT_TYPE_UNSPECIFIED" : Unknown. | 867 /// - "THREAT_TYPE_UNSPECIFIED" : Unknown. |
879 * - "MALWARE" : Malware threat type. | 868 /// - "MALWARE" : Malware threat type. |
880 * - "SOCIAL_ENGINEERING" : Social engineering threat type. | 869 /// - "SOCIAL_ENGINEERING" : Social engineering threat type. |
881 * - "UNWANTED_SOFTWARE" : Unwanted software threat type. | 870 /// - "UNWANTED_SOFTWARE" : Unwanted software threat type. |
882 * - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application | 871 /// - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application |
883 * threat type. | 872 /// threat type. |
884 * - "SOCIAL_ENGINEERING_INTERNAL" : Social engineering threat type for | 873 /// - "SOCIAL_ENGINEERING_INTERNAL" : Social engineering threat type for |
885 * internal use. | 874 /// internal use. |
886 * - "API_ABUSE" : API abuse threat type. | 875 /// - "API_ABUSE" : API abuse threat type. |
887 * - "MALICIOUS_BINARY" : Malicious binary threat type. | 876 /// - "MALICIOUS_BINARY" : Malicious binary threat type. |
888 * - "CSD_WHITELIST" : Client side detection whitelist threat type. | 877 /// - "CSD_WHITELIST" : Client side detection whitelist threat type. |
889 * - "CSD_DOWNLOAD_WHITELIST" : Client side download detection whitelist | 878 /// - "CSD_DOWNLOAD_WHITELIST" : Client side download detection whitelist |
890 * threat type. | 879 /// threat type. |
891 * - "CLIENT_INCIDENT" : Client incident threat type. | 880 /// - "CLIENT_INCIDENT" : Client incident threat type. |
892 * - "CLIENT_INCIDENT_WHITELIST" : Whitelist used when detecting client | 881 /// - "CLIENT_INCIDENT_WHITELIST" : Whitelist used when detecting client |
893 * incident threats. | 882 /// incident threats. |
894 * This enum was never launched and should be re-used for the next list. | 883 /// This enum was never launched and should be re-used for the next list. |
895 * - "APK_MALWARE_OFFLINE" : List used for offline APK checks in PAM. | 884 /// - "APK_MALWARE_OFFLINE" : List used for offline APK checks in PAM. |
896 * - "SUBRESOURCE_FILTER" : Patterns to be used for activating the subresource | 885 /// - "SUBRESOURCE_FILTER" : Patterns to be used for activating the |
897 * filter. Interstitial | 886 /// subresource filter. Interstitial |
898 * will not be shown for patterns from this list. | 887 /// will not be shown for patterns from this list. |
899 */ | |
900 core.String threatType; | 888 core.String threatType; |
901 | 889 |
902 ListUpdateResponse(); | 890 ListUpdateResponse(); |
903 | 891 |
904 ListUpdateResponse.fromJson(core.Map _json) { | 892 ListUpdateResponse.fromJson(core.Map _json) { |
905 if (_json.containsKey("additions")) { | 893 if (_json.containsKey("additions")) { |
906 additions = _json["additions"].map((value) => new ThreatEntrySet.fromJson(
value)).toList(); | 894 additions = _json["additions"] |
| 895 .map((value) => new ThreatEntrySet.fromJson(value)) |
| 896 .toList(); |
907 } | 897 } |
908 if (_json.containsKey("checksum")) { | 898 if (_json.containsKey("checksum")) { |
909 checksum = new Checksum.fromJson(_json["checksum"]); | 899 checksum = new Checksum.fromJson(_json["checksum"]); |
910 } | 900 } |
911 if (_json.containsKey("newClientState")) { | 901 if (_json.containsKey("newClientState")) { |
912 newClientState = _json["newClientState"]; | 902 newClientState = _json["newClientState"]; |
913 } | 903 } |
914 if (_json.containsKey("platformType")) { | 904 if (_json.containsKey("platformType")) { |
915 platformType = _json["platformType"]; | 905 platformType = _json["platformType"]; |
916 } | 906 } |
917 if (_json.containsKey("removals")) { | 907 if (_json.containsKey("removals")) { |
918 removals = _json["removals"].map((value) => new ThreatEntrySet.fromJson(va
lue)).toList(); | 908 removals = _json["removals"] |
| 909 .map((value) => new ThreatEntrySet.fromJson(value)) |
| 910 .toList(); |
919 } | 911 } |
920 if (_json.containsKey("responseType")) { | 912 if (_json.containsKey("responseType")) { |
921 responseType = _json["responseType"]; | 913 responseType = _json["responseType"]; |
922 } | 914 } |
923 if (_json.containsKey("threatEntryType")) { | 915 if (_json.containsKey("threatEntryType")) { |
924 threatEntryType = _json["threatEntryType"]; | 916 threatEntryType = _json["threatEntryType"]; |
925 } | 917 } |
926 if (_json.containsKey("threatType")) { | 918 if (_json.containsKey("threatType")) { |
927 threatType = _json["threatType"]; | 919 threatType = _json["threatType"]; |
928 } | 920 } |
929 } | 921 } |
930 | 922 |
931 core.Map<core.String, core.Object> toJson() { | 923 core.Map<core.String, core.Object> toJson() { |
932 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 924 final core.Map<core.String, core.Object> _json = |
| 925 new core.Map<core.String, core.Object>(); |
933 if (additions != null) { | 926 if (additions != null) { |
934 _json["additions"] = additions.map((value) => (value).toJson()).toList(); | 927 _json["additions"] = additions.map((value) => (value).toJson()).toList(); |
935 } | 928 } |
936 if (checksum != null) { | 929 if (checksum != null) { |
937 _json["checksum"] = (checksum).toJson(); | 930 _json["checksum"] = (checksum).toJson(); |
938 } | 931 } |
939 if (newClientState != null) { | 932 if (newClientState != null) { |
940 _json["newClientState"] = newClientState; | 933 _json["newClientState"] = newClientState; |
941 } | 934 } |
942 if (platformType != null) { | 935 if (platformType != null) { |
943 _json["platformType"] = platformType; | 936 _json["platformType"] = platformType; |
944 } | 937 } |
945 if (removals != null) { | 938 if (removals != null) { |
946 _json["removals"] = removals.map((value) => (value).toJson()).toList(); | 939 _json["removals"] = removals.map((value) => (value).toJson()).toList(); |
947 } | 940 } |
948 if (responseType != null) { | 941 if (responseType != null) { |
949 _json["responseType"] = responseType; | 942 _json["responseType"] = responseType; |
950 } | 943 } |
951 if (threatEntryType != null) { | 944 if (threatEntryType != null) { |
952 _json["threatEntryType"] = threatEntryType; | 945 _json["threatEntryType"] = threatEntryType; |
953 } | 946 } |
954 if (threatType != null) { | 947 if (threatType != null) { |
955 _json["threatType"] = threatType; | 948 _json["threatType"] = threatType; |
956 } | 949 } |
957 return _json; | 950 return _json; |
958 } | 951 } |
959 } | 952 } |
960 | 953 |
961 /** A single metadata entry. */ | 954 /// A single metadata entry. |
962 class MetadataEntry { | 955 class MetadataEntry { |
963 /** The metadata entry key. For JSON requests, the key is base64-encoded. */ | 956 /// The metadata entry key. For JSON requests, the key is base64-encoded. |
964 core.String key; | 957 core.String key; |
965 core.List<core.int> get keyAsBytes { | 958 core.List<core.int> get keyAsBytes { |
966 return convert.BASE64.decode(key); | 959 return convert.BASE64.decode(key); |
967 } | 960 } |
968 | 961 |
969 void set keyAsBytes(core.List<core.int> _bytes) { | 962 void set keyAsBytes(core.List<core.int> _bytes) { |
970 key = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"
); | 963 key = |
| 964 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
971 } | 965 } |
972 /** | 966 |
973 * The metadata entry value. For JSON requests, the value is base64-encoded. | 967 /// The metadata entry value. For JSON requests, the value is base64-encoded. |
974 */ | |
975 core.String value; | 968 core.String value; |
976 core.List<core.int> get valueAsBytes { | 969 core.List<core.int> get valueAsBytes { |
977 return convert.BASE64.decode(value); | 970 return convert.BASE64.decode(value); |
978 } | 971 } |
979 | 972 |
980 void set valueAsBytes(core.List<core.int> _bytes) { | 973 void set valueAsBytes(core.List<core.int> _bytes) { |
981 value = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "
-"); | 974 value = |
| 975 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
982 } | 976 } |
983 | 977 |
984 MetadataEntry(); | 978 MetadataEntry(); |
985 | 979 |
986 MetadataEntry.fromJson(core.Map _json) { | 980 MetadataEntry.fromJson(core.Map _json) { |
987 if (_json.containsKey("key")) { | 981 if (_json.containsKey("key")) { |
988 key = _json["key"]; | 982 key = _json["key"]; |
989 } | 983 } |
990 if (_json.containsKey("value")) { | 984 if (_json.containsKey("value")) { |
991 value = _json["value"]; | 985 value = _json["value"]; |
992 } | 986 } |
993 } | 987 } |
994 | 988 |
995 core.Map<core.String, core.Object> toJson() { | 989 core.Map<core.String, core.Object> toJson() { |
996 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 990 final core.Map<core.String, core.Object> _json = |
| 991 new core.Map<core.String, core.Object>(); |
997 if (key != null) { | 992 if (key != null) { |
998 _json["key"] = key; | 993 _json["key"] = key; |
999 } | 994 } |
1000 if (value != null) { | 995 if (value != null) { |
1001 _json["value"] = value; | 996 _json["value"] = value; |
1002 } | 997 } |
1003 return _json; | 998 return _json; |
1004 } | 999 } |
1005 } | 1000 } |
1006 | 1001 |
1007 /** | 1002 /// The uncompressed threat entries in hash format of a particular prefix |
1008 * The uncompressed threat entries in hash format of a particular prefix length. | 1003 /// length. |
1009 * Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 | 1004 /// Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 |
1010 * bytes, but some hashes are lengthened if they collide with the hash of a | 1005 /// bytes, but some hashes are lengthened if they collide with the hash of a |
1011 * popular URL. | 1006 /// popular URL. |
1012 * | 1007 /// |
1013 * Used for sending ThreatEntrySet to clients that do not support compression, | 1008 /// Used for sending ThreatEntrySet to clients that do not support compression, |
1014 * or when sending non-4-byte hashes to clients that do support compression. | 1009 /// or when sending non-4-byte hashes to clients that do support compression. |
1015 */ | |
1016 class RawHashes { | 1010 class RawHashes { |
1017 /** | 1011 /// The number of bytes for each prefix encoded below. This field can be |
1018 * The number of bytes for each prefix encoded below. This field can be | 1012 /// anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). |
1019 * anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). | |
1020 */ | |
1021 core.int prefixSize; | 1013 core.int prefixSize; |
1022 /** | 1014 |
1023 * The hashes, in binary format, concatenated into one long string. Hashes are | 1015 /// The hashes, in binary format, concatenated into one long string. Hashes |
1024 * sorted in lexicographic order. For JSON API users, hashes are | 1016 /// are |
1025 * base64-encoded. | 1017 /// sorted in lexicographic order. For JSON API users, hashes are |
1026 */ | 1018 /// base64-encoded. |
1027 core.String rawHashes; | 1019 core.String rawHashes; |
1028 core.List<core.int> get rawHashesAsBytes { | 1020 core.List<core.int> get rawHashesAsBytes { |
1029 return convert.BASE64.decode(rawHashes); | 1021 return convert.BASE64.decode(rawHashes); |
1030 } | 1022 } |
1031 | 1023 |
1032 void set rawHashesAsBytes(core.List<core.int> _bytes) { | 1024 void set rawHashesAsBytes(core.List<core.int> _bytes) { |
1033 rawHashes = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+
", "-"); | 1025 rawHashes = |
| 1026 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1034 } | 1027 } |
1035 | 1028 |
1036 RawHashes(); | 1029 RawHashes(); |
1037 | 1030 |
1038 RawHashes.fromJson(core.Map _json) { | 1031 RawHashes.fromJson(core.Map _json) { |
1039 if (_json.containsKey("prefixSize")) { | 1032 if (_json.containsKey("prefixSize")) { |
1040 prefixSize = _json["prefixSize"]; | 1033 prefixSize = _json["prefixSize"]; |
1041 } | 1034 } |
1042 if (_json.containsKey("rawHashes")) { | 1035 if (_json.containsKey("rawHashes")) { |
1043 rawHashes = _json["rawHashes"]; | 1036 rawHashes = _json["rawHashes"]; |
1044 } | 1037 } |
1045 } | 1038 } |
1046 | 1039 |
1047 core.Map<core.String, core.Object> toJson() { | 1040 core.Map<core.String, core.Object> toJson() { |
1048 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1041 final core.Map<core.String, core.Object> _json = |
| 1042 new core.Map<core.String, core.Object>(); |
1049 if (prefixSize != null) { | 1043 if (prefixSize != null) { |
1050 _json["prefixSize"] = prefixSize; | 1044 _json["prefixSize"] = prefixSize; |
1051 } | 1045 } |
1052 if (rawHashes != null) { | 1046 if (rawHashes != null) { |
1053 _json["rawHashes"] = rawHashes; | 1047 _json["rawHashes"] = rawHashes; |
1054 } | 1048 } |
1055 return _json; | 1049 return _json; |
1056 } | 1050 } |
1057 } | 1051 } |
1058 | 1052 |
1059 /** A set of raw indices to remove from a local list. */ | 1053 /// A set of raw indices to remove from a local list. |
1060 class RawIndices { | 1054 class RawIndices { |
1061 /** The indices to remove from a lexicographically-sorted local list. */ | 1055 /// The indices to remove from a lexicographically-sorted local list. |
1062 core.List<core.int> indices; | 1056 core.List<core.int> indices; |
1063 | 1057 |
1064 RawIndices(); | 1058 RawIndices(); |
1065 | 1059 |
1066 RawIndices.fromJson(core.Map _json) { | 1060 RawIndices.fromJson(core.Map _json) { |
1067 if (_json.containsKey("indices")) { | 1061 if (_json.containsKey("indices")) { |
1068 indices = _json["indices"]; | 1062 indices = _json["indices"]; |
1069 } | 1063 } |
1070 } | 1064 } |
1071 | 1065 |
1072 core.Map<core.String, core.Object> toJson() { | 1066 core.Map<core.String, core.Object> toJson() { |
1073 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1067 final core.Map<core.String, core.Object> _json = |
| 1068 new core.Map<core.String, core.Object>(); |
1074 if (indices != null) { | 1069 if (indices != null) { |
1075 _json["indices"] = indices; | 1070 _json["indices"] = indices; |
1076 } | 1071 } |
1077 return _json; | 1072 return _json; |
1078 } | 1073 } |
1079 } | 1074 } |
1080 | 1075 |
1081 /** | 1076 /// The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or |
1082 * The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or | 1077 /// compressed removal indices. |
1083 * compressed removal indices. | |
1084 */ | |
1085 class RiceDeltaEncoding { | 1078 class RiceDeltaEncoding { |
1086 /** The encoded deltas that are encoded using the Golomb-Rice coder. */ | 1079 /// The encoded deltas that are encoded using the Golomb-Rice coder. |
1087 core.String encodedData; | 1080 core.String encodedData; |
1088 core.List<core.int> get encodedDataAsBytes { | 1081 core.List<core.int> get encodedDataAsBytes { |
1089 return convert.BASE64.decode(encodedData); | 1082 return convert.BASE64.decode(encodedData); |
1090 } | 1083 } |
1091 | 1084 |
1092 void set encodedDataAsBytes(core.List<core.int> _bytes) { | 1085 void set encodedDataAsBytes(core.List<core.int> _bytes) { |
1093 encodedData = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll(
"+", "-"); | 1086 encodedData = |
| 1087 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1094 } | 1088 } |
1095 /** | 1089 |
1096 * The offset of the first entry in the encoded data, or, if only a single | 1090 /// The offset of the first entry in the encoded data, or, if only a single |
1097 * integer was encoded, that single integer's value. | 1091 /// integer was encoded, that single integer's value. |
1098 */ | |
1099 core.String firstValue; | 1092 core.String firstValue; |
1100 /** | 1093 |
1101 * The number of entries that are delta encoded in the encoded data. If only a | 1094 /// The number of entries that are delta encoded in the encoded data. If only |
1102 * single integer was encoded, this will be zero and the single value will be | 1095 /// a |
1103 * stored in `first_value`. | 1096 /// single integer was encoded, this will be zero and the single value will |
1104 */ | 1097 /// be |
| 1098 /// stored in `first_value`. |
1105 core.int numEntries; | 1099 core.int numEntries; |
1106 /** | 1100 |
1107 * The Golomb-Rice parameter, which is a number between 2 and 28. This field | 1101 /// The Golomb-Rice parameter, which is a number between 2 and 28. This field |
1108 * is missing (that is, zero) if `num_entries` is zero. | 1102 /// is missing (that is, zero) if `num_entries` is zero. |
1109 */ | |
1110 core.int riceParameter; | 1103 core.int riceParameter; |
1111 | 1104 |
1112 RiceDeltaEncoding(); | 1105 RiceDeltaEncoding(); |
1113 | 1106 |
1114 RiceDeltaEncoding.fromJson(core.Map _json) { | 1107 RiceDeltaEncoding.fromJson(core.Map _json) { |
1115 if (_json.containsKey("encodedData")) { | 1108 if (_json.containsKey("encodedData")) { |
1116 encodedData = _json["encodedData"]; | 1109 encodedData = _json["encodedData"]; |
1117 } | 1110 } |
1118 if (_json.containsKey("firstValue")) { | 1111 if (_json.containsKey("firstValue")) { |
1119 firstValue = _json["firstValue"]; | 1112 firstValue = _json["firstValue"]; |
1120 } | 1113 } |
1121 if (_json.containsKey("numEntries")) { | 1114 if (_json.containsKey("numEntries")) { |
1122 numEntries = _json["numEntries"]; | 1115 numEntries = _json["numEntries"]; |
1123 } | 1116 } |
1124 if (_json.containsKey("riceParameter")) { | 1117 if (_json.containsKey("riceParameter")) { |
1125 riceParameter = _json["riceParameter"]; | 1118 riceParameter = _json["riceParameter"]; |
1126 } | 1119 } |
1127 } | 1120 } |
1128 | 1121 |
1129 core.Map<core.String, core.Object> toJson() { | 1122 core.Map<core.String, core.Object> toJson() { |
1130 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1123 final core.Map<core.String, core.Object> _json = |
| 1124 new core.Map<core.String, core.Object>(); |
1131 if (encodedData != null) { | 1125 if (encodedData != null) { |
1132 _json["encodedData"] = encodedData; | 1126 _json["encodedData"] = encodedData; |
1133 } | 1127 } |
1134 if (firstValue != null) { | 1128 if (firstValue != null) { |
1135 _json["firstValue"] = firstValue; | 1129 _json["firstValue"] = firstValue; |
1136 } | 1130 } |
1137 if (numEntries != null) { | 1131 if (numEntries != null) { |
1138 _json["numEntries"] = numEntries; | 1132 _json["numEntries"] = numEntries; |
1139 } | 1133 } |
1140 if (riceParameter != null) { | 1134 if (riceParameter != null) { |
1141 _json["riceParameter"] = riceParameter; | 1135 _json["riceParameter"] = riceParameter; |
1142 } | 1136 } |
1143 return _json; | 1137 return _json; |
1144 } | 1138 } |
1145 } | 1139 } |
1146 | 1140 |
1147 /** | 1141 /// An individual threat; for example, a malicious URL or its hash |
1148 * An individual threat; for example, a malicious URL or its hash | 1142 /// representation. Only one of these fields should be set. |
1149 * representation. Only one of these fields should be set. | |
1150 */ | |
1151 class ThreatEntry { | 1143 class ThreatEntry { |
1152 /** | 1144 /// The digest of an executable in SHA256 format. The API supports both |
1153 * The digest of an executable in SHA256 format. The API supports both | 1145 /// binary and hex digests. For JSON requests, digests are base64-encoded. |
1154 * binary and hex digests. For JSON requests, digests are base64-encoded. | |
1155 */ | |
1156 core.String digest; | 1146 core.String digest; |
1157 core.List<core.int> get digestAsBytes { | 1147 core.List<core.int> get digestAsBytes { |
1158 return convert.BASE64.decode(digest); | 1148 return convert.BASE64.decode(digest); |
1159 } | 1149 } |
1160 | 1150 |
1161 void set digestAsBytes(core.List<core.int> _bytes) { | 1151 void set digestAsBytes(core.List<core.int> _bytes) { |
1162 digest = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+",
"-"); | 1152 digest = |
| 1153 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1163 } | 1154 } |
1164 /** | 1155 |
1165 * A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 | 1156 /// A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 |
1166 * hash. This field is in binary format. For JSON requests, hashes are | 1157 /// hash. This field is in binary format. For JSON requests, hashes are |
1167 * base64-encoded. | 1158 /// base64-encoded. |
1168 */ | |
1169 core.String hash; | 1159 core.String hash; |
1170 core.List<core.int> get hashAsBytes { | 1160 core.List<core.int> get hashAsBytes { |
1171 return convert.BASE64.decode(hash); | 1161 return convert.BASE64.decode(hash); |
1172 } | 1162 } |
1173 | 1163 |
1174 void set hashAsBytes(core.List<core.int> _bytes) { | 1164 void set hashAsBytes(core.List<core.int> _bytes) { |
1175 hash = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | 1165 hash = |
| 1166 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1176 } | 1167 } |
1177 /** A URL. */ | 1168 |
| 1169 /// A URL. |
1178 core.String url; | 1170 core.String url; |
1179 | 1171 |
1180 ThreatEntry(); | 1172 ThreatEntry(); |
1181 | 1173 |
1182 ThreatEntry.fromJson(core.Map _json) { | 1174 ThreatEntry.fromJson(core.Map _json) { |
1183 if (_json.containsKey("digest")) { | 1175 if (_json.containsKey("digest")) { |
1184 digest = _json["digest"]; | 1176 digest = _json["digest"]; |
1185 } | 1177 } |
1186 if (_json.containsKey("hash")) { | 1178 if (_json.containsKey("hash")) { |
1187 hash = _json["hash"]; | 1179 hash = _json["hash"]; |
1188 } | 1180 } |
1189 if (_json.containsKey("url")) { | 1181 if (_json.containsKey("url")) { |
1190 url = _json["url"]; | 1182 url = _json["url"]; |
1191 } | 1183 } |
1192 } | 1184 } |
1193 | 1185 |
1194 core.Map<core.String, core.Object> toJson() { | 1186 core.Map<core.String, core.Object> toJson() { |
1195 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1187 final core.Map<core.String, core.Object> _json = |
| 1188 new core.Map<core.String, core.Object>(); |
1196 if (digest != null) { | 1189 if (digest != null) { |
1197 _json["digest"] = digest; | 1190 _json["digest"] = digest; |
1198 } | 1191 } |
1199 if (hash != null) { | 1192 if (hash != null) { |
1200 _json["hash"] = hash; | 1193 _json["hash"] = hash; |
1201 } | 1194 } |
1202 if (url != null) { | 1195 if (url != null) { |
1203 _json["url"] = url; | 1196 _json["url"] = url; |
1204 } | 1197 } |
1205 return _json; | 1198 return _json; |
1206 } | 1199 } |
1207 } | 1200 } |
1208 | 1201 |
1209 /** | 1202 /// The metadata associated with a specific threat entry. The client is |
1210 * The metadata associated with a specific threat entry. The client is expected | 1203 /// expected |
1211 * to know the metadata key/value pairs associated with each threat type. | 1204 /// to know the metadata key/value pairs associated with each threat type. |
1212 */ | |
1213 class ThreatEntryMetadata { | 1205 class ThreatEntryMetadata { |
1214 /** The metadata entries. */ | 1206 /// The metadata entries. |
1215 core.List<MetadataEntry> entries; | 1207 core.List<MetadataEntry> entries; |
1216 | 1208 |
1217 ThreatEntryMetadata(); | 1209 ThreatEntryMetadata(); |
1218 | 1210 |
1219 ThreatEntryMetadata.fromJson(core.Map _json) { | 1211 ThreatEntryMetadata.fromJson(core.Map _json) { |
1220 if (_json.containsKey("entries")) { | 1212 if (_json.containsKey("entries")) { |
1221 entries = _json["entries"].map((value) => new MetadataEntry.fromJson(value
)).toList(); | 1213 entries = _json["entries"] |
| 1214 .map((value) => new MetadataEntry.fromJson(value)) |
| 1215 .toList(); |
1222 } | 1216 } |
1223 } | 1217 } |
1224 | 1218 |
1225 core.Map<core.String, core.Object> toJson() { | 1219 core.Map<core.String, core.Object> toJson() { |
1226 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1220 final core.Map<core.String, core.Object> _json = |
| 1221 new core.Map<core.String, core.Object>(); |
1227 if (entries != null) { | 1222 if (entries != null) { |
1228 _json["entries"] = entries.map((value) => (value).toJson()).toList(); | 1223 _json["entries"] = entries.map((value) => (value).toJson()).toList(); |
1229 } | 1224 } |
1230 return _json; | 1225 return _json; |
1231 } | 1226 } |
1232 } | 1227 } |
1233 | 1228 |
1234 /** | 1229 /// A set of threats that should be added or removed from a client's local |
1235 * A set of threats that should be added or removed from a client's local | 1230 /// database. |
1236 * database. | |
1237 */ | |
1238 class ThreatEntrySet { | 1231 class ThreatEntrySet { |
1239 /** | 1232 /// The compression type for the entries in this set. |
1240 * The compression type for the entries in this set. | 1233 /// Possible string values are: |
1241 * Possible string values are: | 1234 /// - "COMPRESSION_TYPE_UNSPECIFIED" : Unknown. |
1242 * - "COMPRESSION_TYPE_UNSPECIFIED" : Unknown. | 1235 /// - "RAW" : Raw, uncompressed data. |
1243 * - "RAW" : Raw, uncompressed data. | 1236 /// - "RICE" : Rice-Golomb encoded data. |
1244 * - "RICE" : Rice-Golomb encoded data. | |
1245 */ | |
1246 core.String compressionType; | 1237 core.String compressionType; |
1247 /** The raw SHA256-formatted entries. */ | 1238 |
| 1239 /// The raw SHA256-formatted entries. |
1248 RawHashes rawHashes; | 1240 RawHashes rawHashes; |
1249 /** The raw removal indices for a local list. */ | 1241 |
| 1242 /// The raw removal indices for a local list. |
1250 RawIndices rawIndices; | 1243 RawIndices rawIndices; |
1251 /** | 1244 |
1252 * The encoded 4-byte prefixes of SHA256-formatted entries, using a | 1245 /// The encoded 4-byte prefixes of SHA256-formatted entries, using a |
1253 * Golomb-Rice encoding. The hashes are converted to uint32, sorted in | 1246 /// Golomb-Rice encoding. The hashes are converted to uint32, sorted in |
1254 * ascending order, then delta encoded and stored as encoded_data. | 1247 /// ascending order, then delta encoded and stored as encoded_data. |
1255 */ | |
1256 RiceDeltaEncoding riceHashes; | 1248 RiceDeltaEncoding riceHashes; |
1257 /** | 1249 |
1258 * The encoded local, lexicographically-sorted list indices, using a | 1250 /// The encoded local, lexicographically-sorted list indices, using a |
1259 * Golomb-Rice encoding. Used for sending compressed removal indices. The | 1251 /// Golomb-Rice encoding. Used for sending compressed removal indices. The |
1260 * removal indices (uint32) are sorted in ascending order, then delta encoded | 1252 /// removal indices (uint32) are sorted in ascending order, then delta |
1261 * and stored as encoded_data. | 1253 /// encoded |
1262 */ | 1254 /// and stored as encoded_data. |
1263 RiceDeltaEncoding riceIndices; | 1255 RiceDeltaEncoding riceIndices; |
1264 | 1256 |
1265 ThreatEntrySet(); | 1257 ThreatEntrySet(); |
1266 | 1258 |
1267 ThreatEntrySet.fromJson(core.Map _json) { | 1259 ThreatEntrySet.fromJson(core.Map _json) { |
1268 if (_json.containsKey("compressionType")) { | 1260 if (_json.containsKey("compressionType")) { |
1269 compressionType = _json["compressionType"]; | 1261 compressionType = _json["compressionType"]; |
1270 } | 1262 } |
1271 if (_json.containsKey("rawHashes")) { | 1263 if (_json.containsKey("rawHashes")) { |
1272 rawHashes = new RawHashes.fromJson(_json["rawHashes"]); | 1264 rawHashes = new RawHashes.fromJson(_json["rawHashes"]); |
1273 } | 1265 } |
1274 if (_json.containsKey("rawIndices")) { | 1266 if (_json.containsKey("rawIndices")) { |
1275 rawIndices = new RawIndices.fromJson(_json["rawIndices"]); | 1267 rawIndices = new RawIndices.fromJson(_json["rawIndices"]); |
1276 } | 1268 } |
1277 if (_json.containsKey("riceHashes")) { | 1269 if (_json.containsKey("riceHashes")) { |
1278 riceHashes = new RiceDeltaEncoding.fromJson(_json["riceHashes"]); | 1270 riceHashes = new RiceDeltaEncoding.fromJson(_json["riceHashes"]); |
1279 } | 1271 } |
1280 if (_json.containsKey("riceIndices")) { | 1272 if (_json.containsKey("riceIndices")) { |
1281 riceIndices = new RiceDeltaEncoding.fromJson(_json["riceIndices"]); | 1273 riceIndices = new RiceDeltaEncoding.fromJson(_json["riceIndices"]); |
1282 } | 1274 } |
1283 } | 1275 } |
1284 | 1276 |
1285 core.Map<core.String, core.Object> toJson() { | 1277 core.Map<core.String, core.Object> toJson() { |
1286 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1278 final core.Map<core.String, core.Object> _json = |
| 1279 new core.Map<core.String, core.Object>(); |
1287 if (compressionType != null) { | 1280 if (compressionType != null) { |
1288 _json["compressionType"] = compressionType; | 1281 _json["compressionType"] = compressionType; |
1289 } | 1282 } |
1290 if (rawHashes != null) { | 1283 if (rawHashes != null) { |
1291 _json["rawHashes"] = (rawHashes).toJson(); | 1284 _json["rawHashes"] = (rawHashes).toJson(); |
1292 } | 1285 } |
1293 if (rawIndices != null) { | 1286 if (rawIndices != null) { |
1294 _json["rawIndices"] = (rawIndices).toJson(); | 1287 _json["rawIndices"] = (rawIndices).toJson(); |
1295 } | 1288 } |
1296 if (riceHashes != null) { | 1289 if (riceHashes != null) { |
1297 _json["riceHashes"] = (riceHashes).toJson(); | 1290 _json["riceHashes"] = (riceHashes).toJson(); |
1298 } | 1291 } |
1299 if (riceIndices != null) { | 1292 if (riceIndices != null) { |
1300 _json["riceIndices"] = (riceIndices).toJson(); | 1293 _json["riceIndices"] = (riceIndices).toJson(); |
1301 } | 1294 } |
1302 return _json; | 1295 return _json; |
1303 } | 1296 } |
1304 } | 1297 } |
1305 | 1298 |
1306 /** | 1299 /// The information regarding one or more threats that a client submits when |
1307 * The information regarding one or more threats that a client submits when | 1300 /// checking for matches in threat lists. |
1308 * checking for matches in threat lists. | |
1309 */ | |
1310 class ThreatInfo { | 1301 class ThreatInfo { |
1311 /** The platform types to be checked. */ | 1302 /// The platform types to be checked. |
1312 core.List<core.String> platformTypes; | 1303 core.List<core.String> platformTypes; |
1313 /** The threat entries to be checked. */ | 1304 |
| 1305 /// The threat entries to be checked. |
1314 core.List<ThreatEntry> threatEntries; | 1306 core.List<ThreatEntry> threatEntries; |
1315 /** The entry types to be checked. */ | 1307 |
| 1308 /// The entry types to be checked. |
1316 core.List<core.String> threatEntryTypes; | 1309 core.List<core.String> threatEntryTypes; |
1317 /** The threat types to be checked. */ | 1310 |
| 1311 /// The threat types to be checked. |
1318 core.List<core.String> threatTypes; | 1312 core.List<core.String> threatTypes; |
1319 | 1313 |
1320 ThreatInfo(); | 1314 ThreatInfo(); |
1321 | 1315 |
1322 ThreatInfo.fromJson(core.Map _json) { | 1316 ThreatInfo.fromJson(core.Map _json) { |
1323 if (_json.containsKey("platformTypes")) { | 1317 if (_json.containsKey("platformTypes")) { |
1324 platformTypes = _json["platformTypes"]; | 1318 platformTypes = _json["platformTypes"]; |
1325 } | 1319 } |
1326 if (_json.containsKey("threatEntries")) { | 1320 if (_json.containsKey("threatEntries")) { |
1327 threatEntries = _json["threatEntries"].map((value) => new ThreatEntry.from
Json(value)).toList(); | 1321 threatEntries = _json["threatEntries"] |
| 1322 .map((value) => new ThreatEntry.fromJson(value)) |
| 1323 .toList(); |
1328 } | 1324 } |
1329 if (_json.containsKey("threatEntryTypes")) { | 1325 if (_json.containsKey("threatEntryTypes")) { |
1330 threatEntryTypes = _json["threatEntryTypes"]; | 1326 threatEntryTypes = _json["threatEntryTypes"]; |
1331 } | 1327 } |
1332 if (_json.containsKey("threatTypes")) { | 1328 if (_json.containsKey("threatTypes")) { |
1333 threatTypes = _json["threatTypes"]; | 1329 threatTypes = _json["threatTypes"]; |
1334 } | 1330 } |
1335 } | 1331 } |
1336 | 1332 |
1337 core.Map<core.String, core.Object> toJson() { | 1333 core.Map<core.String, core.Object> toJson() { |
1338 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1334 final core.Map<core.String, core.Object> _json = |
| 1335 new core.Map<core.String, core.Object>(); |
1339 if (platformTypes != null) { | 1336 if (platformTypes != null) { |
1340 _json["platformTypes"] = platformTypes; | 1337 _json["platformTypes"] = platformTypes; |
1341 } | 1338 } |
1342 if (threatEntries != null) { | 1339 if (threatEntries != null) { |
1343 _json["threatEntries"] = threatEntries.map((value) => (value).toJson()).to
List(); | 1340 _json["threatEntries"] = |
| 1341 threatEntries.map((value) => (value).toJson()).toList(); |
1344 } | 1342 } |
1345 if (threatEntryTypes != null) { | 1343 if (threatEntryTypes != null) { |
1346 _json["threatEntryTypes"] = threatEntryTypes; | 1344 _json["threatEntryTypes"] = threatEntryTypes; |
1347 } | 1345 } |
1348 if (threatTypes != null) { | 1346 if (threatTypes != null) { |
1349 _json["threatTypes"] = threatTypes; | 1347 _json["threatTypes"] = threatTypes; |
1350 } | 1348 } |
1351 return _json; | 1349 return _json; |
1352 } | 1350 } |
1353 } | 1351 } |
1354 | 1352 |
1355 /** | 1353 /// Describes an individual threat list. A list is defined by three parameters: |
1356 * Describes an individual threat list. A list is defined by three parameters: | 1354 /// the type of threat posed, the type of platform targeted by the threat, and |
1357 * the type of threat posed, the type of platform targeted by the threat, and | 1355 /// the type of entries in the list. |
1358 * the type of entries in the list. | |
1359 */ | |
1360 class ThreatListDescriptor { | 1356 class ThreatListDescriptor { |
1361 /** | 1357 /// The platform type targeted by the list's entries. |
1362 * The platform type targeted by the list's entries. | 1358 /// Possible string values are: |
1363 * Possible string values are: | 1359 /// - "PLATFORM_TYPE_UNSPECIFIED" : Unknown platform. |
1364 * - "PLATFORM_TYPE_UNSPECIFIED" : Unknown platform. | 1360 /// - "WINDOWS" : Threat posed to Windows. |
1365 * - "WINDOWS" : Threat posed to Windows. | 1361 /// - "LINUX" : Threat posed to Linux. |
1366 * - "LINUX" : Threat posed to Linux. | 1362 /// - "ANDROID" : Threat posed to Android. |
1367 * - "ANDROID" : Threat posed to Android. | 1363 /// - "OSX" : Threat posed to OS X. |
1368 * - "OSX" : Threat posed to OS X. | 1364 /// - "IOS" : Threat posed to iOS. |
1369 * - "IOS" : Threat posed to iOS. | 1365 /// - "ANY_PLATFORM" : Threat posed to at least one of the defined platforms. |
1370 * - "ANY_PLATFORM" : Threat posed to at least one of the defined platforms. | 1366 /// - "ALL_PLATFORMS" : Threat posed to all defined platforms. |
1371 * - "ALL_PLATFORMS" : Threat posed to all defined platforms. | 1367 /// - "CHROME" : Threat posed to Chrome. |
1372 * - "CHROME" : Threat posed to Chrome. | |
1373 */ | |
1374 core.String platformType; | 1368 core.String platformType; |
1375 /** | 1369 |
1376 * The entry types contained in the list. | 1370 /// The entry types contained in the list. |
1377 * Possible string values are: | 1371 /// Possible string values are: |
1378 * - "THREAT_ENTRY_TYPE_UNSPECIFIED" : Unspecified. | 1372 /// - "THREAT_ENTRY_TYPE_UNSPECIFIED" : Unspecified. |
1379 * - "URL" : A URL. | 1373 /// - "URL" : A URL. |
1380 * - "EXECUTABLE" : An executable program. | 1374 /// - "EXECUTABLE" : An executable program. |
1381 * - "IP_RANGE" : An IP range. | 1375 /// - "IP_RANGE" : An IP range. |
1382 * - "CHROME_EXTENSION" : Chrome extension. | 1376 /// - "CHROME_EXTENSION" : Chrome extension. |
1383 * - "FILENAME" : Filename. | 1377 /// - "FILENAME" : Filename. |
1384 * - "CERT" : CERT | 1378 /// - "CERT" : CERT |
1385 */ | |
1386 core.String threatEntryType; | 1379 core.String threatEntryType; |
1387 /** | 1380 |
1388 * The threat type posed by the list's entries. | 1381 /// The threat type posed by the list's entries. |
1389 * Possible string values are: | 1382 /// Possible string values are: |
1390 * - "THREAT_TYPE_UNSPECIFIED" : Unknown. | 1383 /// - "THREAT_TYPE_UNSPECIFIED" : Unknown. |
1391 * - "MALWARE" : Malware threat type. | 1384 /// - "MALWARE" : Malware threat type. |
1392 * - "SOCIAL_ENGINEERING" : Social engineering threat type. | 1385 /// - "SOCIAL_ENGINEERING" : Social engineering threat type. |
1393 * - "UNWANTED_SOFTWARE" : Unwanted software threat type. | 1386 /// - "UNWANTED_SOFTWARE" : Unwanted software threat type. |
1394 * - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application | 1387 /// - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application |
1395 * threat type. | 1388 /// threat type. |
1396 * - "SOCIAL_ENGINEERING_INTERNAL" : Social engineering threat type for | 1389 /// - "SOCIAL_ENGINEERING_INTERNAL" : Social engineering threat type for |
1397 * internal use. | 1390 /// internal use. |
1398 * - "API_ABUSE" : API abuse threat type. | 1391 /// - "API_ABUSE" : API abuse threat type. |
1399 * - "MALICIOUS_BINARY" : Malicious binary threat type. | 1392 /// - "MALICIOUS_BINARY" : Malicious binary threat type. |
1400 * - "CSD_WHITELIST" : Client side detection whitelist threat type. | 1393 /// - "CSD_WHITELIST" : Client side detection whitelist threat type. |
1401 * - "CSD_DOWNLOAD_WHITELIST" : Client side download detection whitelist | 1394 /// - "CSD_DOWNLOAD_WHITELIST" : Client side download detection whitelist |
1402 * threat type. | 1395 /// threat type. |
1403 * - "CLIENT_INCIDENT" : Client incident threat type. | 1396 /// - "CLIENT_INCIDENT" : Client incident threat type. |
1404 * - "CLIENT_INCIDENT_WHITELIST" : Whitelist used when detecting client | 1397 /// - "CLIENT_INCIDENT_WHITELIST" : Whitelist used when detecting client |
1405 * incident threats. | 1398 /// incident threats. |
1406 * This enum was never launched and should be re-used for the next list. | 1399 /// This enum was never launched and should be re-used for the next list. |
1407 * - "APK_MALWARE_OFFLINE" : List used for offline APK checks in PAM. | 1400 /// - "APK_MALWARE_OFFLINE" : List used for offline APK checks in PAM. |
1408 * - "SUBRESOURCE_FILTER" : Patterns to be used for activating the subresource | 1401 /// - "SUBRESOURCE_FILTER" : Patterns to be used for activating the |
1409 * filter. Interstitial | 1402 /// subresource filter. Interstitial |
1410 * will not be shown for patterns from this list. | 1403 /// will not be shown for patterns from this list. |
1411 */ | |
1412 core.String threatType; | 1404 core.String threatType; |
1413 | 1405 |
1414 ThreatListDescriptor(); | 1406 ThreatListDescriptor(); |
1415 | 1407 |
1416 ThreatListDescriptor.fromJson(core.Map _json) { | 1408 ThreatListDescriptor.fromJson(core.Map _json) { |
1417 if (_json.containsKey("platformType")) { | 1409 if (_json.containsKey("platformType")) { |
1418 platformType = _json["platformType"]; | 1410 platformType = _json["platformType"]; |
1419 } | 1411 } |
1420 if (_json.containsKey("threatEntryType")) { | 1412 if (_json.containsKey("threatEntryType")) { |
1421 threatEntryType = _json["threatEntryType"]; | 1413 threatEntryType = _json["threatEntryType"]; |
1422 } | 1414 } |
1423 if (_json.containsKey("threatType")) { | 1415 if (_json.containsKey("threatType")) { |
1424 threatType = _json["threatType"]; | 1416 threatType = _json["threatType"]; |
1425 } | 1417 } |
1426 } | 1418 } |
1427 | 1419 |
1428 core.Map<core.String, core.Object> toJson() { | 1420 core.Map<core.String, core.Object> toJson() { |
1429 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1421 final core.Map<core.String, core.Object> _json = |
| 1422 new core.Map<core.String, core.Object>(); |
1430 if (platformType != null) { | 1423 if (platformType != null) { |
1431 _json["platformType"] = platformType; | 1424 _json["platformType"] = platformType; |
1432 } | 1425 } |
1433 if (threatEntryType != null) { | 1426 if (threatEntryType != null) { |
1434 _json["threatEntryType"] = threatEntryType; | 1427 _json["threatEntryType"] = threatEntryType; |
1435 } | 1428 } |
1436 if (threatType != null) { | 1429 if (threatType != null) { |
1437 _json["threatType"] = threatType; | 1430 _json["threatType"] = threatType; |
1438 } | 1431 } |
1439 return _json; | 1432 return _json; |
1440 } | 1433 } |
1441 } | 1434 } |
1442 | 1435 |
1443 /** A match when checking a threat entry in the Safe Browsing threat lists. */ | 1436 /// A match when checking a threat entry in the Safe Browsing threat lists. |
1444 class ThreatMatch { | 1437 class ThreatMatch { |
1445 /** | 1438 /// The cache lifetime for the returned match. Clients must not cache this |
1446 * The cache lifetime for the returned match. Clients must not cache this | 1439 /// response for more than this duration to avoid false positives. |
1447 * response for more than this duration to avoid false positives. | |
1448 */ | |
1449 core.String cacheDuration; | 1440 core.String cacheDuration; |
1450 /** | 1441 |
1451 * The platform type matching this threat. | 1442 /// The platform type matching this threat. |
1452 * Possible string values are: | 1443 /// Possible string values are: |
1453 * - "PLATFORM_TYPE_UNSPECIFIED" : Unknown platform. | 1444 /// - "PLATFORM_TYPE_UNSPECIFIED" : Unknown platform. |
1454 * - "WINDOWS" : Threat posed to Windows. | 1445 /// - "WINDOWS" : Threat posed to Windows. |
1455 * - "LINUX" : Threat posed to Linux. | 1446 /// - "LINUX" : Threat posed to Linux. |
1456 * - "ANDROID" : Threat posed to Android. | 1447 /// - "ANDROID" : Threat posed to Android. |
1457 * - "OSX" : Threat posed to OS X. | 1448 /// - "OSX" : Threat posed to OS X. |
1458 * - "IOS" : Threat posed to iOS. | 1449 /// - "IOS" : Threat posed to iOS. |
1459 * - "ANY_PLATFORM" : Threat posed to at least one of the defined platforms. | 1450 /// - "ANY_PLATFORM" : Threat posed to at least one of the defined platforms. |
1460 * - "ALL_PLATFORMS" : Threat posed to all defined platforms. | 1451 /// - "ALL_PLATFORMS" : Threat posed to all defined platforms. |
1461 * - "CHROME" : Threat posed to Chrome. | 1452 /// - "CHROME" : Threat posed to Chrome. |
1462 */ | |
1463 core.String platformType; | 1453 core.String platformType; |
1464 /** The threat matching this threat. */ | 1454 |
| 1455 /// The threat matching this threat. |
1465 ThreatEntry threat; | 1456 ThreatEntry threat; |
1466 /** Optional metadata associated with this threat. */ | 1457 |
| 1458 /// Optional metadata associated with this threat. |
1467 ThreatEntryMetadata threatEntryMetadata; | 1459 ThreatEntryMetadata threatEntryMetadata; |
1468 /** | 1460 |
1469 * The threat entry type matching this threat. | 1461 /// The threat entry type matching this threat. |
1470 * Possible string values are: | 1462 /// Possible string values are: |
1471 * - "THREAT_ENTRY_TYPE_UNSPECIFIED" : Unspecified. | 1463 /// - "THREAT_ENTRY_TYPE_UNSPECIFIED" : Unspecified. |
1472 * - "URL" : A URL. | 1464 /// - "URL" : A URL. |
1473 * - "EXECUTABLE" : An executable program. | 1465 /// - "EXECUTABLE" : An executable program. |
1474 * - "IP_RANGE" : An IP range. | 1466 /// - "IP_RANGE" : An IP range. |
1475 * - "CHROME_EXTENSION" : Chrome extension. | 1467 /// - "CHROME_EXTENSION" : Chrome extension. |
1476 * - "FILENAME" : Filename. | 1468 /// - "FILENAME" : Filename. |
1477 * - "CERT" : CERT | 1469 /// - "CERT" : CERT |
1478 */ | |
1479 core.String threatEntryType; | 1470 core.String threatEntryType; |
1480 /** | 1471 |
1481 * The threat type matching this threat. | 1472 /// The threat type matching this threat. |
1482 * Possible string values are: | 1473 /// Possible string values are: |
1483 * - "THREAT_TYPE_UNSPECIFIED" : Unknown. | 1474 /// - "THREAT_TYPE_UNSPECIFIED" : Unknown. |
1484 * - "MALWARE" : Malware threat type. | 1475 /// - "MALWARE" : Malware threat type. |
1485 * - "SOCIAL_ENGINEERING" : Social engineering threat type. | 1476 /// - "SOCIAL_ENGINEERING" : Social engineering threat type. |
1486 * - "UNWANTED_SOFTWARE" : Unwanted software threat type. | 1477 /// - "UNWANTED_SOFTWARE" : Unwanted software threat type. |
1487 * - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application | 1478 /// - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application |
1488 * threat type. | 1479 /// threat type. |
1489 * - "SOCIAL_ENGINEERING_INTERNAL" : Social engineering threat type for | 1480 /// - "SOCIAL_ENGINEERING_INTERNAL" : Social engineering threat type for |
1490 * internal use. | 1481 /// internal use. |
1491 * - "API_ABUSE" : API abuse threat type. | 1482 /// - "API_ABUSE" : API abuse threat type. |
1492 * - "MALICIOUS_BINARY" : Malicious binary threat type. | 1483 /// - "MALICIOUS_BINARY" : Malicious binary threat type. |
1493 * - "CSD_WHITELIST" : Client side detection whitelist threat type. | 1484 /// - "CSD_WHITELIST" : Client side detection whitelist threat type. |
1494 * - "CSD_DOWNLOAD_WHITELIST" : Client side download detection whitelist | 1485 /// - "CSD_DOWNLOAD_WHITELIST" : Client side download detection whitelist |
1495 * threat type. | 1486 /// threat type. |
1496 * - "CLIENT_INCIDENT" : Client incident threat type. | 1487 /// - "CLIENT_INCIDENT" : Client incident threat type. |
1497 * - "CLIENT_INCIDENT_WHITELIST" : Whitelist used when detecting client | 1488 /// - "CLIENT_INCIDENT_WHITELIST" : Whitelist used when detecting client |
1498 * incident threats. | 1489 /// incident threats. |
1499 * This enum was never launched and should be re-used for the next list. | 1490 /// This enum was never launched and should be re-used for the next list. |
1500 * - "APK_MALWARE_OFFLINE" : List used for offline APK checks in PAM. | 1491 /// - "APK_MALWARE_OFFLINE" : List used for offline APK checks in PAM. |
1501 * - "SUBRESOURCE_FILTER" : Patterns to be used for activating the subresource | 1492 /// - "SUBRESOURCE_FILTER" : Patterns to be used for activating the |
1502 * filter. Interstitial | 1493 /// subresource filter. Interstitial |
1503 * will not be shown for patterns from this list. | 1494 /// will not be shown for patterns from this list. |
1504 */ | |
1505 core.String threatType; | 1495 core.String threatType; |
1506 | 1496 |
1507 ThreatMatch(); | 1497 ThreatMatch(); |
1508 | 1498 |
1509 ThreatMatch.fromJson(core.Map _json) { | 1499 ThreatMatch.fromJson(core.Map _json) { |
1510 if (_json.containsKey("cacheDuration")) { | 1500 if (_json.containsKey("cacheDuration")) { |
1511 cacheDuration = _json["cacheDuration"]; | 1501 cacheDuration = _json["cacheDuration"]; |
1512 } | 1502 } |
1513 if (_json.containsKey("platformType")) { | 1503 if (_json.containsKey("platformType")) { |
1514 platformType = _json["platformType"]; | 1504 platformType = _json["platformType"]; |
1515 } | 1505 } |
1516 if (_json.containsKey("threat")) { | 1506 if (_json.containsKey("threat")) { |
1517 threat = new ThreatEntry.fromJson(_json["threat"]); | 1507 threat = new ThreatEntry.fromJson(_json["threat"]); |
1518 } | 1508 } |
1519 if (_json.containsKey("threatEntryMetadata")) { | 1509 if (_json.containsKey("threatEntryMetadata")) { |
1520 threatEntryMetadata = new ThreatEntryMetadata.fromJson(_json["threatEntryM
etadata"]); | 1510 threatEntryMetadata = |
| 1511 new ThreatEntryMetadata.fromJson(_json["threatEntryMetadata"]); |
1521 } | 1512 } |
1522 if (_json.containsKey("threatEntryType")) { | 1513 if (_json.containsKey("threatEntryType")) { |
1523 threatEntryType = _json["threatEntryType"]; | 1514 threatEntryType = _json["threatEntryType"]; |
1524 } | 1515 } |
1525 if (_json.containsKey("threatType")) { | 1516 if (_json.containsKey("threatType")) { |
1526 threatType = _json["threatType"]; | 1517 threatType = _json["threatType"]; |
1527 } | 1518 } |
1528 } | 1519 } |
1529 | 1520 |
1530 core.Map<core.String, core.Object> toJson() { | 1521 core.Map<core.String, core.Object> toJson() { |
1531 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1522 final core.Map<core.String, core.Object> _json = |
| 1523 new core.Map<core.String, core.Object>(); |
1532 if (cacheDuration != null) { | 1524 if (cacheDuration != null) { |
1533 _json["cacheDuration"] = cacheDuration; | 1525 _json["cacheDuration"] = cacheDuration; |
1534 } | 1526 } |
1535 if (platformType != null) { | 1527 if (platformType != null) { |
1536 _json["platformType"] = platformType; | 1528 _json["platformType"] = platformType; |
1537 } | 1529 } |
1538 if (threat != null) { | 1530 if (threat != null) { |
1539 _json["threat"] = (threat).toJson(); | 1531 _json["threat"] = (threat).toJson(); |
1540 } | 1532 } |
1541 if (threatEntryMetadata != null) { | 1533 if (threatEntryMetadata != null) { |
1542 _json["threatEntryMetadata"] = (threatEntryMetadata).toJson(); | 1534 _json["threatEntryMetadata"] = (threatEntryMetadata).toJson(); |
1543 } | 1535 } |
1544 if (threatEntryType != null) { | 1536 if (threatEntryType != null) { |
1545 _json["threatEntryType"] = threatEntryType; | 1537 _json["threatEntryType"] = threatEntryType; |
1546 } | 1538 } |
1547 if (threatType != null) { | 1539 if (threatType != null) { |
1548 _json["threatType"] = threatType; | 1540 _json["threatType"] = threatType; |
1549 } | 1541 } |
1550 return _json; | 1542 return _json; |
1551 } | 1543 } |
1552 } | 1544 } |
OLD | NEW |