File: service.rb

package info (click to toggle)
ruby-google-api-client 0.53.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 75,020 kB
  • sloc: ruby: 626,567; makefile: 4
file content (491 lines) | stat: -rw-r--r-- 29,999 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'

module Google
  module Apis
    module FirebaserulesV1
      # Firebase Rules API
      #
      # Creates and manages rules that determine when a Firebase Rules-enabled service
      #  should permit a request.
      #
      # @example
      #    require 'google/apis/firebaserules_v1'
      #
      #    Firebaserules = Google::Apis::FirebaserulesV1 # Alias the module
      #    service = Firebaserules::FirebaseRulesService.new
      #
      # @see https://firebase.google.com/docs/storage/security
      class FirebaseRulesService < Google::Apis::Core::BaseService
        # @return [String]
        #  API key. Your API key identifies your project and provides you with API access,
        #  quota, and reports. Required unless you provide an OAuth 2.0 token.
        attr_accessor :key

        # @return [String]
        #  Available to use for quota purposes for server-side applications. Can be any
        #  arbitrary string assigned to a user, but should not exceed 40 characters.
        attr_accessor :quota_user

        def initialize
          super('https://firebaserules.googleapis.com/', '')
          @batch_path = 'batch'
        end
        
        # 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/') ` `
        # @param [String] 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``
        # @param [Google::Apis::FirebaserulesV1::TestRulesetRequest] test_ruleset_request_object
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::FirebaserulesV1::TestRulesetResponse] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::FirebaserulesV1::TestRulesetResponse]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def test_project_ruleset(name, test_ruleset_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
          command = make_simple_command(:post, 'v1/{+name}:test', options)
          command.request_representation = Google::Apis::FirebaserulesV1::TestRulesetRequest::Representation
          command.request_object = test_ruleset_request_object
          command.response_representation = Google::Apis::FirebaserulesV1::TestRulesetResponse::Representation
          command.response_class = Google::Apis::FirebaserulesV1::TestRulesetResponse
          command.params['name'] = name unless name.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          execute_or_queue_command(command, &block)
        end
        
        # Create a `Release`. Release names should reflect the developer's deployment
        # practices. For example, the release name may include the environment name,
        # application name, application version, or any other name meaningful to the
        # developer. Once a `Release` refers to a `Ruleset`, the rules can be enforced
        # by Firebase Rules-enabled services. More than one `Release` may be 'live'
        # concurrently. Consider the following three `Release` names for `projects/foo`
        # and the `Ruleset` to which they refer. Release Name | Ruleset Name ------------
        # --------------------|------------- projects/foo/releases/prod | projects/foo/
        # rulesets/uuid123 projects/foo/releases/prod/beta | projects/foo/rulesets/
        # uuid123 projects/foo/releases/prod/v23 | projects/foo/rulesets/uuid456 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.
        # @param [String] name
        #   Resource name for the project which owns this `Release`. Format: `projects/`
        #   project_id``
        # @param [Google::Apis::FirebaserulesV1::Release] release_object
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::FirebaserulesV1::Release] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::FirebaserulesV1::Release]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def create_project_release(name, release_object = nil, fields: nil, quota_user: nil, options: nil, &block)
          command = make_simple_command(:post, 'v1/{+name}/releases', options)
          command.request_representation = Google::Apis::FirebaserulesV1::Release::Representation
          command.request_object = release_object
          command.response_representation = Google::Apis::FirebaserulesV1::Release::Representation
          command.response_class = Google::Apis::FirebaserulesV1::Release
          command.params['name'] = name unless name.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          execute_or_queue_command(command, &block)
        end
        
        # Delete a `Release` by resource name.
        # @param [String] name
        #   Resource name for the `Release` to delete. Format: `projects/`project_id`/
        #   releases/`release_id``
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::FirebaserulesV1::Empty] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::FirebaserulesV1::Empty]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def delete_project_release(name, fields: nil, quota_user: nil, options: nil, &block)
          command = make_simple_command(:delete, 'v1/{+name}', options)
          command.response_representation = Google::Apis::FirebaserulesV1::Empty::Representation
          command.response_class = Google::Apis::FirebaserulesV1::Empty
          command.params['name'] = name unless name.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          execute_or_queue_command(command, &block)
        end
        
        # Get a `Release` by name.
        # @param [String] name
        #   Resource name of the `Release`. Format: `projects/`project_id`/releases/`
        #   release_id``
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::FirebaserulesV1::Release] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::FirebaserulesV1::Release]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def get_project_release(name, fields: nil, quota_user: nil, options: nil, &block)
          command = make_simple_command(:get, 'v1/{+name}', options)
          command.response_representation = Google::Apis::FirebaserulesV1::Release::Representation
          command.response_class = Google::Apis::FirebaserulesV1::Release
          command.params['name'] = name unless name.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          execute_or_queue_command(command, &block)
        end
        
        # Get the `Release` executable to use when enforcing rules.
        # @param [String] name
        #   Resource name of the `Release`. Format: `projects/`project_id`/releases/`
        #   release_id``
        # @param [String] executable_version
        #   The requested runtime executable version. Defaults to
        #   FIREBASE_RULES_EXECUTABLE_V1.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::FirebaserulesV1::GetReleaseExecutableResponse] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::FirebaserulesV1::GetReleaseExecutableResponse]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def get_project_release_executable(name, executable_version: nil, fields: nil, quota_user: nil, options: nil, &block)
          command = make_simple_command(:get, 'v1/{+name}:getExecutable', options)
          command.response_representation = Google::Apis::FirebaserulesV1::GetReleaseExecutableResponse::Representation
          command.response_class = Google::Apis::FirebaserulesV1::GetReleaseExecutableResponse
          command.params['name'] = name unless name.nil?
          command.query['executableVersion'] = executable_version unless executable_version.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          execute_or_queue_command(command, &block)
        end
        
        # List the `Release` values for a project. This list may optionally be filtered
        # by `Release` name, `Ruleset` name, `TestSuite` name, or any combination
        # thereof.
        # @param [String] name
        #   Resource name for the project. Format: `projects/`project_id``
        # @param [String] filter
        #   `Release` filter. The list method supports filters with restrictions on the `
        #   Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`. Example
        #   1: A filter of 'name=prod*' might return `Release`s with names within '
        #   projects/foo' prefixed with 'prod': Name | Ruleset Name -----------------------
        #   -------|------------- projects/foo/releases/prod | projects/foo/rulesets/
        #   uuid1234 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 `Release`
        #   instances for 'projects/foo' with names prefixed with 'prod' referring to the
        #   same `Ruleset` name of 'uuid1234': Name | Ruleset Name ------------------------
        #   ------|------------- 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 are relative to the project.
        #   Fully qualified prefixed may also be used. e.g. `test_suite_name=projects/foo/
        #   testsuites/uuid1`
        # @param [Fixnum] page_size
        #   Page size to load. Maximum of 100. Defaults to 10. 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.
        # @param [String] page_token
        #   Next page token for the next batch of `Release` instances.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::FirebaserulesV1::ListReleasesResponse] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::FirebaserulesV1::ListReleasesResponse]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def list_project_releases(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
          command = make_simple_command(:get, 'v1/{+name}/releases', options)
          command.response_representation = Google::Apis::FirebaserulesV1::ListReleasesResponse::Representation
          command.response_class = Google::Apis::FirebaserulesV1::ListReleasesResponse
          command.params['name'] = name unless name.nil?
          command.query['filter'] = filter unless filter.nil?
          command.query['pageSize'] = page_size unless page_size.nil?
          command.query['pageToken'] = page_token unless page_token.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          execute_or_queue_command(command, &block)
        end
        
        # Update a `Release` via PATCH. 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.
        # @param [String] name
        #   Resource name for the project which owns this `Release`. Format: `projects/`
        #   project_id``
        # @param [Google::Apis::FirebaserulesV1::UpdateReleaseRequest] update_release_request_object
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::FirebaserulesV1::Release] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::FirebaserulesV1::Release]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def patch_project_release(name, update_release_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
          command = make_simple_command(:patch, 'v1/{+name}', options)
          command.request_representation = Google::Apis::FirebaserulesV1::UpdateReleaseRequest::Representation
          command.request_object = update_release_request_object
          command.response_representation = Google::Apis::FirebaserulesV1::Release::Representation
          command.response_class = Google::Apis::FirebaserulesV1::Release
          command.params['name'] = name unless name.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          execute_or_queue_command(command, &block)
        end
        
        # Create a `Ruleset` from `Source`. The `Ruleset` is given a unique generated
        # name which is returned to the caller. `Source` containing syntactic or
        # semantics errors will result in an error response indicating the first error
        # encountered. For a detailed view of `Source` issues, use TestRuleset.
        # @param [String] name
        #   Resource name for Project which owns this `Ruleset`. Format: `projects/`
        #   project_id``
        # @param [Google::Apis::FirebaserulesV1::Ruleset] ruleset_object
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::FirebaserulesV1::Ruleset] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::FirebaserulesV1::Ruleset]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def create_project_ruleset(name, ruleset_object = nil, fields: nil, quota_user: nil, options: nil, &block)
          command = make_simple_command(:post, 'v1/{+name}/rulesets', options)
          command.request_representation = Google::Apis::FirebaserulesV1::Ruleset::Representation
          command.request_object = ruleset_object
          command.response_representation = Google::Apis::FirebaserulesV1::Ruleset::Representation
          command.response_class = Google::Apis::FirebaserulesV1::Ruleset
          command.params['name'] = name unless name.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          execute_or_queue_command(command, &block)
        end
        
        # Delete a `Ruleset` by resource name. If the `Ruleset` is referenced by a `
        # Release` the operation will fail.
        # @param [String] name
        #   Resource name for the ruleset to delete. Format: `projects/`project_id`/
        #   rulesets/`ruleset_id``
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::FirebaserulesV1::Empty] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::FirebaserulesV1::Empty]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def delete_project_ruleset(name, fields: nil, quota_user: nil, options: nil, &block)
          command = make_simple_command(:delete, 'v1/{+name}', options)
          command.response_representation = Google::Apis::FirebaserulesV1::Empty::Representation
          command.response_class = Google::Apis::FirebaserulesV1::Empty
          command.params['name'] = name unless name.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          execute_or_queue_command(command, &block)
        end
        
        # Get a `Ruleset` by name including the full `Source` contents.
        # @param [String] name
        #   Resource name for the ruleset to get. Format: `projects/`project_id`/rulesets/`
        #   ruleset_id``
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::FirebaserulesV1::Ruleset] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::FirebaserulesV1::Ruleset]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def get_project_ruleset(name, fields: nil, quota_user: nil, options: nil, &block)
          command = make_simple_command(:get, 'v1/{+name}', options)
          command.response_representation = Google::Apis::FirebaserulesV1::Ruleset::Representation
          command.response_class = Google::Apis::FirebaserulesV1::Ruleset
          command.params['name'] = name unless name.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          execute_or_queue_command(command, &block)
        end
        
        # List `Ruleset` metadata only and optionally filter the results by `Ruleset`
        # name. The full `Source` contents of a `Ruleset` may be retrieved with
        # GetRuleset.
        # @param [String] name
        #   Resource name for the project. Format: `projects/`project_id``
        # @param [String] 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-01T00:00:00Z") AND name=UUID-*`
        # @param [Fixnum] page_size
        #   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.
        # @param [String] page_token
        #   Next page token for loading the next batch of `Ruleset` instances.
        # @param [String] fields
        #   Selector specifying which fields to include in a partial response.
        # @param [String] quota_user
        #   Available to use for quota purposes for server-side applications. Can be any
        #   arbitrary string assigned to a user, but should not exceed 40 characters.
        # @param [Google::Apis::RequestOptions] options
        #   Request-specific options
        #
        # @yield [result, err] Result & error if block supplied
        # @yieldparam result [Google::Apis::FirebaserulesV1::ListRulesetsResponse] parsed result object
        # @yieldparam err [StandardError] error object if request failed
        #
        # @return [Google::Apis::FirebaserulesV1::ListRulesetsResponse]
        #
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def list_project_rulesets(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
          command = make_simple_command(:get, 'v1/{+name}/rulesets', options)
          command.response_representation = Google::Apis::FirebaserulesV1::ListRulesetsResponse::Representation
          command.response_class = Google::Apis::FirebaserulesV1::ListRulesetsResponse
          command.params['name'] = name unless name.nil?
          command.query['filter'] = filter unless filter.nil?
          command.query['pageSize'] = page_size unless page_size.nil?
          command.query['pageToken'] = page_token unless page_token.nil?
          command.query['fields'] = fields unless fields.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
          execute_or_queue_command(command, &block)
        end

        protected

        def apply_command_defaults(command)
          command.query['key'] = key unless key.nil?
          command.query['quotaUser'] = quota_user unless quota_user.nil?
        end
      end
    end
  end
end