google-cloud-kms-v1 0.25.1 → 0.26.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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -4
  3. data/README.md +3 -3
  4. data/lib/google/cloud/kms/v1/autokey/client.rb +713 -0
  5. data/lib/google/cloud/kms/v1/autokey/credentials.rb +52 -0
  6. data/lib/google/cloud/kms/v1/autokey/operations.rb +809 -0
  7. data/lib/google/cloud/kms/v1/autokey/paths.rb +90 -0
  8. data/lib/google/cloud/kms/v1/autokey/rest/client.rb +675 -0
  9. data/lib/google/cloud/kms/v1/autokey/rest/operations.rb +902 -0
  10. data/lib/google/cloud/kms/v1/autokey/rest/service_stub.rb +247 -0
  11. data/lib/google/cloud/kms/v1/autokey/rest.rb +70 -0
  12. data/lib/google/cloud/kms/v1/autokey.rb +72 -0
  13. data/lib/google/cloud/kms/v1/autokey_admin/client.rb +677 -0
  14. data/lib/google/cloud/kms/v1/autokey_admin/credentials.rb +52 -0
  15. data/lib/google/cloud/kms/v1/autokey_admin/paths.rb +61 -0
  16. data/lib/google/cloud/kms/v1/autokey_admin/rest/client.rb +639 -0
  17. data/lib/google/cloud/kms/v1/autokey_admin/rest/service_stub.rb +247 -0
  18. data/lib/google/cloud/kms/v1/autokey_admin/rest.rb +59 -0
  19. data/lib/google/cloud/kms/v1/autokey_admin.rb +61 -0
  20. data/lib/google/cloud/kms/v1/autokey_admin_pb.rb +53 -0
  21. data/lib/google/cloud/kms/v1/autokey_admin_services_pb.rb +62 -0
  22. data/lib/google/cloud/kms/v1/autokey_pb.rb +53 -0
  23. data/lib/google/cloud/kms/v1/autokey_services_pb.rb +71 -0
  24. data/lib/google/cloud/kms/v1/bindings_override.rb +1 -1
  25. data/lib/google/cloud/kms/v1/ekm_service/client.rb +17 -7
  26. data/lib/google/cloud/kms/v1/ekm_service/rest/client.rb +17 -7
  27. data/lib/google/cloud/kms/v1/key_management_service/client.rb +59 -28
  28. data/lib/google/cloud/kms/v1/key_management_service/rest/client.rb +59 -28
  29. data/lib/google/cloud/kms/v1/resources_pb.rb +1 -1
  30. data/lib/google/cloud/kms/v1/rest.rb +3 -1
  31. data/lib/google/cloud/kms/v1/version.rb +1 -1
  32. data/lib/google/cloud/kms/v1.rb +4 -2
  33. data/proto_docs/google/cloud/kms/v1/autokey.rb +123 -0
  34. data/proto_docs/google/cloud/kms/v1/autokey_admin.rb +99 -0
  35. data/proto_docs/google/cloud/kms/v1/resources.rb +3 -0
  36. data/proto_docs/google/longrunning/operations.rb +164 -0
  37. data/proto_docs/google/protobuf/empty.rb +34 -0
  38. data/proto_docs/google/rpc/status.rb +48 -0
  39. metadata +27 -2
@@ -0,0 +1,639 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/kms/v1/autokey_admin_pb"
21
+ require "google/cloud/kms/v1/autokey_admin/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+ require "google/iam/v1/rest"
24
+
25
+ module Google
26
+ module Cloud
27
+ module Kms
28
+ module V1
29
+ module AutokeyAdmin
30
+ module Rest
31
+ ##
32
+ # REST client for the AutokeyAdmin service.
33
+ #
34
+ # Provides interfaces for managing Cloud KMS Autokey folder-level
35
+ # configurations. A configuration is inherited by all descendent projects. A
36
+ # configuration at one folder overrides any other configurations in its
37
+ # ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS
38
+ # Autokey, so that users working in a descendant project can request
39
+ # provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer
40
+ # Managed Encryption Key (CMEK) use, on-demand.
41
+ #
42
+ class Client
43
+ # @private
44
+ API_VERSION = ""
45
+
46
+ # @private
47
+ DEFAULT_ENDPOINT_TEMPLATE = "cloudkms.$UNIVERSE_DOMAIN$"
48
+
49
+ include Paths
50
+
51
+ # @private
52
+ attr_reader :autokey_admin_stub
53
+
54
+ ##
55
+ # Configure the AutokeyAdmin Client class.
56
+ #
57
+ # See {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client::Configuration}
58
+ # for a description of the configuration fields.
59
+ #
60
+ # @example
61
+ #
62
+ # # Modify the configuration for all AutokeyAdmin clients
63
+ # ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.configure do |config|
64
+ # config.timeout = 10.0
65
+ # end
66
+ #
67
+ # @yield [config] Configure the Client client.
68
+ # @yieldparam config [Client::Configuration]
69
+ #
70
+ # @return [Client::Configuration]
71
+ #
72
+ def self.configure
73
+ @configure ||= begin
74
+ namespace = ["Google", "Cloud", "Kms", "V1"]
75
+ parent_config = while namespace.any?
76
+ parent_name = namespace.join "::"
77
+ parent_const = const_get parent_name
78
+ break parent_const.configure if parent_const.respond_to? :configure
79
+ namespace.pop
80
+ end
81
+ default_config = Client::Configuration.new parent_config
82
+
83
+ default_config.rpcs.update_autokey_config.timeout = 60.0
84
+ default_config.rpcs.update_autokey_config.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
86
+ }
87
+
88
+ default_config.rpcs.get_autokey_config.timeout = 60.0
89
+ default_config.rpcs.get_autokey_config.retry_policy = {
90
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
91
+ }
92
+
93
+ default_config.rpcs.show_effective_autokey_config.timeout = 60.0
94
+ default_config.rpcs.show_effective_autokey_config.retry_policy = {
95
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
96
+ }
97
+
98
+ default_config
99
+ end
100
+ yield @configure if block_given?
101
+ @configure
102
+ end
103
+
104
+ ##
105
+ # Configure the AutokeyAdmin Client instance.
106
+ #
107
+ # The configuration is set to the derived mode, meaning that values can be changed,
108
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
109
+ # should be made on {Client.configure}.
110
+ #
111
+ # See {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client::Configuration}
112
+ # for a description of the configuration fields.
113
+ #
114
+ # @yield [config] Configure the Client client.
115
+ # @yieldparam config [Client::Configuration]
116
+ #
117
+ # @return [Client::Configuration]
118
+ #
119
+ def configure
120
+ yield @config if block_given?
121
+ @config
122
+ end
123
+
124
+ ##
125
+ # The effective universe domain
126
+ #
127
+ # @return [String]
128
+ #
129
+ def universe_domain
130
+ @autokey_admin_stub.universe_domain
131
+ end
132
+
133
+ ##
134
+ # Create a new AutokeyAdmin REST client object.
135
+ #
136
+ # @example
137
+ #
138
+ # # Create a client using the default configuration
139
+ # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new
140
+ #
141
+ # # Create a client using a custom configuration
142
+ # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config|
143
+ # config.timeout = 10.0
144
+ # end
145
+ #
146
+ # @yield [config] Configure the AutokeyAdmin client.
147
+ # @yieldparam config [Client::Configuration]
148
+ #
149
+ def initialize
150
+ # Create the configuration object
151
+ @config = Configuration.new Client.configure
152
+
153
+ # Yield the configuration if needed
154
+ yield @config if block_given?
155
+
156
+ # Create credentials
157
+ credentials = @config.credentials
158
+ # Use self-signed JWT if the endpoint is unchanged from default,
159
+ # but only if the default endpoint does not have a region prefix.
160
+ enable_self_signed_jwt = @config.endpoint.nil? ||
161
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
162
+ !@config.endpoint.split(".").first.include?("-"))
163
+ credentials ||= Credentials.default scope: @config.scope,
164
+ enable_self_signed_jwt: enable_self_signed_jwt
165
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
166
+ credentials = Credentials.new credentials, scope: @config.scope
167
+ end
168
+
169
+ @quota_project_id = @config.quota_project
170
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
171
+
172
+ @autokey_admin_stub = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::ServiceStub.new(
173
+ endpoint: @config.endpoint,
174
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
175
+ universe_domain: @config.universe_domain,
176
+ credentials: credentials
177
+ )
178
+
179
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
180
+ config.credentials = credentials
181
+ config.quota_project = @quota_project_id
182
+ config.endpoint = @autokey_admin_stub.endpoint
183
+ config.universe_domain = @autokey_admin_stub.universe_domain
184
+ config.bindings_override = @config.bindings_override
185
+ end
186
+
187
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
188
+ config.credentials = credentials
189
+ config.quota_project = @quota_project_id
190
+ config.endpoint = @autokey_admin_stub.endpoint
191
+ config.universe_domain = @autokey_admin_stub.universe_domain
192
+ config.bindings_override = @config.bindings_override
193
+ end
194
+ end
195
+
196
+ ##
197
+ # Get the associated client for mix-in of the Locations.
198
+ #
199
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
200
+ #
201
+ attr_reader :location_client
202
+
203
+ ##
204
+ # Get the associated client for mix-in of the IAMPolicy.
205
+ #
206
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
207
+ #
208
+ attr_reader :iam_policy_client
209
+
210
+ # Service calls
211
+
212
+ ##
213
+ # Updates the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a
214
+ # folder. The caller must have both `cloudkms.autokeyConfigs.update`
215
+ # permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy`
216
+ # permission on the provided key project. A
217
+ # {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} creation in the folder's
218
+ # descendant projects will use this configuration to determine where to
219
+ # create the resulting {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}.
220
+ #
221
+ # @overload update_autokey_config(request, options = nil)
222
+ # Pass arguments to `update_autokey_config` via a request object, either of type
223
+ # {::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest} or an equivalent Hash.
224
+ #
225
+ # @param request [::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest, ::Hash]
226
+ # A request object representing the call parameters. Required. To specify no
227
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
228
+ # @param options [::Gapic::CallOptions, ::Hash]
229
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
230
+ #
231
+ # @overload update_autokey_config(autokey_config: nil, update_mask: nil)
232
+ # Pass arguments to `update_autokey_config` via keyword arguments. Note that at
233
+ # least one keyword argument is required. To specify no parameters, or to keep all
234
+ # the default parameter values, pass an empty Hash as a request object (see above).
235
+ #
236
+ # @param autokey_config [::Google::Cloud::Kms::V1::AutokeyConfig, ::Hash]
237
+ # Required. {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} with values to
238
+ # update.
239
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
240
+ # Required. Masks which fields of the
241
+ # {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} to update, e.g.
242
+ # `keyProject`.
243
+ # @yield [result, operation] Access the result along with the TransportOperation object
244
+ # @yieldparam result [::Google::Cloud::Kms::V1::AutokeyConfig]
245
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
246
+ #
247
+ # @return [::Google::Cloud::Kms::V1::AutokeyConfig]
248
+ #
249
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
250
+ #
251
+ # @example Basic example
252
+ # require "google/cloud/kms/v1"
253
+ #
254
+ # # Create a client object. The client can be reused for multiple calls.
255
+ # client = Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new
256
+ #
257
+ # # Create a request. To set request fields, pass in keyword arguments.
258
+ # request = Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest.new
259
+ #
260
+ # # Call the update_autokey_config method.
261
+ # result = client.update_autokey_config request
262
+ #
263
+ # # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig.
264
+ # p result
265
+ #
266
+ def update_autokey_config request, options = nil
267
+ raise ::ArgumentError, "request must be provided" if request.nil?
268
+
269
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest
270
+
271
+ # Converts hash and nil to an options object
272
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
273
+
274
+ # Customize the options with defaults
275
+ call_metadata = @config.rpcs.update_autokey_config.metadata.to_h
276
+
277
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
278
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
279
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
280
+ gapic_version: ::Google::Cloud::Kms::V1::VERSION,
281
+ transports_version_send: [:rest]
282
+
283
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
284
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
285
+
286
+ options.apply_defaults timeout: @config.rpcs.update_autokey_config.timeout,
287
+ metadata: call_metadata,
288
+ retry_policy: @config.rpcs.update_autokey_config.retry_policy
289
+
290
+ options.apply_defaults timeout: @config.timeout,
291
+ metadata: @config.metadata,
292
+ retry_policy: @config.retry_policy
293
+
294
+ @autokey_admin_stub.update_autokey_config request, options do |result, operation|
295
+ yield result, operation if block_given?
296
+ return result
297
+ end
298
+ rescue ::Gapic::Rest::Error => e
299
+ raise ::Google::Cloud::Error.from_error(e)
300
+ end
301
+
302
+ ##
303
+ # Returns the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a
304
+ # folder.
305
+ #
306
+ # @overload get_autokey_config(request, options = nil)
307
+ # Pass arguments to `get_autokey_config` via a request object, either of type
308
+ # {::Google::Cloud::Kms::V1::GetAutokeyConfigRequest} or an equivalent Hash.
309
+ #
310
+ # @param request [::Google::Cloud::Kms::V1::GetAutokeyConfigRequest, ::Hash]
311
+ # A request object representing the call parameters. Required. To specify no
312
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
313
+ # @param options [::Gapic::CallOptions, ::Hash]
314
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
315
+ #
316
+ # @overload get_autokey_config(name: nil)
317
+ # Pass arguments to `get_autokey_config` via keyword arguments. Note that at
318
+ # least one keyword argument is required. To specify no parameters, or to keep all
319
+ # the default parameter values, pass an empty Hash as a request object (see above).
320
+ #
321
+ # @param name [::String]
322
+ # Required. Name of the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig}
323
+ # resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`.
324
+ # @yield [result, operation] Access the result along with the TransportOperation object
325
+ # @yieldparam result [::Google::Cloud::Kms::V1::AutokeyConfig]
326
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
327
+ #
328
+ # @return [::Google::Cloud::Kms::V1::AutokeyConfig]
329
+ #
330
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
331
+ #
332
+ # @example Basic example
333
+ # require "google/cloud/kms/v1"
334
+ #
335
+ # # Create a client object. The client can be reused for multiple calls.
336
+ # client = Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new
337
+ #
338
+ # # Create a request. To set request fields, pass in keyword arguments.
339
+ # request = Google::Cloud::Kms::V1::GetAutokeyConfigRequest.new
340
+ #
341
+ # # Call the get_autokey_config method.
342
+ # result = client.get_autokey_config request
343
+ #
344
+ # # The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig.
345
+ # p result
346
+ #
347
+ def get_autokey_config request, options = nil
348
+ raise ::ArgumentError, "request must be provided" if request.nil?
349
+
350
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GetAutokeyConfigRequest
351
+
352
+ # Converts hash and nil to an options object
353
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
354
+
355
+ # Customize the options with defaults
356
+ call_metadata = @config.rpcs.get_autokey_config.metadata.to_h
357
+
358
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
359
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
360
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
361
+ gapic_version: ::Google::Cloud::Kms::V1::VERSION,
362
+ transports_version_send: [:rest]
363
+
364
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
365
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
366
+
367
+ options.apply_defaults timeout: @config.rpcs.get_autokey_config.timeout,
368
+ metadata: call_metadata,
369
+ retry_policy: @config.rpcs.get_autokey_config.retry_policy
370
+
371
+ options.apply_defaults timeout: @config.timeout,
372
+ metadata: @config.metadata,
373
+ retry_policy: @config.retry_policy
374
+
375
+ @autokey_admin_stub.get_autokey_config request, options do |result, operation|
376
+ yield result, operation if block_given?
377
+ return result
378
+ end
379
+ rescue ::Gapic::Rest::Error => e
380
+ raise ::Google::Cloud::Error.from_error(e)
381
+ end
382
+
383
+ ##
384
+ # Returns the effective Cloud KMS Autokey configuration for a given project.
385
+ #
386
+ # @overload show_effective_autokey_config(request, options = nil)
387
+ # Pass arguments to `show_effective_autokey_config` via a request object, either of type
388
+ # {::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest} or an equivalent Hash.
389
+ #
390
+ # @param request [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest, ::Hash]
391
+ # A request object representing the call parameters. Required. To specify no
392
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
393
+ # @param options [::Gapic::CallOptions, ::Hash]
394
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
395
+ #
396
+ # @overload show_effective_autokey_config(parent: nil)
397
+ # Pass arguments to `show_effective_autokey_config` via keyword arguments. Note that at
398
+ # least one keyword argument is required. To specify no parameters, or to keep all
399
+ # the default parameter values, pass an empty Hash as a request object (see above).
400
+ #
401
+ # @param parent [::String]
402
+ # Required. Name of the resource project to the show effective Cloud KMS
403
+ # Autokey configuration for. This may be helpful for interrogating the effect
404
+ # of nested folder configurations on a given resource project.
405
+ # @yield [result, operation] Access the result along with the TransportOperation object
406
+ # @yieldparam result [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse]
407
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
408
+ #
409
+ # @return [::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse]
410
+ #
411
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
412
+ #
413
+ # @example Basic example
414
+ # require "google/cloud/kms/v1"
415
+ #
416
+ # # Create a client object. The client can be reused for multiple calls.
417
+ # client = Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new
418
+ #
419
+ # # Create a request. To set request fields, pass in keyword arguments.
420
+ # request = Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest.new
421
+ #
422
+ # # Call the show_effective_autokey_config method.
423
+ # result = client.show_effective_autokey_config request
424
+ #
425
+ # # The returned object is of type Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse.
426
+ # p result
427
+ #
428
+ def show_effective_autokey_config request, options = nil
429
+ raise ::ArgumentError, "request must be provided" if request.nil?
430
+
431
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest
432
+
433
+ # Converts hash and nil to an options object
434
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
435
+
436
+ # Customize the options with defaults
437
+ call_metadata = @config.rpcs.show_effective_autokey_config.metadata.to_h
438
+
439
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
440
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
441
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
442
+ gapic_version: ::Google::Cloud::Kms::V1::VERSION,
443
+ transports_version_send: [:rest]
444
+
445
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
446
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
447
+
448
+ options.apply_defaults timeout: @config.rpcs.show_effective_autokey_config.timeout,
449
+ metadata: call_metadata,
450
+ retry_policy: @config.rpcs.show_effective_autokey_config.retry_policy
451
+
452
+ options.apply_defaults timeout: @config.timeout,
453
+ metadata: @config.metadata,
454
+ retry_policy: @config.retry_policy
455
+
456
+ @autokey_admin_stub.show_effective_autokey_config request, options do |result, operation|
457
+ yield result, operation if block_given?
458
+ return result
459
+ end
460
+ rescue ::Gapic::Rest::Error => e
461
+ raise ::Google::Cloud::Error.from_error(e)
462
+ end
463
+
464
+ ##
465
+ # Configuration class for the AutokeyAdmin REST API.
466
+ #
467
+ # This class represents the configuration for AutokeyAdmin REST,
468
+ # providing control over timeouts, retry behavior, logging, transport
469
+ # parameters, and other low-level controls. Certain parameters can also be
470
+ # applied individually to specific RPCs. See
471
+ # {::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client::Configuration::Rpcs}
472
+ # for a list of RPCs that can be configured independently.
473
+ #
474
+ # Configuration can be applied globally to all clients, or to a single client
475
+ # on construction.
476
+ #
477
+ # @example
478
+ #
479
+ # # Modify the global config, setting the timeout for
480
+ # # update_autokey_config to 20 seconds,
481
+ # # and all remaining timeouts to 10 seconds.
482
+ # ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.configure do |config|
483
+ # config.timeout = 10.0
484
+ # config.rpcs.update_autokey_config.timeout = 20.0
485
+ # end
486
+ #
487
+ # # Apply the above configuration only to a new client.
488
+ # client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Rest::Client.new do |config|
489
+ # config.timeout = 10.0
490
+ # config.rpcs.update_autokey_config.timeout = 20.0
491
+ # end
492
+ #
493
+ # @!attribute [rw] endpoint
494
+ # A custom service endpoint, as a hostname or hostname:port. The default is
495
+ # nil, indicating to use the default endpoint in the current universe domain.
496
+ # @return [::String,nil]
497
+ # @!attribute [rw] credentials
498
+ # Credentials to send with calls. You may provide any of the following types:
499
+ # * (`String`) The path to a service account key file in JSON format
500
+ # * (`Hash`) A service account key as a Hash
501
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
502
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
503
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
504
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
505
+ # * (`nil`) indicating no credentials
506
+ # @return [::Object]
507
+ # @!attribute [rw] scope
508
+ # The OAuth scopes
509
+ # @return [::Array<::String>]
510
+ # @!attribute [rw] lib_name
511
+ # The library name as recorded in instrumentation and logging
512
+ # @return [::String]
513
+ # @!attribute [rw] lib_version
514
+ # The library version as recorded in instrumentation and logging
515
+ # @return [::String]
516
+ # @!attribute [rw] timeout
517
+ # The call timeout in seconds.
518
+ # @return [::Numeric]
519
+ # @!attribute [rw] metadata
520
+ # Additional headers to be sent with the call.
521
+ # @return [::Hash{::Symbol=>::String}]
522
+ # @!attribute [rw] retry_policy
523
+ # The retry policy. The value is a hash with the following keys:
524
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
525
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
526
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
527
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
528
+ # trigger a retry.
529
+ # @return [::Hash]
530
+ # @!attribute [rw] quota_project
531
+ # A separate project against which to charge quota.
532
+ # @return [::String]
533
+ # @!attribute [rw] universe_domain
534
+ # The universe domain within which to make requests. This determines the
535
+ # default endpoint URL. The default value of nil uses the environment
536
+ # universe (usually the default "googleapis.com" universe).
537
+ # @return [::String,nil]
538
+ #
539
+ class Configuration
540
+ extend ::Gapic::Config
541
+
542
+ # @private
543
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
544
+ DEFAULT_ENDPOINT = "cloudkms.googleapis.com"
545
+
546
+ config_attr :endpoint, nil, ::String, nil
547
+ config_attr :credentials, nil do |value|
548
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
549
+ allowed.any? { |klass| klass === value }
550
+ end
551
+ config_attr :scope, nil, ::String, ::Array, nil
552
+ config_attr :lib_name, nil, ::String, nil
553
+ config_attr :lib_version, nil, ::String, nil
554
+ config_attr :timeout, nil, ::Numeric, nil
555
+ config_attr :metadata, nil, ::Hash, nil
556
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
557
+ config_attr :quota_project, nil, ::String, nil
558
+ config_attr :universe_domain, nil, ::String, nil
559
+
560
+ # @private
561
+ # Overrides for http bindings for the RPCs of this service
562
+ # are only used when this service is used as mixin, and only
563
+ # by the host service.
564
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
565
+ config_attr :bindings_override, {}, ::Hash, nil
566
+
567
+ # @private
568
+ def initialize parent_config = nil
569
+ @parent_config = parent_config unless parent_config.nil?
570
+
571
+ yield self if block_given?
572
+ end
573
+
574
+ ##
575
+ # Configurations for individual RPCs
576
+ # @return [Rpcs]
577
+ #
578
+ def rpcs
579
+ @rpcs ||= begin
580
+ parent_rpcs = nil
581
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
582
+ Rpcs.new parent_rpcs
583
+ end
584
+ end
585
+
586
+ ##
587
+ # Configuration RPC class for the AutokeyAdmin API.
588
+ #
589
+ # Includes fields providing the configuration for each RPC in this service.
590
+ # Each configuration object is of type `Gapic::Config::Method` and includes
591
+ # the following configuration fields:
592
+ #
593
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
594
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
595
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
596
+ # include the following keys:
597
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
598
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
599
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
600
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
601
+ # trigger a retry.
602
+ #
603
+ class Rpcs
604
+ ##
605
+ # RPC-specific configuration for `update_autokey_config`
606
+ # @return [::Gapic::Config::Method]
607
+ #
608
+ attr_reader :update_autokey_config
609
+ ##
610
+ # RPC-specific configuration for `get_autokey_config`
611
+ # @return [::Gapic::Config::Method]
612
+ #
613
+ attr_reader :get_autokey_config
614
+ ##
615
+ # RPC-specific configuration for `show_effective_autokey_config`
616
+ # @return [::Gapic::Config::Method]
617
+ #
618
+ attr_reader :show_effective_autokey_config
619
+
620
+ # @private
621
+ def initialize parent_rpcs = nil
622
+ update_autokey_config_config = parent_rpcs.update_autokey_config if parent_rpcs.respond_to? :update_autokey_config
623
+ @update_autokey_config = ::Gapic::Config::Method.new update_autokey_config_config
624
+ get_autokey_config_config = parent_rpcs.get_autokey_config if parent_rpcs.respond_to? :get_autokey_config
625
+ @get_autokey_config = ::Gapic::Config::Method.new get_autokey_config_config
626
+ show_effective_autokey_config_config = parent_rpcs.show_effective_autokey_config if parent_rpcs.respond_to? :show_effective_autokey_config
627
+ @show_effective_autokey_config = ::Gapic::Config::Method.new show_effective_autokey_config_config
628
+
629
+ yield self if block_given?
630
+ end
631
+ end
632
+ end
633
+ end
634
+ end
635
+ end
636
+ end
637
+ end
638
+ end
639
+ end