blob: afd044c8252d9948407b3d42b94a871ffa54890b [file] [log] [blame]
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="firebaserules_v1.html">Firebase Rules API</a> . <a href="firebaserules_v1.projects.html">projects</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="firebaserules_v1.projects.releases.html">releases()</a></code>
79</p>
80<p class="firstline">Returns the releases Resource.</p>
81
82<p class="toc_element">
83 <code><a href="firebaserules_v1.projects.rulesets.html">rulesets()</a></code>
84</p>
85<p class="firstline">Returns the rulesets Resource.</p>
86
87<p class="toc_element">
88 <code><a href="#test">test(name=None, body, x__xgafv=None)</a></code></p>
89<p class="firstline">Test `Source` for syntactic and semantic correctness. Issues present in the</p>
90<h3>Method Details</h3>
91<div class="method">
92 <code class="details" id="test">test(name=None, body, x__xgafv=None)</code>
93 <pre>Test `Source` for syntactic and semantic correctness. Issues present in the
94rules, if any, will be returned to the caller with a description, severity,
95and source location.
96
97The test method will typically be executed with a developer provided
98`Source`, but if regression testing is desired, this method may be
99executed against a `Ruleset` resource name and the `Source` will be
100retrieved from the persisted `Ruleset`.
101
102The following is an example of `Source` that permits users to upload images
103to a bucket bearing their user id and matching the correct metadata:
104
105_*Example*_
106
107 // Users are allowed to subscribe and unsubscribe to the blog.
108 service firebase.storage {
109 match /users/{userId}/images/{imageName} {
110 allow write: if userId == request.userId
111 && (imageName.endsWith('.png') || imageName.endsWith('.jpg'))
112 && resource.mimeType.startsWith('image/')
113 }
114 }
115
116Args:
117 name: string, Name of the project.
118
119Format: `projects/{project_id}` (required)
120 body: object, The request body. (required)
121 The object takes the form of:
122
123{ # The request for FirebaseRulesService.TestRuleset.
124 "source": { # `Source` is one or more `File` messages comprising a logical set of rules. # `Source` to be checked for correctness.
125 "files": [ # `File` set constituting the `Source` bundle.
126 { # `File` containing source content.
127 "content": "A String", # Textual Content.
128 "name": "A String", # File name.
129 "fingerprint": "A String", # Fingerprint (e.g. github sha) associated with the `File`.
130 },
131 ],
132 },
133 }
134
135 x__xgafv: string, V1 error format.
136 Allowed values
137 1 - v1 error format
138 2 - v2 error format
139
140Returns:
141 An object of the form:
142
143 { # The response for FirebaseRulesService.TestRuleset.
144 "issues": [ # Syntactic and semantic `Source` issues of varying severity. Issues of
145 # `ERROR` severity will prevent tests from executing.
146 { # Issues include warnings, errors, and deprecation notices.
147 "sourcePosition": { # Position in the `Source` content including its line, column number, and an # Position of the issue in the `Source`.
148 # index of the `File` in the `Source` message. Used for debug purposes.
149 "column": 42, # First column on the source line associated with the source fragment.
150 "line": 42, # Line number of the source fragment. 1-based.
151 "fileName": "A String", # Name of the `File`.
152 },
153 "description": "A String", # Short error description.
154 "severity": "A String", # The severity of the issue.
155 },
156 ],
157 }</pre>
158</div>
159
160</body></html>