google-cloud-secret_manager-v1 0.15.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1473 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/secretmanager/v1/service_pb"
21
+ require "google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module SecretManager
26
+ module V1
27
+ module SecretManagerService
28
+ module Rest
29
+ ##
30
+ # REST client for the SecretManagerService service.
31
+ #
32
+ # Secret Manager Service
33
+ #
34
+ # Manages secrets and operations using those secrets. Implements a REST
35
+ # model with the following objects:
36
+ #
37
+ # * {::Google::Cloud::SecretManager::V1::Secret Secret}
38
+ # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}
39
+ #
40
+ class Client
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :secret_manager_service_stub
45
+
46
+ ##
47
+ # Configure the SecretManagerService Client class.
48
+ #
49
+ # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all SecretManagerService clients
55
+ # ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::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", "SecretManager", "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.rpcs.list_secrets.timeout = 60.0
76
+
77
+ default_config.rpcs.create_secret.timeout = 60.0
78
+
79
+ default_config.rpcs.add_secret_version.timeout = 60.0
80
+
81
+ default_config.rpcs.get_secret.timeout = 60.0
82
+
83
+ default_config.rpcs.update_secret.timeout = 60.0
84
+
85
+ default_config.rpcs.delete_secret.timeout = 60.0
86
+
87
+ default_config.rpcs.list_secret_versions.timeout = 60.0
88
+
89
+ default_config.rpcs.get_secret_version.timeout = 60.0
90
+
91
+ default_config.rpcs.access_secret_version.timeout = 60.0
92
+ default_config.rpcs.access_secret_version.retry_policy = {
93
+ initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8]
94
+ }
95
+
96
+ default_config.rpcs.disable_secret_version.timeout = 60.0
97
+
98
+ default_config.rpcs.enable_secret_version.timeout = 60.0
99
+
100
+ default_config.rpcs.destroy_secret_version.timeout = 60.0
101
+
102
+ default_config.rpcs.set_iam_policy.timeout = 60.0
103
+
104
+ default_config.rpcs.get_iam_policy.timeout = 60.0
105
+
106
+ default_config.rpcs.test_iam_permissions.timeout = 60.0
107
+
108
+ default_config
109
+ end
110
+ yield @configure if block_given?
111
+ @configure
112
+ end
113
+
114
+ ##
115
+ # Configure the SecretManagerService Client instance.
116
+ #
117
+ # The configuration is set to the derived mode, meaning that values can be changed,
118
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
119
+ # should be made on {Client.configure}.
120
+ #
121
+ # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration}
122
+ # for a description of the configuration fields.
123
+ #
124
+ # @yield [config] Configure the Client client.
125
+ # @yieldparam config [Client::Configuration]
126
+ #
127
+ # @return [Client::Configuration]
128
+ #
129
+ def configure
130
+ yield @config if block_given?
131
+ @config
132
+ end
133
+
134
+ ##
135
+ # Create a new SecretManagerService REST client object.
136
+ #
137
+ # @example
138
+ #
139
+ # # Create a client using the default configuration
140
+ # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new
141
+ #
142
+ # # Create a client using a custom configuration
143
+ # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config|
144
+ # config.timeout = 10.0
145
+ # end
146
+ #
147
+ # @yield [config] Configure the SecretManagerService client.
148
+ # @yieldparam config [Client::Configuration]
149
+ #
150
+ def initialize
151
+ # Create the configuration object
152
+ @config = Configuration.new Client.configure
153
+
154
+ # Yield the configuration if needed
155
+ yield @config if block_given?
156
+
157
+ # Create credentials
158
+ credentials = @config.credentials
159
+ # Use self-signed JWT if the endpoint is unchanged from default,
160
+ # but only if the default endpoint does not have a region prefix.
161
+ enable_self_signed_jwt = @config.endpoint == Client.configure.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
+ @secret_manager_service_stub = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
173
+ end
174
+
175
+ # Service calls
176
+
177
+ ##
178
+ # Lists {::Google::Cloud::SecretManager::V1::Secret Secrets}.
179
+ #
180
+ # @overload list_secrets(request, options = nil)
181
+ # Pass arguments to `list_secrets` via a request object, either of type
182
+ # {::Google::Cloud::SecretManager::V1::ListSecretsRequest} or an equivalent Hash.
183
+ #
184
+ # @param request [::Google::Cloud::SecretManager::V1::ListSecretsRequest, ::Hash]
185
+ # A request object representing the call parameters. Required. To specify no
186
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
187
+ # @param options [::Gapic::CallOptions, ::Hash]
188
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
189
+ #
190
+ # @overload list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil)
191
+ # Pass arguments to `list_secrets` via keyword arguments. Note that at
192
+ # least one keyword argument is required. To specify no parameters, or to keep all
193
+ # the default parameter values, pass an empty Hash as a request object (see above).
194
+ #
195
+ # @param parent [::String]
196
+ # Required. The resource name of the project associated with the
197
+ # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*`.
198
+ # @param page_size [::Integer]
199
+ # Optional. The maximum number of results to be returned in a single page. If
200
+ # set to 0, the server decides the number of results to return. If the
201
+ # number is greater than 25000, it is capped at 25000.
202
+ # @param page_token [::String]
203
+ # Optional. Pagination token, returned earlier via
204
+ # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}.
205
+ # @param filter [::String]
206
+ # Optional. Filter string, adhering to the rules in
207
+ # [List-operation
208
+ # filtering](https://cloud.google.com/secret-manager/docs/filtering). List
209
+ # only secrets matching the filter. If filter is empty, all secrets are
210
+ # listed.
211
+ # @yield [result, operation] Access the result along with the TransportOperation object
212
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>]
213
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
214
+ #
215
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>]
216
+ #
217
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
218
+ def list_secrets request, options = nil
219
+ raise ::ArgumentError, "request must be provided" if request.nil?
220
+
221
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretsRequest
222
+
223
+ # Converts hash and nil to an options object
224
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
225
+
226
+ # Customize the options with defaults
227
+ call_metadata = @config.rpcs.list_secrets.metadata.to_h
228
+
229
+ # Set x-goog-api-client and x-goog-user-project headers
230
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
231
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
232
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
233
+ transports_version_send: [:rest]
234
+
235
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
236
+
237
+ options.apply_defaults timeout: @config.rpcs.list_secrets.timeout,
238
+ metadata: call_metadata,
239
+ retry_policy: @config.rpcs.list_secrets.retry_policy
240
+
241
+ options.apply_defaults timeout: @config.timeout,
242
+ metadata: @config.metadata,
243
+ retry_policy: @config.retry_policy
244
+
245
+ @secret_manager_service_stub.list_secrets request, options do |result, operation|
246
+ result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, "secrets", request, result, options
247
+ yield result, operation if block_given?
248
+ return result
249
+ end
250
+ rescue ::Gapic::Rest::Error => e
251
+ raise ::Google::Cloud::Error.from_error(e)
252
+ end
253
+
254
+ ##
255
+ # Creates a new {::Google::Cloud::SecretManager::V1::Secret Secret} containing no {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}.
256
+ #
257
+ # @overload create_secret(request, options = nil)
258
+ # Pass arguments to `create_secret` via a request object, either of type
259
+ # {::Google::Cloud::SecretManager::V1::CreateSecretRequest} or an equivalent Hash.
260
+ #
261
+ # @param request [::Google::Cloud::SecretManager::V1::CreateSecretRequest, ::Hash]
262
+ # A request object representing the call parameters. Required. To specify no
263
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
264
+ # @param options [::Gapic::CallOptions, ::Hash]
265
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
266
+ #
267
+ # @overload create_secret(parent: nil, secret_id: nil, secret: nil)
268
+ # Pass arguments to `create_secret` via keyword arguments. Note that at
269
+ # least one keyword argument is required. To specify no parameters, or to keep all
270
+ # the default parameter values, pass an empty Hash as a request object (see above).
271
+ #
272
+ # @param parent [::String]
273
+ # Required. The resource name of the project to associate with the
274
+ # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*`.
275
+ # @param secret_id [::String]
276
+ # Required. This must be unique within the project.
277
+ #
278
+ # A secret ID is a string with a maximum length of 255 characters and can
279
+ # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and
280
+ # underscore (`_`) characters.
281
+ # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash]
282
+ # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial field values.
283
+ # @yield [result, operation] Access the result along with the TransportOperation object
284
+ # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret]
285
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
286
+ #
287
+ # @return [::Google::Cloud::SecretManager::V1::Secret]
288
+ #
289
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
290
+ def create_secret request, options = nil
291
+ raise ::ArgumentError, "request must be provided" if request.nil?
292
+
293
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::CreateSecretRequest
294
+
295
+ # Converts hash and nil to an options object
296
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
297
+
298
+ # Customize the options with defaults
299
+ call_metadata = @config.rpcs.create_secret.metadata.to_h
300
+
301
+ # Set x-goog-api-client and x-goog-user-project headers
302
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
303
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
304
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
305
+ transports_version_send: [:rest]
306
+
307
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
308
+
309
+ options.apply_defaults timeout: @config.rpcs.create_secret.timeout,
310
+ metadata: call_metadata,
311
+ retry_policy: @config.rpcs.create_secret.retry_policy
312
+
313
+ options.apply_defaults timeout: @config.timeout,
314
+ metadata: @config.metadata,
315
+ retry_policy: @config.retry_policy
316
+
317
+ @secret_manager_service_stub.create_secret request, options do |result, operation|
318
+ yield result, operation if block_given?
319
+ return result
320
+ end
321
+ rescue ::Gapic::Rest::Error => e
322
+ raise ::Google::Cloud::Error.from_error(e)
323
+ end
324
+
325
+ ##
326
+ # Creates a new {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} containing secret data and attaches
327
+ # it to an existing {::Google::Cloud::SecretManager::V1::Secret Secret}.
328
+ #
329
+ # @overload add_secret_version(request, options = nil)
330
+ # Pass arguments to `add_secret_version` via a request object, either of type
331
+ # {::Google::Cloud::SecretManager::V1::AddSecretVersionRequest} or an equivalent Hash.
332
+ #
333
+ # @param request [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, ::Hash]
334
+ # A request object representing the call parameters. Required. To specify no
335
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
336
+ # @param options [::Gapic::CallOptions, ::Hash]
337
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
338
+ #
339
+ # @overload add_secret_version(parent: nil, payload: nil)
340
+ # Pass arguments to `add_secret_version` via keyword arguments. Note that at
341
+ # least one keyword argument is required. To specify no parameters, or to keep all
342
+ # the default parameter values, pass an empty Hash as a request object (see above).
343
+ #
344
+ # @param parent [::String]
345
+ # Required. The resource name of the {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the
346
+ # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format `projects/*/secrets/*`.
347
+ # @param payload [::Google::Cloud::SecretManager::V1::SecretPayload, ::Hash]
348
+ # Required. The secret payload of the {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}.
349
+ # @yield [result, operation] Access the result along with the TransportOperation object
350
+ # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion]
351
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
352
+ #
353
+ # @return [::Google::Cloud::SecretManager::V1::SecretVersion]
354
+ #
355
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
356
+ def add_secret_version request, options = nil
357
+ raise ::ArgumentError, "request must be provided" if request.nil?
358
+
359
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest
360
+
361
+ # Converts hash and nil to an options object
362
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
363
+
364
+ # Customize the options with defaults
365
+ call_metadata = @config.rpcs.add_secret_version.metadata.to_h
366
+
367
+ # Set x-goog-api-client and x-goog-user-project headers
368
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
369
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
370
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
371
+ transports_version_send: [:rest]
372
+
373
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
374
+
375
+ options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout,
376
+ metadata: call_metadata,
377
+ retry_policy: @config.rpcs.add_secret_version.retry_policy
378
+
379
+ options.apply_defaults timeout: @config.timeout,
380
+ metadata: @config.metadata,
381
+ retry_policy: @config.retry_policy
382
+
383
+ @secret_manager_service_stub.add_secret_version request, options do |result, operation|
384
+ yield result, operation if block_given?
385
+ return result
386
+ end
387
+ rescue ::Gapic::Rest::Error => e
388
+ raise ::Google::Cloud::Error.from_error(e)
389
+ end
390
+
391
+ ##
392
+ # Gets metadata for a given {::Google::Cloud::SecretManager::V1::Secret Secret}.
393
+ #
394
+ # @overload get_secret(request, options = nil)
395
+ # Pass arguments to `get_secret` via a request object, either of type
396
+ # {::Google::Cloud::SecretManager::V1::GetSecretRequest} or an equivalent Hash.
397
+ #
398
+ # @param request [::Google::Cloud::SecretManager::V1::GetSecretRequest, ::Hash]
399
+ # A request object representing the call parameters. Required. To specify no
400
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
401
+ # @param options [::Gapic::CallOptions, ::Hash]
402
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
403
+ #
404
+ # @overload get_secret(name: nil)
405
+ # Pass arguments to `get_secret` via keyword arguments. Note that at
406
+ # least one keyword argument is required. To specify no parameters, or to keep all
407
+ # the default parameter values, pass an empty Hash as a request object (see above).
408
+ #
409
+ # @param name [::String]
410
+ # Required. The resource name of the {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*/secrets/*`.
411
+ # @yield [result, operation] Access the result along with the TransportOperation object
412
+ # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret]
413
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
414
+ #
415
+ # @return [::Google::Cloud::SecretManager::V1::Secret]
416
+ #
417
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
418
+ def get_secret request, options = nil
419
+ raise ::ArgumentError, "request must be provided" if request.nil?
420
+
421
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretRequest
422
+
423
+ # Converts hash and nil to an options object
424
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
425
+
426
+ # Customize the options with defaults
427
+ call_metadata = @config.rpcs.get_secret.metadata.to_h
428
+
429
+ # Set x-goog-api-client and x-goog-user-project headers
430
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
431
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
432
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
433
+ transports_version_send: [:rest]
434
+
435
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
436
+
437
+ options.apply_defaults timeout: @config.rpcs.get_secret.timeout,
438
+ metadata: call_metadata,
439
+ retry_policy: @config.rpcs.get_secret.retry_policy
440
+
441
+ options.apply_defaults timeout: @config.timeout,
442
+ metadata: @config.metadata,
443
+ retry_policy: @config.retry_policy
444
+
445
+ @secret_manager_service_stub.get_secret request, options do |result, operation|
446
+ yield result, operation if block_given?
447
+ return result
448
+ end
449
+ rescue ::Gapic::Rest::Error => e
450
+ raise ::Google::Cloud::Error.from_error(e)
451
+ end
452
+
453
+ ##
454
+ # Updates metadata of an existing {::Google::Cloud::SecretManager::V1::Secret Secret}.
455
+ #
456
+ # @overload update_secret(request, options = nil)
457
+ # Pass arguments to `update_secret` via a request object, either of type
458
+ # {::Google::Cloud::SecretManager::V1::UpdateSecretRequest} or an equivalent Hash.
459
+ #
460
+ # @param request [::Google::Cloud::SecretManager::V1::UpdateSecretRequest, ::Hash]
461
+ # A request object representing the call parameters. Required. To specify no
462
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
463
+ # @param options [::Gapic::CallOptions, ::Hash]
464
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
465
+ #
466
+ # @overload update_secret(secret: nil, update_mask: nil)
467
+ # Pass arguments to `update_secret` via keyword arguments. Note that at
468
+ # least one keyword argument is required. To specify no parameters, or to keep all
469
+ # the default parameter values, pass an empty Hash as a request object (see above).
470
+ #
471
+ # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash]
472
+ # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field values.
473
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
474
+ # Required. Specifies the fields to be updated.
475
+ # @yield [result, operation] Access the result along with the TransportOperation object
476
+ # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret]
477
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
478
+ #
479
+ # @return [::Google::Cloud::SecretManager::V1::Secret]
480
+ #
481
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
482
+ def update_secret request, options = nil
483
+ raise ::ArgumentError, "request must be provided" if request.nil?
484
+
485
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::UpdateSecretRequest
486
+
487
+ # Converts hash and nil to an options object
488
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
489
+
490
+ # Customize the options with defaults
491
+ call_metadata = @config.rpcs.update_secret.metadata.to_h
492
+
493
+ # Set x-goog-api-client and x-goog-user-project headers
494
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
495
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
496
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
497
+ transports_version_send: [:rest]
498
+
499
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
500
+
501
+ options.apply_defaults timeout: @config.rpcs.update_secret.timeout,
502
+ metadata: call_metadata,
503
+ retry_policy: @config.rpcs.update_secret.retry_policy
504
+
505
+ options.apply_defaults timeout: @config.timeout,
506
+ metadata: @config.metadata,
507
+ retry_policy: @config.retry_policy
508
+
509
+ @secret_manager_service_stub.update_secret request, options do |result, operation|
510
+ yield result, operation if block_given?
511
+ return result
512
+ end
513
+ rescue ::Gapic::Rest::Error => e
514
+ raise ::Google::Cloud::Error.from_error(e)
515
+ end
516
+
517
+ ##
518
+ # Deletes a {::Google::Cloud::SecretManager::V1::Secret Secret}.
519
+ #
520
+ # @overload delete_secret(request, options = nil)
521
+ # Pass arguments to `delete_secret` via a request object, either of type
522
+ # {::Google::Cloud::SecretManager::V1::DeleteSecretRequest} or an equivalent Hash.
523
+ #
524
+ # @param request [::Google::Cloud::SecretManager::V1::DeleteSecretRequest, ::Hash]
525
+ # A request object representing the call parameters. Required. To specify no
526
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
527
+ # @param options [::Gapic::CallOptions, ::Hash]
528
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
529
+ #
530
+ # @overload delete_secret(name: nil, etag: nil)
531
+ # Pass arguments to `delete_secret` via keyword arguments. Note that at
532
+ # least one keyword argument is required. To specify no parameters, or to keep all
533
+ # the default parameter values, pass an empty Hash as a request object (see above).
534
+ #
535
+ # @param name [::String]
536
+ # Required. The resource name of the {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format
537
+ # `projects/*/secrets/*`.
538
+ # @param etag [::String]
539
+ # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The request succeeds if it matches
540
+ # the etag of the currently stored secret object. If the etag is omitted,
541
+ # the request succeeds.
542
+ # @yield [result, operation] Access the result along with the TransportOperation object
543
+ # @yieldparam result [::Google::Protobuf::Empty]
544
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
545
+ #
546
+ # @return [::Google::Protobuf::Empty]
547
+ #
548
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
549
+ def delete_secret request, options = nil
550
+ raise ::ArgumentError, "request must be provided" if request.nil?
551
+
552
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DeleteSecretRequest
553
+
554
+ # Converts hash and nil to an options object
555
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
556
+
557
+ # Customize the options with defaults
558
+ call_metadata = @config.rpcs.delete_secret.metadata.to_h
559
+
560
+ # Set x-goog-api-client and x-goog-user-project headers
561
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
562
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
563
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
564
+ transports_version_send: [:rest]
565
+
566
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
567
+
568
+ options.apply_defaults timeout: @config.rpcs.delete_secret.timeout,
569
+ metadata: call_metadata,
570
+ retry_policy: @config.rpcs.delete_secret.retry_policy
571
+
572
+ options.apply_defaults timeout: @config.timeout,
573
+ metadata: @config.metadata,
574
+ retry_policy: @config.retry_policy
575
+
576
+ @secret_manager_service_stub.delete_secret request, options do |result, operation|
577
+ yield result, operation if block_given?
578
+ return result
579
+ end
580
+ rescue ::Gapic::Rest::Error => e
581
+ raise ::Google::Cloud::Error.from_error(e)
582
+ end
583
+
584
+ ##
585
+ # Lists {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. This call does not return secret
586
+ # data.
587
+ #
588
+ # @overload list_secret_versions(request, options = nil)
589
+ # Pass arguments to `list_secret_versions` via a request object, either of type
590
+ # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest} or an equivalent Hash.
591
+ #
592
+ # @param request [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, ::Hash]
593
+ # A request object representing the call parameters. Required. To specify no
594
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
595
+ # @param options [::Gapic::CallOptions, ::Hash]
596
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
597
+ #
598
+ # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil)
599
+ # Pass arguments to `list_secret_versions` via keyword arguments. Note that at
600
+ # least one keyword argument is required. To specify no parameters, or to keep all
601
+ # the default parameter values, pass an empty Hash as a request object (see above).
602
+ #
603
+ # @param parent [::String]
604
+ # Required. The resource name of the {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the
605
+ # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in the format
606
+ # `projects/*/secrets/*`.
607
+ # @param page_size [::Integer]
608
+ # Optional. The maximum number of results to be returned in a single page. If
609
+ # set to 0, the server decides the number of results to return. If the
610
+ # number is greater than 25000, it is capped at 25000.
611
+ # @param page_token [::String]
612
+ # Optional. Pagination token, returned earlier via
613
+ # ListSecretVersionsResponse.next_page_token][].
614
+ # @param filter [::String]
615
+ # Optional. Filter string, adhering to the rules in
616
+ # [List-operation
617
+ # filtering](https://cloud.google.com/secret-manager/docs/filtering). List
618
+ # only secret versions matching the filter. If filter is empty, all secret
619
+ # versions are listed.
620
+ # @yield [result, operation] Access the result along with the TransportOperation object
621
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>]
622
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
623
+ #
624
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>]
625
+ #
626
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
627
+ def list_secret_versions request, options = nil
628
+ raise ::ArgumentError, "request must be provided" if request.nil?
629
+
630
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest
631
+
632
+ # Converts hash and nil to an options object
633
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
634
+
635
+ # Customize the options with defaults
636
+ call_metadata = @config.rpcs.list_secret_versions.metadata.to_h
637
+
638
+ # Set x-goog-api-client and x-goog-user-project headers
639
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
640
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
641
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
642
+ transports_version_send: [:rest]
643
+
644
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
645
+
646
+ options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout,
647
+ metadata: call_metadata,
648
+ retry_policy: @config.rpcs.list_secret_versions.retry_policy
649
+
650
+ options.apply_defaults timeout: @config.timeout,
651
+ metadata: @config.metadata,
652
+ retry_policy: @config.retry_policy
653
+
654
+ @secret_manager_service_stub.list_secret_versions request, options do |result, operation|
655
+ result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, "versions", request, result, options
656
+ yield result, operation if block_given?
657
+ return result
658
+ end
659
+ rescue ::Gapic::Rest::Error => e
660
+ raise ::Google::Cloud::Error.from_error(e)
661
+ end
662
+
663
+ ##
664
+ # Gets metadata for a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}.
665
+ #
666
+ # `projects/*/secrets/*/versions/latest` is an alias to the most recently
667
+ # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}.
668
+ #
669
+ # @overload get_secret_version(request, options = nil)
670
+ # Pass arguments to `get_secret_version` via a request object, either of type
671
+ # {::Google::Cloud::SecretManager::V1::GetSecretVersionRequest} or an equivalent Hash.
672
+ #
673
+ # @param request [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, ::Hash]
674
+ # A request object representing the call parameters. Required. To specify no
675
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
676
+ # @param options [::Gapic::CallOptions, ::Hash]
677
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
678
+ #
679
+ # @overload get_secret_version(name: nil)
680
+ # Pass arguments to `get_secret_version` via keyword arguments. Note that at
681
+ # least one keyword argument is required. To specify no parameters, or to keep all
682
+ # the default parameter values, pass an empty Hash as a request object (see above).
683
+ #
684
+ # @param name [::String]
685
+ # Required. The resource name of the {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format
686
+ # `projects/*/secrets/*/versions/*`.
687
+ #
688
+ # `projects/*/secrets/*/versions/latest` is an alias to the most recently
689
+ # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}.
690
+ # @yield [result, operation] Access the result along with the TransportOperation object
691
+ # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion]
692
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
693
+ #
694
+ # @return [::Google::Cloud::SecretManager::V1::SecretVersion]
695
+ #
696
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
697
+ def get_secret_version request, options = nil
698
+ raise ::ArgumentError, "request must be provided" if request.nil?
699
+
700
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest
701
+
702
+ # Converts hash and nil to an options object
703
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
704
+
705
+ # Customize the options with defaults
706
+ call_metadata = @config.rpcs.get_secret_version.metadata.to_h
707
+
708
+ # Set x-goog-api-client and x-goog-user-project headers
709
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
710
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
711
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
712
+ transports_version_send: [:rest]
713
+
714
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
715
+
716
+ options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout,
717
+ metadata: call_metadata,
718
+ retry_policy: @config.rpcs.get_secret_version.retry_policy
719
+
720
+ options.apply_defaults timeout: @config.timeout,
721
+ metadata: @config.metadata,
722
+ retry_policy: @config.retry_policy
723
+
724
+ @secret_manager_service_stub.get_secret_version request, options do |result, operation|
725
+ yield result, operation if block_given?
726
+ return result
727
+ end
728
+ rescue ::Gapic::Rest::Error => e
729
+ raise ::Google::Cloud::Error.from_error(e)
730
+ end
731
+
732
+ ##
733
+ # Accesses a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. This call returns the secret data.
734
+ #
735
+ # `projects/*/secrets/*/versions/latest` is an alias to the most recently
736
+ # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}.
737
+ #
738
+ # @overload access_secret_version(request, options = nil)
739
+ # Pass arguments to `access_secret_version` via a request object, either of type
740
+ # {::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest} or an equivalent Hash.
741
+ #
742
+ # @param request [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, ::Hash]
743
+ # A request object representing the call parameters. Required. To specify no
744
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
745
+ # @param options [::Gapic::CallOptions, ::Hash]
746
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
747
+ #
748
+ # @overload access_secret_version(name: nil)
749
+ # Pass arguments to `access_secret_version` via keyword arguments. Note that at
750
+ # least one keyword argument is required. To specify no parameters, or to keep all
751
+ # the default parameter values, pass an empty Hash as a request object (see above).
752
+ #
753
+ # @param name [::String]
754
+ # Required. The resource name of the {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format
755
+ # `projects/*/secrets/*/versions/*`.
756
+ #
757
+ # `projects/*/secrets/*/versions/latest` is an alias to the most recently
758
+ # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}.
759
+ # @yield [result, operation] Access the result along with the TransportOperation object
760
+ # @yieldparam result [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse]
761
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
762
+ #
763
+ # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse]
764
+ #
765
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
766
+ def access_secret_version request, options = nil
767
+ raise ::ArgumentError, "request must be provided" if request.nil?
768
+
769
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest
770
+
771
+ # Converts hash and nil to an options object
772
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
773
+
774
+ # Customize the options with defaults
775
+ call_metadata = @config.rpcs.access_secret_version.metadata.to_h
776
+
777
+ # Set x-goog-api-client and x-goog-user-project headers
778
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
779
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
780
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
781
+ transports_version_send: [:rest]
782
+
783
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
784
+
785
+ options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout,
786
+ metadata: call_metadata,
787
+ retry_policy: @config.rpcs.access_secret_version.retry_policy
788
+
789
+ options.apply_defaults timeout: @config.timeout,
790
+ metadata: @config.metadata,
791
+ retry_policy: @config.retry_policy
792
+
793
+ @secret_manager_service_stub.access_secret_version request, options do |result, operation|
794
+ yield result, operation if block_given?
795
+ return result
796
+ end
797
+ rescue ::Gapic::Rest::Error => e
798
+ raise ::Google::Cloud::Error.from_error(e)
799
+ end
800
+
801
+ ##
802
+ # Disables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}.
803
+ #
804
+ # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to
805
+ # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DISABLED DISABLED}.
806
+ #
807
+ # @overload disable_secret_version(request, options = nil)
808
+ # Pass arguments to `disable_secret_version` via a request object, either of type
809
+ # {::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest} or an equivalent Hash.
810
+ #
811
+ # @param request [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, ::Hash]
812
+ # A request object representing the call parameters. Required. To specify no
813
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
814
+ # @param options [::Gapic::CallOptions, ::Hash]
815
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
816
+ #
817
+ # @overload disable_secret_version(name: nil, etag: nil)
818
+ # Pass arguments to `disable_secret_version` via keyword arguments. Note that at
819
+ # least one keyword argument is required. To specify no parameters, or to keep all
820
+ # the default parameter values, pass an empty Hash as a request object (see above).
821
+ #
822
+ # @param name [::String]
823
+ # Required. The resource name of the {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in the format
824
+ # `projects/*/secrets/*/versions/*`.
825
+ # @param etag [::String]
826
+ # Optional. Etag of the {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request succeeds if it matches
827
+ # the etag of the currently stored secret version object. If the etag is
828
+ # omitted, the request succeeds.
829
+ # @yield [result, operation] Access the result along with the TransportOperation object
830
+ # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion]
831
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
832
+ #
833
+ # @return [::Google::Cloud::SecretManager::V1::SecretVersion]
834
+ #
835
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
836
+ def disable_secret_version request, options = nil
837
+ raise ::ArgumentError, "request must be provided" if request.nil?
838
+
839
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest
840
+
841
+ # Converts hash and nil to an options object
842
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
843
+
844
+ # Customize the options with defaults
845
+ call_metadata = @config.rpcs.disable_secret_version.metadata.to_h
846
+
847
+ # Set x-goog-api-client and x-goog-user-project headers
848
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
849
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
850
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
851
+ transports_version_send: [:rest]
852
+
853
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
854
+
855
+ options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout,
856
+ metadata: call_metadata,
857
+ retry_policy: @config.rpcs.disable_secret_version.retry_policy
858
+
859
+ options.apply_defaults timeout: @config.timeout,
860
+ metadata: @config.metadata,
861
+ retry_policy: @config.retry_policy
862
+
863
+ @secret_manager_service_stub.disable_secret_version request, options do |result, operation|
864
+ yield result, operation if block_given?
865
+ return result
866
+ end
867
+ rescue ::Gapic::Rest::Error => e
868
+ raise ::Google::Cloud::Error.from_error(e)
869
+ end
870
+
871
+ ##
872
+ # Enables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}.
873
+ #
874
+ # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to
875
+ # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED}.
876
+ #
877
+ # @overload enable_secret_version(request, options = nil)
878
+ # Pass arguments to `enable_secret_version` via a request object, either of type
879
+ # {::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest} or an equivalent Hash.
880
+ #
881
+ # @param request [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, ::Hash]
882
+ # A request object representing the call parameters. Required. To specify no
883
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
884
+ # @param options [::Gapic::CallOptions, ::Hash]
885
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
886
+ #
887
+ # @overload enable_secret_version(name: nil, etag: nil)
888
+ # Pass arguments to `enable_secret_version` via keyword arguments. Note that at
889
+ # least one keyword argument is required. To specify no parameters, or to keep all
890
+ # the default parameter values, pass an empty Hash as a request object (see above).
891
+ #
892
+ # @param name [::String]
893
+ # Required. The resource name of the {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in the format
894
+ # `projects/*/secrets/*/versions/*`.
895
+ # @param etag [::String]
896
+ # Optional. Etag of the {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request succeeds if it matches
897
+ # the etag of the currently stored secret version object. If the etag is
898
+ # omitted, the request succeeds.
899
+ # @yield [result, operation] Access the result along with the TransportOperation object
900
+ # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion]
901
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
902
+ #
903
+ # @return [::Google::Cloud::SecretManager::V1::SecretVersion]
904
+ #
905
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
906
+ def enable_secret_version request, options = nil
907
+ raise ::ArgumentError, "request must be provided" if request.nil?
908
+
909
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest
910
+
911
+ # Converts hash and nil to an options object
912
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
913
+
914
+ # Customize the options with defaults
915
+ call_metadata = @config.rpcs.enable_secret_version.metadata.to_h
916
+
917
+ # Set x-goog-api-client and x-goog-user-project headers
918
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
919
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
920
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
921
+ transports_version_send: [:rest]
922
+
923
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
924
+
925
+ options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout,
926
+ metadata: call_metadata,
927
+ retry_policy: @config.rpcs.enable_secret_version.retry_policy
928
+
929
+ options.apply_defaults timeout: @config.timeout,
930
+ metadata: @config.metadata,
931
+ retry_policy: @config.retry_policy
932
+
933
+ @secret_manager_service_stub.enable_secret_version request, options do |result, operation|
934
+ yield result, operation if block_given?
935
+ return result
936
+ end
937
+ rescue ::Gapic::Rest::Error => e
938
+ raise ::Google::Cloud::Error.from_error(e)
939
+ end
940
+
941
+ ##
942
+ # Destroys a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}.
943
+ #
944
+ # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to
945
+ # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED} and irrevocably destroys the
946
+ # secret data.
947
+ #
948
+ # @overload destroy_secret_version(request, options = nil)
949
+ # Pass arguments to `destroy_secret_version` via a request object, either of type
950
+ # {::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest} or an equivalent Hash.
951
+ #
952
+ # @param request [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, ::Hash]
953
+ # A request object representing the call parameters. Required. To specify no
954
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
955
+ # @param options [::Gapic::CallOptions, ::Hash]
956
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
957
+ #
958
+ # @overload destroy_secret_version(name: nil, etag: nil)
959
+ # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at
960
+ # least one keyword argument is required. To specify no parameters, or to keep all
961
+ # the default parameter values, pass an empty Hash as a request object (see above).
962
+ #
963
+ # @param name [::String]
964
+ # Required. The resource name of the {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in the format
965
+ # `projects/*/secrets/*/versions/*`.
966
+ # @param etag [::String]
967
+ # Optional. Etag of the {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request succeeds if it matches
968
+ # the etag of the currently stored secret version object. If the etag is
969
+ # omitted, the request succeeds.
970
+ # @yield [result, operation] Access the result along with the TransportOperation object
971
+ # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion]
972
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
973
+ #
974
+ # @return [::Google::Cloud::SecretManager::V1::SecretVersion]
975
+ #
976
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
977
+ def destroy_secret_version request, options = nil
978
+ raise ::ArgumentError, "request must be provided" if request.nil?
979
+
980
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest
981
+
982
+ # Converts hash and nil to an options object
983
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
984
+
985
+ # Customize the options with defaults
986
+ call_metadata = @config.rpcs.destroy_secret_version.metadata.to_h
987
+
988
+ # Set x-goog-api-client and x-goog-user-project headers
989
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
990
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
991
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
992
+ transports_version_send: [:rest]
993
+
994
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
995
+
996
+ options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout,
997
+ metadata: call_metadata,
998
+ retry_policy: @config.rpcs.destroy_secret_version.retry_policy
999
+
1000
+ options.apply_defaults timeout: @config.timeout,
1001
+ metadata: @config.metadata,
1002
+ retry_policy: @config.retry_policy
1003
+
1004
+ @secret_manager_service_stub.destroy_secret_version request, options do |result, operation|
1005
+ yield result, operation if block_given?
1006
+ return result
1007
+ end
1008
+ rescue ::Gapic::Rest::Error => e
1009
+ raise ::Google::Cloud::Error.from_error(e)
1010
+ end
1011
+
1012
+ ##
1013
+ # Sets the access control policy on the specified secret. Replaces any
1014
+ # existing policy.
1015
+ #
1016
+ # Permissions on {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} are enforced according
1017
+ # to the policy set on the associated {::Google::Cloud::SecretManager::V1::Secret Secret}.
1018
+ #
1019
+ # @overload set_iam_policy(request, options = nil)
1020
+ # Pass arguments to `set_iam_policy` via a request object, either of type
1021
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
1022
+ #
1023
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
1024
+ # A request object representing the call parameters. Required. To specify no
1025
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1026
+ # @param options [::Gapic::CallOptions, ::Hash]
1027
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1028
+ #
1029
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
1030
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
1031
+ # least one keyword argument is required. To specify no parameters, or to keep all
1032
+ # the default parameter values, pass an empty Hash as a request object (see above).
1033
+ #
1034
+ # @param resource [::String]
1035
+ # REQUIRED: The resource for which the policy is being specified.
1036
+ # See the operation documentation for the appropriate value for this field.
1037
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
1038
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
1039
+ # the policy is limited to a few 10s of KB. An empty policy is a
1040
+ # valid policy but certain Cloud Platform services (such as Projects)
1041
+ # might reject them.
1042
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1043
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
1044
+ # the fields in the mask will be modified. If no mask is provided, the
1045
+ # following default mask is used:
1046
+ #
1047
+ # `paths: "bindings, etag"`
1048
+ # @yield [result, operation] Access the result along with the TransportOperation object
1049
+ # @yieldparam result [::Google::Iam::V1::Policy]
1050
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1051
+ #
1052
+ # @return [::Google::Iam::V1::Policy]
1053
+ #
1054
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1055
+ def set_iam_policy request, options = nil
1056
+ raise ::ArgumentError, "request must be provided" if request.nil?
1057
+
1058
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
1059
+
1060
+ # Converts hash and nil to an options object
1061
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1062
+
1063
+ # Customize the options with defaults
1064
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
1065
+
1066
+ # Set x-goog-api-client and x-goog-user-project headers
1067
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1068
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1069
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
1070
+ transports_version_send: [:rest]
1071
+
1072
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1073
+
1074
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1075
+ metadata: call_metadata,
1076
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
1077
+
1078
+ options.apply_defaults timeout: @config.timeout,
1079
+ metadata: @config.metadata,
1080
+ retry_policy: @config.retry_policy
1081
+
1082
+ @secret_manager_service_stub.set_iam_policy request, options do |result, operation|
1083
+ yield result, operation if block_given?
1084
+ return result
1085
+ end
1086
+ rescue ::Gapic::Rest::Error => e
1087
+ raise ::Google::Cloud::Error.from_error(e)
1088
+ end
1089
+
1090
+ ##
1091
+ # Gets the access control policy for a secret.
1092
+ # Returns empty policy if the secret exists and does not have a policy set.
1093
+ #
1094
+ # @overload get_iam_policy(request, options = nil)
1095
+ # Pass arguments to `get_iam_policy` via a request object, either of type
1096
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
1097
+ #
1098
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
1099
+ # A request object representing the call parameters. Required. To specify no
1100
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1101
+ # @param options [::Gapic::CallOptions, ::Hash]
1102
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1103
+ #
1104
+ # @overload get_iam_policy(resource: nil, options: nil)
1105
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
1106
+ # least one keyword argument is required. To specify no parameters, or to keep all
1107
+ # the default parameter values, pass an empty Hash as a request object (see above).
1108
+ #
1109
+ # @param resource [::String]
1110
+ # REQUIRED: The resource for which the policy is being requested.
1111
+ # See the operation documentation for the appropriate value for this field.
1112
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
1113
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
1114
+ # `GetIamPolicy`.
1115
+ # @yield [result, operation] Access the result along with the TransportOperation object
1116
+ # @yieldparam result [::Google::Iam::V1::Policy]
1117
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1118
+ #
1119
+ # @return [::Google::Iam::V1::Policy]
1120
+ #
1121
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1122
+ def get_iam_policy request, options = nil
1123
+ raise ::ArgumentError, "request must be provided" if request.nil?
1124
+
1125
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
1126
+
1127
+ # Converts hash and nil to an options object
1128
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1129
+
1130
+ # Customize the options with defaults
1131
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
1132
+
1133
+ # Set x-goog-api-client and x-goog-user-project headers
1134
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1135
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1136
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
1137
+ transports_version_send: [:rest]
1138
+
1139
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1140
+
1141
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1142
+ metadata: call_metadata,
1143
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
1144
+
1145
+ options.apply_defaults timeout: @config.timeout,
1146
+ metadata: @config.metadata,
1147
+ retry_policy: @config.retry_policy
1148
+
1149
+ @secret_manager_service_stub.get_iam_policy request, options do |result, operation|
1150
+ yield result, operation if block_given?
1151
+ return result
1152
+ end
1153
+ rescue ::Gapic::Rest::Error => e
1154
+ raise ::Google::Cloud::Error.from_error(e)
1155
+ end
1156
+
1157
+ ##
1158
+ # Returns permissions that a caller has for the specified secret.
1159
+ # If the secret does not exist, this call returns an empty set of
1160
+ # permissions, not a NOT_FOUND error.
1161
+ #
1162
+ # Note: This operation is designed to be used for building permission-aware
1163
+ # UIs and command-line tools, not for authorization checking. This operation
1164
+ # may "fail open" without warning.
1165
+ #
1166
+ # @overload test_iam_permissions(request, options = nil)
1167
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
1168
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
1169
+ #
1170
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
1171
+ # A request object representing the call parameters. Required. To specify no
1172
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1173
+ # @param options [::Gapic::CallOptions, ::Hash]
1174
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1175
+ #
1176
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
1177
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
1178
+ # least one keyword argument is required. To specify no parameters, or to keep all
1179
+ # the default parameter values, pass an empty Hash as a request object (see above).
1180
+ #
1181
+ # @param resource [::String]
1182
+ # REQUIRED: The resource for which the policy detail is being requested.
1183
+ # See the operation documentation for the appropriate value for this field.
1184
+ # @param permissions [::Array<::String>]
1185
+ # The set of permissions to check for the `resource`. Permissions with
1186
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
1187
+ # information see
1188
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1189
+ # @yield [result, operation] Access the result along with the TransportOperation object
1190
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
1191
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1192
+ #
1193
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
1194
+ #
1195
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1196
+ def test_iam_permissions request, options = nil
1197
+ raise ::ArgumentError, "request must be provided" if request.nil?
1198
+
1199
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
1200
+
1201
+ # Converts hash and nil to an options object
1202
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1203
+
1204
+ # Customize the options with defaults
1205
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1206
+
1207
+ # Set x-goog-api-client and x-goog-user-project headers
1208
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1209
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1210
+ gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
1211
+ transports_version_send: [:rest]
1212
+
1213
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1214
+
1215
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1216
+ metadata: call_metadata,
1217
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1218
+
1219
+ options.apply_defaults timeout: @config.timeout,
1220
+ metadata: @config.metadata,
1221
+ retry_policy: @config.retry_policy
1222
+
1223
+ @secret_manager_service_stub.test_iam_permissions request, options do |result, operation|
1224
+ yield result, operation if block_given?
1225
+ return result
1226
+ end
1227
+ rescue ::Gapic::Rest::Error => e
1228
+ raise ::Google::Cloud::Error.from_error(e)
1229
+ end
1230
+
1231
+ ##
1232
+ # Configuration class for the SecretManagerService REST API.
1233
+ #
1234
+ # This class represents the configuration for SecretManagerService REST,
1235
+ # providing control over timeouts, retry behavior, logging, transport
1236
+ # parameters, and other low-level controls. Certain parameters can also be
1237
+ # applied individually to specific RPCs. See
1238
+ # {::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration::Rpcs}
1239
+ # for a list of RPCs that can be configured independently.
1240
+ #
1241
+ # Configuration can be applied globally to all clients, or to a single client
1242
+ # on construction.
1243
+ #
1244
+ # @example
1245
+ #
1246
+ # # Modify the global config, setting the timeout for
1247
+ # # list_secrets to 20 seconds,
1248
+ # # and all remaining timeouts to 10 seconds.
1249
+ # ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.configure do |config|
1250
+ # config.timeout = 10.0
1251
+ # config.rpcs.list_secrets.timeout = 20.0
1252
+ # end
1253
+ #
1254
+ # # Apply the above configuration only to a new client.
1255
+ # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config|
1256
+ # config.timeout = 10.0
1257
+ # config.rpcs.list_secrets.timeout = 20.0
1258
+ # end
1259
+ #
1260
+ # @!attribute [rw] endpoint
1261
+ # The hostname or hostname:port of the service endpoint.
1262
+ # Defaults to `"secretmanager.googleapis.com"`.
1263
+ # @return [::String]
1264
+ # @!attribute [rw] credentials
1265
+ # Credentials to send with calls. You may provide any of the following types:
1266
+ # * (`String`) The path to a service account key file in JSON format
1267
+ # * (`Hash`) A service account key as a Hash
1268
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1269
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1270
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1271
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1272
+ # * (`nil`) indicating no credentials
1273
+ # @return [::Object]
1274
+ # @!attribute [rw] scope
1275
+ # The OAuth scopes
1276
+ # @return [::Array<::String>]
1277
+ # @!attribute [rw] lib_name
1278
+ # The library name as recorded in instrumentation and logging
1279
+ # @return [::String]
1280
+ # @!attribute [rw] lib_version
1281
+ # The library version as recorded in instrumentation and logging
1282
+ # @return [::String]
1283
+ # @!attribute [rw] timeout
1284
+ # The call timeout in seconds.
1285
+ # @return [::Numeric]
1286
+ # @!attribute [rw] metadata
1287
+ # Additional headers to be sent with the call.
1288
+ # @return [::Hash{::Symbol=>::String}]
1289
+ # @!attribute [rw] retry_policy
1290
+ # The retry policy. The value is a hash with the following keys:
1291
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1292
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1293
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1294
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1295
+ # trigger a retry.
1296
+ # @return [::Hash]
1297
+ # @!attribute [rw] quota_project
1298
+ # A separate project against which to charge quota.
1299
+ # @return [::String]
1300
+ #
1301
+ class Configuration
1302
+ extend ::Gapic::Config
1303
+
1304
+ config_attr :endpoint, "secretmanager.googleapis.com", ::String
1305
+ config_attr :credentials, nil do |value|
1306
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1307
+ allowed.any? { |klass| klass === value }
1308
+ end
1309
+ config_attr :scope, nil, ::String, ::Array, nil
1310
+ config_attr :lib_name, nil, ::String, nil
1311
+ config_attr :lib_version, nil, ::String, nil
1312
+ config_attr :timeout, nil, ::Numeric, nil
1313
+ config_attr :metadata, nil, ::Hash, nil
1314
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1315
+ config_attr :quota_project, nil, ::String, nil
1316
+
1317
+ # @private
1318
+ def initialize parent_config = nil
1319
+ @parent_config = parent_config unless parent_config.nil?
1320
+
1321
+ yield self if block_given?
1322
+ end
1323
+
1324
+ ##
1325
+ # Configurations for individual RPCs
1326
+ # @return [Rpcs]
1327
+ #
1328
+ def rpcs
1329
+ @rpcs ||= begin
1330
+ parent_rpcs = nil
1331
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1332
+ Rpcs.new parent_rpcs
1333
+ end
1334
+ end
1335
+
1336
+ ##
1337
+ # Configuration RPC class for the SecretManagerService API.
1338
+ #
1339
+ # Includes fields providing the configuration for each RPC in this service.
1340
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1341
+ # the following configuration fields:
1342
+ #
1343
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1344
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1345
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1346
+ # include the following keys:
1347
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1348
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1349
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1350
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1351
+ # trigger a retry.
1352
+ #
1353
+ class Rpcs
1354
+ ##
1355
+ # RPC-specific configuration for `list_secrets`
1356
+ # @return [::Gapic::Config::Method]
1357
+ #
1358
+ attr_reader :list_secrets
1359
+ ##
1360
+ # RPC-specific configuration for `create_secret`
1361
+ # @return [::Gapic::Config::Method]
1362
+ #
1363
+ attr_reader :create_secret
1364
+ ##
1365
+ # RPC-specific configuration for `add_secret_version`
1366
+ # @return [::Gapic::Config::Method]
1367
+ #
1368
+ attr_reader :add_secret_version
1369
+ ##
1370
+ # RPC-specific configuration for `get_secret`
1371
+ # @return [::Gapic::Config::Method]
1372
+ #
1373
+ attr_reader :get_secret
1374
+ ##
1375
+ # RPC-specific configuration for `update_secret`
1376
+ # @return [::Gapic::Config::Method]
1377
+ #
1378
+ attr_reader :update_secret
1379
+ ##
1380
+ # RPC-specific configuration for `delete_secret`
1381
+ # @return [::Gapic::Config::Method]
1382
+ #
1383
+ attr_reader :delete_secret
1384
+ ##
1385
+ # RPC-specific configuration for `list_secret_versions`
1386
+ # @return [::Gapic::Config::Method]
1387
+ #
1388
+ attr_reader :list_secret_versions
1389
+ ##
1390
+ # RPC-specific configuration for `get_secret_version`
1391
+ # @return [::Gapic::Config::Method]
1392
+ #
1393
+ attr_reader :get_secret_version
1394
+ ##
1395
+ # RPC-specific configuration for `access_secret_version`
1396
+ # @return [::Gapic::Config::Method]
1397
+ #
1398
+ attr_reader :access_secret_version
1399
+ ##
1400
+ # RPC-specific configuration for `disable_secret_version`
1401
+ # @return [::Gapic::Config::Method]
1402
+ #
1403
+ attr_reader :disable_secret_version
1404
+ ##
1405
+ # RPC-specific configuration for `enable_secret_version`
1406
+ # @return [::Gapic::Config::Method]
1407
+ #
1408
+ attr_reader :enable_secret_version
1409
+ ##
1410
+ # RPC-specific configuration for `destroy_secret_version`
1411
+ # @return [::Gapic::Config::Method]
1412
+ #
1413
+ attr_reader :destroy_secret_version
1414
+ ##
1415
+ # RPC-specific configuration for `set_iam_policy`
1416
+ # @return [::Gapic::Config::Method]
1417
+ #
1418
+ attr_reader :set_iam_policy
1419
+ ##
1420
+ # RPC-specific configuration for `get_iam_policy`
1421
+ # @return [::Gapic::Config::Method]
1422
+ #
1423
+ attr_reader :get_iam_policy
1424
+ ##
1425
+ # RPC-specific configuration for `test_iam_permissions`
1426
+ # @return [::Gapic::Config::Method]
1427
+ #
1428
+ attr_reader :test_iam_permissions
1429
+
1430
+ # @private
1431
+ def initialize parent_rpcs = nil
1432
+ list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets
1433
+ @list_secrets = ::Gapic::Config::Method.new list_secrets_config
1434
+ create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret
1435
+ @create_secret = ::Gapic::Config::Method.new create_secret_config
1436
+ add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version
1437
+ @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config
1438
+ get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret
1439
+ @get_secret = ::Gapic::Config::Method.new get_secret_config
1440
+ update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret
1441
+ @update_secret = ::Gapic::Config::Method.new update_secret_config
1442
+ delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret
1443
+ @delete_secret = ::Gapic::Config::Method.new delete_secret_config
1444
+ list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions
1445
+ @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config
1446
+ get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version
1447
+ @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config
1448
+ access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version
1449
+ @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config
1450
+ disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version
1451
+ @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config
1452
+ enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version
1453
+ @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config
1454
+ destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version
1455
+ @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config
1456
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1457
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1458
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1459
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1460
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1461
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1462
+
1463
+ yield self if block_given?
1464
+ end
1465
+ end
1466
+ end
1467
+ end
1468
+ end
1469
+ end
1470
+ end
1471
+ end
1472
+ end
1473
+ end