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' show |
13 ApiRequestError, DetailedApiRequestError; | 13 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 /** |
18 * The Safe Browsing API is an experimental API that allows client applications | 18 * Enables client applications to check web resources (most commonly URLs) |
19 * to check URLs against Google's constantly-updated blacklists of suspected | 19 * against Google-generated lists of unsafe web resources. |
20 * phishing and malware pages. Your client application can use the API to | |
21 * download an encrypted table for local, client-side lookups of URLs. | |
22 */ | 20 */ |
23 class SafebrowsingApi { | 21 class SafebrowsingApi { |
24 | 22 |
25 final commons.ApiRequester _requester; | 23 final commons.ApiRequester _requester; |
26 | 24 |
27 EncodedFullHashesResourceApi get encodedFullHashes => new EncodedFullHashesRes
ourceApi(_requester); | 25 EncodedFullHashesResourceApi get encodedFullHashes => new EncodedFullHashesRes
ourceApi(_requester); |
28 EncodedUpdatesResourceApi get encodedUpdates => new EncodedUpdatesResourceApi(
_requester); | 26 EncodedUpdatesResourceApi get encodedUpdates => new EncodedUpdatesResourceApi(
_requester); |
29 FullHashesResourceApi get fullHashes => new FullHashesResourceApi(_requester); | 27 FullHashesResourceApi get fullHashes => new FullHashesResourceApi(_requester); |
30 ThreatListUpdatesResourceApi get threatListUpdates => new ThreatListUpdatesRes
ourceApi(_requester); | 28 ThreatListUpdatesResourceApi get threatListUpdates => new ThreatListUpdatesRes
ourceApi(_requester); |
31 ThreatListsResourceApi get threatLists => new ThreatListsResourceApi(_requeste
r); | 29 ThreatListsResourceApi get threatLists => new ThreatListsResourceApi(_requeste
r); |
32 ThreatMatchesResourceApi get threatMatches => new ThreatMatchesResourceApi(_re
quester); | 30 ThreatMatchesResourceApi get threatMatches => new ThreatMatchesResourceApi(_re
quester); |
33 | 31 |
34 SafebrowsingApi(http.Client client, {core.String rootUrl: "https://safebrowsin
g.googleapis.com/", core.String servicePath: ""}) : | 32 SafebrowsingApi(http.Client client, {core.String rootUrl: "https://safebrowsin
g.googleapis.com/", core.String servicePath: ""}) : |
35 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 33 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
36 } | 34 } |
37 | 35 |
38 | 36 |
39 class EncodedFullHashesResourceApi { | 37 class EncodedFullHashesResourceApi { |
40 final commons.ApiRequester _requester; | 38 final commons.ApiRequester _requester; |
41 | 39 |
42 EncodedFullHashesResourceApi(commons.ApiRequester client) : | 40 EncodedFullHashesResourceApi(commons.ApiRequester client) : |
43 _requester = client; | 41 _requester = client; |
44 | 42 |
45 /** | 43 /** |
46 * Request parameters: | 44 * Request parameters: |
47 * | 45 * |
48 * [encodedRequest] - A serialized FindFullHashesRequest proto. | 46 * [encodedRequest] - A serialized FindFullHashesRequest proto. |
49 * | 47 * |
50 * [clientVersion] - The version of the client implementation. | |
51 * | |
52 * [clientId] - A client ID that (hopefully) uniquely identifies the client | 48 * [clientId] - A client ID that (hopefully) uniquely identifies the client |
53 * implementation | 49 * implementation |
54 * of the Safe Browsing API. | 50 * of the Safe Browsing API. |
55 * | 51 * |
| 52 * [clientVersion] - The version of the client implementation. |
| 53 * |
56 * Completes with a [FindFullHashesResponse]. | 54 * Completes with a [FindFullHashesResponse]. |
57 * | 55 * |
58 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 56 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
59 * error. | 57 * error. |
60 * | 58 * |
61 * If the used [http.Client] completes with an error when making a REST call, | 59 * If the used [http.Client] completes with an error when making a REST call, |
62 * this method will complete with the same error. | 60 * this method will complete with the same error. |
63 */ | 61 */ |
64 async.Future<FindFullHashesResponse> get(core.String encodedRequest, {core.Str
ing clientVersion, core.String clientId}) { | 62 async.Future<FindFullHashesResponse> get(core.String encodedRequest, {core.Str
ing clientId, core.String clientVersion}) { |
65 var _url = null; | 63 var _url = null; |
66 var _queryParams = new core.Map(); | 64 var _queryParams = new core.Map(); |
67 var _uploadMedia = null; | 65 var _uploadMedia = null; |
68 var _uploadOptions = null; | 66 var _uploadOptions = null; |
69 var _downloadOptions = commons.DownloadOptions.Metadata; | 67 var _downloadOptions = commons.DownloadOptions.Metadata; |
70 var _body = null; | 68 var _body = null; |
71 | 69 |
72 if (encodedRequest == null) { | 70 if (encodedRequest == null) { |
73 throw new core.ArgumentError("Parameter encodedRequest is required."); | 71 throw new core.ArgumentError("Parameter encodedRequest is required."); |
74 } | 72 } |
| 73 if (clientId != null) { |
| 74 _queryParams["clientId"] = [clientId]; |
| 75 } |
75 if (clientVersion != null) { | 76 if (clientVersion != null) { |
76 _queryParams["clientVersion"] = [clientVersion]; | 77 _queryParams["clientVersion"] = [clientVersion]; |
77 } | 78 } |
78 if (clientId != null) { | |
79 _queryParams["clientId"] = [clientId]; | |
80 } | |
81 | 79 |
82 _url = 'v4/encodedFullHashes/' + commons.Escaper.ecapeVariable('$encodedRequ
est'); | 80 _url = 'v4/encodedFullHashes/' + commons.Escaper.ecapeVariable('$encodedRequ
est'); |
83 | 81 |
84 var _response = _requester.request(_url, | 82 var _response = _requester.request(_url, |
85 "GET", | 83 "GET", |
86 body: _body, | 84 body: _body, |
87 queryParams: _queryParams, | 85 queryParams: _queryParams, |
88 uploadOptions: _uploadOptions, | 86 uploadOptions: _uploadOptions, |
89 uploadMedia: _uploadMedia, | 87 uploadMedia: _uploadMedia, |
90 downloadOptions: _downloadOptions); | 88 downloadOptions: _downloadOptions); |
91 return _response.then((data) => new FindFullHashesResponse.fromJson(data)); | 89 return _response.then((data) => new FindFullHashesResponse.fromJson(data)); |
92 } | 90 } |
93 | 91 |
94 } | 92 } |
95 | 93 |
96 | 94 |
97 class EncodedUpdatesResourceApi { | 95 class EncodedUpdatesResourceApi { |
98 final commons.ApiRequester _requester; | 96 final commons.ApiRequester _requester; |
99 | 97 |
100 EncodedUpdatesResourceApi(commons.ApiRequester client) : | 98 EncodedUpdatesResourceApi(commons.ApiRequester client) : |
101 _requester = client; | 99 _requester = client; |
102 | 100 |
103 /** | 101 /** |
104 * Request parameters: | 102 * Request parameters: |
105 * | 103 * |
106 * [encodedRequest] - A serialized FetchThreatListUpdatesRequest proto. | 104 * [encodedRequest] - A serialized FetchThreatListUpdatesRequest proto. |
107 * | 105 * |
108 * [clientVersion] - The version of the client implementation. | |
109 * | |
110 * [clientId] - A client ID that uniquely identifies the client implementation | 106 * [clientId] - A client ID that uniquely identifies the client implementation |
111 * of the Safe | 107 * of the Safe |
112 * Browsing API. | 108 * Browsing API. |
113 * | 109 * |
| 110 * [clientVersion] - The version of the client implementation. |
| 111 * |
114 * Completes with a [FetchThreatListUpdatesResponse]. | 112 * Completes with a [FetchThreatListUpdatesResponse]. |
115 * | 113 * |
116 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 114 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
117 * error. | 115 * error. |
118 * | 116 * |
119 * If the used [http.Client] completes with an error when making a REST call, | 117 * If the used [http.Client] completes with an error when making a REST call, |
120 * this method will complete with the same error. | 118 * this method will complete with the same error. |
121 */ | 119 */ |
122 async.Future<FetchThreatListUpdatesResponse> get(core.String encodedRequest, {
core.String clientVersion, core.String clientId}) { | 120 async.Future<FetchThreatListUpdatesResponse> get(core.String encodedRequest, {
core.String clientId, core.String clientVersion}) { |
123 var _url = null; | 121 var _url = null; |
124 var _queryParams = new core.Map(); | 122 var _queryParams = new core.Map(); |
125 var _uploadMedia = null; | 123 var _uploadMedia = null; |
126 var _uploadOptions = null; | 124 var _uploadOptions = null; |
127 var _downloadOptions = commons.DownloadOptions.Metadata; | 125 var _downloadOptions = commons.DownloadOptions.Metadata; |
128 var _body = null; | 126 var _body = null; |
129 | 127 |
130 if (encodedRequest == null) { | 128 if (encodedRequest == null) { |
131 throw new core.ArgumentError("Parameter encodedRequest is required."); | 129 throw new core.ArgumentError("Parameter encodedRequest is required."); |
132 } | 130 } |
| 131 if (clientId != null) { |
| 132 _queryParams["clientId"] = [clientId]; |
| 133 } |
133 if (clientVersion != null) { | 134 if (clientVersion != null) { |
134 _queryParams["clientVersion"] = [clientVersion]; | 135 _queryParams["clientVersion"] = [clientVersion]; |
135 } | 136 } |
136 if (clientId != null) { | |
137 _queryParams["clientId"] = [clientId]; | |
138 } | |
139 | 137 |
140 _url = 'v4/encodedUpdates/' + commons.Escaper.ecapeVariable('$encodedRequest
'); | 138 _url = 'v4/encodedUpdates/' + commons.Escaper.ecapeVariable('$encodedRequest
'); |
141 | 139 |
142 var _response = _requester.request(_url, | 140 var _response = _requester.request(_url, |
143 "GET", | 141 "GET", |
144 body: _body, | 142 body: _body, |
145 queryParams: _queryParams, | 143 queryParams: _queryParams, |
146 uploadOptions: _uploadOptions, | 144 uploadOptions: _uploadOptions, |
147 uploadMedia: _uploadMedia, | 145 uploadMedia: _uploadMedia, |
148 downloadOptions: _downloadOptions); | 146 downloadOptions: _downloadOptions); |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 core.String threatEntryType; | 738 core.String threatEntryType; |
741 /** | 739 /** |
742 * The type of threat posed by entries present in the list. | 740 * The type of threat posed by entries present in the list. |
743 * Possible string values are: | 741 * Possible string values are: |
744 * - "THREAT_TYPE_UNSPECIFIED" : Unknown. | 742 * - "THREAT_TYPE_UNSPECIFIED" : Unknown. |
745 * - "MALWARE" : Malware threat type. | 743 * - "MALWARE" : Malware threat type. |
746 * - "SOCIAL_ENGINEERING" : Social engineering threat type. | 744 * - "SOCIAL_ENGINEERING" : Social engineering threat type. |
747 * - "UNWANTED_SOFTWARE" : Unwanted software threat type. | 745 * - "UNWANTED_SOFTWARE" : Unwanted software threat type. |
748 * - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application | 746 * - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application |
749 * threat type. | 747 * threat type. |
| 748 * - "SOCIAL_ENGINEERING_INTERNAL" : Social engineering threat type for |
| 749 * internal use. |
| 750 * - "API_ABUSE" : API abuse threat type. |
750 * - "MALICIOUS_BINARY" : Malicious binary threat type. | 751 * - "MALICIOUS_BINARY" : Malicious binary threat type. |
| 752 * - "CSD_WHITELIST" : Client side detection whitelist threat type. |
| 753 * - "CSD_DOWNLOAD_WHITELIST" : Client side download detection whitelist |
| 754 * threat type. |
| 755 * - "CLIENT_INCIDENT" : Client incident threat type. |
| 756 * - "CLIENT_INCIDENT_WHITELIST" : Whitelist used when detecting client |
| 757 * incident threats. |
| 758 * 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. |
| 760 * - "SUBRESOURCE_FILTER" : Patterns to be used for activating the subresource |
| 761 * filter. Interstitial |
| 762 * will not be shown for patterns from this list. |
751 */ | 763 */ |
752 core.String threatType; | 764 core.String threatType; |
753 | 765 |
754 ListUpdateRequest(); | 766 ListUpdateRequest(); |
755 | 767 |
756 ListUpdateRequest.fromJson(core.Map _json) { | 768 ListUpdateRequest.fromJson(core.Map _json) { |
757 if (_json.containsKey("constraints")) { | 769 if (_json.containsKey("constraints")) { |
758 constraints = new Constraints.fromJson(_json["constraints"]); | 770 constraints = new Constraints.fromJson(_json["constraints"]); |
759 } | 771 } |
760 if (_json.containsKey("platformType")) { | 772 if (_json.containsKey("platformType")) { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 core.String threatEntryType; | 874 core.String threatEntryType; |
863 /** | 875 /** |
864 * The threat type for which data is returned. | 876 * The threat type for which data is returned. |
865 * Possible string values are: | 877 * Possible string values are: |
866 * - "THREAT_TYPE_UNSPECIFIED" : Unknown. | 878 * - "THREAT_TYPE_UNSPECIFIED" : Unknown. |
867 * - "MALWARE" : Malware threat type. | 879 * - "MALWARE" : Malware threat type. |
868 * - "SOCIAL_ENGINEERING" : Social engineering threat type. | 880 * - "SOCIAL_ENGINEERING" : Social engineering threat type. |
869 * - "UNWANTED_SOFTWARE" : Unwanted software threat type. | 881 * - "UNWANTED_SOFTWARE" : Unwanted software threat type. |
870 * - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application | 882 * - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application |
871 * threat type. | 883 * threat type. |
| 884 * - "SOCIAL_ENGINEERING_INTERNAL" : Social engineering threat type for |
| 885 * internal use. |
| 886 * - "API_ABUSE" : API abuse threat type. |
872 * - "MALICIOUS_BINARY" : Malicious binary threat type. | 887 * - "MALICIOUS_BINARY" : Malicious binary threat type. |
| 888 * - "CSD_WHITELIST" : Client side detection whitelist threat type. |
| 889 * - "CSD_DOWNLOAD_WHITELIST" : Client side download detection whitelist |
| 890 * threat type. |
| 891 * - "CLIENT_INCIDENT" : Client incident threat type. |
| 892 * - "CLIENT_INCIDENT_WHITELIST" : Whitelist used when detecting client |
| 893 * incident threats. |
| 894 * 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. |
| 896 * - "SUBRESOURCE_FILTER" : Patterns to be used for activating the subresource |
| 897 * filter. Interstitial |
| 898 * will not be shown for patterns from this list. |
873 */ | 899 */ |
874 core.String threatType; | 900 core.String threatType; |
875 | 901 |
876 ListUpdateResponse(); | 902 ListUpdateResponse(); |
877 | 903 |
878 ListUpdateResponse.fromJson(core.Map _json) { | 904 ListUpdateResponse.fromJson(core.Map _json) { |
879 if (_json.containsKey("additions")) { | 905 if (_json.containsKey("additions")) { |
880 additions = _json["additions"].map((value) => new ThreatEntrySet.fromJson(
value)).toList(); | 906 additions = _json["additions"].map((value) => new ThreatEntrySet.fromJson(
value)).toList(); |
881 } | 907 } |
882 if (_json.containsKey("checksum")) { | 908 if (_json.containsKey("checksum")) { |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 core.String threatEntryType; | 1386 core.String threatEntryType; |
1361 /** | 1387 /** |
1362 * The threat type posed by the list's entries. | 1388 * The threat type posed by the list's entries. |
1363 * Possible string values are: | 1389 * Possible string values are: |
1364 * - "THREAT_TYPE_UNSPECIFIED" : Unknown. | 1390 * - "THREAT_TYPE_UNSPECIFIED" : Unknown. |
1365 * - "MALWARE" : Malware threat type. | 1391 * - "MALWARE" : Malware threat type. |
1366 * - "SOCIAL_ENGINEERING" : Social engineering threat type. | 1392 * - "SOCIAL_ENGINEERING" : Social engineering threat type. |
1367 * - "UNWANTED_SOFTWARE" : Unwanted software threat type. | 1393 * - "UNWANTED_SOFTWARE" : Unwanted software threat type. |
1368 * - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application | 1394 * - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application |
1369 * threat type. | 1395 * threat type. |
| 1396 * - "SOCIAL_ENGINEERING_INTERNAL" : Social engineering threat type for |
| 1397 * internal use. |
| 1398 * - "API_ABUSE" : API abuse threat type. |
1370 * - "MALICIOUS_BINARY" : Malicious binary threat type. | 1399 * - "MALICIOUS_BINARY" : Malicious binary threat type. |
| 1400 * - "CSD_WHITELIST" : Client side detection whitelist threat type. |
| 1401 * - "CSD_DOWNLOAD_WHITELIST" : Client side download detection whitelist |
| 1402 * threat type. |
| 1403 * - "CLIENT_INCIDENT" : Client incident threat type. |
| 1404 * - "CLIENT_INCIDENT_WHITELIST" : Whitelist used when detecting client |
| 1405 * incident threats. |
| 1406 * 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. |
| 1408 * - "SUBRESOURCE_FILTER" : Patterns to be used for activating the subresource |
| 1409 * filter. Interstitial |
| 1410 * will not be shown for patterns from this list. |
1371 */ | 1411 */ |
1372 core.String threatType; | 1412 core.String threatType; |
1373 | 1413 |
1374 ThreatListDescriptor(); | 1414 ThreatListDescriptor(); |
1375 | 1415 |
1376 ThreatListDescriptor.fromJson(core.Map _json) { | 1416 ThreatListDescriptor.fromJson(core.Map _json) { |
1377 if (_json.containsKey("platformType")) { | 1417 if (_json.containsKey("platformType")) { |
1378 platformType = _json["platformType"]; | 1418 platformType = _json["platformType"]; |
1379 } | 1419 } |
1380 if (_json.containsKey("threatEntryType")) { | 1420 if (_json.containsKey("threatEntryType")) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 core.String threatEntryType; | 1479 core.String threatEntryType; |
1440 /** | 1480 /** |
1441 * The threat type matching this threat. | 1481 * The threat type matching this threat. |
1442 * Possible string values are: | 1482 * Possible string values are: |
1443 * - "THREAT_TYPE_UNSPECIFIED" : Unknown. | 1483 * - "THREAT_TYPE_UNSPECIFIED" : Unknown. |
1444 * - "MALWARE" : Malware threat type. | 1484 * - "MALWARE" : Malware threat type. |
1445 * - "SOCIAL_ENGINEERING" : Social engineering threat type. | 1485 * - "SOCIAL_ENGINEERING" : Social engineering threat type. |
1446 * - "UNWANTED_SOFTWARE" : Unwanted software threat type. | 1486 * - "UNWANTED_SOFTWARE" : Unwanted software threat type. |
1447 * - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application | 1487 * - "POTENTIALLY_HARMFUL_APPLICATION" : Potentially harmful application |
1448 * threat type. | 1488 * threat type. |
| 1489 * - "SOCIAL_ENGINEERING_INTERNAL" : Social engineering threat type for |
| 1490 * internal use. |
| 1491 * - "API_ABUSE" : API abuse threat type. |
1449 * - "MALICIOUS_BINARY" : Malicious binary threat type. | 1492 * - "MALICIOUS_BINARY" : Malicious binary threat type. |
| 1493 * - "CSD_WHITELIST" : Client side detection whitelist threat type. |
| 1494 * - "CSD_DOWNLOAD_WHITELIST" : Client side download detection whitelist |
| 1495 * threat type. |
| 1496 * - "CLIENT_INCIDENT" : Client incident threat type. |
| 1497 * - "CLIENT_INCIDENT_WHITELIST" : Whitelist used when detecting client |
| 1498 * incident threats. |
| 1499 * 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. |
| 1501 * - "SUBRESOURCE_FILTER" : Patterns to be used for activating the subresource |
| 1502 * filter. Interstitial |
| 1503 * will not be shown for patterns from this list. |
1450 */ | 1504 */ |
1451 core.String threatType; | 1505 core.String threatType; |
1452 | 1506 |
1453 ThreatMatch(); | 1507 ThreatMatch(); |
1454 | 1508 |
1455 ThreatMatch.fromJson(core.Map _json) { | 1509 ThreatMatch.fromJson(core.Map _json) { |
1456 if (_json.containsKey("cacheDuration")) { | 1510 if (_json.containsKey("cacheDuration")) { |
1457 cacheDuration = _json["cacheDuration"]; | 1511 cacheDuration = _json["cacheDuration"]; |
1458 } | 1512 } |
1459 if (_json.containsKey("platformType")) { | 1513 if (_json.containsKey("platformType")) { |
(...skipping 29 matching lines...) Expand all Loading... |
1489 } | 1543 } |
1490 if (threatEntryType != null) { | 1544 if (threatEntryType != null) { |
1491 _json["threatEntryType"] = threatEntryType; | 1545 _json["threatEntryType"] = threatEntryType; |
1492 } | 1546 } |
1493 if (threatType != null) { | 1547 if (threatType != null) { |
1494 _json["threatType"] = threatType; | 1548 _json["threatType"] = threatType; |
1495 } | 1549 } |
1496 return _json; | 1550 return _json; |
1497 } | 1551 } |
1498 } | 1552 } |
OLD | NEW |