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