google-cloud-spanner-admin-database-v1 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1214 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/spanner/admin/database/v1/spanner_database_admin_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Spanner
24
+ module Admin
25
+ module Database
26
+ module V1
27
+ module DatabaseAdmin
28
+ module Rest
29
+ ##
30
+ # REST service stub for the DatabaseAdmin service.
31
+ # Service stub contains baseline method implementations
32
+ # including transcoding, making the REST call, and deserialing the response.
33
+ #
34
+ class ServiceStub
35
+ def initialize endpoint:, credentials:
36
+ # These require statements are intentionally placed here to initialize
37
+ # the REST modules only when it's required.
38
+ require "gapic/rest"
39
+
40
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
41
+ numeric_enums: true,
42
+ raise_faraday_errors: false
43
+ end
44
+
45
+ ##
46
+ # Baseline implementation for the list_databases REST call
47
+ #
48
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest]
49
+ # A request object representing the call parameters. Required.
50
+ # @param options [::Gapic::CallOptions]
51
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
52
+ #
53
+ # @yield [result, operation] Access the result along with the TransportOperation object
54
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse]
55
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
56
+ #
57
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse]
58
+ # A result object deserialized from the server's reply
59
+ def list_databases request_pb, options = nil
60
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
61
+
62
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_databases_request request_pb
63
+ query_string_params = if query_string_params.any?
64
+ query_string_params.to_h { |p| p.split("=", 2) }
65
+ else
66
+ {}
67
+ end
68
+
69
+ response = @client_stub.make_http_request(
70
+ verb,
71
+ uri: uri,
72
+ body: body || "",
73
+ params: query_string_params,
74
+ options: options
75
+ )
76
+ operation = ::Gapic::Rest::TransportOperation.new response
77
+ result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.decode_json response.body, ignore_unknown_fields: true
78
+
79
+ yield result, operation if block_given?
80
+ result
81
+ end
82
+
83
+ ##
84
+ # Baseline implementation for the create_database REST call
85
+ #
86
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest]
87
+ # A request object representing the call parameters. Required.
88
+ # @param options [::Gapic::CallOptions]
89
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
90
+ #
91
+ # @yield [result, operation] Access the result along with the TransportOperation object
92
+ # @yieldparam result [::Google::Longrunning::Operation]
93
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
94
+ #
95
+ # @return [::Google::Longrunning::Operation]
96
+ # A result object deserialized from the server's reply
97
+ def create_database request_pb, options = nil
98
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
99
+
100
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_database_request request_pb
101
+ query_string_params = if query_string_params.any?
102
+ query_string_params.to_h { |p| p.split("=", 2) }
103
+ else
104
+ {}
105
+ end
106
+
107
+ response = @client_stub.make_http_request(
108
+ verb,
109
+ uri: uri,
110
+ body: body || "",
111
+ params: query_string_params,
112
+ options: options
113
+ )
114
+ operation = ::Gapic::Rest::TransportOperation.new response
115
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
116
+
117
+ yield result, operation if block_given?
118
+ result
119
+ end
120
+
121
+ ##
122
+ # Baseline implementation for the get_database REST call
123
+ #
124
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest]
125
+ # A request object representing the call parameters. Required.
126
+ # @param options [::Gapic::CallOptions]
127
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
128
+ #
129
+ # @yield [result, operation] Access the result along with the TransportOperation object
130
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Database]
131
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
132
+ #
133
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::Database]
134
+ # A result object deserialized from the server's reply
135
+ def get_database request_pb, options = nil
136
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
137
+
138
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_database_request request_pb
139
+ query_string_params = if query_string_params.any?
140
+ query_string_params.to_h { |p| p.split("=", 2) }
141
+ else
142
+ {}
143
+ end
144
+
145
+ response = @client_stub.make_http_request(
146
+ verb,
147
+ uri: uri,
148
+ body: body || "",
149
+ params: query_string_params,
150
+ options: options
151
+ )
152
+ operation = ::Gapic::Rest::TransportOperation.new response
153
+ result = ::Google::Cloud::Spanner::Admin::Database::V1::Database.decode_json response.body, ignore_unknown_fields: true
154
+
155
+ yield result, operation if block_given?
156
+ result
157
+ end
158
+
159
+ ##
160
+ # Baseline implementation for the update_database_ddl REST call
161
+ #
162
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest]
163
+ # A request object representing the call parameters. Required.
164
+ # @param options [::Gapic::CallOptions]
165
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
166
+ #
167
+ # @yield [result, operation] Access the result along with the TransportOperation object
168
+ # @yieldparam result [::Google::Longrunning::Operation]
169
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
170
+ #
171
+ # @return [::Google::Longrunning::Operation]
172
+ # A result object deserialized from the server's reply
173
+ def update_database_ddl request_pb, options = nil
174
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
175
+
176
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_database_ddl_request request_pb
177
+ query_string_params = if query_string_params.any?
178
+ query_string_params.to_h { |p| p.split("=", 2) }
179
+ else
180
+ {}
181
+ end
182
+
183
+ response = @client_stub.make_http_request(
184
+ verb,
185
+ uri: uri,
186
+ body: body || "",
187
+ params: query_string_params,
188
+ options: options
189
+ )
190
+ operation = ::Gapic::Rest::TransportOperation.new response
191
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
192
+
193
+ yield result, operation if block_given?
194
+ result
195
+ end
196
+
197
+ ##
198
+ # Baseline implementation for the drop_database REST call
199
+ #
200
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest]
201
+ # A request object representing the call parameters. Required.
202
+ # @param options [::Gapic::CallOptions]
203
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
204
+ #
205
+ # @yield [result, operation] Access the result along with the TransportOperation object
206
+ # @yieldparam result [::Google::Protobuf::Empty]
207
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
208
+ #
209
+ # @return [::Google::Protobuf::Empty]
210
+ # A result object deserialized from the server's reply
211
+ def drop_database request_pb, options = nil
212
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
213
+
214
+ verb, uri, query_string_params, body = ServiceStub.transcode_drop_database_request request_pb
215
+ query_string_params = if query_string_params.any?
216
+ query_string_params.to_h { |p| p.split("=", 2) }
217
+ else
218
+ {}
219
+ end
220
+
221
+ response = @client_stub.make_http_request(
222
+ verb,
223
+ uri: uri,
224
+ body: body || "",
225
+ params: query_string_params,
226
+ options: options
227
+ )
228
+ operation = ::Gapic::Rest::TransportOperation.new response
229
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
230
+
231
+ yield result, operation if block_given?
232
+ result
233
+ end
234
+
235
+ ##
236
+ # Baseline implementation for the get_database_ddl REST call
237
+ #
238
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest]
239
+ # A request object representing the call parameters. Required.
240
+ # @param options [::Gapic::CallOptions]
241
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
242
+ #
243
+ # @yield [result, operation] Access the result along with the TransportOperation object
244
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse]
245
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
246
+ #
247
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse]
248
+ # A result object deserialized from the server's reply
249
+ def get_database_ddl request_pb, options = nil
250
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
251
+
252
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_database_ddl_request request_pb
253
+ query_string_params = if query_string_params.any?
254
+ query_string_params.to_h { |p| p.split("=", 2) }
255
+ else
256
+ {}
257
+ end
258
+
259
+ response = @client_stub.make_http_request(
260
+ verb,
261
+ uri: uri,
262
+ body: body || "",
263
+ params: query_string_params,
264
+ options: options
265
+ )
266
+ operation = ::Gapic::Rest::TransportOperation.new response
267
+ result = ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse.decode_json response.body, ignore_unknown_fields: true
268
+
269
+ yield result, operation if block_given?
270
+ result
271
+ end
272
+
273
+ ##
274
+ # Baseline implementation for the set_iam_policy REST call
275
+ #
276
+ # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
277
+ # A request object representing the call parameters. Required.
278
+ # @param options [::Gapic::CallOptions]
279
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
280
+ #
281
+ # @yield [result, operation] Access the result along with the TransportOperation object
282
+ # @yieldparam result [::Google::Iam::V1::Policy]
283
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
284
+ #
285
+ # @return [::Google::Iam::V1::Policy]
286
+ # A result object deserialized from the server's reply
287
+ def set_iam_policy request_pb, options = nil
288
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
289
+
290
+ verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb
291
+ query_string_params = if query_string_params.any?
292
+ query_string_params.to_h { |p| p.split("=", 2) }
293
+ else
294
+ {}
295
+ end
296
+
297
+ response = @client_stub.make_http_request(
298
+ verb,
299
+ uri: uri,
300
+ body: body || "",
301
+ params: query_string_params,
302
+ options: options
303
+ )
304
+ operation = ::Gapic::Rest::TransportOperation.new response
305
+ result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
306
+
307
+ yield result, operation if block_given?
308
+ result
309
+ end
310
+
311
+ ##
312
+ # Baseline implementation for the get_iam_policy REST call
313
+ #
314
+ # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
315
+ # A request object representing the call parameters. Required.
316
+ # @param options [::Gapic::CallOptions]
317
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
318
+ #
319
+ # @yield [result, operation] Access the result along with the TransportOperation object
320
+ # @yieldparam result [::Google::Iam::V1::Policy]
321
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
322
+ #
323
+ # @return [::Google::Iam::V1::Policy]
324
+ # A result object deserialized from the server's reply
325
+ def get_iam_policy request_pb, options = nil
326
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
327
+
328
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb
329
+ query_string_params = if query_string_params.any?
330
+ query_string_params.to_h { |p| p.split("=", 2) }
331
+ else
332
+ {}
333
+ end
334
+
335
+ response = @client_stub.make_http_request(
336
+ verb,
337
+ uri: uri,
338
+ body: body || "",
339
+ params: query_string_params,
340
+ options: options
341
+ )
342
+ operation = ::Gapic::Rest::TransportOperation.new response
343
+ result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
344
+
345
+ yield result, operation if block_given?
346
+ result
347
+ end
348
+
349
+ ##
350
+ # Baseline implementation for the test_iam_permissions REST call
351
+ #
352
+ # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
353
+ # A request object representing the call parameters. Required.
354
+ # @param options [::Gapic::CallOptions]
355
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
356
+ #
357
+ # @yield [result, operation] Access the result along with the TransportOperation object
358
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
359
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
360
+ #
361
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
362
+ # A result object deserialized from the server's reply
363
+ def test_iam_permissions request_pb, options = nil
364
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
365
+
366
+ verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb
367
+ query_string_params = if query_string_params.any?
368
+ query_string_params.to_h { |p| p.split("=", 2) }
369
+ else
370
+ {}
371
+ end
372
+
373
+ response = @client_stub.make_http_request(
374
+ verb,
375
+ uri: uri,
376
+ body: body || "",
377
+ params: query_string_params,
378
+ options: options
379
+ )
380
+ operation = ::Gapic::Rest::TransportOperation.new response
381
+ result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
382
+
383
+ yield result, operation if block_given?
384
+ result
385
+ end
386
+
387
+ ##
388
+ # Baseline implementation for the create_backup REST call
389
+ #
390
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest]
391
+ # A request object representing the call parameters. Required.
392
+ # @param options [::Gapic::CallOptions]
393
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
394
+ #
395
+ # @yield [result, operation] Access the result along with the TransportOperation object
396
+ # @yieldparam result [::Google::Longrunning::Operation]
397
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
398
+ #
399
+ # @return [::Google::Longrunning::Operation]
400
+ # A result object deserialized from the server's reply
401
+ def create_backup request_pb, options = nil
402
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
403
+
404
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_backup_request request_pb
405
+ query_string_params = if query_string_params.any?
406
+ query_string_params.to_h { |p| p.split("=", 2) }
407
+ else
408
+ {}
409
+ end
410
+
411
+ response = @client_stub.make_http_request(
412
+ verb,
413
+ uri: uri,
414
+ body: body || "",
415
+ params: query_string_params,
416
+ options: options
417
+ )
418
+ operation = ::Gapic::Rest::TransportOperation.new response
419
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
420
+
421
+ yield result, operation if block_given?
422
+ result
423
+ end
424
+
425
+ ##
426
+ # Baseline implementation for the copy_backup REST call
427
+ #
428
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest]
429
+ # A request object representing the call parameters. Required.
430
+ # @param options [::Gapic::CallOptions]
431
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
432
+ #
433
+ # @yield [result, operation] Access the result along with the TransportOperation object
434
+ # @yieldparam result [::Google::Longrunning::Operation]
435
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
436
+ #
437
+ # @return [::Google::Longrunning::Operation]
438
+ # A result object deserialized from the server's reply
439
+ def copy_backup request_pb, options = nil
440
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
441
+
442
+ verb, uri, query_string_params, body = ServiceStub.transcode_copy_backup_request request_pb
443
+ query_string_params = if query_string_params.any?
444
+ query_string_params.to_h { |p| p.split("=", 2) }
445
+ else
446
+ {}
447
+ end
448
+
449
+ response = @client_stub.make_http_request(
450
+ verb,
451
+ uri: uri,
452
+ body: body || "",
453
+ params: query_string_params,
454
+ options: options
455
+ )
456
+ operation = ::Gapic::Rest::TransportOperation.new response
457
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
458
+
459
+ yield result, operation if block_given?
460
+ result
461
+ end
462
+
463
+ ##
464
+ # Baseline implementation for the get_backup REST call
465
+ #
466
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest]
467
+ # A request object representing the call parameters. Required.
468
+ # @param options [::Gapic::CallOptions]
469
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
470
+ #
471
+ # @yield [result, operation] Access the result along with the TransportOperation object
472
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Backup]
473
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
474
+ #
475
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup]
476
+ # A result object deserialized from the server's reply
477
+ def get_backup request_pb, options = nil
478
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
479
+
480
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_request request_pb
481
+ query_string_params = if query_string_params.any?
482
+ query_string_params.to_h { |p| p.split("=", 2) }
483
+ else
484
+ {}
485
+ end
486
+
487
+ response = @client_stub.make_http_request(
488
+ verb,
489
+ uri: uri,
490
+ body: body || "",
491
+ params: query_string_params,
492
+ options: options
493
+ )
494
+ operation = ::Gapic::Rest::TransportOperation.new response
495
+ result = ::Google::Cloud::Spanner::Admin::Database::V1::Backup.decode_json response.body, ignore_unknown_fields: true
496
+
497
+ yield result, operation if block_given?
498
+ result
499
+ end
500
+
501
+ ##
502
+ # Baseline implementation for the update_backup REST call
503
+ #
504
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest]
505
+ # A request object representing the call parameters. Required.
506
+ # @param options [::Gapic::CallOptions]
507
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
508
+ #
509
+ # @yield [result, operation] Access the result along with the TransportOperation object
510
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Backup]
511
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
512
+ #
513
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup]
514
+ # A result object deserialized from the server's reply
515
+ def update_backup request_pb, options = nil
516
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
517
+
518
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_backup_request request_pb
519
+ query_string_params = if query_string_params.any?
520
+ query_string_params.to_h { |p| p.split("=", 2) }
521
+ else
522
+ {}
523
+ end
524
+
525
+ response = @client_stub.make_http_request(
526
+ verb,
527
+ uri: uri,
528
+ body: body || "",
529
+ params: query_string_params,
530
+ options: options
531
+ )
532
+ operation = ::Gapic::Rest::TransportOperation.new response
533
+ result = ::Google::Cloud::Spanner::Admin::Database::V1::Backup.decode_json response.body, ignore_unknown_fields: true
534
+
535
+ yield result, operation if block_given?
536
+ result
537
+ end
538
+
539
+ ##
540
+ # Baseline implementation for the delete_backup REST call
541
+ #
542
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest]
543
+ # A request object representing the call parameters. Required.
544
+ # @param options [::Gapic::CallOptions]
545
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
546
+ #
547
+ # @yield [result, operation] Access the result along with the TransportOperation object
548
+ # @yieldparam result [::Google::Protobuf::Empty]
549
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
550
+ #
551
+ # @return [::Google::Protobuf::Empty]
552
+ # A result object deserialized from the server's reply
553
+ def delete_backup request_pb, options = nil
554
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
555
+
556
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_request request_pb
557
+ query_string_params = if query_string_params.any?
558
+ query_string_params.to_h { |p| p.split("=", 2) }
559
+ else
560
+ {}
561
+ end
562
+
563
+ response = @client_stub.make_http_request(
564
+ verb,
565
+ uri: uri,
566
+ body: body || "",
567
+ params: query_string_params,
568
+ options: options
569
+ )
570
+ operation = ::Gapic::Rest::TransportOperation.new response
571
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
572
+
573
+ yield result, operation if block_given?
574
+ result
575
+ end
576
+
577
+ ##
578
+ # Baseline implementation for the list_backups REST call
579
+ #
580
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest]
581
+ # A request object representing the call parameters. Required.
582
+ # @param options [::Gapic::CallOptions]
583
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
584
+ #
585
+ # @yield [result, operation] Access the result along with the TransportOperation object
586
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse]
587
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
588
+ #
589
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse]
590
+ # A result object deserialized from the server's reply
591
+ def list_backups request_pb, options = nil
592
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
593
+
594
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_backups_request request_pb
595
+ query_string_params = if query_string_params.any?
596
+ query_string_params.to_h { |p| p.split("=", 2) }
597
+ else
598
+ {}
599
+ end
600
+
601
+ response = @client_stub.make_http_request(
602
+ verb,
603
+ uri: uri,
604
+ body: body || "",
605
+ params: query_string_params,
606
+ options: options
607
+ )
608
+ operation = ::Gapic::Rest::TransportOperation.new response
609
+ result = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse.decode_json response.body, ignore_unknown_fields: true
610
+
611
+ yield result, operation if block_given?
612
+ result
613
+ end
614
+
615
+ ##
616
+ # Baseline implementation for the restore_database REST call
617
+ #
618
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest]
619
+ # A request object representing the call parameters. Required.
620
+ # @param options [::Gapic::CallOptions]
621
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
622
+ #
623
+ # @yield [result, operation] Access the result along with the TransportOperation object
624
+ # @yieldparam result [::Google::Longrunning::Operation]
625
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
626
+ #
627
+ # @return [::Google::Longrunning::Operation]
628
+ # A result object deserialized from the server's reply
629
+ def restore_database request_pb, options = nil
630
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
631
+
632
+ verb, uri, query_string_params, body = ServiceStub.transcode_restore_database_request request_pb
633
+ query_string_params = if query_string_params.any?
634
+ query_string_params.to_h { |p| p.split("=", 2) }
635
+ else
636
+ {}
637
+ end
638
+
639
+ response = @client_stub.make_http_request(
640
+ verb,
641
+ uri: uri,
642
+ body: body || "",
643
+ params: query_string_params,
644
+ options: options
645
+ )
646
+ operation = ::Gapic::Rest::TransportOperation.new response
647
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
648
+
649
+ yield result, operation if block_given?
650
+ result
651
+ end
652
+
653
+ ##
654
+ # Baseline implementation for the list_database_operations REST call
655
+ #
656
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest]
657
+ # A request object representing the call parameters. Required.
658
+ # @param options [::Gapic::CallOptions]
659
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
660
+ #
661
+ # @yield [result, operation] Access the result along with the TransportOperation object
662
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse]
663
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
664
+ #
665
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse]
666
+ # A result object deserialized from the server's reply
667
+ def list_database_operations request_pb, options = nil
668
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
669
+
670
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_database_operations_request request_pb
671
+ query_string_params = if query_string_params.any?
672
+ query_string_params.to_h { |p| p.split("=", 2) }
673
+ else
674
+ {}
675
+ end
676
+
677
+ response = @client_stub.make_http_request(
678
+ verb,
679
+ uri: uri,
680
+ body: body || "",
681
+ params: query_string_params,
682
+ options: options
683
+ )
684
+ operation = ::Gapic::Rest::TransportOperation.new response
685
+ result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.decode_json response.body, ignore_unknown_fields: true
686
+
687
+ yield result, operation if block_given?
688
+ result
689
+ end
690
+
691
+ ##
692
+ # Baseline implementation for the list_backup_operations REST call
693
+ #
694
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest]
695
+ # A request object representing the call parameters. Required.
696
+ # @param options [::Gapic::CallOptions]
697
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
698
+ #
699
+ # @yield [result, operation] Access the result along with the TransportOperation object
700
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse]
701
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
702
+ #
703
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse]
704
+ # A result object deserialized from the server's reply
705
+ def list_backup_operations request_pb, options = nil
706
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
707
+
708
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_operations_request request_pb
709
+ query_string_params = if query_string_params.any?
710
+ query_string_params.to_h { |p| p.split("=", 2) }
711
+ else
712
+ {}
713
+ end
714
+
715
+ response = @client_stub.make_http_request(
716
+ verb,
717
+ uri: uri,
718
+ body: body || "",
719
+ params: query_string_params,
720
+ options: options
721
+ )
722
+ operation = ::Gapic::Rest::TransportOperation.new response
723
+ result = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse.decode_json response.body, ignore_unknown_fields: true
724
+
725
+ yield result, operation if block_given?
726
+ result
727
+ end
728
+
729
+ ##
730
+ # Baseline implementation for the list_database_roles REST call
731
+ #
732
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest]
733
+ # A request object representing the call parameters. Required.
734
+ # @param options [::Gapic::CallOptions]
735
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
736
+ #
737
+ # @yield [result, operation] Access the result along with the TransportOperation object
738
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse]
739
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
740
+ #
741
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse]
742
+ # A result object deserialized from the server's reply
743
+ def list_database_roles request_pb, options = nil
744
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
745
+
746
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_database_roles_request request_pb
747
+ query_string_params = if query_string_params.any?
748
+ query_string_params.to_h { |p| p.split("=", 2) }
749
+ else
750
+ {}
751
+ end
752
+
753
+ response = @client_stub.make_http_request(
754
+ verb,
755
+ uri: uri,
756
+ body: body || "",
757
+ params: query_string_params,
758
+ options: options
759
+ )
760
+ operation = ::Gapic::Rest::TransportOperation.new response
761
+ result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse.decode_json response.body, ignore_unknown_fields: true
762
+
763
+ yield result, operation if block_given?
764
+ result
765
+ end
766
+
767
+ ##
768
+ # @private
769
+ #
770
+ # GRPC transcoding helper method for the list_databases REST call
771
+ #
772
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest]
773
+ # A request object representing the call parameters. Required.
774
+ # @return [Array(String, [String, nil], Hash{String => String})]
775
+ # Uri, Body, Query string parameters
776
+ def self.transcode_list_databases_request request_pb
777
+ transcoder = Gapic::Rest::GrpcTranscoder.new
778
+ .with_bindings(
779
+ uri_method: :get,
780
+ uri_template: "/v1/{parent}/databases",
781
+ matches: [
782
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
783
+ ]
784
+ )
785
+ transcoder.transcode request_pb
786
+ end
787
+
788
+ ##
789
+ # @private
790
+ #
791
+ # GRPC transcoding helper method for the create_database REST call
792
+ #
793
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest]
794
+ # A request object representing the call parameters. Required.
795
+ # @return [Array(String, [String, nil], Hash{String => String})]
796
+ # Uri, Body, Query string parameters
797
+ def self.transcode_create_database_request request_pb
798
+ transcoder = Gapic::Rest::GrpcTranscoder.new
799
+ .with_bindings(
800
+ uri_method: :post,
801
+ uri_template: "/v1/{parent}/databases",
802
+ body: "*",
803
+ matches: [
804
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
805
+ ]
806
+ )
807
+ transcoder.transcode request_pb
808
+ end
809
+
810
+ ##
811
+ # @private
812
+ #
813
+ # GRPC transcoding helper method for the get_database REST call
814
+ #
815
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest]
816
+ # A request object representing the call parameters. Required.
817
+ # @return [Array(String, [String, nil], Hash{String => String})]
818
+ # Uri, Body, Query string parameters
819
+ def self.transcode_get_database_request request_pb
820
+ transcoder = Gapic::Rest::GrpcTranscoder.new
821
+ .with_bindings(
822
+ uri_method: :get,
823
+ uri_template: "/v1/{name}",
824
+ matches: [
825
+ ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
826
+ ]
827
+ )
828
+ transcoder.transcode request_pb
829
+ end
830
+
831
+ ##
832
+ # @private
833
+ #
834
+ # GRPC transcoding helper method for the update_database_ddl REST call
835
+ #
836
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest]
837
+ # A request object representing the call parameters. Required.
838
+ # @return [Array(String, [String, nil], Hash{String => String})]
839
+ # Uri, Body, Query string parameters
840
+ def self.transcode_update_database_ddl_request request_pb
841
+ transcoder = Gapic::Rest::GrpcTranscoder.new
842
+ .with_bindings(
843
+ uri_method: :patch,
844
+ uri_template: "/v1/{database}/ddl",
845
+ body: "*",
846
+ matches: [
847
+ ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
848
+ ]
849
+ )
850
+ transcoder.transcode request_pb
851
+ end
852
+
853
+ ##
854
+ # @private
855
+ #
856
+ # GRPC transcoding helper method for the drop_database REST call
857
+ #
858
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest]
859
+ # A request object representing the call parameters. Required.
860
+ # @return [Array(String, [String, nil], Hash{String => String})]
861
+ # Uri, Body, Query string parameters
862
+ def self.transcode_drop_database_request request_pb
863
+ transcoder = Gapic::Rest::GrpcTranscoder.new
864
+ .with_bindings(
865
+ uri_method: :delete,
866
+ uri_template: "/v1/{database}",
867
+ matches: [
868
+ ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
869
+ ]
870
+ )
871
+ transcoder.transcode request_pb
872
+ end
873
+
874
+ ##
875
+ # @private
876
+ #
877
+ # GRPC transcoding helper method for the get_database_ddl REST call
878
+ #
879
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest]
880
+ # A request object representing the call parameters. Required.
881
+ # @return [Array(String, [String, nil], Hash{String => String})]
882
+ # Uri, Body, Query string parameters
883
+ def self.transcode_get_database_ddl_request request_pb
884
+ transcoder = Gapic::Rest::GrpcTranscoder.new
885
+ .with_bindings(
886
+ uri_method: :get,
887
+ uri_template: "/v1/{database}/ddl",
888
+ matches: [
889
+ ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
890
+ ]
891
+ )
892
+ transcoder.transcode request_pb
893
+ end
894
+
895
+ ##
896
+ # @private
897
+ #
898
+ # GRPC transcoding helper method for the set_iam_policy REST call
899
+ #
900
+ # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
901
+ # A request object representing the call parameters. Required.
902
+ # @return [Array(String, [String, nil], Hash{String => String})]
903
+ # Uri, Body, Query string parameters
904
+ def self.transcode_set_iam_policy_request request_pb
905
+ transcoder = Gapic::Rest::GrpcTranscoder.new
906
+ .with_bindings(
907
+ uri_method: :post,
908
+ uri_template: "/v1/{resource}:setIamPolicy",
909
+ body: "*",
910
+ matches: [
911
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
912
+ ]
913
+ )
914
+ .with_bindings(
915
+ uri_method: :post,
916
+ uri_template: "/v1/{resource}:setIamPolicy",
917
+ body: "*",
918
+ matches: [
919
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false]
920
+ ]
921
+ )
922
+ transcoder.transcode request_pb
923
+ end
924
+
925
+ ##
926
+ # @private
927
+ #
928
+ # GRPC transcoding helper method for the get_iam_policy REST call
929
+ #
930
+ # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
931
+ # A request object representing the call parameters. Required.
932
+ # @return [Array(String, [String, nil], Hash{String => String})]
933
+ # Uri, Body, Query string parameters
934
+ def self.transcode_get_iam_policy_request request_pb
935
+ transcoder = Gapic::Rest::GrpcTranscoder.new
936
+ .with_bindings(
937
+ uri_method: :post,
938
+ uri_template: "/v1/{resource}:getIamPolicy",
939
+ body: "*",
940
+ matches: [
941
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
942
+ ]
943
+ )
944
+ .with_bindings(
945
+ uri_method: :post,
946
+ uri_template: "/v1/{resource}:getIamPolicy",
947
+ body: "*",
948
+ matches: [
949
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false]
950
+ ]
951
+ )
952
+ transcoder.transcode request_pb
953
+ end
954
+
955
+ ##
956
+ # @private
957
+ #
958
+ # GRPC transcoding helper method for the test_iam_permissions REST call
959
+ #
960
+ # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
961
+ # A request object representing the call parameters. Required.
962
+ # @return [Array(String, [String, nil], Hash{String => String})]
963
+ # Uri, Body, Query string parameters
964
+ def self.transcode_test_iam_permissions_request request_pb
965
+ transcoder = Gapic::Rest::GrpcTranscoder.new
966
+ .with_bindings(
967
+ uri_method: :post,
968
+ uri_template: "/v1/{resource}:testIamPermissions",
969
+ body: "*",
970
+ matches: [
971
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
972
+ ]
973
+ )
974
+ .with_bindings(
975
+ uri_method: :post,
976
+ uri_template: "/v1/{resource}:testIamPermissions",
977
+ body: "*",
978
+ matches: [
979
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false]
980
+ ]
981
+ )
982
+ .with_bindings(
983
+ uri_method: :post,
984
+ uri_template: "/v1/{resource}:testIamPermissions",
985
+ body: "*",
986
+ matches: [
987
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/databaseRoles/[^/]+/?$}, false]
988
+ ]
989
+ )
990
+ transcoder.transcode request_pb
991
+ end
992
+
993
+ ##
994
+ # @private
995
+ #
996
+ # GRPC transcoding helper method for the create_backup REST call
997
+ #
998
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest]
999
+ # A request object representing the call parameters. Required.
1000
+ # @return [Array(String, [String, nil], Hash{String => String})]
1001
+ # Uri, Body, Query string parameters
1002
+ def self.transcode_create_backup_request request_pb
1003
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1004
+ .with_bindings(
1005
+ uri_method: :post,
1006
+ uri_template: "/v1/{parent}/backups",
1007
+ body: "backup",
1008
+ matches: [
1009
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
1010
+ ]
1011
+ )
1012
+ transcoder.transcode request_pb
1013
+ end
1014
+
1015
+ ##
1016
+ # @private
1017
+ #
1018
+ # GRPC transcoding helper method for the copy_backup REST call
1019
+ #
1020
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest]
1021
+ # A request object representing the call parameters. Required.
1022
+ # @return [Array(String, [String, nil], Hash{String => String})]
1023
+ # Uri, Body, Query string parameters
1024
+ def self.transcode_copy_backup_request request_pb
1025
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1026
+ .with_bindings(
1027
+ uri_method: :post,
1028
+ uri_template: "/v1/{parent}/backups:copy",
1029
+ body: "*",
1030
+ matches: [
1031
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
1032
+ ]
1033
+ )
1034
+ transcoder.transcode request_pb
1035
+ end
1036
+
1037
+ ##
1038
+ # @private
1039
+ #
1040
+ # GRPC transcoding helper method for the get_backup REST call
1041
+ #
1042
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest]
1043
+ # A request object representing the call parameters. Required.
1044
+ # @return [Array(String, [String, nil], Hash{String => String})]
1045
+ # Uri, Body, Query string parameters
1046
+ def self.transcode_get_backup_request request_pb
1047
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1048
+ .with_bindings(
1049
+ uri_method: :get,
1050
+ uri_template: "/v1/{name}",
1051
+ matches: [
1052
+ ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false]
1053
+ ]
1054
+ )
1055
+ transcoder.transcode request_pb
1056
+ end
1057
+
1058
+ ##
1059
+ # @private
1060
+ #
1061
+ # GRPC transcoding helper method for the update_backup REST call
1062
+ #
1063
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest]
1064
+ # A request object representing the call parameters. Required.
1065
+ # @return [Array(String, [String, nil], Hash{String => String})]
1066
+ # Uri, Body, Query string parameters
1067
+ def self.transcode_update_backup_request request_pb
1068
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1069
+ .with_bindings(
1070
+ uri_method: :patch,
1071
+ uri_template: "/v1/{backup.name}",
1072
+ body: "backup",
1073
+ matches: [
1074
+ ["backup.name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false]
1075
+ ]
1076
+ )
1077
+ transcoder.transcode request_pb
1078
+ end
1079
+
1080
+ ##
1081
+ # @private
1082
+ #
1083
+ # GRPC transcoding helper method for the delete_backup REST call
1084
+ #
1085
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest]
1086
+ # A request object representing the call parameters. Required.
1087
+ # @return [Array(String, [String, nil], Hash{String => String})]
1088
+ # Uri, Body, Query string parameters
1089
+ def self.transcode_delete_backup_request request_pb
1090
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1091
+ .with_bindings(
1092
+ uri_method: :delete,
1093
+ uri_template: "/v1/{name}",
1094
+ matches: [
1095
+ ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false]
1096
+ ]
1097
+ )
1098
+ transcoder.transcode request_pb
1099
+ end
1100
+
1101
+ ##
1102
+ # @private
1103
+ #
1104
+ # GRPC transcoding helper method for the list_backups REST call
1105
+ #
1106
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest]
1107
+ # A request object representing the call parameters. Required.
1108
+ # @return [Array(String, [String, nil], Hash{String => String})]
1109
+ # Uri, Body, Query string parameters
1110
+ def self.transcode_list_backups_request request_pb
1111
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1112
+ .with_bindings(
1113
+ uri_method: :get,
1114
+ uri_template: "/v1/{parent}/backups",
1115
+ matches: [
1116
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
1117
+ ]
1118
+ )
1119
+ transcoder.transcode request_pb
1120
+ end
1121
+
1122
+ ##
1123
+ # @private
1124
+ #
1125
+ # GRPC transcoding helper method for the restore_database REST call
1126
+ #
1127
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest]
1128
+ # A request object representing the call parameters. Required.
1129
+ # @return [Array(String, [String, nil], Hash{String => String})]
1130
+ # Uri, Body, Query string parameters
1131
+ def self.transcode_restore_database_request request_pb
1132
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1133
+ .with_bindings(
1134
+ uri_method: :post,
1135
+ uri_template: "/v1/{parent}/databases:restore",
1136
+ body: "*",
1137
+ matches: [
1138
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
1139
+ ]
1140
+ )
1141
+ transcoder.transcode request_pb
1142
+ end
1143
+
1144
+ ##
1145
+ # @private
1146
+ #
1147
+ # GRPC transcoding helper method for the list_database_operations REST call
1148
+ #
1149
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest]
1150
+ # A request object representing the call parameters. Required.
1151
+ # @return [Array(String, [String, nil], Hash{String => String})]
1152
+ # Uri, Body, Query string parameters
1153
+ def self.transcode_list_database_operations_request request_pb
1154
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1155
+ .with_bindings(
1156
+ uri_method: :get,
1157
+ uri_template: "/v1/{parent}/databaseOperations",
1158
+ matches: [
1159
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
1160
+ ]
1161
+ )
1162
+ transcoder.transcode request_pb
1163
+ end
1164
+
1165
+ ##
1166
+ # @private
1167
+ #
1168
+ # GRPC transcoding helper method for the list_backup_operations REST call
1169
+ #
1170
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest]
1171
+ # A request object representing the call parameters. Required.
1172
+ # @return [Array(String, [String, nil], Hash{String => String})]
1173
+ # Uri, Body, Query string parameters
1174
+ def self.transcode_list_backup_operations_request request_pb
1175
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1176
+ .with_bindings(
1177
+ uri_method: :get,
1178
+ uri_template: "/v1/{parent}/backupOperations",
1179
+ matches: [
1180
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
1181
+ ]
1182
+ )
1183
+ transcoder.transcode request_pb
1184
+ end
1185
+
1186
+ ##
1187
+ # @private
1188
+ #
1189
+ # GRPC transcoding helper method for the list_database_roles REST call
1190
+ #
1191
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest]
1192
+ # A request object representing the call parameters. Required.
1193
+ # @return [Array(String, [String, nil], Hash{String => String})]
1194
+ # Uri, Body, Query string parameters
1195
+ def self.transcode_list_database_roles_request request_pb
1196
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1197
+ .with_bindings(
1198
+ uri_method: :get,
1199
+ uri_template: "/v1/{parent}/databaseRoles",
1200
+ matches: [
1201
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
1202
+ ]
1203
+ )
1204
+ transcoder.transcode request_pb
1205
+ end
1206
+ end
1207
+ end
1208
+ end
1209
+ end
1210
+ end
1211
+ end
1212
+ end
1213
+ end
1214
+ end