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

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