google-cloud-spanner-admin-database-v1 0.11.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1274 @@
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 REST call
161
+ #
162
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest]
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 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_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 update_database_ddl REST call
199
+ #
200
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest]
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::Longrunning::Operation]
207
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
208
+ #
209
+ # @return [::Google::Longrunning::Operation]
210
+ # A result object deserialized from the server's reply
211
+ def update_database_ddl 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_update_database_ddl_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::Longrunning::Operation.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 drop_database REST call
237
+ #
238
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest]
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::Protobuf::Empty]
245
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
246
+ #
247
+ # @return [::Google::Protobuf::Empty]
248
+ # A result object deserialized from the server's reply
249
+ def drop_database 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_drop_database_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::Protobuf::Empty.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 get_database_ddl REST call
275
+ #
276
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest]
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::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse]
283
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
284
+ #
285
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse]
286
+ # A result object deserialized from the server's reply
287
+ def get_database_ddl 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_get_database_ddl_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::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse.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 set_iam_policy REST call
313
+ #
314
+ # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
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 set_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_set_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 get_iam_policy REST call
351
+ #
352
+ # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
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::Policy]
359
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
360
+ #
361
+ # @return [::Google::Iam::V1::Policy]
362
+ # A result object deserialized from the server's reply
363
+ def get_iam_policy 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_get_iam_policy_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::Policy.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 test_iam_permissions REST call
389
+ #
390
+ # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
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::Iam::V1::TestIamPermissionsResponse]
397
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
398
+ #
399
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
400
+ # A result object deserialized from the server's reply
401
+ def test_iam_permissions 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_test_iam_permissions_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::Iam::V1::TestIamPermissionsResponse.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 create_backup REST call
427
+ #
428
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest]
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 create_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_create_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 copy_backup REST call
465
+ #
466
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest]
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::Longrunning::Operation]
473
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
474
+ #
475
+ # @return [::Google::Longrunning::Operation]
476
+ # A result object deserialized from the server's reply
477
+ def copy_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_copy_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::Longrunning::Operation.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 get_backup REST call
503
+ #
504
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest]
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 get_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_get_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 update_backup REST call
541
+ #
542
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest]
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::Cloud::Spanner::Admin::Database::V1::Backup]
549
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
550
+ #
551
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup]
552
+ # A result object deserialized from the server's reply
553
+ def update_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_update_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::Cloud::Spanner::Admin::Database::V1::Backup.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 delete_backup REST call
579
+ #
580
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest]
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::Protobuf::Empty]
587
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
588
+ #
589
+ # @return [::Google::Protobuf::Empty]
590
+ # A result object deserialized from the server's reply
591
+ def delete_backup 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_delete_backup_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::Protobuf::Empty.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 list_backups REST call
617
+ #
618
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest]
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::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse]
625
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
626
+ #
627
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse]
628
+ # A result object deserialized from the server's reply
629
+ def list_backups 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_list_backups_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::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse.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 restore_database REST call
655
+ #
656
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest]
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::Longrunning::Operation]
663
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
664
+ #
665
+ # @return [::Google::Longrunning::Operation]
666
+ # A result object deserialized from the server's reply
667
+ def restore_database 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_restore_database_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::Longrunning::Operation.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_database_operations REST call
693
+ #
694
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest]
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::ListDatabaseOperationsResponse]
701
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
702
+ #
703
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse]
704
+ # A result object deserialized from the server's reply
705
+ def list_database_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_database_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::ListDatabaseOperationsResponse.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_backup_operations REST call
731
+ #
732
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest]
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::ListBackupOperationsResponse]
739
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
740
+ #
741
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse]
742
+ # A result object deserialized from the server's reply
743
+ def list_backup_operations 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_backup_operations_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::ListBackupOperationsResponse.decode_json response.body, ignore_unknown_fields: true
762
+
763
+ yield result, operation if block_given?
764
+ result
765
+ end
766
+
767
+ ##
768
+ # Baseline implementation for the list_database_roles REST call
769
+ #
770
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest]
771
+ # A request object representing the call parameters. Required.
772
+ # @param options [::Gapic::CallOptions]
773
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
774
+ #
775
+ # @yield [result, operation] Access the result along with the TransportOperation object
776
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse]
777
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
778
+ #
779
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse]
780
+ # A result object deserialized from the server's reply
781
+ def list_database_roles request_pb, options = nil
782
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
783
+
784
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_database_roles_request request_pb
785
+ query_string_params = if query_string_params.any?
786
+ query_string_params.to_h { |p| p.split("=", 2) }
787
+ else
788
+ {}
789
+ end
790
+
791
+ response = @client_stub.make_http_request(
792
+ verb,
793
+ uri: uri,
794
+ body: body || "",
795
+ params: query_string_params,
796
+ options: options
797
+ )
798
+ operation = ::Gapic::Rest::TransportOperation.new response
799
+ result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse.decode_json response.body, ignore_unknown_fields: true
800
+
801
+ yield result, operation if block_given?
802
+ result
803
+ end
804
+
805
+ ##
806
+ # @private
807
+ #
808
+ # GRPC transcoding helper method for the list_databases REST call
809
+ #
810
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest]
811
+ # A request object representing the call parameters. Required.
812
+ # @return [Array(String, [String, nil], Hash{String => String})]
813
+ # Uri, Body, Query string parameters
814
+ def self.transcode_list_databases_request request_pb
815
+ transcoder = Gapic::Rest::GrpcTranscoder.new
816
+ .with_bindings(
817
+ uri_method: :get,
818
+ uri_template: "/v1/{parent}/databases",
819
+ matches: [
820
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
821
+ ]
822
+ )
823
+ transcoder.transcode request_pb
824
+ end
825
+
826
+ ##
827
+ # @private
828
+ #
829
+ # GRPC transcoding helper method for the create_database REST call
830
+ #
831
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest]
832
+ # A request object representing the call parameters. Required.
833
+ # @return [Array(String, [String, nil], Hash{String => String})]
834
+ # Uri, Body, Query string parameters
835
+ def self.transcode_create_database_request request_pb
836
+ transcoder = Gapic::Rest::GrpcTranscoder.new
837
+ .with_bindings(
838
+ uri_method: :post,
839
+ uri_template: "/v1/{parent}/databases",
840
+ body: "*",
841
+ matches: [
842
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
843
+ ]
844
+ )
845
+ transcoder.transcode request_pb
846
+ end
847
+
848
+ ##
849
+ # @private
850
+ #
851
+ # GRPC transcoding helper method for the get_database REST call
852
+ #
853
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest]
854
+ # A request object representing the call parameters. Required.
855
+ # @return [Array(String, [String, nil], Hash{String => String})]
856
+ # Uri, Body, Query string parameters
857
+ def self.transcode_get_database_request request_pb
858
+ transcoder = Gapic::Rest::GrpcTranscoder.new
859
+ .with_bindings(
860
+ uri_method: :get,
861
+ uri_template: "/v1/{name}",
862
+ matches: [
863
+ ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
864
+ ]
865
+ )
866
+ transcoder.transcode request_pb
867
+ end
868
+
869
+ ##
870
+ # @private
871
+ #
872
+ # GRPC transcoding helper method for the update_database REST call
873
+ #
874
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest]
875
+ # A request object representing the call parameters. Required.
876
+ # @return [Array(String, [String, nil], Hash{String => String})]
877
+ # Uri, Body, Query string parameters
878
+ def self.transcode_update_database_request request_pb
879
+ transcoder = Gapic::Rest::GrpcTranscoder.new
880
+ .with_bindings(
881
+ uri_method: :patch,
882
+ uri_template: "/v1/{database.name}",
883
+ body: "database",
884
+ matches: [
885
+ ["database.name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
886
+ ]
887
+ )
888
+ transcoder.transcode request_pb
889
+ end
890
+
891
+ ##
892
+ # @private
893
+ #
894
+ # GRPC transcoding helper method for the update_database_ddl REST call
895
+ #
896
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest]
897
+ # A request object representing the call parameters. Required.
898
+ # @return [Array(String, [String, nil], Hash{String => String})]
899
+ # Uri, Body, Query string parameters
900
+ def self.transcode_update_database_ddl_request request_pb
901
+ transcoder = Gapic::Rest::GrpcTranscoder.new
902
+ .with_bindings(
903
+ uri_method: :patch,
904
+ uri_template: "/v1/{database}/ddl",
905
+ body: "*",
906
+ matches: [
907
+ ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
908
+ ]
909
+ )
910
+ transcoder.transcode request_pb
911
+ end
912
+
913
+ ##
914
+ # @private
915
+ #
916
+ # GRPC transcoding helper method for the drop_database REST call
917
+ #
918
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest]
919
+ # A request object representing the call parameters. Required.
920
+ # @return [Array(String, [String, nil], Hash{String => String})]
921
+ # Uri, Body, Query string parameters
922
+ def self.transcode_drop_database_request request_pb
923
+ transcoder = Gapic::Rest::GrpcTranscoder.new
924
+ .with_bindings(
925
+ uri_method: :delete,
926
+ uri_template: "/v1/{database}",
927
+ matches: [
928
+ ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
929
+ ]
930
+ )
931
+ transcoder.transcode request_pb
932
+ end
933
+
934
+ ##
935
+ # @private
936
+ #
937
+ # GRPC transcoding helper method for the get_database_ddl REST call
938
+ #
939
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest]
940
+ # A request object representing the call parameters. Required.
941
+ # @return [Array(String, [String, nil], Hash{String => String})]
942
+ # Uri, Body, Query string parameters
943
+ def self.transcode_get_database_ddl_request request_pb
944
+ transcoder = Gapic::Rest::GrpcTranscoder.new
945
+ .with_bindings(
946
+ uri_method: :get,
947
+ uri_template: "/v1/{database}/ddl",
948
+ matches: [
949
+ ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
950
+ ]
951
+ )
952
+ transcoder.transcode request_pb
953
+ end
954
+
955
+ ##
956
+ # @private
957
+ #
958
+ # GRPC transcoding helper method for the set_iam_policy REST call
959
+ #
960
+ # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
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_set_iam_policy_request request_pb
965
+ transcoder = Gapic::Rest::GrpcTranscoder.new
966
+ .with_bindings(
967
+ uri_method: :post,
968
+ uri_template: "/v1/{resource}:setIamPolicy",
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}:setIamPolicy",
977
+ body: "*",
978
+ matches: [
979
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false]
980
+ ]
981
+ )
982
+ transcoder.transcode request_pb
983
+ end
984
+
985
+ ##
986
+ # @private
987
+ #
988
+ # GRPC transcoding helper method for the get_iam_policy REST call
989
+ #
990
+ # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
991
+ # A request object representing the call parameters. Required.
992
+ # @return [Array(String, [String, nil], Hash{String => String})]
993
+ # Uri, Body, Query string parameters
994
+ def self.transcode_get_iam_policy_request request_pb
995
+ transcoder = Gapic::Rest::GrpcTranscoder.new
996
+ .with_bindings(
997
+ uri_method: :post,
998
+ uri_template: "/v1/{resource}:getIamPolicy",
999
+ body: "*",
1000
+ matches: [
1001
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
1002
+ ]
1003
+ )
1004
+ .with_bindings(
1005
+ uri_method: :post,
1006
+ uri_template: "/v1/{resource}:getIamPolicy",
1007
+ body: "*",
1008
+ matches: [
1009
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false]
1010
+ ]
1011
+ )
1012
+ transcoder.transcode request_pb
1013
+ end
1014
+
1015
+ ##
1016
+ # @private
1017
+ #
1018
+ # GRPC transcoding helper method for the test_iam_permissions REST call
1019
+ #
1020
+ # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
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_test_iam_permissions_request request_pb
1025
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1026
+ .with_bindings(
1027
+ uri_method: :post,
1028
+ uri_template: "/v1/{resource}:testIamPermissions",
1029
+ body: "*",
1030
+ matches: [
1031
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
1032
+ ]
1033
+ )
1034
+ .with_bindings(
1035
+ uri_method: :post,
1036
+ uri_template: "/v1/{resource}:testIamPermissions",
1037
+ body: "*",
1038
+ matches: [
1039
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false]
1040
+ ]
1041
+ )
1042
+ .with_bindings(
1043
+ uri_method: :post,
1044
+ uri_template: "/v1/{resource}:testIamPermissions",
1045
+ body: "*",
1046
+ matches: [
1047
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/databaseRoles/[^/]+/?$}, false]
1048
+ ]
1049
+ )
1050
+ transcoder.transcode request_pb
1051
+ end
1052
+
1053
+ ##
1054
+ # @private
1055
+ #
1056
+ # GRPC transcoding helper method for the create_backup REST call
1057
+ #
1058
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest]
1059
+ # A request object representing the call parameters. Required.
1060
+ # @return [Array(String, [String, nil], Hash{String => String})]
1061
+ # Uri, Body, Query string parameters
1062
+ def self.transcode_create_backup_request request_pb
1063
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1064
+ .with_bindings(
1065
+ uri_method: :post,
1066
+ uri_template: "/v1/{parent}/backups",
1067
+ body: "backup",
1068
+ matches: [
1069
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
1070
+ ]
1071
+ )
1072
+ transcoder.transcode request_pb
1073
+ end
1074
+
1075
+ ##
1076
+ # @private
1077
+ #
1078
+ # GRPC transcoding helper method for the copy_backup REST call
1079
+ #
1080
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest]
1081
+ # A request object representing the call parameters. Required.
1082
+ # @return [Array(String, [String, nil], Hash{String => String})]
1083
+ # Uri, Body, Query string parameters
1084
+ def self.transcode_copy_backup_request request_pb
1085
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1086
+ .with_bindings(
1087
+ uri_method: :post,
1088
+ uri_template: "/v1/{parent}/backups:copy",
1089
+ body: "*",
1090
+ matches: [
1091
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
1092
+ ]
1093
+ )
1094
+ transcoder.transcode request_pb
1095
+ end
1096
+
1097
+ ##
1098
+ # @private
1099
+ #
1100
+ # GRPC transcoding helper method for the get_backup REST call
1101
+ #
1102
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest]
1103
+ # A request object representing the call parameters. Required.
1104
+ # @return [Array(String, [String, nil], Hash{String => String})]
1105
+ # Uri, Body, Query string parameters
1106
+ def self.transcode_get_backup_request request_pb
1107
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1108
+ .with_bindings(
1109
+ uri_method: :get,
1110
+ uri_template: "/v1/{name}",
1111
+ matches: [
1112
+ ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false]
1113
+ ]
1114
+ )
1115
+ transcoder.transcode request_pb
1116
+ end
1117
+
1118
+ ##
1119
+ # @private
1120
+ #
1121
+ # GRPC transcoding helper method for the update_backup REST call
1122
+ #
1123
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest]
1124
+ # A request object representing the call parameters. Required.
1125
+ # @return [Array(String, [String, nil], Hash{String => String})]
1126
+ # Uri, Body, Query string parameters
1127
+ def self.transcode_update_backup_request request_pb
1128
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1129
+ .with_bindings(
1130
+ uri_method: :patch,
1131
+ uri_template: "/v1/{backup.name}",
1132
+ body: "backup",
1133
+ matches: [
1134
+ ["backup.name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false]
1135
+ ]
1136
+ )
1137
+ transcoder.transcode request_pb
1138
+ end
1139
+
1140
+ ##
1141
+ # @private
1142
+ #
1143
+ # GRPC transcoding helper method for the delete_backup REST call
1144
+ #
1145
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest]
1146
+ # A request object representing the call parameters. Required.
1147
+ # @return [Array(String, [String, nil], Hash{String => String})]
1148
+ # Uri, Body, Query string parameters
1149
+ def self.transcode_delete_backup_request request_pb
1150
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1151
+ .with_bindings(
1152
+ uri_method: :delete,
1153
+ uri_template: "/v1/{name}",
1154
+ matches: [
1155
+ ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false]
1156
+ ]
1157
+ )
1158
+ transcoder.transcode request_pb
1159
+ end
1160
+
1161
+ ##
1162
+ # @private
1163
+ #
1164
+ # GRPC transcoding helper method for the list_backups REST call
1165
+ #
1166
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest]
1167
+ # A request object representing the call parameters. Required.
1168
+ # @return [Array(String, [String, nil], Hash{String => String})]
1169
+ # Uri, Body, Query string parameters
1170
+ def self.transcode_list_backups_request request_pb
1171
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1172
+ .with_bindings(
1173
+ uri_method: :get,
1174
+ uri_template: "/v1/{parent}/backups",
1175
+ matches: [
1176
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
1177
+ ]
1178
+ )
1179
+ transcoder.transcode request_pb
1180
+ end
1181
+
1182
+ ##
1183
+ # @private
1184
+ #
1185
+ # GRPC transcoding helper method for the restore_database REST call
1186
+ #
1187
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest]
1188
+ # A request object representing the call parameters. Required.
1189
+ # @return [Array(String, [String, nil], Hash{String => String})]
1190
+ # Uri, Body, Query string parameters
1191
+ def self.transcode_restore_database_request request_pb
1192
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1193
+ .with_bindings(
1194
+ uri_method: :post,
1195
+ uri_template: "/v1/{parent}/databases:restore",
1196
+ body: "*",
1197
+ matches: [
1198
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
1199
+ ]
1200
+ )
1201
+ transcoder.transcode request_pb
1202
+ end
1203
+
1204
+ ##
1205
+ # @private
1206
+ #
1207
+ # GRPC transcoding helper method for the list_database_operations REST call
1208
+ #
1209
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest]
1210
+ # A request object representing the call parameters. Required.
1211
+ # @return [Array(String, [String, nil], Hash{String => String})]
1212
+ # Uri, Body, Query string parameters
1213
+ def self.transcode_list_database_operations_request request_pb
1214
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1215
+ .with_bindings(
1216
+ uri_method: :get,
1217
+ uri_template: "/v1/{parent}/databaseOperations",
1218
+ matches: [
1219
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
1220
+ ]
1221
+ )
1222
+ transcoder.transcode request_pb
1223
+ end
1224
+
1225
+ ##
1226
+ # @private
1227
+ #
1228
+ # GRPC transcoding helper method for the list_backup_operations REST call
1229
+ #
1230
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest]
1231
+ # A request object representing the call parameters. Required.
1232
+ # @return [Array(String, [String, nil], Hash{String => String})]
1233
+ # Uri, Body, Query string parameters
1234
+ def self.transcode_list_backup_operations_request request_pb
1235
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1236
+ .with_bindings(
1237
+ uri_method: :get,
1238
+ uri_template: "/v1/{parent}/backupOperations",
1239
+ matches: [
1240
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
1241
+ ]
1242
+ )
1243
+ transcoder.transcode request_pb
1244
+ end
1245
+
1246
+ ##
1247
+ # @private
1248
+ #
1249
+ # GRPC transcoding helper method for the list_database_roles REST call
1250
+ #
1251
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest]
1252
+ # A request object representing the call parameters. Required.
1253
+ # @return [Array(String, [String, nil], Hash{String => String})]
1254
+ # Uri, Body, Query string parameters
1255
+ def self.transcode_list_database_roles_request request_pb
1256
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1257
+ .with_bindings(
1258
+ uri_method: :get,
1259
+ uri_template: "/v1/{parent}/databaseRoles",
1260
+ matches: [
1261
+ ["parent", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
1262
+ ]
1263
+ )
1264
+ transcoder.transcode request_pb
1265
+ end
1266
+ end
1267
+ end
1268
+ end
1269
+ end
1270
+ end
1271
+ end
1272
+ end
1273
+ end
1274
+ end