google-apis-secretmanager_v1beta2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1269 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module SecretmanagerV1beta2
23
+ # Secret Manager API
24
+ #
25
+ # Stores sensitive data such as API keys, passwords, and certificates. Provides
26
+ # convenience while improving security.
27
+ #
28
+ # @example
29
+ # require 'google/apis/secretmanager_v1beta2'
30
+ #
31
+ # Secretmanager = Google::Apis::SecretmanagerV1beta2 # Alias the module
32
+ # service = Secretmanager::SecretManagerService.new
33
+ #
34
+ # @see https://cloud.google.com/secret-manager/
35
+ class SecretManagerService < Google::Apis::Core::BaseService
36
+ DEFAULT_ENDPOINT_TEMPLATE = "https://secretmanager.$UNIVERSE_DOMAIN$/"
37
+
38
+ # @return [String]
39
+ # API key. Your API key identifies your project and provides you with API access,
40
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
41
+ attr_accessor :key
42
+
43
+ # @return [String]
44
+ # Available to use for quota purposes for server-side applications. Can be any
45
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
46
+ attr_accessor :quota_user
47
+
48
+ def initialize
49
+ super(DEFAULT_ENDPOINT_TEMPLATE, '',
50
+ client_name: 'google-apis-secretmanager_v1beta2',
51
+ client_version: Google::Apis::SecretmanagerV1beta2::GEM_VERSION)
52
+ @batch_path = 'batch'
53
+ end
54
+
55
+ # Gets information about a location.
56
+ # @param [String] name
57
+ # Resource name for the location.
58
+ # @param [String] fields
59
+ # Selector specifying which fields to include in a partial response.
60
+ # @param [String] quota_user
61
+ # Available to use for quota purposes for server-side applications. Can be any
62
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
63
+ # @param [Google::Apis::RequestOptions] options
64
+ # Request-specific options
65
+ #
66
+ # @yield [result, err] Result & error if block supplied
67
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Location] parsed result object
68
+ # @yieldparam err [StandardError] error object if request failed
69
+ #
70
+ # @return [Google::Apis::SecretmanagerV1beta2::Location]
71
+ #
72
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
73
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
74
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
75
+ def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
76
+ command = make_simple_command(:get, 'v1beta2/{+name}', options)
77
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Location::Representation
78
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Location
79
+ command.params['name'] = name unless name.nil?
80
+ command.query['fields'] = fields unless fields.nil?
81
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
82
+ execute_or_queue_command(command, &block)
83
+ end
84
+
85
+ # Lists information about the supported locations for this service.
86
+ # @param [String] name
87
+ # The resource that owns the locations collection, if applicable.
88
+ # @param [String] filter
89
+ # A filter to narrow down results to a preferred subset. The filtering language
90
+ # accepts strings like `"displayName=tokyo"`, and is documented in more detail
91
+ # in [AIP-160](https://google.aip.dev/160).
92
+ # @param [Fixnum] page_size
93
+ # The maximum number of results to return. If not set, the service selects a
94
+ # default.
95
+ # @param [String] page_token
96
+ # A page token received from the `next_page_token` field in the response. Send
97
+ # that page token to receive the subsequent page.
98
+ # @param [String] fields
99
+ # Selector specifying which fields to include in a partial response.
100
+ # @param [String] quota_user
101
+ # Available to use for quota purposes for server-side applications. Can be any
102
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
103
+ # @param [Google::Apis::RequestOptions] options
104
+ # Request-specific options
105
+ #
106
+ # @yield [result, err] Result & error if block supplied
107
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::ListLocationsResponse] parsed result object
108
+ # @yieldparam err [StandardError] error object if request failed
109
+ #
110
+ # @return [Google::Apis::SecretmanagerV1beta2::ListLocationsResponse]
111
+ #
112
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
113
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
114
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
115
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
116
+ command = make_simple_command(:get, 'v1beta2/{+name}/locations', options)
117
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::ListLocationsResponse::Representation
118
+ command.response_class = Google::Apis::SecretmanagerV1beta2::ListLocationsResponse
119
+ command.params['name'] = name unless name.nil?
120
+ command.query['filter'] = filter unless filter.nil?
121
+ command.query['pageSize'] = page_size unless page_size.nil?
122
+ command.query['pageToken'] = page_token unless page_token.nil?
123
+ command.query['fields'] = fields unless fields.nil?
124
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
125
+ execute_or_queue_command(command, &block)
126
+ end
127
+
128
+ # Creates a new SecretVersion containing secret data and attaches it to an
129
+ # existing Secret.
130
+ # @param [String] parent
131
+ # Required. The resource name of the Secret to associate with the SecretVersion
132
+ # in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.
133
+ # @param [Google::Apis::SecretmanagerV1beta2::AddSecretVersionRequest] add_secret_version_request_object
134
+ # @param [String] fields
135
+ # Selector specifying which fields to include in a partial response.
136
+ # @param [String] quota_user
137
+ # Available to use for quota purposes for server-side applications. Can be any
138
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
139
+ # @param [Google::Apis::RequestOptions] options
140
+ # Request-specific options
141
+ #
142
+ # @yield [result, err] Result & error if block supplied
143
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::SecretVersion] parsed result object
144
+ # @yieldparam err [StandardError] error object if request failed
145
+ #
146
+ # @return [Google::Apis::SecretmanagerV1beta2::SecretVersion]
147
+ #
148
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
149
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
150
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
151
+ def add_project_location_secret_version(parent, add_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
152
+ command = make_simple_command(:post, 'v1beta2/{+parent}:addVersion', options)
153
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::AddSecretVersionRequest::Representation
154
+ command.request_object = add_secret_version_request_object
155
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
156
+ command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
157
+ command.params['parent'] = parent unless parent.nil?
158
+ command.query['fields'] = fields unless fields.nil?
159
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
160
+ execute_or_queue_command(command, &block)
161
+ end
162
+
163
+ # Creates a new Secret containing no SecretVersions.
164
+ # @param [String] parent
165
+ # Required. The resource name of the project to associate with the Secret, in
166
+ # the format `projects/*` or `projects/*/locations/*`.
167
+ # @param [Google::Apis::SecretmanagerV1beta2::Secret] secret_object
168
+ # @param [String] secret_id
169
+ # Required. This must be unique within the project. A secret ID is a string with
170
+ # a maximum length of 255 characters and can contain uppercase and lowercase
171
+ # letters, numerals, and the hyphen (`-`) and underscore (`_`) characters.
172
+ # @param [String] fields
173
+ # Selector specifying which fields to include in a partial response.
174
+ # @param [String] quota_user
175
+ # Available to use for quota purposes for server-side applications. Can be any
176
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
177
+ # @param [Google::Apis::RequestOptions] options
178
+ # Request-specific options
179
+ #
180
+ # @yield [result, err] Result & error if block supplied
181
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Secret] parsed result object
182
+ # @yieldparam err [StandardError] error object if request failed
183
+ #
184
+ # @return [Google::Apis::SecretmanagerV1beta2::Secret]
185
+ #
186
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
187
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
188
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
189
+ def create_project_location_secret(parent, secret_object = nil, secret_id: nil, fields: nil, quota_user: nil, options: nil, &block)
190
+ command = make_simple_command(:post, 'v1beta2/{+parent}/secrets', options)
191
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
192
+ command.request_object = secret_object
193
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
194
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Secret
195
+ command.params['parent'] = parent unless parent.nil?
196
+ command.query['secretId'] = secret_id unless secret_id.nil?
197
+ command.query['fields'] = fields unless fields.nil?
198
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
199
+ execute_or_queue_command(command, &block)
200
+ end
201
+
202
+ # Deletes a Secret.
203
+ # @param [String] name
204
+ # Required. The resource name of the Secret to delete in the format `projects/*/
205
+ # secrets/*`.
206
+ # @param [String] etag
207
+ # Optional. Etag of the Secret. The request succeeds if it matches the etag of
208
+ # the currently stored secret object. If the etag is omitted, the request
209
+ # succeeds.
210
+ # @param [String] fields
211
+ # Selector specifying which fields to include in a partial response.
212
+ # @param [String] quota_user
213
+ # Available to use for quota purposes for server-side applications. Can be any
214
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
215
+ # @param [Google::Apis::RequestOptions] options
216
+ # Request-specific options
217
+ #
218
+ # @yield [result, err] Result & error if block supplied
219
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Empty] parsed result object
220
+ # @yieldparam err [StandardError] error object if request failed
221
+ #
222
+ # @return [Google::Apis::SecretmanagerV1beta2::Empty]
223
+ #
224
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
225
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
226
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
227
+ def delete_project_location_secret(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block)
228
+ command = make_simple_command(:delete, 'v1beta2/{+name}', options)
229
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Empty::Representation
230
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Empty
231
+ command.params['name'] = name unless name.nil?
232
+ command.query['etag'] = etag unless etag.nil?
233
+ command.query['fields'] = fields unless fields.nil?
234
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
235
+ execute_or_queue_command(command, &block)
236
+ end
237
+
238
+ # Gets metadata for a given Secret.
239
+ # @param [String] name
240
+ # Required. The resource name of the Secret, in the format `projects/*/secrets/*`
241
+ # or `projects/*/locations/*/secrets/*`.
242
+ # @param [String] fields
243
+ # Selector specifying which fields to include in a partial response.
244
+ # @param [String] quota_user
245
+ # Available to use for quota purposes for server-side applications. Can be any
246
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
247
+ # @param [Google::Apis::RequestOptions] options
248
+ # Request-specific options
249
+ #
250
+ # @yield [result, err] Result & error if block supplied
251
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Secret] parsed result object
252
+ # @yieldparam err [StandardError] error object if request failed
253
+ #
254
+ # @return [Google::Apis::SecretmanagerV1beta2::Secret]
255
+ #
256
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
257
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
258
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
259
+ def get_project_location_secret(name, fields: nil, quota_user: nil, options: nil, &block)
260
+ command = make_simple_command(:get, 'v1beta2/{+name}', options)
261
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
262
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Secret
263
+ command.params['name'] = name unless name.nil?
264
+ command.query['fields'] = fields unless fields.nil?
265
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
266
+ execute_or_queue_command(command, &block)
267
+ end
268
+
269
+ # Gets the access control policy for a secret. Returns empty policy if the
270
+ # secret exists and does not have a policy set.
271
+ # @param [String] resource
272
+ # REQUIRED: The resource for which the policy is being requested. See [Resource
273
+ # names](https://cloud.google.com/apis/design/resource_names) for the
274
+ # appropriate value for this field.
275
+ # @param [Fixnum] options_requested_policy_version
276
+ # Optional. The maximum policy version that will be used to format the policy.
277
+ # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
278
+ # rejected. Requests for policies with any conditional role bindings must
279
+ # specify version 3. Policies with no conditional role bindings may specify any
280
+ # valid value or leave the field unset. The policy in the response might use the
281
+ # policy version that you specified, or it might use a lower policy version. For
282
+ # example, if you specify version 3, but the policy has no conditional role
283
+ # bindings, the response uses version 1. To learn which resources support
284
+ # conditions in their IAM policies, see the [IAM documentation](https://cloud.
285
+ # google.com/iam/help/conditions/resource-policies).
286
+ # @param [String] fields
287
+ # Selector specifying which fields to include in a partial response.
288
+ # @param [String] quota_user
289
+ # Available to use for quota purposes for server-side applications. Can be any
290
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
291
+ # @param [Google::Apis::RequestOptions] options
292
+ # Request-specific options
293
+ #
294
+ # @yield [result, err] Result & error if block supplied
295
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Policy] parsed result object
296
+ # @yieldparam err [StandardError] error object if request failed
297
+ #
298
+ # @return [Google::Apis::SecretmanagerV1beta2::Policy]
299
+ #
300
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
301
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
302
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
303
+ def get_project_location_secret_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
304
+ command = make_simple_command(:get, 'v1beta2/{+resource}:getIamPolicy', options)
305
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Policy::Representation
306
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Policy
307
+ command.params['resource'] = resource unless resource.nil?
308
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
309
+ command.query['fields'] = fields unless fields.nil?
310
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
311
+ execute_or_queue_command(command, &block)
312
+ end
313
+
314
+ # Lists Secrets.
315
+ # @param [String] parent
316
+ # Required. The resource name of the project associated with the Secrets, in the
317
+ # format `projects/*` or `projects/*/locations/*`
318
+ # @param [String] filter
319
+ # Optional. Filter string, adhering to the rules in [List-operation filtering](
320
+ # https://cloud.google.com/secret-manager/docs/filtering). List only secrets
321
+ # matching the filter. If filter is empty, all secrets are listed.
322
+ # @param [Fixnum] page_size
323
+ # Optional. The maximum number of results to be returned in a single page. If
324
+ # set to 0, the server decides the number of results to return. If the number is
325
+ # greater than 25000, it is capped at 25000.
326
+ # @param [String] page_token
327
+ # Optional. Pagination token, returned earlier via ListSecretsResponse.
328
+ # next_page_token.
329
+ # @param [String] fields
330
+ # Selector specifying which fields to include in a partial response.
331
+ # @param [String] quota_user
332
+ # Available to use for quota purposes for server-side applications. Can be any
333
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
334
+ # @param [Google::Apis::RequestOptions] options
335
+ # Request-specific options
336
+ #
337
+ # @yield [result, err] Result & error if block supplied
338
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::ListSecretsResponse] parsed result object
339
+ # @yieldparam err [StandardError] error object if request failed
340
+ #
341
+ # @return [Google::Apis::SecretmanagerV1beta2::ListSecretsResponse]
342
+ #
343
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
344
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
345
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
346
+ def list_project_location_secrets(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
347
+ command = make_simple_command(:get, 'v1beta2/{+parent}/secrets', options)
348
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::ListSecretsResponse::Representation
349
+ command.response_class = Google::Apis::SecretmanagerV1beta2::ListSecretsResponse
350
+ command.params['parent'] = parent unless parent.nil?
351
+ command.query['filter'] = filter unless filter.nil?
352
+ command.query['pageSize'] = page_size unless page_size.nil?
353
+ command.query['pageToken'] = page_token unless page_token.nil?
354
+ command.query['fields'] = fields unless fields.nil?
355
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
356
+ execute_or_queue_command(command, &block)
357
+ end
358
+
359
+ # Updates metadata of an existing Secret.
360
+ # @param [String] name
361
+ # Output only. The resource name of the Secret in the format `projects/*/secrets/
362
+ # *`.
363
+ # @param [Google::Apis::SecretmanagerV1beta2::Secret] secret_object
364
+ # @param [String] update_mask
365
+ # Required. Specifies the fields to be updated.
366
+ # @param [String] fields
367
+ # Selector specifying which fields to include in a partial response.
368
+ # @param [String] quota_user
369
+ # Available to use for quota purposes for server-side applications. Can be any
370
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
371
+ # @param [Google::Apis::RequestOptions] options
372
+ # Request-specific options
373
+ #
374
+ # @yield [result, err] Result & error if block supplied
375
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Secret] parsed result object
376
+ # @yieldparam err [StandardError] error object if request failed
377
+ #
378
+ # @return [Google::Apis::SecretmanagerV1beta2::Secret]
379
+ #
380
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
381
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
382
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
383
+ def patch_project_location_secret(name, secret_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
384
+ command = make_simple_command(:patch, 'v1beta2/{+name}', options)
385
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
386
+ command.request_object = secret_object
387
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
388
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Secret
389
+ command.params['name'] = name unless name.nil?
390
+ command.query['updateMask'] = update_mask unless update_mask.nil?
391
+ command.query['fields'] = fields unless fields.nil?
392
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
393
+ execute_or_queue_command(command, &block)
394
+ end
395
+
396
+ # Sets the access control policy on the specified secret. Replaces any existing
397
+ # policy. Permissions on SecretVersions are enforced according to the policy set
398
+ # on the associated Secret.
399
+ # @param [String] resource
400
+ # REQUIRED: The resource for which the policy is being specified. See [Resource
401
+ # names](https://cloud.google.com/apis/design/resource_names) for the
402
+ # appropriate value for this field.
403
+ # @param [Google::Apis::SecretmanagerV1beta2::SetIamPolicyRequest] set_iam_policy_request_object
404
+ # @param [String] fields
405
+ # Selector specifying which fields to include in a partial response.
406
+ # @param [String] quota_user
407
+ # Available to use for quota purposes for server-side applications. Can be any
408
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
409
+ # @param [Google::Apis::RequestOptions] options
410
+ # Request-specific options
411
+ #
412
+ # @yield [result, err] Result & error if block supplied
413
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Policy] parsed result object
414
+ # @yieldparam err [StandardError] error object if request failed
415
+ #
416
+ # @return [Google::Apis::SecretmanagerV1beta2::Policy]
417
+ #
418
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
419
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
420
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
421
+ def set_project_location_secret_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
422
+ command = make_simple_command(:post, 'v1beta2/{+resource}:setIamPolicy', options)
423
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::SetIamPolicyRequest::Representation
424
+ command.request_object = set_iam_policy_request_object
425
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Policy::Representation
426
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Policy
427
+ command.params['resource'] = resource unless resource.nil?
428
+ command.query['fields'] = fields unless fields.nil?
429
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
430
+ execute_or_queue_command(command, &block)
431
+ end
432
+
433
+ # Returns permissions that a caller has for the specified secret. If the secret
434
+ # does not exist, this call returns an empty set of permissions, not a NOT_FOUND
435
+ # error. Note: This operation is designed to be used for building permission-
436
+ # aware UIs and command-line tools, not for authorization checking. This
437
+ # operation may "fail open" without warning.
438
+ # @param [String] resource
439
+ # REQUIRED: The resource for which the policy detail is being requested. See [
440
+ # Resource names](https://cloud.google.com/apis/design/resource_names) for the
441
+ # appropriate value for this field.
442
+ # @param [Google::Apis::SecretmanagerV1beta2::TestIamPermissionsRequest] test_iam_permissions_request_object
443
+ # @param [String] fields
444
+ # Selector specifying which fields to include in a partial response.
445
+ # @param [String] quota_user
446
+ # Available to use for quota purposes for server-side applications. Can be any
447
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
448
+ # @param [Google::Apis::RequestOptions] options
449
+ # Request-specific options
450
+ #
451
+ # @yield [result, err] Result & error if block supplied
452
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse] parsed result object
453
+ # @yieldparam err [StandardError] error object if request failed
454
+ #
455
+ # @return [Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse]
456
+ #
457
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
458
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
459
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
460
+ def test_project_location_secret_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
461
+ command = make_simple_command(:post, 'v1beta2/{+resource}:testIamPermissions', options)
462
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::TestIamPermissionsRequest::Representation
463
+ command.request_object = test_iam_permissions_request_object
464
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse::Representation
465
+ command.response_class = Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse
466
+ command.params['resource'] = resource unless resource.nil?
467
+ command.query['fields'] = fields unless fields.nil?
468
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
469
+ execute_or_queue_command(command, &block)
470
+ end
471
+
472
+ # Accesses a SecretVersion. This call returns the secret data. `projects/*/
473
+ # secrets/*/versions/latest` is an alias to the most recently created
474
+ # SecretVersion.
475
+ # @param [String] name
476
+ # Required. The resource name of the SecretVersion in the format `projects/*/
477
+ # secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/*`. `
478
+ # projects/*/secrets/*/versions/latest` or `projects/*/locations/*/secrets/*/
479
+ # versions/latest` is an alias to the most recently created SecretVersion.
480
+ # @param [String] fields
481
+ # Selector specifying which fields to include in a partial response.
482
+ # @param [String] quota_user
483
+ # Available to use for quota purposes for server-side applications. Can be any
484
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
485
+ # @param [Google::Apis::RequestOptions] options
486
+ # Request-specific options
487
+ #
488
+ # @yield [result, err] Result & error if block supplied
489
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse] parsed result object
490
+ # @yieldparam err [StandardError] error object if request failed
491
+ #
492
+ # @return [Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse]
493
+ #
494
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
495
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
496
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
497
+ def access_project_location_secret_version(name, fields: nil, quota_user: nil, options: nil, &block)
498
+ command = make_simple_command(:get, 'v1beta2/{+name}:access', options)
499
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse::Representation
500
+ command.response_class = Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse
501
+ command.params['name'] = name unless name.nil?
502
+ command.query['fields'] = fields unless fields.nil?
503
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
504
+ execute_or_queue_command(command, &block)
505
+ end
506
+
507
+ # Destroys a SecretVersion. Sets the state of the SecretVersion to DESTROYED and
508
+ # irrevocably destroys the secret data.
509
+ # @param [String] name
510
+ # Required. The resource name of the SecretVersion to destroy in the format `
511
+ # projects/*/secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/
512
+ # *`.
513
+ # @param [Google::Apis::SecretmanagerV1beta2::DestroySecretVersionRequest] destroy_secret_version_request_object
514
+ # @param [String] fields
515
+ # Selector specifying which fields to include in a partial response.
516
+ # @param [String] quota_user
517
+ # Available to use for quota purposes for server-side applications. Can be any
518
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
519
+ # @param [Google::Apis::RequestOptions] options
520
+ # Request-specific options
521
+ #
522
+ # @yield [result, err] Result & error if block supplied
523
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::SecretVersion] parsed result object
524
+ # @yieldparam err [StandardError] error object if request failed
525
+ #
526
+ # @return [Google::Apis::SecretmanagerV1beta2::SecretVersion]
527
+ #
528
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
529
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
530
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
531
+ def destroy_project_location_secret_version(name, destroy_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
532
+ command = make_simple_command(:post, 'v1beta2/{+name}:destroy', options)
533
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::DestroySecretVersionRequest::Representation
534
+ command.request_object = destroy_secret_version_request_object
535
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
536
+ command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
537
+ command.params['name'] = name unless name.nil?
538
+ command.query['fields'] = fields unless fields.nil?
539
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
540
+ execute_or_queue_command(command, &block)
541
+ end
542
+
543
+ # Disables a SecretVersion. Sets the state of the SecretVersion to DISABLED.
544
+ # @param [String] name
545
+ # Required. The resource name of the SecretVersion to disable in the format `
546
+ # projects/*/secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/
547
+ # *`.
548
+ # @param [Google::Apis::SecretmanagerV1beta2::DisableSecretVersionRequest] disable_secret_version_request_object
549
+ # @param [String] fields
550
+ # Selector specifying which fields to include in a partial response.
551
+ # @param [String] quota_user
552
+ # Available to use for quota purposes for server-side applications. Can be any
553
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
554
+ # @param [Google::Apis::RequestOptions] options
555
+ # Request-specific options
556
+ #
557
+ # @yield [result, err] Result & error if block supplied
558
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::SecretVersion] parsed result object
559
+ # @yieldparam err [StandardError] error object if request failed
560
+ #
561
+ # @return [Google::Apis::SecretmanagerV1beta2::SecretVersion]
562
+ #
563
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
564
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
565
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
566
+ def disable_project_location_secret_version(name, disable_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
567
+ command = make_simple_command(:post, 'v1beta2/{+name}:disable', options)
568
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::DisableSecretVersionRequest::Representation
569
+ command.request_object = disable_secret_version_request_object
570
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
571
+ command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
572
+ command.params['name'] = name unless name.nil?
573
+ command.query['fields'] = fields unless fields.nil?
574
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
575
+ execute_or_queue_command(command, &block)
576
+ end
577
+
578
+ # Enables a SecretVersion. Sets the state of the SecretVersion to ENABLED.
579
+ # @param [String] name
580
+ # Required. The resource name of the SecretVersion to enable in the format `
581
+ # projects/*/secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/
582
+ # *`.
583
+ # @param [Google::Apis::SecretmanagerV1beta2::EnableSecretVersionRequest] enable_secret_version_request_object
584
+ # @param [String] fields
585
+ # Selector specifying which fields to include in a partial response.
586
+ # @param [String] quota_user
587
+ # Available to use for quota purposes for server-side applications. Can be any
588
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
589
+ # @param [Google::Apis::RequestOptions] options
590
+ # Request-specific options
591
+ #
592
+ # @yield [result, err] Result & error if block supplied
593
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::SecretVersion] parsed result object
594
+ # @yieldparam err [StandardError] error object if request failed
595
+ #
596
+ # @return [Google::Apis::SecretmanagerV1beta2::SecretVersion]
597
+ #
598
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
599
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
600
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
601
+ def enable_project_location_secret_version(name, enable_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
602
+ command = make_simple_command(:post, 'v1beta2/{+name}:enable', options)
603
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::EnableSecretVersionRequest::Representation
604
+ command.request_object = enable_secret_version_request_object
605
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
606
+ command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
607
+ command.params['name'] = name unless name.nil?
608
+ command.query['fields'] = fields unless fields.nil?
609
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
610
+ execute_or_queue_command(command, &block)
611
+ end
612
+
613
+ # Gets metadata for a SecretVersion. `projects/*/secrets/*/versions/latest` is
614
+ # an alias to the most recently created SecretVersion.
615
+ # @param [String] name
616
+ # Required. The resource name of the SecretVersion in the format `projects/*/
617
+ # secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/*`. `
618
+ # projects/*/secrets/*/versions/latest` or `projects/*/locations/*/secrets/*/
619
+ # versions/latest` is an alias to the most recently created SecretVersion.
620
+ # @param [String] fields
621
+ # Selector specifying which fields to include in a partial response.
622
+ # @param [String] quota_user
623
+ # Available to use for quota purposes for server-side applications. Can be any
624
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
625
+ # @param [Google::Apis::RequestOptions] options
626
+ # Request-specific options
627
+ #
628
+ # @yield [result, err] Result & error if block supplied
629
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::SecretVersion] parsed result object
630
+ # @yieldparam err [StandardError] error object if request failed
631
+ #
632
+ # @return [Google::Apis::SecretmanagerV1beta2::SecretVersion]
633
+ #
634
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
635
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
636
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
637
+ def get_project_location_secret_version(name, fields: nil, quota_user: nil, options: nil, &block)
638
+ command = make_simple_command(:get, 'v1beta2/{+name}', options)
639
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
640
+ command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
641
+ command.params['name'] = name unless name.nil?
642
+ command.query['fields'] = fields unless fields.nil?
643
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
644
+ execute_or_queue_command(command, &block)
645
+ end
646
+
647
+ # Lists SecretVersions. This call does not return secret data.
648
+ # @param [String] parent
649
+ # Required. The resource name of the Secret associated with the SecretVersions
650
+ # to list, in the format `projects/*/secrets/*` or `projects/*/locations/*/
651
+ # secrets/*`.
652
+ # @param [String] filter
653
+ # Optional. Filter string, adhering to the rules in [List-operation filtering](
654
+ # https://cloud.google.com/secret-manager/docs/filtering). List only secret
655
+ # versions matching the filter. If filter is empty, all secret versions are
656
+ # listed.
657
+ # @param [Fixnum] page_size
658
+ # Optional. The maximum number of results to be returned in a single page. If
659
+ # set to 0, the server decides the number of results to return. If the number is
660
+ # greater than 25000, it is capped at 25000.
661
+ # @param [String] page_token
662
+ # Optional. Pagination token, returned earlier via ListSecretVersionsResponse.
663
+ # next_page_token][].
664
+ # @param [String] fields
665
+ # Selector specifying which fields to include in a partial response.
666
+ # @param [String] quota_user
667
+ # Available to use for quota purposes for server-side applications. Can be any
668
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
669
+ # @param [Google::Apis::RequestOptions] options
670
+ # Request-specific options
671
+ #
672
+ # @yield [result, err] Result & error if block supplied
673
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse] parsed result object
674
+ # @yieldparam err [StandardError] error object if request failed
675
+ #
676
+ # @return [Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse]
677
+ #
678
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
679
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
680
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
681
+ def list_project_location_secret_versions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
682
+ command = make_simple_command(:get, 'v1beta2/{+parent}/versions', options)
683
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse::Representation
684
+ command.response_class = Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse
685
+ command.params['parent'] = parent unless parent.nil?
686
+ command.query['filter'] = filter unless filter.nil?
687
+ command.query['pageSize'] = page_size unless page_size.nil?
688
+ command.query['pageToken'] = page_token unless page_token.nil?
689
+ command.query['fields'] = fields unless fields.nil?
690
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
691
+ execute_or_queue_command(command, &block)
692
+ end
693
+
694
+ # Creates a new SecretVersion containing secret data and attaches it to an
695
+ # existing Secret.
696
+ # @param [String] parent
697
+ # Required. The resource name of the Secret to associate with the SecretVersion
698
+ # in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.
699
+ # @param [Google::Apis::SecretmanagerV1beta2::AddSecretVersionRequest] add_secret_version_request_object
700
+ # @param [String] fields
701
+ # Selector specifying which fields to include in a partial response.
702
+ # @param [String] quota_user
703
+ # Available to use for quota purposes for server-side applications. Can be any
704
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
705
+ # @param [Google::Apis::RequestOptions] options
706
+ # Request-specific options
707
+ #
708
+ # @yield [result, err] Result & error if block supplied
709
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::SecretVersion] parsed result object
710
+ # @yieldparam err [StandardError] error object if request failed
711
+ #
712
+ # @return [Google::Apis::SecretmanagerV1beta2::SecretVersion]
713
+ #
714
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
715
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
716
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
717
+ def add_project_secret_version(parent, add_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
718
+ command = make_simple_command(:post, 'v1beta2/{+parent}:addVersion', options)
719
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::AddSecretVersionRequest::Representation
720
+ command.request_object = add_secret_version_request_object
721
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
722
+ command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
723
+ command.params['parent'] = parent unless parent.nil?
724
+ command.query['fields'] = fields unless fields.nil?
725
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
726
+ execute_or_queue_command(command, &block)
727
+ end
728
+
729
+ # Creates a new Secret containing no SecretVersions.
730
+ # @param [String] parent
731
+ # Required. The resource name of the project to associate with the Secret, in
732
+ # the format `projects/*` or `projects/*/locations/*`.
733
+ # @param [Google::Apis::SecretmanagerV1beta2::Secret] secret_object
734
+ # @param [String] secret_id
735
+ # Required. This must be unique within the project. A secret ID is a string with
736
+ # a maximum length of 255 characters and can contain uppercase and lowercase
737
+ # letters, numerals, and the hyphen (`-`) and underscore (`_`) characters.
738
+ # @param [String] fields
739
+ # Selector specifying which fields to include in a partial response.
740
+ # @param [String] quota_user
741
+ # Available to use for quota purposes for server-side applications. Can be any
742
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
743
+ # @param [Google::Apis::RequestOptions] options
744
+ # Request-specific options
745
+ #
746
+ # @yield [result, err] Result & error if block supplied
747
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Secret] parsed result object
748
+ # @yieldparam err [StandardError] error object if request failed
749
+ #
750
+ # @return [Google::Apis::SecretmanagerV1beta2::Secret]
751
+ #
752
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
753
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
754
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
755
+ def create_project_secret(parent, secret_object = nil, secret_id: nil, fields: nil, quota_user: nil, options: nil, &block)
756
+ command = make_simple_command(:post, 'v1beta2/{+parent}/secrets', options)
757
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
758
+ command.request_object = secret_object
759
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
760
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Secret
761
+ command.params['parent'] = parent unless parent.nil?
762
+ command.query['secretId'] = secret_id unless secret_id.nil?
763
+ command.query['fields'] = fields unless fields.nil?
764
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
765
+ execute_or_queue_command(command, &block)
766
+ end
767
+
768
+ # Deletes a Secret.
769
+ # @param [String] name
770
+ # Required. The resource name of the Secret to delete in the format `projects/*/
771
+ # secrets/*`.
772
+ # @param [String] etag
773
+ # Optional. Etag of the Secret. The request succeeds if it matches the etag of
774
+ # the currently stored secret object. If the etag is omitted, the request
775
+ # succeeds.
776
+ # @param [String] fields
777
+ # Selector specifying which fields to include in a partial response.
778
+ # @param [String] quota_user
779
+ # Available to use for quota purposes for server-side applications. Can be any
780
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
781
+ # @param [Google::Apis::RequestOptions] options
782
+ # Request-specific options
783
+ #
784
+ # @yield [result, err] Result & error if block supplied
785
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Empty] parsed result object
786
+ # @yieldparam err [StandardError] error object if request failed
787
+ #
788
+ # @return [Google::Apis::SecretmanagerV1beta2::Empty]
789
+ #
790
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
791
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
792
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
793
+ def delete_project_secret(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block)
794
+ command = make_simple_command(:delete, 'v1beta2/{+name}', options)
795
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Empty::Representation
796
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Empty
797
+ command.params['name'] = name unless name.nil?
798
+ command.query['etag'] = etag unless etag.nil?
799
+ command.query['fields'] = fields unless fields.nil?
800
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
801
+ execute_or_queue_command(command, &block)
802
+ end
803
+
804
+ # Gets metadata for a given Secret.
805
+ # @param [String] name
806
+ # Required. The resource name of the Secret, in the format `projects/*/secrets/*`
807
+ # or `projects/*/locations/*/secrets/*`.
808
+ # @param [String] fields
809
+ # Selector specifying which fields to include in a partial response.
810
+ # @param [String] quota_user
811
+ # Available to use for quota purposes for server-side applications. Can be any
812
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
813
+ # @param [Google::Apis::RequestOptions] options
814
+ # Request-specific options
815
+ #
816
+ # @yield [result, err] Result & error if block supplied
817
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Secret] parsed result object
818
+ # @yieldparam err [StandardError] error object if request failed
819
+ #
820
+ # @return [Google::Apis::SecretmanagerV1beta2::Secret]
821
+ #
822
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
823
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
824
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
825
+ def get_project_secret(name, fields: nil, quota_user: nil, options: nil, &block)
826
+ command = make_simple_command(:get, 'v1beta2/{+name}', options)
827
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
828
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Secret
829
+ command.params['name'] = name unless name.nil?
830
+ command.query['fields'] = fields unless fields.nil?
831
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
832
+ execute_or_queue_command(command, &block)
833
+ end
834
+
835
+ # Gets the access control policy for a secret. Returns empty policy if the
836
+ # secret exists and does not have a policy set.
837
+ # @param [String] resource
838
+ # REQUIRED: The resource for which the policy is being requested. See [Resource
839
+ # names](https://cloud.google.com/apis/design/resource_names) for the
840
+ # appropriate value for this field.
841
+ # @param [Fixnum] options_requested_policy_version
842
+ # Optional. The maximum policy version that will be used to format the policy.
843
+ # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
844
+ # rejected. Requests for policies with any conditional role bindings must
845
+ # specify version 3. Policies with no conditional role bindings may specify any
846
+ # valid value or leave the field unset. The policy in the response might use the
847
+ # policy version that you specified, or it might use a lower policy version. For
848
+ # example, if you specify version 3, but the policy has no conditional role
849
+ # bindings, the response uses version 1. To learn which resources support
850
+ # conditions in their IAM policies, see the [IAM documentation](https://cloud.
851
+ # google.com/iam/help/conditions/resource-policies).
852
+ # @param [String] fields
853
+ # Selector specifying which fields to include in a partial response.
854
+ # @param [String] quota_user
855
+ # Available to use for quota purposes for server-side applications. Can be any
856
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
857
+ # @param [Google::Apis::RequestOptions] options
858
+ # Request-specific options
859
+ #
860
+ # @yield [result, err] Result & error if block supplied
861
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Policy] parsed result object
862
+ # @yieldparam err [StandardError] error object if request failed
863
+ #
864
+ # @return [Google::Apis::SecretmanagerV1beta2::Policy]
865
+ #
866
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
867
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
868
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
869
+ def get_project_secret_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
870
+ command = make_simple_command(:get, 'v1beta2/{+resource}:getIamPolicy', options)
871
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Policy::Representation
872
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Policy
873
+ command.params['resource'] = resource unless resource.nil?
874
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
875
+ command.query['fields'] = fields unless fields.nil?
876
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
877
+ execute_or_queue_command(command, &block)
878
+ end
879
+
880
+ # Lists Secrets.
881
+ # @param [String] parent
882
+ # Required. The resource name of the project associated with the Secrets, in the
883
+ # format `projects/*` or `projects/*/locations/*`
884
+ # @param [String] filter
885
+ # Optional. Filter string, adhering to the rules in [List-operation filtering](
886
+ # https://cloud.google.com/secret-manager/docs/filtering). List only secrets
887
+ # matching the filter. If filter is empty, all secrets are listed.
888
+ # @param [Fixnum] page_size
889
+ # Optional. The maximum number of results to be returned in a single page. If
890
+ # set to 0, the server decides the number of results to return. If the number is
891
+ # greater than 25000, it is capped at 25000.
892
+ # @param [String] page_token
893
+ # Optional. Pagination token, returned earlier via ListSecretsResponse.
894
+ # next_page_token.
895
+ # @param [String] fields
896
+ # Selector specifying which fields to include in a partial response.
897
+ # @param [String] quota_user
898
+ # Available to use for quota purposes for server-side applications. Can be any
899
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
900
+ # @param [Google::Apis::RequestOptions] options
901
+ # Request-specific options
902
+ #
903
+ # @yield [result, err] Result & error if block supplied
904
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::ListSecretsResponse] parsed result object
905
+ # @yieldparam err [StandardError] error object if request failed
906
+ #
907
+ # @return [Google::Apis::SecretmanagerV1beta2::ListSecretsResponse]
908
+ #
909
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
910
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
911
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
912
+ def list_project_secrets(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
913
+ command = make_simple_command(:get, 'v1beta2/{+parent}/secrets', options)
914
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::ListSecretsResponse::Representation
915
+ command.response_class = Google::Apis::SecretmanagerV1beta2::ListSecretsResponse
916
+ command.params['parent'] = parent unless parent.nil?
917
+ command.query['filter'] = filter unless filter.nil?
918
+ command.query['pageSize'] = page_size unless page_size.nil?
919
+ command.query['pageToken'] = page_token unless page_token.nil?
920
+ command.query['fields'] = fields unless fields.nil?
921
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
922
+ execute_or_queue_command(command, &block)
923
+ end
924
+
925
+ # Updates metadata of an existing Secret.
926
+ # @param [String] name
927
+ # Output only. The resource name of the Secret in the format `projects/*/secrets/
928
+ # *`.
929
+ # @param [Google::Apis::SecretmanagerV1beta2::Secret] secret_object
930
+ # @param [String] update_mask
931
+ # Required. Specifies the fields to be updated.
932
+ # @param [String] fields
933
+ # Selector specifying which fields to include in a partial response.
934
+ # @param [String] quota_user
935
+ # Available to use for quota purposes for server-side applications. Can be any
936
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
937
+ # @param [Google::Apis::RequestOptions] options
938
+ # Request-specific options
939
+ #
940
+ # @yield [result, err] Result & error if block supplied
941
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Secret] parsed result object
942
+ # @yieldparam err [StandardError] error object if request failed
943
+ #
944
+ # @return [Google::Apis::SecretmanagerV1beta2::Secret]
945
+ #
946
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
947
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
948
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
949
+ def patch_project_secret(name, secret_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
950
+ command = make_simple_command(:patch, 'v1beta2/{+name}', options)
951
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
952
+ command.request_object = secret_object
953
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
954
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Secret
955
+ command.params['name'] = name unless name.nil?
956
+ command.query['updateMask'] = update_mask unless update_mask.nil?
957
+ command.query['fields'] = fields unless fields.nil?
958
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
959
+ execute_or_queue_command(command, &block)
960
+ end
961
+
962
+ # Sets the access control policy on the specified secret. Replaces any existing
963
+ # policy. Permissions on SecretVersions are enforced according to the policy set
964
+ # on the associated Secret.
965
+ # @param [String] resource
966
+ # REQUIRED: The resource for which the policy is being specified. See [Resource
967
+ # names](https://cloud.google.com/apis/design/resource_names) for the
968
+ # appropriate value for this field.
969
+ # @param [Google::Apis::SecretmanagerV1beta2::SetIamPolicyRequest] set_iam_policy_request_object
970
+ # @param [String] fields
971
+ # Selector specifying which fields to include in a partial response.
972
+ # @param [String] quota_user
973
+ # Available to use for quota purposes for server-side applications. Can be any
974
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
975
+ # @param [Google::Apis::RequestOptions] options
976
+ # Request-specific options
977
+ #
978
+ # @yield [result, err] Result & error if block supplied
979
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::Policy] parsed result object
980
+ # @yieldparam err [StandardError] error object if request failed
981
+ #
982
+ # @return [Google::Apis::SecretmanagerV1beta2::Policy]
983
+ #
984
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
985
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
986
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
987
+ def set_project_secret_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
988
+ command = make_simple_command(:post, 'v1beta2/{+resource}:setIamPolicy', options)
989
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::SetIamPolicyRequest::Representation
990
+ command.request_object = set_iam_policy_request_object
991
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::Policy::Representation
992
+ command.response_class = Google::Apis::SecretmanagerV1beta2::Policy
993
+ command.params['resource'] = resource unless resource.nil?
994
+ command.query['fields'] = fields unless fields.nil?
995
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
996
+ execute_or_queue_command(command, &block)
997
+ end
998
+
999
+ # Returns permissions that a caller has for the specified secret. If the secret
1000
+ # does not exist, this call returns an empty set of permissions, not a NOT_FOUND
1001
+ # error. Note: This operation is designed to be used for building permission-
1002
+ # aware UIs and command-line tools, not for authorization checking. This
1003
+ # operation may "fail open" without warning.
1004
+ # @param [String] resource
1005
+ # REQUIRED: The resource for which the policy detail is being requested. See [
1006
+ # Resource names](https://cloud.google.com/apis/design/resource_names) for the
1007
+ # appropriate value for this field.
1008
+ # @param [Google::Apis::SecretmanagerV1beta2::TestIamPermissionsRequest] test_iam_permissions_request_object
1009
+ # @param [String] fields
1010
+ # Selector specifying which fields to include in a partial response.
1011
+ # @param [String] quota_user
1012
+ # Available to use for quota purposes for server-side applications. Can be any
1013
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1014
+ # @param [Google::Apis::RequestOptions] options
1015
+ # Request-specific options
1016
+ #
1017
+ # @yield [result, err] Result & error if block supplied
1018
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse] parsed result object
1019
+ # @yieldparam err [StandardError] error object if request failed
1020
+ #
1021
+ # @return [Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse]
1022
+ #
1023
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1024
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1025
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1026
+ def test_project_secret_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1027
+ command = make_simple_command(:post, 'v1beta2/{+resource}:testIamPermissions', options)
1028
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::TestIamPermissionsRequest::Representation
1029
+ command.request_object = test_iam_permissions_request_object
1030
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse::Representation
1031
+ command.response_class = Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse
1032
+ command.params['resource'] = resource unless resource.nil?
1033
+ command.query['fields'] = fields unless fields.nil?
1034
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1035
+ execute_or_queue_command(command, &block)
1036
+ end
1037
+
1038
+ # Accesses a SecretVersion. This call returns the secret data. `projects/*/
1039
+ # secrets/*/versions/latest` is an alias to the most recently created
1040
+ # SecretVersion.
1041
+ # @param [String] name
1042
+ # Required. The resource name of the SecretVersion in the format `projects/*/
1043
+ # secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/*`. `
1044
+ # projects/*/secrets/*/versions/latest` or `projects/*/locations/*/secrets/*/
1045
+ # versions/latest` is an alias to the most recently created SecretVersion.
1046
+ # @param [String] fields
1047
+ # Selector specifying which fields to include in a partial response.
1048
+ # @param [String] quota_user
1049
+ # Available to use for quota purposes for server-side applications. Can be any
1050
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1051
+ # @param [Google::Apis::RequestOptions] options
1052
+ # Request-specific options
1053
+ #
1054
+ # @yield [result, err] Result & error if block supplied
1055
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse] parsed result object
1056
+ # @yieldparam err [StandardError] error object if request failed
1057
+ #
1058
+ # @return [Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse]
1059
+ #
1060
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1061
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1062
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1063
+ def access_project_secret_version(name, fields: nil, quota_user: nil, options: nil, &block)
1064
+ command = make_simple_command(:get, 'v1beta2/{+name}:access', options)
1065
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse::Representation
1066
+ command.response_class = Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse
1067
+ command.params['name'] = name unless name.nil?
1068
+ command.query['fields'] = fields unless fields.nil?
1069
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1070
+ execute_or_queue_command(command, &block)
1071
+ end
1072
+
1073
+ # Destroys a SecretVersion. Sets the state of the SecretVersion to DESTROYED and
1074
+ # irrevocably destroys the secret data.
1075
+ # @param [String] name
1076
+ # Required. The resource name of the SecretVersion to destroy in the format `
1077
+ # projects/*/secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/
1078
+ # *`.
1079
+ # @param [Google::Apis::SecretmanagerV1beta2::DestroySecretVersionRequest] destroy_secret_version_request_object
1080
+ # @param [String] fields
1081
+ # Selector specifying which fields to include in a partial response.
1082
+ # @param [String] quota_user
1083
+ # Available to use for quota purposes for server-side applications. Can be any
1084
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1085
+ # @param [Google::Apis::RequestOptions] options
1086
+ # Request-specific options
1087
+ #
1088
+ # @yield [result, err] Result & error if block supplied
1089
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::SecretVersion] parsed result object
1090
+ # @yieldparam err [StandardError] error object if request failed
1091
+ #
1092
+ # @return [Google::Apis::SecretmanagerV1beta2::SecretVersion]
1093
+ #
1094
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1095
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1096
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1097
+ def destroy_project_secret_version(name, destroy_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1098
+ command = make_simple_command(:post, 'v1beta2/{+name}:destroy', options)
1099
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::DestroySecretVersionRequest::Representation
1100
+ command.request_object = destroy_secret_version_request_object
1101
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
1102
+ command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
1103
+ command.params['name'] = name unless name.nil?
1104
+ command.query['fields'] = fields unless fields.nil?
1105
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1106
+ execute_or_queue_command(command, &block)
1107
+ end
1108
+
1109
+ # Disables a SecretVersion. Sets the state of the SecretVersion to DISABLED.
1110
+ # @param [String] name
1111
+ # Required. The resource name of the SecretVersion to disable in the format `
1112
+ # projects/*/secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/
1113
+ # *`.
1114
+ # @param [Google::Apis::SecretmanagerV1beta2::DisableSecretVersionRequest] disable_secret_version_request_object
1115
+ # @param [String] fields
1116
+ # Selector specifying which fields to include in a partial response.
1117
+ # @param [String] quota_user
1118
+ # Available to use for quota purposes for server-side applications. Can be any
1119
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1120
+ # @param [Google::Apis::RequestOptions] options
1121
+ # Request-specific options
1122
+ #
1123
+ # @yield [result, err] Result & error if block supplied
1124
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::SecretVersion] parsed result object
1125
+ # @yieldparam err [StandardError] error object if request failed
1126
+ #
1127
+ # @return [Google::Apis::SecretmanagerV1beta2::SecretVersion]
1128
+ #
1129
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1130
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1131
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1132
+ def disable_project_secret_version(name, disable_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1133
+ command = make_simple_command(:post, 'v1beta2/{+name}:disable', options)
1134
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::DisableSecretVersionRequest::Representation
1135
+ command.request_object = disable_secret_version_request_object
1136
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
1137
+ command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
1138
+ command.params['name'] = name unless name.nil?
1139
+ command.query['fields'] = fields unless fields.nil?
1140
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1141
+ execute_or_queue_command(command, &block)
1142
+ end
1143
+
1144
+ # Enables a SecretVersion. Sets the state of the SecretVersion to ENABLED.
1145
+ # @param [String] name
1146
+ # Required. The resource name of the SecretVersion to enable in the format `
1147
+ # projects/*/secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/
1148
+ # *`.
1149
+ # @param [Google::Apis::SecretmanagerV1beta2::EnableSecretVersionRequest] enable_secret_version_request_object
1150
+ # @param [String] fields
1151
+ # Selector specifying which fields to include in a partial response.
1152
+ # @param [String] quota_user
1153
+ # Available to use for quota purposes for server-side applications. Can be any
1154
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1155
+ # @param [Google::Apis::RequestOptions] options
1156
+ # Request-specific options
1157
+ #
1158
+ # @yield [result, err] Result & error if block supplied
1159
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::SecretVersion] parsed result object
1160
+ # @yieldparam err [StandardError] error object if request failed
1161
+ #
1162
+ # @return [Google::Apis::SecretmanagerV1beta2::SecretVersion]
1163
+ #
1164
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1165
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1166
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1167
+ def enable_project_secret_version(name, enable_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1168
+ command = make_simple_command(:post, 'v1beta2/{+name}:enable', options)
1169
+ command.request_representation = Google::Apis::SecretmanagerV1beta2::EnableSecretVersionRequest::Representation
1170
+ command.request_object = enable_secret_version_request_object
1171
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
1172
+ command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
1173
+ command.params['name'] = name unless name.nil?
1174
+ command.query['fields'] = fields unless fields.nil?
1175
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1176
+ execute_or_queue_command(command, &block)
1177
+ end
1178
+
1179
+ # Gets metadata for a SecretVersion. `projects/*/secrets/*/versions/latest` is
1180
+ # an alias to the most recently created SecretVersion.
1181
+ # @param [String] name
1182
+ # Required. The resource name of the SecretVersion in the format `projects/*/
1183
+ # secrets/*/versions/*` or `projects/*/locations/*/secrets/*/versions/*`. `
1184
+ # projects/*/secrets/*/versions/latest` or `projects/*/locations/*/secrets/*/
1185
+ # versions/latest` is an alias to the most recently created SecretVersion.
1186
+ # @param [String] fields
1187
+ # Selector specifying which fields to include in a partial response.
1188
+ # @param [String] quota_user
1189
+ # Available to use for quota purposes for server-side applications. Can be any
1190
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1191
+ # @param [Google::Apis::RequestOptions] options
1192
+ # Request-specific options
1193
+ #
1194
+ # @yield [result, err] Result & error if block supplied
1195
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::SecretVersion] parsed result object
1196
+ # @yieldparam err [StandardError] error object if request failed
1197
+ #
1198
+ # @return [Google::Apis::SecretmanagerV1beta2::SecretVersion]
1199
+ #
1200
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1201
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1202
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1203
+ def get_project_secret_version(name, fields: nil, quota_user: nil, options: nil, &block)
1204
+ command = make_simple_command(:get, 'v1beta2/{+name}', options)
1205
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
1206
+ command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
1207
+ command.params['name'] = name unless name.nil?
1208
+ command.query['fields'] = fields unless fields.nil?
1209
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1210
+ execute_or_queue_command(command, &block)
1211
+ end
1212
+
1213
+ # Lists SecretVersions. This call does not return secret data.
1214
+ # @param [String] parent
1215
+ # Required. The resource name of the Secret associated with the SecretVersions
1216
+ # to list, in the format `projects/*/secrets/*` or `projects/*/locations/*/
1217
+ # secrets/*`.
1218
+ # @param [String] filter
1219
+ # Optional. Filter string, adhering to the rules in [List-operation filtering](
1220
+ # https://cloud.google.com/secret-manager/docs/filtering). List only secret
1221
+ # versions matching the filter. If filter is empty, all secret versions are
1222
+ # listed.
1223
+ # @param [Fixnum] page_size
1224
+ # Optional. The maximum number of results to be returned in a single page. If
1225
+ # set to 0, the server decides the number of results to return. If the number is
1226
+ # greater than 25000, it is capped at 25000.
1227
+ # @param [String] page_token
1228
+ # Optional. Pagination token, returned earlier via ListSecretVersionsResponse.
1229
+ # next_page_token][].
1230
+ # @param [String] fields
1231
+ # Selector specifying which fields to include in a partial response.
1232
+ # @param [String] quota_user
1233
+ # Available to use for quota purposes for server-side applications. Can be any
1234
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1235
+ # @param [Google::Apis::RequestOptions] options
1236
+ # Request-specific options
1237
+ #
1238
+ # @yield [result, err] Result & error if block supplied
1239
+ # @yieldparam result [Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse] parsed result object
1240
+ # @yieldparam err [StandardError] error object if request failed
1241
+ #
1242
+ # @return [Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse]
1243
+ #
1244
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1245
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1246
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1247
+ def list_project_secret_versions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1248
+ command = make_simple_command(:get, 'v1beta2/{+parent}/versions', options)
1249
+ command.response_representation = Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse::Representation
1250
+ command.response_class = Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse
1251
+ command.params['parent'] = parent unless parent.nil?
1252
+ command.query['filter'] = filter unless filter.nil?
1253
+ command.query['pageSize'] = page_size unless page_size.nil?
1254
+ command.query['pageToken'] = page_token unless page_token.nil?
1255
+ command.query['fields'] = fields unless fields.nil?
1256
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1257
+ execute_or_queue_command(command, &block)
1258
+ end
1259
+
1260
+ protected
1261
+
1262
+ def apply_command_defaults(command)
1263
+ command.query['key'] = key unless key.nil?
1264
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1265
+ end
1266
+ end
1267
+ end
1268
+ end
1269
+ end