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