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,1075 @@
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/secretmanager/v1beta2/service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module SecretManager
24
+ module V1beta2
25
+ module SecretManagerService
26
+ module Rest
27
+ ##
28
+ # REST service stub for the SecretManagerService service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
42
+ numeric_enums: true,
43
+ raise_faraday_errors: false
44
+ end
45
+
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
64
+ ##
65
+ # Baseline implementation for the list_secrets REST call
66
+ #
67
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest]
68
+ # A request object representing the call parameters. Required.
69
+ # @param options [::Gapic::CallOptions]
70
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
71
+ #
72
+ # @yield [result, operation] Access the result along with the TransportOperation object
73
+ # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse]
74
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
75
+ #
76
+ # @return [::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse]
77
+ # A result object deserialized from the server's reply
78
+ def list_secrets request_pb, options = nil
79
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
80
+
81
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_secrets_request request_pb
82
+ query_string_params = if query_string_params.any?
83
+ query_string_params.to_h { |p| p.split "=", 2 }
84
+ else
85
+ {}
86
+ end
87
+
88
+ response = @client_stub.make_http_request(
89
+ verb,
90
+ uri: uri,
91
+ body: body || "",
92
+ params: query_string_params,
93
+ options: options
94
+ )
95
+ operation = ::Gapic::Rest::TransportOperation.new response
96
+ result = ::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse.decode_json response.body, ignore_unknown_fields: true
97
+
98
+ yield result, operation if block_given?
99
+ result
100
+ end
101
+
102
+ ##
103
+ # Baseline implementation for the create_secret REST call
104
+ #
105
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest]
106
+ # A request object representing the call parameters. Required.
107
+ # @param options [::Gapic::CallOptions]
108
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
109
+ #
110
+ # @yield [result, operation] Access the result along with the TransportOperation object
111
+ # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret]
112
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
113
+ #
114
+ # @return [::Google::Cloud::SecretManager::V1beta2::Secret]
115
+ # A result object deserialized from the server's reply
116
+ def create_secret request_pb, options = nil
117
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
118
+
119
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_secret_request request_pb
120
+ query_string_params = if query_string_params.any?
121
+ query_string_params.to_h { |p| p.split "=", 2 }
122
+ else
123
+ {}
124
+ end
125
+
126
+ response = @client_stub.make_http_request(
127
+ verb,
128
+ uri: uri,
129
+ body: body || "",
130
+ params: query_string_params,
131
+ options: options
132
+ )
133
+ operation = ::Gapic::Rest::TransportOperation.new response
134
+ result = ::Google::Cloud::SecretManager::V1beta2::Secret.decode_json response.body, ignore_unknown_fields: true
135
+
136
+ yield result, operation if block_given?
137
+ result
138
+ end
139
+
140
+ ##
141
+ # Baseline implementation for the add_secret_version REST call
142
+ #
143
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest]
144
+ # A request object representing the call parameters. Required.
145
+ # @param options [::Gapic::CallOptions]
146
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
147
+ #
148
+ # @yield [result, operation] Access the result along with the TransportOperation object
149
+ # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
150
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
151
+ #
152
+ # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
153
+ # A result object deserialized from the server's reply
154
+ def add_secret_version request_pb, options = nil
155
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
156
+
157
+ verb, uri, query_string_params, body = ServiceStub.transcode_add_secret_version_request request_pb
158
+ query_string_params = if query_string_params.any?
159
+ query_string_params.to_h { |p| p.split "=", 2 }
160
+ else
161
+ {}
162
+ end
163
+
164
+ response = @client_stub.make_http_request(
165
+ verb,
166
+ uri: uri,
167
+ body: body || "",
168
+ params: query_string_params,
169
+ options: options
170
+ )
171
+ operation = ::Gapic::Rest::TransportOperation.new response
172
+ result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true
173
+
174
+ yield result, operation if block_given?
175
+ result
176
+ end
177
+
178
+ ##
179
+ # Baseline implementation for the get_secret REST call
180
+ #
181
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::GetSecretRequest]
182
+ # A request object representing the call parameters. Required.
183
+ # @param options [::Gapic::CallOptions]
184
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
185
+ #
186
+ # @yield [result, operation] Access the result along with the TransportOperation object
187
+ # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret]
188
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
189
+ #
190
+ # @return [::Google::Cloud::SecretManager::V1beta2::Secret]
191
+ # A result object deserialized from the server's reply
192
+ def get_secret request_pb, options = nil
193
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
194
+
195
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_request request_pb
196
+ query_string_params = if query_string_params.any?
197
+ query_string_params.to_h { |p| p.split "=", 2 }
198
+ else
199
+ {}
200
+ end
201
+
202
+ response = @client_stub.make_http_request(
203
+ verb,
204
+ uri: uri,
205
+ body: body || "",
206
+ params: query_string_params,
207
+ options: options
208
+ )
209
+ operation = ::Gapic::Rest::TransportOperation.new response
210
+ result = ::Google::Cloud::SecretManager::V1beta2::Secret.decode_json response.body, ignore_unknown_fields: true
211
+
212
+ yield result, operation if block_given?
213
+ result
214
+ end
215
+
216
+ ##
217
+ # Baseline implementation for the update_secret REST call
218
+ #
219
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest]
220
+ # A request object representing the call parameters. Required.
221
+ # @param options [::Gapic::CallOptions]
222
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
223
+ #
224
+ # @yield [result, operation] Access the result along with the TransportOperation object
225
+ # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret]
226
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
227
+ #
228
+ # @return [::Google::Cloud::SecretManager::V1beta2::Secret]
229
+ # A result object deserialized from the server's reply
230
+ def update_secret request_pb, options = nil
231
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
232
+
233
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_secret_request request_pb
234
+ query_string_params = if query_string_params.any?
235
+ query_string_params.to_h { |p| p.split "=", 2 }
236
+ else
237
+ {}
238
+ end
239
+
240
+ response = @client_stub.make_http_request(
241
+ verb,
242
+ uri: uri,
243
+ body: body || "",
244
+ params: query_string_params,
245
+ options: options
246
+ )
247
+ operation = ::Gapic::Rest::TransportOperation.new response
248
+ result = ::Google::Cloud::SecretManager::V1beta2::Secret.decode_json response.body, ignore_unknown_fields: true
249
+
250
+ yield result, operation if block_given?
251
+ result
252
+ end
253
+
254
+ ##
255
+ # Baseline implementation for the delete_secret REST call
256
+ #
257
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest]
258
+ # A request object representing the call parameters. Required.
259
+ # @param options [::Gapic::CallOptions]
260
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
261
+ #
262
+ # @yield [result, operation] Access the result along with the TransportOperation object
263
+ # @yieldparam result [::Google::Protobuf::Empty]
264
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
265
+ #
266
+ # @return [::Google::Protobuf::Empty]
267
+ # A result object deserialized from the server's reply
268
+ def delete_secret request_pb, options = nil
269
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
270
+
271
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_secret_request request_pb
272
+ query_string_params = if query_string_params.any?
273
+ query_string_params.to_h { |p| p.split "=", 2 }
274
+ else
275
+ {}
276
+ end
277
+
278
+ response = @client_stub.make_http_request(
279
+ verb,
280
+ uri: uri,
281
+ body: body || "",
282
+ params: query_string_params,
283
+ options: options
284
+ )
285
+ operation = ::Gapic::Rest::TransportOperation.new response
286
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
287
+
288
+ yield result, operation if block_given?
289
+ result
290
+ end
291
+
292
+ ##
293
+ # Baseline implementation for the list_secret_versions REST call
294
+ #
295
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest]
296
+ # A request object representing the call parameters. Required.
297
+ # @param options [::Gapic::CallOptions]
298
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
299
+ #
300
+ # @yield [result, operation] Access the result along with the TransportOperation object
301
+ # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse]
302
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
303
+ #
304
+ # @return [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse]
305
+ # A result object deserialized from the server's reply
306
+ def list_secret_versions request_pb, options = nil
307
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
308
+
309
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_secret_versions_request request_pb
310
+ query_string_params = if query_string_params.any?
311
+ query_string_params.to_h { |p| p.split "=", 2 }
312
+ else
313
+ {}
314
+ end
315
+
316
+ response = @client_stub.make_http_request(
317
+ verb,
318
+ uri: uri,
319
+ body: body || "",
320
+ params: query_string_params,
321
+ options: options
322
+ )
323
+ operation = ::Gapic::Rest::TransportOperation.new response
324
+ result = ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse.decode_json response.body, ignore_unknown_fields: true
325
+
326
+ yield result, operation if block_given?
327
+ result
328
+ end
329
+
330
+ ##
331
+ # Baseline implementation for the get_secret_version REST call
332
+ #
333
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest]
334
+ # A request object representing the call parameters. Required.
335
+ # @param options [::Gapic::CallOptions]
336
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
337
+ #
338
+ # @yield [result, operation] Access the result along with the TransportOperation object
339
+ # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
340
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
341
+ #
342
+ # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
343
+ # A result object deserialized from the server's reply
344
+ def get_secret_version request_pb, options = nil
345
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
346
+
347
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_version_request request_pb
348
+ query_string_params = if query_string_params.any?
349
+ query_string_params.to_h { |p| p.split "=", 2 }
350
+ else
351
+ {}
352
+ end
353
+
354
+ response = @client_stub.make_http_request(
355
+ verb,
356
+ uri: uri,
357
+ body: body || "",
358
+ params: query_string_params,
359
+ options: options
360
+ )
361
+ operation = ::Gapic::Rest::TransportOperation.new response
362
+ result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true
363
+
364
+ yield result, operation if block_given?
365
+ result
366
+ end
367
+
368
+ ##
369
+ # Baseline implementation for the access_secret_version REST call
370
+ #
371
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest]
372
+ # A request object representing the call parameters. Required.
373
+ # @param options [::Gapic::CallOptions]
374
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
375
+ #
376
+ # @yield [result, operation] Access the result along with the TransportOperation object
377
+ # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse]
378
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
379
+ #
380
+ # @return [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse]
381
+ # A result object deserialized from the server's reply
382
+ def access_secret_version request_pb, options = nil
383
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
384
+
385
+ verb, uri, query_string_params, body = ServiceStub.transcode_access_secret_version_request request_pb
386
+ query_string_params = if query_string_params.any?
387
+ query_string_params.to_h { |p| p.split "=", 2 }
388
+ else
389
+ {}
390
+ end
391
+
392
+ response = @client_stub.make_http_request(
393
+ verb,
394
+ uri: uri,
395
+ body: body || "",
396
+ params: query_string_params,
397
+ options: options
398
+ )
399
+ operation = ::Gapic::Rest::TransportOperation.new response
400
+ result = ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse.decode_json response.body, ignore_unknown_fields: true
401
+
402
+ yield result, operation if block_given?
403
+ result
404
+ end
405
+
406
+ ##
407
+ # Baseline implementation for the disable_secret_version REST call
408
+ #
409
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest]
410
+ # A request object representing the call parameters. Required.
411
+ # @param options [::Gapic::CallOptions]
412
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
413
+ #
414
+ # @yield [result, operation] Access the result along with the TransportOperation object
415
+ # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
416
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
417
+ #
418
+ # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
419
+ # A result object deserialized from the server's reply
420
+ def disable_secret_version request_pb, options = nil
421
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
422
+
423
+ verb, uri, query_string_params, body = ServiceStub.transcode_disable_secret_version_request request_pb
424
+ query_string_params = if query_string_params.any?
425
+ query_string_params.to_h { |p| p.split "=", 2 }
426
+ else
427
+ {}
428
+ end
429
+
430
+ response = @client_stub.make_http_request(
431
+ verb,
432
+ uri: uri,
433
+ body: body || "",
434
+ params: query_string_params,
435
+ options: options
436
+ )
437
+ operation = ::Gapic::Rest::TransportOperation.new response
438
+ result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true
439
+
440
+ yield result, operation if block_given?
441
+ result
442
+ end
443
+
444
+ ##
445
+ # Baseline implementation for the enable_secret_version REST call
446
+ #
447
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest]
448
+ # A request object representing the call parameters. Required.
449
+ # @param options [::Gapic::CallOptions]
450
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
451
+ #
452
+ # @yield [result, operation] Access the result along with the TransportOperation object
453
+ # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
454
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
455
+ #
456
+ # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
457
+ # A result object deserialized from the server's reply
458
+ def enable_secret_version request_pb, options = nil
459
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
460
+
461
+ verb, uri, query_string_params, body = ServiceStub.transcode_enable_secret_version_request request_pb
462
+ query_string_params = if query_string_params.any?
463
+ query_string_params.to_h { |p| p.split "=", 2 }
464
+ else
465
+ {}
466
+ end
467
+
468
+ response = @client_stub.make_http_request(
469
+ verb,
470
+ uri: uri,
471
+ body: body || "",
472
+ params: query_string_params,
473
+ options: options
474
+ )
475
+ operation = ::Gapic::Rest::TransportOperation.new response
476
+ result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true
477
+
478
+ yield result, operation if block_given?
479
+ result
480
+ end
481
+
482
+ ##
483
+ # Baseline implementation for the destroy_secret_version REST call
484
+ #
485
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest]
486
+ # A request object representing the call parameters. Required.
487
+ # @param options [::Gapic::CallOptions]
488
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
489
+ #
490
+ # @yield [result, operation] Access the result along with the TransportOperation object
491
+ # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
492
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
493
+ #
494
+ # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion]
495
+ # A result object deserialized from the server's reply
496
+ def destroy_secret_version request_pb, options = nil
497
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
498
+
499
+ verb, uri, query_string_params, body = ServiceStub.transcode_destroy_secret_version_request request_pb
500
+ query_string_params = if query_string_params.any?
501
+ query_string_params.to_h { |p| p.split "=", 2 }
502
+ else
503
+ {}
504
+ end
505
+
506
+ response = @client_stub.make_http_request(
507
+ verb,
508
+ uri: uri,
509
+ body: body || "",
510
+ params: query_string_params,
511
+ options: options
512
+ )
513
+ operation = ::Gapic::Rest::TransportOperation.new response
514
+ result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true
515
+
516
+ yield result, operation if block_given?
517
+ result
518
+ end
519
+
520
+ ##
521
+ # Baseline implementation for the set_iam_policy REST call
522
+ #
523
+ # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
524
+ # A request object representing the call parameters. Required.
525
+ # @param options [::Gapic::CallOptions]
526
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
527
+ #
528
+ # @yield [result, operation] Access the result along with the TransportOperation object
529
+ # @yieldparam result [::Google::Iam::V1::Policy]
530
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
531
+ #
532
+ # @return [::Google::Iam::V1::Policy]
533
+ # A result object deserialized from the server's reply
534
+ def set_iam_policy request_pb, options = nil
535
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
536
+
537
+ verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb
538
+ query_string_params = if query_string_params.any?
539
+ query_string_params.to_h { |p| p.split "=", 2 }
540
+ else
541
+ {}
542
+ end
543
+
544
+ response = @client_stub.make_http_request(
545
+ verb,
546
+ uri: uri,
547
+ body: body || "",
548
+ params: query_string_params,
549
+ options: options
550
+ )
551
+ operation = ::Gapic::Rest::TransportOperation.new response
552
+ result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
553
+
554
+ yield result, operation if block_given?
555
+ result
556
+ end
557
+
558
+ ##
559
+ # Baseline implementation for the get_iam_policy REST call
560
+ #
561
+ # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
562
+ # A request object representing the call parameters. Required.
563
+ # @param options [::Gapic::CallOptions]
564
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
565
+ #
566
+ # @yield [result, operation] Access the result along with the TransportOperation object
567
+ # @yieldparam result [::Google::Iam::V1::Policy]
568
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
569
+ #
570
+ # @return [::Google::Iam::V1::Policy]
571
+ # A result object deserialized from the server's reply
572
+ def get_iam_policy request_pb, options = nil
573
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
574
+
575
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb
576
+ query_string_params = if query_string_params.any?
577
+ query_string_params.to_h { |p| p.split "=", 2 }
578
+ else
579
+ {}
580
+ end
581
+
582
+ response = @client_stub.make_http_request(
583
+ verb,
584
+ uri: uri,
585
+ body: body || "",
586
+ params: query_string_params,
587
+ options: options
588
+ )
589
+ operation = ::Gapic::Rest::TransportOperation.new response
590
+ result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
591
+
592
+ yield result, operation if block_given?
593
+ result
594
+ end
595
+
596
+ ##
597
+ # Baseline implementation for the test_iam_permissions REST call
598
+ #
599
+ # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
600
+ # A request object representing the call parameters. Required.
601
+ # @param options [::Gapic::CallOptions]
602
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
603
+ #
604
+ # @yield [result, operation] Access the result along with the TransportOperation object
605
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
606
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
607
+ #
608
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
609
+ # A result object deserialized from the server's reply
610
+ def test_iam_permissions request_pb, options = nil
611
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
612
+
613
+ verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb
614
+ query_string_params = if query_string_params.any?
615
+ query_string_params.to_h { |p| p.split "=", 2 }
616
+ else
617
+ {}
618
+ end
619
+
620
+ response = @client_stub.make_http_request(
621
+ verb,
622
+ uri: uri,
623
+ body: body || "",
624
+ params: query_string_params,
625
+ options: options
626
+ )
627
+ operation = ::Gapic::Rest::TransportOperation.new response
628
+ result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
629
+
630
+ yield result, operation if block_given?
631
+ result
632
+ end
633
+
634
+ ##
635
+ # @private
636
+ #
637
+ # GRPC transcoding helper method for the list_secrets REST call
638
+ #
639
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest]
640
+ # A request object representing the call parameters. Required.
641
+ # @return [Array(String, [String, nil], Hash{String => String})]
642
+ # Uri, Body, Query string parameters
643
+ def self.transcode_list_secrets_request request_pb
644
+ transcoder = Gapic::Rest::GrpcTranscoder.new
645
+ .with_bindings(
646
+ uri_method: :get,
647
+ uri_template: "/v1beta2/{parent}/secrets",
648
+ matches: [
649
+ ["parent", %r{^projects/[^/]+/?$}, false]
650
+ ]
651
+ )
652
+ .with_bindings(
653
+ uri_method: :get,
654
+ uri_template: "/v1beta2/{parent}/secrets",
655
+ matches: [
656
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
657
+ ]
658
+ )
659
+ transcoder.transcode request_pb
660
+ end
661
+
662
+ ##
663
+ # @private
664
+ #
665
+ # GRPC transcoding helper method for the create_secret REST call
666
+ #
667
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest]
668
+ # A request object representing the call parameters. Required.
669
+ # @return [Array(String, [String, nil], Hash{String => String})]
670
+ # Uri, Body, Query string parameters
671
+ def self.transcode_create_secret_request request_pb
672
+ transcoder = Gapic::Rest::GrpcTranscoder.new
673
+ .with_bindings(
674
+ uri_method: :post,
675
+ uri_template: "/v1beta2/{parent}/secrets",
676
+ body: "secret",
677
+ matches: [
678
+ ["parent", %r{^projects/[^/]+/?$}, false]
679
+ ]
680
+ )
681
+ .with_bindings(
682
+ uri_method: :post,
683
+ uri_template: "/v1beta2/{parent}/secrets",
684
+ body: "secret",
685
+ matches: [
686
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
687
+ ]
688
+ )
689
+ transcoder.transcode request_pb
690
+ end
691
+
692
+ ##
693
+ # @private
694
+ #
695
+ # GRPC transcoding helper method for the add_secret_version REST call
696
+ #
697
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest]
698
+ # A request object representing the call parameters. Required.
699
+ # @return [Array(String, [String, nil], Hash{String => String})]
700
+ # Uri, Body, Query string parameters
701
+ def self.transcode_add_secret_version_request request_pb
702
+ transcoder = Gapic::Rest::GrpcTranscoder.new
703
+ .with_bindings(
704
+ uri_method: :post,
705
+ uri_template: "/v1beta2/{parent}:addVersion",
706
+ body: "*",
707
+ matches: [
708
+ ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false]
709
+ ]
710
+ )
711
+ .with_bindings(
712
+ uri_method: :post,
713
+ uri_template: "/v1beta2/{parent}:addVersion",
714
+ body: "*",
715
+ matches: [
716
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false]
717
+ ]
718
+ )
719
+ transcoder.transcode request_pb
720
+ end
721
+
722
+ ##
723
+ # @private
724
+ #
725
+ # GRPC transcoding helper method for the get_secret REST call
726
+ #
727
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::GetSecretRequest]
728
+ # A request object representing the call parameters. Required.
729
+ # @return [Array(String, [String, nil], Hash{String => String})]
730
+ # Uri, Body, Query string parameters
731
+ def self.transcode_get_secret_request request_pb
732
+ transcoder = Gapic::Rest::GrpcTranscoder.new
733
+ .with_bindings(
734
+ uri_method: :get,
735
+ uri_template: "/v1beta2/{name}",
736
+ matches: [
737
+ ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false]
738
+ ]
739
+ )
740
+ .with_bindings(
741
+ uri_method: :get,
742
+ uri_template: "/v1beta2/{name}",
743
+ matches: [
744
+ ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false]
745
+ ]
746
+ )
747
+ transcoder.transcode request_pb
748
+ end
749
+
750
+ ##
751
+ # @private
752
+ #
753
+ # GRPC transcoding helper method for the update_secret REST call
754
+ #
755
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest]
756
+ # A request object representing the call parameters. Required.
757
+ # @return [Array(String, [String, nil], Hash{String => String})]
758
+ # Uri, Body, Query string parameters
759
+ def self.transcode_update_secret_request request_pb
760
+ transcoder = Gapic::Rest::GrpcTranscoder.new
761
+ .with_bindings(
762
+ uri_method: :patch,
763
+ uri_template: "/v1beta2/{secret.name}",
764
+ body: "secret",
765
+ matches: [
766
+ ["secret.name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false]
767
+ ]
768
+ )
769
+ .with_bindings(
770
+ uri_method: :patch,
771
+ uri_template: "/v1beta2/{secret.name}",
772
+ body: "secret",
773
+ matches: [
774
+ ["secret.name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false]
775
+ ]
776
+ )
777
+ transcoder.transcode request_pb
778
+ end
779
+
780
+ ##
781
+ # @private
782
+ #
783
+ # GRPC transcoding helper method for the delete_secret REST call
784
+ #
785
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest]
786
+ # A request object representing the call parameters. Required.
787
+ # @return [Array(String, [String, nil], Hash{String => String})]
788
+ # Uri, Body, Query string parameters
789
+ def self.transcode_delete_secret_request request_pb
790
+ transcoder = Gapic::Rest::GrpcTranscoder.new
791
+ .with_bindings(
792
+ uri_method: :delete,
793
+ uri_template: "/v1beta2/{name}",
794
+ matches: [
795
+ ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false]
796
+ ]
797
+ )
798
+ .with_bindings(
799
+ uri_method: :delete,
800
+ uri_template: "/v1beta2/{name}",
801
+ matches: [
802
+ ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false]
803
+ ]
804
+ )
805
+ transcoder.transcode request_pb
806
+ end
807
+
808
+ ##
809
+ # @private
810
+ #
811
+ # GRPC transcoding helper method for the list_secret_versions REST call
812
+ #
813
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest]
814
+ # A request object representing the call parameters. Required.
815
+ # @return [Array(String, [String, nil], Hash{String => String})]
816
+ # Uri, Body, Query string parameters
817
+ def self.transcode_list_secret_versions_request request_pb
818
+ transcoder = Gapic::Rest::GrpcTranscoder.new
819
+ .with_bindings(
820
+ uri_method: :get,
821
+ uri_template: "/v1beta2/{parent}/versions",
822
+ matches: [
823
+ ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false]
824
+ ]
825
+ )
826
+ .with_bindings(
827
+ uri_method: :get,
828
+ uri_template: "/v1beta2/{parent}/versions",
829
+ matches: [
830
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false]
831
+ ]
832
+ )
833
+ transcoder.transcode request_pb
834
+ end
835
+
836
+ ##
837
+ # @private
838
+ #
839
+ # GRPC transcoding helper method for the get_secret_version REST call
840
+ #
841
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest]
842
+ # A request object representing the call parameters. Required.
843
+ # @return [Array(String, [String, nil], Hash{String => String})]
844
+ # Uri, Body, Query string parameters
845
+ def self.transcode_get_secret_version_request request_pb
846
+ transcoder = Gapic::Rest::GrpcTranscoder.new
847
+ .with_bindings(
848
+ uri_method: :get,
849
+ uri_template: "/v1beta2/{name}",
850
+ matches: [
851
+ ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false]
852
+ ]
853
+ )
854
+ .with_bindings(
855
+ uri_method: :get,
856
+ uri_template: "/v1beta2/{name}",
857
+ matches: [
858
+ ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false]
859
+ ]
860
+ )
861
+ transcoder.transcode request_pb
862
+ end
863
+
864
+ ##
865
+ # @private
866
+ #
867
+ # GRPC transcoding helper method for the access_secret_version REST call
868
+ #
869
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest]
870
+ # A request object representing the call parameters. Required.
871
+ # @return [Array(String, [String, nil], Hash{String => String})]
872
+ # Uri, Body, Query string parameters
873
+ def self.transcode_access_secret_version_request request_pb
874
+ transcoder = Gapic::Rest::GrpcTranscoder.new
875
+ .with_bindings(
876
+ uri_method: :get,
877
+ uri_template: "/v1beta2/{name}:access",
878
+ matches: [
879
+ ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false]
880
+ ]
881
+ )
882
+ .with_bindings(
883
+ uri_method: :get,
884
+ uri_template: "/v1beta2/{name}:access",
885
+ matches: [
886
+ ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false]
887
+ ]
888
+ )
889
+ transcoder.transcode request_pb
890
+ end
891
+
892
+ ##
893
+ # @private
894
+ #
895
+ # GRPC transcoding helper method for the disable_secret_version REST call
896
+ #
897
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest]
898
+ # A request object representing the call parameters. Required.
899
+ # @return [Array(String, [String, nil], Hash{String => String})]
900
+ # Uri, Body, Query string parameters
901
+ def self.transcode_disable_secret_version_request request_pb
902
+ transcoder = Gapic::Rest::GrpcTranscoder.new
903
+ .with_bindings(
904
+ uri_method: :post,
905
+ uri_template: "/v1beta2/{name}:disable",
906
+ body: "*",
907
+ matches: [
908
+ ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false]
909
+ ]
910
+ )
911
+ .with_bindings(
912
+ uri_method: :post,
913
+ uri_template: "/v1beta2/{name}:disable",
914
+ body: "*",
915
+ matches: [
916
+ ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false]
917
+ ]
918
+ )
919
+ transcoder.transcode request_pb
920
+ end
921
+
922
+ ##
923
+ # @private
924
+ #
925
+ # GRPC transcoding helper method for the enable_secret_version REST call
926
+ #
927
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest]
928
+ # A request object representing the call parameters. Required.
929
+ # @return [Array(String, [String, nil], Hash{String => String})]
930
+ # Uri, Body, Query string parameters
931
+ def self.transcode_enable_secret_version_request request_pb
932
+ transcoder = Gapic::Rest::GrpcTranscoder.new
933
+ .with_bindings(
934
+ uri_method: :post,
935
+ uri_template: "/v1beta2/{name}:enable",
936
+ body: "*",
937
+ matches: [
938
+ ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false]
939
+ ]
940
+ )
941
+ .with_bindings(
942
+ uri_method: :post,
943
+ uri_template: "/v1beta2/{name}:enable",
944
+ body: "*",
945
+ matches: [
946
+ ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false]
947
+ ]
948
+ )
949
+ transcoder.transcode request_pb
950
+ end
951
+
952
+ ##
953
+ # @private
954
+ #
955
+ # GRPC transcoding helper method for the destroy_secret_version REST call
956
+ #
957
+ # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest]
958
+ # A request object representing the call parameters. Required.
959
+ # @return [Array(String, [String, nil], Hash{String => String})]
960
+ # Uri, Body, Query string parameters
961
+ def self.transcode_destroy_secret_version_request request_pb
962
+ transcoder = Gapic::Rest::GrpcTranscoder.new
963
+ .with_bindings(
964
+ uri_method: :post,
965
+ uri_template: "/v1beta2/{name}:destroy",
966
+ body: "*",
967
+ matches: [
968
+ ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false]
969
+ ]
970
+ )
971
+ .with_bindings(
972
+ uri_method: :post,
973
+ uri_template: "/v1beta2/{name}:destroy",
974
+ body: "*",
975
+ matches: [
976
+ ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false]
977
+ ]
978
+ )
979
+ transcoder.transcode request_pb
980
+ end
981
+
982
+ ##
983
+ # @private
984
+ #
985
+ # GRPC transcoding helper method for the set_iam_policy REST call
986
+ #
987
+ # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest]
988
+ # A request object representing the call parameters. Required.
989
+ # @return [Array(String, [String, nil], Hash{String => String})]
990
+ # Uri, Body, Query string parameters
991
+ def self.transcode_set_iam_policy_request request_pb
992
+ transcoder = Gapic::Rest::GrpcTranscoder.new
993
+ .with_bindings(
994
+ uri_method: :post,
995
+ uri_template: "/v1beta2/{resource}:setIamPolicy",
996
+ body: "*",
997
+ matches: [
998
+ ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false]
999
+ ]
1000
+ )
1001
+ .with_bindings(
1002
+ uri_method: :post,
1003
+ uri_template: "/v1beta2/{resource}:setIamPolicy",
1004
+ body: "*",
1005
+ matches: [
1006
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false]
1007
+ ]
1008
+ )
1009
+ transcoder.transcode request_pb
1010
+ end
1011
+
1012
+ ##
1013
+ # @private
1014
+ #
1015
+ # GRPC transcoding helper method for the get_iam_policy REST call
1016
+ #
1017
+ # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest]
1018
+ # A request object representing the call parameters. Required.
1019
+ # @return [Array(String, [String, nil], Hash{String => String})]
1020
+ # Uri, Body, Query string parameters
1021
+ def self.transcode_get_iam_policy_request request_pb
1022
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1023
+ .with_bindings(
1024
+ uri_method: :get,
1025
+ uri_template: "/v1beta2/{resource}:getIamPolicy",
1026
+ matches: [
1027
+ ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false]
1028
+ ]
1029
+ )
1030
+ .with_bindings(
1031
+ uri_method: :get,
1032
+ uri_template: "/v1beta2/{resource}:getIamPolicy",
1033
+ matches: [
1034
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false]
1035
+ ]
1036
+ )
1037
+ transcoder.transcode request_pb
1038
+ end
1039
+
1040
+ ##
1041
+ # @private
1042
+ #
1043
+ # GRPC transcoding helper method for the test_iam_permissions REST call
1044
+ #
1045
+ # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest]
1046
+ # A request object representing the call parameters. Required.
1047
+ # @return [Array(String, [String, nil], Hash{String => String})]
1048
+ # Uri, Body, Query string parameters
1049
+ def self.transcode_test_iam_permissions_request request_pb
1050
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1051
+ .with_bindings(
1052
+ uri_method: :post,
1053
+ uri_template: "/v1beta2/{resource}:testIamPermissions",
1054
+ body: "*",
1055
+ matches: [
1056
+ ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false]
1057
+ ]
1058
+ )
1059
+ .with_bindings(
1060
+ uri_method: :post,
1061
+ uri_template: "/v1beta2/{resource}:testIamPermissions",
1062
+ body: "*",
1063
+ matches: [
1064
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false]
1065
+ ]
1066
+ )
1067
+ transcoder.transcode request_pb
1068
+ end
1069
+ end
1070
+ end
1071
+ end
1072
+ end
1073
+ end
1074
+ end
1075
+ end