Class ProjectsResource.TestRequest
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 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: Example // Users are
allowed to subscribe and unsubscribe to the blog. service firebase.storage { match
/users/{userId}/images/{imageName} { allow write: if userId == request.auth.uid &&
(imageName.matches('.png$') || imageName.matches('.jpg$')) &&
resource.mimeType.matches('^image/') } }
Inheritance
Inherited Members
Namespace: Google.Apis.FirebaseRules.v1
Assembly: Google.Apis.FirebaseRules.v1.dll
Syntax
public class ProjectsResource.TestRequest : FirebaseRulesBaseServiceRequest<TestRulesetResponse>, IClientServiceRequest<TestRulesetResponse>, IClientServiceRequest
Constructors
TestRequest(IClientService, TestRulesetRequest, string)
Constructs a new Test request.
Declaration
public TestRequest(IClientService service, TestRulesetRequest body, string name)
Parameters
Type | Name | Description |
---|---|---|
IClientService | service | |
TestRulesetRequest | body | |
string | name |
Properties
HttpMethod
Gets the HTTP method.
Declaration
public override string HttpMethod { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
MethodName
Gets the method name.
Declaration
public override string MethodName { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Name
Required. 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}
Declaration
[RequestParameter("name", RequestParameterType.Path)]
public virtual string Name { get; }
Property Value
Type | Description |
---|---|
string |
RestPath
Gets the REST path.
Declaration
public override string RestPath { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
GetBody()
Returns the body of the request.
Declaration
protected override object GetBody()
Returns
Type | Description |
---|---|
object |
Overrides
InitParameters()
Initializes Test parameter list.
Declaration
protected override void InitParameters()