google-apis-firebaserules_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module FirebaserulesV1
18
+ # Version of the google-apis-firebaserules_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20200807"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,405 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module FirebaserulesV1
24
+
25
+ class Arg
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class Empty
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class ExpressionReport
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class File
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class FunctionCall
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class FunctionMock
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class GetReleaseExecutableResponse
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class Issue
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class ListReleasesResponse
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class ListRulesetsResponse
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class Metadata
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class Release
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class Result
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class Ruleset
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class Source
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class SourcePosition
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class TestCase
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class TestResult
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class TestRulesetRequest
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class TestRulesetResponse
140
+ class Representation < Google::Apis::Core::JsonRepresentation; end
141
+
142
+ include Google::Apis::Core::JsonObjectSupport
143
+ end
144
+
145
+ class TestSuite
146
+ class Representation < Google::Apis::Core::JsonRepresentation; end
147
+
148
+ include Google::Apis::Core::JsonObjectSupport
149
+ end
150
+
151
+ class UpdateReleaseRequest
152
+ class Representation < Google::Apis::Core::JsonRepresentation; end
153
+
154
+ include Google::Apis::Core::JsonObjectSupport
155
+ end
156
+
157
+ class ValueCount
158
+ class Representation < Google::Apis::Core::JsonRepresentation; end
159
+
160
+ include Google::Apis::Core::JsonObjectSupport
161
+ end
162
+
163
+ class VisitedExpression
164
+ class Representation < Google::Apis::Core::JsonRepresentation; end
165
+
166
+ include Google::Apis::Core::JsonObjectSupport
167
+ end
168
+
169
+ class Arg
170
+ # @private
171
+ class Representation < Google::Apis::Core::JsonRepresentation
172
+ property :any_value, as: 'anyValue', class: Google::Apis::FirebaserulesV1::Empty, decorator: Google::Apis::FirebaserulesV1::Empty::Representation
173
+
174
+ property :exact_value, as: 'exactValue'
175
+ end
176
+ end
177
+
178
+ class Empty
179
+ # @private
180
+ class Representation < Google::Apis::Core::JsonRepresentation
181
+ end
182
+ end
183
+
184
+ class ExpressionReport
185
+ # @private
186
+ class Representation < Google::Apis::Core::JsonRepresentation
187
+ collection :children, as: 'children', class: Google::Apis::FirebaserulesV1::ExpressionReport, decorator: Google::Apis::FirebaserulesV1::ExpressionReport::Representation
188
+
189
+ property :source_position, as: 'sourcePosition', class: Google::Apis::FirebaserulesV1::SourcePosition, decorator: Google::Apis::FirebaserulesV1::SourcePosition::Representation
190
+
191
+ collection :values, as: 'values', class: Google::Apis::FirebaserulesV1::ValueCount, decorator: Google::Apis::FirebaserulesV1::ValueCount::Representation
192
+
193
+ end
194
+ end
195
+
196
+ class File
197
+ # @private
198
+ class Representation < Google::Apis::Core::JsonRepresentation
199
+ property :content, as: 'content'
200
+ property :fingerprint, :base64 => true, as: 'fingerprint'
201
+ property :name, as: 'name'
202
+ end
203
+ end
204
+
205
+ class FunctionCall
206
+ # @private
207
+ class Representation < Google::Apis::Core::JsonRepresentation
208
+ collection :args, as: 'args'
209
+ property :function, as: 'function'
210
+ end
211
+ end
212
+
213
+ class FunctionMock
214
+ # @private
215
+ class Representation < Google::Apis::Core::JsonRepresentation
216
+ collection :args, as: 'args', class: Google::Apis::FirebaserulesV1::Arg, decorator: Google::Apis::FirebaserulesV1::Arg::Representation
217
+
218
+ property :function, as: 'function'
219
+ property :result, as: 'result', class: Google::Apis::FirebaserulesV1::Result, decorator: Google::Apis::FirebaserulesV1::Result::Representation
220
+
221
+ end
222
+ end
223
+
224
+ class GetReleaseExecutableResponse
225
+ # @private
226
+ class Representation < Google::Apis::Core::JsonRepresentation
227
+ property :executable, :base64 => true, as: 'executable'
228
+ property :executable_version, as: 'executableVersion'
229
+ property :language, as: 'language'
230
+ property :ruleset_name, as: 'rulesetName'
231
+ property :sync_time, as: 'syncTime'
232
+ property :update_time, as: 'updateTime'
233
+ end
234
+ end
235
+
236
+ class Issue
237
+ # @private
238
+ class Representation < Google::Apis::Core::JsonRepresentation
239
+ property :description, as: 'description'
240
+ property :severity, as: 'severity'
241
+ property :source_position, as: 'sourcePosition', class: Google::Apis::FirebaserulesV1::SourcePosition, decorator: Google::Apis::FirebaserulesV1::SourcePosition::Representation
242
+
243
+ end
244
+ end
245
+
246
+ class ListReleasesResponse
247
+ # @private
248
+ class Representation < Google::Apis::Core::JsonRepresentation
249
+ property :next_page_token, as: 'nextPageToken'
250
+ collection :releases, as: 'releases', class: Google::Apis::FirebaserulesV1::Release, decorator: Google::Apis::FirebaserulesV1::Release::Representation
251
+
252
+ end
253
+ end
254
+
255
+ class ListRulesetsResponse
256
+ # @private
257
+ class Representation < Google::Apis::Core::JsonRepresentation
258
+ property :next_page_token, as: 'nextPageToken'
259
+ collection :rulesets, as: 'rulesets', class: Google::Apis::FirebaserulesV1::Ruleset, decorator: Google::Apis::FirebaserulesV1::Ruleset::Representation
260
+
261
+ end
262
+ end
263
+
264
+ class Metadata
265
+ # @private
266
+ class Representation < Google::Apis::Core::JsonRepresentation
267
+ collection :services, as: 'services'
268
+ end
269
+ end
270
+
271
+ class Release
272
+ # @private
273
+ class Representation < Google::Apis::Core::JsonRepresentation
274
+ property :create_time, as: 'createTime'
275
+ property :name, as: 'name'
276
+ property :ruleset_name, as: 'rulesetName'
277
+ property :update_time, as: 'updateTime'
278
+ end
279
+ end
280
+
281
+ class Result
282
+ # @private
283
+ class Representation < Google::Apis::Core::JsonRepresentation
284
+ property :undefined, as: 'undefined', class: Google::Apis::FirebaserulesV1::Empty, decorator: Google::Apis::FirebaserulesV1::Empty::Representation
285
+
286
+ property :value, as: 'value'
287
+ end
288
+ end
289
+
290
+ class Ruleset
291
+ # @private
292
+ class Representation < Google::Apis::Core::JsonRepresentation
293
+ property :create_time, as: 'createTime'
294
+ property :metadata, as: 'metadata', class: Google::Apis::FirebaserulesV1::Metadata, decorator: Google::Apis::FirebaserulesV1::Metadata::Representation
295
+
296
+ property :name, as: 'name'
297
+ property :source, as: 'source', class: Google::Apis::FirebaserulesV1::Source, decorator: Google::Apis::FirebaserulesV1::Source::Representation
298
+
299
+ end
300
+ end
301
+
302
+ class Source
303
+ # @private
304
+ class Representation < Google::Apis::Core::JsonRepresentation
305
+ collection :files, as: 'files', class: Google::Apis::FirebaserulesV1::File, decorator: Google::Apis::FirebaserulesV1::File::Representation
306
+
307
+ end
308
+ end
309
+
310
+ class SourcePosition
311
+ # @private
312
+ class Representation < Google::Apis::Core::JsonRepresentation
313
+ property :column, as: 'column'
314
+ property :current_offset, as: 'currentOffset'
315
+ property :end_offset, as: 'endOffset'
316
+ property :file_name, as: 'fileName'
317
+ property :line, as: 'line'
318
+ end
319
+ end
320
+
321
+ class TestCase
322
+ # @private
323
+ class Representation < Google::Apis::Core::JsonRepresentation
324
+ property :expectation, as: 'expectation'
325
+ property :expression_report_level, as: 'expressionReportLevel'
326
+ collection :function_mocks, as: 'functionMocks', class: Google::Apis::FirebaserulesV1::FunctionMock, decorator: Google::Apis::FirebaserulesV1::FunctionMock::Representation
327
+
328
+ property :path_encoding, as: 'pathEncoding'
329
+ property :request, as: 'request'
330
+ property :resource, as: 'resource'
331
+ end
332
+ end
333
+
334
+ class TestResult
335
+ # @private
336
+ class Representation < Google::Apis::Core::JsonRepresentation
337
+ collection :debug_messages, as: 'debugMessages'
338
+ property :error_position, as: 'errorPosition', class: Google::Apis::FirebaserulesV1::SourcePosition, decorator: Google::Apis::FirebaserulesV1::SourcePosition::Representation
339
+
340
+ collection :expression_reports, as: 'expressionReports', class: Google::Apis::FirebaserulesV1::ExpressionReport, decorator: Google::Apis::FirebaserulesV1::ExpressionReport::Representation
341
+
342
+ collection :function_calls, as: 'functionCalls', class: Google::Apis::FirebaserulesV1::FunctionCall, decorator: Google::Apis::FirebaserulesV1::FunctionCall::Representation
343
+
344
+ property :state, as: 'state'
345
+ collection :visited_expressions, as: 'visitedExpressions', class: Google::Apis::FirebaserulesV1::VisitedExpression, decorator: Google::Apis::FirebaserulesV1::VisitedExpression::Representation
346
+
347
+ end
348
+ end
349
+
350
+ class TestRulesetRequest
351
+ # @private
352
+ class Representation < Google::Apis::Core::JsonRepresentation
353
+ property :source, as: 'source', class: Google::Apis::FirebaserulesV1::Source, decorator: Google::Apis::FirebaserulesV1::Source::Representation
354
+
355
+ property :test_suite, as: 'testSuite', class: Google::Apis::FirebaserulesV1::TestSuite, decorator: Google::Apis::FirebaserulesV1::TestSuite::Representation
356
+
357
+ end
358
+ end
359
+
360
+ class TestRulesetResponse
361
+ # @private
362
+ class Representation < Google::Apis::Core::JsonRepresentation
363
+ collection :issues, as: 'issues', class: Google::Apis::FirebaserulesV1::Issue, decorator: Google::Apis::FirebaserulesV1::Issue::Representation
364
+
365
+ collection :test_results, as: 'testResults', class: Google::Apis::FirebaserulesV1::TestResult, decorator: Google::Apis::FirebaserulesV1::TestResult::Representation
366
+
367
+ end
368
+ end
369
+
370
+ class TestSuite
371
+ # @private
372
+ class Representation < Google::Apis::Core::JsonRepresentation
373
+ collection :test_cases, as: 'testCases', class: Google::Apis::FirebaserulesV1::TestCase, decorator: Google::Apis::FirebaserulesV1::TestCase::Representation
374
+
375
+ end
376
+ end
377
+
378
+ class UpdateReleaseRequest
379
+ # @private
380
+ class Representation < Google::Apis::Core::JsonRepresentation
381
+ property :release, as: 'release', class: Google::Apis::FirebaserulesV1::Release, decorator: Google::Apis::FirebaserulesV1::Release::Representation
382
+
383
+ property :update_mask, as: 'updateMask'
384
+ end
385
+ end
386
+
387
+ class ValueCount
388
+ # @private
389
+ class Representation < Google::Apis::Core::JsonRepresentation
390
+ property :count, as: 'count'
391
+ property :value, as: 'value'
392
+ end
393
+ end
394
+
395
+ class VisitedExpression
396
+ # @private
397
+ class Representation < Google::Apis::Core::JsonRepresentation
398
+ property :source_position, as: 'sourcePosition', class: Google::Apis::FirebaserulesV1::SourcePosition, decorator: Google::Apis::FirebaserulesV1::SourcePosition::Representation
399
+
400
+ property :value, as: 'value'
401
+ end
402
+ end
403
+ end
404
+ end
405
+ end
@@ -0,0 +1,493 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module FirebaserulesV1
23
+ # Firebase Rules API
24
+ #
25
+ # Creates and manages rules that determine when a Firebase Rules-enabled service
26
+ # should permit a request.
27
+ #
28
+ # @example
29
+ # require 'google/apis/firebaserules_v1'
30
+ #
31
+ # Firebaserules = Google::Apis::FirebaserulesV1 # Alias the module
32
+ # service = Firebaserules::FirebaseRulesService.new
33
+ #
34
+ # @see https://firebase.google.com/docs/storage/security
35
+ class FirebaseRulesService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://firebaserules.googleapis.com/', '',
48
+ client_name: 'google-apis-firebaserules_v1',
49
+ client_version: Google::Apis::FirebaserulesV1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Test `Source` for syntactic and semantic correctness. Issues present, if any,
54
+ # will be returned to the caller with a description, severity, and source
55
+ # location. The test method may be executed with `Source` or a `Ruleset` name.
56
+ # Passing `Source` is useful for unit testing new rules. Passing a `Ruleset`
57
+ # name is useful for regression testing an existing rule. The following is an
58
+ # example of `Source` that permits users to upload images to a bucket bearing
59
+ # their user id and matching the correct metadata: _*Example*_ // Users are
60
+ # allowed to subscribe and unsubscribe to the blog. service firebase.storage `
61
+ # match /users/`userId`/images/`imageName` ` allow write: if userId == request.
62
+ # auth.uid && (imageName.matches('*.png$') || imageName.matches('*.jpg$')) &&
63
+ # resource.mimeType.matches('^image/') ` `
64
+ # @param [String] name
65
+ # Tests may either provide `source` or a `Ruleset` resource name. For tests
66
+ # against `source`, the resource name must refer to the project: Format: `
67
+ # projects/`project_id`` For tests against a `Ruleset`, this must be the `
68
+ # Ruleset` resource name: Format: `projects/`project_id`/rulesets/`ruleset_id``
69
+ # @param [Google::Apis::FirebaserulesV1::TestRulesetRequest] test_ruleset_request_object
70
+ # @param [String] fields
71
+ # Selector specifying which fields to include in a partial response.
72
+ # @param [String] quota_user
73
+ # Available to use for quota purposes for server-side applications. Can be any
74
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
75
+ # @param [Google::Apis::RequestOptions] options
76
+ # Request-specific options
77
+ #
78
+ # @yield [result, err] Result & error if block supplied
79
+ # @yieldparam result [Google::Apis::FirebaserulesV1::TestRulesetResponse] parsed result object
80
+ # @yieldparam err [StandardError] error object if request failed
81
+ #
82
+ # @return [Google::Apis::FirebaserulesV1::TestRulesetResponse]
83
+ #
84
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
85
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
86
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
87
+ def test_project_ruleset(name, test_ruleset_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
88
+ command = make_simple_command(:post, 'v1/{+name}:test', options)
89
+ command.request_representation = Google::Apis::FirebaserulesV1::TestRulesetRequest::Representation
90
+ command.request_object = test_ruleset_request_object
91
+ command.response_representation = Google::Apis::FirebaserulesV1::TestRulesetResponse::Representation
92
+ command.response_class = Google::Apis::FirebaserulesV1::TestRulesetResponse
93
+ command.params['name'] = name unless name.nil?
94
+ command.query['fields'] = fields unless fields.nil?
95
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
96
+ execute_or_queue_command(command, &block)
97
+ end
98
+
99
+ # Create a `Release`. Release names should reflect the developer's deployment
100
+ # practices. For example, the release name may include the environment name,
101
+ # application name, application version, or any other name meaningful to the
102
+ # developer. Once a `Release` refers to a `Ruleset`, the rules can be enforced
103
+ # by Firebase Rules-enabled services. More than one `Release` may be 'live'
104
+ # concurrently. Consider the following three `Release` names for `projects/foo`
105
+ # and the `Ruleset` to which they refer. Release Name | Ruleset Name ------------
106
+ # --------------------|------------- projects/foo/releases/prod | projects/foo/
107
+ # rulesets/uuid123 projects/foo/releases/prod/beta | projects/foo/rulesets/
108
+ # uuid123 projects/foo/releases/prod/v23 | projects/foo/rulesets/uuid456 The
109
+ # table reflects the `Ruleset` rollout in progress. The `prod` and `prod/beta`
110
+ # releases refer to the same `Ruleset`. However, `prod/v23` refers to a new `
111
+ # Ruleset`. The `Ruleset` reference for a `Release` may be updated using the
112
+ # UpdateRelease method.
113
+ # @param [String] name
114
+ # Resource name for the project which owns this `Release`. Format: `projects/`
115
+ # project_id``
116
+ # @param [Google::Apis::FirebaserulesV1::Release] release_object
117
+ # @param [String] fields
118
+ # Selector specifying which fields to include in a partial response.
119
+ # @param [String] quota_user
120
+ # Available to use for quota purposes for server-side applications. Can be any
121
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
122
+ # @param [Google::Apis::RequestOptions] options
123
+ # Request-specific options
124
+ #
125
+ # @yield [result, err] Result & error if block supplied
126
+ # @yieldparam result [Google::Apis::FirebaserulesV1::Release] parsed result object
127
+ # @yieldparam err [StandardError] error object if request failed
128
+ #
129
+ # @return [Google::Apis::FirebaserulesV1::Release]
130
+ #
131
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
132
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
133
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
134
+ def create_project_release(name, release_object = nil, fields: nil, quota_user: nil, options: nil, &block)
135
+ command = make_simple_command(:post, 'v1/{+name}/releases', options)
136
+ command.request_representation = Google::Apis::FirebaserulesV1::Release::Representation
137
+ command.request_object = release_object
138
+ command.response_representation = Google::Apis::FirebaserulesV1::Release::Representation
139
+ command.response_class = Google::Apis::FirebaserulesV1::Release
140
+ command.params['name'] = name unless name.nil?
141
+ command.query['fields'] = fields unless fields.nil?
142
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
143
+ execute_or_queue_command(command, &block)
144
+ end
145
+
146
+ # Delete a `Release` by resource name.
147
+ # @param [String] name
148
+ # Resource name for the `Release` to delete. Format: `projects/`project_id`/
149
+ # releases/`release_id``
150
+ # @param [String] fields
151
+ # Selector specifying which fields to include in a partial response.
152
+ # @param [String] quota_user
153
+ # Available to use for quota purposes for server-side applications. Can be any
154
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
155
+ # @param [Google::Apis::RequestOptions] options
156
+ # Request-specific options
157
+ #
158
+ # @yield [result, err] Result & error if block supplied
159
+ # @yieldparam result [Google::Apis::FirebaserulesV1::Empty] parsed result object
160
+ # @yieldparam err [StandardError] error object if request failed
161
+ #
162
+ # @return [Google::Apis::FirebaserulesV1::Empty]
163
+ #
164
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
165
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
166
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
167
+ def delete_project_release(name, fields: nil, quota_user: nil, options: nil, &block)
168
+ command = make_simple_command(:delete, 'v1/{+name}', options)
169
+ command.response_representation = Google::Apis::FirebaserulesV1::Empty::Representation
170
+ command.response_class = Google::Apis::FirebaserulesV1::Empty
171
+ command.params['name'] = name unless name.nil?
172
+ command.query['fields'] = fields unless fields.nil?
173
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
174
+ execute_or_queue_command(command, &block)
175
+ end
176
+
177
+ # Get a `Release` by name.
178
+ # @param [String] name
179
+ # Resource name of the `Release`. Format: `projects/`project_id`/releases/`
180
+ # release_id``
181
+ # @param [String] fields
182
+ # Selector specifying which fields to include in a partial response.
183
+ # @param [String] quota_user
184
+ # Available to use for quota purposes for server-side applications. Can be any
185
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
186
+ # @param [Google::Apis::RequestOptions] options
187
+ # Request-specific options
188
+ #
189
+ # @yield [result, err] Result & error if block supplied
190
+ # @yieldparam result [Google::Apis::FirebaserulesV1::Release] parsed result object
191
+ # @yieldparam err [StandardError] error object if request failed
192
+ #
193
+ # @return [Google::Apis::FirebaserulesV1::Release]
194
+ #
195
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
196
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
197
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
198
+ def get_project_release(name, fields: nil, quota_user: nil, options: nil, &block)
199
+ command = make_simple_command(:get, 'v1/{+name}', options)
200
+ command.response_representation = Google::Apis::FirebaserulesV1::Release::Representation
201
+ command.response_class = Google::Apis::FirebaserulesV1::Release
202
+ command.params['name'] = name unless name.nil?
203
+ command.query['fields'] = fields unless fields.nil?
204
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
205
+ execute_or_queue_command(command, &block)
206
+ end
207
+
208
+ # Get the `Release` executable to use when enforcing rules.
209
+ # @param [String] name
210
+ # Resource name of the `Release`. Format: `projects/`project_id`/releases/`
211
+ # release_id``
212
+ # @param [String] executable_version
213
+ # The requested runtime executable version. Defaults to
214
+ # FIREBASE_RULES_EXECUTABLE_V1.
215
+ # @param [String] fields
216
+ # Selector specifying which fields to include in a partial response.
217
+ # @param [String] quota_user
218
+ # Available to use for quota purposes for server-side applications. Can be any
219
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
220
+ # @param [Google::Apis::RequestOptions] options
221
+ # Request-specific options
222
+ #
223
+ # @yield [result, err] Result & error if block supplied
224
+ # @yieldparam result [Google::Apis::FirebaserulesV1::GetReleaseExecutableResponse] parsed result object
225
+ # @yieldparam err [StandardError] error object if request failed
226
+ #
227
+ # @return [Google::Apis::FirebaserulesV1::GetReleaseExecutableResponse]
228
+ #
229
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
230
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
231
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
232
+ def get_project_release_executable(name, executable_version: nil, fields: nil, quota_user: nil, options: nil, &block)
233
+ command = make_simple_command(:get, 'v1/{+name}:getExecutable', options)
234
+ command.response_representation = Google::Apis::FirebaserulesV1::GetReleaseExecutableResponse::Representation
235
+ command.response_class = Google::Apis::FirebaserulesV1::GetReleaseExecutableResponse
236
+ command.params['name'] = name unless name.nil?
237
+ command.query['executableVersion'] = executable_version unless executable_version.nil?
238
+ command.query['fields'] = fields unless fields.nil?
239
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
240
+ execute_or_queue_command(command, &block)
241
+ end
242
+
243
+ # List the `Release` values for a project. This list may optionally be filtered
244
+ # by `Release` name, `Ruleset` name, `TestSuite` name, or any combination
245
+ # thereof.
246
+ # @param [String] name
247
+ # Resource name for the project. Format: `projects/`project_id``
248
+ # @param [String] filter
249
+ # `Release` filter. The list method supports filters with restrictions on the `
250
+ # Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`. Example
251
+ # 1: A filter of 'name=prod*' might return `Release`s with names within '
252
+ # projects/foo' prefixed with 'prod': Name | Ruleset Name -----------------------
253
+ # -------|------------- projects/foo/releases/prod | projects/foo/rulesets/
254
+ # uuid1234 projects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234
255
+ # projects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888 Example 2: A
256
+ # filter of `name=prod* ruleset_name=uuid1234` would return only `Release`
257
+ # instances for 'projects/foo' with names prefixed with 'prod' referring to the
258
+ # same `Ruleset` name of 'uuid1234': Name | Ruleset Name ------------------------
259
+ # ------|------------- projects/foo/releases/prod | projects/foo/rulesets/1234
260
+ # projects/foo/releases/prod/v1 | projects/foo/rulesets/1234 In the examples,
261
+ # the filter parameters refer to the search filters are relative to the project.
262
+ # Fully qualified prefixed may also be used. e.g. `test_suite_name=projects/foo/
263
+ # testsuites/uuid1`
264
+ # @param [Fixnum] page_size
265
+ # Page size to load. Maximum of 100. Defaults to 10. Note: `page_size` is just a
266
+ # hint and the service may choose to load fewer than `page_size` results due to
267
+ # the size of the output. To traverse all of the releases, the caller should
268
+ # iterate until the `page_token` on the response is empty.
269
+ # @param [String] page_token
270
+ # Next page token for the next batch of `Release` instances.
271
+ # @param [String] fields
272
+ # Selector specifying which fields to include in a partial response.
273
+ # @param [String] quota_user
274
+ # Available to use for quota purposes for server-side applications. Can be any
275
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
276
+ # @param [Google::Apis::RequestOptions] options
277
+ # Request-specific options
278
+ #
279
+ # @yield [result, err] Result & error if block supplied
280
+ # @yieldparam result [Google::Apis::FirebaserulesV1::ListReleasesResponse] parsed result object
281
+ # @yieldparam err [StandardError] error object if request failed
282
+ #
283
+ # @return [Google::Apis::FirebaserulesV1::ListReleasesResponse]
284
+ #
285
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
286
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
287
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
288
+ def list_project_releases(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
289
+ command = make_simple_command(:get, 'v1/{+name}/releases', options)
290
+ command.response_representation = Google::Apis::FirebaserulesV1::ListReleasesResponse::Representation
291
+ command.response_class = Google::Apis::FirebaserulesV1::ListReleasesResponse
292
+ command.params['name'] = name unless name.nil?
293
+ command.query['filter'] = filter unless filter.nil?
294
+ command.query['pageSize'] = page_size unless page_size.nil?
295
+ command.query['pageToken'] = page_token unless page_token.nil?
296
+ command.query['fields'] = fields unless fields.nil?
297
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
298
+ execute_or_queue_command(command, &block)
299
+ end
300
+
301
+ # Update a `Release` via PATCH. Only updates to the `ruleset_name` and `
302
+ # test_suite_name` fields will be honored. `Release` rename is not supported. To
303
+ # create a `Release` use the CreateRelease method.
304
+ # @param [String] name
305
+ # Resource name for the project which owns this `Release`. Format: `projects/`
306
+ # project_id``
307
+ # @param [Google::Apis::FirebaserulesV1::UpdateReleaseRequest] update_release_request_object
308
+ # @param [String] fields
309
+ # Selector specifying which fields to include in a partial response.
310
+ # @param [String] quota_user
311
+ # Available to use for quota purposes for server-side applications. Can be any
312
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
313
+ # @param [Google::Apis::RequestOptions] options
314
+ # Request-specific options
315
+ #
316
+ # @yield [result, err] Result & error if block supplied
317
+ # @yieldparam result [Google::Apis::FirebaserulesV1::Release] parsed result object
318
+ # @yieldparam err [StandardError] error object if request failed
319
+ #
320
+ # @return [Google::Apis::FirebaserulesV1::Release]
321
+ #
322
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
323
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
324
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
325
+ def patch_project_release(name, update_release_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
326
+ command = make_simple_command(:patch, 'v1/{+name}', options)
327
+ command.request_representation = Google::Apis::FirebaserulesV1::UpdateReleaseRequest::Representation
328
+ command.request_object = update_release_request_object
329
+ command.response_representation = Google::Apis::FirebaserulesV1::Release::Representation
330
+ command.response_class = Google::Apis::FirebaserulesV1::Release
331
+ command.params['name'] = name unless name.nil?
332
+ command.query['fields'] = fields unless fields.nil?
333
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
334
+ execute_or_queue_command(command, &block)
335
+ end
336
+
337
+ # Create a `Ruleset` from `Source`. The `Ruleset` is given a unique generated
338
+ # name which is returned to the caller. `Source` containing syntactic or
339
+ # semantics errors will result in an error response indicating the first error
340
+ # encountered. For a detailed view of `Source` issues, use TestRuleset.
341
+ # @param [String] name
342
+ # Resource name for Project which owns this `Ruleset`. Format: `projects/`
343
+ # project_id``
344
+ # @param [Google::Apis::FirebaserulesV1::Ruleset] ruleset_object
345
+ # @param [String] fields
346
+ # Selector specifying which fields to include in a partial response.
347
+ # @param [String] quota_user
348
+ # Available to use for quota purposes for server-side applications. Can be any
349
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
350
+ # @param [Google::Apis::RequestOptions] options
351
+ # Request-specific options
352
+ #
353
+ # @yield [result, err] Result & error if block supplied
354
+ # @yieldparam result [Google::Apis::FirebaserulesV1::Ruleset] parsed result object
355
+ # @yieldparam err [StandardError] error object if request failed
356
+ #
357
+ # @return [Google::Apis::FirebaserulesV1::Ruleset]
358
+ #
359
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
360
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
361
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
362
+ def create_project_ruleset(name, ruleset_object = nil, fields: nil, quota_user: nil, options: nil, &block)
363
+ command = make_simple_command(:post, 'v1/{+name}/rulesets', options)
364
+ command.request_representation = Google::Apis::FirebaserulesV1::Ruleset::Representation
365
+ command.request_object = ruleset_object
366
+ command.response_representation = Google::Apis::FirebaserulesV1::Ruleset::Representation
367
+ command.response_class = Google::Apis::FirebaserulesV1::Ruleset
368
+ command.params['name'] = name unless name.nil?
369
+ command.query['fields'] = fields unless fields.nil?
370
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
371
+ execute_or_queue_command(command, &block)
372
+ end
373
+
374
+ # Delete a `Ruleset` by resource name. If the `Ruleset` is referenced by a `
375
+ # Release` the operation will fail.
376
+ # @param [String] name
377
+ # Resource name for the ruleset to delete. Format: `projects/`project_id`/
378
+ # rulesets/`ruleset_id``
379
+ # @param [String] fields
380
+ # Selector specifying which fields to include in a partial response.
381
+ # @param [String] quota_user
382
+ # Available to use for quota purposes for server-side applications. Can be any
383
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
384
+ # @param [Google::Apis::RequestOptions] options
385
+ # Request-specific options
386
+ #
387
+ # @yield [result, err] Result & error if block supplied
388
+ # @yieldparam result [Google::Apis::FirebaserulesV1::Empty] parsed result object
389
+ # @yieldparam err [StandardError] error object if request failed
390
+ #
391
+ # @return [Google::Apis::FirebaserulesV1::Empty]
392
+ #
393
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
394
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
395
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
396
+ def delete_project_ruleset(name, fields: nil, quota_user: nil, options: nil, &block)
397
+ command = make_simple_command(:delete, 'v1/{+name}', options)
398
+ command.response_representation = Google::Apis::FirebaserulesV1::Empty::Representation
399
+ command.response_class = Google::Apis::FirebaserulesV1::Empty
400
+ command.params['name'] = name unless name.nil?
401
+ command.query['fields'] = fields unless fields.nil?
402
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
403
+ execute_or_queue_command(command, &block)
404
+ end
405
+
406
+ # Get a `Ruleset` by name including the full `Source` contents.
407
+ # @param [String] name
408
+ # Resource name for the ruleset to get. Format: `projects/`project_id`/rulesets/`
409
+ # ruleset_id``
410
+ # @param [String] fields
411
+ # Selector specifying which fields to include in a partial response.
412
+ # @param [String] quota_user
413
+ # Available to use for quota purposes for server-side applications. Can be any
414
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
415
+ # @param [Google::Apis::RequestOptions] options
416
+ # Request-specific options
417
+ #
418
+ # @yield [result, err] Result & error if block supplied
419
+ # @yieldparam result [Google::Apis::FirebaserulesV1::Ruleset] parsed result object
420
+ # @yieldparam err [StandardError] error object if request failed
421
+ #
422
+ # @return [Google::Apis::FirebaserulesV1::Ruleset]
423
+ #
424
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
425
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
426
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
427
+ def get_project_ruleset(name, fields: nil, quota_user: nil, options: nil, &block)
428
+ command = make_simple_command(:get, 'v1/{+name}', options)
429
+ command.response_representation = Google::Apis::FirebaserulesV1::Ruleset::Representation
430
+ command.response_class = Google::Apis::FirebaserulesV1::Ruleset
431
+ command.params['name'] = name unless name.nil?
432
+ command.query['fields'] = fields unless fields.nil?
433
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
434
+ execute_or_queue_command(command, &block)
435
+ end
436
+
437
+ # List `Ruleset` metadata only and optionally filter the results by `Ruleset`
438
+ # name. The full `Source` contents of a `Ruleset` may be retrieved with
439
+ # GetRuleset.
440
+ # @param [String] name
441
+ # Resource name for the project. Format: `projects/`project_id``
442
+ # @param [String] filter
443
+ # `Ruleset` filter. The list method supports filters with restrictions on `
444
+ # Ruleset.name`. Filters on `Ruleset.create_time` should use the `date` function
445
+ # which parses strings that conform to the RFC 3339 date/time specifications.
446
+ # Example: `create_time > date("2017-01-01T00:00:00Z") AND name=UUID-*`
447
+ # @param [Fixnum] page_size
448
+ # Page size to load. Maximum of 100. Defaults to 10. Note: `page_size` is just a
449
+ # hint and the service may choose to load less than `page_size` due to the size
450
+ # of the output. To traverse all of the releases, caller should iterate until
451
+ # the `page_token` is empty.
452
+ # @param [String] page_token
453
+ # Next page token for loading the next batch of `Ruleset` instances.
454
+ # @param [String] fields
455
+ # Selector specifying which fields to include in a partial response.
456
+ # @param [String] quota_user
457
+ # Available to use for quota purposes for server-side applications. Can be any
458
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
459
+ # @param [Google::Apis::RequestOptions] options
460
+ # Request-specific options
461
+ #
462
+ # @yield [result, err] Result & error if block supplied
463
+ # @yieldparam result [Google::Apis::FirebaserulesV1::ListRulesetsResponse] parsed result object
464
+ # @yieldparam err [StandardError] error object if request failed
465
+ #
466
+ # @return [Google::Apis::FirebaserulesV1::ListRulesetsResponse]
467
+ #
468
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
469
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
470
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
471
+ def list_project_rulesets(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
472
+ command = make_simple_command(:get, 'v1/{+name}/rulesets', options)
473
+ command.response_representation = Google::Apis::FirebaserulesV1::ListRulesetsResponse::Representation
474
+ command.response_class = Google::Apis::FirebaserulesV1::ListRulesetsResponse
475
+ command.params['name'] = name unless name.nil?
476
+ command.query['filter'] = filter unless filter.nil?
477
+ command.query['pageSize'] = page_size unless page_size.nil?
478
+ command.query['pageToken'] = page_token unless page_token.nil?
479
+ command.query['fields'] = fields unless fields.nil?
480
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
481
+ execute_or_queue_command(command, &block)
482
+ end
483
+
484
+ protected
485
+
486
+ def apply_command_defaults(command)
487
+ command.query['key'] = key unless key.nil?
488
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
489
+ end
490
+ end
491
+ end
492
+ end
493
+ end