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.firebaserules.v1; | 3 library googleapis.firebaserules.v1; |
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; |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 * filtered by `Release` name, `Ruleset` name, `TestSuite` name, or any | 285 * filtered by `Release` name, `Ruleset` name, `TestSuite` name, or any |
286 * combination thereof. | 286 * combination thereof. |
287 * | 287 * |
288 * Request parameters: | 288 * Request parameters: |
289 * | 289 * |
290 * [name] - Resource name for the project. | 290 * [name] - Resource name for the project. |
291 * | 291 * |
292 * Format: `projects/{project_id}` | 292 * Format: `projects/{project_id}` |
293 * Value must have pattern "^projects/[^/]+$". | 293 * Value must have pattern "^projects/[^/]+$". |
294 * | 294 * |
| 295 * [pageToken] - Next page token for the next batch of `Release` instances. |
| 296 * |
| 297 * [pageSize] - Page size to load. Maximum of 100. Defaults to 10. |
| 298 * Note: `page_size` is just a hint and the service may choose to load fewer |
| 299 * than `page_size` results due to the size of the output. To traverse all of |
| 300 * the releases, the caller should iterate until the `page_token` on the |
| 301 * response is empty. |
| 302 * |
295 * [filter] - `Release` filter. The list method supports filters with | 303 * [filter] - `Release` filter. The list method supports filters with |
296 * restrictions on the | 304 * restrictions on the |
297 * `Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`. | 305 * `Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`. |
298 * | 306 * |
299 * Example 1: A filter of 'name=prod*' might return `Release`s with names | 307 * Example 1: A filter of 'name=prod*' might return `Release`s with names |
300 * within 'projects/foo' prefixed with 'prod': | 308 * within 'projects/foo' prefixed with 'prod': |
301 * | 309 * |
302 * Name | Ruleset Name | 310 * Name | Ruleset Name |
303 * ------------------------------|------------- | 311 * ------------------------------|------------- |
304 * projects/foo/releases/prod | projects/foo/rulesets/uuid1234 | 312 * projects/foo/releases/prod | projects/foo/rulesets/uuid1234 |
305 * projects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234 | 313 * projects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234 |
306 * projects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888 | 314 * projects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888 |
307 * | 315 * |
308 * Example 2: A filter of `name=prod* ruleset_name=uuid1234` would return only | 316 * Example 2: A filter of `name=prod* ruleset_name=uuid1234` would return only |
309 * `Release` instances for 'projects/foo' with names prefixed with 'prod' | 317 * `Release` instances for 'projects/foo' with names prefixed with 'prod' |
310 * referring to the same `Ruleset` name of 'uuid1234': | 318 * referring to the same `Ruleset` name of 'uuid1234': |
311 * | 319 * |
312 * Name | Ruleset Name | 320 * Name | Ruleset Name |
313 * ------------------------------|------------- | 321 * ------------------------------|------------- |
314 * projects/foo/releases/prod | projects/foo/rulesets/1234 | 322 * projects/foo/releases/prod | projects/foo/rulesets/1234 |
315 * projects/foo/releases/prod/v1 | projects/foo/rulesets/1234 | 323 * projects/foo/releases/prod/v1 | projects/foo/rulesets/1234 |
316 * | 324 * |
317 * In the examples, the filter parameters refer to the search filters are | 325 * In the examples, the filter parameters refer to the search filters are |
318 * relative to the project. Fully qualified prefixed may also be used. e.g. | 326 * relative to the project. Fully qualified prefixed may also be used. e.g. |
319 * `test_suite_name=projects/foo/testsuites/uuid1` | 327 * `test_suite_name=projects/foo/testsuites/uuid1` |
320 * | 328 * |
321 * [pageToken] - Next page token for the next batch of `Release` instances. | |
322 * | |
323 * [pageSize] - Page size to load. Maximum of 100. Defaults to 10. | |
324 * Note: `page_size` is just a hint and the service may choose to load fewer | |
325 * than `page_size` results due to the size of the output. To traverse all of | |
326 * the releases, the caller should iterate until the `page_token` on the | |
327 * response is empty. | |
328 * | |
329 * Completes with a [ListReleasesResponse]. | 329 * Completes with a [ListReleasesResponse]. |
330 * | 330 * |
331 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 331 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
332 * error. | 332 * error. |
333 * | 333 * |
334 * If the used [http.Client] completes with an error when making a REST call, | 334 * If the used [http.Client] completes with an error when making a REST call, |
335 * this method will complete with the same error. | 335 * this method will complete with the same error. |
336 */ | 336 */ |
337 async.Future<ListReleasesResponse> list(core.String name, {core.String filter,
core.String pageToken, core.int pageSize}) { | 337 async.Future<ListReleasesResponse> list(core.String name, {core.String pageTok
en, core.int pageSize, core.String filter}) { |
338 var _url = null; | 338 var _url = null; |
339 var _queryParams = new core.Map(); | 339 var _queryParams = new core.Map(); |
340 var _uploadMedia = null; | 340 var _uploadMedia = null; |
341 var _uploadOptions = null; | 341 var _uploadOptions = null; |
342 var _downloadOptions = commons.DownloadOptions.Metadata; | 342 var _downloadOptions = commons.DownloadOptions.Metadata; |
343 var _body = null; | 343 var _body = null; |
344 | 344 |
345 if (name == null) { | 345 if (name == null) { |
346 throw new core.ArgumentError("Parameter name is required."); | 346 throw new core.ArgumentError("Parameter name is required."); |
347 } | 347 } |
348 if (filter != null) { | |
349 _queryParams["filter"] = [filter]; | |
350 } | |
351 if (pageToken != null) { | 348 if (pageToken != null) { |
352 _queryParams["pageToken"] = [pageToken]; | 349 _queryParams["pageToken"] = [pageToken]; |
353 } | 350 } |
354 if (pageSize != null) { | 351 if (pageSize != null) { |
355 _queryParams["pageSize"] = ["${pageSize}"]; | 352 _queryParams["pageSize"] = ["${pageSize}"]; |
356 } | 353 } |
| 354 if (filter != null) { |
| 355 _queryParams["filter"] = [filter]; |
| 356 } |
357 | 357 |
358 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + '/releases'; | 358 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + '/releases'; |
359 | 359 |
360 var _response = _requester.request(_url, | 360 var _response = _requester.request(_url, |
361 "GET", | 361 "GET", |
362 body: _body, | 362 body: _body, |
363 queryParams: _queryParams, | 363 queryParams: _queryParams, |
364 uploadOptions: _uploadOptions, | 364 uploadOptions: _uploadOptions, |
365 uploadMedia: _uploadMedia, | 365 uploadMedia: _uploadMedia, |
366 downloadOptions: _downloadOptions); | 366 downloadOptions: _downloadOptions); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 uploadOptions: _uploadOptions, | 655 uploadOptions: _uploadOptions, |
656 uploadMedia: _uploadMedia, | 656 uploadMedia: _uploadMedia, |
657 downloadOptions: _downloadOptions); | 657 downloadOptions: _downloadOptions); |
658 return _response.then((data) => new ListRulesetsResponse.fromJson(data)); | 658 return _response.then((data) => new ListRulesetsResponse.fromJson(data)); |
659 } | 659 } |
660 | 660 |
661 } | 661 } |
662 | 662 |
663 | 663 |
664 | 664 |
| 665 /** Arg matchers for the mock function. */ |
| 666 class Arg { |
| 667 /** Argument matches any value provided. */ |
| 668 Empty anyValue; |
| 669 /** |
| 670 * Argument exactly matches value provided. |
| 671 * |
| 672 * The values for Object must be JSON objects. It can consist of `num`, |
| 673 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 674 */ |
| 675 core.Object exactValue; |
| 676 |
| 677 Arg(); |
| 678 |
| 679 Arg.fromJson(core.Map _json) { |
| 680 if (_json.containsKey("anyValue")) { |
| 681 anyValue = new Empty.fromJson(_json["anyValue"]); |
| 682 } |
| 683 if (_json.containsKey("exactValue")) { |
| 684 exactValue = _json["exactValue"]; |
| 685 } |
| 686 } |
| 687 |
| 688 core.Map<core.String, core.Object> toJson() { |
| 689 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 690 if (anyValue != null) { |
| 691 _json["anyValue"] = (anyValue).toJson(); |
| 692 } |
| 693 if (exactValue != null) { |
| 694 _json["exactValue"] = exactValue; |
| 695 } |
| 696 return _json; |
| 697 } |
| 698 } |
| 699 |
665 /** | 700 /** |
666 * A generic empty message that you can re-use to avoid defining duplicated | 701 * A generic empty message that you can re-use to avoid defining duplicated |
667 * empty messages in your APIs. A typical example is to use it as the request | 702 * empty messages in your APIs. A typical example is to use it as the request |
668 * or the response type of an API method. For instance: | 703 * or the response type of an API method. For instance: |
669 * | 704 * |
670 * service Foo { | 705 * service Foo { |
671 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); | 706 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
672 * } | 707 * } |
673 * | 708 * |
674 * The JSON representation for `Empty` is empty JSON object `{}`. | 709 * The JSON representation for `Empty` is empty JSON object `{}`. |
675 */ | 710 */ |
676 class Empty { | 711 class Empty { |
677 | 712 |
678 Empty(); | 713 Empty(); |
679 | 714 |
680 Empty.fromJson(core.Map _json) { | 715 Empty.fromJson(core.Map _json) { |
681 } | 716 } |
682 | 717 |
683 core.Map toJson() { | 718 core.Map<core.String, core.Object> toJson() { |
684 var _json = new core.Map(); | 719 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
685 return _json; | 720 return _json; |
686 } | 721 } |
687 } | 722 } |
688 | 723 |
689 /** `File` containing source content. */ | 724 /** `File` containing source content. */ |
690 class File { | 725 class File { |
691 /** Textual Content. */ | 726 /** Textual Content. */ |
692 core.String content; | 727 core.String content; |
693 /** Fingerprint (e.g. github sha) associated with the `File`. */ | 728 /** Fingerprint (e.g. github sha) associated with the `File`. */ |
694 core.String fingerprint; | 729 core.String fingerprint; |
(...skipping 14 matching lines...) Expand all Loading... |
709 content = _json["content"]; | 744 content = _json["content"]; |
710 } | 745 } |
711 if (_json.containsKey("fingerprint")) { | 746 if (_json.containsKey("fingerprint")) { |
712 fingerprint = _json["fingerprint"]; | 747 fingerprint = _json["fingerprint"]; |
713 } | 748 } |
714 if (_json.containsKey("name")) { | 749 if (_json.containsKey("name")) { |
715 name = _json["name"]; | 750 name = _json["name"]; |
716 } | 751 } |
717 } | 752 } |
718 | 753 |
719 core.Map toJson() { | 754 core.Map<core.String, core.Object> toJson() { |
720 var _json = new core.Map(); | 755 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
721 if (content != null) { | 756 if (content != null) { |
722 _json["content"] = content; | 757 _json["content"] = content; |
723 } | 758 } |
724 if (fingerprint != null) { | 759 if (fingerprint != null) { |
725 _json["fingerprint"] = fingerprint; | 760 _json["fingerprint"] = fingerprint; |
726 } | 761 } |
727 if (name != null) { | 762 if (name != null) { |
728 _json["name"] = name; | 763 _json["name"] = name; |
729 } | 764 } |
730 return _json; | 765 return _json; |
(...skipping 19 matching lines...) Expand all Loading... |
750 | 785 |
751 FunctionCall.fromJson(core.Map _json) { | 786 FunctionCall.fromJson(core.Map _json) { |
752 if (_json.containsKey("args")) { | 787 if (_json.containsKey("args")) { |
753 args = _json["args"]; | 788 args = _json["args"]; |
754 } | 789 } |
755 if (_json.containsKey("function")) { | 790 if (_json.containsKey("function")) { |
756 function = _json["function"]; | 791 function = _json["function"]; |
757 } | 792 } |
758 } | 793 } |
759 | 794 |
760 core.Map toJson() { | 795 core.Map<core.String, core.Object> toJson() { |
761 var _json = new core.Map(); | 796 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
762 if (args != null) { | 797 if (args != null) { |
763 _json["args"] = args; | 798 _json["args"] = args; |
764 } | 799 } |
765 if (function != null) { | 800 if (function != null) { |
766 _json["function"] = function; | 801 _json["function"] = function; |
767 } | 802 } |
768 return _json; | 803 return _json; |
769 } | 804 } |
770 } | 805 } |
771 | 806 |
| 807 /** |
| 808 * Mock function definition. |
| 809 * |
| 810 * Mocks must refer to a function declared by the target service. The type of |
| 811 * the function args and result will be inferred at test time. If either the |
| 812 * arg or result values are not compatible with function type declaration, the |
| 813 * request will be considered invalid. |
| 814 * |
| 815 * More than one `FunctionMock` may be provided for a given function name so |
| 816 * long as the `Arg` matchers are distinct. There may be only one function |
| 817 * for a given overload where all `Arg` values are `Arg.any_value`. |
| 818 */ |
| 819 class FunctionMock { |
| 820 /** |
| 821 * The list of `Arg` values to match. The order in which the arguments are |
| 822 * provided is the order in which they must appear in the function |
| 823 * invocation. |
| 824 */ |
| 825 core.List<Arg> args; |
| 826 /** |
| 827 * The name of the function. |
| 828 * |
| 829 * The function name must match one provided by a service declaration. |
| 830 */ |
| 831 core.String function; |
| 832 /** The mock result of the function call. */ |
| 833 Result result; |
| 834 |
| 835 FunctionMock(); |
| 836 |
| 837 FunctionMock.fromJson(core.Map _json) { |
| 838 if (_json.containsKey("args")) { |
| 839 args = _json["args"].map((value) => new Arg.fromJson(value)).toList(); |
| 840 } |
| 841 if (_json.containsKey("function")) { |
| 842 function = _json["function"]; |
| 843 } |
| 844 if (_json.containsKey("result")) { |
| 845 result = new Result.fromJson(_json["result"]); |
| 846 } |
| 847 } |
| 848 |
| 849 core.Map<core.String, core.Object> toJson() { |
| 850 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 851 if (args != null) { |
| 852 _json["args"] = args.map((value) => (value).toJson()).toList(); |
| 853 } |
| 854 if (function != null) { |
| 855 _json["function"] = function; |
| 856 } |
| 857 if (result != null) { |
| 858 _json["result"] = (result).toJson(); |
| 859 } |
| 860 return _json; |
| 861 } |
| 862 } |
| 863 |
772 /** Issues include warnings, errors, and deprecation notices. */ | 864 /** Issues include warnings, errors, and deprecation notices. */ |
773 class Issue { | 865 class Issue { |
774 /** Short error description. */ | 866 /** Short error description. */ |
775 core.String description; | 867 core.String description; |
776 /** | 868 /** |
777 * The severity of the issue. | 869 * The severity of the issue. |
778 * Possible string values are: | 870 * Possible string values are: |
779 * - "SEVERITY_UNSPECIFIED" : An unspecified severity. | 871 * - "SEVERITY_UNSPECIFIED" : An unspecified severity. |
780 * - "DEPRECATION" : Deprecation issue for statements and method that may no | 872 * - "DEPRECATION" : Deprecation issue for statements and method that may no |
781 * longer be | 873 * longer be |
(...skipping 13 matching lines...) Expand all Loading... |
795 description = _json["description"]; | 887 description = _json["description"]; |
796 } | 888 } |
797 if (_json.containsKey("severity")) { | 889 if (_json.containsKey("severity")) { |
798 severity = _json["severity"]; | 890 severity = _json["severity"]; |
799 } | 891 } |
800 if (_json.containsKey("sourcePosition")) { | 892 if (_json.containsKey("sourcePosition")) { |
801 sourcePosition = new SourcePosition.fromJson(_json["sourcePosition"]); | 893 sourcePosition = new SourcePosition.fromJson(_json["sourcePosition"]); |
802 } | 894 } |
803 } | 895 } |
804 | 896 |
805 core.Map toJson() { | 897 core.Map<core.String, core.Object> toJson() { |
806 var _json = new core.Map(); | 898 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
807 if (description != null) { | 899 if (description != null) { |
808 _json["description"] = description; | 900 _json["description"] = description; |
809 } | 901 } |
810 if (severity != null) { | 902 if (severity != null) { |
811 _json["severity"] = severity; | 903 _json["severity"] = severity; |
812 } | 904 } |
813 if (sourcePosition != null) { | 905 if (sourcePosition != null) { |
814 _json["sourcePosition"] = (sourcePosition).toJson(); | 906 _json["sourcePosition"] = (sourcePosition).toJson(); |
815 } | 907 } |
816 return _json; | 908 return _json; |
(...skipping 14 matching lines...) Expand all Loading... |
831 | 923 |
832 ListReleasesResponse.fromJson(core.Map _json) { | 924 ListReleasesResponse.fromJson(core.Map _json) { |
833 if (_json.containsKey("nextPageToken")) { | 925 if (_json.containsKey("nextPageToken")) { |
834 nextPageToken = _json["nextPageToken"]; | 926 nextPageToken = _json["nextPageToken"]; |
835 } | 927 } |
836 if (_json.containsKey("releases")) { | 928 if (_json.containsKey("releases")) { |
837 releases = _json["releases"].map((value) => new Release.fromJson(value)).t
oList(); | 929 releases = _json["releases"].map((value) => new Release.fromJson(value)).t
oList(); |
838 } | 930 } |
839 } | 931 } |
840 | 932 |
841 core.Map toJson() { | 933 core.Map<core.String, core.Object> toJson() { |
842 var _json = new core.Map(); | 934 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
843 if (nextPageToken != null) { | 935 if (nextPageToken != null) { |
844 _json["nextPageToken"] = nextPageToken; | 936 _json["nextPageToken"] = nextPageToken; |
845 } | 937 } |
846 if (releases != null) { | 938 if (releases != null) { |
847 _json["releases"] = releases.map((value) => (value).toJson()).toList(); | 939 _json["releases"] = releases.map((value) => (value).toJson()).toList(); |
848 } | 940 } |
849 return _json; | 941 return _json; |
850 } | 942 } |
851 } | 943 } |
852 | 944 |
(...skipping 11 matching lines...) Expand all Loading... |
864 | 956 |
865 ListRulesetsResponse.fromJson(core.Map _json) { | 957 ListRulesetsResponse.fromJson(core.Map _json) { |
866 if (_json.containsKey("nextPageToken")) { | 958 if (_json.containsKey("nextPageToken")) { |
867 nextPageToken = _json["nextPageToken"]; | 959 nextPageToken = _json["nextPageToken"]; |
868 } | 960 } |
869 if (_json.containsKey("rulesets")) { | 961 if (_json.containsKey("rulesets")) { |
870 rulesets = _json["rulesets"].map((value) => new Ruleset.fromJson(value)).t
oList(); | 962 rulesets = _json["rulesets"].map((value) => new Ruleset.fromJson(value)).t
oList(); |
871 } | 963 } |
872 } | 964 } |
873 | 965 |
874 core.Map toJson() { | 966 core.Map<core.String, core.Object> toJson() { |
875 var _json = new core.Map(); | 967 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
876 if (nextPageToken != null) { | 968 if (nextPageToken != null) { |
877 _json["nextPageToken"] = nextPageToken; | 969 _json["nextPageToken"] = nextPageToken; |
878 } | 970 } |
879 if (rulesets != null) { | 971 if (rulesets != null) { |
880 _json["rulesets"] = rulesets.map((value) => (value).toJson()).toList(); | 972 _json["rulesets"] = rulesets.map((value) => (value).toJson()).toList(); |
881 } | 973 } |
882 return _json; | 974 return _json; |
883 } | 975 } |
884 } | 976 } |
885 | 977 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 name = _json["name"]; | 1033 name = _json["name"]; |
942 } | 1034 } |
943 if (_json.containsKey("rulesetName")) { | 1035 if (_json.containsKey("rulesetName")) { |
944 rulesetName = _json["rulesetName"]; | 1036 rulesetName = _json["rulesetName"]; |
945 } | 1037 } |
946 if (_json.containsKey("updateTime")) { | 1038 if (_json.containsKey("updateTime")) { |
947 updateTime = _json["updateTime"]; | 1039 updateTime = _json["updateTime"]; |
948 } | 1040 } |
949 } | 1041 } |
950 | 1042 |
951 core.Map toJson() { | 1043 core.Map<core.String, core.Object> toJson() { |
952 var _json = new core.Map(); | 1044 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
953 if (createTime != null) { | 1045 if (createTime != null) { |
954 _json["createTime"] = createTime; | 1046 _json["createTime"] = createTime; |
955 } | 1047 } |
956 if (name != null) { | 1048 if (name != null) { |
957 _json["name"] = name; | 1049 _json["name"] = name; |
958 } | 1050 } |
959 if (rulesetName != null) { | 1051 if (rulesetName != null) { |
960 _json["rulesetName"] = rulesetName; | 1052 _json["rulesetName"] = rulesetName; |
961 } | 1053 } |
962 if (updateTime != null) { | 1054 if (updateTime != null) { |
963 _json["updateTime"] = updateTime; | 1055 _json["updateTime"] = updateTime; |
964 } | 1056 } |
965 return _json; | 1057 return _json; |
966 } | 1058 } |
967 } | 1059 } |
968 | 1060 |
| 1061 /** Possible result values from the function mock invocation. */ |
| 1062 class Result { |
| 1063 /** The result is undefined, meaning the result could not be computed. */ |
| 1064 Empty undefined; |
| 1065 /** |
| 1066 * The result is an actual value. The type of the value must match that |
| 1067 * of the type declared by the service. |
| 1068 * |
| 1069 * The values for Object must be JSON objects. It can consist of `num`, |
| 1070 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1071 */ |
| 1072 core.Object value; |
| 1073 |
| 1074 Result(); |
| 1075 |
| 1076 Result.fromJson(core.Map _json) { |
| 1077 if (_json.containsKey("undefined")) { |
| 1078 undefined = new Empty.fromJson(_json["undefined"]); |
| 1079 } |
| 1080 if (_json.containsKey("value")) { |
| 1081 value = _json["value"]; |
| 1082 } |
| 1083 } |
| 1084 |
| 1085 core.Map<core.String, core.Object> toJson() { |
| 1086 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1087 if (undefined != null) { |
| 1088 _json["undefined"] = (undefined).toJson(); |
| 1089 } |
| 1090 if (value != null) { |
| 1091 _json["value"] = value; |
| 1092 } |
| 1093 return _json; |
| 1094 } |
| 1095 } |
| 1096 |
969 /** | 1097 /** |
970 * `Ruleset` is an immutable copy of `Source` with a globally unique identifier | 1098 * `Ruleset` is an immutable copy of `Source` with a globally unique identifier |
971 * and a creation time. | 1099 * and a creation time. |
972 */ | 1100 */ |
973 class Ruleset { | 1101 class Ruleset { |
974 /** | 1102 /** |
975 * Time the `Ruleset` was created. | 1103 * Time the `Ruleset` was created. |
976 * Output only. | 1104 * Output only. |
977 */ | 1105 */ |
978 core.String createTime; | 1106 core.String createTime; |
(...skipping 13 matching lines...) Expand all Loading... |
992 createTime = _json["createTime"]; | 1120 createTime = _json["createTime"]; |
993 } | 1121 } |
994 if (_json.containsKey("name")) { | 1122 if (_json.containsKey("name")) { |
995 name = _json["name"]; | 1123 name = _json["name"]; |
996 } | 1124 } |
997 if (_json.containsKey("source")) { | 1125 if (_json.containsKey("source")) { |
998 source = new Source.fromJson(_json["source"]); | 1126 source = new Source.fromJson(_json["source"]); |
999 } | 1127 } |
1000 } | 1128 } |
1001 | 1129 |
1002 core.Map toJson() { | 1130 core.Map<core.String, core.Object> toJson() { |
1003 var _json = new core.Map(); | 1131 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
1004 if (createTime != null) { | 1132 if (createTime != null) { |
1005 _json["createTime"] = createTime; | 1133 _json["createTime"] = createTime; |
1006 } | 1134 } |
1007 if (name != null) { | 1135 if (name != null) { |
1008 _json["name"] = name; | 1136 _json["name"] = name; |
1009 } | 1137 } |
1010 if (source != null) { | 1138 if (source != null) { |
1011 _json["source"] = (source).toJson(); | 1139 _json["source"] = (source).toJson(); |
1012 } | 1140 } |
1013 return _json; | 1141 return _json; |
1014 } | 1142 } |
1015 } | 1143 } |
1016 | 1144 |
1017 /** | 1145 /** |
1018 * `Source` is one or more `File` messages comprising a logical set of rules. | 1146 * `Source` is one or more `File` messages comprising a logical set of rules. |
1019 */ | 1147 */ |
1020 class Source { | 1148 class Source { |
1021 /** `File` set constituting the `Source` bundle. */ | 1149 /** `File` set constituting the `Source` bundle. */ |
1022 core.List<File> files; | 1150 core.List<File> files; |
1023 | 1151 |
1024 Source(); | 1152 Source(); |
1025 | 1153 |
1026 Source.fromJson(core.Map _json) { | 1154 Source.fromJson(core.Map _json) { |
1027 if (_json.containsKey("files")) { | 1155 if (_json.containsKey("files")) { |
1028 files = _json["files"].map((value) => new File.fromJson(value)).toList(); | 1156 files = _json["files"].map((value) => new File.fromJson(value)).toList(); |
1029 } | 1157 } |
1030 } | 1158 } |
1031 | 1159 |
1032 core.Map toJson() { | 1160 core.Map<core.String, core.Object> toJson() { |
1033 var _json = new core.Map(); | 1161 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
1034 if (files != null) { | 1162 if (files != null) { |
1035 _json["files"] = files.map((value) => (value).toJson()).toList(); | 1163 _json["files"] = files.map((value) => (value).toJson()).toList(); |
1036 } | 1164 } |
1037 return _json; | 1165 return _json; |
1038 } | 1166 } |
1039 } | 1167 } |
1040 | 1168 |
1041 /** | 1169 /** |
1042 * Position in the `Source` content including its line, column number, and an | 1170 * Position in the `Source` content including its line, column number, and an |
1043 * index of the `File` in the `Source` message. Used for debug purposes. | 1171 * index of the `File` in the `Source` message. Used for debug purposes. |
(...skipping 13 matching lines...) Expand all Loading... |
1057 column = _json["column"]; | 1185 column = _json["column"]; |
1058 } | 1186 } |
1059 if (_json.containsKey("fileName")) { | 1187 if (_json.containsKey("fileName")) { |
1060 fileName = _json["fileName"]; | 1188 fileName = _json["fileName"]; |
1061 } | 1189 } |
1062 if (_json.containsKey("line")) { | 1190 if (_json.containsKey("line")) { |
1063 line = _json["line"]; | 1191 line = _json["line"]; |
1064 } | 1192 } |
1065 } | 1193 } |
1066 | 1194 |
1067 core.Map toJson() { | 1195 core.Map<core.String, core.Object> toJson() { |
1068 var _json = new core.Map(); | 1196 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
1069 if (column != null) { | 1197 if (column != null) { |
1070 _json["column"] = column; | 1198 _json["column"] = column; |
1071 } | 1199 } |
1072 if (fileName != null) { | 1200 if (fileName != null) { |
1073 _json["fileName"] = fileName; | 1201 _json["fileName"] = fileName; |
1074 } | 1202 } |
1075 if (line != null) { | 1203 if (line != null) { |
1076 _json["line"] = line; | 1204 _json["line"] = line; |
1077 } | 1205 } |
1078 return _json; | 1206 return _json; |
1079 } | 1207 } |
1080 } | 1208 } |
1081 | 1209 |
1082 /** | 1210 /** |
| 1211 * `TestCase` messages provide the request context and an expectation as to |
| 1212 * whether the given context will be allowed or denied. Test cases may specify |
| 1213 * the `request`, `resource`, and `function_mocks` to mock a function call to |
| 1214 * a service-provided function. |
| 1215 * |
| 1216 * The `request` object represents context present at request-time. |
| 1217 * |
| 1218 * The `resource` is the value of the target resource as it appears in |
| 1219 * persistent storage before the request is executed. |
| 1220 */ |
| 1221 class TestCase { |
| 1222 /** |
| 1223 * Test expectation. |
| 1224 * Possible string values are: |
| 1225 * - "EXPECTATION_UNSPECIFIED" : Unspecified expectation. |
| 1226 * - "ALLOW" : Expect an allowed result. |
| 1227 * - "DENY" : Expect a denied result. |
| 1228 */ |
| 1229 core.String expectation; |
| 1230 /** |
| 1231 * Optional function mocks for service-defined functions. If not set, any |
| 1232 * service defined function is expected to return an error, which may or may |
| 1233 * not influence the test outcome. |
| 1234 */ |
| 1235 core.List<FunctionMock> functionMocks; |
| 1236 /** |
| 1237 * Request context. |
| 1238 * |
| 1239 * The exact format of the request context is service-dependent. See the |
| 1240 * appropriate service documentation for information about the supported |
| 1241 * fields and types on the request. Minimally, all services support the |
| 1242 * following fields and types: |
| 1243 * |
| 1244 * Request field | Type |
| 1245 * ---------------|----------------- |
| 1246 * auth.uid | `string` |
| 1247 * auth.token | `map<string, string>` |
| 1248 * headers | `map<string, string>` |
| 1249 * method | `string` |
| 1250 * params | `map<string, string>` |
| 1251 * path | `string` |
| 1252 * time | `google.protobuf.Timestamp` |
| 1253 * |
| 1254 * If the request value is not well-formed for the service, the request will |
| 1255 * be rejected as an invalid argument. |
| 1256 * |
| 1257 * The values for Object must be JSON objects. It can consist of `num`, |
| 1258 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1259 */ |
| 1260 core.Object request; |
| 1261 /** |
| 1262 * Optional resource value as it appears in persistent storage before the |
| 1263 * request is fulfilled. |
| 1264 * |
| 1265 * The resource type depends on the `request.path` value. |
| 1266 * |
| 1267 * The values for Object must be JSON objects. It can consist of `num`, |
| 1268 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1269 */ |
| 1270 core.Object resource; |
| 1271 |
| 1272 TestCase(); |
| 1273 |
| 1274 TestCase.fromJson(core.Map _json) { |
| 1275 if (_json.containsKey("expectation")) { |
| 1276 expectation = _json["expectation"]; |
| 1277 } |
| 1278 if (_json.containsKey("functionMocks")) { |
| 1279 functionMocks = _json["functionMocks"].map((value) => new FunctionMock.fro
mJson(value)).toList(); |
| 1280 } |
| 1281 if (_json.containsKey("request")) { |
| 1282 request = _json["request"]; |
| 1283 } |
| 1284 if (_json.containsKey("resource")) { |
| 1285 resource = _json["resource"]; |
| 1286 } |
| 1287 } |
| 1288 |
| 1289 core.Map<core.String, core.Object> toJson() { |
| 1290 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1291 if (expectation != null) { |
| 1292 _json["expectation"] = expectation; |
| 1293 } |
| 1294 if (functionMocks != null) { |
| 1295 _json["functionMocks"] = functionMocks.map((value) => (value).toJson()).to
List(); |
| 1296 } |
| 1297 if (request != null) { |
| 1298 _json["request"] = request; |
| 1299 } |
| 1300 if (resource != null) { |
| 1301 _json["resource"] = resource; |
| 1302 } |
| 1303 return _json; |
| 1304 } |
| 1305 } |
| 1306 |
| 1307 /** |
1083 * Test result message containing the state of the test as well as a | 1308 * Test result message containing the state of the test as well as a |
1084 * description and source position for test failures. | 1309 * description and source position for test failures. |
1085 */ | 1310 */ |
1086 class TestResult { | 1311 class TestResult { |
1087 /** | 1312 /** |
1088 * Debug messages related to test execution issues encountered during | 1313 * Debug messages related to test execution issues encountered during |
1089 * evaluation. | 1314 * evaluation. |
1090 * | 1315 * |
1091 * Debug messages may be related to too many or too few invocations of | 1316 * Debug messages may be related to too many or too few invocations of |
1092 * function mocks or to runtime errors that occur during evaluation. | 1317 * function mocks or to runtime errors that occur during evaluation. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 errorPosition = new SourcePosition.fromJson(_json["errorPosition"]); | 1357 errorPosition = new SourcePosition.fromJson(_json["errorPosition"]); |
1133 } | 1358 } |
1134 if (_json.containsKey("functionCalls")) { | 1359 if (_json.containsKey("functionCalls")) { |
1135 functionCalls = _json["functionCalls"].map((value) => new FunctionCall.fro
mJson(value)).toList(); | 1360 functionCalls = _json["functionCalls"].map((value) => new FunctionCall.fro
mJson(value)).toList(); |
1136 } | 1361 } |
1137 if (_json.containsKey("state")) { | 1362 if (_json.containsKey("state")) { |
1138 state = _json["state"]; | 1363 state = _json["state"]; |
1139 } | 1364 } |
1140 } | 1365 } |
1141 | 1366 |
1142 core.Map toJson() { | 1367 core.Map<core.String, core.Object> toJson() { |
1143 var _json = new core.Map(); | 1368 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
1144 if (debugMessages != null) { | 1369 if (debugMessages != null) { |
1145 _json["debugMessages"] = debugMessages; | 1370 _json["debugMessages"] = debugMessages; |
1146 } | 1371 } |
1147 if (errorPosition != null) { | 1372 if (errorPosition != null) { |
1148 _json["errorPosition"] = (errorPosition).toJson(); | 1373 _json["errorPosition"] = (errorPosition).toJson(); |
1149 } | 1374 } |
1150 if (functionCalls != null) { | 1375 if (functionCalls != null) { |
1151 _json["functionCalls"] = functionCalls.map((value) => (value).toJson()).to
List(); | 1376 _json["functionCalls"] = functionCalls.map((value) => (value).toJson()).to
List(); |
1152 } | 1377 } |
1153 if (state != null) { | 1378 if (state != null) { |
1154 _json["state"] = state; | 1379 _json["state"] = state; |
1155 } | 1380 } |
1156 return _json; | 1381 return _json; |
1157 } | 1382 } |
1158 } | 1383 } |
1159 | 1384 |
1160 /** The request for FirebaseRulesService.TestRuleset. */ | 1385 /** The request for FirebaseRulesService.TestRuleset. */ |
1161 class TestRulesetRequest { | 1386 class TestRulesetRequest { |
1162 /** | 1387 /** |
1163 * Optional `Source` to be checked for correctness. | 1388 * Optional `Source` to be checked for correctness. |
1164 * | 1389 * |
1165 * This field must not be set when the resource name refers to a `Ruleset`. | 1390 * This field must not be set when the resource name refers to a `Ruleset`. |
1166 */ | 1391 */ |
1167 Source source; | 1392 Source source; |
| 1393 /** Inline `TestSuite` to run. */ |
| 1394 TestSuite testSuite; |
1168 | 1395 |
1169 TestRulesetRequest(); | 1396 TestRulesetRequest(); |
1170 | 1397 |
1171 TestRulesetRequest.fromJson(core.Map _json) { | 1398 TestRulesetRequest.fromJson(core.Map _json) { |
1172 if (_json.containsKey("source")) { | 1399 if (_json.containsKey("source")) { |
1173 source = new Source.fromJson(_json["source"]); | 1400 source = new Source.fromJson(_json["source"]); |
1174 } | 1401 } |
| 1402 if (_json.containsKey("testSuite")) { |
| 1403 testSuite = new TestSuite.fromJson(_json["testSuite"]); |
| 1404 } |
1175 } | 1405 } |
1176 | 1406 |
1177 core.Map toJson() { | 1407 core.Map<core.String, core.Object> toJson() { |
1178 var _json = new core.Map(); | 1408 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
1179 if (source != null) { | 1409 if (source != null) { |
1180 _json["source"] = (source).toJson(); | 1410 _json["source"] = (source).toJson(); |
1181 } | 1411 } |
| 1412 if (testSuite != null) { |
| 1413 _json["testSuite"] = (testSuite).toJson(); |
| 1414 } |
1182 return _json; | 1415 return _json; |
1183 } | 1416 } |
1184 } | 1417 } |
1185 | 1418 |
1186 /** The response for FirebaseRulesService.TestRuleset. */ | 1419 /** The response for FirebaseRulesService.TestRuleset. */ |
1187 class TestRulesetResponse { | 1420 class TestRulesetResponse { |
1188 /** | 1421 /** |
1189 * Syntactic and semantic `Source` issues of varying severity. Issues of | 1422 * Syntactic and semantic `Source` issues of varying severity. Issues of |
1190 * `ERROR` severity will prevent tests from executing. | 1423 * `ERROR` severity will prevent tests from executing. |
1191 */ | 1424 */ |
1192 core.List<Issue> issues; | 1425 core.List<Issue> issues; |
1193 /** | 1426 /** |
1194 * The set of test results given the test cases in the `TestSuite`. | 1427 * The set of test results given the test cases in the `TestSuite`. |
1195 * The results will appear in the same order as the test cases appear in the | 1428 * The results will appear in the same order as the test cases appear in the |
1196 * `TestSuite`. | 1429 * `TestSuite`. |
1197 */ | 1430 */ |
1198 core.List<TestResult> testResults; | 1431 core.List<TestResult> testResults; |
1199 | 1432 |
1200 TestRulesetResponse(); | 1433 TestRulesetResponse(); |
1201 | 1434 |
1202 TestRulesetResponse.fromJson(core.Map _json) { | 1435 TestRulesetResponse.fromJson(core.Map _json) { |
1203 if (_json.containsKey("issues")) { | 1436 if (_json.containsKey("issues")) { |
1204 issues = _json["issues"].map((value) => new Issue.fromJson(value)).toList(
); | 1437 issues = _json["issues"].map((value) => new Issue.fromJson(value)).toList(
); |
1205 } | 1438 } |
1206 if (_json.containsKey("testResults")) { | 1439 if (_json.containsKey("testResults")) { |
1207 testResults = _json["testResults"].map((value) => new TestResult.fromJson(
value)).toList(); | 1440 testResults = _json["testResults"].map((value) => new TestResult.fromJson(
value)).toList(); |
1208 } | 1441 } |
1209 } | 1442 } |
1210 | 1443 |
1211 core.Map toJson() { | 1444 core.Map<core.String, core.Object> toJson() { |
1212 var _json = new core.Map(); | 1445 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
1213 if (issues != null) { | 1446 if (issues != null) { |
1214 _json["issues"] = issues.map((value) => (value).toJson()).toList(); | 1447 _json["issues"] = issues.map((value) => (value).toJson()).toList(); |
1215 } | 1448 } |
1216 if (testResults != null) { | 1449 if (testResults != null) { |
1217 _json["testResults"] = testResults.map((value) => (value).toJson()).toList
(); | 1450 _json["testResults"] = testResults.map((value) => (value).toJson()).toList
(); |
1218 } | 1451 } |
1219 return _json; | 1452 return _json; |
1220 } | 1453 } |
1221 } | 1454 } |
| 1455 |
| 1456 /** |
| 1457 * `TestSuite` is a collection of `TestCase` instances that validate the logical |
| 1458 * correctness of a `Ruleset`. The `TestSuite` may be referenced in-line within |
| 1459 * a `TestRuleset` invocation or as part of a `Release` object as a pre-release |
| 1460 * check. |
| 1461 */ |
| 1462 class TestSuite { |
| 1463 /** Collection of test cases associated with the `TestSuite`. */ |
| 1464 core.List<TestCase> testCases; |
| 1465 |
| 1466 TestSuite(); |
| 1467 |
| 1468 TestSuite.fromJson(core.Map _json) { |
| 1469 if (_json.containsKey("testCases")) { |
| 1470 testCases = _json["testCases"].map((value) => new TestCase.fromJson(value)
).toList(); |
| 1471 } |
| 1472 } |
| 1473 |
| 1474 core.Map<core.String, core.Object> toJson() { |
| 1475 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1476 if (testCases != null) { |
| 1477 _json["testCases"] = testCases.map((value) => (value).toJson()).toList(); |
| 1478 } |
| 1479 return _json; |
| 1480 } |
| 1481 } |
OLD | NEW |