google-apis-cloudkms_v1 0.1.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.
@@ -0,0 +1,1352 @@
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 CloudkmsV1
23
+ # Cloud Key Management Service (KMS) API
24
+ #
25
+ # Manages keys and performs cryptographic operations in a central cloud service,
26
+ # for direct use by other cloud resources and applications.
27
+ #
28
+ # @example
29
+ # require 'google/apis/cloudkms_v1'
30
+ #
31
+ # Cloudkms = Google::Apis::CloudkmsV1 # Alias the module
32
+ # service = Cloudkms::CloudKMSService.new
33
+ #
34
+ # @see https://cloud.google.com/kms/
35
+ class CloudKMSService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://cloudkms.googleapis.com/', '',
48
+ client_name: 'google-apis-cloudkms_v1',
49
+ client_version: Google::Apis::CloudkmsV1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Gets information about a location.
54
+ # @param [String] name
55
+ # Resource name for the location.
56
+ # @param [String] fields
57
+ # Selector specifying which fields to include in a partial response.
58
+ # @param [String] quota_user
59
+ # Available to use for quota purposes for server-side applications. Can be any
60
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
61
+ # @param [Google::Apis::RequestOptions] options
62
+ # Request-specific options
63
+ #
64
+ # @yield [result, err] Result & error if block supplied
65
+ # @yieldparam result [Google::Apis::CloudkmsV1::Location] parsed result object
66
+ # @yieldparam err [StandardError] error object if request failed
67
+ #
68
+ # @return [Google::Apis::CloudkmsV1::Location]
69
+ #
70
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
71
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
72
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
73
+ def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
74
+ command = make_simple_command(:get, 'v1/{+name}', options)
75
+ command.response_representation = Google::Apis::CloudkmsV1::Location::Representation
76
+ command.response_class = Google::Apis::CloudkmsV1::Location
77
+ command.params['name'] = name unless name.nil?
78
+ command.query['fields'] = fields unless fields.nil?
79
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
80
+ execute_or_queue_command(command, &block)
81
+ end
82
+
83
+ # Lists information about the supported locations for this service.
84
+ # @param [String] name
85
+ # The resource that owns the locations collection, if applicable.
86
+ # @param [String] filter
87
+ # The standard list filter.
88
+ # @param [Fixnum] page_size
89
+ # The standard list page size.
90
+ # @param [String] page_token
91
+ # The standard list page token.
92
+ # @param [String] fields
93
+ # Selector specifying which fields to include in a partial response.
94
+ # @param [String] quota_user
95
+ # Available to use for quota purposes for server-side applications. Can be any
96
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
97
+ # @param [Google::Apis::RequestOptions] options
98
+ # Request-specific options
99
+ #
100
+ # @yield [result, err] Result & error if block supplied
101
+ # @yieldparam result [Google::Apis::CloudkmsV1::ListLocationsResponse] parsed result object
102
+ # @yieldparam err [StandardError] error object if request failed
103
+ #
104
+ # @return [Google::Apis::CloudkmsV1::ListLocationsResponse]
105
+ #
106
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
107
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
108
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
109
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
110
+ command = make_simple_command(:get, 'v1/{+name}/locations', options)
111
+ command.response_representation = Google::Apis::CloudkmsV1::ListLocationsResponse::Representation
112
+ command.response_class = Google::Apis::CloudkmsV1::ListLocationsResponse
113
+ command.params['name'] = name unless name.nil?
114
+ command.query['filter'] = filter unless filter.nil?
115
+ command.query['pageSize'] = page_size unless page_size.nil?
116
+ command.query['pageToken'] = page_token unless page_token.nil?
117
+ command.query['fields'] = fields unless fields.nil?
118
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
119
+ execute_or_queue_command(command, &block)
120
+ end
121
+
122
+ # Create a new KeyRing in a given Project and Location.
123
+ # @param [String] parent
124
+ # Required. The resource name of the location associated with the KeyRings, in
125
+ # the format `projects/*/locations/*`.
126
+ # @param [Google::Apis::CloudkmsV1::KeyRing] key_ring_object
127
+ # @param [String] key_ring_id
128
+ # Required. It must be unique within a location and match the regular expression
129
+ # `[a-zA-Z0-9_-]`1,63``
130
+ # @param [String] fields
131
+ # Selector specifying which fields to include in a partial response.
132
+ # @param [String] quota_user
133
+ # Available to use for quota purposes for server-side applications. Can be any
134
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
135
+ # @param [Google::Apis::RequestOptions] options
136
+ # Request-specific options
137
+ #
138
+ # @yield [result, err] Result & error if block supplied
139
+ # @yieldparam result [Google::Apis::CloudkmsV1::KeyRing] parsed result object
140
+ # @yieldparam err [StandardError] error object if request failed
141
+ #
142
+ # @return [Google::Apis::CloudkmsV1::KeyRing]
143
+ #
144
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
145
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
146
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
147
+ def create_project_location_key_ring(parent, key_ring_object = nil, key_ring_id: nil, fields: nil, quota_user: nil, options: nil, &block)
148
+ command = make_simple_command(:post, 'v1/{+parent}/keyRings', options)
149
+ command.request_representation = Google::Apis::CloudkmsV1::KeyRing::Representation
150
+ command.request_object = key_ring_object
151
+ command.response_representation = Google::Apis::CloudkmsV1::KeyRing::Representation
152
+ command.response_class = Google::Apis::CloudkmsV1::KeyRing
153
+ command.params['parent'] = parent unless parent.nil?
154
+ command.query['keyRingId'] = key_ring_id unless key_ring_id.nil?
155
+ command.query['fields'] = fields unless fields.nil?
156
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
157
+ execute_or_queue_command(command, &block)
158
+ end
159
+
160
+ # Returns metadata for a given KeyRing.
161
+ # @param [String] name
162
+ # Required. The name of the KeyRing to get.
163
+ # @param [String] fields
164
+ # Selector specifying which fields to include in a partial response.
165
+ # @param [String] quota_user
166
+ # Available to use for quota purposes for server-side applications. Can be any
167
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
168
+ # @param [Google::Apis::RequestOptions] options
169
+ # Request-specific options
170
+ #
171
+ # @yield [result, err] Result & error if block supplied
172
+ # @yieldparam result [Google::Apis::CloudkmsV1::KeyRing] parsed result object
173
+ # @yieldparam err [StandardError] error object if request failed
174
+ #
175
+ # @return [Google::Apis::CloudkmsV1::KeyRing]
176
+ #
177
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
178
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
179
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
180
+ def get_project_location_key_ring(name, fields: nil, quota_user: nil, options: nil, &block)
181
+ command = make_simple_command(:get, 'v1/{+name}', options)
182
+ command.response_representation = Google::Apis::CloudkmsV1::KeyRing::Representation
183
+ command.response_class = Google::Apis::CloudkmsV1::KeyRing
184
+ command.params['name'] = name unless name.nil?
185
+ command.query['fields'] = fields unless fields.nil?
186
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
187
+ execute_or_queue_command(command, &block)
188
+ end
189
+
190
+ # Gets the access control policy for a resource. Returns an empty policy if the
191
+ # resource exists and does not have a policy set.
192
+ # @param [String] resource
193
+ # REQUIRED: The resource for which the policy is being requested. See the
194
+ # operation documentation for the appropriate value for this field.
195
+ # @param [Fixnum] options_requested_policy_version
196
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
197
+ # 3. Requests specifying an invalid value will be rejected. Requests for
198
+ # policies with any conditional bindings must specify version 3. Policies
199
+ # without any conditional bindings may specify any valid value or leave the
200
+ # field unset. To learn which resources support conditions in their IAM policies,
201
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
202
+ # resource-policies).
203
+ # @param [String] fields
204
+ # Selector specifying which fields to include in a partial response.
205
+ # @param [String] quota_user
206
+ # Available to use for quota purposes for server-side applications. Can be any
207
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
208
+ # @param [Google::Apis::RequestOptions] options
209
+ # Request-specific options
210
+ #
211
+ # @yield [result, err] Result & error if block supplied
212
+ # @yieldparam result [Google::Apis::CloudkmsV1::Policy] parsed result object
213
+ # @yieldparam err [StandardError] error object if request failed
214
+ #
215
+ # @return [Google::Apis::CloudkmsV1::Policy]
216
+ #
217
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
218
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
219
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
220
+ def get_project_location_key_ring_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
221
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
222
+ command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
223
+ command.response_class = Google::Apis::CloudkmsV1::Policy
224
+ command.params['resource'] = resource unless resource.nil?
225
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
226
+ command.query['fields'] = fields unless fields.nil?
227
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
228
+ execute_or_queue_command(command, &block)
229
+ end
230
+
231
+ # Lists KeyRings.
232
+ # @param [String] parent
233
+ # Required. The resource name of the location associated with the KeyRings, in
234
+ # the format `projects/*/locations/*`.
235
+ # @param [String] filter
236
+ # Optional. Only include resources that match the filter in the response. For
237
+ # more information, see [Sorting and filtering list results](https://cloud.
238
+ # google.com/kms/docs/sorting-and-filtering).
239
+ # @param [String] order_by
240
+ # Optional. Specify how the results should be sorted. If not specified, the
241
+ # results will be sorted in the default order. For more information, see [
242
+ # Sorting and filtering list results](https://cloud.google.com/kms/docs/sorting-
243
+ # and-filtering).
244
+ # @param [Fixnum] page_size
245
+ # Optional. Optional limit on the number of KeyRings to include in the response.
246
+ # Further KeyRings can subsequently be obtained by including the
247
+ # ListKeyRingsResponse.next_page_token in a subsequent request. If unspecified,
248
+ # the server will pick an appropriate default.
249
+ # @param [String] page_token
250
+ # Optional. Optional pagination token, returned earlier via ListKeyRingsResponse.
251
+ # next_page_token.
252
+ # @param [String] fields
253
+ # Selector specifying which fields to include in a partial response.
254
+ # @param [String] quota_user
255
+ # Available to use for quota purposes for server-side applications. Can be any
256
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
257
+ # @param [Google::Apis::RequestOptions] options
258
+ # Request-specific options
259
+ #
260
+ # @yield [result, err] Result & error if block supplied
261
+ # @yieldparam result [Google::Apis::CloudkmsV1::ListKeyRingsResponse] parsed result object
262
+ # @yieldparam err [StandardError] error object if request failed
263
+ #
264
+ # @return [Google::Apis::CloudkmsV1::ListKeyRingsResponse]
265
+ #
266
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
267
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
268
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
269
+ def list_project_location_key_rings(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
270
+ command = make_simple_command(:get, 'v1/{+parent}/keyRings', options)
271
+ command.response_representation = Google::Apis::CloudkmsV1::ListKeyRingsResponse::Representation
272
+ command.response_class = Google::Apis::CloudkmsV1::ListKeyRingsResponse
273
+ command.params['parent'] = parent unless parent.nil?
274
+ command.query['filter'] = filter unless filter.nil?
275
+ command.query['orderBy'] = order_by unless order_by.nil?
276
+ command.query['pageSize'] = page_size unless page_size.nil?
277
+ command.query['pageToken'] = page_token unless page_token.nil?
278
+ command.query['fields'] = fields unless fields.nil?
279
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
280
+ execute_or_queue_command(command, &block)
281
+ end
282
+
283
+ # Sets the access control policy on the specified resource. Replaces any
284
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
285
+ # PERMISSION_DENIED` errors.
286
+ # @param [String] resource
287
+ # REQUIRED: The resource for which the policy is being specified. See the
288
+ # operation documentation for the appropriate value for this field.
289
+ # @param [Google::Apis::CloudkmsV1::SetIamPolicyRequest] set_iam_policy_request_object
290
+ # @param [String] fields
291
+ # Selector specifying which fields to include in a partial response.
292
+ # @param [String] quota_user
293
+ # Available to use for quota purposes for server-side applications. Can be any
294
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
295
+ # @param [Google::Apis::RequestOptions] options
296
+ # Request-specific options
297
+ #
298
+ # @yield [result, err] Result & error if block supplied
299
+ # @yieldparam result [Google::Apis::CloudkmsV1::Policy] parsed result object
300
+ # @yieldparam err [StandardError] error object if request failed
301
+ #
302
+ # @return [Google::Apis::CloudkmsV1::Policy]
303
+ #
304
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
305
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
306
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
307
+ def set_key_ring_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
308
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
309
+ command.request_representation = Google::Apis::CloudkmsV1::SetIamPolicyRequest::Representation
310
+ command.request_object = set_iam_policy_request_object
311
+ command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
312
+ command.response_class = Google::Apis::CloudkmsV1::Policy
313
+ command.params['resource'] = resource unless resource.nil?
314
+ command.query['fields'] = fields unless fields.nil?
315
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
316
+ execute_or_queue_command(command, &block)
317
+ end
318
+
319
+ # Returns permissions that a caller has on the specified resource. If the
320
+ # resource does not exist, this will return an empty set of permissions, not a `
321
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
322
+ # permission-aware UIs and command-line tools, not for authorization checking.
323
+ # This operation may "fail open" without warning.
324
+ # @param [String] resource
325
+ # REQUIRED: The resource for which the policy detail is being requested. See the
326
+ # operation documentation for the appropriate value for this field.
327
+ # @param [Google::Apis::CloudkmsV1::TestIamPermissionsRequest] test_iam_permissions_request_object
328
+ # @param [String] fields
329
+ # Selector specifying which fields to include in a partial response.
330
+ # @param [String] quota_user
331
+ # Available to use for quota purposes for server-side applications. Can be any
332
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
333
+ # @param [Google::Apis::RequestOptions] options
334
+ # Request-specific options
335
+ #
336
+ # @yield [result, err] Result & error if block supplied
337
+ # @yieldparam result [Google::Apis::CloudkmsV1::TestIamPermissionsResponse] parsed result object
338
+ # @yieldparam err [StandardError] error object if request failed
339
+ #
340
+ # @return [Google::Apis::CloudkmsV1::TestIamPermissionsResponse]
341
+ #
342
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
343
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
344
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
345
+ def test_key_ring_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
346
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
347
+ command.request_representation = Google::Apis::CloudkmsV1::TestIamPermissionsRequest::Representation
348
+ command.request_object = test_iam_permissions_request_object
349
+ command.response_representation = Google::Apis::CloudkmsV1::TestIamPermissionsResponse::Representation
350
+ command.response_class = Google::Apis::CloudkmsV1::TestIamPermissionsResponse
351
+ command.params['resource'] = resource unless resource.nil?
352
+ command.query['fields'] = fields unless fields.nil?
353
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
354
+ execute_or_queue_command(command, &block)
355
+ end
356
+
357
+ # Create a new CryptoKey within a KeyRing. CryptoKey.purpose and CryptoKey.
358
+ # version_template.algorithm are required.
359
+ # @param [String] parent
360
+ # Required. The name of the KeyRing associated with the CryptoKeys.
361
+ # @param [Google::Apis::CloudkmsV1::CryptoKey] crypto_key_object
362
+ # @param [String] crypto_key_id
363
+ # Required. It must be unique within a KeyRing and match the regular expression `
364
+ # [a-zA-Z0-9_-]`1,63``
365
+ # @param [Boolean] skip_initial_version_creation
366
+ # If set to true, the request will create a CryptoKey without any
367
+ # CryptoKeyVersions. You must manually call CreateCryptoKeyVersion or
368
+ # ImportCryptoKeyVersion before you can use this CryptoKey.
369
+ # @param [String] fields
370
+ # Selector specifying which fields to include in a partial response.
371
+ # @param [String] quota_user
372
+ # Available to use for quota purposes for server-side applications. Can be any
373
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
374
+ # @param [Google::Apis::RequestOptions] options
375
+ # Request-specific options
376
+ #
377
+ # @yield [result, err] Result & error if block supplied
378
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKey] parsed result object
379
+ # @yieldparam err [StandardError] error object if request failed
380
+ #
381
+ # @return [Google::Apis::CloudkmsV1::CryptoKey]
382
+ #
383
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
384
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
385
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
386
+ def create_project_location_key_ring_crypto_key(parent, crypto_key_object = nil, crypto_key_id: nil, skip_initial_version_creation: nil, fields: nil, quota_user: nil, options: nil, &block)
387
+ command = make_simple_command(:post, 'v1/{+parent}/cryptoKeys', options)
388
+ command.request_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
389
+ command.request_object = crypto_key_object
390
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
391
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKey
392
+ command.params['parent'] = parent unless parent.nil?
393
+ command.query['cryptoKeyId'] = crypto_key_id unless crypto_key_id.nil?
394
+ command.query['skipInitialVersionCreation'] = skip_initial_version_creation unless skip_initial_version_creation.nil?
395
+ command.query['fields'] = fields unless fields.nil?
396
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
397
+ execute_or_queue_command(command, &block)
398
+ end
399
+
400
+ # Decrypts data that was protected by Encrypt. The CryptoKey.purpose must be
401
+ # ENCRYPT_DECRYPT.
402
+ # @param [String] name
403
+ # Required. The resource name of the CryptoKey to use for decryption. The server
404
+ # will choose the appropriate version.
405
+ # @param [Google::Apis::CloudkmsV1::DecryptRequest] decrypt_request_object
406
+ # @param [String] fields
407
+ # Selector specifying which fields to include in a partial response.
408
+ # @param [String] quota_user
409
+ # Available to use for quota purposes for server-side applications. Can be any
410
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
411
+ # @param [Google::Apis::RequestOptions] options
412
+ # Request-specific options
413
+ #
414
+ # @yield [result, err] Result & error if block supplied
415
+ # @yieldparam result [Google::Apis::CloudkmsV1::DecryptResponse] parsed result object
416
+ # @yieldparam err [StandardError] error object if request failed
417
+ #
418
+ # @return [Google::Apis::CloudkmsV1::DecryptResponse]
419
+ #
420
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
421
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
422
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
423
+ def decrypt_crypto_key(name, decrypt_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
424
+ command = make_simple_command(:post, 'v1/{+name}:decrypt', options)
425
+ command.request_representation = Google::Apis::CloudkmsV1::DecryptRequest::Representation
426
+ command.request_object = decrypt_request_object
427
+ command.response_representation = Google::Apis::CloudkmsV1::DecryptResponse::Representation
428
+ command.response_class = Google::Apis::CloudkmsV1::DecryptResponse
429
+ command.params['name'] = name unless name.nil?
430
+ command.query['fields'] = fields unless fields.nil?
431
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
432
+ execute_or_queue_command(command, &block)
433
+ end
434
+
435
+ # Encrypts data, so that it can only be recovered by a call to Decrypt. The
436
+ # CryptoKey.purpose must be ENCRYPT_DECRYPT.
437
+ # @param [String] name
438
+ # Required. The resource name of the CryptoKey or CryptoKeyVersion to use for
439
+ # encryption. If a CryptoKey is specified, the server will use its primary
440
+ # version.
441
+ # @param [Google::Apis::CloudkmsV1::EncryptRequest] encrypt_request_object
442
+ # @param [String] fields
443
+ # Selector specifying which fields to include in a partial response.
444
+ # @param [String] quota_user
445
+ # Available to use for quota purposes for server-side applications. Can be any
446
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
447
+ # @param [Google::Apis::RequestOptions] options
448
+ # Request-specific options
449
+ #
450
+ # @yield [result, err] Result & error if block supplied
451
+ # @yieldparam result [Google::Apis::CloudkmsV1::EncryptResponse] parsed result object
452
+ # @yieldparam err [StandardError] error object if request failed
453
+ #
454
+ # @return [Google::Apis::CloudkmsV1::EncryptResponse]
455
+ #
456
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
457
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
458
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
459
+ def encrypt_crypto_key(name, encrypt_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
460
+ command = make_simple_command(:post, 'v1/{+name}:encrypt', options)
461
+ command.request_representation = Google::Apis::CloudkmsV1::EncryptRequest::Representation
462
+ command.request_object = encrypt_request_object
463
+ command.response_representation = Google::Apis::CloudkmsV1::EncryptResponse::Representation
464
+ command.response_class = Google::Apis::CloudkmsV1::EncryptResponse
465
+ command.params['name'] = name unless name.nil?
466
+ command.query['fields'] = fields unless fields.nil?
467
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
468
+ execute_or_queue_command(command, &block)
469
+ end
470
+
471
+ # Returns metadata for a given CryptoKey, as well as its primary
472
+ # CryptoKeyVersion.
473
+ # @param [String] name
474
+ # Required. The name of the CryptoKey to get.
475
+ # @param [String] fields
476
+ # Selector specifying which fields to include in a partial response.
477
+ # @param [String] quota_user
478
+ # Available to use for quota purposes for server-side applications. Can be any
479
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
480
+ # @param [Google::Apis::RequestOptions] options
481
+ # Request-specific options
482
+ #
483
+ # @yield [result, err] Result & error if block supplied
484
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKey] parsed result object
485
+ # @yieldparam err [StandardError] error object if request failed
486
+ #
487
+ # @return [Google::Apis::CloudkmsV1::CryptoKey]
488
+ #
489
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
490
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
491
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
492
+ def get_project_location_key_ring_crypto_key(name, fields: nil, quota_user: nil, options: nil, &block)
493
+ command = make_simple_command(:get, 'v1/{+name}', options)
494
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
495
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKey
496
+ command.params['name'] = name unless name.nil?
497
+ command.query['fields'] = fields unless fields.nil?
498
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
499
+ execute_or_queue_command(command, &block)
500
+ end
501
+
502
+ # Gets the access control policy for a resource. Returns an empty policy if the
503
+ # resource exists and does not have a policy set.
504
+ # @param [String] resource
505
+ # REQUIRED: The resource for which the policy is being requested. See the
506
+ # operation documentation for the appropriate value for this field.
507
+ # @param [Fixnum] options_requested_policy_version
508
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
509
+ # 3. Requests specifying an invalid value will be rejected. Requests for
510
+ # policies with any conditional bindings must specify version 3. Policies
511
+ # without any conditional bindings may specify any valid value or leave the
512
+ # field unset. To learn which resources support conditions in their IAM policies,
513
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
514
+ # resource-policies).
515
+ # @param [String] fields
516
+ # Selector specifying which fields to include in a partial response.
517
+ # @param [String] quota_user
518
+ # Available to use for quota purposes for server-side applications. Can be any
519
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
520
+ # @param [Google::Apis::RequestOptions] options
521
+ # Request-specific options
522
+ #
523
+ # @yield [result, err] Result & error if block supplied
524
+ # @yieldparam result [Google::Apis::CloudkmsV1::Policy] parsed result object
525
+ # @yieldparam err [StandardError] error object if request failed
526
+ #
527
+ # @return [Google::Apis::CloudkmsV1::Policy]
528
+ #
529
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
530
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
531
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
532
+ def get_project_location_key_ring_crypto_key_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
533
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
534
+ command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
535
+ command.response_class = Google::Apis::CloudkmsV1::Policy
536
+ command.params['resource'] = resource unless resource.nil?
537
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.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
+ # Lists CryptoKeys.
544
+ # @param [String] parent
545
+ # Required. The resource name of the KeyRing to list, in the format `projects/*/
546
+ # locations/*/keyRings/*`.
547
+ # @param [String] filter
548
+ # Optional. Only include resources that match the filter in the response. For
549
+ # more information, see [Sorting and filtering list results](https://cloud.
550
+ # google.com/kms/docs/sorting-and-filtering).
551
+ # @param [String] order_by
552
+ # Optional. Specify how the results should be sorted. If not specified, the
553
+ # results will be sorted in the default order. For more information, see [
554
+ # Sorting and filtering list results](https://cloud.google.com/kms/docs/sorting-
555
+ # and-filtering).
556
+ # @param [Fixnum] page_size
557
+ # Optional. Optional limit on the number of CryptoKeys to include in the
558
+ # response. Further CryptoKeys can subsequently be obtained by including the
559
+ # ListCryptoKeysResponse.next_page_token in a subsequent request. If unspecified,
560
+ # the server will pick an appropriate default.
561
+ # @param [String] page_token
562
+ # Optional. Optional pagination token, returned earlier via
563
+ # ListCryptoKeysResponse.next_page_token.
564
+ # @param [String] version_view
565
+ # The fields of the primary version to include in the response.
566
+ # @param [String] fields
567
+ # Selector specifying which fields to include in a partial response.
568
+ # @param [String] quota_user
569
+ # Available to use for quota purposes for server-side applications. Can be any
570
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
571
+ # @param [Google::Apis::RequestOptions] options
572
+ # Request-specific options
573
+ #
574
+ # @yield [result, err] Result & error if block supplied
575
+ # @yieldparam result [Google::Apis::CloudkmsV1::ListCryptoKeysResponse] parsed result object
576
+ # @yieldparam err [StandardError] error object if request failed
577
+ #
578
+ # @return [Google::Apis::CloudkmsV1::ListCryptoKeysResponse]
579
+ #
580
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
581
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
582
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
583
+ def list_project_location_key_ring_crypto_keys(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, version_view: nil, fields: nil, quota_user: nil, options: nil, &block)
584
+ command = make_simple_command(:get, 'v1/{+parent}/cryptoKeys', options)
585
+ command.response_representation = Google::Apis::CloudkmsV1::ListCryptoKeysResponse::Representation
586
+ command.response_class = Google::Apis::CloudkmsV1::ListCryptoKeysResponse
587
+ command.params['parent'] = parent unless parent.nil?
588
+ command.query['filter'] = filter unless filter.nil?
589
+ command.query['orderBy'] = order_by unless order_by.nil?
590
+ command.query['pageSize'] = page_size unless page_size.nil?
591
+ command.query['pageToken'] = page_token unless page_token.nil?
592
+ command.query['versionView'] = version_view unless version_view.nil?
593
+ command.query['fields'] = fields unless fields.nil?
594
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
595
+ execute_or_queue_command(command, &block)
596
+ end
597
+
598
+ # Update a CryptoKey.
599
+ # @param [String] name
600
+ # Output only. The resource name for this CryptoKey in the format `projects/*/
601
+ # locations/*/keyRings/*/cryptoKeys/*`.
602
+ # @param [Google::Apis::CloudkmsV1::CryptoKey] crypto_key_object
603
+ # @param [String] update_mask
604
+ # Required. List of fields to be updated in this request.
605
+ # @param [String] fields
606
+ # Selector specifying which fields to include in a partial response.
607
+ # @param [String] quota_user
608
+ # Available to use for quota purposes for server-side applications. Can be any
609
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
610
+ # @param [Google::Apis::RequestOptions] options
611
+ # Request-specific options
612
+ #
613
+ # @yield [result, err] Result & error if block supplied
614
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKey] parsed result object
615
+ # @yieldparam err [StandardError] error object if request failed
616
+ #
617
+ # @return [Google::Apis::CloudkmsV1::CryptoKey]
618
+ #
619
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
620
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
621
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
622
+ def patch_project_location_key_ring_crypto_key(name, crypto_key_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
623
+ command = make_simple_command(:patch, 'v1/{+name}', options)
624
+ command.request_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
625
+ command.request_object = crypto_key_object
626
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
627
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKey
628
+ command.params['name'] = name unless name.nil?
629
+ command.query['updateMask'] = update_mask unless update_mask.nil?
630
+ command.query['fields'] = fields unless fields.nil?
631
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
632
+ execute_or_queue_command(command, &block)
633
+ end
634
+
635
+ # Sets the access control policy on the specified resource. Replaces any
636
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
637
+ # PERMISSION_DENIED` errors.
638
+ # @param [String] resource
639
+ # REQUIRED: The resource for which the policy is being specified. See the
640
+ # operation documentation for the appropriate value for this field.
641
+ # @param [Google::Apis::CloudkmsV1::SetIamPolicyRequest] set_iam_policy_request_object
642
+ # @param [String] fields
643
+ # Selector specifying which fields to include in a partial response.
644
+ # @param [String] quota_user
645
+ # Available to use for quota purposes for server-side applications. Can be any
646
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
647
+ # @param [Google::Apis::RequestOptions] options
648
+ # Request-specific options
649
+ #
650
+ # @yield [result, err] Result & error if block supplied
651
+ # @yieldparam result [Google::Apis::CloudkmsV1::Policy] parsed result object
652
+ # @yieldparam err [StandardError] error object if request failed
653
+ #
654
+ # @return [Google::Apis::CloudkmsV1::Policy]
655
+ #
656
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
657
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
658
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
659
+ def set_crypto_key_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
660
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
661
+ command.request_representation = Google::Apis::CloudkmsV1::SetIamPolicyRequest::Representation
662
+ command.request_object = set_iam_policy_request_object
663
+ command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
664
+ command.response_class = Google::Apis::CloudkmsV1::Policy
665
+ command.params['resource'] = resource unless resource.nil?
666
+ command.query['fields'] = fields unless fields.nil?
667
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
668
+ execute_or_queue_command(command, &block)
669
+ end
670
+
671
+ # Returns permissions that a caller has on the specified resource. If the
672
+ # resource does not exist, this will return an empty set of permissions, not a `
673
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
674
+ # permission-aware UIs and command-line tools, not for authorization checking.
675
+ # This operation may "fail open" without warning.
676
+ # @param [String] resource
677
+ # REQUIRED: The resource for which the policy detail is being requested. See the
678
+ # operation documentation for the appropriate value for this field.
679
+ # @param [Google::Apis::CloudkmsV1::TestIamPermissionsRequest] test_iam_permissions_request_object
680
+ # @param [String] fields
681
+ # Selector specifying which fields to include in a partial response.
682
+ # @param [String] quota_user
683
+ # Available to use for quota purposes for server-side applications. Can be any
684
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
685
+ # @param [Google::Apis::RequestOptions] options
686
+ # Request-specific options
687
+ #
688
+ # @yield [result, err] Result & error if block supplied
689
+ # @yieldparam result [Google::Apis::CloudkmsV1::TestIamPermissionsResponse] parsed result object
690
+ # @yieldparam err [StandardError] error object if request failed
691
+ #
692
+ # @return [Google::Apis::CloudkmsV1::TestIamPermissionsResponse]
693
+ #
694
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
695
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
696
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
697
+ def test_crypto_key_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
698
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
699
+ command.request_representation = Google::Apis::CloudkmsV1::TestIamPermissionsRequest::Representation
700
+ command.request_object = test_iam_permissions_request_object
701
+ command.response_representation = Google::Apis::CloudkmsV1::TestIamPermissionsResponse::Representation
702
+ command.response_class = Google::Apis::CloudkmsV1::TestIamPermissionsResponse
703
+ command.params['resource'] = resource unless resource.nil?
704
+ command.query['fields'] = fields unless fields.nil?
705
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
706
+ execute_or_queue_command(command, &block)
707
+ end
708
+
709
+ # Update the version of a CryptoKey that will be used in Encrypt. Returns an
710
+ # error if called on an asymmetric key.
711
+ # @param [String] name
712
+ # Required. The resource name of the CryptoKey to update.
713
+ # @param [Google::Apis::CloudkmsV1::UpdateCryptoKeyPrimaryVersionRequest] update_crypto_key_primary_version_request_object
714
+ # @param [String] fields
715
+ # Selector specifying which fields to include in a partial response.
716
+ # @param [String] quota_user
717
+ # Available to use for quota purposes for server-side applications. Can be any
718
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
719
+ # @param [Google::Apis::RequestOptions] options
720
+ # Request-specific options
721
+ #
722
+ # @yield [result, err] Result & error if block supplied
723
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKey] parsed result object
724
+ # @yieldparam err [StandardError] error object if request failed
725
+ #
726
+ # @return [Google::Apis::CloudkmsV1::CryptoKey]
727
+ #
728
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
729
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
730
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
731
+ def update_project_location_key_ring_crypto_key_primary_version(name, update_crypto_key_primary_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
732
+ command = make_simple_command(:post, 'v1/{+name}:updatePrimaryVersion', options)
733
+ command.request_representation = Google::Apis::CloudkmsV1::UpdateCryptoKeyPrimaryVersionRequest::Representation
734
+ command.request_object = update_crypto_key_primary_version_request_object
735
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
736
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKey
737
+ command.params['name'] = name unless name.nil?
738
+ command.query['fields'] = fields unless fields.nil?
739
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
740
+ execute_or_queue_command(command, &block)
741
+ end
742
+
743
+ # Decrypts data that was encrypted with a public key retrieved from GetPublicKey
744
+ # corresponding to a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_DECRYPT.
745
+ # @param [String] name
746
+ # Required. The resource name of the CryptoKeyVersion to use for decryption.
747
+ # @param [Google::Apis::CloudkmsV1::AsymmetricDecryptRequest] asymmetric_decrypt_request_object
748
+ # @param [String] fields
749
+ # Selector specifying which fields to include in a partial response.
750
+ # @param [String] quota_user
751
+ # Available to use for quota purposes for server-side applications. Can be any
752
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
753
+ # @param [Google::Apis::RequestOptions] options
754
+ # Request-specific options
755
+ #
756
+ # @yield [result, err] Result & error if block supplied
757
+ # @yieldparam result [Google::Apis::CloudkmsV1::AsymmetricDecryptResponse] parsed result object
758
+ # @yieldparam err [StandardError] error object if request failed
759
+ #
760
+ # @return [Google::Apis::CloudkmsV1::AsymmetricDecryptResponse]
761
+ #
762
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
763
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
764
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
765
+ def asymmetric_crypto_key_version_decrypt(name, asymmetric_decrypt_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
766
+ command = make_simple_command(:post, 'v1/{+name}:asymmetricDecrypt', options)
767
+ command.request_representation = Google::Apis::CloudkmsV1::AsymmetricDecryptRequest::Representation
768
+ command.request_object = asymmetric_decrypt_request_object
769
+ command.response_representation = Google::Apis::CloudkmsV1::AsymmetricDecryptResponse::Representation
770
+ command.response_class = Google::Apis::CloudkmsV1::AsymmetricDecryptResponse
771
+ command.params['name'] = name unless name.nil?
772
+ command.query['fields'] = fields unless fields.nil?
773
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
774
+ execute_or_queue_command(command, &block)
775
+ end
776
+
777
+ # Signs data using a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_SIGN,
778
+ # producing a signature that can be verified with the public key retrieved from
779
+ # GetPublicKey.
780
+ # @param [String] name
781
+ # Required. The resource name of the CryptoKeyVersion to use for signing.
782
+ # @param [Google::Apis::CloudkmsV1::AsymmetricSignRequest] asymmetric_sign_request_object
783
+ # @param [String] fields
784
+ # Selector specifying which fields to include in a partial response.
785
+ # @param [String] quota_user
786
+ # Available to use for quota purposes for server-side applications. Can be any
787
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
788
+ # @param [Google::Apis::RequestOptions] options
789
+ # Request-specific options
790
+ #
791
+ # @yield [result, err] Result & error if block supplied
792
+ # @yieldparam result [Google::Apis::CloudkmsV1::AsymmetricSignResponse] parsed result object
793
+ # @yieldparam err [StandardError] error object if request failed
794
+ #
795
+ # @return [Google::Apis::CloudkmsV1::AsymmetricSignResponse]
796
+ #
797
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
798
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
799
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
800
+ def asymmetric_crypto_key_version_sign(name, asymmetric_sign_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
801
+ command = make_simple_command(:post, 'v1/{+name}:asymmetricSign', options)
802
+ command.request_representation = Google::Apis::CloudkmsV1::AsymmetricSignRequest::Representation
803
+ command.request_object = asymmetric_sign_request_object
804
+ command.response_representation = Google::Apis::CloudkmsV1::AsymmetricSignResponse::Representation
805
+ command.response_class = Google::Apis::CloudkmsV1::AsymmetricSignResponse
806
+ command.params['name'] = name unless name.nil?
807
+ command.query['fields'] = fields unless fields.nil?
808
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
809
+ execute_or_queue_command(command, &block)
810
+ end
811
+
812
+ # Create a new CryptoKeyVersion in a CryptoKey. The server will assign the next
813
+ # sequential id. If unset, state will be set to ENABLED.
814
+ # @param [String] parent
815
+ # Required. The name of the CryptoKey associated with the CryptoKeyVersions.
816
+ # @param [Google::Apis::CloudkmsV1::CryptoKeyVersion] crypto_key_version_object
817
+ # @param [String] fields
818
+ # Selector specifying which fields to include in a partial response.
819
+ # @param [String] quota_user
820
+ # Available to use for quota purposes for server-side applications. Can be any
821
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
822
+ # @param [Google::Apis::RequestOptions] options
823
+ # Request-specific options
824
+ #
825
+ # @yield [result, err] Result & error if block supplied
826
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKeyVersion] parsed result object
827
+ # @yieldparam err [StandardError] error object if request failed
828
+ #
829
+ # @return [Google::Apis::CloudkmsV1::CryptoKeyVersion]
830
+ #
831
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
832
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
833
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
834
+ def create_project_location_key_ring_crypto_key_crypto_key_version(parent, crypto_key_version_object = nil, fields: nil, quota_user: nil, options: nil, &block)
835
+ command = make_simple_command(:post, 'v1/{+parent}/cryptoKeyVersions', options)
836
+ command.request_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
837
+ command.request_object = crypto_key_version_object
838
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
839
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
840
+ command.params['parent'] = parent unless parent.nil?
841
+ command.query['fields'] = fields unless fields.nil?
842
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
843
+ execute_or_queue_command(command, &block)
844
+ end
845
+
846
+ # Schedule a CryptoKeyVersion for destruction. Upon calling this method,
847
+ # CryptoKeyVersion.state will be set to DESTROY_SCHEDULED and destroy_time will
848
+ # be set to a time 24 hours in the future, at which point the state will be
849
+ # changed to DESTROYED, and the key material will be irrevocably destroyed.
850
+ # Before the destroy_time is reached, RestoreCryptoKeyVersion may be called to
851
+ # reverse the process.
852
+ # @param [String] name
853
+ # Required. The resource name of the CryptoKeyVersion to destroy.
854
+ # @param [Google::Apis::CloudkmsV1::DestroyCryptoKeyVersionRequest] destroy_crypto_key_version_request_object
855
+ # @param [String] fields
856
+ # Selector specifying which fields to include in a partial response.
857
+ # @param [String] quota_user
858
+ # Available to use for quota purposes for server-side applications. Can be any
859
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
860
+ # @param [Google::Apis::RequestOptions] options
861
+ # Request-specific options
862
+ #
863
+ # @yield [result, err] Result & error if block supplied
864
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKeyVersion] parsed result object
865
+ # @yieldparam err [StandardError] error object if request failed
866
+ #
867
+ # @return [Google::Apis::CloudkmsV1::CryptoKeyVersion]
868
+ #
869
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
870
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
871
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
872
+ def destroy_crypto_key_version(name, destroy_crypto_key_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
873
+ command = make_simple_command(:post, 'v1/{+name}:destroy', options)
874
+ command.request_representation = Google::Apis::CloudkmsV1::DestroyCryptoKeyVersionRequest::Representation
875
+ command.request_object = destroy_crypto_key_version_request_object
876
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
877
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
878
+ command.params['name'] = name unless name.nil?
879
+ command.query['fields'] = fields unless fields.nil?
880
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
881
+ execute_or_queue_command(command, &block)
882
+ end
883
+
884
+ # Returns metadata for a given CryptoKeyVersion.
885
+ # @param [String] name
886
+ # Required. The name of the CryptoKeyVersion to get.
887
+ # @param [String] fields
888
+ # Selector specifying which fields to include in a partial response.
889
+ # @param [String] quota_user
890
+ # Available to use for quota purposes for server-side applications. Can be any
891
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
892
+ # @param [Google::Apis::RequestOptions] options
893
+ # Request-specific options
894
+ #
895
+ # @yield [result, err] Result & error if block supplied
896
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKeyVersion] parsed result object
897
+ # @yieldparam err [StandardError] error object if request failed
898
+ #
899
+ # @return [Google::Apis::CloudkmsV1::CryptoKeyVersion]
900
+ #
901
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
902
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
903
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
904
+ def get_project_location_key_ring_crypto_key_crypto_key_version(name, fields: nil, quota_user: nil, options: nil, &block)
905
+ command = make_simple_command(:get, 'v1/{+name}', options)
906
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
907
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
908
+ command.params['name'] = name unless name.nil?
909
+ command.query['fields'] = fields unless fields.nil?
910
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
911
+ execute_or_queue_command(command, &block)
912
+ end
913
+
914
+ # Returns the public key for the given CryptoKeyVersion. The CryptoKey.purpose
915
+ # must be ASYMMETRIC_SIGN or ASYMMETRIC_DECRYPT.
916
+ # @param [String] name
917
+ # Required. The name of the CryptoKeyVersion public key to get.
918
+ # @param [String] fields
919
+ # Selector specifying which fields to include in a partial response.
920
+ # @param [String] quota_user
921
+ # Available to use for quota purposes for server-side applications. Can be any
922
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
923
+ # @param [Google::Apis::RequestOptions] options
924
+ # Request-specific options
925
+ #
926
+ # @yield [result, err] Result & error if block supplied
927
+ # @yieldparam result [Google::Apis::CloudkmsV1::PublicKey] parsed result object
928
+ # @yieldparam err [StandardError] error object if request failed
929
+ #
930
+ # @return [Google::Apis::CloudkmsV1::PublicKey]
931
+ #
932
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
933
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
934
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
935
+ def get_project_location_key_ring_crypto_key_crypto_key_version_public_key(name, fields: nil, quota_user: nil, options: nil, &block)
936
+ command = make_simple_command(:get, 'v1/{+name}/publicKey', options)
937
+ command.response_representation = Google::Apis::CloudkmsV1::PublicKey::Representation
938
+ command.response_class = Google::Apis::CloudkmsV1::PublicKey
939
+ command.params['name'] = name unless name.nil?
940
+ command.query['fields'] = fields unless fields.nil?
941
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
942
+ execute_or_queue_command(command, &block)
943
+ end
944
+
945
+ # Imports a new CryptoKeyVersion into an existing CryptoKey using the wrapped
946
+ # key material provided in the request. The version ID will be assigned the next
947
+ # sequential id within the CryptoKey.
948
+ # @param [String] parent
949
+ # Required. The name of the CryptoKey to be imported into.
950
+ # @param [Google::Apis::CloudkmsV1::ImportCryptoKeyVersionRequest] import_crypto_key_version_request_object
951
+ # @param [String] fields
952
+ # Selector specifying which fields to include in a partial response.
953
+ # @param [String] quota_user
954
+ # Available to use for quota purposes for server-side applications. Can be any
955
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
956
+ # @param [Google::Apis::RequestOptions] options
957
+ # Request-specific options
958
+ #
959
+ # @yield [result, err] Result & error if block supplied
960
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKeyVersion] parsed result object
961
+ # @yieldparam err [StandardError] error object if request failed
962
+ #
963
+ # @return [Google::Apis::CloudkmsV1::CryptoKeyVersion]
964
+ #
965
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
966
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
967
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
968
+ def import_crypto_key_version(parent, import_crypto_key_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
969
+ command = make_simple_command(:post, 'v1/{+parent}/cryptoKeyVersions:import', options)
970
+ command.request_representation = Google::Apis::CloudkmsV1::ImportCryptoKeyVersionRequest::Representation
971
+ command.request_object = import_crypto_key_version_request_object
972
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
973
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
974
+ command.params['parent'] = parent unless parent.nil?
975
+ command.query['fields'] = fields unless fields.nil?
976
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
977
+ execute_or_queue_command(command, &block)
978
+ end
979
+
980
+ # Lists CryptoKeyVersions.
981
+ # @param [String] parent
982
+ # Required. The resource name of the CryptoKey to list, in the format `projects/*
983
+ # /locations/*/keyRings/*/cryptoKeys/*`.
984
+ # @param [String] filter
985
+ # Optional. Only include resources that match the filter in the response. For
986
+ # more information, see [Sorting and filtering list results](https://cloud.
987
+ # google.com/kms/docs/sorting-and-filtering).
988
+ # @param [String] order_by
989
+ # Optional. Specify how the results should be sorted. If not specified, the
990
+ # results will be sorted in the default order. For more information, see [
991
+ # Sorting and filtering list results](https://cloud.google.com/kms/docs/sorting-
992
+ # and-filtering).
993
+ # @param [Fixnum] page_size
994
+ # Optional. Optional limit on the number of CryptoKeyVersions to include in the
995
+ # response. Further CryptoKeyVersions can subsequently be obtained by including
996
+ # the ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. If
997
+ # unspecified, the server will pick an appropriate default.
998
+ # @param [String] page_token
999
+ # Optional. Optional pagination token, returned earlier via
1000
+ # ListCryptoKeyVersionsResponse.next_page_token.
1001
+ # @param [String] view
1002
+ # The fields to include in the response.
1003
+ # @param [String] fields
1004
+ # Selector specifying which fields to include in a partial response.
1005
+ # @param [String] quota_user
1006
+ # Available to use for quota purposes for server-side applications. Can be any
1007
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1008
+ # @param [Google::Apis::RequestOptions] options
1009
+ # Request-specific options
1010
+ #
1011
+ # @yield [result, err] Result & error if block supplied
1012
+ # @yieldparam result [Google::Apis::CloudkmsV1::ListCryptoKeyVersionsResponse] parsed result object
1013
+ # @yieldparam err [StandardError] error object if request failed
1014
+ #
1015
+ # @return [Google::Apis::CloudkmsV1::ListCryptoKeyVersionsResponse]
1016
+ #
1017
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1018
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1019
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1020
+ def list_project_location_key_ring_crypto_key_crypto_key_versions(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
1021
+ command = make_simple_command(:get, 'v1/{+parent}/cryptoKeyVersions', options)
1022
+ command.response_representation = Google::Apis::CloudkmsV1::ListCryptoKeyVersionsResponse::Representation
1023
+ command.response_class = Google::Apis::CloudkmsV1::ListCryptoKeyVersionsResponse
1024
+ command.params['parent'] = parent unless parent.nil?
1025
+ command.query['filter'] = filter unless filter.nil?
1026
+ command.query['orderBy'] = order_by unless order_by.nil?
1027
+ command.query['pageSize'] = page_size unless page_size.nil?
1028
+ command.query['pageToken'] = page_token unless page_token.nil?
1029
+ command.query['view'] = view unless view.nil?
1030
+ command.query['fields'] = fields unless fields.nil?
1031
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1032
+ execute_or_queue_command(command, &block)
1033
+ end
1034
+
1035
+ # Update a CryptoKeyVersion's metadata. state may be changed between ENABLED and
1036
+ # DISABLED using this method. See DestroyCryptoKeyVersion and
1037
+ # RestoreCryptoKeyVersion to move between other states.
1038
+ # @param [String] name
1039
+ # Output only. The resource name for this CryptoKeyVersion in the format `
1040
+ # projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
1041
+ # @param [Google::Apis::CloudkmsV1::CryptoKeyVersion] crypto_key_version_object
1042
+ # @param [String] update_mask
1043
+ # Required. List of fields to be updated in this request.
1044
+ # @param [String] fields
1045
+ # Selector specifying which fields to include in a partial response.
1046
+ # @param [String] quota_user
1047
+ # Available to use for quota purposes for server-side applications. Can be any
1048
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1049
+ # @param [Google::Apis::RequestOptions] options
1050
+ # Request-specific options
1051
+ #
1052
+ # @yield [result, err] Result & error if block supplied
1053
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKeyVersion] parsed result object
1054
+ # @yieldparam err [StandardError] error object if request failed
1055
+ #
1056
+ # @return [Google::Apis::CloudkmsV1::CryptoKeyVersion]
1057
+ #
1058
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1059
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1060
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1061
+ def patch_project_location_key_ring_crypto_key_crypto_key_version(name, crypto_key_version_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
1062
+ command = make_simple_command(:patch, 'v1/{+name}', options)
1063
+ command.request_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
1064
+ command.request_object = crypto_key_version_object
1065
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
1066
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
1067
+ command.params['name'] = name unless name.nil?
1068
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1069
+ command.query['fields'] = fields unless fields.nil?
1070
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1071
+ execute_or_queue_command(command, &block)
1072
+ end
1073
+
1074
+ # Restore a CryptoKeyVersion in the DESTROY_SCHEDULED state. Upon restoration of
1075
+ # the CryptoKeyVersion, state will be set to DISABLED, and destroy_time will be
1076
+ # cleared.
1077
+ # @param [String] name
1078
+ # Required. The resource name of the CryptoKeyVersion to restore.
1079
+ # @param [Google::Apis::CloudkmsV1::RestoreCryptoKeyVersionRequest] restore_crypto_key_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::CloudkmsV1::CryptoKeyVersion] parsed result object
1090
+ # @yieldparam err [StandardError] error object if request failed
1091
+ #
1092
+ # @return [Google::Apis::CloudkmsV1::CryptoKeyVersion]
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 restore_crypto_key_version(name, restore_crypto_key_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1098
+ command = make_simple_command(:post, 'v1/{+name}:restore', options)
1099
+ command.request_representation = Google::Apis::CloudkmsV1::RestoreCryptoKeyVersionRequest::Representation
1100
+ command.request_object = restore_crypto_key_version_request_object
1101
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
1102
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
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
+ # Create a new ImportJob within a KeyRing. ImportJob.import_method is required.
1110
+ # @param [String] parent
1111
+ # Required. The name of the KeyRing associated with the ImportJobs.
1112
+ # @param [Google::Apis::CloudkmsV1::ImportJob] import_job_object
1113
+ # @param [String] import_job_id
1114
+ # Required. It must be unique within a KeyRing and match the regular expression `
1115
+ # [a-zA-Z0-9_-]`1,63``
1116
+ # @param [String] fields
1117
+ # Selector specifying which fields to include in a partial response.
1118
+ # @param [String] quota_user
1119
+ # Available to use for quota purposes for server-side applications. Can be any
1120
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1121
+ # @param [Google::Apis::RequestOptions] options
1122
+ # Request-specific options
1123
+ #
1124
+ # @yield [result, err] Result & error if block supplied
1125
+ # @yieldparam result [Google::Apis::CloudkmsV1::ImportJob] parsed result object
1126
+ # @yieldparam err [StandardError] error object if request failed
1127
+ #
1128
+ # @return [Google::Apis::CloudkmsV1::ImportJob]
1129
+ #
1130
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1131
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1132
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1133
+ def create_project_location_key_ring_import_job(parent, import_job_object = nil, import_job_id: nil, fields: nil, quota_user: nil, options: nil, &block)
1134
+ command = make_simple_command(:post, 'v1/{+parent}/importJobs', options)
1135
+ command.request_representation = Google::Apis::CloudkmsV1::ImportJob::Representation
1136
+ command.request_object = import_job_object
1137
+ command.response_representation = Google::Apis::CloudkmsV1::ImportJob::Representation
1138
+ command.response_class = Google::Apis::CloudkmsV1::ImportJob
1139
+ command.params['parent'] = parent unless parent.nil?
1140
+ command.query['importJobId'] = import_job_id unless import_job_id.nil?
1141
+ command.query['fields'] = fields unless fields.nil?
1142
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1143
+ execute_or_queue_command(command, &block)
1144
+ end
1145
+
1146
+ # Returns metadata for a given ImportJob.
1147
+ # @param [String] name
1148
+ # Required. The name of the ImportJob to get.
1149
+ # @param [String] fields
1150
+ # Selector specifying which fields to include in a partial response.
1151
+ # @param [String] quota_user
1152
+ # Available to use for quota purposes for server-side applications. Can be any
1153
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1154
+ # @param [Google::Apis::RequestOptions] options
1155
+ # Request-specific options
1156
+ #
1157
+ # @yield [result, err] Result & error if block supplied
1158
+ # @yieldparam result [Google::Apis::CloudkmsV1::ImportJob] parsed result object
1159
+ # @yieldparam err [StandardError] error object if request failed
1160
+ #
1161
+ # @return [Google::Apis::CloudkmsV1::ImportJob]
1162
+ #
1163
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1164
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1165
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1166
+ def get_project_location_key_ring_import_job(name, fields: nil, quota_user: nil, options: nil, &block)
1167
+ command = make_simple_command(:get, 'v1/{+name}', options)
1168
+ command.response_representation = Google::Apis::CloudkmsV1::ImportJob::Representation
1169
+ command.response_class = Google::Apis::CloudkmsV1::ImportJob
1170
+ command.params['name'] = name unless name.nil?
1171
+ command.query['fields'] = fields unless fields.nil?
1172
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1173
+ execute_or_queue_command(command, &block)
1174
+ end
1175
+
1176
+ # Gets the access control policy for a resource. Returns an empty policy if the
1177
+ # resource exists and does not have a policy set.
1178
+ # @param [String] resource
1179
+ # REQUIRED: The resource for which the policy is being requested. See the
1180
+ # operation documentation for the appropriate value for this field.
1181
+ # @param [Fixnum] options_requested_policy_version
1182
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
1183
+ # 3. Requests specifying an invalid value will be rejected. Requests for
1184
+ # policies with any conditional bindings must specify version 3. Policies
1185
+ # without any conditional bindings may specify any valid value or leave the
1186
+ # field unset. To learn which resources support conditions in their IAM policies,
1187
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
1188
+ # resource-policies).
1189
+ # @param [String] fields
1190
+ # Selector specifying which fields to include in a partial response.
1191
+ # @param [String] quota_user
1192
+ # Available to use for quota purposes for server-side applications. Can be any
1193
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1194
+ # @param [Google::Apis::RequestOptions] options
1195
+ # Request-specific options
1196
+ #
1197
+ # @yield [result, err] Result & error if block supplied
1198
+ # @yieldparam result [Google::Apis::CloudkmsV1::Policy] parsed result object
1199
+ # @yieldparam err [StandardError] error object if request failed
1200
+ #
1201
+ # @return [Google::Apis::CloudkmsV1::Policy]
1202
+ #
1203
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1204
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1205
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1206
+ def get_project_location_key_ring_import_job_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
1207
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
1208
+ command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
1209
+ command.response_class = Google::Apis::CloudkmsV1::Policy
1210
+ command.params['resource'] = resource unless resource.nil?
1211
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
1212
+ command.query['fields'] = fields unless fields.nil?
1213
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1214
+ execute_or_queue_command(command, &block)
1215
+ end
1216
+
1217
+ # Lists ImportJobs.
1218
+ # @param [String] parent
1219
+ # Required. The resource name of the KeyRing to list, in the format `projects/*/
1220
+ # locations/*/keyRings/*`.
1221
+ # @param [String] filter
1222
+ # Optional. Only include resources that match the filter in the response. For
1223
+ # more information, see [Sorting and filtering list results](https://cloud.
1224
+ # google.com/kms/docs/sorting-and-filtering).
1225
+ # @param [String] order_by
1226
+ # Optional. Specify how the results should be sorted. If not specified, the
1227
+ # results will be sorted in the default order. For more information, see [
1228
+ # Sorting and filtering list results](https://cloud.google.com/kms/docs/sorting-
1229
+ # and-filtering).
1230
+ # @param [Fixnum] page_size
1231
+ # Optional. Optional limit on the number of ImportJobs to include in the
1232
+ # response. Further ImportJobs can subsequently be obtained by including the
1233
+ # ListImportJobsResponse.next_page_token in a subsequent request. If unspecified,
1234
+ # the server will pick an appropriate default.
1235
+ # @param [String] page_token
1236
+ # Optional. Optional pagination token, returned earlier via
1237
+ # ListImportJobsResponse.next_page_token.
1238
+ # @param [String] fields
1239
+ # Selector specifying which fields to include in a partial response.
1240
+ # @param [String] quota_user
1241
+ # Available to use for quota purposes for server-side applications. Can be any
1242
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1243
+ # @param [Google::Apis::RequestOptions] options
1244
+ # Request-specific options
1245
+ #
1246
+ # @yield [result, err] Result & error if block supplied
1247
+ # @yieldparam result [Google::Apis::CloudkmsV1::ListImportJobsResponse] parsed result object
1248
+ # @yieldparam err [StandardError] error object if request failed
1249
+ #
1250
+ # @return [Google::Apis::CloudkmsV1::ListImportJobsResponse]
1251
+ #
1252
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1253
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1254
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1255
+ def list_project_location_key_ring_import_jobs(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1256
+ command = make_simple_command(:get, 'v1/{+parent}/importJobs', options)
1257
+ command.response_representation = Google::Apis::CloudkmsV1::ListImportJobsResponse::Representation
1258
+ command.response_class = Google::Apis::CloudkmsV1::ListImportJobsResponse
1259
+ command.params['parent'] = parent unless parent.nil?
1260
+ command.query['filter'] = filter unless filter.nil?
1261
+ command.query['orderBy'] = order_by unless order_by.nil?
1262
+ command.query['pageSize'] = page_size unless page_size.nil?
1263
+ command.query['pageToken'] = page_token unless page_token.nil?
1264
+ command.query['fields'] = fields unless fields.nil?
1265
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1266
+ execute_or_queue_command(command, &block)
1267
+ end
1268
+
1269
+ # Sets the access control policy on the specified resource. Replaces any
1270
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
1271
+ # PERMISSION_DENIED` errors.
1272
+ # @param [String] resource
1273
+ # REQUIRED: The resource for which the policy is being specified. See the
1274
+ # operation documentation for the appropriate value for this field.
1275
+ # @param [Google::Apis::CloudkmsV1::SetIamPolicyRequest] set_iam_policy_request_object
1276
+ # @param [String] fields
1277
+ # Selector specifying which fields to include in a partial response.
1278
+ # @param [String] quota_user
1279
+ # Available to use for quota purposes for server-side applications. Can be any
1280
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1281
+ # @param [Google::Apis::RequestOptions] options
1282
+ # Request-specific options
1283
+ #
1284
+ # @yield [result, err] Result & error if block supplied
1285
+ # @yieldparam result [Google::Apis::CloudkmsV1::Policy] parsed result object
1286
+ # @yieldparam err [StandardError] error object if request failed
1287
+ #
1288
+ # @return [Google::Apis::CloudkmsV1::Policy]
1289
+ #
1290
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1291
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1292
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1293
+ def set_import_job_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1294
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
1295
+ command.request_representation = Google::Apis::CloudkmsV1::SetIamPolicyRequest::Representation
1296
+ command.request_object = set_iam_policy_request_object
1297
+ command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
1298
+ command.response_class = Google::Apis::CloudkmsV1::Policy
1299
+ command.params['resource'] = resource unless resource.nil?
1300
+ command.query['fields'] = fields unless fields.nil?
1301
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1302
+ execute_or_queue_command(command, &block)
1303
+ end
1304
+
1305
+ # Returns permissions that a caller has on the specified resource. If the
1306
+ # resource does not exist, this will return an empty set of permissions, not a `
1307
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
1308
+ # permission-aware UIs and command-line tools, not for authorization checking.
1309
+ # This operation may "fail open" without warning.
1310
+ # @param [String] resource
1311
+ # REQUIRED: The resource for which the policy detail is being requested. See the
1312
+ # operation documentation for the appropriate value for this field.
1313
+ # @param [Google::Apis::CloudkmsV1::TestIamPermissionsRequest] test_iam_permissions_request_object
1314
+ # @param [String] fields
1315
+ # Selector specifying which fields to include in a partial response.
1316
+ # @param [String] quota_user
1317
+ # Available to use for quota purposes for server-side applications. Can be any
1318
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1319
+ # @param [Google::Apis::RequestOptions] options
1320
+ # Request-specific options
1321
+ #
1322
+ # @yield [result, err] Result & error if block supplied
1323
+ # @yieldparam result [Google::Apis::CloudkmsV1::TestIamPermissionsResponse] parsed result object
1324
+ # @yieldparam err [StandardError] error object if request failed
1325
+ #
1326
+ # @return [Google::Apis::CloudkmsV1::TestIamPermissionsResponse]
1327
+ #
1328
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1329
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1330
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1331
+ def test_import_job_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1332
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
1333
+ command.request_representation = Google::Apis::CloudkmsV1::TestIamPermissionsRequest::Representation
1334
+ command.request_object = test_iam_permissions_request_object
1335
+ command.response_representation = Google::Apis::CloudkmsV1::TestIamPermissionsResponse::Representation
1336
+ command.response_class = Google::Apis::CloudkmsV1::TestIamPermissionsResponse
1337
+ command.params['resource'] = resource unless resource.nil?
1338
+ command.query['fields'] = fields unless fields.nil?
1339
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1340
+ execute_or_queue_command(command, &block)
1341
+ end
1342
+
1343
+ protected
1344
+
1345
+ def apply_command_defaults(command)
1346
+ command.query['key'] = key unless key.nil?
1347
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1348
+ end
1349
+ end
1350
+ end
1351
+ end
1352
+ end