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

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