google-cloud-bigquery-reservation-v1 0.6.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1299 @@
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/cloud/bigquery/reservation/v1/reservation_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Bigquery
24
+ module Reservation
25
+ module V1
26
+ module ReservationService
27
+ module Rest
28
+ ##
29
+ # REST service stub for the ReservationService service.
30
+ # Service stub contains baseline method implementations
31
+ # including transcoding, making the REST call, and deserialing the response.
32
+ #
33
+ class ServiceStub
34
+ def initialize endpoint:, credentials:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
40
+ numeric_enums: true,
41
+ raise_faraday_errors: false
42
+ end
43
+
44
+ ##
45
+ # Baseline implementation for the create_reservation REST call
46
+ #
47
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest]
48
+ # A request object representing the call parameters. Required.
49
+ # @param options [::Gapic::CallOptions]
50
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
51
+ #
52
+ # @yield [result, operation] Access the result along with the TransportOperation object
53
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Reservation]
54
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
55
+ #
56
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation]
57
+ # A result object deserialized from the server's reply
58
+ def create_reservation request_pb, options = nil
59
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
60
+
61
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_reservation_request request_pb
62
+ query_string_params = if query_string_params.any?
63
+ query_string_params.to_h { |p| p.split("=", 2) }
64
+ else
65
+ {}
66
+ end
67
+
68
+ response = @client_stub.make_http_request(
69
+ verb,
70
+ uri: uri,
71
+ body: body || "",
72
+ params: query_string_params,
73
+ options: options
74
+ )
75
+ operation = ::Gapic::Rest::TransportOperation.new response
76
+ result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.decode_json response.body, ignore_unknown_fields: true
77
+
78
+ yield result, operation if block_given?
79
+ result
80
+ end
81
+
82
+ ##
83
+ # Baseline implementation for the list_reservations REST call
84
+ #
85
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest]
86
+ # A request object representing the call parameters. Required.
87
+ # @param options [::Gapic::CallOptions]
88
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
89
+ #
90
+ # @yield [result, operation] Access the result along with the TransportOperation object
91
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse]
92
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
93
+ #
94
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse]
95
+ # A result object deserialized from the server's reply
96
+ def list_reservations request_pb, options = nil
97
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
98
+
99
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_reservations_request request_pb
100
+ query_string_params = if query_string_params.any?
101
+ query_string_params.to_h { |p| p.split("=", 2) }
102
+ else
103
+ {}
104
+ end
105
+
106
+ response = @client_stub.make_http_request(
107
+ verb,
108
+ uri: uri,
109
+ body: body || "",
110
+ params: query_string_params,
111
+ options: options
112
+ )
113
+ operation = ::Gapic::Rest::TransportOperation.new response
114
+ result = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse.decode_json response.body, ignore_unknown_fields: true
115
+
116
+ yield result, operation if block_given?
117
+ result
118
+ end
119
+
120
+ ##
121
+ # Baseline implementation for the get_reservation REST call
122
+ #
123
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest]
124
+ # A request object representing the call parameters. Required.
125
+ # @param options [::Gapic::CallOptions]
126
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
127
+ #
128
+ # @yield [result, operation] Access the result along with the TransportOperation object
129
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Reservation]
130
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
131
+ #
132
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation]
133
+ # A result object deserialized from the server's reply
134
+ def get_reservation request_pb, options = nil
135
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
136
+
137
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_reservation_request request_pb
138
+ query_string_params = if query_string_params.any?
139
+ query_string_params.to_h { |p| p.split("=", 2) }
140
+ else
141
+ {}
142
+ end
143
+
144
+ response = @client_stub.make_http_request(
145
+ verb,
146
+ uri: uri,
147
+ body: body || "",
148
+ params: query_string_params,
149
+ options: options
150
+ )
151
+ operation = ::Gapic::Rest::TransportOperation.new response
152
+ result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.decode_json response.body, ignore_unknown_fields: true
153
+
154
+ yield result, operation if block_given?
155
+ result
156
+ end
157
+
158
+ ##
159
+ # Baseline implementation for the delete_reservation REST call
160
+ #
161
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest]
162
+ # A request object representing the call parameters. Required.
163
+ # @param options [::Gapic::CallOptions]
164
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
165
+ #
166
+ # @yield [result, operation] Access the result along with the TransportOperation object
167
+ # @yieldparam result [::Google::Protobuf::Empty]
168
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
169
+ #
170
+ # @return [::Google::Protobuf::Empty]
171
+ # A result object deserialized from the server's reply
172
+ def delete_reservation request_pb, options = nil
173
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
174
+
175
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_reservation_request request_pb
176
+ query_string_params = if query_string_params.any?
177
+ query_string_params.to_h { |p| p.split("=", 2) }
178
+ else
179
+ {}
180
+ end
181
+
182
+ response = @client_stub.make_http_request(
183
+ verb,
184
+ uri: uri,
185
+ body: body || "",
186
+ params: query_string_params,
187
+ options: options
188
+ )
189
+ operation = ::Gapic::Rest::TransportOperation.new response
190
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
191
+
192
+ yield result, operation if block_given?
193
+ result
194
+ end
195
+
196
+ ##
197
+ # Baseline implementation for the update_reservation REST call
198
+ #
199
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest]
200
+ # A request object representing the call parameters. Required.
201
+ # @param options [::Gapic::CallOptions]
202
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
203
+ #
204
+ # @yield [result, operation] Access the result along with the TransportOperation object
205
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Reservation]
206
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
207
+ #
208
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation]
209
+ # A result object deserialized from the server's reply
210
+ def update_reservation request_pb, options = nil
211
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
212
+
213
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_reservation_request request_pb
214
+ query_string_params = if query_string_params.any?
215
+ query_string_params.to_h { |p| p.split("=", 2) }
216
+ else
217
+ {}
218
+ end
219
+
220
+ response = @client_stub.make_http_request(
221
+ verb,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ options: options
226
+ )
227
+ operation = ::Gapic::Rest::TransportOperation.new response
228
+ result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.decode_json response.body, ignore_unknown_fields: true
229
+
230
+ yield result, operation if block_given?
231
+ result
232
+ end
233
+
234
+ ##
235
+ # Baseline implementation for the create_capacity_commitment REST call
236
+ #
237
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest]
238
+ # A request object representing the call parameters. Required.
239
+ # @param options [::Gapic::CallOptions]
240
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
241
+ #
242
+ # @yield [result, operation] Access the result along with the TransportOperation object
243
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment]
244
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
245
+ #
246
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment]
247
+ # A result object deserialized from the server's reply
248
+ def create_capacity_commitment request_pb, options = nil
249
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
250
+
251
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_capacity_commitment_request request_pb
252
+ query_string_params = if query_string_params.any?
253
+ query_string_params.to_h { |p| p.split("=", 2) }
254
+ else
255
+ {}
256
+ end
257
+
258
+ response = @client_stub.make_http_request(
259
+ verb,
260
+ uri: uri,
261
+ body: body || "",
262
+ params: query_string_params,
263
+ options: options
264
+ )
265
+ operation = ::Gapic::Rest::TransportOperation.new response
266
+ result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.decode_json response.body, ignore_unknown_fields: true
267
+
268
+ yield result, operation if block_given?
269
+ result
270
+ end
271
+
272
+ ##
273
+ # Baseline implementation for the list_capacity_commitments REST call
274
+ #
275
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest]
276
+ # A request object representing the call parameters. Required.
277
+ # @param options [::Gapic::CallOptions]
278
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
279
+ #
280
+ # @yield [result, operation] Access the result along with the TransportOperation object
281
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse]
282
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
283
+ #
284
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse]
285
+ # A result object deserialized from the server's reply
286
+ def list_capacity_commitments request_pb, options = nil
287
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
288
+
289
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_capacity_commitments_request request_pb
290
+ query_string_params = if query_string_params.any?
291
+ query_string_params.to_h { |p| p.split("=", 2) }
292
+ else
293
+ {}
294
+ end
295
+
296
+ response = @client_stub.make_http_request(
297
+ verb,
298
+ uri: uri,
299
+ body: body || "",
300
+ params: query_string_params,
301
+ options: options
302
+ )
303
+ operation = ::Gapic::Rest::TransportOperation.new response
304
+ result = ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse.decode_json response.body, ignore_unknown_fields: true
305
+
306
+ yield result, operation if block_given?
307
+ result
308
+ end
309
+
310
+ ##
311
+ # Baseline implementation for the get_capacity_commitment REST call
312
+ #
313
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest]
314
+ # A request object representing the call parameters. Required.
315
+ # @param options [::Gapic::CallOptions]
316
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
317
+ #
318
+ # @yield [result, operation] Access the result along with the TransportOperation object
319
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment]
320
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
321
+ #
322
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment]
323
+ # A result object deserialized from the server's reply
324
+ def get_capacity_commitment request_pb, options = nil
325
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
326
+
327
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_capacity_commitment_request request_pb
328
+ query_string_params = if query_string_params.any?
329
+ query_string_params.to_h { |p| p.split("=", 2) }
330
+ else
331
+ {}
332
+ end
333
+
334
+ response = @client_stub.make_http_request(
335
+ verb,
336
+ uri: uri,
337
+ body: body || "",
338
+ params: query_string_params,
339
+ options: options
340
+ )
341
+ operation = ::Gapic::Rest::TransportOperation.new response
342
+ result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.decode_json response.body, ignore_unknown_fields: true
343
+
344
+ yield result, operation if block_given?
345
+ result
346
+ end
347
+
348
+ ##
349
+ # Baseline implementation for the delete_capacity_commitment REST call
350
+ #
351
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest]
352
+ # A request object representing the call parameters. Required.
353
+ # @param options [::Gapic::CallOptions]
354
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
355
+ #
356
+ # @yield [result, operation] Access the result along with the TransportOperation object
357
+ # @yieldparam result [::Google::Protobuf::Empty]
358
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
359
+ #
360
+ # @return [::Google::Protobuf::Empty]
361
+ # A result object deserialized from the server's reply
362
+ def delete_capacity_commitment request_pb, options = nil
363
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
364
+
365
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_capacity_commitment_request request_pb
366
+ query_string_params = if query_string_params.any?
367
+ query_string_params.to_h { |p| p.split("=", 2) }
368
+ else
369
+ {}
370
+ end
371
+
372
+ response = @client_stub.make_http_request(
373
+ verb,
374
+ uri: uri,
375
+ body: body || "",
376
+ params: query_string_params,
377
+ options: options
378
+ )
379
+ operation = ::Gapic::Rest::TransportOperation.new response
380
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
381
+
382
+ yield result, operation if block_given?
383
+ result
384
+ end
385
+
386
+ ##
387
+ # Baseline implementation for the update_capacity_commitment REST call
388
+ #
389
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest]
390
+ # A request object representing the call parameters. Required.
391
+ # @param options [::Gapic::CallOptions]
392
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
393
+ #
394
+ # @yield [result, operation] Access the result along with the TransportOperation object
395
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment]
396
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
397
+ #
398
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment]
399
+ # A result object deserialized from the server's reply
400
+ def update_capacity_commitment request_pb, options = nil
401
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
402
+
403
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_capacity_commitment_request request_pb
404
+ query_string_params = if query_string_params.any?
405
+ query_string_params.to_h { |p| p.split("=", 2) }
406
+ else
407
+ {}
408
+ end
409
+
410
+ response = @client_stub.make_http_request(
411
+ verb,
412
+ uri: uri,
413
+ body: body || "",
414
+ params: query_string_params,
415
+ options: options
416
+ )
417
+ operation = ::Gapic::Rest::TransportOperation.new response
418
+ result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.decode_json response.body, ignore_unknown_fields: true
419
+
420
+ yield result, operation if block_given?
421
+ result
422
+ end
423
+
424
+ ##
425
+ # Baseline implementation for the split_capacity_commitment REST call
426
+ #
427
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest]
428
+ # A request object representing the call parameters. Required.
429
+ # @param options [::Gapic::CallOptions]
430
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
431
+ #
432
+ # @yield [result, operation] Access the result along with the TransportOperation object
433
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse]
434
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
435
+ #
436
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse]
437
+ # A result object deserialized from the server's reply
438
+ def split_capacity_commitment request_pb, options = nil
439
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
440
+
441
+ verb, uri, query_string_params, body = ServiceStub.transcode_split_capacity_commitment_request request_pb
442
+ query_string_params = if query_string_params.any?
443
+ query_string_params.to_h { |p| p.split("=", 2) }
444
+ else
445
+ {}
446
+ end
447
+
448
+ response = @client_stub.make_http_request(
449
+ verb,
450
+ uri: uri,
451
+ body: body || "",
452
+ params: query_string_params,
453
+ options: options
454
+ )
455
+ operation = ::Gapic::Rest::TransportOperation.new response
456
+ result = ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse.decode_json response.body, ignore_unknown_fields: true
457
+
458
+ yield result, operation if block_given?
459
+ result
460
+ end
461
+
462
+ ##
463
+ # Baseline implementation for the merge_capacity_commitments REST call
464
+ #
465
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest]
466
+ # A request object representing the call parameters. Required.
467
+ # @param options [::Gapic::CallOptions]
468
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
469
+ #
470
+ # @yield [result, operation] Access the result along with the TransportOperation object
471
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment]
472
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
473
+ #
474
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment]
475
+ # A result object deserialized from the server's reply
476
+ def merge_capacity_commitments request_pb, options = nil
477
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
478
+
479
+ verb, uri, query_string_params, body = ServiceStub.transcode_merge_capacity_commitments_request request_pb
480
+ query_string_params = if query_string_params.any?
481
+ query_string_params.to_h { |p| p.split("=", 2) }
482
+ else
483
+ {}
484
+ end
485
+
486
+ response = @client_stub.make_http_request(
487
+ verb,
488
+ uri: uri,
489
+ body: body || "",
490
+ params: query_string_params,
491
+ options: options
492
+ )
493
+ operation = ::Gapic::Rest::TransportOperation.new response
494
+ result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.decode_json response.body, ignore_unknown_fields: true
495
+
496
+ yield result, operation if block_given?
497
+ result
498
+ end
499
+
500
+ ##
501
+ # Baseline implementation for the create_assignment REST call
502
+ #
503
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest]
504
+ # A request object representing the call parameters. Required.
505
+ # @param options [::Gapic::CallOptions]
506
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
507
+ #
508
+ # @yield [result, operation] Access the result along with the TransportOperation object
509
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Assignment]
510
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
511
+ #
512
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment]
513
+ # A result object deserialized from the server's reply
514
+ def create_assignment request_pb, options = nil
515
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
516
+
517
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_assignment_request request_pb
518
+ query_string_params = if query_string_params.any?
519
+ query_string_params.to_h { |p| p.split("=", 2) }
520
+ else
521
+ {}
522
+ end
523
+
524
+ response = @client_stub.make_http_request(
525
+ verb,
526
+ uri: uri,
527
+ body: body || "",
528
+ params: query_string_params,
529
+ options: options
530
+ )
531
+ operation = ::Gapic::Rest::TransportOperation.new response
532
+ result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.decode_json response.body, ignore_unknown_fields: true
533
+
534
+ yield result, operation if block_given?
535
+ result
536
+ end
537
+
538
+ ##
539
+ # Baseline implementation for the list_assignments REST call
540
+ #
541
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest]
542
+ # A request object representing the call parameters. Required.
543
+ # @param options [::Gapic::CallOptions]
544
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
545
+ #
546
+ # @yield [result, operation] Access the result along with the TransportOperation object
547
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse]
548
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
549
+ #
550
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse]
551
+ # A result object deserialized from the server's reply
552
+ def list_assignments request_pb, options = nil
553
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
554
+
555
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_assignments_request request_pb
556
+ query_string_params = if query_string_params.any?
557
+ query_string_params.to_h { |p| p.split("=", 2) }
558
+ else
559
+ {}
560
+ end
561
+
562
+ response = @client_stub.make_http_request(
563
+ verb,
564
+ uri: uri,
565
+ body: body || "",
566
+ params: query_string_params,
567
+ options: options
568
+ )
569
+ operation = ::Gapic::Rest::TransportOperation.new response
570
+ result = ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse.decode_json response.body, ignore_unknown_fields: true
571
+
572
+ yield result, operation if block_given?
573
+ result
574
+ end
575
+
576
+ ##
577
+ # Baseline implementation for the delete_assignment REST call
578
+ #
579
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest]
580
+ # A request object representing the call parameters. Required.
581
+ # @param options [::Gapic::CallOptions]
582
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
583
+ #
584
+ # @yield [result, operation] Access the result along with the TransportOperation object
585
+ # @yieldparam result [::Google::Protobuf::Empty]
586
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
587
+ #
588
+ # @return [::Google::Protobuf::Empty]
589
+ # A result object deserialized from the server's reply
590
+ def delete_assignment request_pb, options = nil
591
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
592
+
593
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_assignment_request request_pb
594
+ query_string_params = if query_string_params.any?
595
+ query_string_params.to_h { |p| p.split("=", 2) }
596
+ else
597
+ {}
598
+ end
599
+
600
+ response = @client_stub.make_http_request(
601
+ verb,
602
+ uri: uri,
603
+ body: body || "",
604
+ params: query_string_params,
605
+ options: options
606
+ )
607
+ operation = ::Gapic::Rest::TransportOperation.new response
608
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
609
+
610
+ yield result, operation if block_given?
611
+ result
612
+ end
613
+
614
+ ##
615
+ # Baseline implementation for the search_assignments REST call
616
+ #
617
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest]
618
+ # A request object representing the call parameters. Required.
619
+ # @param options [::Gapic::CallOptions]
620
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
621
+ #
622
+ # @yield [result, operation] Access the result along with the TransportOperation object
623
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse]
624
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
625
+ #
626
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse]
627
+ # A result object deserialized from the server's reply
628
+ def search_assignments request_pb, options = nil
629
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
630
+
631
+ verb, uri, query_string_params, body = ServiceStub.transcode_search_assignments_request request_pb
632
+ query_string_params = if query_string_params.any?
633
+ query_string_params.to_h { |p| p.split("=", 2) }
634
+ else
635
+ {}
636
+ end
637
+
638
+ response = @client_stub.make_http_request(
639
+ verb,
640
+ uri: uri,
641
+ body: body || "",
642
+ params: query_string_params,
643
+ options: options
644
+ )
645
+ operation = ::Gapic::Rest::TransportOperation.new response
646
+ result = ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse.decode_json response.body, ignore_unknown_fields: true
647
+
648
+ yield result, operation if block_given?
649
+ result
650
+ end
651
+
652
+ ##
653
+ # Baseline implementation for the search_all_assignments REST call
654
+ #
655
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest]
656
+ # A request object representing the call parameters. Required.
657
+ # @param options [::Gapic::CallOptions]
658
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
659
+ #
660
+ # @yield [result, operation] Access the result along with the TransportOperation object
661
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse]
662
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
663
+ #
664
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse]
665
+ # A result object deserialized from the server's reply
666
+ def search_all_assignments request_pb, options = nil
667
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
668
+
669
+ verb, uri, query_string_params, body = ServiceStub.transcode_search_all_assignments_request request_pb
670
+ query_string_params = if query_string_params.any?
671
+ query_string_params.to_h { |p| p.split("=", 2) }
672
+ else
673
+ {}
674
+ end
675
+
676
+ response = @client_stub.make_http_request(
677
+ verb,
678
+ uri: uri,
679
+ body: body || "",
680
+ params: query_string_params,
681
+ options: options
682
+ )
683
+ operation = ::Gapic::Rest::TransportOperation.new response
684
+ result = ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse.decode_json response.body, ignore_unknown_fields: true
685
+
686
+ yield result, operation if block_given?
687
+ result
688
+ end
689
+
690
+ ##
691
+ # Baseline implementation for the move_assignment REST call
692
+ #
693
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest]
694
+ # A request object representing the call parameters. Required.
695
+ # @param options [::Gapic::CallOptions]
696
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
697
+ #
698
+ # @yield [result, operation] Access the result along with the TransportOperation object
699
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Assignment]
700
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
701
+ #
702
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment]
703
+ # A result object deserialized from the server's reply
704
+ def move_assignment request_pb, options = nil
705
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
706
+
707
+ verb, uri, query_string_params, body = ServiceStub.transcode_move_assignment_request request_pb
708
+ query_string_params = if query_string_params.any?
709
+ query_string_params.to_h { |p| p.split("=", 2) }
710
+ else
711
+ {}
712
+ end
713
+
714
+ response = @client_stub.make_http_request(
715
+ verb,
716
+ uri: uri,
717
+ body: body || "",
718
+ params: query_string_params,
719
+ options: options
720
+ )
721
+ operation = ::Gapic::Rest::TransportOperation.new response
722
+ result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.decode_json response.body, ignore_unknown_fields: true
723
+
724
+ yield result, operation if block_given?
725
+ result
726
+ end
727
+
728
+ ##
729
+ # Baseline implementation for the update_assignment REST call
730
+ #
731
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest]
732
+ # A request object representing the call parameters. Required.
733
+ # @param options [::Gapic::CallOptions]
734
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
735
+ #
736
+ # @yield [result, operation] Access the result along with the TransportOperation object
737
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Assignment]
738
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
739
+ #
740
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment]
741
+ # A result object deserialized from the server's reply
742
+ def update_assignment request_pb, options = nil
743
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
744
+
745
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_assignment_request request_pb
746
+ query_string_params = if query_string_params.any?
747
+ query_string_params.to_h { |p| p.split("=", 2) }
748
+ else
749
+ {}
750
+ end
751
+
752
+ response = @client_stub.make_http_request(
753
+ verb,
754
+ uri: uri,
755
+ body: body || "",
756
+ params: query_string_params,
757
+ options: options
758
+ )
759
+ operation = ::Gapic::Rest::TransportOperation.new response
760
+ result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.decode_json response.body, ignore_unknown_fields: true
761
+
762
+ yield result, operation if block_given?
763
+ result
764
+ end
765
+
766
+ ##
767
+ # Baseline implementation for the get_bi_reservation REST call
768
+ #
769
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest]
770
+ # A request object representing the call parameters. Required.
771
+ # @param options [::Gapic::CallOptions]
772
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
773
+ #
774
+ # @yield [result, operation] Access the result along with the TransportOperation object
775
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::BiReservation]
776
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
777
+ #
778
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation]
779
+ # A result object deserialized from the server's reply
780
+ def get_bi_reservation request_pb, options = nil
781
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
782
+
783
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_bi_reservation_request request_pb
784
+ query_string_params = if query_string_params.any?
785
+ query_string_params.to_h { |p| p.split("=", 2) }
786
+ else
787
+ {}
788
+ end
789
+
790
+ response = @client_stub.make_http_request(
791
+ verb,
792
+ uri: uri,
793
+ body: body || "",
794
+ params: query_string_params,
795
+ options: options
796
+ )
797
+ operation = ::Gapic::Rest::TransportOperation.new response
798
+ result = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.decode_json response.body, ignore_unknown_fields: true
799
+
800
+ yield result, operation if block_given?
801
+ result
802
+ end
803
+
804
+ ##
805
+ # Baseline implementation for the update_bi_reservation REST call
806
+ #
807
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest]
808
+ # A request object representing the call parameters. Required.
809
+ # @param options [::Gapic::CallOptions]
810
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
811
+ #
812
+ # @yield [result, operation] Access the result along with the TransportOperation object
813
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::BiReservation]
814
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
815
+ #
816
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation]
817
+ # A result object deserialized from the server's reply
818
+ def update_bi_reservation request_pb, options = nil
819
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
820
+
821
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_bi_reservation_request request_pb
822
+ query_string_params = if query_string_params.any?
823
+ query_string_params.to_h { |p| p.split("=", 2) }
824
+ else
825
+ {}
826
+ end
827
+
828
+ response = @client_stub.make_http_request(
829
+ verb,
830
+ uri: uri,
831
+ body: body || "",
832
+ params: query_string_params,
833
+ options: options
834
+ )
835
+ operation = ::Gapic::Rest::TransportOperation.new response
836
+ result = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.decode_json response.body, ignore_unknown_fields: true
837
+
838
+ yield result, operation if block_given?
839
+ result
840
+ end
841
+
842
+ ##
843
+ # @private
844
+ #
845
+ # GRPC transcoding helper method for the create_reservation REST call
846
+ #
847
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest]
848
+ # A request object representing the call parameters. Required.
849
+ # @return [Array(String, [String, nil], Hash{String => String})]
850
+ # Uri, Body, Query string parameters
851
+ def self.transcode_create_reservation_request request_pb
852
+ transcoder = Gapic::Rest::GrpcTranscoder.new
853
+ .with_bindings(
854
+ uri_method: :post,
855
+ uri_template: "/v1/{parent}/reservations",
856
+ body: "reservation",
857
+ matches: [
858
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
859
+ ]
860
+ )
861
+ transcoder.transcode request_pb
862
+ end
863
+
864
+ ##
865
+ # @private
866
+ #
867
+ # GRPC transcoding helper method for the list_reservations REST call
868
+ #
869
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest]
870
+ # A request object representing the call parameters. Required.
871
+ # @return [Array(String, [String, nil], Hash{String => String})]
872
+ # Uri, Body, Query string parameters
873
+ def self.transcode_list_reservations_request request_pb
874
+ transcoder = Gapic::Rest::GrpcTranscoder.new
875
+ .with_bindings(
876
+ uri_method: :get,
877
+ uri_template: "/v1/{parent}/reservations",
878
+ matches: [
879
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
880
+ ]
881
+ )
882
+ transcoder.transcode request_pb
883
+ end
884
+
885
+ ##
886
+ # @private
887
+ #
888
+ # GRPC transcoding helper method for the get_reservation REST call
889
+ #
890
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest]
891
+ # A request object representing the call parameters. Required.
892
+ # @return [Array(String, [String, nil], Hash{String => String})]
893
+ # Uri, Body, Query string parameters
894
+ def self.transcode_get_reservation_request request_pb
895
+ transcoder = Gapic::Rest::GrpcTranscoder.new
896
+ .with_bindings(
897
+ uri_method: :get,
898
+ uri_template: "/v1/{name}",
899
+ matches: [
900
+ ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false]
901
+ ]
902
+ )
903
+ transcoder.transcode request_pb
904
+ end
905
+
906
+ ##
907
+ # @private
908
+ #
909
+ # GRPC transcoding helper method for the delete_reservation REST call
910
+ #
911
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest]
912
+ # A request object representing the call parameters. Required.
913
+ # @return [Array(String, [String, nil], Hash{String => String})]
914
+ # Uri, Body, Query string parameters
915
+ def self.transcode_delete_reservation_request request_pb
916
+ transcoder = Gapic::Rest::GrpcTranscoder.new
917
+ .with_bindings(
918
+ uri_method: :delete,
919
+ uri_template: "/v1/{name}",
920
+ matches: [
921
+ ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false]
922
+ ]
923
+ )
924
+ transcoder.transcode request_pb
925
+ end
926
+
927
+ ##
928
+ # @private
929
+ #
930
+ # GRPC transcoding helper method for the update_reservation REST call
931
+ #
932
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest]
933
+ # A request object representing the call parameters. Required.
934
+ # @return [Array(String, [String, nil], Hash{String => String})]
935
+ # Uri, Body, Query string parameters
936
+ def self.transcode_update_reservation_request request_pb
937
+ transcoder = Gapic::Rest::GrpcTranscoder.new
938
+ .with_bindings(
939
+ uri_method: :patch,
940
+ uri_template: "/v1/{reservation.name}",
941
+ body: "reservation",
942
+ matches: [
943
+ ["reservation.name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false]
944
+ ]
945
+ )
946
+ transcoder.transcode request_pb
947
+ end
948
+
949
+ ##
950
+ # @private
951
+ #
952
+ # GRPC transcoding helper method for the create_capacity_commitment REST call
953
+ #
954
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest]
955
+ # A request object representing the call parameters. Required.
956
+ # @return [Array(String, [String, nil], Hash{String => String})]
957
+ # Uri, Body, Query string parameters
958
+ def self.transcode_create_capacity_commitment_request request_pb
959
+ transcoder = Gapic::Rest::GrpcTranscoder.new
960
+ .with_bindings(
961
+ uri_method: :post,
962
+ uri_template: "/v1/{parent}/capacityCommitments",
963
+ body: "capacity_commitment",
964
+ matches: [
965
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
966
+ ]
967
+ )
968
+ transcoder.transcode request_pb
969
+ end
970
+
971
+ ##
972
+ # @private
973
+ #
974
+ # GRPC transcoding helper method for the list_capacity_commitments REST call
975
+ #
976
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest]
977
+ # A request object representing the call parameters. Required.
978
+ # @return [Array(String, [String, nil], Hash{String => String})]
979
+ # Uri, Body, Query string parameters
980
+ def self.transcode_list_capacity_commitments_request request_pb
981
+ transcoder = Gapic::Rest::GrpcTranscoder.new
982
+ .with_bindings(
983
+ uri_method: :get,
984
+ uri_template: "/v1/{parent}/capacityCommitments",
985
+ matches: [
986
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
987
+ ]
988
+ )
989
+ transcoder.transcode request_pb
990
+ end
991
+
992
+ ##
993
+ # @private
994
+ #
995
+ # GRPC transcoding helper method for the get_capacity_commitment REST call
996
+ #
997
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest]
998
+ # A request object representing the call parameters. Required.
999
+ # @return [Array(String, [String, nil], Hash{String => String})]
1000
+ # Uri, Body, Query string parameters
1001
+ def self.transcode_get_capacity_commitment_request request_pb
1002
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1003
+ .with_bindings(
1004
+ uri_method: :get,
1005
+ uri_template: "/v1/{name}",
1006
+ matches: [
1007
+ ["name", %r{^projects/[^/]+/locations/[^/]+/capacityCommitments/[^/]+/?$}, false]
1008
+ ]
1009
+ )
1010
+ transcoder.transcode request_pb
1011
+ end
1012
+
1013
+ ##
1014
+ # @private
1015
+ #
1016
+ # GRPC transcoding helper method for the delete_capacity_commitment REST call
1017
+ #
1018
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest]
1019
+ # A request object representing the call parameters. Required.
1020
+ # @return [Array(String, [String, nil], Hash{String => String})]
1021
+ # Uri, Body, Query string parameters
1022
+ def self.transcode_delete_capacity_commitment_request request_pb
1023
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1024
+ .with_bindings(
1025
+ uri_method: :delete,
1026
+ uri_template: "/v1/{name}",
1027
+ matches: [
1028
+ ["name", %r{^projects/[^/]+/locations/[^/]+/capacityCommitments/[^/]+/?$}, false]
1029
+ ]
1030
+ )
1031
+ transcoder.transcode request_pb
1032
+ end
1033
+
1034
+ ##
1035
+ # @private
1036
+ #
1037
+ # GRPC transcoding helper method for the update_capacity_commitment REST call
1038
+ #
1039
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest]
1040
+ # A request object representing the call parameters. Required.
1041
+ # @return [Array(String, [String, nil], Hash{String => String})]
1042
+ # Uri, Body, Query string parameters
1043
+ def self.transcode_update_capacity_commitment_request request_pb
1044
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1045
+ .with_bindings(
1046
+ uri_method: :patch,
1047
+ uri_template: "/v1/{capacity_commitment.name}",
1048
+ body: "capacity_commitment",
1049
+ matches: [
1050
+ ["capacity_commitment.name", %r{^projects/[^/]+/locations/[^/]+/capacityCommitments/[^/]+/?$}, false]
1051
+ ]
1052
+ )
1053
+ transcoder.transcode request_pb
1054
+ end
1055
+
1056
+ ##
1057
+ # @private
1058
+ #
1059
+ # GRPC transcoding helper method for the split_capacity_commitment REST call
1060
+ #
1061
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest]
1062
+ # A request object representing the call parameters. Required.
1063
+ # @return [Array(String, [String, nil], Hash{String => String})]
1064
+ # Uri, Body, Query string parameters
1065
+ def self.transcode_split_capacity_commitment_request request_pb
1066
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1067
+ .with_bindings(
1068
+ uri_method: :post,
1069
+ uri_template: "/v1/{name}:split",
1070
+ body: "*",
1071
+ matches: [
1072
+ ["name", %r{^projects/[^/]+/locations/[^/]+/capacityCommitments/[^/]+/?$}, false]
1073
+ ]
1074
+ )
1075
+ transcoder.transcode request_pb
1076
+ end
1077
+
1078
+ ##
1079
+ # @private
1080
+ #
1081
+ # GRPC transcoding helper method for the merge_capacity_commitments REST call
1082
+ #
1083
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest]
1084
+ # A request object representing the call parameters. Required.
1085
+ # @return [Array(String, [String, nil], Hash{String => String})]
1086
+ # Uri, Body, Query string parameters
1087
+ def self.transcode_merge_capacity_commitments_request request_pb
1088
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1089
+ .with_bindings(
1090
+ uri_method: :post,
1091
+ uri_template: "/v1/{parent}/capacityCommitments:merge",
1092
+ body: "*",
1093
+ matches: [
1094
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
1095
+ ]
1096
+ )
1097
+ transcoder.transcode request_pb
1098
+ end
1099
+
1100
+ ##
1101
+ # @private
1102
+ #
1103
+ # GRPC transcoding helper method for the create_assignment REST call
1104
+ #
1105
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest]
1106
+ # A request object representing the call parameters. Required.
1107
+ # @return [Array(String, [String, nil], Hash{String => String})]
1108
+ # Uri, Body, Query string parameters
1109
+ def self.transcode_create_assignment_request request_pb
1110
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1111
+ .with_bindings(
1112
+ uri_method: :post,
1113
+ uri_template: "/v1/{parent}/assignments",
1114
+ body: "assignment",
1115
+ matches: [
1116
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false]
1117
+ ]
1118
+ )
1119
+ transcoder.transcode request_pb
1120
+ end
1121
+
1122
+ ##
1123
+ # @private
1124
+ #
1125
+ # GRPC transcoding helper method for the list_assignments REST call
1126
+ #
1127
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest]
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_list_assignments_request request_pb
1132
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1133
+ .with_bindings(
1134
+ uri_method: :get,
1135
+ uri_template: "/v1/{parent}/assignments",
1136
+ matches: [
1137
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false]
1138
+ ]
1139
+ )
1140
+ transcoder.transcode request_pb
1141
+ end
1142
+
1143
+ ##
1144
+ # @private
1145
+ #
1146
+ # GRPC transcoding helper method for the delete_assignment REST call
1147
+ #
1148
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest]
1149
+ # A request object representing the call parameters. Required.
1150
+ # @return [Array(String, [String, nil], Hash{String => String})]
1151
+ # Uri, Body, Query string parameters
1152
+ def self.transcode_delete_assignment_request request_pb
1153
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1154
+ .with_bindings(
1155
+ uri_method: :delete,
1156
+ uri_template: "/v1/{name}",
1157
+ matches: [
1158
+ ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false]
1159
+ ]
1160
+ )
1161
+ transcoder.transcode request_pb
1162
+ end
1163
+
1164
+ ##
1165
+ # @private
1166
+ #
1167
+ # GRPC transcoding helper method for the search_assignments REST call
1168
+ #
1169
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest]
1170
+ # A request object representing the call parameters. Required.
1171
+ # @return [Array(String, [String, nil], Hash{String => String})]
1172
+ # Uri, Body, Query string parameters
1173
+ def self.transcode_search_assignments_request request_pb
1174
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1175
+ .with_bindings(
1176
+ uri_method: :get,
1177
+ uri_template: "/v1/{parent}:searchAssignments",
1178
+ matches: [
1179
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
1180
+ ]
1181
+ )
1182
+ transcoder.transcode request_pb
1183
+ end
1184
+
1185
+ ##
1186
+ # @private
1187
+ #
1188
+ # GRPC transcoding helper method for the search_all_assignments REST call
1189
+ #
1190
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest]
1191
+ # A request object representing the call parameters. Required.
1192
+ # @return [Array(String, [String, nil], Hash{String => String})]
1193
+ # Uri, Body, Query string parameters
1194
+ def self.transcode_search_all_assignments_request request_pb
1195
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1196
+ .with_bindings(
1197
+ uri_method: :get,
1198
+ uri_template: "/v1/{parent}:searchAllAssignments",
1199
+ matches: [
1200
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
1201
+ ]
1202
+ )
1203
+ transcoder.transcode request_pb
1204
+ end
1205
+
1206
+ ##
1207
+ # @private
1208
+ #
1209
+ # GRPC transcoding helper method for the move_assignment REST call
1210
+ #
1211
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest]
1212
+ # A request object representing the call parameters. Required.
1213
+ # @return [Array(String, [String, nil], Hash{String => String})]
1214
+ # Uri, Body, Query string parameters
1215
+ def self.transcode_move_assignment_request request_pb
1216
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1217
+ .with_bindings(
1218
+ uri_method: :post,
1219
+ uri_template: "/v1/{name}:move",
1220
+ body: "*",
1221
+ matches: [
1222
+ ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false]
1223
+ ]
1224
+ )
1225
+ transcoder.transcode request_pb
1226
+ end
1227
+
1228
+ ##
1229
+ # @private
1230
+ #
1231
+ # GRPC transcoding helper method for the update_assignment REST call
1232
+ #
1233
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest]
1234
+ # A request object representing the call parameters. Required.
1235
+ # @return [Array(String, [String, nil], Hash{String => String})]
1236
+ # Uri, Body, Query string parameters
1237
+ def self.transcode_update_assignment_request request_pb
1238
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1239
+ .with_bindings(
1240
+ uri_method: :patch,
1241
+ uri_template: "/v1/{assignment.name}",
1242
+ body: "assignment",
1243
+ matches: [
1244
+ ["assignment.name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false]
1245
+ ]
1246
+ )
1247
+ transcoder.transcode request_pb
1248
+ end
1249
+
1250
+ ##
1251
+ # @private
1252
+ #
1253
+ # GRPC transcoding helper method for the get_bi_reservation REST call
1254
+ #
1255
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest]
1256
+ # A request object representing the call parameters. Required.
1257
+ # @return [Array(String, [String, nil], Hash{String => String})]
1258
+ # Uri, Body, Query string parameters
1259
+ def self.transcode_get_bi_reservation_request request_pb
1260
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1261
+ .with_bindings(
1262
+ uri_method: :get,
1263
+ uri_template: "/v1/{name}",
1264
+ matches: [
1265
+ ["name", %r{^projects/[^/]+/locations/[^/]+/biReservation/?$}, false]
1266
+ ]
1267
+ )
1268
+ transcoder.transcode request_pb
1269
+ end
1270
+
1271
+ ##
1272
+ # @private
1273
+ #
1274
+ # GRPC transcoding helper method for the update_bi_reservation REST call
1275
+ #
1276
+ # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest]
1277
+ # A request object representing the call parameters. Required.
1278
+ # @return [Array(String, [String, nil], Hash{String => String})]
1279
+ # Uri, Body, Query string parameters
1280
+ def self.transcode_update_bi_reservation_request request_pb
1281
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1282
+ .with_bindings(
1283
+ uri_method: :patch,
1284
+ uri_template: "/v1/{bi_reservation.name}",
1285
+ body: "bi_reservation",
1286
+ matches: [
1287
+ ["bi_reservation.name", %r{^projects/[^/]+/locations/[^/]+/biReservation/?$}, false]
1288
+ ]
1289
+ )
1290
+ transcoder.transcode request_pb
1291
+ end
1292
+ end
1293
+ end
1294
+ end
1295
+ end
1296
+ end
1297
+ end
1298
+ end
1299
+ end