google-cloud-dataplex-v1 0.5.1 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1177 @@
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/dataplex/v1/datascans_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Dataplex
27
+ module V1
28
+ module DataScanService
29
+ ##
30
+ # Client for the DataScanService service.
31
+ #
32
+ # DataScanService manages DataScan resources which can be configured to run
33
+ # various types of data scanning workload and generate enriched metadata (e.g.
34
+ # Data Profile, Data Quality) for the data source.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :data_scan_service_stub
41
+
42
+ ##
43
+ # Configure the DataScanService Client class.
44
+ #
45
+ # See {::Google::Cloud::Dataplex::V1::DataScanService::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all DataScanService clients
51
+ # ::Google::Cloud::Dataplex::V1::DataScanService::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", "Dataplex", "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
72
+ end
73
+ yield @configure if block_given?
74
+ @configure
75
+ end
76
+
77
+ ##
78
+ # Configure the DataScanService Client instance.
79
+ #
80
+ # The configuration is set to the derived mode, meaning that values can be changed,
81
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
82
+ # should be made on {Client.configure}.
83
+ #
84
+ # See {::Google::Cloud::Dataplex::V1::DataScanService::Client::Configuration}
85
+ # for a description of the configuration fields.
86
+ #
87
+ # @yield [config] Configure the Client client.
88
+ # @yieldparam config [Client::Configuration]
89
+ #
90
+ # @return [Client::Configuration]
91
+ #
92
+ def configure
93
+ yield @config if block_given?
94
+ @config
95
+ end
96
+
97
+ ##
98
+ # Create a new DataScanService client object.
99
+ #
100
+ # @example
101
+ #
102
+ # # Create a client using the default configuration
103
+ # client = ::Google::Cloud::Dataplex::V1::DataScanService::Client.new
104
+ #
105
+ # # Create a client using a custom configuration
106
+ # client = ::Google::Cloud::Dataplex::V1::DataScanService::Client.new do |config|
107
+ # config.timeout = 10.0
108
+ # end
109
+ #
110
+ # @yield [config] Configure the DataScanService client.
111
+ # @yieldparam config [Client::Configuration]
112
+ #
113
+ def initialize
114
+ # These require statements are intentionally placed here to initialize
115
+ # the gRPC module only when it's required.
116
+ # See https://github.com/googleapis/toolkit/issues/446
117
+ require "gapic/grpc"
118
+ require "google/cloud/dataplex/v1/datascans_services_pb"
119
+
120
+ # Create the configuration object
121
+ @config = Configuration.new Client.configure
122
+
123
+ # Yield the configuration if needed
124
+ yield @config if block_given?
125
+
126
+ # Create credentials
127
+ credentials = @config.credentials
128
+ # Use self-signed JWT if the endpoint is unchanged from default,
129
+ # but only if the default endpoint does not have a region prefix.
130
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
131
+ !@config.endpoint.split(".").first.include?("-")
132
+ credentials ||= Credentials.default scope: @config.scope,
133
+ enable_self_signed_jwt: enable_self_signed_jwt
134
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
135
+ credentials = Credentials.new credentials, scope: @config.scope
136
+ end
137
+ @quota_project_id = @config.quota_project
138
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
139
+
140
+ @operations_client = Operations.new do |config|
141
+ config.credentials = credentials
142
+ config.quota_project = @quota_project_id
143
+ config.endpoint = @config.endpoint
144
+ end
145
+
146
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
147
+ config.credentials = credentials
148
+ config.quota_project = @quota_project_id
149
+ config.endpoint = @config.endpoint
150
+ end
151
+
152
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
153
+ config.credentials = credentials
154
+ config.quota_project = @quota_project_id
155
+ config.endpoint = @config.endpoint
156
+ end
157
+
158
+ @data_scan_service_stub = ::Gapic::ServiceStub.new(
159
+ ::Google::Cloud::Dataplex::V1::DataScanService::Stub,
160
+ credentials: credentials,
161
+ endpoint: @config.endpoint,
162
+ channel_args: @config.channel_args,
163
+ interceptors: @config.interceptors
164
+ )
165
+ end
166
+
167
+ ##
168
+ # Get the associated client for long-running operations.
169
+ #
170
+ # @return [::Google::Cloud::Dataplex::V1::DataScanService::Operations]
171
+ #
172
+ attr_reader :operations_client
173
+
174
+ ##
175
+ # Get the associated client for mix-in of the Locations.
176
+ #
177
+ # @return [Google::Cloud::Location::Locations::Client]
178
+ #
179
+ attr_reader :location_client
180
+
181
+ ##
182
+ # Get the associated client for mix-in of the IAMPolicy.
183
+ #
184
+ # @return [Google::Iam::V1::IAMPolicy::Client]
185
+ #
186
+ attr_reader :iam_policy_client
187
+
188
+ # Service calls
189
+
190
+ ##
191
+ # Creates a DataScan resource.
192
+ #
193
+ # @overload create_data_scan(request, options = nil)
194
+ # Pass arguments to `create_data_scan` via a request object, either of type
195
+ # {::Google::Cloud::Dataplex::V1::CreateDataScanRequest} or an equivalent Hash.
196
+ #
197
+ # @param request [::Google::Cloud::Dataplex::V1::CreateDataScanRequest, ::Hash]
198
+ # A request object representing the call parameters. Required. To specify no
199
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
200
+ # @param options [::Gapic::CallOptions, ::Hash]
201
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
202
+ #
203
+ # @overload create_data_scan(parent: nil, data_scan: nil, data_scan_id: nil)
204
+ # Pass arguments to `create_data_scan` via keyword arguments. Note that at
205
+ # least one keyword argument is required. To specify no parameters, or to keep all
206
+ # the default parameter values, pass an empty Hash as a request object (see above).
207
+ #
208
+ # @param parent [::String]
209
+ # Required. The resource name of the parent location:
210
+ # `projects/{project}/locations/{location_id}`
211
+ # where `project` refers to a *project_id* or *project_number* and
212
+ # `location_id` refers to a GCP region.
213
+ # @param data_scan [::Google::Cloud::Dataplex::V1::DataScan, ::Hash]
214
+ # Required. DataScan resource.
215
+ # @param data_scan_id [::String]
216
+ # Required. DataScan identifier.
217
+ #
218
+ # * Must contain only lowercase letters, numbers and hyphens.
219
+ # * Must start with a letter.
220
+ # * Must end with a number or a letter.
221
+ # * Must be between 1-63 characters.
222
+ # * Must be unique within the customer project / location.
223
+ #
224
+ # @yield [response, operation] Access the result along with the RPC operation
225
+ # @yieldparam response [::Gapic::Operation]
226
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
227
+ #
228
+ # @return [::Gapic::Operation]
229
+ #
230
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
231
+ #
232
+ # @example Basic example
233
+ # require "google/cloud/dataplex/v1"
234
+ #
235
+ # # Create a client object. The client can be reused for multiple calls.
236
+ # client = Google::Cloud::Dataplex::V1::DataScanService::Client.new
237
+ #
238
+ # # Create a request. To set request fields, pass in keyword arguments.
239
+ # request = Google::Cloud::Dataplex::V1::CreateDataScanRequest.new
240
+ #
241
+ # # Call the create_data_scan method.
242
+ # result = client.create_data_scan request
243
+ #
244
+ # # The returned object is of type Gapic::Operation. You can use this
245
+ # # object to check the status of an operation, cancel it, or wait
246
+ # # for results. Here is how to block until completion:
247
+ # result.wait_until_done! timeout: 60
248
+ # if result.response?
249
+ # p result.response
250
+ # else
251
+ # puts "Error!"
252
+ # end
253
+ #
254
+ def create_data_scan request, options = nil
255
+ raise ::ArgumentError, "request must be provided" if request.nil?
256
+
257
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::CreateDataScanRequest
258
+
259
+ # Converts hash and nil to an options object
260
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
261
+
262
+ # Customize the options with defaults
263
+ metadata = @config.rpcs.create_data_scan.metadata.to_h
264
+
265
+ # Set x-goog-api-client and x-goog-user-project headers
266
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
267
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
268
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
269
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
270
+
271
+ header_params = {}
272
+ if request.parent
273
+ header_params["parent"] = request.parent
274
+ end
275
+
276
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
277
+ metadata[:"x-goog-request-params"] ||= request_params_header
278
+
279
+ options.apply_defaults timeout: @config.rpcs.create_data_scan.timeout,
280
+ metadata: metadata,
281
+ retry_policy: @config.rpcs.create_data_scan.retry_policy
282
+
283
+ options.apply_defaults timeout: @config.timeout,
284
+ metadata: @config.metadata,
285
+ retry_policy: @config.retry_policy
286
+
287
+ @data_scan_service_stub.call_rpc :create_data_scan, request, options: options do |response, operation|
288
+ response = ::Gapic::Operation.new response, @operations_client, options: options
289
+ yield response, operation if block_given?
290
+ return response
291
+ end
292
+ rescue ::GRPC::BadStatus => e
293
+ raise ::Google::Cloud::Error.from_error(e)
294
+ end
295
+
296
+ ##
297
+ # Updates a DataScan resource.
298
+ #
299
+ # @overload update_data_scan(request, options = nil)
300
+ # Pass arguments to `update_data_scan` via a request object, either of type
301
+ # {::Google::Cloud::Dataplex::V1::UpdateDataScanRequest} or an equivalent Hash.
302
+ #
303
+ # @param request [::Google::Cloud::Dataplex::V1::UpdateDataScanRequest, ::Hash]
304
+ # A request object representing the call parameters. Required. To specify no
305
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
306
+ # @param options [::Gapic::CallOptions, ::Hash]
307
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
308
+ #
309
+ # @overload update_data_scan(data_scan: nil, update_mask: nil)
310
+ # Pass arguments to `update_data_scan` via keyword arguments. Note that at
311
+ # least one keyword argument is required. To specify no parameters, or to keep all
312
+ # the default parameter values, pass an empty Hash as a request object (see above).
313
+ #
314
+ # @param data_scan [::Google::Cloud::Dataplex::V1::DataScan, ::Hash]
315
+ # Required. DataScan resource to be updated.
316
+ #
317
+ # Only fields specified in `update_mask` are updated.
318
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
319
+ # Required. Mask of fields to update.
320
+ #
321
+ # @yield [response, operation] Access the result along with the RPC operation
322
+ # @yieldparam response [::Gapic::Operation]
323
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
324
+ #
325
+ # @return [::Gapic::Operation]
326
+ #
327
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
328
+ #
329
+ # @example Basic example
330
+ # require "google/cloud/dataplex/v1"
331
+ #
332
+ # # Create a client object. The client can be reused for multiple calls.
333
+ # client = Google::Cloud::Dataplex::V1::DataScanService::Client.new
334
+ #
335
+ # # Create a request. To set request fields, pass in keyword arguments.
336
+ # request = Google::Cloud::Dataplex::V1::UpdateDataScanRequest.new
337
+ #
338
+ # # Call the update_data_scan method.
339
+ # result = client.update_data_scan request
340
+ #
341
+ # # The returned object is of type Gapic::Operation. You can use this
342
+ # # object to check the status of an operation, cancel it, or wait
343
+ # # for results. Here is how to block until completion:
344
+ # result.wait_until_done! timeout: 60
345
+ # if result.response?
346
+ # p result.response
347
+ # else
348
+ # puts "Error!"
349
+ # end
350
+ #
351
+ def update_data_scan request, options = nil
352
+ raise ::ArgumentError, "request must be provided" if request.nil?
353
+
354
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::UpdateDataScanRequest
355
+
356
+ # Converts hash and nil to an options object
357
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
358
+
359
+ # Customize the options with defaults
360
+ metadata = @config.rpcs.update_data_scan.metadata.to_h
361
+
362
+ # Set x-goog-api-client and x-goog-user-project headers
363
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
364
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
365
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
366
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
367
+
368
+ header_params = {}
369
+ if request.data_scan&.name
370
+ header_params["data_scan.name"] = request.data_scan.name
371
+ end
372
+
373
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
374
+ metadata[:"x-goog-request-params"] ||= request_params_header
375
+
376
+ options.apply_defaults timeout: @config.rpcs.update_data_scan.timeout,
377
+ metadata: metadata,
378
+ retry_policy: @config.rpcs.update_data_scan.retry_policy
379
+
380
+ options.apply_defaults timeout: @config.timeout,
381
+ metadata: @config.metadata,
382
+ retry_policy: @config.retry_policy
383
+
384
+ @data_scan_service_stub.call_rpc :update_data_scan, request, options: options do |response, operation|
385
+ response = ::Gapic::Operation.new response, @operations_client, options: options
386
+ yield response, operation if block_given?
387
+ return response
388
+ end
389
+ rescue ::GRPC::BadStatus => e
390
+ raise ::Google::Cloud::Error.from_error(e)
391
+ end
392
+
393
+ ##
394
+ # Deletes a DataScan resource.
395
+ #
396
+ # @overload delete_data_scan(request, options = nil)
397
+ # Pass arguments to `delete_data_scan` via a request object, either of type
398
+ # {::Google::Cloud::Dataplex::V1::DeleteDataScanRequest} or an equivalent Hash.
399
+ #
400
+ # @param request [::Google::Cloud::Dataplex::V1::DeleteDataScanRequest, ::Hash]
401
+ # A request object representing the call parameters. Required. To specify no
402
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
403
+ # @param options [::Gapic::CallOptions, ::Hash]
404
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
405
+ #
406
+ # @overload delete_data_scan(name: nil)
407
+ # Pass arguments to `delete_data_scan` via keyword arguments. Note that at
408
+ # least one keyword argument is required. To specify no parameters, or to keep all
409
+ # the default parameter values, pass an empty Hash as a request object (see above).
410
+ #
411
+ # @param name [::String]
412
+ # Required. The resource name of the dataScan:
413
+ # `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}`
414
+ # where `project` refers to a *project_id* or *project_number* and
415
+ # `location_id` refers to a GCP region.
416
+ #
417
+ # @yield [response, operation] Access the result along with the RPC operation
418
+ # @yieldparam response [::Gapic::Operation]
419
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
420
+ #
421
+ # @return [::Gapic::Operation]
422
+ #
423
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
424
+ #
425
+ # @example Basic example
426
+ # require "google/cloud/dataplex/v1"
427
+ #
428
+ # # Create a client object. The client can be reused for multiple calls.
429
+ # client = Google::Cloud::Dataplex::V1::DataScanService::Client.new
430
+ #
431
+ # # Create a request. To set request fields, pass in keyword arguments.
432
+ # request = Google::Cloud::Dataplex::V1::DeleteDataScanRequest.new
433
+ #
434
+ # # Call the delete_data_scan method.
435
+ # result = client.delete_data_scan request
436
+ #
437
+ # # The returned object is of type Gapic::Operation. You can use this
438
+ # # object to check the status of an operation, cancel it, or wait
439
+ # # for results. Here is how to block until completion:
440
+ # result.wait_until_done! timeout: 60
441
+ # if result.response?
442
+ # p result.response
443
+ # else
444
+ # puts "Error!"
445
+ # end
446
+ #
447
+ def delete_data_scan request, options = nil
448
+ raise ::ArgumentError, "request must be provided" if request.nil?
449
+
450
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::DeleteDataScanRequest
451
+
452
+ # Converts hash and nil to an options object
453
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
454
+
455
+ # Customize the options with defaults
456
+ metadata = @config.rpcs.delete_data_scan.metadata.to_h
457
+
458
+ # Set x-goog-api-client and x-goog-user-project headers
459
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
460
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
461
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
462
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
463
+
464
+ header_params = {}
465
+ if request.name
466
+ header_params["name"] = request.name
467
+ end
468
+
469
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
470
+ metadata[:"x-goog-request-params"] ||= request_params_header
471
+
472
+ options.apply_defaults timeout: @config.rpcs.delete_data_scan.timeout,
473
+ metadata: metadata,
474
+ retry_policy: @config.rpcs.delete_data_scan.retry_policy
475
+
476
+ options.apply_defaults timeout: @config.timeout,
477
+ metadata: @config.metadata,
478
+ retry_policy: @config.retry_policy
479
+
480
+ @data_scan_service_stub.call_rpc :delete_data_scan, request, options: options do |response, operation|
481
+ response = ::Gapic::Operation.new response, @operations_client, options: options
482
+ yield response, operation if block_given?
483
+ return response
484
+ end
485
+ rescue ::GRPC::BadStatus => e
486
+ raise ::Google::Cloud::Error.from_error(e)
487
+ end
488
+
489
+ ##
490
+ # Gets a DataScan resource.
491
+ #
492
+ # @overload get_data_scan(request, options = nil)
493
+ # Pass arguments to `get_data_scan` via a request object, either of type
494
+ # {::Google::Cloud::Dataplex::V1::GetDataScanRequest} or an equivalent Hash.
495
+ #
496
+ # @param request [::Google::Cloud::Dataplex::V1::GetDataScanRequest, ::Hash]
497
+ # A request object representing the call parameters. Required. To specify no
498
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
499
+ # @param options [::Gapic::CallOptions, ::Hash]
500
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
501
+ #
502
+ # @overload get_data_scan(name: nil, view: nil)
503
+ # Pass arguments to `get_data_scan` via keyword arguments. Note that at
504
+ # least one keyword argument is required. To specify no parameters, or to keep all
505
+ # the default parameter values, pass an empty Hash as a request object (see above).
506
+ #
507
+ # @param name [::String]
508
+ # Required. The resource name of the dataScan:
509
+ # `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}`
510
+ # where `project` refers to a *project_id* or *project_number* and
511
+ # `location_id` refers to a GCP region.
512
+ # @param view [::Google::Cloud::Dataplex::V1::GetDataScanRequest::DataScanView]
513
+ # Optional. Select the DataScan view to return. Defaults to `BASIC`.
514
+ #
515
+ # @yield [response, operation] Access the result along with the RPC operation
516
+ # @yieldparam response [::Google::Cloud::Dataplex::V1::DataScan]
517
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
518
+ #
519
+ # @return [::Google::Cloud::Dataplex::V1::DataScan]
520
+ #
521
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
522
+ #
523
+ # @example Basic example
524
+ # require "google/cloud/dataplex/v1"
525
+ #
526
+ # # Create a client object. The client can be reused for multiple calls.
527
+ # client = Google::Cloud::Dataplex::V1::DataScanService::Client.new
528
+ #
529
+ # # Create a request. To set request fields, pass in keyword arguments.
530
+ # request = Google::Cloud::Dataplex::V1::GetDataScanRequest.new
531
+ #
532
+ # # Call the get_data_scan method.
533
+ # result = client.get_data_scan request
534
+ #
535
+ # # The returned object is of type Google::Cloud::Dataplex::V1::DataScan.
536
+ # p result
537
+ #
538
+ def get_data_scan request, options = nil
539
+ raise ::ArgumentError, "request must be provided" if request.nil?
540
+
541
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::GetDataScanRequest
542
+
543
+ # Converts hash and nil to an options object
544
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
545
+
546
+ # Customize the options with defaults
547
+ metadata = @config.rpcs.get_data_scan.metadata.to_h
548
+
549
+ # Set x-goog-api-client and x-goog-user-project headers
550
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
551
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
552
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
553
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
554
+
555
+ header_params = {}
556
+ if request.name
557
+ header_params["name"] = request.name
558
+ end
559
+
560
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
561
+ metadata[:"x-goog-request-params"] ||= request_params_header
562
+
563
+ options.apply_defaults timeout: @config.rpcs.get_data_scan.timeout,
564
+ metadata: metadata,
565
+ retry_policy: @config.rpcs.get_data_scan.retry_policy
566
+
567
+ options.apply_defaults timeout: @config.timeout,
568
+ metadata: @config.metadata,
569
+ retry_policy: @config.retry_policy
570
+
571
+ @data_scan_service_stub.call_rpc :get_data_scan, request, options: options do |response, operation|
572
+ yield response, operation if block_given?
573
+ return response
574
+ end
575
+ rescue ::GRPC::BadStatus => e
576
+ raise ::Google::Cloud::Error.from_error(e)
577
+ end
578
+
579
+ ##
580
+ # Lists DataScans.
581
+ #
582
+ # @overload list_data_scans(request, options = nil)
583
+ # Pass arguments to `list_data_scans` via a request object, either of type
584
+ # {::Google::Cloud::Dataplex::V1::ListDataScansRequest} or an equivalent Hash.
585
+ #
586
+ # @param request [::Google::Cloud::Dataplex::V1::ListDataScansRequest, ::Hash]
587
+ # A request object representing the call parameters. Required. To specify no
588
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
589
+ # @param options [::Gapic::CallOptions, ::Hash]
590
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
591
+ #
592
+ # @overload list_data_scans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
593
+ # Pass arguments to `list_data_scans` via keyword arguments. Note that at
594
+ # least one keyword argument is required. To specify no parameters, or to keep all
595
+ # the default parameter values, pass an empty Hash as a request object (see above).
596
+ #
597
+ # @param parent [::String]
598
+ # Required. The resource name of the parent location:
599
+ # `projects/{project}/locations/{location_id}`
600
+ # where `project` refers to a *project_id* or *project_number* and
601
+ # `location_id` refers to a GCP region.
602
+ # @param page_size [::Integer]
603
+ # Optional. Maximum number of dataScans to return. The service may return
604
+ # fewer than this value. If unspecified, at most 10 scans will be returned.
605
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
606
+ # @param page_token [::String]
607
+ # Optional. Page token received from a previous `ListDataScans` call. Provide
608
+ # this to retrieve the subsequent page. When paginating, all other parameters
609
+ # provided to `ListDataScans` must match the call that provided the
610
+ # page token.
611
+ # @param filter [::String]
612
+ # Optional. Filter request.
613
+ # @param order_by [::String]
614
+ # Optional. Order by fields (`name` or `create_time`) for the result.
615
+ # If not specified, the ordering is undefined.
616
+ #
617
+ # @yield [response, operation] Access the result along with the RPC operation
618
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataplex::V1::DataScan>]
619
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
620
+ #
621
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataplex::V1::DataScan>]
622
+ #
623
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
624
+ #
625
+ # @example Basic example
626
+ # require "google/cloud/dataplex/v1"
627
+ #
628
+ # # Create a client object. The client can be reused for multiple calls.
629
+ # client = Google::Cloud::Dataplex::V1::DataScanService::Client.new
630
+ #
631
+ # # Create a request. To set request fields, pass in keyword arguments.
632
+ # request = Google::Cloud::Dataplex::V1::ListDataScansRequest.new
633
+ #
634
+ # # Call the list_data_scans method.
635
+ # result = client.list_data_scans request
636
+ #
637
+ # # The returned object is of type Gapic::PagedEnumerable. You can
638
+ # # iterate over all elements by calling #each, and the enumerable
639
+ # # will lazily make API calls to fetch subsequent pages. Other
640
+ # # methods are also available for managing paging directly.
641
+ # result.each do |response|
642
+ # # Each element is of type ::Google::Cloud::Dataplex::V1::DataScan.
643
+ # p response
644
+ # end
645
+ #
646
+ def list_data_scans request, options = nil
647
+ raise ::ArgumentError, "request must be provided" if request.nil?
648
+
649
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::ListDataScansRequest
650
+
651
+ # Converts hash and nil to an options object
652
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
653
+
654
+ # Customize the options with defaults
655
+ metadata = @config.rpcs.list_data_scans.metadata.to_h
656
+
657
+ # Set x-goog-api-client and x-goog-user-project headers
658
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
659
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
660
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
661
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
662
+
663
+ header_params = {}
664
+ if request.parent
665
+ header_params["parent"] = request.parent
666
+ end
667
+
668
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
669
+ metadata[:"x-goog-request-params"] ||= request_params_header
670
+
671
+ options.apply_defaults timeout: @config.rpcs.list_data_scans.timeout,
672
+ metadata: metadata,
673
+ retry_policy: @config.rpcs.list_data_scans.retry_policy
674
+
675
+ options.apply_defaults timeout: @config.timeout,
676
+ metadata: @config.metadata,
677
+ retry_policy: @config.retry_policy
678
+
679
+ @data_scan_service_stub.call_rpc :list_data_scans, request, options: options do |response, operation|
680
+ response = ::Gapic::PagedEnumerable.new @data_scan_service_stub, :list_data_scans, request, response, operation, options
681
+ yield response, operation if block_given?
682
+ return response
683
+ end
684
+ rescue ::GRPC::BadStatus => e
685
+ raise ::Google::Cloud::Error.from_error(e)
686
+ end
687
+
688
+ ##
689
+ # Runs an on-demand execution of a DataScan
690
+ #
691
+ # @overload run_data_scan(request, options = nil)
692
+ # Pass arguments to `run_data_scan` via a request object, either of type
693
+ # {::Google::Cloud::Dataplex::V1::RunDataScanRequest} or an equivalent Hash.
694
+ #
695
+ # @param request [::Google::Cloud::Dataplex::V1::RunDataScanRequest, ::Hash]
696
+ # A request object representing the call parameters. Required. To specify no
697
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
698
+ # @param options [::Gapic::CallOptions, ::Hash]
699
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
700
+ #
701
+ # @overload run_data_scan(name: nil)
702
+ # Pass arguments to `run_data_scan` via keyword arguments. Note that at
703
+ # least one keyword argument is required. To specify no parameters, or to keep all
704
+ # the default parameter values, pass an empty Hash as a request object (see above).
705
+ #
706
+ # @param name [::String]
707
+ # Required. The resource name of the DataScan:
708
+ # `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}`.
709
+ # where `project` refers to a *project_id* or *project_number* and
710
+ # `location_id` refers to a GCP region.
711
+ #
712
+ # Only **OnDemand** data scans are allowed.
713
+ #
714
+ # @yield [response, operation] Access the result along with the RPC operation
715
+ # @yieldparam response [::Google::Cloud::Dataplex::V1::RunDataScanResponse]
716
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
717
+ #
718
+ # @return [::Google::Cloud::Dataplex::V1::RunDataScanResponse]
719
+ #
720
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
721
+ #
722
+ # @example Basic example
723
+ # require "google/cloud/dataplex/v1"
724
+ #
725
+ # # Create a client object. The client can be reused for multiple calls.
726
+ # client = Google::Cloud::Dataplex::V1::DataScanService::Client.new
727
+ #
728
+ # # Create a request. To set request fields, pass in keyword arguments.
729
+ # request = Google::Cloud::Dataplex::V1::RunDataScanRequest.new
730
+ #
731
+ # # Call the run_data_scan method.
732
+ # result = client.run_data_scan request
733
+ #
734
+ # # The returned object is of type Google::Cloud::Dataplex::V1::RunDataScanResponse.
735
+ # p result
736
+ #
737
+ def run_data_scan request, options = nil
738
+ raise ::ArgumentError, "request must be provided" if request.nil?
739
+
740
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::RunDataScanRequest
741
+
742
+ # Converts hash and nil to an options object
743
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
744
+
745
+ # Customize the options with defaults
746
+ metadata = @config.rpcs.run_data_scan.metadata.to_h
747
+
748
+ # Set x-goog-api-client and x-goog-user-project headers
749
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
750
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
751
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
752
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
753
+
754
+ header_params = {}
755
+ if request.name
756
+ header_params["name"] = request.name
757
+ end
758
+
759
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
760
+ metadata[:"x-goog-request-params"] ||= request_params_header
761
+
762
+ options.apply_defaults timeout: @config.rpcs.run_data_scan.timeout,
763
+ metadata: metadata,
764
+ retry_policy: @config.rpcs.run_data_scan.retry_policy
765
+
766
+ options.apply_defaults timeout: @config.timeout,
767
+ metadata: @config.metadata,
768
+ retry_policy: @config.retry_policy
769
+
770
+ @data_scan_service_stub.call_rpc :run_data_scan, request, options: options do |response, operation|
771
+ yield response, operation if block_given?
772
+ return response
773
+ end
774
+ rescue ::GRPC::BadStatus => e
775
+ raise ::Google::Cloud::Error.from_error(e)
776
+ end
777
+
778
+ ##
779
+ # Gets a DataScanJob resource.
780
+ #
781
+ # @overload get_data_scan_job(request, options = nil)
782
+ # Pass arguments to `get_data_scan_job` via a request object, either of type
783
+ # {::Google::Cloud::Dataplex::V1::GetDataScanJobRequest} or an equivalent Hash.
784
+ #
785
+ # @param request [::Google::Cloud::Dataplex::V1::GetDataScanJobRequest, ::Hash]
786
+ # A request object representing the call parameters. Required. To specify no
787
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
788
+ # @param options [::Gapic::CallOptions, ::Hash]
789
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
790
+ #
791
+ # @overload get_data_scan_job(name: nil, view: nil)
792
+ # Pass arguments to `get_data_scan_job` via keyword arguments. Note that at
793
+ # least one keyword argument is required. To specify no parameters, or to keep all
794
+ # the default parameter values, pass an empty Hash as a request object (see above).
795
+ #
796
+ # @param name [::String]
797
+ # Required. The resource name of the DataScanJob:
798
+ # `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}/dataScanJobs/{data_scan_job_id}`
799
+ # where `project` refers to a *project_id* or *project_number* and
800
+ # `location_id` refers to a GCP region.
801
+ # @param view [::Google::Cloud::Dataplex::V1::GetDataScanJobRequest::DataScanJobView]
802
+ # Optional. Select the DataScanJob view to return. Defaults to `BASIC`.
803
+ #
804
+ # @yield [response, operation] Access the result along with the RPC operation
805
+ # @yieldparam response [::Google::Cloud::Dataplex::V1::DataScanJob]
806
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
807
+ #
808
+ # @return [::Google::Cloud::Dataplex::V1::DataScanJob]
809
+ #
810
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
811
+ #
812
+ # @example Basic example
813
+ # require "google/cloud/dataplex/v1"
814
+ #
815
+ # # Create a client object. The client can be reused for multiple calls.
816
+ # client = Google::Cloud::Dataplex::V1::DataScanService::Client.new
817
+ #
818
+ # # Create a request. To set request fields, pass in keyword arguments.
819
+ # request = Google::Cloud::Dataplex::V1::GetDataScanJobRequest.new
820
+ #
821
+ # # Call the get_data_scan_job method.
822
+ # result = client.get_data_scan_job request
823
+ #
824
+ # # The returned object is of type Google::Cloud::Dataplex::V1::DataScanJob.
825
+ # p result
826
+ #
827
+ def get_data_scan_job request, options = nil
828
+ raise ::ArgumentError, "request must be provided" if request.nil?
829
+
830
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::GetDataScanJobRequest
831
+
832
+ # Converts hash and nil to an options object
833
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
834
+
835
+ # Customize the options with defaults
836
+ metadata = @config.rpcs.get_data_scan_job.metadata.to_h
837
+
838
+ # Set x-goog-api-client and x-goog-user-project headers
839
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
840
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
841
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
842
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
843
+
844
+ header_params = {}
845
+ if request.name
846
+ header_params["name"] = request.name
847
+ end
848
+
849
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
850
+ metadata[:"x-goog-request-params"] ||= request_params_header
851
+
852
+ options.apply_defaults timeout: @config.rpcs.get_data_scan_job.timeout,
853
+ metadata: metadata,
854
+ retry_policy: @config.rpcs.get_data_scan_job.retry_policy
855
+
856
+ options.apply_defaults timeout: @config.timeout,
857
+ metadata: @config.metadata,
858
+ retry_policy: @config.retry_policy
859
+
860
+ @data_scan_service_stub.call_rpc :get_data_scan_job, request, options: options do |response, operation|
861
+ yield response, operation if block_given?
862
+ return response
863
+ end
864
+ rescue ::GRPC::BadStatus => e
865
+ raise ::Google::Cloud::Error.from_error(e)
866
+ end
867
+
868
+ ##
869
+ # Lists DataScanJobs under the given DataScan.
870
+ #
871
+ # @overload list_data_scan_jobs(request, options = nil)
872
+ # Pass arguments to `list_data_scan_jobs` via a request object, either of type
873
+ # {::Google::Cloud::Dataplex::V1::ListDataScanJobsRequest} or an equivalent Hash.
874
+ #
875
+ # @param request [::Google::Cloud::Dataplex::V1::ListDataScanJobsRequest, ::Hash]
876
+ # A request object representing the call parameters. Required. To specify no
877
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
878
+ # @param options [::Gapic::CallOptions, ::Hash]
879
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
880
+ #
881
+ # @overload list_data_scan_jobs(parent: nil, page_size: nil, page_token: nil)
882
+ # Pass arguments to `list_data_scan_jobs` via keyword arguments. Note that at
883
+ # least one keyword argument is required. To specify no parameters, or to keep all
884
+ # the default parameter values, pass an empty Hash as a request object (see above).
885
+ #
886
+ # @param parent [::String]
887
+ # Required. The resource name of the parent environment:
888
+ # `projects/{project}/locations/{location_id}/dataScans/{data_scan_id}`
889
+ # where `project` refers to a *project_id* or *project_number* and
890
+ # `location_id` refers to a GCP region.
891
+ # @param page_size [::Integer]
892
+ # Optional. Maximum number of DataScanJobs to return. The service may return
893
+ # fewer than this value. If unspecified, at most 10 DataScanJobs will be
894
+ # returned. The maximum value is 1000; values above 1000 will be coerced to
895
+ # 1000.
896
+ # @param page_token [::String]
897
+ # Optional. Page token received from a previous `ListDataScanJobs` call.
898
+ # Provide this to retrieve the subsequent page. When paginating, all other
899
+ # parameters provided to `ListDataScanJobs` must match the call that provided
900
+ # the page token.
901
+ #
902
+ # @yield [response, operation] Access the result along with the RPC operation
903
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataplex::V1::DataScanJob>]
904
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
905
+ #
906
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataplex::V1::DataScanJob>]
907
+ #
908
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
909
+ #
910
+ # @example Basic example
911
+ # require "google/cloud/dataplex/v1"
912
+ #
913
+ # # Create a client object. The client can be reused for multiple calls.
914
+ # client = Google::Cloud::Dataplex::V1::DataScanService::Client.new
915
+ #
916
+ # # Create a request. To set request fields, pass in keyword arguments.
917
+ # request = Google::Cloud::Dataplex::V1::ListDataScanJobsRequest.new
918
+ #
919
+ # # Call the list_data_scan_jobs method.
920
+ # result = client.list_data_scan_jobs request
921
+ #
922
+ # # The returned object is of type Gapic::PagedEnumerable. You can
923
+ # # iterate over all elements by calling #each, and the enumerable
924
+ # # will lazily make API calls to fetch subsequent pages. Other
925
+ # # methods are also available for managing paging directly.
926
+ # result.each do |response|
927
+ # # Each element is of type ::Google::Cloud::Dataplex::V1::DataScanJob.
928
+ # p response
929
+ # end
930
+ #
931
+ def list_data_scan_jobs request, options = nil
932
+ raise ::ArgumentError, "request must be provided" if request.nil?
933
+
934
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::ListDataScanJobsRequest
935
+
936
+ # Converts hash and nil to an options object
937
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
938
+
939
+ # Customize the options with defaults
940
+ metadata = @config.rpcs.list_data_scan_jobs.metadata.to_h
941
+
942
+ # Set x-goog-api-client and x-goog-user-project headers
943
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
944
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
945
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
946
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
947
+
948
+ header_params = {}
949
+ if request.parent
950
+ header_params["parent"] = request.parent
951
+ end
952
+
953
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
954
+ metadata[:"x-goog-request-params"] ||= request_params_header
955
+
956
+ options.apply_defaults timeout: @config.rpcs.list_data_scan_jobs.timeout,
957
+ metadata: metadata,
958
+ retry_policy: @config.rpcs.list_data_scan_jobs.retry_policy
959
+
960
+ options.apply_defaults timeout: @config.timeout,
961
+ metadata: @config.metadata,
962
+ retry_policy: @config.retry_policy
963
+
964
+ @data_scan_service_stub.call_rpc :list_data_scan_jobs, request, options: options do |response, operation|
965
+ response = ::Gapic::PagedEnumerable.new @data_scan_service_stub, :list_data_scan_jobs, request, response, operation, options
966
+ yield response, operation if block_given?
967
+ return response
968
+ end
969
+ rescue ::GRPC::BadStatus => e
970
+ raise ::Google::Cloud::Error.from_error(e)
971
+ end
972
+
973
+ ##
974
+ # Configuration class for the DataScanService API.
975
+ #
976
+ # This class represents the configuration for DataScanService,
977
+ # providing control over timeouts, retry behavior, logging, transport
978
+ # parameters, and other low-level controls. Certain parameters can also be
979
+ # applied individually to specific RPCs. See
980
+ # {::Google::Cloud::Dataplex::V1::DataScanService::Client::Configuration::Rpcs}
981
+ # for a list of RPCs that can be configured independently.
982
+ #
983
+ # Configuration can be applied globally to all clients, or to a single client
984
+ # on construction.
985
+ #
986
+ # @example
987
+ #
988
+ # # Modify the global config, setting the timeout for
989
+ # # create_data_scan to 20 seconds,
990
+ # # and all remaining timeouts to 10 seconds.
991
+ # ::Google::Cloud::Dataplex::V1::DataScanService::Client.configure do |config|
992
+ # config.timeout = 10.0
993
+ # config.rpcs.create_data_scan.timeout = 20.0
994
+ # end
995
+ #
996
+ # # Apply the above configuration only to a new client.
997
+ # client = ::Google::Cloud::Dataplex::V1::DataScanService::Client.new do |config|
998
+ # config.timeout = 10.0
999
+ # config.rpcs.create_data_scan.timeout = 20.0
1000
+ # end
1001
+ #
1002
+ # @!attribute [rw] endpoint
1003
+ # The hostname or hostname:port of the service endpoint.
1004
+ # Defaults to `"dataplex.googleapis.com"`.
1005
+ # @return [::String]
1006
+ # @!attribute [rw] credentials
1007
+ # Credentials to send with calls. You may provide any of the following types:
1008
+ # * (`String`) The path to a service account key file in JSON format
1009
+ # * (`Hash`) A service account key as a Hash
1010
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1011
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1012
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1013
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1014
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1015
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1016
+ # * (`nil`) indicating no credentials
1017
+ # @return [::Object]
1018
+ # @!attribute [rw] scope
1019
+ # The OAuth scopes
1020
+ # @return [::Array<::String>]
1021
+ # @!attribute [rw] lib_name
1022
+ # The library name as recorded in instrumentation and logging
1023
+ # @return [::String]
1024
+ # @!attribute [rw] lib_version
1025
+ # The library version as recorded in instrumentation and logging
1026
+ # @return [::String]
1027
+ # @!attribute [rw] channel_args
1028
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1029
+ # `GRPC::Core::Channel` object is provided as the credential.
1030
+ # @return [::Hash]
1031
+ # @!attribute [rw] interceptors
1032
+ # An array of interceptors that are run before calls are executed.
1033
+ # @return [::Array<::GRPC::ClientInterceptor>]
1034
+ # @!attribute [rw] timeout
1035
+ # The call timeout in seconds.
1036
+ # @return [::Numeric]
1037
+ # @!attribute [rw] metadata
1038
+ # Additional gRPC headers to be sent with the call.
1039
+ # @return [::Hash{::Symbol=>::String}]
1040
+ # @!attribute [rw] retry_policy
1041
+ # The retry policy. The value is a hash with the following keys:
1042
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1043
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1044
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1045
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1046
+ # trigger a retry.
1047
+ # @return [::Hash]
1048
+ # @!attribute [rw] quota_project
1049
+ # A separate project against which to charge quota.
1050
+ # @return [::String]
1051
+ #
1052
+ class Configuration
1053
+ extend ::Gapic::Config
1054
+
1055
+ config_attr :endpoint, "dataplex.googleapis.com", ::String
1056
+ config_attr :credentials, nil do |value|
1057
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1058
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1059
+ allowed.any? { |klass| klass === value }
1060
+ end
1061
+ config_attr :scope, nil, ::String, ::Array, nil
1062
+ config_attr :lib_name, nil, ::String, nil
1063
+ config_attr :lib_version, nil, ::String, nil
1064
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1065
+ config_attr :interceptors, nil, ::Array, nil
1066
+ config_attr :timeout, nil, ::Numeric, nil
1067
+ config_attr :metadata, nil, ::Hash, nil
1068
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1069
+ config_attr :quota_project, nil, ::String, nil
1070
+
1071
+ # @private
1072
+ def initialize parent_config = nil
1073
+ @parent_config = parent_config unless parent_config.nil?
1074
+
1075
+ yield self if block_given?
1076
+ end
1077
+
1078
+ ##
1079
+ # Configurations for individual RPCs
1080
+ # @return [Rpcs]
1081
+ #
1082
+ def rpcs
1083
+ @rpcs ||= begin
1084
+ parent_rpcs = nil
1085
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1086
+ Rpcs.new parent_rpcs
1087
+ end
1088
+ end
1089
+
1090
+ ##
1091
+ # Configuration RPC class for the DataScanService API.
1092
+ #
1093
+ # Includes fields providing the configuration for each RPC in this service.
1094
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1095
+ # the following configuration fields:
1096
+ #
1097
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1098
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1099
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1100
+ # include the following keys:
1101
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1102
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1103
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1104
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1105
+ # trigger a retry.
1106
+ #
1107
+ class Rpcs
1108
+ ##
1109
+ # RPC-specific configuration for `create_data_scan`
1110
+ # @return [::Gapic::Config::Method]
1111
+ #
1112
+ attr_reader :create_data_scan
1113
+ ##
1114
+ # RPC-specific configuration for `update_data_scan`
1115
+ # @return [::Gapic::Config::Method]
1116
+ #
1117
+ attr_reader :update_data_scan
1118
+ ##
1119
+ # RPC-specific configuration for `delete_data_scan`
1120
+ # @return [::Gapic::Config::Method]
1121
+ #
1122
+ attr_reader :delete_data_scan
1123
+ ##
1124
+ # RPC-specific configuration for `get_data_scan`
1125
+ # @return [::Gapic::Config::Method]
1126
+ #
1127
+ attr_reader :get_data_scan
1128
+ ##
1129
+ # RPC-specific configuration for `list_data_scans`
1130
+ # @return [::Gapic::Config::Method]
1131
+ #
1132
+ attr_reader :list_data_scans
1133
+ ##
1134
+ # RPC-specific configuration for `run_data_scan`
1135
+ # @return [::Gapic::Config::Method]
1136
+ #
1137
+ attr_reader :run_data_scan
1138
+ ##
1139
+ # RPC-specific configuration for `get_data_scan_job`
1140
+ # @return [::Gapic::Config::Method]
1141
+ #
1142
+ attr_reader :get_data_scan_job
1143
+ ##
1144
+ # RPC-specific configuration for `list_data_scan_jobs`
1145
+ # @return [::Gapic::Config::Method]
1146
+ #
1147
+ attr_reader :list_data_scan_jobs
1148
+
1149
+ # @private
1150
+ def initialize parent_rpcs = nil
1151
+ create_data_scan_config = parent_rpcs.create_data_scan if parent_rpcs.respond_to? :create_data_scan
1152
+ @create_data_scan = ::Gapic::Config::Method.new create_data_scan_config
1153
+ update_data_scan_config = parent_rpcs.update_data_scan if parent_rpcs.respond_to? :update_data_scan
1154
+ @update_data_scan = ::Gapic::Config::Method.new update_data_scan_config
1155
+ delete_data_scan_config = parent_rpcs.delete_data_scan if parent_rpcs.respond_to? :delete_data_scan
1156
+ @delete_data_scan = ::Gapic::Config::Method.new delete_data_scan_config
1157
+ get_data_scan_config = parent_rpcs.get_data_scan if parent_rpcs.respond_to? :get_data_scan
1158
+ @get_data_scan = ::Gapic::Config::Method.new get_data_scan_config
1159
+ list_data_scans_config = parent_rpcs.list_data_scans if parent_rpcs.respond_to? :list_data_scans
1160
+ @list_data_scans = ::Gapic::Config::Method.new list_data_scans_config
1161
+ run_data_scan_config = parent_rpcs.run_data_scan if parent_rpcs.respond_to? :run_data_scan
1162
+ @run_data_scan = ::Gapic::Config::Method.new run_data_scan_config
1163
+ get_data_scan_job_config = parent_rpcs.get_data_scan_job if parent_rpcs.respond_to? :get_data_scan_job
1164
+ @get_data_scan_job = ::Gapic::Config::Method.new get_data_scan_job_config
1165
+ list_data_scan_jobs_config = parent_rpcs.list_data_scan_jobs if parent_rpcs.respond_to? :list_data_scan_jobs
1166
+ @list_data_scan_jobs = ::Gapic::Config::Method.new list_data_scan_jobs_config
1167
+
1168
+ yield self if block_given?
1169
+ end
1170
+ end
1171
+ end
1172
+ end
1173
+ end
1174
+ end
1175
+ end
1176
+ end
1177
+ end