google-cloud-secret_manager-v1beta2 0.a → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/secret_manager/v1beta2/bindings_override.rb +102 -0
  6. data/lib/google/cloud/secret_manager/v1beta2/rest.rb +38 -0
  7. data/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/client.rb +1958 -0
  8. data/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/credentials.rb +51 -0
  9. data/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/paths.rb +167 -0
  10. data/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/client.rb +1835 -0
  11. data/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/service_stub.rb +1075 -0
  12. data/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest.rb +59 -0
  13. data/lib/google/cloud/secret_manager/v1beta2/secret_manager_service.rb +61 -0
  14. data/lib/google/cloud/secret_manager/v1beta2/version.rb +7 -2
  15. data/lib/google/cloud/secret_manager/v1beta2.rb +45 -0
  16. data/lib/google/cloud/secretmanager/v1beta2/resources_pb.rb +64 -0
  17. data/lib/google/cloud/secretmanager/v1beta2/service_pb.rb +68 -0
  18. data/lib/google/cloud/secretmanager/v1beta2/service_services_pb.rb +125 -0
  19. data/lib/google-cloud-secret_manager-v1beta2.rb +21 -0
  20. data/proto_docs/README.md +4 -0
  21. data/proto_docs/google/api/client.rb +420 -0
  22. data/proto_docs/google/api/field_behavior.rb +85 -0
  23. data/proto_docs/google/api/launch_stage.rb +71 -0
  24. data/proto_docs/google/api/resource.rb +227 -0
  25. data/proto_docs/google/cloud/secretmanager/v1beta2/resources.rb +499 -0
  26. data/proto_docs/google/cloud/secretmanager/v1beta2/service.rb +321 -0
  27. data/proto_docs/google/iam/v1/iam_policy.rb +87 -0
  28. data/proto_docs/google/iam/v1/options.rb +50 -0
  29. data/proto_docs/google/iam/v1/policy.rb +426 -0
  30. data/proto_docs/google/protobuf/any.rb +145 -0
  31. data/proto_docs/google/protobuf/duration.rb +98 -0
  32. data/proto_docs/google/protobuf/empty.rb +34 -0
  33. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  34. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  35. data/proto_docs/google/type/expr.rb +75 -0
  36. metadata +110 -10
@@ -0,0 +1,1958 @@
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/secretmanager/v1beta2/service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module SecretManager
26
+ module V1beta2
27
+ module SecretManagerService
28
+ ##
29
+ # Client for the SecretManagerService service.
30
+ #
31
+ # Secret Manager Service
32
+ #
33
+ # Manages secrets and operations using those secrets. Implements a REST
34
+ # model with the following objects:
35
+ #
36
+ # * {::Google::Cloud::SecretManager::V1beta2::Secret Secret}
37
+ # * {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}
38
+ #
39
+ class Client
40
+ # @private
41
+ API_VERSION = ""
42
+
43
+ # @private
44
+ DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$"
45
+
46
+ include Paths
47
+
48
+ # @private
49
+ attr_reader :secret_manager_service_stub
50
+
51
+ ##
52
+ # Configure the SecretManagerService Client class.
53
+ #
54
+ # See {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client::Configuration}
55
+ # for a description of the configuration fields.
56
+ #
57
+ # @example
58
+ #
59
+ # # Modify the configuration for all SecretManagerService clients
60
+ # ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.configure do |config|
61
+ # config.timeout = 10.0
62
+ # end
63
+ #
64
+ # @yield [config] Configure the Client client.
65
+ # @yieldparam config [Client::Configuration]
66
+ #
67
+ # @return [Client::Configuration]
68
+ #
69
+ def self.configure
70
+ @configure ||= begin
71
+ namespace = ["Google", "Cloud", "SecretManager", "V1beta2"]
72
+ parent_config = while namespace.any?
73
+ parent_name = namespace.join "::"
74
+ parent_const = const_get parent_name
75
+ break parent_const.configure if parent_const.respond_to? :configure
76
+ namespace.pop
77
+ end
78
+ default_config = Client::Configuration.new parent_config
79
+
80
+ default_config.rpcs.list_secrets.timeout = 60.0
81
+
82
+ default_config.rpcs.create_secret.timeout = 60.0
83
+
84
+ default_config.rpcs.add_secret_version.timeout = 60.0
85
+
86
+ default_config.rpcs.get_secret.timeout = 60.0
87
+
88
+ default_config.rpcs.update_secret.timeout = 60.0
89
+
90
+ default_config.rpcs.delete_secret.timeout = 60.0
91
+
92
+ default_config.rpcs.list_secret_versions.timeout = 60.0
93
+
94
+ default_config.rpcs.get_secret_version.timeout = 60.0
95
+
96
+ default_config.rpcs.access_secret_version.timeout = 60.0
97
+ default_config.rpcs.access_secret_version.retry_policy = {
98
+ initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8]
99
+ }
100
+
101
+ default_config.rpcs.disable_secret_version.timeout = 60.0
102
+
103
+ default_config.rpcs.enable_secret_version.timeout = 60.0
104
+
105
+ default_config.rpcs.destroy_secret_version.timeout = 60.0
106
+
107
+ default_config.rpcs.set_iam_policy.timeout = 60.0
108
+
109
+ default_config.rpcs.get_iam_policy.timeout = 60.0
110
+
111
+ default_config.rpcs.test_iam_permissions.timeout = 60.0
112
+
113
+ default_config
114
+ end
115
+ yield @configure if block_given?
116
+ @configure
117
+ end
118
+
119
+ ##
120
+ # Configure the SecretManagerService Client instance.
121
+ #
122
+ # The configuration is set to the derived mode, meaning that values can be changed,
123
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
124
+ # should be made on {Client.configure}.
125
+ #
126
+ # See {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client::Configuration}
127
+ # for a description of the configuration fields.
128
+ #
129
+ # @yield [config] Configure the Client client.
130
+ # @yieldparam config [Client::Configuration]
131
+ #
132
+ # @return [Client::Configuration]
133
+ #
134
+ def configure
135
+ yield @config if block_given?
136
+ @config
137
+ end
138
+
139
+ ##
140
+ # The effective universe domain
141
+ #
142
+ # @return [String]
143
+ #
144
+ def universe_domain
145
+ @secret_manager_service_stub.universe_domain
146
+ end
147
+
148
+ ##
149
+ # Create a new SecretManagerService client object.
150
+ #
151
+ # @example
152
+ #
153
+ # # Create a client using the default configuration
154
+ # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
155
+ #
156
+ # # Create a client using a custom configuration
157
+ # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config|
158
+ # config.timeout = 10.0
159
+ # end
160
+ #
161
+ # @yield [config] Configure the SecretManagerService client.
162
+ # @yieldparam config [Client::Configuration]
163
+ #
164
+ def initialize
165
+ # These require statements are intentionally placed here to initialize
166
+ # the gRPC module only when it's required.
167
+ # See https://github.com/googleapis/toolkit/issues/446
168
+ require "gapic/grpc"
169
+ require "google/cloud/secretmanager/v1beta2/service_services_pb"
170
+
171
+ # Create the configuration object
172
+ @config = Configuration.new Client.configure
173
+
174
+ # Yield the configuration if needed
175
+ yield @config if block_given?
176
+
177
+ # Create credentials
178
+ credentials = @config.credentials
179
+ # Use self-signed JWT if the endpoint is unchanged from default,
180
+ # but only if the default endpoint does not have a region prefix.
181
+ enable_self_signed_jwt = @config.endpoint.nil? ||
182
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
183
+ !@config.endpoint.split(".").first.include?("-"))
184
+ credentials ||= Credentials.default scope: @config.scope,
185
+ enable_self_signed_jwt: enable_self_signed_jwt
186
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
187
+ credentials = Credentials.new credentials, scope: @config.scope
188
+ end
189
+ @quota_project_id = @config.quota_project
190
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
191
+
192
+ @secret_manager_service_stub = ::Gapic::ServiceStub.new(
193
+ ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Stub,
194
+ credentials: credentials,
195
+ endpoint: @config.endpoint,
196
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
197
+ universe_domain: @config.universe_domain,
198
+ channel_args: @config.channel_args,
199
+ interceptors: @config.interceptors,
200
+ channel_pool_config: @config.channel_pool
201
+ )
202
+
203
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
204
+ config.credentials = credentials
205
+ config.quota_project = @quota_project_id
206
+ config.endpoint = @secret_manager_service_stub.endpoint
207
+ config.universe_domain = @secret_manager_service_stub.universe_domain
208
+ end
209
+ end
210
+
211
+ ##
212
+ # Get the associated client for mix-in of the Locations.
213
+ #
214
+ # @return [Google::Cloud::Location::Locations::Client]
215
+ #
216
+ attr_reader :location_client
217
+
218
+ # Service calls
219
+
220
+ ##
221
+ # Lists {::Google::Cloud::SecretManager::V1beta2::Secret Secrets}.
222
+ #
223
+ # @overload list_secrets(request, options = nil)
224
+ # Pass arguments to `list_secrets` via a request object, either of type
225
+ # {::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest} or an equivalent Hash.
226
+ #
227
+ # @param request [::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest, ::Hash]
228
+ # A request object representing the call parameters. Required. To specify no
229
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
230
+ # @param options [::Gapic::CallOptions, ::Hash]
231
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
232
+ #
233
+ # @overload list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil)
234
+ # Pass arguments to `list_secrets` via keyword arguments. Note that at
235
+ # least one keyword argument is required. To specify no parameters, or to keep all
236
+ # the default parameter values, pass an empty Hash as a request object (see above).
237
+ #
238
+ # @param parent [::String]
239
+ # Required. The resource name of the project associated with the
240
+ # {::Google::Cloud::SecretManager::V1beta2::Secret Secrets}, in the format
241
+ # `projects/*` or `projects/*/locations/*`
242
+ # @param page_size [::Integer]
243
+ # Optional. The maximum number of results to be returned in a single page. If
244
+ # set to 0, the server decides the number of results to return. If the
245
+ # number is greater than 25000, it is capped at 25000.
246
+ # @param page_token [::String]
247
+ # Optional. Pagination token, returned earlier via
248
+ # {::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}.
249
+ # @param filter [::String]
250
+ # Optional. Filter string, adhering to the rules in
251
+ # [List-operation
252
+ # filtering](https://cloud.google.com/secret-manager/docs/filtering). List
253
+ # only secrets matching the filter. If filter is empty, all secrets are
254
+ # listed.
255
+ #
256
+ # @yield [response, operation] Access the result along with the RPC operation
257
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>]
258
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
259
+ #
260
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>]
261
+ #
262
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
263
+ #
264
+ # @example Basic example
265
+ # require "google/cloud/secret_manager/v1beta2"
266
+ #
267
+ # # Create a client object. The client can be reused for multiple calls.
268
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
269
+ #
270
+ # # Create a request. To set request fields, pass in keyword arguments.
271
+ # request = Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new
272
+ #
273
+ # # Call the list_secrets method.
274
+ # result = client.list_secrets request
275
+ #
276
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
277
+ # # over elements, and API calls will be issued to fetch pages as needed.
278
+ # result.each do |item|
279
+ # # Each element is of type ::Google::Cloud::SecretManager::V1beta2::Secret.
280
+ # p item
281
+ # end
282
+ #
283
+ def list_secrets request, options = nil
284
+ raise ::ArgumentError, "request must be provided" if request.nil?
285
+
286
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest
287
+
288
+ # Converts hash and nil to an options object
289
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
290
+
291
+ # Customize the options with defaults
292
+ metadata = @config.rpcs.list_secrets.metadata.to_h
293
+
294
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
295
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
296
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
297
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
298
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
299
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
300
+
301
+ header_params = {}
302
+ if request.parent
303
+ header_params["parent"] = request.parent
304
+ end
305
+
306
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
307
+ metadata[:"x-goog-request-params"] ||= request_params_header
308
+
309
+ options.apply_defaults timeout: @config.rpcs.list_secrets.timeout,
310
+ metadata: metadata,
311
+ retry_policy: @config.rpcs.list_secrets.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.call_rpc :list_secrets, request, options: options do |response, operation|
318
+ response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, request, response, operation, options
319
+ yield response, operation if block_given?
320
+ return response
321
+ end
322
+ rescue ::GRPC::BadStatus => e
323
+ raise ::Google::Cloud::Error.from_error(e)
324
+ end
325
+
326
+ ##
327
+ # Creates a new {::Google::Cloud::SecretManager::V1beta2::Secret Secret}
328
+ # containing no
329
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}.
330
+ #
331
+ # @overload create_secret(request, options = nil)
332
+ # Pass arguments to `create_secret` via a request object, either of type
333
+ # {::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest} or an equivalent Hash.
334
+ #
335
+ # @param request [::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest, ::Hash]
336
+ # A request object representing the call parameters. Required. To specify no
337
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
338
+ # @param options [::Gapic::CallOptions, ::Hash]
339
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
340
+ #
341
+ # @overload create_secret(parent: nil, secret_id: nil, secret: nil)
342
+ # Pass arguments to `create_secret` via keyword arguments. Note that at
343
+ # least one keyword argument is required. To specify no parameters, or to keep all
344
+ # the default parameter values, pass an empty Hash as a request object (see above).
345
+ #
346
+ # @param parent [::String]
347
+ # Required. The resource name of the project to associate with the
348
+ # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format
349
+ # `projects/*` or `projects/*/locations/*`.
350
+ # @param secret_id [::String]
351
+ # Required. This must be unique within the project.
352
+ #
353
+ # A secret ID is a string with a maximum length of 255 characters and can
354
+ # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and
355
+ # underscore (`_`) characters.
356
+ # @param secret [::Google::Cloud::SecretManager::V1beta2::Secret, ::Hash]
357
+ # Required. A {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with
358
+ # initial field values.
359
+ #
360
+ # @yield [response, operation] Access the result along with the RPC operation
361
+ # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::Secret]
362
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
363
+ #
364
+ # @return [::Google::Cloud::SecretManager::V1beta2::Secret]
365
+ #
366
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
367
+ #
368
+ # @example Basic example
369
+ # require "google/cloud/secret_manager/v1beta2"
370
+ #
371
+ # # Create a client object. The client can be reused for multiple calls.
372
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
373
+ #
374
+ # # Create a request. To set request fields, pass in keyword arguments.
375
+ # request = Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new
376
+ #
377
+ # # Call the create_secret method.
378
+ # result = client.create_secret request
379
+ #
380
+ # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret.
381
+ # p result
382
+ #
383
+ def create_secret request, options = nil
384
+ raise ::ArgumentError, "request must be provided" if request.nil?
385
+
386
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest
387
+
388
+ # Converts hash and nil to an options object
389
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
390
+
391
+ # Customize the options with defaults
392
+ metadata = @config.rpcs.create_secret.metadata.to_h
393
+
394
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
395
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
396
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
397
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
398
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
399
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
400
+
401
+ header_params = {}
402
+ if request.parent
403
+ header_params["parent"] = request.parent
404
+ end
405
+
406
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
407
+ metadata[:"x-goog-request-params"] ||= request_params_header
408
+
409
+ options.apply_defaults timeout: @config.rpcs.create_secret.timeout,
410
+ metadata: metadata,
411
+ retry_policy: @config.rpcs.create_secret.retry_policy
412
+
413
+ options.apply_defaults timeout: @config.timeout,
414
+ metadata: @config.metadata,
415
+ retry_policy: @config.retry_policy
416
+
417
+ @secret_manager_service_stub.call_rpc :create_secret, request, options: options do |response, operation|
418
+ yield response, operation if block_given?
419
+ return response
420
+ end
421
+ rescue ::GRPC::BadStatus => e
422
+ raise ::Google::Cloud::Error.from_error(e)
423
+ end
424
+
425
+ ##
426
+ # Creates a new
427
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}
428
+ # containing secret data and attaches it to an existing
429
+ # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}.
430
+ #
431
+ # @overload add_secret_version(request, options = nil)
432
+ # Pass arguments to `add_secret_version` via a request object, either of type
433
+ # {::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest} or an equivalent Hash.
434
+ #
435
+ # @param request [::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest, ::Hash]
436
+ # A request object representing the call parameters. Required. To specify no
437
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
438
+ # @param options [::Gapic::CallOptions, ::Hash]
439
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
440
+ #
441
+ # @overload add_secret_version(parent: nil, payload: nil)
442
+ # Pass arguments to `add_secret_version` via keyword arguments. Note that at
443
+ # least one keyword argument is required. To specify no parameters, or to keep all
444
+ # the default parameter values, pass an empty Hash as a request object (see above).
445
+ #
446
+ # @param parent [::String]
447
+ # Required. The resource name of the
448
+ # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to associate with the
449
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the
450
+ # format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.
451
+ # @param payload [::Google::Cloud::SecretManager::V1beta2::SecretPayload, ::Hash]
452
+ # Required. The secret payload of the
453
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}.
454
+ #
455
+ # @yield [response, operation] Access the result along with the RPC operation
456
+ # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
457
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
458
+ #
459
+ # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
460
+ #
461
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
462
+ #
463
+ # @example Basic example
464
+ # require "google/cloud/secret_manager/v1beta2"
465
+ #
466
+ # # Create a client object. The client can be reused for multiple calls.
467
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
468
+ #
469
+ # # Create a request. To set request fields, pass in keyword arguments.
470
+ # request = Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new
471
+ #
472
+ # # Call the add_secret_version method.
473
+ # result = client.add_secret_version request
474
+ #
475
+ # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion.
476
+ # p result
477
+ #
478
+ def add_secret_version request, options = nil
479
+ raise ::ArgumentError, "request must be provided" if request.nil?
480
+
481
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest
482
+
483
+ # Converts hash and nil to an options object
484
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
485
+
486
+ # Customize the options with defaults
487
+ metadata = @config.rpcs.add_secret_version.metadata.to_h
488
+
489
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
490
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
491
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
492
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
493
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
494
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
495
+
496
+ header_params = {}
497
+ if request.parent
498
+ header_params["parent"] = request.parent
499
+ end
500
+
501
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
502
+ metadata[:"x-goog-request-params"] ||= request_params_header
503
+
504
+ options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout,
505
+ metadata: metadata,
506
+ retry_policy: @config.rpcs.add_secret_version.retry_policy
507
+
508
+ options.apply_defaults timeout: @config.timeout,
509
+ metadata: @config.metadata,
510
+ retry_policy: @config.retry_policy
511
+
512
+ @secret_manager_service_stub.call_rpc :add_secret_version, request, options: options do |response, operation|
513
+ yield response, operation if block_given?
514
+ return response
515
+ end
516
+ rescue ::GRPC::BadStatus => e
517
+ raise ::Google::Cloud::Error.from_error(e)
518
+ end
519
+
520
+ ##
521
+ # Gets metadata for a given
522
+ # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}.
523
+ #
524
+ # @overload get_secret(request, options = nil)
525
+ # Pass arguments to `get_secret` via a request object, either of type
526
+ # {::Google::Cloud::SecretManager::V1beta2::GetSecretRequest} or an equivalent Hash.
527
+ #
528
+ # @param request [::Google::Cloud::SecretManager::V1beta2::GetSecretRequest, ::Hash]
529
+ # A request object representing the call parameters. Required. To specify no
530
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
531
+ # @param options [::Gapic::CallOptions, ::Hash]
532
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
533
+ #
534
+ # @overload get_secret(name: nil)
535
+ # Pass arguments to `get_secret` via keyword arguments. Note that at
536
+ # least one keyword argument is required. To specify no parameters, or to keep all
537
+ # the default parameter values, pass an empty Hash as a request object (see above).
538
+ #
539
+ # @param name [::String]
540
+ # Required. The resource name of the
541
+ # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format
542
+ # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.
543
+ #
544
+ # @yield [response, operation] Access the result along with the RPC operation
545
+ # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::Secret]
546
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
547
+ #
548
+ # @return [::Google::Cloud::SecretManager::V1beta2::Secret]
549
+ #
550
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
551
+ #
552
+ # @example Basic example
553
+ # require "google/cloud/secret_manager/v1beta2"
554
+ #
555
+ # # Create a client object. The client can be reused for multiple calls.
556
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
557
+ #
558
+ # # Create a request. To set request fields, pass in keyword arguments.
559
+ # request = Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new
560
+ #
561
+ # # Call the get_secret method.
562
+ # result = client.get_secret request
563
+ #
564
+ # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret.
565
+ # p result
566
+ #
567
+ def get_secret request, options = nil
568
+ raise ::ArgumentError, "request must be provided" if request.nil?
569
+
570
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest
571
+
572
+ # Converts hash and nil to an options object
573
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
574
+
575
+ # Customize the options with defaults
576
+ metadata = @config.rpcs.get_secret.metadata.to_h
577
+
578
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
579
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
580
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
581
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
582
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
583
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
584
+
585
+ header_params = {}
586
+ if request.name
587
+ header_params["name"] = request.name
588
+ end
589
+
590
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
591
+ metadata[:"x-goog-request-params"] ||= request_params_header
592
+
593
+ options.apply_defaults timeout: @config.rpcs.get_secret.timeout,
594
+ metadata: metadata,
595
+ retry_policy: @config.rpcs.get_secret.retry_policy
596
+
597
+ options.apply_defaults timeout: @config.timeout,
598
+ metadata: @config.metadata,
599
+ retry_policy: @config.retry_policy
600
+
601
+ @secret_manager_service_stub.call_rpc :get_secret, request, options: options do |response, operation|
602
+ yield response, operation if block_given?
603
+ return response
604
+ end
605
+ rescue ::GRPC::BadStatus => e
606
+ raise ::Google::Cloud::Error.from_error(e)
607
+ end
608
+
609
+ ##
610
+ # Updates metadata of an existing
611
+ # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}.
612
+ #
613
+ # @overload update_secret(request, options = nil)
614
+ # Pass arguments to `update_secret` via a request object, either of type
615
+ # {::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest} or an equivalent Hash.
616
+ #
617
+ # @param request [::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest, ::Hash]
618
+ # A request object representing the call parameters. Required. To specify no
619
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
620
+ # @param options [::Gapic::CallOptions, ::Hash]
621
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
622
+ #
623
+ # @overload update_secret(secret: nil, update_mask: nil)
624
+ # Pass arguments to `update_secret` via keyword arguments. Note that at
625
+ # least one keyword argument is required. To specify no parameters, or to keep all
626
+ # the default parameter values, pass an empty Hash as a request object (see above).
627
+ #
628
+ # @param secret [::Google::Cloud::SecretManager::V1beta2::Secret, ::Hash]
629
+ # Required. {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with updated
630
+ # field values.
631
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
632
+ # Required. Specifies the fields to be updated.
633
+ #
634
+ # @yield [response, operation] Access the result along with the RPC operation
635
+ # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::Secret]
636
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
637
+ #
638
+ # @return [::Google::Cloud::SecretManager::V1beta2::Secret]
639
+ #
640
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
641
+ #
642
+ # @example Basic example
643
+ # require "google/cloud/secret_manager/v1beta2"
644
+ #
645
+ # # Create a client object. The client can be reused for multiple calls.
646
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
647
+ #
648
+ # # Create a request. To set request fields, pass in keyword arguments.
649
+ # request = Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new
650
+ #
651
+ # # Call the update_secret method.
652
+ # result = client.update_secret request
653
+ #
654
+ # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret.
655
+ # p result
656
+ #
657
+ def update_secret request, options = nil
658
+ raise ::ArgumentError, "request must be provided" if request.nil?
659
+
660
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest
661
+
662
+ # Converts hash and nil to an options object
663
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
664
+
665
+ # Customize the options with defaults
666
+ metadata = @config.rpcs.update_secret.metadata.to_h
667
+
668
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
669
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
670
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
671
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
672
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
673
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
674
+
675
+ header_params = {}
676
+ if request.secret&.name
677
+ header_params["secret.name"] = request.secret.name
678
+ end
679
+
680
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
681
+ metadata[:"x-goog-request-params"] ||= request_params_header
682
+
683
+ options.apply_defaults timeout: @config.rpcs.update_secret.timeout,
684
+ metadata: metadata,
685
+ retry_policy: @config.rpcs.update_secret.retry_policy
686
+
687
+ options.apply_defaults timeout: @config.timeout,
688
+ metadata: @config.metadata,
689
+ retry_policy: @config.retry_policy
690
+
691
+ @secret_manager_service_stub.call_rpc :update_secret, request, options: options do |response, operation|
692
+ yield response, operation if block_given?
693
+ return response
694
+ end
695
+ rescue ::GRPC::BadStatus => e
696
+ raise ::Google::Cloud::Error.from_error(e)
697
+ end
698
+
699
+ ##
700
+ # Deletes a {::Google::Cloud::SecretManager::V1beta2::Secret Secret}.
701
+ #
702
+ # @overload delete_secret(request, options = nil)
703
+ # Pass arguments to `delete_secret` via a request object, either of type
704
+ # {::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest} or an equivalent Hash.
705
+ #
706
+ # @param request [::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest, ::Hash]
707
+ # A request object representing the call parameters. Required. To specify no
708
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
709
+ # @param options [::Gapic::CallOptions, ::Hash]
710
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
711
+ #
712
+ # @overload delete_secret(name: nil, etag: nil)
713
+ # Pass arguments to `delete_secret` via keyword arguments. Note that at
714
+ # least one keyword argument is required. To specify no parameters, or to keep all
715
+ # the default parameter values, pass an empty Hash as a request object (see above).
716
+ #
717
+ # @param name [::String]
718
+ # Required. The resource name of the
719
+ # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to delete in the format
720
+ # `projects/*/secrets/*`.
721
+ # @param etag [::String]
722
+ # Optional. Etag of the {::Google::Cloud::SecretManager::V1beta2::Secret Secret}.
723
+ # The request succeeds if it matches the etag of the currently stored secret
724
+ # object. If the etag is omitted, the request succeeds.
725
+ #
726
+ # @yield [response, operation] Access the result along with the RPC operation
727
+ # @yieldparam response [::Google::Protobuf::Empty]
728
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
729
+ #
730
+ # @return [::Google::Protobuf::Empty]
731
+ #
732
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
733
+ #
734
+ # @example Basic example
735
+ # require "google/cloud/secret_manager/v1beta2"
736
+ #
737
+ # # Create a client object. The client can be reused for multiple calls.
738
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
739
+ #
740
+ # # Create a request. To set request fields, pass in keyword arguments.
741
+ # request = Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new
742
+ #
743
+ # # Call the delete_secret method.
744
+ # result = client.delete_secret request
745
+ #
746
+ # # The returned object is of type Google::Protobuf::Empty.
747
+ # p result
748
+ #
749
+ def delete_secret request, options = nil
750
+ raise ::ArgumentError, "request must be provided" if request.nil?
751
+
752
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest
753
+
754
+ # Converts hash and nil to an options object
755
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
756
+
757
+ # Customize the options with defaults
758
+ metadata = @config.rpcs.delete_secret.metadata.to_h
759
+
760
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
761
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
762
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
763
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
764
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
765
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
766
+
767
+ header_params = {}
768
+ if request.name
769
+ header_params["name"] = request.name
770
+ end
771
+
772
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
773
+ metadata[:"x-goog-request-params"] ||= request_params_header
774
+
775
+ options.apply_defaults timeout: @config.rpcs.delete_secret.timeout,
776
+ metadata: metadata,
777
+ retry_policy: @config.rpcs.delete_secret.retry_policy
778
+
779
+ options.apply_defaults timeout: @config.timeout,
780
+ metadata: @config.metadata,
781
+ retry_policy: @config.retry_policy
782
+
783
+ @secret_manager_service_stub.call_rpc :delete_secret, request, options: options do |response, operation|
784
+ yield response, operation if block_given?
785
+ return response
786
+ end
787
+ rescue ::GRPC::BadStatus => e
788
+ raise ::Google::Cloud::Error.from_error(e)
789
+ end
790
+
791
+ ##
792
+ # Lists {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}.
793
+ # This call does not return secret data.
794
+ #
795
+ # @overload list_secret_versions(request, options = nil)
796
+ # Pass arguments to `list_secret_versions` via a request object, either of type
797
+ # {::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest} or an equivalent Hash.
798
+ #
799
+ # @param request [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest, ::Hash]
800
+ # A request object representing the call parameters. Required. To specify no
801
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
802
+ # @param options [::Gapic::CallOptions, ::Hash]
803
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
804
+ #
805
+ # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil)
806
+ # Pass arguments to `list_secret_versions` via keyword arguments. Note that at
807
+ # least one keyword argument is required. To specify no parameters, or to keep all
808
+ # the default parameter values, pass an empty Hash as a request object (see above).
809
+ #
810
+ # @param parent [::String]
811
+ # Required. The resource name of the
812
+ # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} associated with the
813
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} to list,
814
+ # in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.
815
+ # @param page_size [::Integer]
816
+ # Optional. The maximum number of results to be returned in a single page. If
817
+ # set to 0, the server decides the number of results to return. If the
818
+ # number is greater than 25000, it is capped at 25000.
819
+ # @param page_token [::String]
820
+ # Optional. Pagination token, returned earlier via
821
+ # ListSecretVersionsResponse.next_page_token][].
822
+ # @param filter [::String]
823
+ # Optional. Filter string, adhering to the rules in
824
+ # [List-operation
825
+ # filtering](https://cloud.google.com/secret-manager/docs/filtering). List
826
+ # only secret versions matching the filter. If filter is empty, all secret
827
+ # versions are listed.
828
+ #
829
+ # @yield [response, operation] Access the result along with the RPC operation
830
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>]
831
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
832
+ #
833
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>]
834
+ #
835
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
836
+ #
837
+ # @example Basic example
838
+ # require "google/cloud/secret_manager/v1beta2"
839
+ #
840
+ # # Create a client object. The client can be reused for multiple calls.
841
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
842
+ #
843
+ # # Create a request. To set request fields, pass in keyword arguments.
844
+ # request = Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new
845
+ #
846
+ # # Call the list_secret_versions method.
847
+ # result = client.list_secret_versions request
848
+ #
849
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
850
+ # # over elements, and API calls will be issued to fetch pages as needed.
851
+ # result.each do |item|
852
+ # # Each element is of type ::Google::Cloud::SecretManager::V1beta2::SecretVersion.
853
+ # p item
854
+ # end
855
+ #
856
+ def list_secret_versions request, options = nil
857
+ raise ::ArgumentError, "request must be provided" if request.nil?
858
+
859
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest
860
+
861
+ # Converts hash and nil to an options object
862
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
863
+
864
+ # Customize the options with defaults
865
+ metadata = @config.rpcs.list_secret_versions.metadata.to_h
866
+
867
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
868
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
869
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
870
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
871
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
872
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
873
+
874
+ header_params = {}
875
+ if request.parent
876
+ header_params["parent"] = request.parent
877
+ end
878
+
879
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
880
+ metadata[:"x-goog-request-params"] ||= request_params_header
881
+
882
+ options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout,
883
+ metadata: metadata,
884
+ retry_policy: @config.rpcs.list_secret_versions.retry_policy
885
+
886
+ options.apply_defaults timeout: @config.timeout,
887
+ metadata: @config.metadata,
888
+ retry_policy: @config.retry_policy
889
+
890
+ @secret_manager_service_stub.call_rpc :list_secret_versions, request, options: options do |response, operation|
891
+ response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, request, response, operation, options
892
+ yield response, operation if block_given?
893
+ return response
894
+ end
895
+ rescue ::GRPC::BadStatus => e
896
+ raise ::Google::Cloud::Error.from_error(e)
897
+ end
898
+
899
+ ##
900
+ # Gets metadata for a
901
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}.
902
+ #
903
+ # `projects/*/secrets/*/versions/latest` is an alias to the most recently
904
+ # created {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}.
905
+ #
906
+ # @overload get_secret_version(request, options = nil)
907
+ # Pass arguments to `get_secret_version` via a request object, either of type
908
+ # {::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest} or an equivalent Hash.
909
+ #
910
+ # @param request [::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest, ::Hash]
911
+ # A request object representing the call parameters. Required. To specify no
912
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
913
+ # @param options [::Gapic::CallOptions, ::Hash]
914
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
915
+ #
916
+ # @overload get_secret_version(name: nil)
917
+ # Pass arguments to `get_secret_version` via keyword arguments. Note that at
918
+ # least one keyword argument is required. To specify no parameters, or to keep all
919
+ # the default parameter values, pass an empty Hash as a request object (see above).
920
+ #
921
+ # @param name [::String]
922
+ # Required. The resource name of the
923
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the
924
+ # format `projects/*/secrets/*/versions/*` or
925
+ # `projects/*/locations/*/secrets/*/versions/*`.
926
+ #
927
+ # `projects/*/secrets/*/versions/latest` or
928
+ # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most
929
+ # recently created
930
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}.
931
+ #
932
+ # @yield [response, operation] Access the result along with the RPC operation
933
+ # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
934
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
935
+ #
936
+ # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
937
+ #
938
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
939
+ #
940
+ # @example Basic example
941
+ # require "google/cloud/secret_manager/v1beta2"
942
+ #
943
+ # # Create a client object. The client can be reused for multiple calls.
944
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
945
+ #
946
+ # # Create a request. To set request fields, pass in keyword arguments.
947
+ # request = Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new
948
+ #
949
+ # # Call the get_secret_version method.
950
+ # result = client.get_secret_version request
951
+ #
952
+ # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion.
953
+ # p result
954
+ #
955
+ def get_secret_version request, options = nil
956
+ raise ::ArgumentError, "request must be provided" if request.nil?
957
+
958
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest
959
+
960
+ # Converts hash and nil to an options object
961
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
962
+
963
+ # Customize the options with defaults
964
+ metadata = @config.rpcs.get_secret_version.metadata.to_h
965
+
966
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
967
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
968
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
969
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
970
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
971
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
972
+
973
+ header_params = {}
974
+ if request.name
975
+ header_params["name"] = request.name
976
+ end
977
+
978
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
979
+ metadata[:"x-goog-request-params"] ||= request_params_header
980
+
981
+ options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout,
982
+ metadata: metadata,
983
+ retry_policy: @config.rpcs.get_secret_version.retry_policy
984
+
985
+ options.apply_defaults timeout: @config.timeout,
986
+ metadata: @config.metadata,
987
+ retry_policy: @config.retry_policy
988
+
989
+ @secret_manager_service_stub.call_rpc :get_secret_version, request, options: options do |response, operation|
990
+ yield response, operation if block_given?
991
+ return response
992
+ end
993
+ rescue ::GRPC::BadStatus => e
994
+ raise ::Google::Cloud::Error.from_error(e)
995
+ end
996
+
997
+ ##
998
+ # Accesses a
999
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. This
1000
+ # call returns the secret data.
1001
+ #
1002
+ # `projects/*/secrets/*/versions/latest` is an alias to the most recently
1003
+ # created {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}.
1004
+ #
1005
+ # @overload access_secret_version(request, options = nil)
1006
+ # Pass arguments to `access_secret_version` via a request object, either of type
1007
+ # {::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest} or an equivalent Hash.
1008
+ #
1009
+ # @param request [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest, ::Hash]
1010
+ # A request object representing the call parameters. Required. To specify no
1011
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1012
+ # @param options [::Gapic::CallOptions, ::Hash]
1013
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1014
+ #
1015
+ # @overload access_secret_version(name: nil)
1016
+ # Pass arguments to `access_secret_version` via keyword arguments. Note that at
1017
+ # least one keyword argument is required. To specify no parameters, or to keep all
1018
+ # the default parameter values, pass an empty Hash as a request object (see above).
1019
+ #
1020
+ # @param name [::String]
1021
+ # Required. The resource name of the
1022
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the
1023
+ # format `projects/*/secrets/*/versions/*` or
1024
+ # `projects/*/locations/*/secrets/*/versions/*`.
1025
+ #
1026
+ # `projects/*/secrets/*/versions/latest` or
1027
+ # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most
1028
+ # recently created
1029
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}.
1030
+ #
1031
+ # @yield [response, operation] Access the result along with the RPC operation
1032
+ # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse]
1033
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1034
+ #
1035
+ # @return [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse]
1036
+ #
1037
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1038
+ #
1039
+ # @example Basic example
1040
+ # require "google/cloud/secret_manager/v1beta2"
1041
+ #
1042
+ # # Create a client object. The client can be reused for multiple calls.
1043
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
1044
+ #
1045
+ # # Create a request. To set request fields, pass in keyword arguments.
1046
+ # request = Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new
1047
+ #
1048
+ # # Call the access_secret_version method.
1049
+ # result = client.access_secret_version request
1050
+ #
1051
+ # # The returned object is of type Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse.
1052
+ # p result
1053
+ #
1054
+ def access_secret_version request, options = nil
1055
+ raise ::ArgumentError, "request must be provided" if request.nil?
1056
+
1057
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest
1058
+
1059
+ # Converts hash and nil to an options object
1060
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1061
+
1062
+ # Customize the options with defaults
1063
+ metadata = @config.rpcs.access_secret_version.metadata.to_h
1064
+
1065
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1066
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1067
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1068
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
1069
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1070
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1071
+
1072
+ header_params = {}
1073
+ if request.name
1074
+ header_params["name"] = request.name
1075
+ end
1076
+
1077
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1078
+ metadata[:"x-goog-request-params"] ||= request_params_header
1079
+
1080
+ options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout,
1081
+ metadata: metadata,
1082
+ retry_policy: @config.rpcs.access_secret_version.retry_policy
1083
+
1084
+ options.apply_defaults timeout: @config.timeout,
1085
+ metadata: @config.metadata,
1086
+ retry_policy: @config.retry_policy
1087
+
1088
+ @secret_manager_service_stub.call_rpc :access_secret_version, request, options: options do |response, operation|
1089
+ yield response, operation if block_given?
1090
+ return response
1091
+ end
1092
+ rescue ::GRPC::BadStatus => e
1093
+ raise ::Google::Cloud::Error.from_error(e)
1094
+ end
1095
+
1096
+ ##
1097
+ # Disables a
1098
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}.
1099
+ #
1100
+ # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of
1101
+ # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to
1102
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DISABLED DISABLED}.
1103
+ #
1104
+ # @overload disable_secret_version(request, options = nil)
1105
+ # Pass arguments to `disable_secret_version` via a request object, either of type
1106
+ # {::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest} or an equivalent Hash.
1107
+ #
1108
+ # @param request [::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest, ::Hash]
1109
+ # A request object representing the call parameters. Required. To specify no
1110
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1111
+ # @param options [::Gapic::CallOptions, ::Hash]
1112
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1113
+ #
1114
+ # @overload disable_secret_version(name: nil, etag: nil)
1115
+ # Pass arguments to `disable_secret_version` via keyword arguments. Note that at
1116
+ # least one keyword argument is required. To specify no parameters, or to keep all
1117
+ # the default parameter values, pass an empty Hash as a request object (see above).
1118
+ #
1119
+ # @param name [::String]
1120
+ # Required. The resource name of the
1121
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to
1122
+ # disable in the format `projects/*/secrets/*/versions/*` or
1123
+ # `projects/*/locations/*/secrets/*/versions/*`.
1124
+ # @param etag [::String]
1125
+ # Optional. Etag of the
1126
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The
1127
+ # request succeeds if it matches the etag of the currently stored secret
1128
+ # version object. If the etag is omitted, the request succeeds.
1129
+ #
1130
+ # @yield [response, operation] Access the result along with the RPC operation
1131
+ # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
1132
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1133
+ #
1134
+ # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
1135
+ #
1136
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1137
+ #
1138
+ # @example Basic example
1139
+ # require "google/cloud/secret_manager/v1beta2"
1140
+ #
1141
+ # # Create a client object. The client can be reused for multiple calls.
1142
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
1143
+ #
1144
+ # # Create a request. To set request fields, pass in keyword arguments.
1145
+ # request = Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new
1146
+ #
1147
+ # # Call the disable_secret_version method.
1148
+ # result = client.disable_secret_version request
1149
+ #
1150
+ # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion.
1151
+ # p result
1152
+ #
1153
+ def disable_secret_version request, options = nil
1154
+ raise ::ArgumentError, "request must be provided" if request.nil?
1155
+
1156
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest
1157
+
1158
+ # Converts hash and nil to an options object
1159
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1160
+
1161
+ # Customize the options with defaults
1162
+ metadata = @config.rpcs.disable_secret_version.metadata.to_h
1163
+
1164
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1165
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1166
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1167
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
1168
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1169
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1170
+
1171
+ header_params = {}
1172
+ if request.name
1173
+ header_params["name"] = request.name
1174
+ end
1175
+
1176
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1177
+ metadata[:"x-goog-request-params"] ||= request_params_header
1178
+
1179
+ options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout,
1180
+ metadata: metadata,
1181
+ retry_policy: @config.rpcs.disable_secret_version.retry_policy
1182
+
1183
+ options.apply_defaults timeout: @config.timeout,
1184
+ metadata: @config.metadata,
1185
+ retry_policy: @config.retry_policy
1186
+
1187
+ @secret_manager_service_stub.call_rpc :disable_secret_version, request, options: options do |response, operation|
1188
+ yield response, operation if block_given?
1189
+ return response
1190
+ end
1191
+ rescue ::GRPC::BadStatus => e
1192
+ raise ::Google::Cloud::Error.from_error(e)
1193
+ end
1194
+
1195
+ ##
1196
+ # Enables a
1197
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}.
1198
+ #
1199
+ # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of
1200
+ # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to
1201
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::ENABLED ENABLED}.
1202
+ #
1203
+ # @overload enable_secret_version(request, options = nil)
1204
+ # Pass arguments to `enable_secret_version` via a request object, either of type
1205
+ # {::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest} or an equivalent Hash.
1206
+ #
1207
+ # @param request [::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest, ::Hash]
1208
+ # A request object representing the call parameters. Required. To specify no
1209
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1210
+ # @param options [::Gapic::CallOptions, ::Hash]
1211
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1212
+ #
1213
+ # @overload enable_secret_version(name: nil, etag: nil)
1214
+ # Pass arguments to `enable_secret_version` via keyword arguments. Note that at
1215
+ # least one keyword argument is required. To specify no parameters, or to keep all
1216
+ # the default parameter values, pass an empty Hash as a request object (see above).
1217
+ #
1218
+ # @param name [::String]
1219
+ # Required. The resource name of the
1220
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to enable
1221
+ # in the format `projects/*/secrets/*/versions/*` or
1222
+ # `projects/*/locations/*/secrets/*/versions/*`.
1223
+ # @param etag [::String]
1224
+ # Optional. Etag of the
1225
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The
1226
+ # request succeeds if it matches the etag of the currently stored secret
1227
+ # version object. If the etag is omitted, the request succeeds.
1228
+ #
1229
+ # @yield [response, operation] Access the result along with the RPC operation
1230
+ # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
1231
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1232
+ #
1233
+ # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
1234
+ #
1235
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1236
+ #
1237
+ # @example Basic example
1238
+ # require "google/cloud/secret_manager/v1beta2"
1239
+ #
1240
+ # # Create a client object. The client can be reused for multiple calls.
1241
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
1242
+ #
1243
+ # # Create a request. To set request fields, pass in keyword arguments.
1244
+ # request = Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new
1245
+ #
1246
+ # # Call the enable_secret_version method.
1247
+ # result = client.enable_secret_version request
1248
+ #
1249
+ # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion.
1250
+ # p result
1251
+ #
1252
+ def enable_secret_version request, options = nil
1253
+ raise ::ArgumentError, "request must be provided" if request.nil?
1254
+
1255
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest
1256
+
1257
+ # Converts hash and nil to an options object
1258
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1259
+
1260
+ # Customize the options with defaults
1261
+ metadata = @config.rpcs.enable_secret_version.metadata.to_h
1262
+
1263
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1264
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1265
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1266
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
1267
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1268
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1269
+
1270
+ header_params = {}
1271
+ if request.name
1272
+ header_params["name"] = request.name
1273
+ end
1274
+
1275
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1276
+ metadata[:"x-goog-request-params"] ||= request_params_header
1277
+
1278
+ options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout,
1279
+ metadata: metadata,
1280
+ retry_policy: @config.rpcs.enable_secret_version.retry_policy
1281
+
1282
+ options.apply_defaults timeout: @config.timeout,
1283
+ metadata: @config.metadata,
1284
+ retry_policy: @config.retry_policy
1285
+
1286
+ @secret_manager_service_stub.call_rpc :enable_secret_version, request, options: options do |response, operation|
1287
+ yield response, operation if block_given?
1288
+ return response
1289
+ end
1290
+ rescue ::GRPC::BadStatus => e
1291
+ raise ::Google::Cloud::Error.from_error(e)
1292
+ end
1293
+
1294
+ ##
1295
+ # Destroys a
1296
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}.
1297
+ #
1298
+ # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of
1299
+ # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to
1300
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DESTROYED DESTROYED}
1301
+ # and irrevocably destroys the secret data.
1302
+ #
1303
+ # @overload destroy_secret_version(request, options = nil)
1304
+ # Pass arguments to `destroy_secret_version` via a request object, either of type
1305
+ # {::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest} or an equivalent Hash.
1306
+ #
1307
+ # @param request [::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest, ::Hash]
1308
+ # A request object representing the call parameters. Required. To specify no
1309
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1310
+ # @param options [::Gapic::CallOptions, ::Hash]
1311
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1312
+ #
1313
+ # @overload destroy_secret_version(name: nil, etag: nil)
1314
+ # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at
1315
+ # least one keyword argument is required. To specify no parameters, or to keep all
1316
+ # the default parameter values, pass an empty Hash as a request object (see above).
1317
+ #
1318
+ # @param name [::String]
1319
+ # Required. The resource name of the
1320
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to
1321
+ # destroy in the format `projects/*/secrets/*/versions/*` or
1322
+ # `projects/*/locations/*/secrets/*/versions/*`.
1323
+ # @param etag [::String]
1324
+ # Optional. Etag of the
1325
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The
1326
+ # request succeeds if it matches the etag of the currently stored secret
1327
+ # version object. If the etag is omitted, the request succeeds.
1328
+ #
1329
+ # @yield [response, operation] Access the result along with the RPC operation
1330
+ # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
1331
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1332
+ #
1333
+ # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
1334
+ #
1335
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1336
+ #
1337
+ # @example Basic example
1338
+ # require "google/cloud/secret_manager/v1beta2"
1339
+ #
1340
+ # # Create a client object. The client can be reused for multiple calls.
1341
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
1342
+ #
1343
+ # # Create a request. To set request fields, pass in keyword arguments.
1344
+ # request = Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new
1345
+ #
1346
+ # # Call the destroy_secret_version method.
1347
+ # result = client.destroy_secret_version request
1348
+ #
1349
+ # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion.
1350
+ # p result
1351
+ #
1352
+ def destroy_secret_version request, options = nil
1353
+ raise ::ArgumentError, "request must be provided" if request.nil?
1354
+
1355
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest
1356
+
1357
+ # Converts hash and nil to an options object
1358
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1359
+
1360
+ # Customize the options with defaults
1361
+ metadata = @config.rpcs.destroy_secret_version.metadata.to_h
1362
+
1363
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1364
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1365
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1366
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
1367
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1368
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1369
+
1370
+ header_params = {}
1371
+ if request.name
1372
+ header_params["name"] = request.name
1373
+ end
1374
+
1375
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1376
+ metadata[:"x-goog-request-params"] ||= request_params_header
1377
+
1378
+ options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout,
1379
+ metadata: metadata,
1380
+ retry_policy: @config.rpcs.destroy_secret_version.retry_policy
1381
+
1382
+ options.apply_defaults timeout: @config.timeout,
1383
+ metadata: @config.metadata,
1384
+ retry_policy: @config.retry_policy
1385
+
1386
+ @secret_manager_service_stub.call_rpc :destroy_secret_version, request, options: options do |response, operation|
1387
+ yield response, operation if block_given?
1388
+ return response
1389
+ end
1390
+ rescue ::GRPC::BadStatus => e
1391
+ raise ::Google::Cloud::Error.from_error(e)
1392
+ end
1393
+
1394
+ ##
1395
+ # Sets the access control policy on the specified secret. Replaces any
1396
+ # existing policy.
1397
+ #
1398
+ # Permissions on
1399
+ # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} are
1400
+ # enforced according to the policy set on the associated
1401
+ # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}.
1402
+ #
1403
+ # @overload set_iam_policy(request, options = nil)
1404
+ # Pass arguments to `set_iam_policy` via a request object, either of type
1405
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
1406
+ #
1407
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
1408
+ # A request object representing the call parameters. Required. To specify no
1409
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1410
+ # @param options [::Gapic::CallOptions, ::Hash]
1411
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1412
+ #
1413
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
1414
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
1415
+ # least one keyword argument is required. To specify no parameters, or to keep all
1416
+ # the default parameter values, pass an empty Hash as a request object (see above).
1417
+ #
1418
+ # @param resource [::String]
1419
+ # REQUIRED: The resource for which the policy is being specified.
1420
+ # See the operation documentation for the appropriate value for this field.
1421
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
1422
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
1423
+ # the policy is limited to a few 10s of KB. An empty policy is a
1424
+ # valid policy but certain Cloud Platform services (such as Projects)
1425
+ # might reject them.
1426
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1427
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
1428
+ # the fields in the mask will be modified. If no mask is provided, the
1429
+ # following default mask is used:
1430
+ #
1431
+ # `paths: "bindings, etag"`
1432
+ #
1433
+ # @yield [response, operation] Access the result along with the RPC operation
1434
+ # @yieldparam response [::Google::Iam::V1::Policy]
1435
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1436
+ #
1437
+ # @return [::Google::Iam::V1::Policy]
1438
+ #
1439
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1440
+ #
1441
+ # @example Basic example
1442
+ # require "google/cloud/secret_manager/v1beta2"
1443
+ #
1444
+ # # Create a client object. The client can be reused for multiple calls.
1445
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
1446
+ #
1447
+ # # Create a request. To set request fields, pass in keyword arguments.
1448
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1449
+ #
1450
+ # # Call the set_iam_policy method.
1451
+ # result = client.set_iam_policy request
1452
+ #
1453
+ # # The returned object is of type Google::Iam::V1::Policy.
1454
+ # p result
1455
+ #
1456
+ def set_iam_policy request, options = nil
1457
+ raise ::ArgumentError, "request must be provided" if request.nil?
1458
+
1459
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
1460
+
1461
+ # Converts hash and nil to an options object
1462
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1463
+
1464
+ # Customize the options with defaults
1465
+ metadata = @config.rpcs.set_iam_policy.metadata.to_h
1466
+
1467
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1468
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1469
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1470
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
1471
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1472
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1473
+
1474
+ header_params = {}
1475
+ if request.resource
1476
+ header_params["resource"] = request.resource
1477
+ end
1478
+
1479
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1480
+ metadata[:"x-goog-request-params"] ||= request_params_header
1481
+
1482
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1483
+ metadata: metadata,
1484
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
1485
+
1486
+ options.apply_defaults timeout: @config.timeout,
1487
+ metadata: @config.metadata,
1488
+ retry_policy: @config.retry_policy
1489
+
1490
+ @secret_manager_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1491
+ yield response, operation if block_given?
1492
+ return response
1493
+ end
1494
+ rescue ::GRPC::BadStatus => e
1495
+ raise ::Google::Cloud::Error.from_error(e)
1496
+ end
1497
+
1498
+ ##
1499
+ # Gets the access control policy for a secret.
1500
+ # Returns empty policy if the secret exists and does not have a policy set.
1501
+ #
1502
+ # @overload get_iam_policy(request, options = nil)
1503
+ # Pass arguments to `get_iam_policy` via a request object, either of type
1504
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
1505
+ #
1506
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
1507
+ # A request object representing the call parameters. Required. To specify no
1508
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1509
+ # @param options [::Gapic::CallOptions, ::Hash]
1510
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1511
+ #
1512
+ # @overload get_iam_policy(resource: nil, options: nil)
1513
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
1514
+ # least one keyword argument is required. To specify no parameters, or to keep all
1515
+ # the default parameter values, pass an empty Hash as a request object (see above).
1516
+ #
1517
+ # @param resource [::String]
1518
+ # REQUIRED: The resource for which the policy is being requested.
1519
+ # See the operation documentation for the appropriate value for this field.
1520
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
1521
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
1522
+ # `GetIamPolicy`.
1523
+ #
1524
+ # @yield [response, operation] Access the result along with the RPC operation
1525
+ # @yieldparam response [::Google::Iam::V1::Policy]
1526
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1527
+ #
1528
+ # @return [::Google::Iam::V1::Policy]
1529
+ #
1530
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1531
+ #
1532
+ # @example Basic example
1533
+ # require "google/cloud/secret_manager/v1beta2"
1534
+ #
1535
+ # # Create a client object. The client can be reused for multiple calls.
1536
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
1537
+ #
1538
+ # # Create a request. To set request fields, pass in keyword arguments.
1539
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1540
+ #
1541
+ # # Call the get_iam_policy method.
1542
+ # result = client.get_iam_policy request
1543
+ #
1544
+ # # The returned object is of type Google::Iam::V1::Policy.
1545
+ # p result
1546
+ #
1547
+ def get_iam_policy request, options = nil
1548
+ raise ::ArgumentError, "request must be provided" if request.nil?
1549
+
1550
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
1551
+
1552
+ # Converts hash and nil to an options object
1553
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1554
+
1555
+ # Customize the options with defaults
1556
+ metadata = @config.rpcs.get_iam_policy.metadata.to_h
1557
+
1558
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1559
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1560
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1561
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
1562
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1563
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1564
+
1565
+ header_params = {}
1566
+ if request.resource
1567
+ header_params["resource"] = request.resource
1568
+ end
1569
+
1570
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1571
+ metadata[:"x-goog-request-params"] ||= request_params_header
1572
+
1573
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1574
+ metadata: metadata,
1575
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
1576
+
1577
+ options.apply_defaults timeout: @config.timeout,
1578
+ metadata: @config.metadata,
1579
+ retry_policy: @config.retry_policy
1580
+
1581
+ @secret_manager_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1582
+ yield response, operation if block_given?
1583
+ return response
1584
+ end
1585
+ rescue ::GRPC::BadStatus => e
1586
+ raise ::Google::Cloud::Error.from_error(e)
1587
+ end
1588
+
1589
+ ##
1590
+ # Returns permissions that a caller has for the specified secret.
1591
+ # If the secret does not exist, this call returns an empty set of
1592
+ # permissions, not a NOT_FOUND error.
1593
+ #
1594
+ # Note: This operation is designed to be used for building permission-aware
1595
+ # UIs and command-line tools, not for authorization checking. This operation
1596
+ # may "fail open" without warning.
1597
+ #
1598
+ # @overload test_iam_permissions(request, options = nil)
1599
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
1600
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
1601
+ #
1602
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
1603
+ # A request object representing the call parameters. Required. To specify no
1604
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1605
+ # @param options [::Gapic::CallOptions, ::Hash]
1606
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1607
+ #
1608
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
1609
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
1610
+ # least one keyword argument is required. To specify no parameters, or to keep all
1611
+ # the default parameter values, pass an empty Hash as a request object (see above).
1612
+ #
1613
+ # @param resource [::String]
1614
+ # REQUIRED: The resource for which the policy detail is being requested.
1615
+ # See the operation documentation for the appropriate value for this field.
1616
+ # @param permissions [::Array<::String>]
1617
+ # The set of permissions to check for the `resource`. Permissions with
1618
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
1619
+ # information see
1620
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1621
+ #
1622
+ # @yield [response, operation] Access the result along with the RPC operation
1623
+ # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
1624
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1625
+ #
1626
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
1627
+ #
1628
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1629
+ #
1630
+ # @example Basic example
1631
+ # require "google/cloud/secret_manager/v1beta2"
1632
+ #
1633
+ # # Create a client object. The client can be reused for multiple calls.
1634
+ # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new
1635
+ #
1636
+ # # Create a request. To set request fields, pass in keyword arguments.
1637
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
1638
+ #
1639
+ # # Call the test_iam_permissions method.
1640
+ # result = client.test_iam_permissions request
1641
+ #
1642
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
1643
+ # p result
1644
+ #
1645
+ def test_iam_permissions request, options = nil
1646
+ raise ::ArgumentError, "request must be provided" if request.nil?
1647
+
1648
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
1649
+
1650
+ # Converts hash and nil to an options object
1651
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1652
+
1653
+ # Customize the options with defaults
1654
+ metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1655
+
1656
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1657
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1658
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1659
+ gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION
1660
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1661
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1662
+
1663
+ header_params = {}
1664
+ if request.resource
1665
+ header_params["resource"] = request.resource
1666
+ end
1667
+
1668
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1669
+ metadata[:"x-goog-request-params"] ||= request_params_header
1670
+
1671
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1672
+ metadata: metadata,
1673
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1674
+
1675
+ options.apply_defaults timeout: @config.timeout,
1676
+ metadata: @config.metadata,
1677
+ retry_policy: @config.retry_policy
1678
+
1679
+ @secret_manager_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
1680
+ yield response, operation if block_given?
1681
+ return response
1682
+ end
1683
+ rescue ::GRPC::BadStatus => e
1684
+ raise ::Google::Cloud::Error.from_error(e)
1685
+ end
1686
+
1687
+ ##
1688
+ # Configuration class for the SecretManagerService API.
1689
+ #
1690
+ # This class represents the configuration for SecretManagerService,
1691
+ # providing control over timeouts, retry behavior, logging, transport
1692
+ # parameters, and other low-level controls. Certain parameters can also be
1693
+ # applied individually to specific RPCs. See
1694
+ # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client::Configuration::Rpcs}
1695
+ # for a list of RPCs that can be configured independently.
1696
+ #
1697
+ # Configuration can be applied globally to all clients, or to a single client
1698
+ # on construction.
1699
+ #
1700
+ # @example
1701
+ #
1702
+ # # Modify the global config, setting the timeout for
1703
+ # # list_secrets to 20 seconds,
1704
+ # # and all remaining timeouts to 10 seconds.
1705
+ # ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.configure do |config|
1706
+ # config.timeout = 10.0
1707
+ # config.rpcs.list_secrets.timeout = 20.0
1708
+ # end
1709
+ #
1710
+ # # Apply the above configuration only to a new client.
1711
+ # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config|
1712
+ # config.timeout = 10.0
1713
+ # config.rpcs.list_secrets.timeout = 20.0
1714
+ # end
1715
+ #
1716
+ # @!attribute [rw] endpoint
1717
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1718
+ # nil, indicating to use the default endpoint in the current universe domain.
1719
+ # @return [::String,nil]
1720
+ # @!attribute [rw] credentials
1721
+ # Credentials to send with calls. You may provide any of the following types:
1722
+ # * (`String`) The path to a service account key file in JSON format
1723
+ # * (`Hash`) A service account key as a Hash
1724
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1725
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1726
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1727
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1728
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1729
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1730
+ # * (`nil`) indicating no credentials
1731
+ # @return [::Object]
1732
+ # @!attribute [rw] scope
1733
+ # The OAuth scopes
1734
+ # @return [::Array<::String>]
1735
+ # @!attribute [rw] lib_name
1736
+ # The library name as recorded in instrumentation and logging
1737
+ # @return [::String]
1738
+ # @!attribute [rw] lib_version
1739
+ # The library version as recorded in instrumentation and logging
1740
+ # @return [::String]
1741
+ # @!attribute [rw] channel_args
1742
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1743
+ # `GRPC::Core::Channel` object is provided as the credential.
1744
+ # @return [::Hash]
1745
+ # @!attribute [rw] interceptors
1746
+ # An array of interceptors that are run before calls are executed.
1747
+ # @return [::Array<::GRPC::ClientInterceptor>]
1748
+ # @!attribute [rw] timeout
1749
+ # The call timeout in seconds.
1750
+ # @return [::Numeric]
1751
+ # @!attribute [rw] metadata
1752
+ # Additional gRPC headers to be sent with the call.
1753
+ # @return [::Hash{::Symbol=>::String}]
1754
+ # @!attribute [rw] retry_policy
1755
+ # The retry policy. The value is a hash with the following keys:
1756
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1757
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1758
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1759
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1760
+ # trigger a retry.
1761
+ # @return [::Hash]
1762
+ # @!attribute [rw] quota_project
1763
+ # A separate project against which to charge quota.
1764
+ # @return [::String]
1765
+ # @!attribute [rw] universe_domain
1766
+ # The universe domain within which to make requests. This determines the
1767
+ # default endpoint URL. The default value of nil uses the environment
1768
+ # universe (usually the default "googleapis.com" universe).
1769
+ # @return [::String,nil]
1770
+ #
1771
+ class Configuration
1772
+ extend ::Gapic::Config
1773
+
1774
+ # @private
1775
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1776
+ DEFAULT_ENDPOINT = "secretmanager.googleapis.com"
1777
+
1778
+ config_attr :endpoint, nil, ::String, nil
1779
+ config_attr :credentials, nil do |value|
1780
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1781
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1782
+ allowed.any? { |klass| klass === value }
1783
+ end
1784
+ config_attr :scope, nil, ::String, ::Array, nil
1785
+ config_attr :lib_name, nil, ::String, nil
1786
+ config_attr :lib_version, nil, ::String, nil
1787
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1788
+ config_attr :interceptors, nil, ::Array, nil
1789
+ config_attr :timeout, nil, ::Numeric, nil
1790
+ config_attr :metadata, nil, ::Hash, nil
1791
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1792
+ config_attr :quota_project, nil, ::String, nil
1793
+ config_attr :universe_domain, nil, ::String, nil
1794
+
1795
+ # @private
1796
+ def initialize parent_config = nil
1797
+ @parent_config = parent_config unless parent_config.nil?
1798
+
1799
+ yield self if block_given?
1800
+ end
1801
+
1802
+ ##
1803
+ # Configurations for individual RPCs
1804
+ # @return [Rpcs]
1805
+ #
1806
+ def rpcs
1807
+ @rpcs ||= begin
1808
+ parent_rpcs = nil
1809
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1810
+ Rpcs.new parent_rpcs
1811
+ end
1812
+ end
1813
+
1814
+ ##
1815
+ # Configuration for the channel pool
1816
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1817
+ #
1818
+ def channel_pool
1819
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1820
+ end
1821
+
1822
+ ##
1823
+ # Configuration RPC class for the SecretManagerService API.
1824
+ #
1825
+ # Includes fields providing the configuration for each RPC in this service.
1826
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1827
+ # the following configuration fields:
1828
+ #
1829
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1830
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1831
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1832
+ # include the following keys:
1833
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1834
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1835
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1836
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1837
+ # trigger a retry.
1838
+ #
1839
+ class Rpcs
1840
+ ##
1841
+ # RPC-specific configuration for `list_secrets`
1842
+ # @return [::Gapic::Config::Method]
1843
+ #
1844
+ attr_reader :list_secrets
1845
+ ##
1846
+ # RPC-specific configuration for `create_secret`
1847
+ # @return [::Gapic::Config::Method]
1848
+ #
1849
+ attr_reader :create_secret
1850
+ ##
1851
+ # RPC-specific configuration for `add_secret_version`
1852
+ # @return [::Gapic::Config::Method]
1853
+ #
1854
+ attr_reader :add_secret_version
1855
+ ##
1856
+ # RPC-specific configuration for `get_secret`
1857
+ # @return [::Gapic::Config::Method]
1858
+ #
1859
+ attr_reader :get_secret
1860
+ ##
1861
+ # RPC-specific configuration for `update_secret`
1862
+ # @return [::Gapic::Config::Method]
1863
+ #
1864
+ attr_reader :update_secret
1865
+ ##
1866
+ # RPC-specific configuration for `delete_secret`
1867
+ # @return [::Gapic::Config::Method]
1868
+ #
1869
+ attr_reader :delete_secret
1870
+ ##
1871
+ # RPC-specific configuration for `list_secret_versions`
1872
+ # @return [::Gapic::Config::Method]
1873
+ #
1874
+ attr_reader :list_secret_versions
1875
+ ##
1876
+ # RPC-specific configuration for `get_secret_version`
1877
+ # @return [::Gapic::Config::Method]
1878
+ #
1879
+ attr_reader :get_secret_version
1880
+ ##
1881
+ # RPC-specific configuration for `access_secret_version`
1882
+ # @return [::Gapic::Config::Method]
1883
+ #
1884
+ attr_reader :access_secret_version
1885
+ ##
1886
+ # RPC-specific configuration for `disable_secret_version`
1887
+ # @return [::Gapic::Config::Method]
1888
+ #
1889
+ attr_reader :disable_secret_version
1890
+ ##
1891
+ # RPC-specific configuration for `enable_secret_version`
1892
+ # @return [::Gapic::Config::Method]
1893
+ #
1894
+ attr_reader :enable_secret_version
1895
+ ##
1896
+ # RPC-specific configuration for `destroy_secret_version`
1897
+ # @return [::Gapic::Config::Method]
1898
+ #
1899
+ attr_reader :destroy_secret_version
1900
+ ##
1901
+ # RPC-specific configuration for `set_iam_policy`
1902
+ # @return [::Gapic::Config::Method]
1903
+ #
1904
+ attr_reader :set_iam_policy
1905
+ ##
1906
+ # RPC-specific configuration for `get_iam_policy`
1907
+ # @return [::Gapic::Config::Method]
1908
+ #
1909
+ attr_reader :get_iam_policy
1910
+ ##
1911
+ # RPC-specific configuration for `test_iam_permissions`
1912
+ # @return [::Gapic::Config::Method]
1913
+ #
1914
+ attr_reader :test_iam_permissions
1915
+
1916
+ # @private
1917
+ def initialize parent_rpcs = nil
1918
+ list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets
1919
+ @list_secrets = ::Gapic::Config::Method.new list_secrets_config
1920
+ create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret
1921
+ @create_secret = ::Gapic::Config::Method.new create_secret_config
1922
+ add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version
1923
+ @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config
1924
+ get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret
1925
+ @get_secret = ::Gapic::Config::Method.new get_secret_config
1926
+ update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret
1927
+ @update_secret = ::Gapic::Config::Method.new update_secret_config
1928
+ delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret
1929
+ @delete_secret = ::Gapic::Config::Method.new delete_secret_config
1930
+ list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions
1931
+ @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config
1932
+ get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version
1933
+ @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config
1934
+ access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version
1935
+ @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config
1936
+ disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version
1937
+ @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config
1938
+ enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version
1939
+ @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config
1940
+ destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version
1941
+ @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config
1942
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1943
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1944
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1945
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1946
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1947
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1948
+
1949
+ yield self if block_given?
1950
+ end
1951
+ end
1952
+ end
1953
+ end
1954
+ end
1955
+ end
1956
+ end
1957
+ end
1958
+ end