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:crypto/crypto.dart' as crypto; | |
11 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
12 | 11 |
13 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
14 ApiRequestError, DetailedApiRequestError; | 13 ApiRequestError, DetailedApiRequestError; |
15 | 14 |
16 const core.String USER_AGENT = 'dart-api-client safebrowsing/v4'; | 15 const core.String USER_AGENT = 'dart-api-client safebrowsing/v4'; |
17 | 16 |
18 /** | 17 /** |
19 * Enables client applications to check web resources (most commonly URLs) | 18 * Enables client applications to check web resources (most commonly URLs) |
20 * against Google-generated lists of unsafe web resources. | 19 * against Google-generated lists of unsafe web resources. |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 222 |
224 | 223 |
225 /** The expected state of a client's local database. */ | 224 /** The expected state of a client's local database. */ |
226 class Checksum { | 225 class Checksum { |
227 /** | 226 /** |
228 * The SHA256 hash of the client state; that is, of the sorted list of all | 227 * The SHA256 hash of the client state; that is, of the sorted list of all |
229 * hashes present in the database. | 228 * hashes present in the database. |
230 */ | 229 */ |
231 core.String sha256; | 230 core.String sha256; |
232 core.List<core.int> get sha256AsBytes { | 231 core.List<core.int> get sha256AsBytes { |
233 return crypto.CryptoUtils.base64StringToBytes(sha256); | 232 return convert.BASE64.decode(sha256); |
234 } | 233 } |
235 | 234 |
236 void set sha256AsBytes(core.List<core.int> _bytes) { | 235 void set sha256AsBytes(core.List<core.int> _bytes) { |
237 sha256 = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 236 sha256 = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+",
"-"); |
238 } | 237 } |
239 | 238 |
240 Checksum(); | 239 Checksum(); |
241 | 240 |
242 Checksum.fromJson(core.Map _json) { | 241 Checksum.fromJson(core.Map _json) { |
243 if (_json.containsKey("sha256")) { | 242 if (_json.containsKey("sha256")) { |
244 sha256 = _json["sha256"]; | 243 sha256 = _json["sha256"]; |
245 } | 244 } |
246 } | 245 } |
247 | 246 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 if (client != null) { | 370 if (client != null) { |
372 _json["client"] = (client).toJson(); | 371 _json["client"] = (client).toJson(); |
373 } | 372 } |
374 if (listUpdateRequests != null) { | 373 if (listUpdateRequests != null) { |
375 _json["listUpdateRequests"] = listUpdateRequests.map((value) => (value).to
Json()).toList(); | 374 _json["listUpdateRequests"] = listUpdateRequests.map((value) => (value).to
Json()).toList(); |
376 } | 375 } |
377 return _json; | 376 return _json; |
378 } | 377 } |
379 } | 378 } |
380 | 379 |
381 /** Response type for threat list update requests. */ | |
382 class FetchThreatListUpdatesResponse { | 380 class FetchThreatListUpdatesResponse { |
383 /** The list updates requested by the clients. */ | 381 /** The list updates requested by the clients. */ |
384 core.List<ListUpdateResponse> listUpdateResponses; | 382 core.List<ListUpdateResponse> listUpdateResponses; |
385 /** | 383 /** |
386 * The minimum duration the client must wait before issuing any update | 384 * The minimum duration the client must wait before issuing any update |
387 * request. If this field is not set clients may update as soon as they want. | 385 * request. If this field is not set clients may update as soon as they want. |
388 */ | 386 */ |
389 core.String minimumWaitDuration; | 387 core.String minimumWaitDuration; |
390 | 388 |
391 FetchThreatListUpdatesResponse(); | 389 FetchThreatListUpdatesResponse(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 if (clientStates != null) { | 440 if (clientStates != null) { |
443 _json["clientStates"] = clientStates; | 441 _json["clientStates"] = clientStates; |
444 } | 442 } |
445 if (threatInfo != null) { | 443 if (threatInfo != null) { |
446 _json["threatInfo"] = (threatInfo).toJson(); | 444 _json["threatInfo"] = (threatInfo).toJson(); |
447 } | 445 } |
448 return _json; | 446 return _json; |
449 } | 447 } |
450 } | 448 } |
451 | 449 |
452 /** Response type for requests to find full hashes. */ | |
453 class FindFullHashesResponse { | 450 class FindFullHashesResponse { |
454 /** The full hashes that matched the requested prefixes. */ | 451 /** The full hashes that matched the requested prefixes. */ |
455 core.List<ThreatMatch> matches; | 452 core.List<ThreatMatch> matches; |
456 /** | 453 /** |
457 * The minimum duration the client must wait before issuing any find hashes | 454 * The minimum duration the client must wait before issuing any find hashes |
458 * request. If this field is not set, clients can issue a request as soon as | 455 * request. If this field is not set, clients can issue a request as soon as |
459 * they want. | 456 * they want. |
460 */ | 457 */ |
461 core.String minimumWaitDuration; | 458 core.String minimumWaitDuration; |
462 /** | 459 /** |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 if (client != null) { | 514 if (client != null) { |
518 _json["client"] = (client).toJson(); | 515 _json["client"] = (client).toJson(); |
519 } | 516 } |
520 if (threatInfo != null) { | 517 if (threatInfo != null) { |
521 _json["threatInfo"] = (threatInfo).toJson(); | 518 _json["threatInfo"] = (threatInfo).toJson(); |
522 } | 519 } |
523 return _json; | 520 return _json; |
524 } | 521 } |
525 } | 522 } |
526 | 523 |
527 /** Response type for requests to find threat matches. */ | |
528 class FindThreatMatchesResponse { | 524 class FindThreatMatchesResponse { |
529 /** The threat list matches. */ | 525 /** The threat list matches. */ |
530 core.List<ThreatMatch> matches; | 526 core.List<ThreatMatch> matches; |
531 | 527 |
532 FindThreatMatchesResponse(); | 528 FindThreatMatchesResponse(); |
533 | 529 |
534 FindThreatMatchesResponse.fromJson(core.Map _json) { | 530 FindThreatMatchesResponse.fromJson(core.Map _json) { |
535 if (_json.containsKey("matches")) { | 531 if (_json.containsKey("matches")) { |
536 matches = _json["matches"].map((value) => new ThreatMatch.fromJson(value))
.toList(); | 532 matches = _json["matches"].map((value) => new ThreatMatch.fromJson(value))
.toList(); |
537 } | 533 } |
538 } | 534 } |
539 | 535 |
540 core.Map toJson() { | 536 core.Map toJson() { |
541 var _json = new core.Map(); | 537 var _json = new core.Map(); |
542 if (matches != null) { | 538 if (matches != null) { |
543 _json["matches"] = matches.map((value) => (value).toJson()).toList(); | 539 _json["matches"] = matches.map((value) => (value).toJson()).toList(); |
544 } | 540 } |
545 return _json; | 541 return _json; |
546 } | 542 } |
547 } | 543 } |
548 | 544 |
549 /** A collection of lists available for download by the client. */ | |
550 class ListThreatListsResponse { | 545 class ListThreatListsResponse { |
551 /** The lists available for download by the client. */ | 546 /** The lists available for download by the client. */ |
552 core.List<ThreatListDescriptor> threatLists; | 547 core.List<ThreatListDescriptor> threatLists; |
553 | 548 |
554 ListThreatListsResponse(); | 549 ListThreatListsResponse(); |
555 | 550 |
556 ListThreatListsResponse.fromJson(core.Map _json) { | 551 ListThreatListsResponse.fromJson(core.Map _json) { |
557 if (_json.containsKey("threatLists")) { | 552 if (_json.containsKey("threatLists")) { |
558 threatLists = _json["threatLists"].map((value) => new ThreatListDescriptor
.fromJson(value)).toList(); | 553 threatLists = _json["threatLists"].map((value) => new ThreatListDescriptor
.fromJson(value)).toList(); |
559 } | 554 } |
(...skipping 21 matching lines...) Expand all Loading... |
581 * - "ANDROID" : A ANDROID. | 576 * - "ANDROID" : A ANDROID. |
582 * - "OSX" : A OSX. | 577 * - "OSX" : A OSX. |
583 * - "IOS" : A IOS. | 578 * - "IOS" : A IOS. |
584 * - "ANY_PLATFORM" : A ANY_PLATFORM. | 579 * - "ANY_PLATFORM" : A ANY_PLATFORM. |
585 * - "ALL_PLATFORMS" : A ALL_PLATFORMS. | 580 * - "ALL_PLATFORMS" : A ALL_PLATFORMS. |
586 * - "CHROME" : A CHROME. | 581 * - "CHROME" : A CHROME. |
587 */ | 582 */ |
588 core.String platformType; | 583 core.String platformType; |
589 /** | 584 /** |
590 * The current state of the client for the requested list (the encrypted | 585 * The current state of the client for the requested list (the encrypted |
591 * ClientState that was sent to the client from the previous update request). | 586 * client state that was received from the last successful list update). |
592 */ | 587 */ |
593 core.String state; | 588 core.String state; |
594 core.List<core.int> get stateAsBytes { | 589 core.List<core.int> get stateAsBytes { |
595 return crypto.CryptoUtils.base64StringToBytes(state); | 590 return convert.BASE64.decode(state); |
596 } | 591 } |
597 | 592 |
598 void set stateAsBytes(core.List<core.int> _bytes) { | 593 void set stateAsBytes(core.List<core.int> _bytes) { |
599 state = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 594 state = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "
-"); |
600 } | 595 } |
601 /** | 596 /** |
602 * The types of entries present in the list. | 597 * The types of entries present in the list. |
603 * Possible string values are: | 598 * Possible string values are: |
604 * - "THREAT_ENTRY_TYPE_UNSPECIFIED" : A THREAT_ENTRY_TYPE_UNSPECIFIED. | 599 * - "THREAT_ENTRY_TYPE_UNSPECIFIED" : A THREAT_ENTRY_TYPE_UNSPECIFIED. |
605 * - "URL_EXPRESSION" : A URL_EXPRESSION. | 600 * - "URL" : A URL. |
606 * - "BINARY_DIGEST" : A BINARY_DIGEST. | 601 * - "EXECUTABLE" : A EXECUTABLE. |
607 * - "IP_RANGE" : A IP_RANGE. | 602 * - "IP_RANGE" : A IP_RANGE. |
608 */ | 603 */ |
609 core.String threatEntryType; | 604 core.String threatEntryType; |
610 /** | 605 /** |
611 * The type of threat posed by entries present in the list. | 606 * The type of threat posed by entries present in the list. |
612 * Possible string values are: | 607 * Possible string values are: |
613 * - "THREAT_TYPE_UNSPECIFIED" : A THREAT_TYPE_UNSPECIFIED. | 608 * - "THREAT_TYPE_UNSPECIFIED" : A THREAT_TYPE_UNSPECIFIED. |
614 * - "MALWARE" : A MALWARE. | 609 * - "MALWARE" : A MALWARE. |
615 * - "SOCIAL_ENGINEERING" : A SOCIAL_ENGINEERING. | 610 * - "SOCIAL_ENGINEERING" : A SOCIAL_ENGINEERING. |
616 * - "UNWANTED_SOFTWARE" : A UNWANTED_SOFTWARE. | 611 * - "UNWANTED_SOFTWARE" : A UNWANTED_SOFTWARE. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 /** | 665 /** |
671 * The expected SHA256 hash of the client state; that is, of the sorted list | 666 * The expected SHA256 hash of the client state; that is, of the sorted list |
672 * of all hashes present in the database after applying the provided update. | 667 * of all hashes present in the database after applying the provided update. |
673 * If the client state doesn't match the expected state, the client must | 668 * If the client state doesn't match the expected state, the client must |
674 * disregard this update and retry later. | 669 * disregard this update and retry later. |
675 */ | 670 */ |
676 Checksum checksum; | 671 Checksum checksum; |
677 /** The new client state, in encrypted format. Opaque to clients. */ | 672 /** The new client state, in encrypted format. Opaque to clients. */ |
678 core.String newClientState; | 673 core.String newClientState; |
679 core.List<core.int> get newClientStateAsBytes { | 674 core.List<core.int> get newClientStateAsBytes { |
680 return crypto.CryptoUtils.base64StringToBytes(newClientState); | 675 return convert.BASE64.decode(newClientState); |
681 } | 676 } |
682 | 677 |
683 void set newClientStateAsBytes(core.List<core.int> _bytes) { | 678 void set newClientStateAsBytes(core.List<core.int> _bytes) { |
684 newClientState = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 679 newClientState = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceA
ll("+", "-"); |
685 } | 680 } |
686 /** | 681 /** |
687 * The platform type for which data is returned. | 682 * The platform type for which data is returned. |
688 * Possible string values are: | 683 * Possible string values are: |
689 * - "PLATFORM_TYPE_UNSPECIFIED" : A PLATFORM_TYPE_UNSPECIFIED. | 684 * - "PLATFORM_TYPE_UNSPECIFIED" : A PLATFORM_TYPE_UNSPECIFIED. |
690 * - "WINDOWS" : A WINDOWS. | 685 * - "WINDOWS" : A WINDOWS. |
691 * - "LINUX" : A LINUX. | 686 * - "LINUX" : A LINUX. |
692 * - "ANDROID" : A ANDROID. | 687 * - "ANDROID" : A ANDROID. |
693 * - "OSX" : A OSX. | 688 * - "OSX" : A OSX. |
694 * - "IOS" : A IOS. | 689 * - "IOS" : A IOS. |
(...skipping 13 matching lines...) Expand all Loading... |
708 * Possible string values are: | 703 * Possible string values are: |
709 * - "RESPONSE_TYPE_UNSPECIFIED" : A RESPONSE_TYPE_UNSPECIFIED. | 704 * - "RESPONSE_TYPE_UNSPECIFIED" : A RESPONSE_TYPE_UNSPECIFIED. |
710 * - "PARTIAL_UPDATE" : A PARTIAL_UPDATE. | 705 * - "PARTIAL_UPDATE" : A PARTIAL_UPDATE. |
711 * - "FULL_UPDATE" : A FULL_UPDATE. | 706 * - "FULL_UPDATE" : A FULL_UPDATE. |
712 */ | 707 */ |
713 core.String responseType; | 708 core.String responseType; |
714 /** | 709 /** |
715 * The format of the threats. | 710 * The format of the threats. |
716 * Possible string values are: | 711 * Possible string values are: |
717 * - "THREAT_ENTRY_TYPE_UNSPECIFIED" : A THREAT_ENTRY_TYPE_UNSPECIFIED. | 712 * - "THREAT_ENTRY_TYPE_UNSPECIFIED" : A THREAT_ENTRY_TYPE_UNSPECIFIED. |
718 * - "URL_EXPRESSION" : A URL_EXPRESSION. | 713 * - "URL" : A URL. |
719 * - "BINARY_DIGEST" : A BINARY_DIGEST. | 714 * - "EXECUTABLE" : A EXECUTABLE. |
720 * - "IP_RANGE" : A IP_RANGE. | 715 * - "IP_RANGE" : A IP_RANGE. |
721 */ | 716 */ |
722 core.String threatEntryType; | 717 core.String threatEntryType; |
723 /** | 718 /** |
724 * The threat type for which data is returned. | 719 * The threat type for which data is returned. |
725 * Possible string values are: | 720 * Possible string values are: |
726 * - "THREAT_TYPE_UNSPECIFIED" : A THREAT_TYPE_UNSPECIFIED. | 721 * - "THREAT_TYPE_UNSPECIFIED" : A THREAT_TYPE_UNSPECIFIED. |
727 * - "MALWARE" : A MALWARE. | 722 * - "MALWARE" : A MALWARE. |
728 * - "SOCIAL_ENGINEERING" : A SOCIAL_ENGINEERING. | 723 * - "SOCIAL_ENGINEERING" : A SOCIAL_ENGINEERING. |
729 * - "UNWANTED_SOFTWARE" : A UNWANTED_SOFTWARE. | 724 * - "UNWANTED_SOFTWARE" : A UNWANTED_SOFTWARE. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 } | 783 } |
789 return _json; | 784 return _json; |
790 } | 785 } |
791 } | 786 } |
792 | 787 |
793 /** A single metadata entry. */ | 788 /** A single metadata entry. */ |
794 class MetadataEntry { | 789 class MetadataEntry { |
795 /** The metadata entry key. */ | 790 /** The metadata entry key. */ |
796 core.String key; | 791 core.String key; |
797 core.List<core.int> get keyAsBytes { | 792 core.List<core.int> get keyAsBytes { |
798 return crypto.CryptoUtils.base64StringToBytes(key); | 793 return convert.BASE64.decode(key); |
799 } | 794 } |
800 | 795 |
801 void set keyAsBytes(core.List<core.int> _bytes) { | 796 void set keyAsBytes(core.List<core.int> _bytes) { |
802 key = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 797 key = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"
); |
803 } | 798 } |
804 /** The metadata entry value. */ | 799 /** The metadata entry value. */ |
805 core.String value; | 800 core.String value; |
806 core.List<core.int> get valueAsBytes { | 801 core.List<core.int> get valueAsBytes { |
807 return crypto.CryptoUtils.base64StringToBytes(value); | 802 return convert.BASE64.decode(value); |
808 } | 803 } |
809 | 804 |
810 void set valueAsBytes(core.List<core.int> _bytes) { | 805 void set valueAsBytes(core.List<core.int> _bytes) { |
811 value = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 806 value = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "
-"); |
812 } | 807 } |
813 | 808 |
814 MetadataEntry(); | 809 MetadataEntry(); |
815 | 810 |
816 MetadataEntry.fromJson(core.Map _json) { | 811 MetadataEntry.fromJson(core.Map _json) { |
817 if (_json.containsKey("key")) { | 812 if (_json.containsKey("key")) { |
818 key = _json["key"]; | 813 key = _json["key"]; |
819 } | 814 } |
820 if (_json.containsKey("value")) { | 815 if (_json.containsKey("value")) { |
821 value = _json["value"]; | 816 value = _json["value"]; |
(...skipping 25 matching lines...) Expand all Loading... |
847 * The number of bytes for each prefix encoded below. This field can be | 842 * The number of bytes for each prefix encoded below. This field can be |
848 * anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). | 843 * anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). |
849 */ | 844 */ |
850 core.int prefixSize; | 845 core.int prefixSize; |
851 /** | 846 /** |
852 * The hashes, all concatenated into one long string. Each hash has a prefix | 847 * The hashes, all concatenated into one long string. Each hash has a prefix |
853 * size of |prefix_size| above. Hashes are sorted in lexicographic order. | 848 * size of |prefix_size| above. Hashes are sorted in lexicographic order. |
854 */ | 849 */ |
855 core.String rawHashes; | 850 core.String rawHashes; |
856 core.List<core.int> get rawHashesAsBytes { | 851 core.List<core.int> get rawHashesAsBytes { |
857 return crypto.CryptoUtils.base64StringToBytes(rawHashes); | 852 return convert.BASE64.decode(rawHashes); |
858 } | 853 } |
859 | 854 |
860 void set rawHashesAsBytes(core.List<core.int> _bytes) { | 855 void set rawHashesAsBytes(core.List<core.int> _bytes) { |
861 rawHashes = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 856 rawHashes = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+
", "-"); |
862 } | 857 } |
863 | 858 |
864 RawHashes(); | 859 RawHashes(); |
865 | 860 |
866 RawHashes.fromJson(core.Map _json) { | 861 RawHashes.fromJson(core.Map _json) { |
867 if (_json.containsKey("prefixSize")) { | 862 if (_json.containsKey("prefixSize")) { |
868 prefixSize = _json["prefixSize"]; | 863 prefixSize = _json["prefixSize"]; |
869 } | 864 } |
870 if (_json.containsKey("rawHashes")) { | 865 if (_json.containsKey("rawHashes")) { |
871 rawHashes = _json["rawHashes"]; | 866 rawHashes = _json["rawHashes"]; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 } | 902 } |
908 | 903 |
909 /** | 904 /** |
910 * The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or | 905 * The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or |
911 * compressed removal indices. | 906 * compressed removal indices. |
912 */ | 907 */ |
913 class RiceDeltaEncoding { | 908 class RiceDeltaEncoding { |
914 /** The encoded deltas that are encoded using the Golomb-Rice coder. */ | 909 /** The encoded deltas that are encoded using the Golomb-Rice coder. */ |
915 core.String encodedData; | 910 core.String encodedData; |
916 core.List<core.int> get encodedDataAsBytes { | 911 core.List<core.int> get encodedDataAsBytes { |
917 return crypto.CryptoUtils.base64StringToBytes(encodedData); | 912 return convert.BASE64.decode(encodedData); |
918 } | 913 } |
919 | 914 |
920 void set encodedDataAsBytes(core.List<core.int> _bytes) { | 915 void set encodedDataAsBytes(core.List<core.int> _bytes) { |
921 encodedData = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 916 encodedData = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll(
"+", "-"); |
922 } | 917 } |
923 /** | 918 /** |
924 * The offset of the first entry in the encoded data, or, if only a single | 919 * The offset of the first entry in the encoded data, or, if only a single |
925 * integer was encoded, that single integer's value. | 920 * integer was encoded, that single integer's value. |
926 */ | 921 */ |
927 core.String firstValue; | 922 core.String firstValue; |
928 /** | 923 /** |
929 * The number of entries that are delta encoded in the encoded data. If only a | 924 * The number of entries that are delta encoded in the encoded data. If only a |
930 * single integer was encoded, this will be zero and the single value will be | 925 * single integer was encoded, this will be zero and the single value will be |
931 * stored in first_value. | 926 * stored in `first_value`. |
932 */ | 927 */ |
933 core.int numEntries; | 928 core.int numEntries; |
934 /** | 929 /** |
935 * The Golomb-Rice parameter which is a number between 2 and 28. This field is | 930 * The Golomb-Rice parameter, which is a number between 2 and 28. This field |
936 * missing (that is, zero) if num_entries is zero. | 931 * is missing (that is, zero) if `num_entries` is zero. |
937 */ | 932 */ |
938 core.int riceParameter; | 933 core.int riceParameter; |
939 | 934 |
940 RiceDeltaEncoding(); | 935 RiceDeltaEncoding(); |
941 | 936 |
942 RiceDeltaEncoding.fromJson(core.Map _json) { | 937 RiceDeltaEncoding.fromJson(core.Map _json) { |
943 if (_json.containsKey("encodedData")) { | 938 if (_json.containsKey("encodedData")) { |
944 encodedData = _json["encodedData"]; | 939 encodedData = _json["encodedData"]; |
945 } | 940 } |
946 if (_json.containsKey("firstValue")) { | 941 if (_json.containsKey("firstValue")) { |
(...skipping 24 matching lines...) Expand all Loading... |
971 return _json; | 966 return _json; |
972 } | 967 } |
973 } | 968 } |
974 | 969 |
975 /** | 970 /** |
976 * An individual threat; for example, a malicious URL or its hash | 971 * An individual threat; for example, a malicious URL or its hash |
977 * representation. Only one of these fields should be set. | 972 * representation. Only one of these fields should be set. |
978 */ | 973 */ |
979 class ThreatEntry { | 974 class ThreatEntry { |
980 /** | 975 /** |
| 976 * The digest of an executable in SHA256 format. The API supports both binary |
| 977 * and hex digests. |
| 978 */ |
| 979 core.String digest; |
| 980 core.List<core.int> get digestAsBytes { |
| 981 return convert.BASE64.decode(digest); |
| 982 } |
| 983 |
| 984 void set digestAsBytes(core.List<core.int> _bytes) { |
| 985 digest = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+",
"-"); |
| 986 } |
| 987 /** |
981 * A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 | 988 * A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 |
982 * hash. | 989 * hash. This field is in binary format. |
983 */ | 990 */ |
984 core.String hash; | 991 core.String hash; |
985 core.List<core.int> get hashAsBytes { | 992 core.List<core.int> get hashAsBytes { |
986 return crypto.CryptoUtils.base64StringToBytes(hash); | 993 return convert.BASE64.decode(hash); |
987 } | 994 } |
988 | 995 |
989 void set hashAsBytes(core.List<core.int> _bytes) { | 996 void set hashAsBytes(core.List<core.int> _bytes) { |
990 hash = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 997 hash = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); |
991 } | 998 } |
992 /** A URL. */ | 999 /** A URL. */ |
993 core.String url; | 1000 core.String url; |
994 | 1001 |
995 ThreatEntry(); | 1002 ThreatEntry(); |
996 | 1003 |
997 ThreatEntry.fromJson(core.Map _json) { | 1004 ThreatEntry.fromJson(core.Map _json) { |
| 1005 if (_json.containsKey("digest")) { |
| 1006 digest = _json["digest"]; |
| 1007 } |
998 if (_json.containsKey("hash")) { | 1008 if (_json.containsKey("hash")) { |
999 hash = _json["hash"]; | 1009 hash = _json["hash"]; |
1000 } | 1010 } |
1001 if (_json.containsKey("url")) { | 1011 if (_json.containsKey("url")) { |
1002 url = _json["url"]; | 1012 url = _json["url"]; |
1003 } | 1013 } |
1004 } | 1014 } |
1005 | 1015 |
1006 core.Map toJson() { | 1016 core.Map toJson() { |
1007 var _json = new core.Map(); | 1017 var _json = new core.Map(); |
| 1018 if (digest != null) { |
| 1019 _json["digest"] = digest; |
| 1020 } |
1008 if (hash != null) { | 1021 if (hash != null) { |
1009 _json["hash"] = hash; | 1022 _json["hash"] = hash; |
1010 } | 1023 } |
1011 if (url != null) { | 1024 if (url != null) { |
1012 _json["url"] = url; | 1025 _json["url"] = url; |
1013 } | 1026 } |
1014 return _json; | 1027 return _json; |
1015 } | 1028 } |
1016 } | 1029 } |
1017 | 1030 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1175 * - "IOS" : A IOS. | 1188 * - "IOS" : A IOS. |
1176 * - "ANY_PLATFORM" : A ANY_PLATFORM. | 1189 * - "ANY_PLATFORM" : A ANY_PLATFORM. |
1177 * - "ALL_PLATFORMS" : A ALL_PLATFORMS. | 1190 * - "ALL_PLATFORMS" : A ALL_PLATFORMS. |
1178 * - "CHROME" : A CHROME. | 1191 * - "CHROME" : A CHROME. |
1179 */ | 1192 */ |
1180 core.String platformType; | 1193 core.String platformType; |
1181 /** | 1194 /** |
1182 * The entry types contained in the list. | 1195 * The entry types contained in the list. |
1183 * Possible string values are: | 1196 * Possible string values are: |
1184 * - "THREAT_ENTRY_TYPE_UNSPECIFIED" : A THREAT_ENTRY_TYPE_UNSPECIFIED. | 1197 * - "THREAT_ENTRY_TYPE_UNSPECIFIED" : A THREAT_ENTRY_TYPE_UNSPECIFIED. |
1185 * - "URL_EXPRESSION" : A URL_EXPRESSION. | 1198 * - "URL" : A URL. |
1186 * - "BINARY_DIGEST" : A BINARY_DIGEST. | 1199 * - "EXECUTABLE" : A EXECUTABLE. |
1187 * - "IP_RANGE" : A IP_RANGE. | 1200 * - "IP_RANGE" : A IP_RANGE. |
1188 */ | 1201 */ |
1189 core.String threatEntryType; | 1202 core.String threatEntryType; |
1190 /** | 1203 /** |
1191 * The threat type posed by the list's entries. | 1204 * The threat type posed by the list's entries. |
1192 * Possible string values are: | 1205 * Possible string values are: |
1193 * - "THREAT_TYPE_UNSPECIFIED" : A THREAT_TYPE_UNSPECIFIED. | 1206 * - "THREAT_TYPE_UNSPECIFIED" : A THREAT_TYPE_UNSPECIFIED. |
1194 * - "MALWARE" : A MALWARE. | 1207 * - "MALWARE" : A MALWARE. |
1195 * - "SOCIAL_ENGINEERING" : A SOCIAL_ENGINEERING. | 1208 * - "SOCIAL_ENGINEERING" : A SOCIAL_ENGINEERING. |
1196 * - "UNWANTED_SOFTWARE" : A UNWANTED_SOFTWARE. | 1209 * - "UNWANTED_SOFTWARE" : A UNWANTED_SOFTWARE. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 */ | 1262 */ |
1250 core.String platformType; | 1263 core.String platformType; |
1251 /** The threat matching this threat. */ | 1264 /** The threat matching this threat. */ |
1252 ThreatEntry threat; | 1265 ThreatEntry threat; |
1253 /** Optional metadata associated with this threat. */ | 1266 /** Optional metadata associated with this threat. */ |
1254 ThreatEntryMetadata threatEntryMetadata; | 1267 ThreatEntryMetadata threatEntryMetadata; |
1255 /** | 1268 /** |
1256 * The threat entry type matching this threat. | 1269 * The threat entry type matching this threat. |
1257 * Possible string values are: | 1270 * Possible string values are: |
1258 * - "THREAT_ENTRY_TYPE_UNSPECIFIED" : A THREAT_ENTRY_TYPE_UNSPECIFIED. | 1271 * - "THREAT_ENTRY_TYPE_UNSPECIFIED" : A THREAT_ENTRY_TYPE_UNSPECIFIED. |
1259 * - "URL_EXPRESSION" : A URL_EXPRESSION. | 1272 * - "URL" : A URL. |
1260 * - "BINARY_DIGEST" : A BINARY_DIGEST. | 1273 * - "EXECUTABLE" : A EXECUTABLE. |
1261 * - "IP_RANGE" : A IP_RANGE. | 1274 * - "IP_RANGE" : A IP_RANGE. |
1262 */ | 1275 */ |
1263 core.String threatEntryType; | 1276 core.String threatEntryType; |
1264 /** | 1277 /** |
1265 * The threat type matching this threat. | 1278 * The threat type matching this threat. |
1266 * Possible string values are: | 1279 * Possible string values are: |
1267 * - "THREAT_TYPE_UNSPECIFIED" : A THREAT_TYPE_UNSPECIFIED. | 1280 * - "THREAT_TYPE_UNSPECIFIED" : A THREAT_TYPE_UNSPECIFIED. |
1268 * - "MALWARE" : A MALWARE. | 1281 * - "MALWARE" : A MALWARE. |
1269 * - "SOCIAL_ENGINEERING" : A SOCIAL_ENGINEERING. | 1282 * - "SOCIAL_ENGINEERING" : A SOCIAL_ENGINEERING. |
1270 * - "UNWANTED_SOFTWARE" : A UNWANTED_SOFTWARE. | 1283 * - "UNWANTED_SOFTWARE" : A UNWANTED_SOFTWARE. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 } | 1324 } |
1312 if (threatEntryType != null) { | 1325 if (threatEntryType != null) { |
1313 _json["threatEntryType"] = threatEntryType; | 1326 _json["threatEntryType"] = threatEntryType; |
1314 } | 1327 } |
1315 if (threatType != null) { | 1328 if (threatType != null) { |
1316 _json["threatType"] = threatType; | 1329 _json["threatType"] = threatType; |
1317 } | 1330 } |
1318 return _json; | 1331 return _json; |
1319 } | 1332 } |
1320 } | 1333 } |
OLD | NEW |