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,1582 @@
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/errors"
20
+ require "google/cloud/bigquery/datatransfer/v1/datatransfer_pb"
21
+ require "google/cloud/bigquery/data_transfer/v1/data_transfer_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Bigquery
27
+ module DataTransfer
28
+ module V1
29
+ module DataTransferService
30
+ module Rest
31
+ ##
32
+ # REST client for the DataTransferService service.
33
+ #
34
+ # This API allows users to manage their data transfers into BigQuery.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :data_transfer_service_stub
41
+
42
+ ##
43
+ # Configure the DataTransferService Client class.
44
+ #
45
+ # See {::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all DataTransferService clients
51
+ # ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Rest::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "Bigquery", "DataTransfer", "V1"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.rpcs.get_data_source.timeout = 20.0
72
+ default_config.rpcs.get_data_source.retry_policy = {
73
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
74
+ }
75
+
76
+ default_config.rpcs.list_data_sources.timeout = 20.0
77
+ default_config.rpcs.list_data_sources.retry_policy = {
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
79
+ }
80
+
81
+ default_config.rpcs.create_transfer_config.timeout = 30.0
82
+
83
+ default_config.rpcs.update_transfer_config.timeout = 30.0
84
+
85
+ default_config.rpcs.delete_transfer_config.timeout = 20.0
86
+ default_config.rpcs.delete_transfer_config.retry_policy = {
87
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
88
+ }
89
+
90
+ default_config.rpcs.get_transfer_config.timeout = 20.0
91
+ default_config.rpcs.get_transfer_config.retry_policy = {
92
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
93
+ }
94
+
95
+ default_config.rpcs.list_transfer_configs.timeout = 20.0
96
+ default_config.rpcs.list_transfer_configs.retry_policy = {
97
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
98
+ }
99
+
100
+ default_config.rpcs.schedule_transfer_runs.timeout = 30.0
101
+
102
+ default_config.rpcs.get_transfer_run.timeout = 20.0
103
+ default_config.rpcs.get_transfer_run.retry_policy = {
104
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
105
+ }
106
+
107
+ default_config.rpcs.delete_transfer_run.timeout = 20.0
108
+ default_config.rpcs.delete_transfer_run.retry_policy = {
109
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
110
+ }
111
+
112
+ default_config.rpcs.list_transfer_runs.timeout = 20.0
113
+ default_config.rpcs.list_transfer_runs.retry_policy = {
114
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
115
+ }
116
+
117
+ default_config.rpcs.list_transfer_logs.timeout = 20.0
118
+ default_config.rpcs.list_transfer_logs.retry_policy = {
119
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
120
+ }
121
+
122
+ default_config.rpcs.check_valid_creds.timeout = 20.0
123
+ default_config.rpcs.check_valid_creds.retry_policy = {
124
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
125
+ }
126
+
127
+ default_config
128
+ end
129
+ yield @configure if block_given?
130
+ @configure
131
+ end
132
+
133
+ ##
134
+ # Configure the DataTransferService Client instance.
135
+ #
136
+ # The configuration is set to the derived mode, meaning that values can be changed,
137
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
138
+ # should be made on {Client.configure}.
139
+ #
140
+ # See {::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Rest::Client::Configuration}
141
+ # for a description of the configuration fields.
142
+ #
143
+ # @yield [config] Configure the Client client.
144
+ # @yieldparam config [Client::Configuration]
145
+ #
146
+ # @return [Client::Configuration]
147
+ #
148
+ def configure
149
+ yield @config if block_given?
150
+ @config
151
+ end
152
+
153
+ ##
154
+ # Create a new DataTransferService REST client object.
155
+ #
156
+ # @example
157
+ #
158
+ # # Create a client using the default configuration
159
+ # client = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Rest::Client.new
160
+ #
161
+ # # Create a client using a custom configuration
162
+ # client = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Rest::Client.new do |config|
163
+ # config.timeout = 10.0
164
+ # end
165
+ #
166
+ # @yield [config] Configure the DataTransferService client.
167
+ # @yieldparam config [Client::Configuration]
168
+ #
169
+ def initialize
170
+ # Create the configuration object
171
+ @config = Configuration.new Client.configure
172
+
173
+ # Yield the configuration if needed
174
+ yield @config if block_given?
175
+
176
+ # Create credentials
177
+ credentials = @config.credentials
178
+ # Use self-signed JWT if the endpoint is unchanged from default,
179
+ # but only if the default endpoint does not have a region prefix.
180
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
181
+ !@config.endpoint.split(".").first.include?("-")
182
+ credentials ||= Credentials.default scope: @config.scope,
183
+ enable_self_signed_jwt: enable_self_signed_jwt
184
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
185
+ credentials = Credentials.new credentials, scope: @config.scope
186
+ end
187
+
188
+ @quota_project_id = @config.quota_project
189
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
190
+
191
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
192
+ config.credentials = credentials
193
+ config.quota_project = @quota_project_id
194
+ config.endpoint = @config.endpoint
195
+ config.bindings_override = @config.bindings_override
196
+ end
197
+
198
+ @data_transfer_service_stub = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
199
+ end
200
+
201
+ ##
202
+ # Get the associated client for mix-in of the Locations.
203
+ #
204
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
205
+ #
206
+ attr_reader :location_client
207
+
208
+ # Service calls
209
+
210
+ ##
211
+ # Retrieves a supported data source and returns its settings.
212
+ #
213
+ # @overload get_data_source(request, options = nil)
214
+ # Pass arguments to `get_data_source` via a request object, either of type
215
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::GetDataSourceRequest} or an equivalent Hash.
216
+ #
217
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::GetDataSourceRequest, ::Hash]
218
+ # A request object representing the call parameters. Required. To specify no
219
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
220
+ # @param options [::Gapic::CallOptions, ::Hash]
221
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
222
+ #
223
+ # @overload get_data_source(name: nil)
224
+ # Pass arguments to `get_data_source` via keyword arguments. Note that at
225
+ # least one keyword argument is required. To specify no parameters, or to keep all
226
+ # the default parameter values, pass an empty Hash as a request object (see above).
227
+ #
228
+ # @param name [::String]
229
+ # Required. The field will contain name of the resource requested, for
230
+ # example: `projects/{project_id}/dataSources/{data_source_id}` or
231
+ # `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
232
+ # @yield [result, operation] Access the result along with the TransportOperation object
233
+ # @yieldparam result [::Google::Cloud::Bigquery::DataTransfer::V1::DataSource]
234
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
235
+ #
236
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::DataSource]
237
+ #
238
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
239
+ def get_data_source request, options = nil
240
+ raise ::ArgumentError, "request must be provided" if request.nil?
241
+
242
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::GetDataSourceRequest
243
+
244
+ # Converts hash and nil to an options object
245
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
246
+
247
+ # Customize the options with defaults
248
+ call_metadata = @config.rpcs.get_data_source.metadata.to_h
249
+
250
+ # Set x-goog-api-client and x-goog-user-project headers
251
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
252
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
253
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
254
+ transports_version_send: [:rest]
255
+
256
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
257
+
258
+ options.apply_defaults timeout: @config.rpcs.get_data_source.timeout,
259
+ metadata: call_metadata,
260
+ retry_policy: @config.rpcs.get_data_source.retry_policy
261
+
262
+ options.apply_defaults timeout: @config.timeout,
263
+ metadata: @config.metadata,
264
+ retry_policy: @config.retry_policy
265
+
266
+ @data_transfer_service_stub.get_data_source request, options do |result, operation|
267
+ yield result, operation if block_given?
268
+ return result
269
+ end
270
+ rescue ::Gapic::Rest::Error => e
271
+ raise ::Google::Cloud::Error.from_error(e)
272
+ end
273
+
274
+ ##
275
+ # Lists supported data sources and returns their settings.
276
+ #
277
+ # @overload list_data_sources(request, options = nil)
278
+ # Pass arguments to `list_data_sources` via a request object, either of type
279
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::ListDataSourcesRequest} or an equivalent Hash.
280
+ #
281
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::ListDataSourcesRequest, ::Hash]
282
+ # A request object representing the call parameters. Required. To specify no
283
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
284
+ # @param options [::Gapic::CallOptions, ::Hash]
285
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
286
+ #
287
+ # @overload list_data_sources(parent: nil, page_token: nil, page_size: nil)
288
+ # Pass arguments to `list_data_sources` via keyword arguments. Note that at
289
+ # least one keyword argument is required. To specify no parameters, or to keep all
290
+ # the default parameter values, pass an empty Hash as a request object (see above).
291
+ #
292
+ # @param parent [::String]
293
+ # Required. The BigQuery project id for which data sources should be
294
+ # returned. Must be in the form: `projects/{project_id}` or
295
+ # `projects/{project_id}/locations/{location_id}`
296
+ # @param page_token [::String]
297
+ # Pagination token, which can be used to request a specific page
298
+ # of `ListDataSourcesRequest` list results. For multiple-page
299
+ # results, `ListDataSourcesResponse` outputs
300
+ # a `next_page` token, which can be used as the
301
+ # `page_token` value to request the next page of list results.
302
+ # @param page_size [::Integer]
303
+ # Page size. The default page size is the maximum value of 1000 results.
304
+ # @yield [result, operation] Access the result along with the TransportOperation object
305
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::DataSource>]
306
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
307
+ #
308
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::DataSource>]
309
+ #
310
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
311
+ def list_data_sources request, options = nil
312
+ raise ::ArgumentError, "request must be provided" if request.nil?
313
+
314
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::ListDataSourcesRequest
315
+
316
+ # Converts hash and nil to an options object
317
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
318
+
319
+ # Customize the options with defaults
320
+ call_metadata = @config.rpcs.list_data_sources.metadata.to_h
321
+
322
+ # Set x-goog-api-client and x-goog-user-project headers
323
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
324
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
325
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
326
+ transports_version_send: [:rest]
327
+
328
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
329
+
330
+ options.apply_defaults timeout: @config.rpcs.list_data_sources.timeout,
331
+ metadata: call_metadata,
332
+ retry_policy: @config.rpcs.list_data_sources.retry_policy
333
+
334
+ options.apply_defaults timeout: @config.timeout,
335
+ metadata: @config.metadata,
336
+ retry_policy: @config.retry_policy
337
+
338
+ @data_transfer_service_stub.list_data_sources request, options do |result, operation|
339
+ result = ::Gapic::Rest::PagedEnumerable.new @data_transfer_service_stub, :list_data_sources, "data_sources", request, result, options
340
+ yield result, operation if block_given?
341
+ return result
342
+ end
343
+ rescue ::Gapic::Rest::Error => e
344
+ raise ::Google::Cloud::Error.from_error(e)
345
+ end
346
+
347
+ ##
348
+ # Creates a new data transfer configuration.
349
+ #
350
+ # @overload create_transfer_config(request, options = nil)
351
+ # Pass arguments to `create_transfer_config` via a request object, either of type
352
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::CreateTransferConfigRequest} or an equivalent Hash.
353
+ #
354
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::CreateTransferConfigRequest, ::Hash]
355
+ # A request object representing the call parameters. Required. To specify no
356
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
357
+ # @param options [::Gapic::CallOptions, ::Hash]
358
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
359
+ #
360
+ # @overload create_transfer_config(parent: nil, transfer_config: nil, authorization_code: nil, version_info: nil, service_account_name: nil)
361
+ # Pass arguments to `create_transfer_config` via keyword arguments. Note that at
362
+ # least one keyword argument is required. To specify no parameters, or to keep all
363
+ # the default parameter values, pass an empty Hash as a request object (see above).
364
+ #
365
+ # @param parent [::String]
366
+ # Required. The BigQuery project id where the transfer configuration should
367
+ # be created. Must be in the format
368
+ # projects/\\{project_id}/locations/\\{location_id} or projects/\\{project_id}. If
369
+ # specified location and location of the destination bigquery dataset do not
370
+ # match - the request will fail.
371
+ # @param transfer_config [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig, ::Hash]
372
+ # Required. Data transfer configuration to create.
373
+ # @param authorization_code [::String]
374
+ # Optional OAuth2 authorization code to use with this transfer configuration.
375
+ # This is required only if `transferConfig.dataSourceId` is 'youtube_channel'
376
+ # and new credentials are needed, as indicated by `CheckValidCreds`. In order
377
+ # to obtain authorization_code, make a request to the following URL:
378
+ # <pre class="prettyprint" suppresswarning="true">
379
+ # https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=<var>client_id</var>&scope=<var>data_source_scopes</var>
380
+ # </pre>
381
+ # * The <var>client_id</var> is the OAuth client_id of the a data source as
382
+ # returned by ListDataSources method.
383
+ # * <var>data_source_scopes</var> are the scopes returned by ListDataSources
384
+ # method.
385
+ #
386
+ # Note that this should not be set when `service_account_name` is used to
387
+ # create the transfer config.
388
+ # @param version_info [::String]
389
+ # Optional version info. This is required only if
390
+ # `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials
391
+ # are needed, as indicated by `CheckValidCreds`. In order to obtain version
392
+ # info, make a request to the following URL:
393
+ # <pre class="prettyprint" suppresswarning="true">
394
+ # https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=<var>client_id</var>&scope=<var>data_source_scopes</var>
395
+ # </pre>
396
+ # * The <var>client_id</var> is the OAuth client_id of the a data source as
397
+ # returned by ListDataSources method.
398
+ # * <var>data_source_scopes</var> are the scopes returned by ListDataSources
399
+ # method.
400
+ #
401
+ # Note that this should not be set when `service_account_name` is used to
402
+ # create the transfer config.
403
+ # @param service_account_name [::String]
404
+ # Optional service account email. If this field is set, the transfer config
405
+ # will be created with this service account's credentials. It requires that
406
+ # the requesting user calling this API has permissions to act as this service
407
+ # account.
408
+ #
409
+ # Note that not all data sources support service account credentials when
410
+ # creating a transfer config. For the latest list of data sources, read about
411
+ # [using service
412
+ # accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
413
+ # @yield [result, operation] Access the result along with the TransportOperation object
414
+ # @yieldparam result [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig]
415
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
416
+ #
417
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig]
418
+ #
419
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
420
+ def create_transfer_config request, options = nil
421
+ raise ::ArgumentError, "request must be provided" if request.nil?
422
+
423
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::CreateTransferConfigRequest
424
+
425
+ # Converts hash and nil to an options object
426
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
427
+
428
+ # Customize the options with defaults
429
+ call_metadata = @config.rpcs.create_transfer_config.metadata.to_h
430
+
431
+ # Set x-goog-api-client and x-goog-user-project headers
432
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
433
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
434
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
435
+ transports_version_send: [:rest]
436
+
437
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
438
+
439
+ options.apply_defaults timeout: @config.rpcs.create_transfer_config.timeout,
440
+ metadata: call_metadata,
441
+ retry_policy: @config.rpcs.create_transfer_config.retry_policy
442
+
443
+ options.apply_defaults timeout: @config.timeout,
444
+ metadata: @config.metadata,
445
+ retry_policy: @config.retry_policy
446
+
447
+ @data_transfer_service_stub.create_transfer_config request, options do |result, operation|
448
+ yield result, operation if block_given?
449
+ return result
450
+ end
451
+ rescue ::Gapic::Rest::Error => e
452
+ raise ::Google::Cloud::Error.from_error(e)
453
+ end
454
+
455
+ ##
456
+ # Updates a data transfer configuration.
457
+ # All fields must be set, even if they are not updated.
458
+ #
459
+ # @overload update_transfer_config(request, options = nil)
460
+ # Pass arguments to `update_transfer_config` via a request object, either of type
461
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::UpdateTransferConfigRequest} or an equivalent Hash.
462
+ #
463
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::UpdateTransferConfigRequest, ::Hash]
464
+ # A request object representing the call parameters. Required. To specify no
465
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
466
+ # @param options [::Gapic::CallOptions, ::Hash]
467
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
468
+ #
469
+ # @overload update_transfer_config(transfer_config: nil, authorization_code: nil, update_mask: nil, version_info: nil, service_account_name: nil)
470
+ # Pass arguments to `update_transfer_config` via keyword arguments. Note that at
471
+ # least one keyword argument is required. To specify no parameters, or to keep all
472
+ # the default parameter values, pass an empty Hash as a request object (see above).
473
+ #
474
+ # @param transfer_config [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig, ::Hash]
475
+ # Required. Data transfer configuration to create.
476
+ # @param authorization_code [::String]
477
+ # Optional OAuth2 authorization code to use with this transfer configuration.
478
+ # This is required only if `transferConfig.dataSourceId` is 'youtube_channel'
479
+ # and new credentials are needed, as indicated by `CheckValidCreds`. In order
480
+ # to obtain authorization_code, make a request to the following URL:
481
+ # <pre class="prettyprint" suppresswarning="true">
482
+ # https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=<var>client_id</var>&scope=<var>data_source_scopes</var>
483
+ # </pre>
484
+ # * The <var>client_id</var> is the OAuth client_id of the a data source as
485
+ # returned by ListDataSources method.
486
+ # * <var>data_source_scopes</var> are the scopes returned by ListDataSources
487
+ # method.
488
+ #
489
+ # Note that this should not be set when `service_account_name` is used to
490
+ # update the transfer config.
491
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
492
+ # Required. Required list of fields to be updated in this request.
493
+ # @param version_info [::String]
494
+ # Optional version info. This is required only if
495
+ # `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials
496
+ # are needed, as indicated by `CheckValidCreds`. In order to obtain version
497
+ # info, make a request to the following URL:
498
+ # <pre class="prettyprint" suppresswarning="true">
499
+ # https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=<var>client_id</var>&scope=<var>data_source_scopes</var>
500
+ # </pre>
501
+ # * The <var>client_id</var> is the OAuth client_id of the a data source as
502
+ # returned by ListDataSources method.
503
+ # * <var>data_source_scopes</var> are the scopes returned by ListDataSources
504
+ # method.
505
+ #
506
+ # Note that this should not be set when `service_account_name` is used to
507
+ # update the transfer config.
508
+ # @param service_account_name [::String]
509
+ # Optional service account email. If this field is set, the transfer config
510
+ # will be created with this service account's credentials. It requires that
511
+ # the requesting user calling this API has permissions to act as this service
512
+ # account.
513
+ #
514
+ # Note that not all data sources support service account credentials when
515
+ # creating a transfer config. For the latest list of data sources, read about
516
+ # [using service
517
+ # accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
518
+ # @yield [result, operation] Access the result along with the TransportOperation object
519
+ # @yieldparam result [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig]
520
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
521
+ #
522
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig]
523
+ #
524
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
525
+ def update_transfer_config request, options = nil
526
+ raise ::ArgumentError, "request must be provided" if request.nil?
527
+
528
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::UpdateTransferConfigRequest
529
+
530
+ # Converts hash and nil to an options object
531
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
532
+
533
+ # Customize the options with defaults
534
+ call_metadata = @config.rpcs.update_transfer_config.metadata.to_h
535
+
536
+ # Set x-goog-api-client and x-goog-user-project headers
537
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
538
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
539
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
540
+ transports_version_send: [:rest]
541
+
542
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
543
+
544
+ options.apply_defaults timeout: @config.rpcs.update_transfer_config.timeout,
545
+ metadata: call_metadata,
546
+ retry_policy: @config.rpcs.update_transfer_config.retry_policy
547
+
548
+ options.apply_defaults timeout: @config.timeout,
549
+ metadata: @config.metadata,
550
+ retry_policy: @config.retry_policy
551
+
552
+ @data_transfer_service_stub.update_transfer_config request, options do |result, operation|
553
+ yield result, operation if block_given?
554
+ return result
555
+ end
556
+ rescue ::Gapic::Rest::Error => e
557
+ raise ::Google::Cloud::Error.from_error(e)
558
+ end
559
+
560
+ ##
561
+ # Deletes a data transfer configuration, including any associated transfer
562
+ # runs and logs.
563
+ #
564
+ # @overload delete_transfer_config(request, options = nil)
565
+ # Pass arguments to `delete_transfer_config` via a request object, either of type
566
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferConfigRequest} or an equivalent Hash.
567
+ #
568
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferConfigRequest, ::Hash]
569
+ # A request object representing the call parameters. Required. To specify no
570
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
571
+ # @param options [::Gapic::CallOptions, ::Hash]
572
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
573
+ #
574
+ # @overload delete_transfer_config(name: nil)
575
+ # Pass arguments to `delete_transfer_config` via keyword arguments. Note that at
576
+ # least one keyword argument is required. To specify no parameters, or to keep all
577
+ # the default parameter values, pass an empty Hash as a request object (see above).
578
+ #
579
+ # @param name [::String]
580
+ # Required. The field will contain name of the resource requested, for
581
+ # example: `projects/{project_id}/transferConfigs/{config_id}` or
582
+ # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
583
+ # @yield [result, operation] Access the result along with the TransportOperation object
584
+ # @yieldparam result [::Google::Protobuf::Empty]
585
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
586
+ #
587
+ # @return [::Google::Protobuf::Empty]
588
+ #
589
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
590
+ def delete_transfer_config request, options = nil
591
+ raise ::ArgumentError, "request must be provided" if request.nil?
592
+
593
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferConfigRequest
594
+
595
+ # Converts hash and nil to an options object
596
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
597
+
598
+ # Customize the options with defaults
599
+ call_metadata = @config.rpcs.delete_transfer_config.metadata.to_h
600
+
601
+ # Set x-goog-api-client and x-goog-user-project headers
602
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
603
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
604
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
605
+ transports_version_send: [:rest]
606
+
607
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
608
+
609
+ options.apply_defaults timeout: @config.rpcs.delete_transfer_config.timeout,
610
+ metadata: call_metadata,
611
+ retry_policy: @config.rpcs.delete_transfer_config.retry_policy
612
+
613
+ options.apply_defaults timeout: @config.timeout,
614
+ metadata: @config.metadata,
615
+ retry_policy: @config.retry_policy
616
+
617
+ @data_transfer_service_stub.delete_transfer_config request, options do |result, operation|
618
+ yield result, operation if block_given?
619
+ return result
620
+ end
621
+ rescue ::Gapic::Rest::Error => e
622
+ raise ::Google::Cloud::Error.from_error(e)
623
+ end
624
+
625
+ ##
626
+ # Returns information about a data transfer config.
627
+ #
628
+ # @overload get_transfer_config(request, options = nil)
629
+ # Pass arguments to `get_transfer_config` via a request object, either of type
630
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::GetTransferConfigRequest} or an equivalent Hash.
631
+ #
632
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::GetTransferConfigRequest, ::Hash]
633
+ # A request object representing the call parameters. Required. To specify no
634
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
635
+ # @param options [::Gapic::CallOptions, ::Hash]
636
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
637
+ #
638
+ # @overload get_transfer_config(name: nil)
639
+ # Pass arguments to `get_transfer_config` via keyword arguments. Note that at
640
+ # least one keyword argument is required. To specify no parameters, or to keep all
641
+ # the default parameter values, pass an empty Hash as a request object (see above).
642
+ #
643
+ # @param name [::String]
644
+ # Required. The field will contain name of the resource requested, for
645
+ # example: `projects/{project_id}/transferConfigs/{config_id}` or
646
+ # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
647
+ # @yield [result, operation] Access the result along with the TransportOperation object
648
+ # @yieldparam result [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig]
649
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
650
+ #
651
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig]
652
+ #
653
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
654
+ def get_transfer_config request, options = nil
655
+ raise ::ArgumentError, "request must be provided" if request.nil?
656
+
657
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::GetTransferConfigRequest
658
+
659
+ # Converts hash and nil to an options object
660
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
661
+
662
+ # Customize the options with defaults
663
+ call_metadata = @config.rpcs.get_transfer_config.metadata.to_h
664
+
665
+ # Set x-goog-api-client and x-goog-user-project headers
666
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
667
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
668
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
669
+ transports_version_send: [:rest]
670
+
671
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
672
+
673
+ options.apply_defaults timeout: @config.rpcs.get_transfer_config.timeout,
674
+ metadata: call_metadata,
675
+ retry_policy: @config.rpcs.get_transfer_config.retry_policy
676
+
677
+ options.apply_defaults timeout: @config.timeout,
678
+ metadata: @config.metadata,
679
+ retry_policy: @config.retry_policy
680
+
681
+ @data_transfer_service_stub.get_transfer_config request, options do |result, operation|
682
+ yield result, operation if block_given?
683
+ return result
684
+ end
685
+ rescue ::Gapic::Rest::Error => e
686
+ raise ::Google::Cloud::Error.from_error(e)
687
+ end
688
+
689
+ ##
690
+ # Returns information about all transfer configs owned by a project in the
691
+ # specified location.
692
+ #
693
+ # @overload list_transfer_configs(request, options = nil)
694
+ # Pass arguments to `list_transfer_configs` via a request object, either of type
695
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferConfigsRequest} or an equivalent Hash.
696
+ #
697
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferConfigsRequest, ::Hash]
698
+ # A request object representing the call parameters. Required. To specify no
699
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
700
+ # @param options [::Gapic::CallOptions, ::Hash]
701
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
702
+ #
703
+ # @overload list_transfer_configs(parent: nil, data_source_ids: nil, page_token: nil, page_size: nil)
704
+ # Pass arguments to `list_transfer_configs` via keyword arguments. Note that at
705
+ # least one keyword argument is required. To specify no parameters, or to keep all
706
+ # the default parameter values, pass an empty Hash as a request object (see above).
707
+ #
708
+ # @param parent [::String]
709
+ # Required. The BigQuery project id for which transfer configs
710
+ # should be returned: `projects/{project_id}` or
711
+ # `projects/{project_id}/locations/{location_id}`
712
+ # @param data_source_ids [::Array<::String>]
713
+ # When specified, only configurations of requested data sources are returned.
714
+ # @param page_token [::String]
715
+ # Pagination token, which can be used to request a specific page
716
+ # of `ListTransfersRequest` list results. For multiple-page
717
+ # results, `ListTransfersResponse` outputs
718
+ # a `next_page` token, which can be used as the
719
+ # `page_token` value to request the next page of list results.
720
+ # @param page_size [::Integer]
721
+ # Page size. The default page size is the maximum value of 1000 results.
722
+ # @yield [result, operation] Access the result along with the TransportOperation object
723
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig>]
724
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
725
+ #
726
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig>]
727
+ #
728
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
729
+ def list_transfer_configs request, options = nil
730
+ raise ::ArgumentError, "request must be provided" if request.nil?
731
+
732
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferConfigsRequest
733
+
734
+ # Converts hash and nil to an options object
735
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
736
+
737
+ # Customize the options with defaults
738
+ call_metadata = @config.rpcs.list_transfer_configs.metadata.to_h
739
+
740
+ # Set x-goog-api-client and x-goog-user-project headers
741
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
742
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
743
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
744
+ transports_version_send: [:rest]
745
+
746
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
747
+
748
+ options.apply_defaults timeout: @config.rpcs.list_transfer_configs.timeout,
749
+ metadata: call_metadata,
750
+ retry_policy: @config.rpcs.list_transfer_configs.retry_policy
751
+
752
+ options.apply_defaults timeout: @config.timeout,
753
+ metadata: @config.metadata,
754
+ retry_policy: @config.retry_policy
755
+
756
+ @data_transfer_service_stub.list_transfer_configs request, options do |result, operation|
757
+ result = ::Gapic::Rest::PagedEnumerable.new @data_transfer_service_stub, :list_transfer_configs, "transfer_configs", request, result, options
758
+ yield result, operation if block_given?
759
+ return result
760
+ end
761
+ rescue ::Gapic::Rest::Error => e
762
+ raise ::Google::Cloud::Error.from_error(e)
763
+ end
764
+
765
+ ##
766
+ # Creates transfer runs for a time range [start_time, end_time].
767
+ # For each date - or whatever granularity the data source supports - in the
768
+ # range, one transfer run is created.
769
+ # Note that runs are created per UTC time in the time range.
770
+ # DEPRECATED: use StartManualTransferRuns instead.
771
+ #
772
+ # @overload schedule_transfer_runs(request, options = nil)
773
+ # Pass arguments to `schedule_transfer_runs` via a request object, either of type
774
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsRequest} or an equivalent Hash.
775
+ #
776
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsRequest, ::Hash]
777
+ # A request object representing the call parameters. Required. To specify no
778
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
779
+ # @param options [::Gapic::CallOptions, ::Hash]
780
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
781
+ #
782
+ # @overload schedule_transfer_runs(parent: nil, start_time: nil, end_time: nil)
783
+ # Pass arguments to `schedule_transfer_runs` via keyword arguments. Note that at
784
+ # least one keyword argument is required. To specify no parameters, or to keep all
785
+ # the default parameter values, pass an empty Hash as a request object (see above).
786
+ #
787
+ # @param parent [::String]
788
+ # Required. Transfer configuration name in the form:
789
+ # `projects/{project_id}/transferConfigs/{config_id}` or
790
+ # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
791
+ # @param start_time [::Google::Protobuf::Timestamp, ::Hash]
792
+ # Required. Start time of the range of transfer runs. For example,
793
+ # `"2017-05-25T00:00:00+00:00"`.
794
+ # @param end_time [::Google::Protobuf::Timestamp, ::Hash]
795
+ # Required. End time of the range of transfer runs. For example,
796
+ # `"2017-05-30T00:00:00+00:00"`.
797
+ # @yield [result, operation] Access the result along with the TransportOperation object
798
+ # @yieldparam result [::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsResponse]
799
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
800
+ #
801
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsResponse]
802
+ #
803
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
804
+ def schedule_transfer_runs request, options = nil
805
+ raise ::ArgumentError, "request must be provided" if request.nil?
806
+
807
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsRequest
808
+
809
+ # Converts hash and nil to an options object
810
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
811
+
812
+ # Customize the options with defaults
813
+ call_metadata = @config.rpcs.schedule_transfer_runs.metadata.to_h
814
+
815
+ # Set x-goog-api-client and x-goog-user-project headers
816
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
817
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
818
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
819
+ transports_version_send: [:rest]
820
+
821
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
822
+
823
+ options.apply_defaults timeout: @config.rpcs.schedule_transfer_runs.timeout,
824
+ metadata: call_metadata,
825
+ retry_policy: @config.rpcs.schedule_transfer_runs.retry_policy
826
+
827
+ options.apply_defaults timeout: @config.timeout,
828
+ metadata: @config.metadata,
829
+ retry_policy: @config.retry_policy
830
+
831
+ @data_transfer_service_stub.schedule_transfer_runs request, options do |result, operation|
832
+ yield result, operation if block_given?
833
+ return result
834
+ end
835
+ rescue ::Gapic::Rest::Error => e
836
+ raise ::Google::Cloud::Error.from_error(e)
837
+ end
838
+
839
+ ##
840
+ # Start manual transfer runs to be executed now with schedule_time equal to
841
+ # current time. The transfer runs can be created for a time range where the
842
+ # run_time is between start_time (inclusive) and end_time (exclusive), or for
843
+ # a specific run_time.
844
+ #
845
+ # @overload start_manual_transfer_runs(request, options = nil)
846
+ # Pass arguments to `start_manual_transfer_runs` via a request object, either of type
847
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsRequest} or an equivalent Hash.
848
+ #
849
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsRequest, ::Hash]
850
+ # A request object representing the call parameters. Required. To specify no
851
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
852
+ # @param options [::Gapic::CallOptions, ::Hash]
853
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
854
+ #
855
+ # @overload start_manual_transfer_runs(parent: nil, requested_time_range: nil, requested_run_time: nil)
856
+ # Pass arguments to `start_manual_transfer_runs` via keyword arguments. Note that at
857
+ # least one keyword argument is required. To specify no parameters, or to keep all
858
+ # the default parameter values, pass an empty Hash as a request object (see above).
859
+ #
860
+ # @param parent [::String]
861
+ # Transfer configuration name in the form:
862
+ # `projects/{project_id}/transferConfigs/{config_id}` or
863
+ # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
864
+ # @param requested_time_range [::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsRequest::TimeRange, ::Hash]
865
+ # Time range for the transfer runs that should be started.
866
+ # @param requested_run_time [::Google::Protobuf::Timestamp, ::Hash]
867
+ # Specific run_time for a transfer run to be started. The
868
+ # requested_run_time must not be in the future.
869
+ # @yield [result, operation] Access the result along with the TransportOperation object
870
+ # @yieldparam result [::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsResponse]
871
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
872
+ #
873
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsResponse]
874
+ #
875
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
876
+ def start_manual_transfer_runs request, options = nil
877
+ raise ::ArgumentError, "request must be provided" if request.nil?
878
+
879
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsRequest
880
+
881
+ # Converts hash and nil to an options object
882
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
883
+
884
+ # Customize the options with defaults
885
+ call_metadata = @config.rpcs.start_manual_transfer_runs.metadata.to_h
886
+
887
+ # Set x-goog-api-client and x-goog-user-project headers
888
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
889
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
890
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
891
+ transports_version_send: [:rest]
892
+
893
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
894
+
895
+ options.apply_defaults timeout: @config.rpcs.start_manual_transfer_runs.timeout,
896
+ metadata: call_metadata,
897
+ retry_policy: @config.rpcs.start_manual_transfer_runs.retry_policy
898
+
899
+ options.apply_defaults timeout: @config.timeout,
900
+ metadata: @config.metadata,
901
+ retry_policy: @config.retry_policy
902
+
903
+ @data_transfer_service_stub.start_manual_transfer_runs request, options do |result, operation|
904
+ yield result, operation if block_given?
905
+ return result
906
+ end
907
+ rescue ::Gapic::Rest::Error => e
908
+ raise ::Google::Cloud::Error.from_error(e)
909
+ end
910
+
911
+ ##
912
+ # Returns information about the particular transfer run.
913
+ #
914
+ # @overload get_transfer_run(request, options = nil)
915
+ # Pass arguments to `get_transfer_run` via a request object, either of type
916
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::GetTransferRunRequest} or an equivalent Hash.
917
+ #
918
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::GetTransferRunRequest, ::Hash]
919
+ # A request object representing the call parameters. Required. To specify no
920
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
921
+ # @param options [::Gapic::CallOptions, ::Hash]
922
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
923
+ #
924
+ # @overload get_transfer_run(name: nil)
925
+ # Pass arguments to `get_transfer_run` via keyword arguments. Note that at
926
+ # least one keyword argument is required. To specify no parameters, or to keep all
927
+ # the default parameter values, pass an empty Hash as a request object (see above).
928
+ #
929
+ # @param name [::String]
930
+ # Required. The field will contain name of the resource requested, for
931
+ # example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`
932
+ # or
933
+ # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
934
+ # @yield [result, operation] Access the result along with the TransportOperation object
935
+ # @yieldparam result [::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun]
936
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
937
+ #
938
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun]
939
+ #
940
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
941
+ def get_transfer_run request, options = nil
942
+ raise ::ArgumentError, "request must be provided" if request.nil?
943
+
944
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::GetTransferRunRequest
945
+
946
+ # Converts hash and nil to an options object
947
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
948
+
949
+ # Customize the options with defaults
950
+ call_metadata = @config.rpcs.get_transfer_run.metadata.to_h
951
+
952
+ # Set x-goog-api-client and x-goog-user-project headers
953
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
954
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
955
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
956
+ transports_version_send: [:rest]
957
+
958
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
959
+
960
+ options.apply_defaults timeout: @config.rpcs.get_transfer_run.timeout,
961
+ metadata: call_metadata,
962
+ retry_policy: @config.rpcs.get_transfer_run.retry_policy
963
+
964
+ options.apply_defaults timeout: @config.timeout,
965
+ metadata: @config.metadata,
966
+ retry_policy: @config.retry_policy
967
+
968
+ @data_transfer_service_stub.get_transfer_run request, options do |result, operation|
969
+ yield result, operation if block_given?
970
+ return result
971
+ end
972
+ rescue ::Gapic::Rest::Error => e
973
+ raise ::Google::Cloud::Error.from_error(e)
974
+ end
975
+
976
+ ##
977
+ # Deletes the specified transfer run.
978
+ #
979
+ # @overload delete_transfer_run(request, options = nil)
980
+ # Pass arguments to `delete_transfer_run` via a request object, either of type
981
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferRunRequest} or an equivalent Hash.
982
+ #
983
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferRunRequest, ::Hash]
984
+ # A request object representing the call parameters. Required. To specify no
985
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
986
+ # @param options [::Gapic::CallOptions, ::Hash]
987
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
988
+ #
989
+ # @overload delete_transfer_run(name: nil)
990
+ # Pass arguments to `delete_transfer_run` via keyword arguments. Note that at
991
+ # least one keyword argument is required. To specify no parameters, or to keep all
992
+ # the default parameter values, pass an empty Hash as a request object (see above).
993
+ #
994
+ # @param name [::String]
995
+ # Required. The field will contain name of the resource requested, for
996
+ # example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`
997
+ # or
998
+ # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
999
+ # @yield [result, operation] Access the result along with the TransportOperation object
1000
+ # @yieldparam result [::Google::Protobuf::Empty]
1001
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1002
+ #
1003
+ # @return [::Google::Protobuf::Empty]
1004
+ #
1005
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1006
+ def delete_transfer_run request, options = nil
1007
+ raise ::ArgumentError, "request must be provided" if request.nil?
1008
+
1009
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferRunRequest
1010
+
1011
+ # Converts hash and nil to an options object
1012
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1013
+
1014
+ # Customize the options with defaults
1015
+ call_metadata = @config.rpcs.delete_transfer_run.metadata.to_h
1016
+
1017
+ # Set x-goog-api-client and x-goog-user-project headers
1018
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1019
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1020
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
1021
+ transports_version_send: [:rest]
1022
+
1023
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1024
+
1025
+ options.apply_defaults timeout: @config.rpcs.delete_transfer_run.timeout,
1026
+ metadata: call_metadata,
1027
+ retry_policy: @config.rpcs.delete_transfer_run.retry_policy
1028
+
1029
+ options.apply_defaults timeout: @config.timeout,
1030
+ metadata: @config.metadata,
1031
+ retry_policy: @config.retry_policy
1032
+
1033
+ @data_transfer_service_stub.delete_transfer_run request, options do |result, operation|
1034
+ yield result, operation if block_given?
1035
+ return result
1036
+ end
1037
+ rescue ::Gapic::Rest::Error => e
1038
+ raise ::Google::Cloud::Error.from_error(e)
1039
+ end
1040
+
1041
+ ##
1042
+ # Returns information about running and completed transfer runs.
1043
+ #
1044
+ # @overload list_transfer_runs(request, options = nil)
1045
+ # Pass arguments to `list_transfer_runs` via a request object, either of type
1046
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferRunsRequest} or an equivalent Hash.
1047
+ #
1048
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferRunsRequest, ::Hash]
1049
+ # A request object representing the call parameters. Required. To specify no
1050
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1051
+ # @param options [::Gapic::CallOptions, ::Hash]
1052
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1053
+ #
1054
+ # @overload list_transfer_runs(parent: nil, states: nil, page_token: nil, page_size: nil, run_attempt: nil)
1055
+ # Pass arguments to `list_transfer_runs` via keyword arguments. Note that at
1056
+ # least one keyword argument is required. To specify no parameters, or to keep all
1057
+ # the default parameter values, pass an empty Hash as a request object (see above).
1058
+ #
1059
+ # @param parent [::String]
1060
+ # Required. Name of transfer configuration for which transfer runs should be
1061
+ # retrieved. Format of transfer configuration resource name is:
1062
+ # `projects/{project_id}/transferConfigs/{config_id}` or
1063
+ # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
1064
+ # @param states [::Array<::Google::Cloud::Bigquery::DataTransfer::V1::TransferState>]
1065
+ # When specified, only transfer runs with requested states are returned.
1066
+ # @param page_token [::String]
1067
+ # Pagination token, which can be used to request a specific page
1068
+ # of `ListTransferRunsRequest` list results. For multiple-page
1069
+ # results, `ListTransferRunsResponse` outputs
1070
+ # a `next_page` token, which can be used as the
1071
+ # `page_token` value to request the next page of list results.
1072
+ # @param page_size [::Integer]
1073
+ # Page size. The default page size is the maximum value of 1000 results.
1074
+ # @param run_attempt [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferRunsRequest::RunAttempt]
1075
+ # Indicates how run attempts are to be pulled.
1076
+ # @yield [result, operation] Access the result along with the TransportOperation object
1077
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun>]
1078
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1079
+ #
1080
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun>]
1081
+ #
1082
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1083
+ def list_transfer_runs request, options = nil
1084
+ raise ::ArgumentError, "request must be provided" if request.nil?
1085
+
1086
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferRunsRequest
1087
+
1088
+ # Converts hash and nil to an options object
1089
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1090
+
1091
+ # Customize the options with defaults
1092
+ call_metadata = @config.rpcs.list_transfer_runs.metadata.to_h
1093
+
1094
+ # Set x-goog-api-client and x-goog-user-project headers
1095
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1096
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1097
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
1098
+ transports_version_send: [:rest]
1099
+
1100
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1101
+
1102
+ options.apply_defaults timeout: @config.rpcs.list_transfer_runs.timeout,
1103
+ metadata: call_metadata,
1104
+ retry_policy: @config.rpcs.list_transfer_runs.retry_policy
1105
+
1106
+ options.apply_defaults timeout: @config.timeout,
1107
+ metadata: @config.metadata,
1108
+ retry_policy: @config.retry_policy
1109
+
1110
+ @data_transfer_service_stub.list_transfer_runs request, options do |result, operation|
1111
+ result = ::Gapic::Rest::PagedEnumerable.new @data_transfer_service_stub, :list_transfer_runs, "transfer_runs", request, result, options
1112
+ yield result, operation if block_given?
1113
+ return result
1114
+ end
1115
+ rescue ::Gapic::Rest::Error => e
1116
+ raise ::Google::Cloud::Error.from_error(e)
1117
+ end
1118
+
1119
+ ##
1120
+ # Returns log messages for the transfer run.
1121
+ #
1122
+ # @overload list_transfer_logs(request, options = nil)
1123
+ # Pass arguments to `list_transfer_logs` via a request object, either of type
1124
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferLogsRequest} or an equivalent Hash.
1125
+ #
1126
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferLogsRequest, ::Hash]
1127
+ # A request object representing the call parameters. Required. To specify no
1128
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1129
+ # @param options [::Gapic::CallOptions, ::Hash]
1130
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1131
+ #
1132
+ # @overload list_transfer_logs(parent: nil, page_token: nil, page_size: nil, message_types: nil)
1133
+ # Pass arguments to `list_transfer_logs` via keyword arguments. Note that at
1134
+ # least one keyword argument is required. To specify no parameters, or to keep all
1135
+ # the default parameter values, pass an empty Hash as a request object (see above).
1136
+ #
1137
+ # @param parent [::String]
1138
+ # Required. Transfer run name in the form:
1139
+ # `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
1140
+ # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
1141
+ # @param page_token [::String]
1142
+ # Pagination token, which can be used to request a specific page
1143
+ # of `ListTransferLogsRequest` list results. For multiple-page
1144
+ # results, `ListTransferLogsResponse` outputs
1145
+ # a `next_page` token, which can be used as the
1146
+ # `page_token` value to request the next page of list results.
1147
+ # @param page_size [::Integer]
1148
+ # Page size. The default page size is the maximum value of 1000 results.
1149
+ # @param message_types [::Array<::Google::Cloud::Bigquery::DataTransfer::V1::TransferMessage::MessageSeverity>]
1150
+ # Message types to return. If not populated - INFO, WARNING and ERROR
1151
+ # messages are returned.
1152
+ # @yield [result, operation] Access the result along with the TransportOperation object
1153
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferMessage>]
1154
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1155
+ #
1156
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferMessage>]
1157
+ #
1158
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1159
+ def list_transfer_logs request, options = nil
1160
+ raise ::ArgumentError, "request must be provided" if request.nil?
1161
+
1162
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferLogsRequest
1163
+
1164
+ # Converts hash and nil to an options object
1165
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1166
+
1167
+ # Customize the options with defaults
1168
+ call_metadata = @config.rpcs.list_transfer_logs.metadata.to_h
1169
+
1170
+ # Set x-goog-api-client and x-goog-user-project headers
1171
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1172
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1173
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
1174
+ transports_version_send: [:rest]
1175
+
1176
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1177
+
1178
+ options.apply_defaults timeout: @config.rpcs.list_transfer_logs.timeout,
1179
+ metadata: call_metadata,
1180
+ retry_policy: @config.rpcs.list_transfer_logs.retry_policy
1181
+
1182
+ options.apply_defaults timeout: @config.timeout,
1183
+ metadata: @config.metadata,
1184
+ retry_policy: @config.retry_policy
1185
+
1186
+ @data_transfer_service_stub.list_transfer_logs request, options do |result, operation|
1187
+ result = ::Gapic::Rest::PagedEnumerable.new @data_transfer_service_stub, :list_transfer_logs, "transfer_messages", request, result, options
1188
+ yield result, operation if block_given?
1189
+ return result
1190
+ end
1191
+ rescue ::Gapic::Rest::Error => e
1192
+ raise ::Google::Cloud::Error.from_error(e)
1193
+ end
1194
+
1195
+ ##
1196
+ # Returns true if valid credentials exist for the given data source and
1197
+ # requesting user.
1198
+ #
1199
+ # @overload check_valid_creds(request, options = nil)
1200
+ # Pass arguments to `check_valid_creds` via a request object, either of type
1201
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsRequest} or an equivalent Hash.
1202
+ #
1203
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsRequest, ::Hash]
1204
+ # A request object representing the call parameters. Required. To specify no
1205
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1206
+ # @param options [::Gapic::CallOptions, ::Hash]
1207
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1208
+ #
1209
+ # @overload check_valid_creds(name: nil)
1210
+ # Pass arguments to `check_valid_creds` via keyword arguments. Note that at
1211
+ # least one keyword argument is required. To specify no parameters, or to keep all
1212
+ # the default parameter values, pass an empty Hash as a request object (see above).
1213
+ #
1214
+ # @param name [::String]
1215
+ # Required. The data source in the form:
1216
+ # `projects/{project_id}/dataSources/{data_source_id}` or
1217
+ # `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
1218
+ # @yield [result, operation] Access the result along with the TransportOperation object
1219
+ # @yieldparam result [::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsResponse]
1220
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1221
+ #
1222
+ # @return [::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsResponse]
1223
+ #
1224
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1225
+ def check_valid_creds request, options = nil
1226
+ raise ::ArgumentError, "request must be provided" if request.nil?
1227
+
1228
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsRequest
1229
+
1230
+ # Converts hash and nil to an options object
1231
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1232
+
1233
+ # Customize the options with defaults
1234
+ call_metadata = @config.rpcs.check_valid_creds.metadata.to_h
1235
+
1236
+ # Set x-goog-api-client and x-goog-user-project headers
1237
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1238
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1239
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
1240
+ transports_version_send: [:rest]
1241
+
1242
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1243
+
1244
+ options.apply_defaults timeout: @config.rpcs.check_valid_creds.timeout,
1245
+ metadata: call_metadata,
1246
+ retry_policy: @config.rpcs.check_valid_creds.retry_policy
1247
+
1248
+ options.apply_defaults timeout: @config.timeout,
1249
+ metadata: @config.metadata,
1250
+ retry_policy: @config.retry_policy
1251
+
1252
+ @data_transfer_service_stub.check_valid_creds request, options do |result, operation|
1253
+ yield result, operation if block_given?
1254
+ return result
1255
+ end
1256
+ rescue ::Gapic::Rest::Error => e
1257
+ raise ::Google::Cloud::Error.from_error(e)
1258
+ end
1259
+
1260
+ ##
1261
+ # Enroll data sources in a user project. This allows users to create transfer
1262
+ # configurations for these data sources. They will also appear in the
1263
+ # ListDataSources RPC and as such, will appear in the
1264
+ # [BigQuery UI](https://console.cloud.google.com/bigquery), and the documents
1265
+ # can be found in the public guide for
1266
+ # [BigQuery Web UI](https://cloud.google.com/bigquery/bigquery-web-ui) and
1267
+ # [Data Transfer
1268
+ # Service](https://cloud.google.com/bigquery/docs/working-with-transfers).
1269
+ #
1270
+ # @overload enroll_data_sources(request, options = nil)
1271
+ # Pass arguments to `enroll_data_sources` via a request object, either of type
1272
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::EnrollDataSourcesRequest} or an equivalent Hash.
1273
+ #
1274
+ # @param request [::Google::Cloud::Bigquery::DataTransfer::V1::EnrollDataSourcesRequest, ::Hash]
1275
+ # A request object representing the call parameters. Required. To specify no
1276
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1277
+ # @param options [::Gapic::CallOptions, ::Hash]
1278
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1279
+ #
1280
+ # @overload enroll_data_sources(name: nil, data_source_ids: nil)
1281
+ # Pass arguments to `enroll_data_sources` via keyword arguments. Note that at
1282
+ # least one keyword argument is required. To specify no parameters, or to keep all
1283
+ # the default parameter values, pass an empty Hash as a request object (see above).
1284
+ #
1285
+ # @param name [::String]
1286
+ # The name of the project resource in the form: `projects/{project_id}`
1287
+ # @param data_source_ids [::Array<::String>]
1288
+ # Data sources that are enrolled. It is required to provide at least one
1289
+ # data source id.
1290
+ # @yield [result, operation] Access the result along with the TransportOperation object
1291
+ # @yieldparam result [::Google::Protobuf::Empty]
1292
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1293
+ #
1294
+ # @return [::Google::Protobuf::Empty]
1295
+ #
1296
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1297
+ def enroll_data_sources request, options = nil
1298
+ raise ::ArgumentError, "request must be provided" if request.nil?
1299
+
1300
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::DataTransfer::V1::EnrollDataSourcesRequest
1301
+
1302
+ # Converts hash and nil to an options object
1303
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1304
+
1305
+ # Customize the options with defaults
1306
+ call_metadata = @config.rpcs.enroll_data_sources.metadata.to_h
1307
+
1308
+ # Set x-goog-api-client and x-goog-user-project headers
1309
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1310
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1311
+ gapic_version: ::Google::Cloud::Bigquery::DataTransfer::V1::VERSION,
1312
+ transports_version_send: [:rest]
1313
+
1314
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1315
+
1316
+ options.apply_defaults timeout: @config.rpcs.enroll_data_sources.timeout,
1317
+ metadata: call_metadata,
1318
+ retry_policy: @config.rpcs.enroll_data_sources.retry_policy
1319
+
1320
+ options.apply_defaults timeout: @config.timeout,
1321
+ metadata: @config.metadata,
1322
+ retry_policy: @config.retry_policy
1323
+
1324
+ @data_transfer_service_stub.enroll_data_sources request, options do |result, operation|
1325
+ yield result, operation if block_given?
1326
+ return result
1327
+ end
1328
+ rescue ::Gapic::Rest::Error => e
1329
+ raise ::Google::Cloud::Error.from_error(e)
1330
+ end
1331
+
1332
+ ##
1333
+ # Configuration class for the DataTransferService REST API.
1334
+ #
1335
+ # This class represents the configuration for DataTransferService REST,
1336
+ # providing control over timeouts, retry behavior, logging, transport
1337
+ # parameters, and other low-level controls. Certain parameters can also be
1338
+ # applied individually to specific RPCs. See
1339
+ # {::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Rest::Client::Configuration::Rpcs}
1340
+ # for a list of RPCs that can be configured independently.
1341
+ #
1342
+ # Configuration can be applied globally to all clients, or to a single client
1343
+ # on construction.
1344
+ #
1345
+ # @example
1346
+ #
1347
+ # # Modify the global config, setting the timeout for
1348
+ # # get_data_source to 20 seconds,
1349
+ # # and all remaining timeouts to 10 seconds.
1350
+ # ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Rest::Client.configure do |config|
1351
+ # config.timeout = 10.0
1352
+ # config.rpcs.get_data_source.timeout = 20.0
1353
+ # end
1354
+ #
1355
+ # # Apply the above configuration only to a new client.
1356
+ # client = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Rest::Client.new do |config|
1357
+ # config.timeout = 10.0
1358
+ # config.rpcs.get_data_source.timeout = 20.0
1359
+ # end
1360
+ #
1361
+ # @!attribute [rw] endpoint
1362
+ # The hostname or hostname:port of the service endpoint.
1363
+ # Defaults to `"bigquerydatatransfer.googleapis.com"`.
1364
+ # @return [::String]
1365
+ # @!attribute [rw] credentials
1366
+ # Credentials to send with calls. You may provide any of the following types:
1367
+ # * (`String`) The path to a service account key file in JSON format
1368
+ # * (`Hash`) A service account key as a Hash
1369
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1370
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1371
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1372
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1373
+ # * (`nil`) indicating no credentials
1374
+ # @return [::Object]
1375
+ # @!attribute [rw] scope
1376
+ # The OAuth scopes
1377
+ # @return [::Array<::String>]
1378
+ # @!attribute [rw] lib_name
1379
+ # The library name as recorded in instrumentation and logging
1380
+ # @return [::String]
1381
+ # @!attribute [rw] lib_version
1382
+ # The library version as recorded in instrumentation and logging
1383
+ # @return [::String]
1384
+ # @!attribute [rw] timeout
1385
+ # The call timeout in seconds.
1386
+ # @return [::Numeric]
1387
+ # @!attribute [rw] metadata
1388
+ # Additional headers to be sent with the call.
1389
+ # @return [::Hash{::Symbol=>::String}]
1390
+ # @!attribute [rw] retry_policy
1391
+ # The retry policy. The value is a hash with the following keys:
1392
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1393
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1394
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1395
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1396
+ # trigger a retry.
1397
+ # @return [::Hash]
1398
+ # @!attribute [rw] quota_project
1399
+ # A separate project against which to charge quota.
1400
+ # @return [::String]
1401
+ #
1402
+ class Configuration
1403
+ extend ::Gapic::Config
1404
+
1405
+ config_attr :endpoint, "bigquerydatatransfer.googleapis.com", ::String
1406
+ config_attr :credentials, nil do |value|
1407
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1408
+ allowed.any? { |klass| klass === value }
1409
+ end
1410
+ config_attr :scope, nil, ::String, ::Array, nil
1411
+ config_attr :lib_name, nil, ::String, nil
1412
+ config_attr :lib_version, nil, ::String, nil
1413
+ config_attr :timeout, nil, ::Numeric, nil
1414
+ config_attr :metadata, nil, ::Hash, nil
1415
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1416
+ config_attr :quota_project, nil, ::String, nil
1417
+
1418
+ # @private
1419
+ # Overrides for http bindings for the RPCs of this service
1420
+ # are only used when this service is used as mixin, and only
1421
+ # by the host service.
1422
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1423
+ config_attr :bindings_override, {}, ::Hash, nil
1424
+
1425
+ # @private
1426
+ def initialize parent_config = nil
1427
+ @parent_config = parent_config unless parent_config.nil?
1428
+
1429
+ yield self if block_given?
1430
+ end
1431
+
1432
+ ##
1433
+ # Configurations for individual RPCs
1434
+ # @return [Rpcs]
1435
+ #
1436
+ def rpcs
1437
+ @rpcs ||= begin
1438
+ parent_rpcs = nil
1439
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1440
+ Rpcs.new parent_rpcs
1441
+ end
1442
+ end
1443
+
1444
+ ##
1445
+ # Configuration RPC class for the DataTransferService API.
1446
+ #
1447
+ # Includes fields providing the configuration for each RPC in this service.
1448
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1449
+ # the following configuration fields:
1450
+ #
1451
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1452
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1453
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1454
+ # include the following keys:
1455
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1456
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1457
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1458
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1459
+ # trigger a retry.
1460
+ #
1461
+ class Rpcs
1462
+ ##
1463
+ # RPC-specific configuration for `get_data_source`
1464
+ # @return [::Gapic::Config::Method]
1465
+ #
1466
+ attr_reader :get_data_source
1467
+ ##
1468
+ # RPC-specific configuration for `list_data_sources`
1469
+ # @return [::Gapic::Config::Method]
1470
+ #
1471
+ attr_reader :list_data_sources
1472
+ ##
1473
+ # RPC-specific configuration for `create_transfer_config`
1474
+ # @return [::Gapic::Config::Method]
1475
+ #
1476
+ attr_reader :create_transfer_config
1477
+ ##
1478
+ # RPC-specific configuration for `update_transfer_config`
1479
+ # @return [::Gapic::Config::Method]
1480
+ #
1481
+ attr_reader :update_transfer_config
1482
+ ##
1483
+ # RPC-specific configuration for `delete_transfer_config`
1484
+ # @return [::Gapic::Config::Method]
1485
+ #
1486
+ attr_reader :delete_transfer_config
1487
+ ##
1488
+ # RPC-specific configuration for `get_transfer_config`
1489
+ # @return [::Gapic::Config::Method]
1490
+ #
1491
+ attr_reader :get_transfer_config
1492
+ ##
1493
+ # RPC-specific configuration for `list_transfer_configs`
1494
+ # @return [::Gapic::Config::Method]
1495
+ #
1496
+ attr_reader :list_transfer_configs
1497
+ ##
1498
+ # RPC-specific configuration for `schedule_transfer_runs`
1499
+ # @return [::Gapic::Config::Method]
1500
+ #
1501
+ attr_reader :schedule_transfer_runs
1502
+ ##
1503
+ # RPC-specific configuration for `start_manual_transfer_runs`
1504
+ # @return [::Gapic::Config::Method]
1505
+ #
1506
+ attr_reader :start_manual_transfer_runs
1507
+ ##
1508
+ # RPC-specific configuration for `get_transfer_run`
1509
+ # @return [::Gapic::Config::Method]
1510
+ #
1511
+ attr_reader :get_transfer_run
1512
+ ##
1513
+ # RPC-specific configuration for `delete_transfer_run`
1514
+ # @return [::Gapic::Config::Method]
1515
+ #
1516
+ attr_reader :delete_transfer_run
1517
+ ##
1518
+ # RPC-specific configuration for `list_transfer_runs`
1519
+ # @return [::Gapic::Config::Method]
1520
+ #
1521
+ attr_reader :list_transfer_runs
1522
+ ##
1523
+ # RPC-specific configuration for `list_transfer_logs`
1524
+ # @return [::Gapic::Config::Method]
1525
+ #
1526
+ attr_reader :list_transfer_logs
1527
+ ##
1528
+ # RPC-specific configuration for `check_valid_creds`
1529
+ # @return [::Gapic::Config::Method]
1530
+ #
1531
+ attr_reader :check_valid_creds
1532
+ ##
1533
+ # RPC-specific configuration for `enroll_data_sources`
1534
+ # @return [::Gapic::Config::Method]
1535
+ #
1536
+ attr_reader :enroll_data_sources
1537
+
1538
+ # @private
1539
+ def initialize parent_rpcs = nil
1540
+ get_data_source_config = parent_rpcs.get_data_source if parent_rpcs.respond_to? :get_data_source
1541
+ @get_data_source = ::Gapic::Config::Method.new get_data_source_config
1542
+ list_data_sources_config = parent_rpcs.list_data_sources if parent_rpcs.respond_to? :list_data_sources
1543
+ @list_data_sources = ::Gapic::Config::Method.new list_data_sources_config
1544
+ create_transfer_config_config = parent_rpcs.create_transfer_config if parent_rpcs.respond_to? :create_transfer_config
1545
+ @create_transfer_config = ::Gapic::Config::Method.new create_transfer_config_config
1546
+ update_transfer_config_config = parent_rpcs.update_transfer_config if parent_rpcs.respond_to? :update_transfer_config
1547
+ @update_transfer_config = ::Gapic::Config::Method.new update_transfer_config_config
1548
+ delete_transfer_config_config = parent_rpcs.delete_transfer_config if parent_rpcs.respond_to? :delete_transfer_config
1549
+ @delete_transfer_config = ::Gapic::Config::Method.new delete_transfer_config_config
1550
+ get_transfer_config_config = parent_rpcs.get_transfer_config if parent_rpcs.respond_to? :get_transfer_config
1551
+ @get_transfer_config = ::Gapic::Config::Method.new get_transfer_config_config
1552
+ list_transfer_configs_config = parent_rpcs.list_transfer_configs if parent_rpcs.respond_to? :list_transfer_configs
1553
+ @list_transfer_configs = ::Gapic::Config::Method.new list_transfer_configs_config
1554
+ schedule_transfer_runs_config = parent_rpcs.schedule_transfer_runs if parent_rpcs.respond_to? :schedule_transfer_runs
1555
+ @schedule_transfer_runs = ::Gapic::Config::Method.new schedule_transfer_runs_config
1556
+ start_manual_transfer_runs_config = parent_rpcs.start_manual_transfer_runs if parent_rpcs.respond_to? :start_manual_transfer_runs
1557
+ @start_manual_transfer_runs = ::Gapic::Config::Method.new start_manual_transfer_runs_config
1558
+ get_transfer_run_config = parent_rpcs.get_transfer_run if parent_rpcs.respond_to? :get_transfer_run
1559
+ @get_transfer_run = ::Gapic::Config::Method.new get_transfer_run_config
1560
+ delete_transfer_run_config = parent_rpcs.delete_transfer_run if parent_rpcs.respond_to? :delete_transfer_run
1561
+ @delete_transfer_run = ::Gapic::Config::Method.new delete_transfer_run_config
1562
+ list_transfer_runs_config = parent_rpcs.list_transfer_runs if parent_rpcs.respond_to? :list_transfer_runs
1563
+ @list_transfer_runs = ::Gapic::Config::Method.new list_transfer_runs_config
1564
+ list_transfer_logs_config = parent_rpcs.list_transfer_logs if parent_rpcs.respond_to? :list_transfer_logs
1565
+ @list_transfer_logs = ::Gapic::Config::Method.new list_transfer_logs_config
1566
+ check_valid_creds_config = parent_rpcs.check_valid_creds if parent_rpcs.respond_to? :check_valid_creds
1567
+ @check_valid_creds = ::Gapic::Config::Method.new check_valid_creds_config
1568
+ enroll_data_sources_config = parent_rpcs.enroll_data_sources if parent_rpcs.respond_to? :enroll_data_sources
1569
+ @enroll_data_sources = ::Gapic::Config::Method.new enroll_data_sources_config
1570
+
1571
+ yield self if block_given?
1572
+ end
1573
+ end
1574
+ end
1575
+ end
1576
+ end
1577
+ end
1578
+ end
1579
+ end
1580
+ end
1581
+ end
1582
+ end