| Index: generated/googleapis/lib/firebaserules/v1.dart
|
| diff --git a/generated/googleapis/lib/firebaserules/v1.dart b/generated/googleapis/lib/firebaserules/v1.dart
|
| index b2587a049b2eaa96c0376cb2c9363821d2877649..49952371d384a26c976f8d9d9fa2458ba574c4a3 100644
|
| --- a/generated/googleapis/lib/firebaserules/v1.dart
|
| +++ b/generated/googleapis/lib/firebaserules/v1.dart
|
| @@ -48,14 +48,13 @@ class ProjectsResourceApi {
|
| _requester = client;
|
|
|
| /**
|
| - * Test `Source` for syntactic and semantic correctness. Issues present in the
|
| - * rules, if any, will be returned to the caller with a description, severity,
|
| - * and source location.
|
| + * Test `Source` for syntactic and semantic correctness. Issues present, if
|
| + * any, will be returned to the caller with a description, severity, and
|
| + * source location.
|
| *
|
| - * The test method will typically be executed with a developer provided
|
| - * `Source`, but if regression testing is desired, this method may be
|
| - * executed against a `Ruleset` resource name and the `Source` will be
|
| - * retrieved from the persisted `Ruleset`.
|
| + * The test method may be executed with `Source` or a `Ruleset` name.
|
| + * Passing `Source` is useful for unit testing new rules. Passing a `Ruleset`
|
| + * name is useful for regression testing an existing rule.
|
| *
|
| * The following is an example of `Source` that permits users to upload images
|
| * to a bucket bearing their user id and matching the correct metadata:
|
| @@ -65,9 +64,10 @@ class ProjectsResourceApi {
|
| * // Users are allowed to subscribe and unsubscribe to the blog.
|
| * service firebase.storage {
|
| * match /users/{userId}/images/{imageName} {
|
| - * allow write: if userId == request.userId
|
| - * && (imageName.endsWith('.png') || imageName.endsWith('.jpg'))
|
| - * && resource.mimeType.startsWith('image/')
|
| + * allow write: if userId == request.auth.uid
|
| + * && (imageName.matches('*.png$')
|
| + * || imageName.matches('*.jpg$'))
|
| + * && resource.mimeType.matches('^image/')
|
| * }
|
| * }
|
| *
|
| @@ -75,9 +75,13 @@ class ProjectsResourceApi {
|
| *
|
| * Request parameters:
|
| *
|
| - * [name] - Name of the project.
|
| + * [name] - Tests may either provide `source` or a `Ruleset` resource name.
|
| *
|
| + * For tests against `source`, the resource name must refer to the project:
|
| * Format: `projects/{project_id}`
|
| + *
|
| + * For tests against a `Ruleset`, this must be the `Ruleset` resource name:
|
| + * Format: `projects/{project_id}/rulesets/{ruleset_id}`
|
| * Value must have pattern "^projects/.+$".
|
| *
|
| * Completes with a [TestRulesetResponse].
|
| @@ -146,8 +150,7 @@ class ProjectsReleasesResourceApi {
|
| * The table reflects the `Ruleset` rollout in progress. The `prod` and
|
| * `prod/beta` releases refer to the same `Ruleset`. However, `prod/v23`
|
| * refers to a new `Ruleset`. The `Ruleset` reference for a `Release` may be
|
| - * updated using the UpdateRelease method, and the custom `Release` name
|
| - * may be referenced by specifying the `X-Firebase-Rules-Release-Name` header.
|
| + * updated using the UpdateRelease method.
|
| *
|
| * [request] - The metadata request object.
|
| *
|
| @@ -242,7 +245,6 @@ class ProjectsReleasesResourceApi {
|
| *
|
| * [name] - Resource name of the `Release`.
|
| *
|
| - *
|
| * Format: `projects/{project_id}/releases/{release_id}`
|
| * Value must have pattern "^projects/[^/]+/releases/.+$".
|
| *
|
| @@ -280,7 +282,8 @@ class ProjectsReleasesResourceApi {
|
|
|
| /**
|
| * List the `Release` values for a project. This list may optionally be
|
| - * filtered by `Release` name or `Ruleset` id or both.
|
| + * filtered by `Release` name, `Ruleset` name, `TestSuite` name, or any
|
| + * combination thereof.
|
| *
|
| * Request parameters:
|
| *
|
| @@ -291,9 +294,9 @@ class ProjectsReleasesResourceApi {
|
| *
|
| * [filter] - `Release` filter. The list method supports filters with
|
| * restrictions on the
|
| - * `Release` `name` and also on the `Ruleset` `ruleset_name`.
|
| + * `Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`.
|
| *
|
| - * Example 1) A filter of 'name=prod*' might return `Release`s with names
|
| + * Example 1: A filter of 'name=prod*' might return `Release`s with names
|
| * within 'projects/foo' prefixed with 'prod':
|
| *
|
| * Name | Ruleset Name
|
| @@ -302,7 +305,7 @@ class ProjectsReleasesResourceApi {
|
| * projects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234
|
| * projects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888
|
| *
|
| - * Example 2) A filter of `name=prod* ruleset_name=uuid1234` would return only
|
| + * Example 2: A filter of `name=prod* ruleset_name=uuid1234` would return only
|
| * `Release` instances for 'projects/foo' with names prefixed with 'prod'
|
| * referring to the same `Ruleset` name of 'uuid1234':
|
| *
|
| @@ -311,17 +314,17 @@ class ProjectsReleasesResourceApi {
|
| * projects/foo/releases/prod | projects/foo/rulesets/1234
|
| * projects/foo/releases/prod/v1 | projects/foo/rulesets/1234
|
| *
|
| - * In the examples, the filter parameters refer to the search filters for
|
| - * release and ruleset names are relative to the project releases and rulesets
|
| - * collections. Fully qualified prefixed may also be used. e.g.
|
| - * `name=projects/foo/releases/prod* ruleset_name=projects/foo/rulesets/uuid1`
|
| + * In the examples, the filter parameters refer to the search filters are
|
| + * relative to the project. Fully qualified prefixed may also be used. e.g.
|
| + * `test_suite_name=projects/foo/testsuites/uuid1`
|
| *
|
| * [pageToken] - Next page token for the next batch of `Release` instances.
|
| *
|
| * [pageSize] - Page size to load. Maximum of 100. Defaults to 10.
|
| - * Note: `page_size` is just a hint and the service may choose to load less
|
| - * than `page_size` due to the size of the output. To traverse all of the
|
| - * releases, caller should iterate until the `page_token` is empty.
|
| + * Note: `page_size` is just a hint and the service may choose to load fewer
|
| + * than `page_size` results due to the size of the output. To traverse all of
|
| + * the releases, the caller should iterate until the `page_token` on the
|
| + * response is empty.
|
| *
|
| * Completes with a [ListReleasesResponse].
|
| *
|
| @@ -367,9 +370,9 @@ class ProjectsReleasesResourceApi {
|
| /**
|
| * Update a `Release`.
|
| *
|
| - * Only updates to the `ruleset_name` field will be honored. `Release` rename
|
| - * is not supported. To create a `Release` use the CreateRelease method
|
| - * instead.
|
| + * Only updates to the `ruleset_name` and `test_suite_name` fields will be
|
| + * honored. `Release` rename is not supported. To create a `Release` use the
|
| + * CreateRelease method.
|
| *
|
| * [request] - The metadata request object.
|
| *
|
| @@ -584,7 +587,7 @@ class ProjectsRulesetsResourceApi {
|
| }
|
|
|
| /**
|
| - * List `Ruleset` metadata only and optionally filter the results by Ruleset
|
| + * List `Ruleset` metadata only and optionally filter the results by `Ruleset`
|
| * name.
|
| *
|
| * The full `Source` contents of a `Ruleset` may be retrieved with
|
| @@ -597,6 +600,15 @@ class ProjectsRulesetsResourceApi {
|
| * Format: `projects/{project_id}`
|
| * Value must have pattern "^projects/[^/]+$".
|
| *
|
| + * [filter] - `Ruleset` filter. The list method supports filters with
|
| + * restrictions on
|
| + * `Ruleset.name`.
|
| + *
|
| + * Filters on `Ruleset.create_time` should use the `date` function which
|
| + * parses strings that conform to the RFC 3339 date/time specifications.
|
| + *
|
| + * Example: `create_time > date("2017-01-01") AND name=UUID-*`
|
| + *
|
| * [pageToken] - Next page token for loading the next batch of `Ruleset`
|
| * instances.
|
| *
|
| @@ -613,7 +625,7 @@ class ProjectsRulesetsResourceApi {
|
| * If the used [http.Client] completes with an error when making a REST call,
|
| * this method will complete with the same error.
|
| */
|
| - async.Future<ListRulesetsResponse> list(core.String name, {core.String pageToken, core.int pageSize}) {
|
| + async.Future<ListRulesetsResponse> list(core.String name, {core.String filter, core.String pageToken, core.int pageSize}) {
|
| var _url = null;
|
| var _queryParams = new core.Map();
|
| var _uploadMedia = null;
|
| @@ -624,6 +636,9 @@ class ProjectsRulesetsResourceApi {
|
| if (name == null) {
|
| throw new core.ArgumentError("Parameter name is required.");
|
| }
|
| + if (filter != null) {
|
| + _queryParams["filter"] = [filter];
|
| + }
|
| if (pageToken != null) {
|
| _queryParams["pageToken"] = [pageToken];
|
| }
|
| @@ -716,6 +731,44 @@ class File {
|
| }
|
| }
|
|
|
| +/**
|
| + * Represents a service-defined function call that was invoked during test
|
| + * execution.
|
| + */
|
| +class FunctionCall {
|
| + /**
|
| + * The arguments that were provided to the function.
|
| + *
|
| + * The values for Object must be JSON objects. It can consist of `num`,
|
| + * `String`, `bool` and `null` as well as `Map` and `List` values.
|
| + */
|
| + core.List<core.Object> args;
|
| + /** Name of the function invoked. */
|
| + core.String function;
|
| +
|
| + FunctionCall();
|
| +
|
| + FunctionCall.fromJson(core.Map _json) {
|
| + if (_json.containsKey("args")) {
|
| + args = _json["args"];
|
| + }
|
| + if (_json.containsKey("function")) {
|
| + function = _json["function"];
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (args != null) {
|
| + _json["args"] = args;
|
| + }
|
| + if (function != null) {
|
| + _json["function"] = function;
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| /** Issues include warnings, errors, and deprecation notices. */
|
| class Issue {
|
| /** Short error description. */
|
| @@ -797,7 +850,7 @@ class ListReleasesResponse {
|
| }
|
| }
|
|
|
| -/** The response for FirebaseRulesService.ListRulesets */
|
| +/** The response for FirebaseRulesService.ListRulesets. */
|
| class ListRulesetsResponse {
|
| /**
|
| * The pagination token to retrieve the next page of results. If the value is
|
| @@ -837,7 +890,7 @@ class ListRulesetsResponse {
|
| class Release {
|
| /**
|
| * Time the release was created.
|
| - * @OutputOnly
|
| + * Output only.
|
| */
|
| core.String createTime;
|
| /**
|
| @@ -874,7 +927,7 @@ class Release {
|
| core.String rulesetName;
|
| /**
|
| * Time the release was updated.
|
| - * @OutputOnly
|
| + * Output only.
|
| */
|
| core.String updateTime;
|
|
|
| @@ -920,13 +973,13 @@ class Release {
|
| class Ruleset {
|
| /**
|
| * Time the `Ruleset` was created.
|
| - * @OutputOnly
|
| + * Output only.
|
| */
|
| core.String createTime;
|
| /**
|
| * Name of the `Ruleset`. The ruleset_id is auto generated by the service.
|
| * Format: `projects/{project_id}/rulesets/{ruleset_id}`
|
| - * @OutputOnly
|
| + * Output only.
|
| */
|
| core.String name;
|
| /** `Source` for the `Ruleset`. */
|
| @@ -1026,9 +1079,91 @@ class SourcePosition {
|
| }
|
| }
|
|
|
| +/**
|
| + * Test result message containing the state of the test as well as a
|
| + * description and source position for test failures.
|
| + */
|
| +class TestResult {
|
| + /**
|
| + * Debug messages related to test execution issues encountered during
|
| + * evaluation.
|
| + *
|
| + * Debug messages may be related to too many or too few invocations of
|
| + * function mocks or to runtime errors that occur during evaluation.
|
| + *
|
| + * For example: ```Unable to read variable [name: "resource"]```
|
| + */
|
| + core.List<core.String> debugMessages;
|
| + /**
|
| + * Position in the `Source` or `Ruleset` where the principle runtime error
|
| + * occurs.
|
| + *
|
| + * Evaluation of an expression may result in an error. Rules are deny by
|
| + * default, so a `DENY` expectation when an error is generated is valid.
|
| + * When there is a `DENY` with an error, the `SourcePosition` is returned.
|
| + *
|
| + * E.g. `error_position { line: 19 column: 37 }`
|
| + */
|
| + SourcePosition errorPosition;
|
| + /**
|
| + * The set of function calls made to service-defined methods.
|
| + *
|
| + * Function calls are included in the order in which they are encountered
|
| + * during evaluation, are provided for both mocked and unmocked functions,
|
| + * and included on the response regardless of the test `state`.
|
| + */
|
| + core.List<FunctionCall> functionCalls;
|
| + /**
|
| + * State of the test.
|
| + * Possible string values are:
|
| + * - "STATE_UNSPECIFIED" : Test state is not set.
|
| + * - "SUCCESS" : Test is a success.
|
| + * - "FAILURE" : Test is a failure.
|
| + */
|
| + core.String state;
|
| +
|
| + TestResult();
|
| +
|
| + TestResult.fromJson(core.Map _json) {
|
| + if (_json.containsKey("debugMessages")) {
|
| + debugMessages = _json["debugMessages"];
|
| + }
|
| + if (_json.containsKey("errorPosition")) {
|
| + errorPosition = new SourcePosition.fromJson(_json["errorPosition"]);
|
| + }
|
| + if (_json.containsKey("functionCalls")) {
|
| + functionCalls = _json["functionCalls"].map((value) => new FunctionCall.fromJson(value)).toList();
|
| + }
|
| + if (_json.containsKey("state")) {
|
| + state = _json["state"];
|
| + }
|
| + }
|
| +
|
| + core.Map toJson() {
|
| + var _json = new core.Map();
|
| + if (debugMessages != null) {
|
| + _json["debugMessages"] = debugMessages;
|
| + }
|
| + if (errorPosition != null) {
|
| + _json["errorPosition"] = (errorPosition).toJson();
|
| + }
|
| + if (functionCalls != null) {
|
| + _json["functionCalls"] = functionCalls.map((value) => (value).toJson()).toList();
|
| + }
|
| + if (state != null) {
|
| + _json["state"] = state;
|
| + }
|
| + return _json;
|
| + }
|
| +}
|
| +
|
| /** The request for FirebaseRulesService.TestRuleset. */
|
| class TestRulesetRequest {
|
| - /** `Source` to be checked for correctness. */
|
| + /**
|
| + * Optional `Source` to be checked for correctness.
|
| + *
|
| + * This field must not be set when the resource name refers to a `Ruleset`.
|
| + */
|
| Source source;
|
|
|
| TestRulesetRequest();
|
| @@ -1055,6 +1190,12 @@ class TestRulesetResponse {
|
| * `ERROR` severity will prevent tests from executing.
|
| */
|
| core.List<Issue> issues;
|
| + /**
|
| + * The set of test results given the test cases in the `TestSuite`.
|
| + * The results will appear in the same order as the test cases appear in the
|
| + * `TestSuite`.
|
| + */
|
| + core.List<TestResult> testResults;
|
|
|
| TestRulesetResponse();
|
|
|
| @@ -1062,6 +1203,9 @@ class TestRulesetResponse {
|
| if (_json.containsKey("issues")) {
|
| issues = _json["issues"].map((value) => new Issue.fromJson(value)).toList();
|
| }
|
| + if (_json.containsKey("testResults")) {
|
| + testResults = _json["testResults"].map((value) => new TestResult.fromJson(value)).toList();
|
| + }
|
| }
|
|
|
| core.Map toJson() {
|
| @@ -1069,6 +1213,9 @@ class TestRulesetResponse {
|
| if (issues != null) {
|
| _json["issues"] = issues.map((value) => (value).toJson()).toList();
|
| }
|
| + if (testResults != null) {
|
| + _json["testResults"] = testResults.map((value) => (value).toJson()).toList();
|
| + }
|
| return _json;
|
| }
|
| }
|
|
|