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 30 matching lines...) Expand all Loading... |
41 class ProjectsResourceApi { | 41 class ProjectsResourceApi { |
42 final commons.ApiRequester _requester; | 42 final commons.ApiRequester _requester; |
43 | 43 |
44 ProjectsReleasesResourceApi get releases => new ProjectsReleasesResourceApi(_r
equester); | 44 ProjectsReleasesResourceApi get releases => new ProjectsReleasesResourceApi(_r
equester); |
45 ProjectsRulesetsResourceApi get rulesets => new ProjectsRulesetsResourceApi(_r
equester); | 45 ProjectsRulesetsResourceApi get rulesets => new ProjectsRulesetsResourceApi(_r
equester); |
46 | 46 |
47 ProjectsResourceApi(commons.ApiRequester client) : | 47 ProjectsResourceApi(commons.ApiRequester client) : |
48 _requester = client; | 48 _requester = client; |
49 | 49 |
50 /** | 50 /** |
51 * Test `Source` for syntactic and semantic correctness. Issues present in the | 51 * Test `Source` for syntactic and semantic correctness. Issues present, if |
52 * rules, if any, will be returned to the caller with a description, severity, | 52 * any, will be returned to the caller with a description, severity, and |
53 * and source location. | 53 * source location. |
54 * | 54 * |
55 * The test method will typically be executed with a developer provided | 55 * The test method may be executed with `Source` or a `Ruleset` name. |
56 * `Source`, but if regression testing is desired, this method may be | 56 * Passing `Source` is useful for unit testing new rules. Passing a `Ruleset` |
57 * executed against a `Ruleset` resource name and the `Source` will be | 57 * name is useful for regression testing an existing rule. |
58 * retrieved from the persisted `Ruleset`. | |
59 * | 58 * |
60 * The following is an example of `Source` that permits users to upload images | 59 * The following is an example of `Source` that permits users to upload images |
61 * to a bucket bearing their user id and matching the correct metadata: | 60 * to a bucket bearing their user id and matching the correct metadata: |
62 * | 61 * |
63 * _*Example*_ | 62 * _*Example*_ |
64 * | 63 * |
65 * // Users are allowed to subscribe and unsubscribe to the blog. | 64 * // Users are allowed to subscribe and unsubscribe to the blog. |
66 * service firebase.storage { | 65 * service firebase.storage { |
67 * match /users/{userId}/images/{imageName} { | 66 * match /users/{userId}/images/{imageName} { |
68 * allow write: if userId == request.userId | 67 * allow write: if userId == request.auth.uid |
69 * && (imageName.endsWith('.png') || imageName.endsWith('.jpg')) | 68 * && (imageName.matches('*.png$') |
70 * && resource.mimeType.startsWith('image/') | 69 * || imageName.matches('*.jpg$')) |
| 70 * && resource.mimeType.matches('^image/') |
71 * } | 71 * } |
72 * } | 72 * } |
73 * | 73 * |
74 * [request] - The metadata request object. | 74 * [request] - The metadata request object. |
75 * | 75 * |
76 * Request parameters: | 76 * Request parameters: |
77 * | 77 * |
78 * [name] - Name of the project. | 78 * [name] - Tests may either provide `source` or a `Ruleset` resource name. |
79 * | 79 * |
| 80 * For tests against `source`, the resource name must refer to the project: |
80 * Format: `projects/{project_id}` | 81 * Format: `projects/{project_id}` |
| 82 * |
| 83 * For tests against a `Ruleset`, this must be the `Ruleset` resource name: |
| 84 * Format: `projects/{project_id}/rulesets/{ruleset_id}` |
81 * Value must have pattern "^projects/.+$". | 85 * Value must have pattern "^projects/.+$". |
82 * | 86 * |
83 * Completes with a [TestRulesetResponse]. | 87 * Completes with a [TestRulesetResponse]. |
84 * | 88 * |
85 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 89 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
86 * error. | 90 * error. |
87 * | 91 * |
88 * If the used [http.Client] completes with an error when making a REST call, | 92 * If the used [http.Client] completes with an error when making a REST call, |
89 * this method will complete with the same error. | 93 * this method will complete with the same error. |
90 */ | 94 */ |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 * | 143 * |
140 * Release Name | Ruleset Name | 144 * Release Name | Ruleset Name |
141 * --------------------------------|------------- | 145 * --------------------------------|------------- |
142 * projects/foo/releases/prod | projects/foo/rulesets/uuid123 | 146 * projects/foo/releases/prod | projects/foo/rulesets/uuid123 |
143 * projects/foo/releases/prod/beta | projects/foo/rulesets/uuid123 | 147 * projects/foo/releases/prod/beta | projects/foo/rulesets/uuid123 |
144 * projects/foo/releases/prod/v23 | projects/foo/rulesets/uuid456 | 148 * projects/foo/releases/prod/v23 | projects/foo/rulesets/uuid456 |
145 * | 149 * |
146 * The table reflects the `Ruleset` rollout in progress. The `prod` and | 150 * The table reflects the `Ruleset` rollout in progress. The `prod` and |
147 * `prod/beta` releases refer to the same `Ruleset`. However, `prod/v23` | 151 * `prod/beta` releases refer to the same `Ruleset`. However, `prod/v23` |
148 * refers to a new `Ruleset`. The `Ruleset` reference for a `Release` may be | 152 * refers to a new `Ruleset`. The `Ruleset` reference for a `Release` may be |
149 * updated using the UpdateRelease method, and the custom `Release` name | 153 * updated using the UpdateRelease method. |
150 * may be referenced by specifying the `X-Firebase-Rules-Release-Name` header. | |
151 * | 154 * |
152 * [request] - The metadata request object. | 155 * [request] - The metadata request object. |
153 * | 156 * |
154 * Request parameters: | 157 * Request parameters: |
155 * | 158 * |
156 * [name] - Resource name for the project which owns this `Release`. | 159 * [name] - Resource name for the project which owns this `Release`. |
157 * | 160 * |
158 * Format: `projects/{project_id}` | 161 * Format: `projects/{project_id}` |
159 * Value must have pattern "^projects/[^/]+$". | 162 * Value must have pattern "^projects/[^/]+$". |
160 * | 163 * |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 return _response.then((data) => new Empty.fromJson(data)); | 238 return _response.then((data) => new Empty.fromJson(data)); |
236 } | 239 } |
237 | 240 |
238 /** | 241 /** |
239 * Get a `Release` by name. | 242 * Get a `Release` by name. |
240 * | 243 * |
241 * Request parameters: | 244 * Request parameters: |
242 * | 245 * |
243 * [name] - Resource name of the `Release`. | 246 * [name] - Resource name of the `Release`. |
244 * | 247 * |
245 * | |
246 * Format: `projects/{project_id}/releases/{release_id}` | 248 * Format: `projects/{project_id}/releases/{release_id}` |
247 * Value must have pattern "^projects/[^/]+/releases/.+$". | 249 * Value must have pattern "^projects/[^/]+/releases/.+$". |
248 * | 250 * |
249 * Completes with a [Release]. | 251 * Completes with a [Release]. |
250 * | 252 * |
251 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 253 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
252 * error. | 254 * error. |
253 * | 255 * |
254 * If the used [http.Client] completes with an error when making a REST call, | 256 * If the used [http.Client] completes with an error when making a REST call, |
255 * this method will complete with the same error. | 257 * this method will complete with the same error. |
(...skipping 17 matching lines...) Expand all Loading... |
273 body: _body, | 275 body: _body, |
274 queryParams: _queryParams, | 276 queryParams: _queryParams, |
275 uploadOptions: _uploadOptions, | 277 uploadOptions: _uploadOptions, |
276 uploadMedia: _uploadMedia, | 278 uploadMedia: _uploadMedia, |
277 downloadOptions: _downloadOptions); | 279 downloadOptions: _downloadOptions); |
278 return _response.then((data) => new Release.fromJson(data)); | 280 return _response.then((data) => new Release.fromJson(data)); |
279 } | 281 } |
280 | 282 |
281 /** | 283 /** |
282 * List the `Release` values for a project. This list may optionally be | 284 * List the `Release` values for a project. This list may optionally be |
283 * filtered by `Release` name or `Ruleset` id or both. | 285 * filtered by `Release` name, `Ruleset` name, `TestSuite` name, or any |
| 286 * combination thereof. |
284 * | 287 * |
285 * Request parameters: | 288 * Request parameters: |
286 * | 289 * |
287 * [name] - Resource name for the project. | 290 * [name] - Resource name for the project. |
288 * | 291 * |
289 * Format: `projects/{project_id}` | 292 * Format: `projects/{project_id}` |
290 * Value must have pattern "^projects/[^/]+$". | 293 * Value must have pattern "^projects/[^/]+$". |
291 * | 294 * |
292 * [filter] - `Release` filter. The list method supports filters with | 295 * [filter] - `Release` filter. The list method supports filters with |
293 * restrictions on the | 296 * restrictions on the |
294 * `Release` `name` and also on the `Ruleset` `ruleset_name`. | 297 * `Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`. |
295 * | 298 * |
296 * Example 1) A filter of 'name=prod*' might return `Release`s with names | 299 * Example 1: A filter of 'name=prod*' might return `Release`s with names |
297 * within 'projects/foo' prefixed with 'prod': | 300 * within 'projects/foo' prefixed with 'prod': |
298 * | 301 * |
299 * Name | Ruleset Name | 302 * Name | Ruleset Name |
300 * ------------------------------|------------- | 303 * ------------------------------|------------- |
301 * projects/foo/releases/prod | projects/foo/rulesets/uuid1234 | 304 * projects/foo/releases/prod | projects/foo/rulesets/uuid1234 |
302 * projects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234 | 305 * projects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234 |
303 * projects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888 | 306 * projects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888 |
304 * | 307 * |
305 * Example 2) A filter of `name=prod* ruleset_name=uuid1234` would return only | 308 * Example 2: A filter of `name=prod* ruleset_name=uuid1234` would return only |
306 * `Release` instances for 'projects/foo' with names prefixed with 'prod' | 309 * `Release` instances for 'projects/foo' with names prefixed with 'prod' |
307 * referring to the same `Ruleset` name of 'uuid1234': | 310 * referring to the same `Ruleset` name of 'uuid1234': |
308 * | 311 * |
309 * Name | Ruleset Name | 312 * Name | Ruleset Name |
310 * ------------------------------|------------- | 313 * ------------------------------|------------- |
311 * projects/foo/releases/prod | projects/foo/rulesets/1234 | 314 * projects/foo/releases/prod | projects/foo/rulesets/1234 |
312 * projects/foo/releases/prod/v1 | projects/foo/rulesets/1234 | 315 * projects/foo/releases/prod/v1 | projects/foo/rulesets/1234 |
313 * | 316 * |
314 * In the examples, the filter parameters refer to the search filters for | 317 * In the examples, the filter parameters refer to the search filters are |
315 * release and ruleset names are relative to the project releases and rulesets | 318 * relative to the project. Fully qualified prefixed may also be used. e.g. |
316 * collections. Fully qualified prefixed may also be used. e.g. | 319 * `test_suite_name=projects/foo/testsuites/uuid1` |
317 * `name=projects/foo/releases/prod* ruleset_name=projects/foo/rulesets/uuid1` | |
318 * | 320 * |
319 * [pageToken] - Next page token for the next batch of `Release` instances. | 321 * [pageToken] - Next page token for the next batch of `Release` instances. |
320 * | 322 * |
321 * [pageSize] - Page size to load. Maximum of 100. Defaults to 10. | 323 * [pageSize] - Page size to load. Maximum of 100. Defaults to 10. |
322 * Note: `page_size` is just a hint and the service may choose to load less | 324 * Note: `page_size` is just a hint and the service may choose to load fewer |
323 * than `page_size` due to the size of the output. To traverse all of the | 325 * than `page_size` results due to the size of the output. To traverse all of |
324 * releases, caller should iterate until the `page_token` is empty. | 326 * the releases, the caller should iterate until the `page_token` on the |
| 327 * response is empty. |
325 * | 328 * |
326 * Completes with a [ListReleasesResponse]. | 329 * Completes with a [ListReleasesResponse]. |
327 * | 330 * |
328 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 331 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
329 * error. | 332 * error. |
330 * | 333 * |
331 * 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, |
332 * this method will complete with the same error. | 335 * this method will complete with the same error. |
333 */ | 336 */ |
334 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 filter,
core.String pageToken, core.int pageSize}) { |
(...skipping 25 matching lines...) Expand all Loading... |
360 queryParams: _queryParams, | 363 queryParams: _queryParams, |
361 uploadOptions: _uploadOptions, | 364 uploadOptions: _uploadOptions, |
362 uploadMedia: _uploadMedia, | 365 uploadMedia: _uploadMedia, |
363 downloadOptions: _downloadOptions); | 366 downloadOptions: _downloadOptions); |
364 return _response.then((data) => new ListReleasesResponse.fromJson(data)); | 367 return _response.then((data) => new ListReleasesResponse.fromJson(data)); |
365 } | 368 } |
366 | 369 |
367 /** | 370 /** |
368 * Update a `Release`. | 371 * Update a `Release`. |
369 * | 372 * |
370 * Only updates to the `ruleset_name` field will be honored. `Release` rename | 373 * Only updates to the `ruleset_name` and `test_suite_name` fields will be |
371 * is not supported. To create a `Release` use the CreateRelease method | 374 * honored. `Release` rename is not supported. To create a `Release` use the |
372 * instead. | 375 * CreateRelease method. |
373 * | 376 * |
374 * [request] - The metadata request object. | 377 * [request] - The metadata request object. |
375 * | 378 * |
376 * Request parameters: | 379 * Request parameters: |
377 * | 380 * |
378 * [name] - Resource name for the `Release`. | 381 * [name] - Resource name for the `Release`. |
379 * | 382 * |
380 * `Release` names may be structured `app1/prod/v2` or flat `app1_prod_v2` | 383 * `Release` names may be structured `app1/prod/v2` or flat `app1_prod_v2` |
381 * which affords developers a great deal of flexibility in mapping the name | 384 * which affords developers a great deal of flexibility in mapping the name |
382 * to the style that best fits their existing development practices. For | 385 * to the style that best fits their existing development practices. For |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 "GET", | 580 "GET", |
578 body: _body, | 581 body: _body, |
579 queryParams: _queryParams, | 582 queryParams: _queryParams, |
580 uploadOptions: _uploadOptions, | 583 uploadOptions: _uploadOptions, |
581 uploadMedia: _uploadMedia, | 584 uploadMedia: _uploadMedia, |
582 downloadOptions: _downloadOptions); | 585 downloadOptions: _downloadOptions); |
583 return _response.then((data) => new Ruleset.fromJson(data)); | 586 return _response.then((data) => new Ruleset.fromJson(data)); |
584 } | 587 } |
585 | 588 |
586 /** | 589 /** |
587 * List `Ruleset` metadata only and optionally filter the results by Ruleset | 590 * List `Ruleset` metadata only and optionally filter the results by `Ruleset` |
588 * name. | 591 * name. |
589 * | 592 * |
590 * The full `Source` contents of a `Ruleset` may be retrieved with | 593 * The full `Source` contents of a `Ruleset` may be retrieved with |
591 * GetRuleset. | 594 * GetRuleset. |
592 * | 595 * |
593 * Request parameters: | 596 * Request parameters: |
594 * | 597 * |
595 * [name] - Resource name for the project. | 598 * [name] - Resource name for the project. |
596 * | 599 * |
597 * Format: `projects/{project_id}` | 600 * Format: `projects/{project_id}` |
598 * Value must have pattern "^projects/[^/]+$". | 601 * Value must have pattern "^projects/[^/]+$". |
599 * | 602 * |
| 603 * [filter] - `Ruleset` filter. The list method supports filters with |
| 604 * restrictions on |
| 605 * `Ruleset.name`. |
| 606 * |
| 607 * Filters on `Ruleset.create_time` should use the `date` function which |
| 608 * parses strings that conform to the RFC 3339 date/time specifications. |
| 609 * |
| 610 * Example: `create_time > date("2017-01-01") AND name=UUID-*` |
| 611 * |
600 * [pageToken] - Next page token for loading the next batch of `Ruleset` | 612 * [pageToken] - Next page token for loading the next batch of `Ruleset` |
601 * instances. | 613 * instances. |
602 * | 614 * |
603 * [pageSize] - Page size to load. Maximum of 100. Defaults to 10. | 615 * [pageSize] - Page size to load. Maximum of 100. Defaults to 10. |
604 * Note: `page_size` is just a hint and the service may choose to load less | 616 * Note: `page_size` is just a hint and the service may choose to load less |
605 * than `page_size` due to the size of the output. To traverse all of the | 617 * than `page_size` due to the size of the output. To traverse all of the |
606 * releases, caller should iterate until the `page_token` is empty. | 618 * releases, caller should iterate until the `page_token` is empty. |
607 * | 619 * |
608 * Completes with a [ListRulesetsResponse]. | 620 * Completes with a [ListRulesetsResponse]. |
609 * | 621 * |
610 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 622 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
611 * error. | 623 * error. |
612 * | 624 * |
613 * If the used [http.Client] completes with an error when making a REST call, | 625 * If the used [http.Client] completes with an error when making a REST call, |
614 * this method will complete with the same error. | 626 * this method will complete with the same error. |
615 */ | 627 */ |
616 async.Future<ListRulesetsResponse> list(core.String name, {core.String pageTok
en, core.int pageSize}) { | 628 async.Future<ListRulesetsResponse> list(core.String name, {core.String filter,
core.String pageToken, core.int pageSize}) { |
617 var _url = null; | 629 var _url = null; |
618 var _queryParams = new core.Map(); | 630 var _queryParams = new core.Map(); |
619 var _uploadMedia = null; | 631 var _uploadMedia = null; |
620 var _uploadOptions = null; | 632 var _uploadOptions = null; |
621 var _downloadOptions = commons.DownloadOptions.Metadata; | 633 var _downloadOptions = commons.DownloadOptions.Metadata; |
622 var _body = null; | 634 var _body = null; |
623 | 635 |
624 if (name == null) { | 636 if (name == null) { |
625 throw new core.ArgumentError("Parameter name is required."); | 637 throw new core.ArgumentError("Parameter name is required."); |
626 } | 638 } |
| 639 if (filter != null) { |
| 640 _queryParams["filter"] = [filter]; |
| 641 } |
627 if (pageToken != null) { | 642 if (pageToken != null) { |
628 _queryParams["pageToken"] = [pageToken]; | 643 _queryParams["pageToken"] = [pageToken]; |
629 } | 644 } |
630 if (pageSize != null) { | 645 if (pageSize != null) { |
631 _queryParams["pageSize"] = ["${pageSize}"]; | 646 _queryParams["pageSize"] = ["${pageSize}"]; |
632 } | 647 } |
633 | 648 |
634 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + '/rulesets'; | 649 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + '/rulesets'; |
635 | 650 |
636 var _response = _requester.request(_url, | 651 var _response = _requester.request(_url, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 if (fingerprint != null) { | 724 if (fingerprint != null) { |
710 _json["fingerprint"] = fingerprint; | 725 _json["fingerprint"] = fingerprint; |
711 } | 726 } |
712 if (name != null) { | 727 if (name != null) { |
713 _json["name"] = name; | 728 _json["name"] = name; |
714 } | 729 } |
715 return _json; | 730 return _json; |
716 } | 731 } |
717 } | 732 } |
718 | 733 |
| 734 /** |
| 735 * Represents a service-defined function call that was invoked during test |
| 736 * execution. |
| 737 */ |
| 738 class FunctionCall { |
| 739 /** |
| 740 * The arguments that were provided to the function. |
| 741 * |
| 742 * The values for Object must be JSON objects. It can consist of `num`, |
| 743 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 744 */ |
| 745 core.List<core.Object> args; |
| 746 /** Name of the function invoked. */ |
| 747 core.String function; |
| 748 |
| 749 FunctionCall(); |
| 750 |
| 751 FunctionCall.fromJson(core.Map _json) { |
| 752 if (_json.containsKey("args")) { |
| 753 args = _json["args"]; |
| 754 } |
| 755 if (_json.containsKey("function")) { |
| 756 function = _json["function"]; |
| 757 } |
| 758 } |
| 759 |
| 760 core.Map toJson() { |
| 761 var _json = new core.Map(); |
| 762 if (args != null) { |
| 763 _json["args"] = args; |
| 764 } |
| 765 if (function != null) { |
| 766 _json["function"] = function; |
| 767 } |
| 768 return _json; |
| 769 } |
| 770 } |
| 771 |
719 /** Issues include warnings, errors, and deprecation notices. */ | 772 /** Issues include warnings, errors, and deprecation notices. */ |
720 class Issue { | 773 class Issue { |
721 /** Short error description. */ | 774 /** Short error description. */ |
722 core.String description; | 775 core.String description; |
723 /** | 776 /** |
724 * The severity of the issue. | 777 * The severity of the issue. |
725 * Possible string values are: | 778 * Possible string values are: |
726 * - "SEVERITY_UNSPECIFIED" : An unspecified severity. | 779 * - "SEVERITY_UNSPECIFIED" : An unspecified severity. |
727 * - "DEPRECATION" : Deprecation issue for statements and method that may no | 780 * - "DEPRECATION" : Deprecation issue for statements and method that may no |
728 * longer be | 781 * longer be |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 if (nextPageToken != null) { | 843 if (nextPageToken != null) { |
791 _json["nextPageToken"] = nextPageToken; | 844 _json["nextPageToken"] = nextPageToken; |
792 } | 845 } |
793 if (releases != null) { | 846 if (releases != null) { |
794 _json["releases"] = releases.map((value) => (value).toJson()).toList(); | 847 _json["releases"] = releases.map((value) => (value).toJson()).toList(); |
795 } | 848 } |
796 return _json; | 849 return _json; |
797 } | 850 } |
798 } | 851 } |
799 | 852 |
800 /** The response for FirebaseRulesService.ListRulesets */ | 853 /** The response for FirebaseRulesService.ListRulesets. */ |
801 class ListRulesetsResponse { | 854 class ListRulesetsResponse { |
802 /** | 855 /** |
803 * The pagination token to retrieve the next page of results. If the value is | 856 * The pagination token to retrieve the next page of results. If the value is |
804 * empty, no further results remain. | 857 * empty, no further results remain. |
805 */ | 858 */ |
806 core.String nextPageToken; | 859 core.String nextPageToken; |
807 /** List of `Ruleset` instances. */ | 860 /** List of `Ruleset` instances. */ |
808 core.List<Ruleset> rulesets; | 861 core.List<Ruleset> rulesets; |
809 | 862 |
810 ListRulesetsResponse(); | 863 ListRulesetsResponse(); |
(...skipping 19 matching lines...) Expand all Loading... |
830 } | 883 } |
831 } | 884 } |
832 | 885 |
833 /** | 886 /** |
834 * `Release` is a named reference to a `Ruleset`. Once a `Release` refers to a | 887 * `Release` is a named reference to a `Ruleset`. Once a `Release` refers to a |
835 * `Ruleset`, rules-enabled services will be able to enforce the `Ruleset`. | 888 * `Ruleset`, rules-enabled services will be able to enforce the `Ruleset`. |
836 */ | 889 */ |
837 class Release { | 890 class Release { |
838 /** | 891 /** |
839 * Time the release was created. | 892 * Time the release was created. |
840 * @OutputOnly | 893 * Output only. |
841 */ | 894 */ |
842 core.String createTime; | 895 core.String createTime; |
843 /** | 896 /** |
844 * Resource name for the `Release`. | 897 * Resource name for the `Release`. |
845 * | 898 * |
846 * `Release` names may be structured `app1/prod/v2` or flat `app1_prod_v2` | 899 * `Release` names may be structured `app1/prod/v2` or flat `app1_prod_v2` |
847 * which affords developers a great deal of flexibility in mapping the name | 900 * which affords developers a great deal of flexibility in mapping the name |
848 * to the style that best fits their existing development practices. For | 901 * to the style that best fits their existing development practices. For |
849 * example, a name could refer to an environment, an app, a version, or some | 902 * example, a name could refer to an environment, an app, a version, or some |
850 * combination of three. | 903 * combination of three. |
(...skipping 16 matching lines...) Expand all Loading... |
867 * Format: `projects/{project_id}/releases/{release_id}` | 920 * Format: `projects/{project_id}/releases/{release_id}` |
868 */ | 921 */ |
869 core.String name; | 922 core.String name; |
870 /** | 923 /** |
871 * Name of the `Ruleset` referred to by this `Release`. The `Ruleset` must | 924 * Name of the `Ruleset` referred to by this `Release`. The `Ruleset` must |
872 * exist the `Release` to be created. | 925 * exist the `Release` to be created. |
873 */ | 926 */ |
874 core.String rulesetName; | 927 core.String rulesetName; |
875 /** | 928 /** |
876 * Time the release was updated. | 929 * Time the release was updated. |
877 * @OutputOnly | 930 * Output only. |
878 */ | 931 */ |
879 core.String updateTime; | 932 core.String updateTime; |
880 | 933 |
881 Release(); | 934 Release(); |
882 | 935 |
883 Release.fromJson(core.Map _json) { | 936 Release.fromJson(core.Map _json) { |
884 if (_json.containsKey("createTime")) { | 937 if (_json.containsKey("createTime")) { |
885 createTime = _json["createTime"]; | 938 createTime = _json["createTime"]; |
886 } | 939 } |
887 if (_json.containsKey("name")) { | 940 if (_json.containsKey("name")) { |
(...skipping 25 matching lines...) Expand all Loading... |
913 } | 966 } |
914 } | 967 } |
915 | 968 |
916 /** | 969 /** |
917 * `Ruleset` is an immutable copy of `Source` with a globally unique identifier | 970 * `Ruleset` is an immutable copy of `Source` with a globally unique identifier |
918 * and a creation time. | 971 * and a creation time. |
919 */ | 972 */ |
920 class Ruleset { | 973 class Ruleset { |
921 /** | 974 /** |
922 * Time the `Ruleset` was created. | 975 * Time the `Ruleset` was created. |
923 * @OutputOnly | 976 * Output only. |
924 */ | 977 */ |
925 core.String createTime; | 978 core.String createTime; |
926 /** | 979 /** |
927 * Name of the `Ruleset`. The ruleset_id is auto generated by the service. | 980 * Name of the `Ruleset`. The ruleset_id is auto generated by the service. |
928 * Format: `projects/{project_id}/rulesets/{ruleset_id}` | 981 * Format: `projects/{project_id}/rulesets/{ruleset_id}` |
929 * @OutputOnly | 982 * Output only. |
930 */ | 983 */ |
931 core.String name; | 984 core.String name; |
932 /** `Source` for the `Ruleset`. */ | 985 /** `Source` for the `Ruleset`. */ |
933 Source source; | 986 Source source; |
934 | 987 |
935 Ruleset(); | 988 Ruleset(); |
936 | 989 |
937 Ruleset.fromJson(core.Map _json) { | 990 Ruleset.fromJson(core.Map _json) { |
938 if (_json.containsKey("createTime")) { | 991 if (_json.containsKey("createTime")) { |
939 createTime = _json["createTime"]; | 992 createTime = _json["createTime"]; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 if (fileName != null) { | 1072 if (fileName != null) { |
1020 _json["fileName"] = fileName; | 1073 _json["fileName"] = fileName; |
1021 } | 1074 } |
1022 if (line != null) { | 1075 if (line != null) { |
1023 _json["line"] = line; | 1076 _json["line"] = line; |
1024 } | 1077 } |
1025 return _json; | 1078 return _json; |
1026 } | 1079 } |
1027 } | 1080 } |
1028 | 1081 |
| 1082 /** |
| 1083 * Test result message containing the state of the test as well as a |
| 1084 * description and source position for test failures. |
| 1085 */ |
| 1086 class TestResult { |
| 1087 /** |
| 1088 * Debug messages related to test execution issues encountered during |
| 1089 * evaluation. |
| 1090 * |
| 1091 * Debug messages may be related to too many or too few invocations of |
| 1092 * function mocks or to runtime errors that occur during evaluation. |
| 1093 * |
| 1094 * For example: ```Unable to read variable [name: "resource"]``` |
| 1095 */ |
| 1096 core.List<core.String> debugMessages; |
| 1097 /** |
| 1098 * Position in the `Source` or `Ruleset` where the principle runtime error |
| 1099 * occurs. |
| 1100 * |
| 1101 * Evaluation of an expression may result in an error. Rules are deny by |
| 1102 * default, so a `DENY` expectation when an error is generated is valid. |
| 1103 * When there is a `DENY` with an error, the `SourcePosition` is returned. |
| 1104 * |
| 1105 * E.g. `error_position { line: 19 column: 37 }` |
| 1106 */ |
| 1107 SourcePosition errorPosition; |
| 1108 /** |
| 1109 * The set of function calls made to service-defined methods. |
| 1110 * |
| 1111 * Function calls are included in the order in which they are encountered |
| 1112 * during evaluation, are provided for both mocked and unmocked functions, |
| 1113 * and included on the response regardless of the test `state`. |
| 1114 */ |
| 1115 core.List<FunctionCall> functionCalls; |
| 1116 /** |
| 1117 * State of the test. |
| 1118 * Possible string values are: |
| 1119 * - "STATE_UNSPECIFIED" : Test state is not set. |
| 1120 * - "SUCCESS" : Test is a success. |
| 1121 * - "FAILURE" : Test is a failure. |
| 1122 */ |
| 1123 core.String state; |
| 1124 |
| 1125 TestResult(); |
| 1126 |
| 1127 TestResult.fromJson(core.Map _json) { |
| 1128 if (_json.containsKey("debugMessages")) { |
| 1129 debugMessages = _json["debugMessages"]; |
| 1130 } |
| 1131 if (_json.containsKey("errorPosition")) { |
| 1132 errorPosition = new SourcePosition.fromJson(_json["errorPosition"]); |
| 1133 } |
| 1134 if (_json.containsKey("functionCalls")) { |
| 1135 functionCalls = _json["functionCalls"].map((value) => new FunctionCall.fro
mJson(value)).toList(); |
| 1136 } |
| 1137 if (_json.containsKey("state")) { |
| 1138 state = _json["state"]; |
| 1139 } |
| 1140 } |
| 1141 |
| 1142 core.Map toJson() { |
| 1143 var _json = new core.Map(); |
| 1144 if (debugMessages != null) { |
| 1145 _json["debugMessages"] = debugMessages; |
| 1146 } |
| 1147 if (errorPosition != null) { |
| 1148 _json["errorPosition"] = (errorPosition).toJson(); |
| 1149 } |
| 1150 if (functionCalls != null) { |
| 1151 _json["functionCalls"] = functionCalls.map((value) => (value).toJson()).to
List(); |
| 1152 } |
| 1153 if (state != null) { |
| 1154 _json["state"] = state; |
| 1155 } |
| 1156 return _json; |
| 1157 } |
| 1158 } |
| 1159 |
1029 /** The request for FirebaseRulesService.TestRuleset. */ | 1160 /** The request for FirebaseRulesService.TestRuleset. */ |
1030 class TestRulesetRequest { | 1161 class TestRulesetRequest { |
1031 /** `Source` to be checked for correctness. */ | 1162 /** |
| 1163 * Optional `Source` to be checked for correctness. |
| 1164 * |
| 1165 * This field must not be set when the resource name refers to a `Ruleset`. |
| 1166 */ |
1032 Source source; | 1167 Source source; |
1033 | 1168 |
1034 TestRulesetRequest(); | 1169 TestRulesetRequest(); |
1035 | 1170 |
1036 TestRulesetRequest.fromJson(core.Map _json) { | 1171 TestRulesetRequest.fromJson(core.Map _json) { |
1037 if (_json.containsKey("source")) { | 1172 if (_json.containsKey("source")) { |
1038 source = new Source.fromJson(_json["source"]); | 1173 source = new Source.fromJson(_json["source"]); |
1039 } | 1174 } |
1040 } | 1175 } |
1041 | 1176 |
1042 core.Map toJson() { | 1177 core.Map toJson() { |
1043 var _json = new core.Map(); | 1178 var _json = new core.Map(); |
1044 if (source != null) { | 1179 if (source != null) { |
1045 _json["source"] = (source).toJson(); | 1180 _json["source"] = (source).toJson(); |
1046 } | 1181 } |
1047 return _json; | 1182 return _json; |
1048 } | 1183 } |
1049 } | 1184 } |
1050 | 1185 |
1051 /** The response for FirebaseRulesService.TestRuleset. */ | 1186 /** The response for FirebaseRulesService.TestRuleset. */ |
1052 class TestRulesetResponse { | 1187 class TestRulesetResponse { |
1053 /** | 1188 /** |
1054 * Syntactic and semantic `Source` issues of varying severity. Issues of | 1189 * Syntactic and semantic `Source` issues of varying severity. Issues of |
1055 * `ERROR` severity will prevent tests from executing. | 1190 * `ERROR` severity will prevent tests from executing. |
1056 */ | 1191 */ |
1057 core.List<Issue> issues; | 1192 core.List<Issue> issues; |
| 1193 /** |
| 1194 * 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 |
| 1196 * `TestSuite`. |
| 1197 */ |
| 1198 core.List<TestResult> testResults; |
1058 | 1199 |
1059 TestRulesetResponse(); | 1200 TestRulesetResponse(); |
1060 | 1201 |
1061 TestRulesetResponse.fromJson(core.Map _json) { | 1202 TestRulesetResponse.fromJson(core.Map _json) { |
1062 if (_json.containsKey("issues")) { | 1203 if (_json.containsKey("issues")) { |
1063 issues = _json["issues"].map((value) => new Issue.fromJson(value)).toList(
); | 1204 issues = _json["issues"].map((value) => new Issue.fromJson(value)).toList(
); |
1064 } | 1205 } |
| 1206 if (_json.containsKey("testResults")) { |
| 1207 testResults = _json["testResults"].map((value) => new TestResult.fromJson(
value)).toList(); |
| 1208 } |
1065 } | 1209 } |
1066 | 1210 |
1067 core.Map toJson() { | 1211 core.Map toJson() { |
1068 var _json = new core.Map(); | 1212 var _json = new core.Map(); |
1069 if (issues != null) { | 1213 if (issues != null) { |
1070 _json["issues"] = issues.map((value) => (value).toJson()).toList(); | 1214 _json["issues"] = issues.map((value) => (value).toJson()).toList(); |
1071 } | 1215 } |
| 1216 if (testResults != null) { |
| 1217 _json["testResults"] = testResults.map((value) => (value).toJson()).toList
(); |
| 1218 } |
1072 return _json; | 1219 return _json; |
1073 } | 1220 } |
1074 } | 1221 } |
OLD | NEW |