google-cloud-bigquery-data_transfer-v1 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1052 @@
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/datatransfer/v1/datatransfer_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Bigquery
24
+ module DataTransfer
25
+ module V1
26
+ module DataTransferService
27
+ module Rest
28
+ ##
29
+ # REST service stub for the DataTransferService 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 get_data_source REST call
46
+ #
47
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::GetDataSourceRequest]
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::DataTransfer::V1::DataSource]
54
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
55
+ #
56
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::DataSource]
57
+ # A result object deserialized from the server's reply
58
+ def get_data_source 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_get_data_source_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::DataTransfer::V1::DataSource.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_data_sources REST call
84
+ #
85
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::ListDataSourcesRequest]
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::DataTransfer::V1::ListDataSourcesResponse]
92
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
93
+ #
94
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::ListDataSourcesResponse]
95
+ # A result object deserialized from the server's reply
96
+ def list_data_sources 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_data_sources_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::DataTransfer::V1::ListDataSourcesResponse.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 create_transfer_config REST call
122
+ #
123
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::CreateTransferConfigRequest]
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::DataTransfer::V1::TransferConfig]
130
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
131
+ #
132
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig]
133
+ # A result object deserialized from the server's reply
134
+ def create_transfer_config 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_create_transfer_config_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::DataTransfer::V1::TransferConfig.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 update_transfer_config REST call
160
+ #
161
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::UpdateTransferConfigRequest]
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::Cloud::Bigquery::DataTransfer::V1::TransferConfig]
168
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
169
+ #
170
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig]
171
+ # A result object deserialized from the server's reply
172
+ def update_transfer_config 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_update_transfer_config_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::Cloud::Bigquery::DataTransfer::V1::TransferConfig.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 delete_transfer_config REST call
198
+ #
199
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferConfigRequest]
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::Protobuf::Empty]
206
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
207
+ #
208
+ # @return [::Google::Protobuf::Empty]
209
+ # A result object deserialized from the server's reply
210
+ def delete_transfer_config 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_delete_transfer_config_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::Protobuf::Empty.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 get_transfer_config REST call
236
+ #
237
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::GetTransferConfigRequest]
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::DataTransfer::V1::TransferConfig]
244
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
245
+ #
246
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig]
247
+ # A result object deserialized from the server's reply
248
+ def get_transfer_config 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_get_transfer_config_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::DataTransfer::V1::TransferConfig.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_transfer_configs REST call
274
+ #
275
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferConfigsRequest]
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::DataTransfer::V1::ListTransferConfigsResponse]
282
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
283
+ #
284
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferConfigsResponse]
285
+ # A result object deserialized from the server's reply
286
+ def list_transfer_configs 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_transfer_configs_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::DataTransfer::V1::ListTransferConfigsResponse.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 schedule_transfer_runs REST call
312
+ #
313
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsRequest]
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::DataTransfer::V1::ScheduleTransferRunsResponse]
320
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
321
+ #
322
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsResponse]
323
+ # A result object deserialized from the server's reply
324
+ def schedule_transfer_runs 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_schedule_transfer_runs_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::DataTransfer::V1::ScheduleTransferRunsResponse.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 start_manual_transfer_runs REST call
350
+ #
351
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsRequest]
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::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsResponse]
358
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
359
+ #
360
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsResponse]
361
+ # A result object deserialized from the server's reply
362
+ def start_manual_transfer_runs 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_start_manual_transfer_runs_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::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsResponse.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 get_transfer_run REST call
388
+ #
389
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::GetTransferRunRequest]
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::DataTransfer::V1::TransferRun]
396
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
397
+ #
398
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun]
399
+ # A result object deserialized from the server's reply
400
+ def get_transfer_run 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_get_transfer_run_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::DataTransfer::V1::TransferRun.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 delete_transfer_run REST call
426
+ #
427
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferRunRequest]
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::Protobuf::Empty]
434
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
435
+ #
436
+ # @return [::Google::Protobuf::Empty]
437
+ # A result object deserialized from the server's reply
438
+ def delete_transfer_run 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_delete_transfer_run_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::Protobuf::Empty.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 list_transfer_runs REST call
464
+ #
465
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferRunsRequest]
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::DataTransfer::V1::ListTransferRunsResponse]
472
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
473
+ #
474
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferRunsResponse]
475
+ # A result object deserialized from the server's reply
476
+ def list_transfer_runs 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_list_transfer_runs_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::DataTransfer::V1::ListTransferRunsResponse.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 list_transfer_logs REST call
502
+ #
503
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferLogsRequest]
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::DataTransfer::V1::ListTransferLogsResponse]
510
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
511
+ #
512
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferLogsResponse]
513
+ # A result object deserialized from the server's reply
514
+ def list_transfer_logs 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_list_transfer_logs_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::DataTransfer::V1::ListTransferLogsResponse.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 check_valid_creds REST call
540
+ #
541
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsRequest]
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::DataTransfer::V1::CheckValidCredsResponse]
548
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
549
+ #
550
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsResponse]
551
+ # A result object deserialized from the server's reply
552
+ def check_valid_creds 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_check_valid_creds_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::DataTransfer::V1::CheckValidCredsResponse.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 enroll_data_sources REST call
578
+ #
579
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::EnrollDataSourcesRequest]
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 enroll_data_sources 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_enroll_data_sources_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
+ # @private
616
+ #
617
+ # GRPC transcoding helper method for the get_data_source REST call
618
+ #
619
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::GetDataSourceRequest]
620
+ # A request object representing the call parameters. Required.
621
+ # @return [Array(String, [String, nil], Hash{String => String})]
622
+ # Uri, Body, Query string parameters
623
+ def self.transcode_get_data_source_request request_pb
624
+ transcoder = Gapic::Rest::GrpcTranscoder.new
625
+ .with_bindings(
626
+ uri_method: :get,
627
+ uri_template: "/v1/{name}",
628
+ matches: [
629
+ ["name", %r{^projects/[^/]+/locations/[^/]+/dataSources/[^/]+/?$}, false]
630
+ ]
631
+ )
632
+ .with_bindings(
633
+ uri_method: :get,
634
+ uri_template: "/v1/{name}",
635
+ matches: [
636
+ ["name", %r{^projects/[^/]+/dataSources/[^/]+/?$}, false]
637
+ ]
638
+ )
639
+ transcoder.transcode request_pb
640
+ end
641
+
642
+ ##
643
+ # @private
644
+ #
645
+ # GRPC transcoding helper method for the list_data_sources REST call
646
+ #
647
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::ListDataSourcesRequest]
648
+ # A request object representing the call parameters. Required.
649
+ # @return [Array(String, [String, nil], Hash{String => String})]
650
+ # Uri, Body, Query string parameters
651
+ def self.transcode_list_data_sources_request request_pb
652
+ transcoder = Gapic::Rest::GrpcTranscoder.new
653
+ .with_bindings(
654
+ uri_method: :get,
655
+ uri_template: "/v1/{parent}/dataSources",
656
+ matches: [
657
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
658
+ ]
659
+ )
660
+ .with_bindings(
661
+ uri_method: :get,
662
+ uri_template: "/v1/{parent}/dataSources",
663
+ matches: [
664
+ ["parent", %r{^projects/[^/]+/?$}, false]
665
+ ]
666
+ )
667
+ transcoder.transcode request_pb
668
+ end
669
+
670
+ ##
671
+ # @private
672
+ #
673
+ # GRPC transcoding helper method for the create_transfer_config REST call
674
+ #
675
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::CreateTransferConfigRequest]
676
+ # A request object representing the call parameters. Required.
677
+ # @return [Array(String, [String, nil], Hash{String => String})]
678
+ # Uri, Body, Query string parameters
679
+ def self.transcode_create_transfer_config_request request_pb
680
+ transcoder = Gapic::Rest::GrpcTranscoder.new
681
+ .with_bindings(
682
+ uri_method: :post,
683
+ uri_template: "/v1/{parent}/transferConfigs",
684
+ body: "transfer_config",
685
+ matches: [
686
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
687
+ ]
688
+ )
689
+ .with_bindings(
690
+ uri_method: :post,
691
+ uri_template: "/v1/{parent}/transferConfigs",
692
+ body: "transfer_config",
693
+ matches: [
694
+ ["parent", %r{^projects/[^/]+/?$}, false]
695
+ ]
696
+ )
697
+ transcoder.transcode request_pb
698
+ end
699
+
700
+ ##
701
+ # @private
702
+ #
703
+ # GRPC transcoding helper method for the update_transfer_config REST call
704
+ #
705
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::UpdateTransferConfigRequest]
706
+ # A request object representing the call parameters. Required.
707
+ # @return [Array(String, [String, nil], Hash{String => String})]
708
+ # Uri, Body, Query string parameters
709
+ def self.transcode_update_transfer_config_request request_pb
710
+ transcoder = Gapic::Rest::GrpcTranscoder.new
711
+ .with_bindings(
712
+ uri_method: :patch,
713
+ uri_template: "/v1/{transfer_config.name}",
714
+ body: "transfer_config",
715
+ matches: [
716
+ ["transfer_config.name", %r{^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/?$}, false]
717
+ ]
718
+ )
719
+ .with_bindings(
720
+ uri_method: :patch,
721
+ uri_template: "/v1/{transfer_config.name}",
722
+ body: "transfer_config",
723
+ matches: [
724
+ ["transfer_config.name", %r{^projects/[^/]+/transferConfigs/[^/]+/?$}, false]
725
+ ]
726
+ )
727
+ transcoder.transcode request_pb
728
+ end
729
+
730
+ ##
731
+ # @private
732
+ #
733
+ # GRPC transcoding helper method for the delete_transfer_config REST call
734
+ #
735
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferConfigRequest]
736
+ # A request object representing the call parameters. Required.
737
+ # @return [Array(String, [String, nil], Hash{String => String})]
738
+ # Uri, Body, Query string parameters
739
+ def self.transcode_delete_transfer_config_request request_pb
740
+ transcoder = Gapic::Rest::GrpcTranscoder.new
741
+ .with_bindings(
742
+ uri_method: :delete,
743
+ uri_template: "/v1/{name}",
744
+ matches: [
745
+ ["name", %r{^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/?$}, false]
746
+ ]
747
+ )
748
+ .with_bindings(
749
+ uri_method: :delete,
750
+ uri_template: "/v1/{name}",
751
+ matches: [
752
+ ["name", %r{^projects/[^/]+/transferConfigs/[^/]+/?$}, false]
753
+ ]
754
+ )
755
+ transcoder.transcode request_pb
756
+ end
757
+
758
+ ##
759
+ # @private
760
+ #
761
+ # GRPC transcoding helper method for the get_transfer_config REST call
762
+ #
763
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::GetTransferConfigRequest]
764
+ # A request object representing the call parameters. Required.
765
+ # @return [Array(String, [String, nil], Hash{String => String})]
766
+ # Uri, Body, Query string parameters
767
+ def self.transcode_get_transfer_config_request request_pb
768
+ transcoder = Gapic::Rest::GrpcTranscoder.new
769
+ .with_bindings(
770
+ uri_method: :get,
771
+ uri_template: "/v1/{name}",
772
+ matches: [
773
+ ["name", %r{^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/?$}, false]
774
+ ]
775
+ )
776
+ .with_bindings(
777
+ uri_method: :get,
778
+ uri_template: "/v1/{name}",
779
+ matches: [
780
+ ["name", %r{^projects/[^/]+/transferConfigs/[^/]+/?$}, false]
781
+ ]
782
+ )
783
+ transcoder.transcode request_pb
784
+ end
785
+
786
+ ##
787
+ # @private
788
+ #
789
+ # GRPC transcoding helper method for the list_transfer_configs REST call
790
+ #
791
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferConfigsRequest]
792
+ # A request object representing the call parameters. Required.
793
+ # @return [Array(String, [String, nil], Hash{String => String})]
794
+ # Uri, Body, Query string parameters
795
+ def self.transcode_list_transfer_configs_request request_pb
796
+ transcoder = Gapic::Rest::GrpcTranscoder.new
797
+ .with_bindings(
798
+ uri_method: :get,
799
+ uri_template: "/v1/{parent}/transferConfigs",
800
+ matches: [
801
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
802
+ ]
803
+ )
804
+ .with_bindings(
805
+ uri_method: :get,
806
+ uri_template: "/v1/{parent}/transferConfigs",
807
+ matches: [
808
+ ["parent", %r{^projects/[^/]+/?$}, false]
809
+ ]
810
+ )
811
+ transcoder.transcode request_pb
812
+ end
813
+
814
+ ##
815
+ # @private
816
+ #
817
+ # GRPC transcoding helper method for the schedule_transfer_runs REST call
818
+ #
819
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsRequest]
820
+ # A request object representing the call parameters. Required.
821
+ # @return [Array(String, [String, nil], Hash{String => String})]
822
+ # Uri, Body, Query string parameters
823
+ def self.transcode_schedule_transfer_runs_request request_pb
824
+ transcoder = Gapic::Rest::GrpcTranscoder.new
825
+ .with_bindings(
826
+ uri_method: :post,
827
+ uri_template: "/v1/{parent}:scheduleRuns",
828
+ body: "*",
829
+ matches: [
830
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/?$}, false]
831
+ ]
832
+ )
833
+ .with_bindings(
834
+ uri_method: :post,
835
+ uri_template: "/v1/{parent}:scheduleRuns",
836
+ body: "*",
837
+ matches: [
838
+ ["parent", %r{^projects/[^/]+/transferConfigs/[^/]+/?$}, false]
839
+ ]
840
+ )
841
+ transcoder.transcode request_pb
842
+ end
843
+
844
+ ##
845
+ # @private
846
+ #
847
+ # GRPC transcoding helper method for the start_manual_transfer_runs REST call
848
+ #
849
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsRequest]
850
+ # A request object representing the call parameters. Required.
851
+ # @return [Array(String, [String, nil], Hash{String => String})]
852
+ # Uri, Body, Query string parameters
853
+ def self.transcode_start_manual_transfer_runs_request request_pb
854
+ transcoder = Gapic::Rest::GrpcTranscoder.new
855
+ .with_bindings(
856
+ uri_method: :post,
857
+ uri_template: "/v1/{parent}:startManualRuns",
858
+ body: "*",
859
+ matches: [
860
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/?$}, false]
861
+ ]
862
+ )
863
+ .with_bindings(
864
+ uri_method: :post,
865
+ uri_template: "/v1/{parent}:startManualRuns",
866
+ body: "*",
867
+ matches: [
868
+ ["parent", %r{^projects/[^/]+/transferConfigs/[^/]+/?$}, false]
869
+ ]
870
+ )
871
+ transcoder.transcode request_pb
872
+ end
873
+
874
+ ##
875
+ # @private
876
+ #
877
+ # GRPC transcoding helper method for the get_transfer_run REST call
878
+ #
879
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::GetTransferRunRequest]
880
+ # A request object representing the call parameters. Required.
881
+ # @return [Array(String, [String, nil], Hash{String => String})]
882
+ # Uri, Body, Query string parameters
883
+ def self.transcode_get_transfer_run_request request_pb
884
+ transcoder = Gapic::Rest::GrpcTranscoder.new
885
+ .with_bindings(
886
+ uri_method: :get,
887
+ uri_template: "/v1/{name}",
888
+ matches: [
889
+ ["name", %r{^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+/?$}, false]
890
+ ]
891
+ )
892
+ .with_bindings(
893
+ uri_method: :get,
894
+ uri_template: "/v1/{name}",
895
+ matches: [
896
+ ["name", %r{^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+/?$}, false]
897
+ ]
898
+ )
899
+ transcoder.transcode request_pb
900
+ end
901
+
902
+ ##
903
+ # @private
904
+ #
905
+ # GRPC transcoding helper method for the delete_transfer_run REST call
906
+ #
907
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferRunRequest]
908
+ # A request object representing the call parameters. Required.
909
+ # @return [Array(String, [String, nil], Hash{String => String})]
910
+ # Uri, Body, Query string parameters
911
+ def self.transcode_delete_transfer_run_request request_pb
912
+ transcoder = Gapic::Rest::GrpcTranscoder.new
913
+ .with_bindings(
914
+ uri_method: :delete,
915
+ uri_template: "/v1/{name}",
916
+ matches: [
917
+ ["name", %r{^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+/?$}, false]
918
+ ]
919
+ )
920
+ .with_bindings(
921
+ uri_method: :delete,
922
+ uri_template: "/v1/{name}",
923
+ matches: [
924
+ ["name", %r{^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+/?$}, false]
925
+ ]
926
+ )
927
+ transcoder.transcode request_pb
928
+ end
929
+
930
+ ##
931
+ # @private
932
+ #
933
+ # GRPC transcoding helper method for the list_transfer_runs REST call
934
+ #
935
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferRunsRequest]
936
+ # A request object representing the call parameters. Required.
937
+ # @return [Array(String, [String, nil], Hash{String => String})]
938
+ # Uri, Body, Query string parameters
939
+ def self.transcode_list_transfer_runs_request request_pb
940
+ transcoder = Gapic::Rest::GrpcTranscoder.new
941
+ .with_bindings(
942
+ uri_method: :get,
943
+ uri_template: "/v1/{parent}/runs",
944
+ matches: [
945
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/?$}, false]
946
+ ]
947
+ )
948
+ .with_bindings(
949
+ uri_method: :get,
950
+ uri_template: "/v1/{parent}/runs",
951
+ matches: [
952
+ ["parent", %r{^projects/[^/]+/transferConfigs/[^/]+/?$}, false]
953
+ ]
954
+ )
955
+ transcoder.transcode request_pb
956
+ end
957
+
958
+ ##
959
+ # @private
960
+ #
961
+ # GRPC transcoding helper method for the list_transfer_logs REST call
962
+ #
963
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferLogsRequest]
964
+ # A request object representing the call parameters. Required.
965
+ # @return [Array(String, [String, nil], Hash{String => String})]
966
+ # Uri, Body, Query string parameters
967
+ def self.transcode_list_transfer_logs_request request_pb
968
+ transcoder = Gapic::Rest::GrpcTranscoder.new
969
+ .with_bindings(
970
+ uri_method: :get,
971
+ uri_template: "/v1/{parent}/transferLogs",
972
+ matches: [
973
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+/?$}, false]
974
+ ]
975
+ )
976
+ .with_bindings(
977
+ uri_method: :get,
978
+ uri_template: "/v1/{parent}/transferLogs",
979
+ matches: [
980
+ ["parent", %r{^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+/?$}, false]
981
+ ]
982
+ )
983
+ transcoder.transcode request_pb
984
+ end
985
+
986
+ ##
987
+ # @private
988
+ #
989
+ # GRPC transcoding helper method for the check_valid_creds REST call
990
+ #
991
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsRequest]
992
+ # A request object representing the call parameters. Required.
993
+ # @return [Array(String, [String, nil], Hash{String => String})]
994
+ # Uri, Body, Query string parameters
995
+ def self.transcode_check_valid_creds_request request_pb
996
+ transcoder = Gapic::Rest::GrpcTranscoder.new
997
+ .with_bindings(
998
+ uri_method: :post,
999
+ uri_template: "/v1/{name}:checkValidCreds",
1000
+ body: "*",
1001
+ matches: [
1002
+ ["name", %r{^projects/[^/]+/locations/[^/]+/dataSources/[^/]+/?$}, false]
1003
+ ]
1004
+ )
1005
+ .with_bindings(
1006
+ uri_method: :post,
1007
+ uri_template: "/v1/{name}:checkValidCreds",
1008
+ body: "*",
1009
+ matches: [
1010
+ ["name", %r{^projects/[^/]+/dataSources/[^/]+/?$}, false]
1011
+ ]
1012
+ )
1013
+ transcoder.transcode request_pb
1014
+ end
1015
+
1016
+ ##
1017
+ # @private
1018
+ #
1019
+ # GRPC transcoding helper method for the enroll_data_sources REST call
1020
+ #
1021
+ # @param request_pb [::Google::Cloud::Bigquery::DataTransfer::V1::EnrollDataSourcesRequest]
1022
+ # A request object representing the call parameters. Required.
1023
+ # @return [Array(String, [String, nil], Hash{String => String})]
1024
+ # Uri, Body, Query string parameters
1025
+ def self.transcode_enroll_data_sources_request request_pb
1026
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1027
+ .with_bindings(
1028
+ uri_method: :post,
1029
+ uri_template: "/v1/{name}:enrollDataSources",
1030
+ body: "*",
1031
+ matches: [
1032
+ ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
1033
+ ]
1034
+ )
1035
+ .with_bindings(
1036
+ uri_method: :post,
1037
+ uri_template: "/v1/{name}:enrollDataSources",
1038
+ body: "*",
1039
+ matches: [
1040
+ ["name", %r{^projects/[^/]+/?$}, false]
1041
+ ]
1042
+ )
1043
+ transcoder.transcode request_pb
1044
+ end
1045
+ end
1046
+ end
1047
+ end
1048
+ end
1049
+ end
1050
+ end
1051
+ end
1052
+ end