google-cloud-dataplex-v1 2.2.0 → 2.3.0

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.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/dataplex/v1/catalog_pb.rb +4 -1
  3. data/lib/google/cloud/dataplex/v1/catalog_service/paths.rb +14 -0
  4. data/lib/google/cloud/dataplex/v1/cmek_pb.rb +63 -0
  5. data/lib/google/cloud/dataplex/v1/cmek_service/client.rb +947 -0
  6. data/lib/google/cloud/dataplex/v1/cmek_service/credentials.rb +47 -0
  7. data/lib/google/cloud/dataplex/v1/cmek_service/operations.rb +813 -0
  8. data/lib/google/cloud/dataplex/v1/cmek_service/paths.rb +69 -0
  9. data/lib/google/cloud/dataplex/v1/cmek_service/rest/client.rb +895 -0
  10. data/lib/google/cloud/dataplex/v1/cmek_service/rest/operations.rb +943 -0
  11. data/lib/google/cloud/dataplex/v1/cmek_service/rest/service_stub.rb +388 -0
  12. data/lib/google/cloud/dataplex/v1/cmek_service/rest.rb +54 -0
  13. data/lib/google/cloud/dataplex/v1/cmek_service.rb +56 -0
  14. data/lib/google/cloud/dataplex/v1/cmek_services_pb.rb +53 -0
  15. data/lib/google/cloud/dataplex/v1/data_discovery_pb.rb +2 -1
  16. data/lib/google/cloud/dataplex/v1/data_quality_pb.rb +1 -1
  17. data/lib/google/cloud/dataplex/v1/logs_pb.rb +3 -1
  18. data/lib/google/cloud/dataplex/v1/rest.rb +1 -0
  19. data/lib/google/cloud/dataplex/v1/version.rb +1 -1
  20. data/lib/google/cloud/dataplex/v1.rb +1 -0
  21. data/proto_docs/google/cloud/dataplex/v1/catalog.rb +94 -0
  22. data/proto_docs/google/cloud/dataplex/v1/cmek.rb +216 -0
  23. data/proto_docs/google/cloud/dataplex/v1/data_discovery.rb +40 -3
  24. data/proto_docs/google/cloud/dataplex/v1/data_profile.rb +2 -0
  25. data/proto_docs/google/cloud/dataplex/v1/data_quality.rb +33 -28
  26. data/proto_docs/google/cloud/dataplex/v1/logs.rb +27 -0
  27. data/proto_docs/google/cloud/dataplex/v1/resources.rb +14 -10
  28. metadata +14 -2
@@ -0,0 +1,947 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/cmek_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 CmekService
29
+ ##
30
+ # Client for the CmekService service.
31
+ #
32
+ # Dataplex Cmek Service
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "dataplex.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :cmek_service_stub
45
+
46
+ ##
47
+ # Configure the CmekService Client class.
48
+ #
49
+ # See {::Google::Cloud::Dataplex::V1::CmekService::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all CmekService clients
55
+ # ::Google::Cloud::Dataplex::V1::CmekService::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "Dataplex", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the CmekService Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::Dataplex::V1::CmekService::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @cmek_service_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new CmekService client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Cloud::Dataplex::V1::CmekService::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Cloud::Dataplex::V1::CmekService::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the CmekService client.
124
+ # @yieldparam config [Client::Configuration]
125
+ #
126
+ def initialize
127
+ # These require statements are intentionally placed here to initialize
128
+ # the gRPC module only when it's required.
129
+ # See https://github.com/googleapis/toolkit/issues/446
130
+ require "gapic/grpc"
131
+ require "google/cloud/dataplex/v1/cmek_services_pb"
132
+
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+ @quota_project_id = @config.quota_project
152
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
153
+
154
+ @operations_client = Operations.new do |config|
155
+ config.credentials = credentials
156
+ config.quota_project = @quota_project_id
157
+ config.endpoint = @config.endpoint
158
+ config.universe_domain = @config.universe_domain
159
+ end
160
+
161
+ @cmek_service_stub = ::Gapic::ServiceStub.new(
162
+ ::Google::Cloud::Dataplex::V1::CmekService::Stub,
163
+ credentials: credentials,
164
+ endpoint: @config.endpoint,
165
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
166
+ universe_domain: @config.universe_domain,
167
+ channel_args: @config.channel_args,
168
+ interceptors: @config.interceptors,
169
+ channel_pool_config: @config.channel_pool,
170
+ logger: @config.logger
171
+ )
172
+
173
+ @cmek_service_stub.stub_logger&.info do |entry|
174
+ entry.set_system_name
175
+ entry.set_service
176
+ entry.message = "Created client for #{entry.service}"
177
+ entry.set_credentials_fields credentials
178
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
179
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
180
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
181
+ end
182
+
183
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
184
+ config.credentials = credentials
185
+ config.quota_project = @quota_project_id
186
+ config.endpoint = @cmek_service_stub.endpoint
187
+ config.universe_domain = @cmek_service_stub.universe_domain
188
+ config.logger = @cmek_service_stub.logger if config.respond_to? :logger=
189
+ end
190
+
191
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
192
+ config.credentials = credentials
193
+ config.quota_project = @quota_project_id
194
+ config.endpoint = @cmek_service_stub.endpoint
195
+ config.universe_domain = @cmek_service_stub.universe_domain
196
+ config.logger = @cmek_service_stub.logger if config.respond_to? :logger=
197
+ end
198
+ end
199
+
200
+ ##
201
+ # Get the associated client for long-running operations.
202
+ #
203
+ # @return [::Google::Cloud::Dataplex::V1::CmekService::Operations]
204
+ #
205
+ attr_reader :operations_client
206
+
207
+ ##
208
+ # Get the associated client for mix-in of the Locations.
209
+ #
210
+ # @return [Google::Cloud::Location::Locations::Client]
211
+ #
212
+ attr_reader :location_client
213
+
214
+ ##
215
+ # Get the associated client for mix-in of the IAMPolicy.
216
+ #
217
+ # @return [Google::Iam::V1::IAMPolicy::Client]
218
+ #
219
+ attr_reader :iam_policy_client
220
+
221
+ ##
222
+ # The logger used for request/response debug logging.
223
+ #
224
+ # @return [Logger]
225
+ #
226
+ def logger
227
+ @cmek_service_stub.logger
228
+ end
229
+
230
+ # Service calls
231
+
232
+ ##
233
+ # Create an EncryptionConfig.
234
+ #
235
+ # @overload create_encryption_config(request, options = nil)
236
+ # Pass arguments to `create_encryption_config` via a request object, either of type
237
+ # {::Google::Cloud::Dataplex::V1::CreateEncryptionConfigRequest} or an equivalent Hash.
238
+ #
239
+ # @param request [::Google::Cloud::Dataplex::V1::CreateEncryptionConfigRequest, ::Hash]
240
+ # A request object representing the call parameters. Required. To specify no
241
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
242
+ # @param options [::Gapic::CallOptions, ::Hash]
243
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
244
+ #
245
+ # @overload create_encryption_config(parent: nil, encryption_config_id: nil, encryption_config: nil)
246
+ # Pass arguments to `create_encryption_config` via keyword arguments. Note that at
247
+ # least one keyword argument is required. To specify no parameters, or to keep all
248
+ # the default parameter values, pass an empty Hash as a request object (see above).
249
+ #
250
+ # @param parent [::String]
251
+ # Required. The location at which the EncryptionConfig is to be created.
252
+ # @param encryption_config_id [::String]
253
+ # Required. The ID of the EncryptionConfig to create.
254
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9),
255
+ # and hyphens (-).
256
+ # The maximum size is 63 characters.
257
+ # The first character must be a letter.
258
+ # The last character must be a letter or a number.
259
+ # @param encryption_config [::Google::Cloud::Dataplex::V1::EncryptionConfig, ::Hash]
260
+ # Required. The EncryptionConfig to create.
261
+ #
262
+ # @yield [response, operation] Access the result along with the RPC operation
263
+ # @yieldparam response [::Gapic::Operation]
264
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
265
+ #
266
+ # @return [::Gapic::Operation]
267
+ #
268
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
269
+ #
270
+ # @example Basic example
271
+ # require "google/cloud/dataplex/v1"
272
+ #
273
+ # # Create a client object. The client can be reused for multiple calls.
274
+ # client = Google::Cloud::Dataplex::V1::CmekService::Client.new
275
+ #
276
+ # # Create a request. To set request fields, pass in keyword arguments.
277
+ # request = Google::Cloud::Dataplex::V1::CreateEncryptionConfigRequest.new
278
+ #
279
+ # # Call the create_encryption_config method.
280
+ # result = client.create_encryption_config request
281
+ #
282
+ # # The returned object is of type Gapic::Operation. You can use it to
283
+ # # check the status of an operation, cancel it, or wait for results.
284
+ # # Here is how to wait for a response.
285
+ # result.wait_until_done! timeout: 60
286
+ # if result.response?
287
+ # p result.response
288
+ # else
289
+ # puts "No response received."
290
+ # end
291
+ #
292
+ def create_encryption_config request, options = nil
293
+ raise ::ArgumentError, "request must be provided" if request.nil?
294
+
295
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::CreateEncryptionConfigRequest
296
+
297
+ # Converts hash and nil to an options object
298
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
299
+
300
+ # Customize the options with defaults
301
+ metadata = @config.rpcs.create_encryption_config.metadata.to_h
302
+
303
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
304
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
305
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
306
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
307
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
308
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
309
+
310
+ header_params = {}
311
+ if request.parent
312
+ header_params["parent"] = request.parent
313
+ end
314
+
315
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
316
+ metadata[:"x-goog-request-params"] ||= request_params_header
317
+
318
+ options.apply_defaults timeout: @config.rpcs.create_encryption_config.timeout,
319
+ metadata: metadata,
320
+ retry_policy: @config.rpcs.create_encryption_config.retry_policy
321
+
322
+ options.apply_defaults timeout: @config.timeout,
323
+ metadata: @config.metadata,
324
+ retry_policy: @config.retry_policy
325
+
326
+ @cmek_service_stub.call_rpc :create_encryption_config, request, options: options do |response, operation|
327
+ response = ::Gapic::Operation.new response, @operations_client, options: options
328
+ yield response, operation if block_given?
329
+ throw :response, response
330
+ end
331
+ rescue ::GRPC::BadStatus => e
332
+ raise ::Google::Cloud::Error.from_error(e)
333
+ end
334
+
335
+ ##
336
+ # Update an EncryptionConfig.
337
+ #
338
+ # @overload update_encryption_config(request, options = nil)
339
+ # Pass arguments to `update_encryption_config` via a request object, either of type
340
+ # {::Google::Cloud::Dataplex::V1::UpdateEncryptionConfigRequest} or an equivalent Hash.
341
+ #
342
+ # @param request [::Google::Cloud::Dataplex::V1::UpdateEncryptionConfigRequest, ::Hash]
343
+ # A request object representing the call parameters. Required. To specify no
344
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
345
+ # @param options [::Gapic::CallOptions, ::Hash]
346
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
347
+ #
348
+ # @overload update_encryption_config(encryption_config: nil, update_mask: nil)
349
+ # Pass arguments to `update_encryption_config` via keyword arguments. Note that at
350
+ # least one keyword argument is required. To specify no parameters, or to keep all
351
+ # the default parameter values, pass an empty Hash as a request object (see above).
352
+ #
353
+ # @param encryption_config [::Google::Cloud::Dataplex::V1::EncryptionConfig, ::Hash]
354
+ # Required. The EncryptionConfig to update.
355
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
356
+ # Optional. Mask of fields to update.
357
+ # The service treats an omitted field mask as an implied field mask
358
+ # equivalent to all fields that are populated (have a non-empty value).
359
+ #
360
+ # @yield [response, operation] Access the result along with the RPC operation
361
+ # @yieldparam response [::Gapic::Operation]
362
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
363
+ #
364
+ # @return [::Gapic::Operation]
365
+ #
366
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
367
+ #
368
+ # @example Basic example
369
+ # require "google/cloud/dataplex/v1"
370
+ #
371
+ # # Create a client object. The client can be reused for multiple calls.
372
+ # client = Google::Cloud::Dataplex::V1::CmekService::Client.new
373
+ #
374
+ # # Create a request. To set request fields, pass in keyword arguments.
375
+ # request = Google::Cloud::Dataplex::V1::UpdateEncryptionConfigRequest.new
376
+ #
377
+ # # Call the update_encryption_config method.
378
+ # result = client.update_encryption_config request
379
+ #
380
+ # # The returned object is of type Gapic::Operation. You can use it to
381
+ # # check the status of an operation, cancel it, or wait for results.
382
+ # # Here is how to wait for a response.
383
+ # result.wait_until_done! timeout: 60
384
+ # if result.response?
385
+ # p result.response
386
+ # else
387
+ # puts "No response received."
388
+ # end
389
+ #
390
+ def update_encryption_config request, options = nil
391
+ raise ::ArgumentError, "request must be provided" if request.nil?
392
+
393
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::UpdateEncryptionConfigRequest
394
+
395
+ # Converts hash and nil to an options object
396
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
397
+
398
+ # Customize the options with defaults
399
+ metadata = @config.rpcs.update_encryption_config.metadata.to_h
400
+
401
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
402
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
403
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
404
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
405
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
406
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
407
+
408
+ header_params = {}
409
+ if request.encryption_config&.name
410
+ header_params["encryption_config.name"] = request.encryption_config.name
411
+ end
412
+
413
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
414
+ metadata[:"x-goog-request-params"] ||= request_params_header
415
+
416
+ options.apply_defaults timeout: @config.rpcs.update_encryption_config.timeout,
417
+ metadata: metadata,
418
+ retry_policy: @config.rpcs.update_encryption_config.retry_policy
419
+
420
+ options.apply_defaults timeout: @config.timeout,
421
+ metadata: @config.metadata,
422
+ retry_policy: @config.retry_policy
423
+
424
+ @cmek_service_stub.call_rpc :update_encryption_config, request, options: options do |response, operation|
425
+ response = ::Gapic::Operation.new response, @operations_client, options: options
426
+ yield response, operation if block_given?
427
+ throw :response, response
428
+ end
429
+ rescue ::GRPC::BadStatus => e
430
+ raise ::Google::Cloud::Error.from_error(e)
431
+ end
432
+
433
+ ##
434
+ # Delete an EncryptionConfig.
435
+ #
436
+ # @overload delete_encryption_config(request, options = nil)
437
+ # Pass arguments to `delete_encryption_config` via a request object, either of type
438
+ # {::Google::Cloud::Dataplex::V1::DeleteEncryptionConfigRequest} or an equivalent Hash.
439
+ #
440
+ # @param request [::Google::Cloud::Dataplex::V1::DeleteEncryptionConfigRequest, ::Hash]
441
+ # A request object representing the call parameters. Required. To specify no
442
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
443
+ # @param options [::Gapic::CallOptions, ::Hash]
444
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
445
+ #
446
+ # @overload delete_encryption_config(name: nil, etag: nil)
447
+ # Pass arguments to `delete_encryption_config` via keyword arguments. Note that at
448
+ # least one keyword argument is required. To specify no parameters, or to keep all
449
+ # the default parameter values, pass an empty Hash as a request object (see above).
450
+ #
451
+ # @param name [::String]
452
+ # Required. The name of the EncryptionConfig to delete.
453
+ # @param etag [::String]
454
+ # Optional. Etag of the EncryptionConfig. This is a strong etag.
455
+ #
456
+ # @yield [response, operation] Access the result along with the RPC operation
457
+ # @yieldparam response [::Gapic::Operation]
458
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
459
+ #
460
+ # @return [::Gapic::Operation]
461
+ #
462
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
463
+ #
464
+ # @example Basic example
465
+ # require "google/cloud/dataplex/v1"
466
+ #
467
+ # # Create a client object. The client can be reused for multiple calls.
468
+ # client = Google::Cloud::Dataplex::V1::CmekService::Client.new
469
+ #
470
+ # # Create a request. To set request fields, pass in keyword arguments.
471
+ # request = Google::Cloud::Dataplex::V1::DeleteEncryptionConfigRequest.new
472
+ #
473
+ # # Call the delete_encryption_config method.
474
+ # result = client.delete_encryption_config request
475
+ #
476
+ # # The returned object is of type Gapic::Operation. You can use it to
477
+ # # check the status of an operation, cancel it, or wait for results.
478
+ # # Here is how to wait for a response.
479
+ # result.wait_until_done! timeout: 60
480
+ # if result.response?
481
+ # p result.response
482
+ # else
483
+ # puts "No response received."
484
+ # end
485
+ #
486
+ def delete_encryption_config request, options = nil
487
+ raise ::ArgumentError, "request must be provided" if request.nil?
488
+
489
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::DeleteEncryptionConfigRequest
490
+
491
+ # Converts hash and nil to an options object
492
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
493
+
494
+ # Customize the options with defaults
495
+ metadata = @config.rpcs.delete_encryption_config.metadata.to_h
496
+
497
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
498
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
499
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
500
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
501
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
502
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
503
+
504
+ header_params = {}
505
+ if request.name
506
+ header_params["name"] = request.name
507
+ end
508
+
509
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
510
+ metadata[:"x-goog-request-params"] ||= request_params_header
511
+
512
+ options.apply_defaults timeout: @config.rpcs.delete_encryption_config.timeout,
513
+ metadata: metadata,
514
+ retry_policy: @config.rpcs.delete_encryption_config.retry_policy
515
+
516
+ options.apply_defaults timeout: @config.timeout,
517
+ metadata: @config.metadata,
518
+ retry_policy: @config.retry_policy
519
+
520
+ @cmek_service_stub.call_rpc :delete_encryption_config, request, options: options do |response, operation|
521
+ response = ::Gapic::Operation.new response, @operations_client, options: options
522
+ yield response, operation if block_given?
523
+ throw :response, response
524
+ end
525
+ rescue ::GRPC::BadStatus => e
526
+ raise ::Google::Cloud::Error.from_error(e)
527
+ end
528
+
529
+ ##
530
+ # List EncryptionConfigs.
531
+ #
532
+ # @overload list_encryption_configs(request, options = nil)
533
+ # Pass arguments to `list_encryption_configs` via a request object, either of type
534
+ # {::Google::Cloud::Dataplex::V1::ListEncryptionConfigsRequest} or an equivalent Hash.
535
+ #
536
+ # @param request [::Google::Cloud::Dataplex::V1::ListEncryptionConfigsRequest, ::Hash]
537
+ # A request object representing the call parameters. Required. To specify no
538
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
539
+ # @param options [::Gapic::CallOptions, ::Hash]
540
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
541
+ #
542
+ # @overload list_encryption_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
543
+ # Pass arguments to `list_encryption_configs` via keyword arguments. Note that at
544
+ # least one keyword argument is required. To specify no parameters, or to keep all
545
+ # the default parameter values, pass an empty Hash as a request object (see above).
546
+ #
547
+ # @param parent [::String]
548
+ # Required. The location for which the EncryptionConfig is to be listed.
549
+ # @param page_size [::Integer]
550
+ # Optional. Maximum number of EncryptionConfigs to return. The service may
551
+ # return fewer than this value. If unspecified, at most 10 EncryptionConfigs
552
+ # will be returned. The maximum value is 1000; values above 1000 will be
553
+ # coerced to 1000.
554
+ # @param page_token [::String]
555
+ # Optional. Page token received from a previous `ListEncryptionConfigs` call.
556
+ # Provide this to retrieve the subsequent page. When paginating, the
557
+ # parameters - filter and order_by provided to `ListEncryptionConfigs` must
558
+ # match the call that provided the page token.
559
+ # @param filter [::String]
560
+ # Optional. Filter the EncryptionConfigs to be returned.
561
+ # Using bare literals: (These values will be matched anywhere it may appear
562
+ # in the object's field values)
563
+ # * filter=some_value
564
+ # Using fields: (These values will be matched only in the specified field)
565
+ # * filter=some_field=some_value
566
+ # Supported fields:
567
+ # * name, key, create_time, update_time, encryption_state
568
+ # Example:
569
+ # * filter=name=organizations/123/locations/us-central1/encryptionConfigs/test-config
570
+ # conjunctions: (AND, OR, NOT)
571
+ # * filter=name=organizations/123/locations/us-central1/encryptionConfigs/test-config
572
+ # AND mode=CMEK
573
+ # logical operators: (>, <, >=, <=, !=, =, :),
574
+ # * filter=create_time>2024-05-01T00:00:00.000Z
575
+ # @param order_by [::String]
576
+ # Optional. Order by fields for the result.
577
+ #
578
+ # @yield [response, operation] Access the result along with the RPC operation
579
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataplex::V1::EncryptionConfig>]
580
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
581
+ #
582
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataplex::V1::EncryptionConfig>]
583
+ #
584
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
585
+ #
586
+ # @example Basic example
587
+ # require "google/cloud/dataplex/v1"
588
+ #
589
+ # # Create a client object. The client can be reused for multiple calls.
590
+ # client = Google::Cloud::Dataplex::V1::CmekService::Client.new
591
+ #
592
+ # # Create a request. To set request fields, pass in keyword arguments.
593
+ # request = Google::Cloud::Dataplex::V1::ListEncryptionConfigsRequest.new
594
+ #
595
+ # # Call the list_encryption_configs method.
596
+ # result = client.list_encryption_configs request
597
+ #
598
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
599
+ # # over elements, and API calls will be issued to fetch pages as needed.
600
+ # result.each do |item|
601
+ # # Each element is of type ::Google::Cloud::Dataplex::V1::EncryptionConfig.
602
+ # p item
603
+ # end
604
+ #
605
+ def list_encryption_configs request, options = nil
606
+ raise ::ArgumentError, "request must be provided" if request.nil?
607
+
608
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::ListEncryptionConfigsRequest
609
+
610
+ # Converts hash and nil to an options object
611
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
612
+
613
+ # Customize the options with defaults
614
+ metadata = @config.rpcs.list_encryption_configs.metadata.to_h
615
+
616
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
617
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
618
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
619
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
620
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
621
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
622
+
623
+ header_params = {}
624
+ if request.parent
625
+ header_params["parent"] = request.parent
626
+ end
627
+
628
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
629
+ metadata[:"x-goog-request-params"] ||= request_params_header
630
+
631
+ options.apply_defaults timeout: @config.rpcs.list_encryption_configs.timeout,
632
+ metadata: metadata,
633
+ retry_policy: @config.rpcs.list_encryption_configs.retry_policy
634
+
635
+ options.apply_defaults timeout: @config.timeout,
636
+ metadata: @config.metadata,
637
+ retry_policy: @config.retry_policy
638
+
639
+ @cmek_service_stub.call_rpc :list_encryption_configs, request, options: options do |response, operation|
640
+ response = ::Gapic::PagedEnumerable.new @cmek_service_stub, :list_encryption_configs, request, response, operation, options
641
+ yield response, operation if block_given?
642
+ throw :response, response
643
+ end
644
+ rescue ::GRPC::BadStatus => e
645
+ raise ::Google::Cloud::Error.from_error(e)
646
+ end
647
+
648
+ ##
649
+ # Get an EncryptionConfig.
650
+ #
651
+ # @overload get_encryption_config(request, options = nil)
652
+ # Pass arguments to `get_encryption_config` via a request object, either of type
653
+ # {::Google::Cloud::Dataplex::V1::GetEncryptionConfigRequest} or an equivalent Hash.
654
+ #
655
+ # @param request [::Google::Cloud::Dataplex::V1::GetEncryptionConfigRequest, ::Hash]
656
+ # A request object representing the call parameters. Required. To specify no
657
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
658
+ # @param options [::Gapic::CallOptions, ::Hash]
659
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
660
+ #
661
+ # @overload get_encryption_config(name: nil)
662
+ # Pass arguments to `get_encryption_config` via keyword arguments. Note that at
663
+ # least one keyword argument is required. To specify no parameters, or to keep all
664
+ # the default parameter values, pass an empty Hash as a request object (see above).
665
+ #
666
+ # @param name [::String]
667
+ # Required. The name of the EncryptionConfig to fetch.
668
+ #
669
+ # @yield [response, operation] Access the result along with the RPC operation
670
+ # @yieldparam response [::Google::Cloud::Dataplex::V1::EncryptionConfig]
671
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
672
+ #
673
+ # @return [::Google::Cloud::Dataplex::V1::EncryptionConfig]
674
+ #
675
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
676
+ #
677
+ # @example Basic example
678
+ # require "google/cloud/dataplex/v1"
679
+ #
680
+ # # Create a client object. The client can be reused for multiple calls.
681
+ # client = Google::Cloud::Dataplex::V1::CmekService::Client.new
682
+ #
683
+ # # Create a request. To set request fields, pass in keyword arguments.
684
+ # request = Google::Cloud::Dataplex::V1::GetEncryptionConfigRequest.new
685
+ #
686
+ # # Call the get_encryption_config method.
687
+ # result = client.get_encryption_config request
688
+ #
689
+ # # The returned object is of type Google::Cloud::Dataplex::V1::EncryptionConfig.
690
+ # p result
691
+ #
692
+ def get_encryption_config request, options = nil
693
+ raise ::ArgumentError, "request must be provided" if request.nil?
694
+
695
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::GetEncryptionConfigRequest
696
+
697
+ # Converts hash and nil to an options object
698
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
699
+
700
+ # Customize the options with defaults
701
+ metadata = @config.rpcs.get_encryption_config.metadata.to_h
702
+
703
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
704
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
705
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
706
+ gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
707
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
708
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
709
+
710
+ header_params = {}
711
+ if request.name
712
+ header_params["name"] = request.name
713
+ end
714
+
715
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
716
+ metadata[:"x-goog-request-params"] ||= request_params_header
717
+
718
+ options.apply_defaults timeout: @config.rpcs.get_encryption_config.timeout,
719
+ metadata: metadata,
720
+ retry_policy: @config.rpcs.get_encryption_config.retry_policy
721
+
722
+ options.apply_defaults timeout: @config.timeout,
723
+ metadata: @config.metadata,
724
+ retry_policy: @config.retry_policy
725
+
726
+ @cmek_service_stub.call_rpc :get_encryption_config, request, options: options do |response, operation|
727
+ yield response, operation if block_given?
728
+ end
729
+ rescue ::GRPC::BadStatus => e
730
+ raise ::Google::Cloud::Error.from_error(e)
731
+ end
732
+
733
+ ##
734
+ # Configuration class for the CmekService API.
735
+ #
736
+ # This class represents the configuration for CmekService,
737
+ # providing control over timeouts, retry behavior, logging, transport
738
+ # parameters, and other low-level controls. Certain parameters can also be
739
+ # applied individually to specific RPCs. See
740
+ # {::Google::Cloud::Dataplex::V1::CmekService::Client::Configuration::Rpcs}
741
+ # for a list of RPCs that can be configured independently.
742
+ #
743
+ # Configuration can be applied globally to all clients, or to a single client
744
+ # on construction.
745
+ #
746
+ # @example
747
+ #
748
+ # # Modify the global config, setting the timeout for
749
+ # # create_encryption_config to 20 seconds,
750
+ # # and all remaining timeouts to 10 seconds.
751
+ # ::Google::Cloud::Dataplex::V1::CmekService::Client.configure do |config|
752
+ # config.timeout = 10.0
753
+ # config.rpcs.create_encryption_config.timeout = 20.0
754
+ # end
755
+ #
756
+ # # Apply the above configuration only to a new client.
757
+ # client = ::Google::Cloud::Dataplex::V1::CmekService::Client.new do |config|
758
+ # config.timeout = 10.0
759
+ # config.rpcs.create_encryption_config.timeout = 20.0
760
+ # end
761
+ #
762
+ # @!attribute [rw] endpoint
763
+ # A custom service endpoint, as a hostname or hostname:port. The default is
764
+ # nil, indicating to use the default endpoint in the current universe domain.
765
+ # @return [::String,nil]
766
+ # @!attribute [rw] credentials
767
+ # Credentials to send with calls. You may provide any of the following types:
768
+ # * (`String`) The path to a service account key file in JSON format
769
+ # * (`Hash`) A service account key as a Hash
770
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
771
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
772
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
773
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
774
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
775
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
776
+ # * (`nil`) indicating no credentials
777
+ #
778
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
779
+ # external source for authentication to Google Cloud, you must validate it before
780
+ # providing it to a Google API client library. Providing an unvalidated credential
781
+ # configuration to Google APIs can compromise the security of your systems and data.
782
+ # For more information, refer to [Validate credential configurations from external
783
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
784
+ # @return [::Object]
785
+ # @!attribute [rw] scope
786
+ # The OAuth scopes
787
+ # @return [::Array<::String>]
788
+ # @!attribute [rw] lib_name
789
+ # The library name as recorded in instrumentation and logging
790
+ # @return [::String]
791
+ # @!attribute [rw] lib_version
792
+ # The library version as recorded in instrumentation and logging
793
+ # @return [::String]
794
+ # @!attribute [rw] channel_args
795
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
796
+ # `GRPC::Core::Channel` object is provided as the credential.
797
+ # @return [::Hash]
798
+ # @!attribute [rw] interceptors
799
+ # An array of interceptors that are run before calls are executed.
800
+ # @return [::Array<::GRPC::ClientInterceptor>]
801
+ # @!attribute [rw] timeout
802
+ # The call timeout in seconds.
803
+ # @return [::Numeric]
804
+ # @!attribute [rw] metadata
805
+ # Additional gRPC headers to be sent with the call.
806
+ # @return [::Hash{::Symbol=>::String}]
807
+ # @!attribute [rw] retry_policy
808
+ # The retry policy. The value is a hash with the following keys:
809
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
810
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
811
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
812
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
813
+ # trigger a retry.
814
+ # @return [::Hash]
815
+ # @!attribute [rw] quota_project
816
+ # A separate project against which to charge quota.
817
+ # @return [::String]
818
+ # @!attribute [rw] universe_domain
819
+ # The universe domain within which to make requests. This determines the
820
+ # default endpoint URL. The default value of nil uses the environment
821
+ # universe (usually the default "googleapis.com" universe).
822
+ # @return [::String,nil]
823
+ # @!attribute [rw] logger
824
+ # A custom logger to use for request/response debug logging, or the value
825
+ # `:default` (the default) to construct a default logger, or `nil` to
826
+ # explicitly disable logging.
827
+ # @return [::Logger,:default,nil]
828
+ #
829
+ class Configuration
830
+ extend ::Gapic::Config
831
+
832
+ # @private
833
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
834
+ DEFAULT_ENDPOINT = "dataplex.googleapis.com"
835
+
836
+ config_attr :endpoint, nil, ::String, nil
837
+ config_attr :credentials, nil do |value|
838
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
839
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
840
+ allowed.any? { |klass| klass === value }
841
+ end
842
+ config_attr :scope, nil, ::String, ::Array, nil
843
+ config_attr :lib_name, nil, ::String, nil
844
+ config_attr :lib_version, nil, ::String, nil
845
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
846
+ config_attr :interceptors, nil, ::Array, nil
847
+ config_attr :timeout, nil, ::Numeric, nil
848
+ config_attr :metadata, nil, ::Hash, nil
849
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
850
+ config_attr :quota_project, nil, ::String, nil
851
+ config_attr :universe_domain, nil, ::String, nil
852
+ config_attr :logger, :default, ::Logger, nil, :default
853
+
854
+ # @private
855
+ def initialize parent_config = nil
856
+ @parent_config = parent_config unless parent_config.nil?
857
+
858
+ yield self if block_given?
859
+ end
860
+
861
+ ##
862
+ # Configurations for individual RPCs
863
+ # @return [Rpcs]
864
+ #
865
+ def rpcs
866
+ @rpcs ||= begin
867
+ parent_rpcs = nil
868
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
869
+ Rpcs.new parent_rpcs
870
+ end
871
+ end
872
+
873
+ ##
874
+ # Configuration for the channel pool
875
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
876
+ #
877
+ def channel_pool
878
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
879
+ end
880
+
881
+ ##
882
+ # Configuration RPC class for the CmekService API.
883
+ #
884
+ # Includes fields providing the configuration for each RPC in this service.
885
+ # Each configuration object is of type `Gapic::Config::Method` and includes
886
+ # the following configuration fields:
887
+ #
888
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
889
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
890
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
891
+ # include the following keys:
892
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
893
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
894
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
895
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
896
+ # trigger a retry.
897
+ #
898
+ class Rpcs
899
+ ##
900
+ # RPC-specific configuration for `create_encryption_config`
901
+ # @return [::Gapic::Config::Method]
902
+ #
903
+ attr_reader :create_encryption_config
904
+ ##
905
+ # RPC-specific configuration for `update_encryption_config`
906
+ # @return [::Gapic::Config::Method]
907
+ #
908
+ attr_reader :update_encryption_config
909
+ ##
910
+ # RPC-specific configuration for `delete_encryption_config`
911
+ # @return [::Gapic::Config::Method]
912
+ #
913
+ attr_reader :delete_encryption_config
914
+ ##
915
+ # RPC-specific configuration for `list_encryption_configs`
916
+ # @return [::Gapic::Config::Method]
917
+ #
918
+ attr_reader :list_encryption_configs
919
+ ##
920
+ # RPC-specific configuration for `get_encryption_config`
921
+ # @return [::Gapic::Config::Method]
922
+ #
923
+ attr_reader :get_encryption_config
924
+
925
+ # @private
926
+ def initialize parent_rpcs = nil
927
+ create_encryption_config_config = parent_rpcs.create_encryption_config if parent_rpcs.respond_to? :create_encryption_config
928
+ @create_encryption_config = ::Gapic::Config::Method.new create_encryption_config_config
929
+ update_encryption_config_config = parent_rpcs.update_encryption_config if parent_rpcs.respond_to? :update_encryption_config
930
+ @update_encryption_config = ::Gapic::Config::Method.new update_encryption_config_config
931
+ delete_encryption_config_config = parent_rpcs.delete_encryption_config if parent_rpcs.respond_to? :delete_encryption_config
932
+ @delete_encryption_config = ::Gapic::Config::Method.new delete_encryption_config_config
933
+ list_encryption_configs_config = parent_rpcs.list_encryption_configs if parent_rpcs.respond_to? :list_encryption_configs
934
+ @list_encryption_configs = ::Gapic::Config::Method.new list_encryption_configs_config
935
+ get_encryption_config_config = parent_rpcs.get_encryption_config if parent_rpcs.respond_to? :get_encryption_config
936
+ @get_encryption_config = ::Gapic::Config::Method.new get_encryption_config_config
937
+
938
+ yield self if block_given?
939
+ end
940
+ end
941
+ end
942
+ end
943
+ end
944
+ end
945
+ end
946
+ end
947
+ end