google-cloud-spanner-admin-instance-v1 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,885 @@
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/instance/v1/spanner_instance_admin_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Spanner
24
+ module Admin
25
+ module Instance
26
+ module V1
27
+ module InstanceAdmin
28
+ module Rest
29
+ ##
30
+ # REST service stub for the InstanceAdmin 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_instance_configs REST call
47
+ #
48
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest]
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::Instance::V1::ListInstanceConfigsResponse]
55
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
56
+ #
57
+ # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse]
58
+ # A result object deserialized from the server's reply
59
+ def list_instance_configs 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_instance_configs_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::Instance::V1::ListInstanceConfigsResponse.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 get_instance_config REST call
85
+ #
86
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest]
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::Cloud::Spanner::Admin::Instance::V1::InstanceConfig]
93
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
94
+ #
95
+ # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig]
96
+ # A result object deserialized from the server's reply
97
+ def get_instance_config 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_get_instance_config_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::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.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 create_instance_config REST call
123
+ #
124
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest]
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::Longrunning::Operation]
131
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
132
+ #
133
+ # @return [::Google::Longrunning::Operation]
134
+ # A result object deserialized from the server's reply
135
+ def create_instance_config 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_create_instance_config_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::Longrunning::Operation.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_instance_config REST call
161
+ #
162
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest]
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_instance_config 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_instance_config_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 delete_instance_config REST call
199
+ #
200
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest]
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 delete_instance_config 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_delete_instance_config_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 list_instance_config_operations REST call
237
+ #
238
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest]
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::Instance::V1::ListInstanceConfigOperationsResponse]
245
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
246
+ #
247
+ # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse]
248
+ # A result object deserialized from the server's reply
249
+ def list_instance_config_operations 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_list_instance_config_operations_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::Instance::V1::ListInstanceConfigOperationsResponse.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 list_instances REST call
275
+ #
276
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest]
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::Instance::V1::ListInstancesResponse]
283
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
284
+ #
285
+ # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse]
286
+ # A result object deserialized from the server's reply
287
+ def list_instances 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_list_instances_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::Instance::V1::ListInstancesResponse.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_instance REST call
313
+ #
314
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest]
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::Cloud::Spanner::Admin::Instance::V1::Instance]
321
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
322
+ #
323
+ # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance]
324
+ # A result object deserialized from the server's reply
325
+ def get_instance 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_instance_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::Cloud::Spanner::Admin::Instance::V1::Instance.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 create_instance REST call
351
+ #
352
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest]
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::Longrunning::Operation]
359
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
360
+ #
361
+ # @return [::Google::Longrunning::Operation]
362
+ # A result object deserialized from the server's reply
363
+ def create_instance 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_create_instance_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::Longrunning::Operation.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 update_instance REST call
389
+ #
390
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest]
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 update_instance 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_update_instance_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 delete_instance REST call
427
+ #
428
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest]
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::Protobuf::Empty]
435
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
436
+ #
437
+ # @return [::Google::Protobuf::Empty]
438
+ # A result object deserialized from the server's reply
439
+ def delete_instance 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_delete_instance_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::Protobuf::Empty.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 set_iam_policy REST call
465
+ #
466
+ # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
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::Iam::V1::Policy]
473
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
474
+ #
475
+ # @return [::Google::Iam::V1::Policy]
476
+ # A result object deserialized from the server's reply
477
+ def set_iam_policy 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_set_iam_policy_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::Iam::V1::Policy.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_iam_policy REST call
503
+ #
504
+ # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
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::Iam::V1::Policy]
511
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
512
+ #
513
+ # @return [::Google::Iam::V1::Policy]
514
+ # A result object deserialized from the server's reply
515
+ def get_iam_policy 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_iam_policy_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::Iam::V1::Policy.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 test_iam_permissions REST call
541
+ #
542
+ # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
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::Iam::V1::TestIamPermissionsResponse]
549
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
550
+ #
551
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
552
+ # A result object deserialized from the server's reply
553
+ def test_iam_permissions 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_test_iam_permissions_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::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
572
+
573
+ yield result, operation if block_given?
574
+ result
575
+ end
576
+
577
+ ##
578
+ # @private
579
+ #
580
+ # GRPC transcoding helper method for the list_instance_configs REST call
581
+ #
582
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest]
583
+ # A request object representing the call parameters. Required.
584
+ # @return [Array(String, [String, nil], Hash{String => String})]
585
+ # Uri, Body, Query string parameters
586
+ def self.transcode_list_instance_configs_request request_pb
587
+ transcoder = Gapic::Rest::GrpcTranscoder.new
588
+ .with_bindings(
589
+ uri_method: :get,
590
+ uri_template: "/v1/{parent}/instanceConfigs",
591
+ matches: [
592
+ ["parent", %r{^projects/[^/]+/?$}, false]
593
+ ]
594
+ )
595
+ transcoder.transcode request_pb
596
+ end
597
+
598
+ ##
599
+ # @private
600
+ #
601
+ # GRPC transcoding helper method for the get_instance_config REST call
602
+ #
603
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest]
604
+ # A request object representing the call parameters. Required.
605
+ # @return [Array(String, [String, nil], Hash{String => String})]
606
+ # Uri, Body, Query string parameters
607
+ def self.transcode_get_instance_config_request request_pb
608
+ transcoder = Gapic::Rest::GrpcTranscoder.new
609
+ .with_bindings(
610
+ uri_method: :get,
611
+ uri_template: "/v1/{name}",
612
+ matches: [
613
+ ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false]
614
+ ]
615
+ )
616
+ transcoder.transcode request_pb
617
+ end
618
+
619
+ ##
620
+ # @private
621
+ #
622
+ # GRPC transcoding helper method for the create_instance_config REST call
623
+ #
624
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest]
625
+ # A request object representing the call parameters. Required.
626
+ # @return [Array(String, [String, nil], Hash{String => String})]
627
+ # Uri, Body, Query string parameters
628
+ def self.transcode_create_instance_config_request request_pb
629
+ transcoder = Gapic::Rest::GrpcTranscoder.new
630
+ .with_bindings(
631
+ uri_method: :post,
632
+ uri_template: "/v1/{parent}/instanceConfigs",
633
+ body: "*",
634
+ matches: [
635
+ ["parent", %r{^projects/[^/]+/?$}, false]
636
+ ]
637
+ )
638
+ transcoder.transcode request_pb
639
+ end
640
+
641
+ ##
642
+ # @private
643
+ #
644
+ # GRPC transcoding helper method for the update_instance_config REST call
645
+ #
646
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest]
647
+ # A request object representing the call parameters. Required.
648
+ # @return [Array(String, [String, nil], Hash{String => String})]
649
+ # Uri, Body, Query string parameters
650
+ def self.transcode_update_instance_config_request request_pb
651
+ transcoder = Gapic::Rest::GrpcTranscoder.new
652
+ .with_bindings(
653
+ uri_method: :patch,
654
+ uri_template: "/v1/{instance_config.name}",
655
+ body: "*",
656
+ matches: [
657
+ ["instance_config.name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false]
658
+ ]
659
+ )
660
+ transcoder.transcode request_pb
661
+ end
662
+
663
+ ##
664
+ # @private
665
+ #
666
+ # GRPC transcoding helper method for the delete_instance_config REST call
667
+ #
668
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest]
669
+ # A request object representing the call parameters. Required.
670
+ # @return [Array(String, [String, nil], Hash{String => String})]
671
+ # Uri, Body, Query string parameters
672
+ def self.transcode_delete_instance_config_request request_pb
673
+ transcoder = Gapic::Rest::GrpcTranscoder.new
674
+ .with_bindings(
675
+ uri_method: :delete,
676
+ uri_template: "/v1/{name}",
677
+ matches: [
678
+ ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false]
679
+ ]
680
+ )
681
+ transcoder.transcode request_pb
682
+ end
683
+
684
+ ##
685
+ # @private
686
+ #
687
+ # GRPC transcoding helper method for the list_instance_config_operations REST call
688
+ #
689
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest]
690
+ # A request object representing the call parameters. Required.
691
+ # @return [Array(String, [String, nil], Hash{String => String})]
692
+ # Uri, Body, Query string parameters
693
+ def self.transcode_list_instance_config_operations_request request_pb
694
+ transcoder = Gapic::Rest::GrpcTranscoder.new
695
+ .with_bindings(
696
+ uri_method: :get,
697
+ uri_template: "/v1/{parent}/instanceConfigOperations",
698
+ matches: [
699
+ ["parent", %r{^projects/[^/]+/?$}, false]
700
+ ]
701
+ )
702
+ transcoder.transcode request_pb
703
+ end
704
+
705
+ ##
706
+ # @private
707
+ #
708
+ # GRPC transcoding helper method for the list_instances REST call
709
+ #
710
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest]
711
+ # A request object representing the call parameters. Required.
712
+ # @return [Array(String, [String, nil], Hash{String => String})]
713
+ # Uri, Body, Query string parameters
714
+ def self.transcode_list_instances_request request_pb
715
+ transcoder = Gapic::Rest::GrpcTranscoder.new
716
+ .with_bindings(
717
+ uri_method: :get,
718
+ uri_template: "/v1/{parent}/instances",
719
+ matches: [
720
+ ["parent", %r{^projects/[^/]+/?$}, false]
721
+ ]
722
+ )
723
+ transcoder.transcode request_pb
724
+ end
725
+
726
+ ##
727
+ # @private
728
+ #
729
+ # GRPC transcoding helper method for the get_instance REST call
730
+ #
731
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest]
732
+ # A request object representing the call parameters. Required.
733
+ # @return [Array(String, [String, nil], Hash{String => String})]
734
+ # Uri, Body, Query string parameters
735
+ def self.transcode_get_instance_request request_pb
736
+ transcoder = Gapic::Rest::GrpcTranscoder.new
737
+ .with_bindings(
738
+ uri_method: :get,
739
+ uri_template: "/v1/{name}",
740
+ matches: [
741
+ ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
742
+ ]
743
+ )
744
+ transcoder.transcode request_pb
745
+ end
746
+
747
+ ##
748
+ # @private
749
+ #
750
+ # GRPC transcoding helper method for the create_instance REST call
751
+ #
752
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest]
753
+ # A request object representing the call parameters. Required.
754
+ # @return [Array(String, [String, nil], Hash{String => String})]
755
+ # Uri, Body, Query string parameters
756
+ def self.transcode_create_instance_request request_pb
757
+ transcoder = Gapic::Rest::GrpcTranscoder.new
758
+ .with_bindings(
759
+ uri_method: :post,
760
+ uri_template: "/v1/{parent}/instances",
761
+ body: "*",
762
+ matches: [
763
+ ["parent", %r{^projects/[^/]+/?$}, false]
764
+ ]
765
+ )
766
+ transcoder.transcode request_pb
767
+ end
768
+
769
+ ##
770
+ # @private
771
+ #
772
+ # GRPC transcoding helper method for the update_instance REST call
773
+ #
774
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest]
775
+ # A request object representing the call parameters. Required.
776
+ # @return [Array(String, [String, nil], Hash{String => String})]
777
+ # Uri, Body, Query string parameters
778
+ def self.transcode_update_instance_request request_pb
779
+ transcoder = Gapic::Rest::GrpcTranscoder.new
780
+ .with_bindings(
781
+ uri_method: :patch,
782
+ uri_template: "/v1/{instance.name}",
783
+ body: "*",
784
+ matches: [
785
+ ["instance.name", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
786
+ ]
787
+ )
788
+ transcoder.transcode request_pb
789
+ end
790
+
791
+ ##
792
+ # @private
793
+ #
794
+ # GRPC transcoding helper method for the delete_instance REST call
795
+ #
796
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest]
797
+ # A request object representing the call parameters. Required.
798
+ # @return [Array(String, [String, nil], Hash{String => String})]
799
+ # Uri, Body, Query string parameters
800
+ def self.transcode_delete_instance_request request_pb
801
+ transcoder = Gapic::Rest::GrpcTranscoder.new
802
+ .with_bindings(
803
+ uri_method: :delete,
804
+ uri_template: "/v1/{name}",
805
+ matches: [
806
+ ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
807
+ ]
808
+ )
809
+ transcoder.transcode request_pb
810
+ end
811
+
812
+ ##
813
+ # @private
814
+ #
815
+ # GRPC transcoding helper method for the set_iam_policy REST call
816
+ #
817
+ # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
818
+ # A request object representing the call parameters. Required.
819
+ # @return [Array(String, [String, nil], Hash{String => String})]
820
+ # Uri, Body, Query string parameters
821
+ def self.transcode_set_iam_policy_request request_pb
822
+ transcoder = Gapic::Rest::GrpcTranscoder.new
823
+ .with_bindings(
824
+ uri_method: :post,
825
+ uri_template: "/v1/{resource}:setIamPolicy",
826
+ body: "*",
827
+ matches: [
828
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
829
+ ]
830
+ )
831
+ transcoder.transcode request_pb
832
+ end
833
+
834
+ ##
835
+ # @private
836
+ #
837
+ # GRPC transcoding helper method for the get_iam_policy REST call
838
+ #
839
+ # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
840
+ # A request object representing the call parameters. Required.
841
+ # @return [Array(String, [String, nil], Hash{String => String})]
842
+ # Uri, Body, Query string parameters
843
+ def self.transcode_get_iam_policy_request request_pb
844
+ transcoder = Gapic::Rest::GrpcTranscoder.new
845
+ .with_bindings(
846
+ uri_method: :post,
847
+ uri_template: "/v1/{resource}:getIamPolicy",
848
+ body: "*",
849
+ matches: [
850
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
851
+ ]
852
+ )
853
+ transcoder.transcode request_pb
854
+ end
855
+
856
+ ##
857
+ # @private
858
+ #
859
+ # GRPC transcoding helper method for the test_iam_permissions REST call
860
+ #
861
+ # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
862
+ # A request object representing the call parameters. Required.
863
+ # @return [Array(String, [String, nil], Hash{String => String})]
864
+ # Uri, Body, Query string parameters
865
+ def self.transcode_test_iam_permissions_request request_pb
866
+ transcoder = Gapic::Rest::GrpcTranscoder.new
867
+ .with_bindings(
868
+ uri_method: :post,
869
+ uri_template: "/v1/{resource}:testIamPermissions",
870
+ body: "*",
871
+ matches: [
872
+ ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false]
873
+ ]
874
+ )
875
+ transcoder.transcode request_pb
876
+ end
877
+ end
878
+ end
879
+ end
880
+ end
881
+ end
882
+ end
883
+ end
884
+ end
885
+ end