google-api-client 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +1 -1
  4. data/api_names.yaml +37747 -36512
  5. data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
  6. data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +1016 -114
  7. data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +426 -22
  8. data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +481 -95
  9. data/generated/google/apis/adexchangebuyer_v1_4.rb +1 -1
  10. data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +27 -10
  11. data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +1 -0
  12. data/generated/google/apis/admin_reports_v1.rb +2 -2
  13. data/generated/google/apis/adsense_v1_4.rb +1 -1
  14. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  15. data/generated/google/apis/analytics_v3.rb +1 -1
  16. data/generated/google/apis/analyticsreporting_v4.rb +4 -4
  17. data/generated/google/apis/analyticsreporting_v4/classes.rb +428 -428
  18. data/generated/google/apis/analyticsreporting_v4/representations.rb +108 -108
  19. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  20. data/generated/google/apis/androidenterprise_v1/classes.rb +60 -66
  21. data/generated/google/apis/androidenterprise_v1/service.rb +12 -11
  22. data/generated/google/apis/androidpublisher_v2.rb +1 -1
  23. data/generated/google/apis/androidpublisher_v2/classes.rb +7 -0
  24. data/generated/google/apis/androidpublisher_v2/representations.rb +1 -0
  25. data/generated/google/apis/androidpublisher_v2/service.rb +1 -1
  26. data/generated/google/apis/appsactivity_v1.rb +3 -3
  27. data/generated/google/apis/appsactivity_v1/service.rb +1 -1
  28. data/generated/google/apis/appstate_v1.rb +1 -1
  29. data/generated/google/apis/bigquery_v2.rb +1 -1
  30. data/generated/google/apis/bigquery_v2/classes.rb +34 -8
  31. data/generated/google/apis/bigquery_v2/representations.rb +15 -0
  32. data/generated/google/apis/calendar_v3.rb +1 -1
  33. data/generated/google/apis/calendar_v3/classes.rb +3 -5
  34. data/generated/google/apis/classroom_v1.rb +25 -22
  35. data/generated/google/apis/classroom_v1/classes.rb +910 -1001
  36. data/generated/google/apis/classroom_v1/representations.rb +240 -240
  37. data/generated/google/apis/classroom_v1/service.rb +1064 -1272
  38. data/generated/google/apis/cloudbilling_v1.rb +3 -3
  39. data/generated/google/apis/cloudbilling_v1/classes.rb +76 -75
  40. data/generated/google/apis/cloudbilling_v1/representations.rb +17 -17
  41. data/generated/google/apis/cloudbilling_v1/service.rb +117 -110
  42. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  43. data/generated/google/apis/cloudbuild_v1/classes.rb +238 -238
  44. data/generated/google/apis/cloudbuild_v1/representations.rb +48 -48
  45. data/generated/google/apis/cloudbuild_v1/service.rb +176 -176
  46. data/generated/google/apis/clouddebugger_v2.rb +4 -4
  47. data/generated/google/apis/clouddebugger_v2/classes.rb +315 -315
  48. data/generated/google/apis/clouddebugger_v2/representations.rb +90 -90
  49. data/generated/google/apis/clouddebugger_v2/service.rb +152 -152
  50. data/generated/google/apis/cloudkms_v1.rb +35 -0
  51. data/generated/google/apis/cloudkms_v1/classes.rb +1039 -0
  52. data/generated/google/apis/cloudkms_v1/representations.rb +448 -0
  53. data/generated/google/apis/cloudkms_v1/service.rb +933 -0
  54. data/generated/google/apis/cloudkms_v1beta1.rb +1 -1
  55. data/generated/google/apis/cloudkms_v1beta1/classes.rb +645 -605
  56. data/generated/google/apis/cloudkms_v1beta1/representations.rb +136 -136
  57. data/generated/google/apis/cloudkms_v1beta1/service.rb +258 -264
  58. data/generated/google/apis/cloudmonitoring_v2beta2.rb +1 -1
  59. data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
  60. data/generated/google/apis/cloudresourcemanager_v1/classes.rb +677 -456
  61. data/generated/google/apis/cloudresourcemanager_v1/representations.rb +154 -89
  62. data/generated/google/apis/cloudresourcemanager_v1/service.rb +380 -279
  63. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +4 -4
  64. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +247 -114
  65. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +72 -40
  66. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +202 -208
  67. data/generated/google/apis/cloudtrace_v1.rb +4 -4
  68. data/generated/google/apis/cloudtrace_v1/classes.rb +39 -39
  69. data/generated/google/apis/cloudtrace_v1/representations.rb +13 -13
  70. data/generated/google/apis/cloudtrace_v1/service.rb +18 -18
  71. data/generated/google/apis/compute_beta.rb +1 -1
  72. data/generated/google/apis/compute_beta/classes.rb +813 -82
  73. data/generated/google/apis/compute_beta/representations.rb +305 -0
  74. data/generated/google/apis/compute_beta/service.rb +971 -180
  75. data/generated/google/apis/compute_v1.rb +1 -1
  76. data/generated/google/apis/compute_v1/classes.rb +147 -21
  77. data/generated/google/apis/compute_v1/representations.rb +38 -0
  78. data/generated/google/apis/compute_v1/service.rb +347 -65
  79. data/generated/google/apis/content_v2.rb +1 -1
  80. data/generated/google/apis/content_v2/classes.rb +2 -1
  81. data/generated/google/apis/dataflow_v1b3.rb +1 -1
  82. data/generated/google/apis/dataflow_v1b3/classes.rb +3352 -3110
  83. data/generated/google/apis/dataflow_v1b3/representations.rb +812 -730
  84. data/generated/google/apis/dataflow_v1b3/service.rb +264 -183
  85. data/generated/google/apis/dataproc_v1.rb +1 -1
  86. data/generated/google/apis/dataproc_v1/classes.rb +1200 -1164
  87. data/generated/google/apis/dataproc_v1/representations.rb +220 -204
  88. data/generated/google/apis/dataproc_v1/service.rb +299 -299
  89. data/generated/google/apis/datastore_v1.rb +4 -4
  90. data/generated/google/apis/datastore_v1/classes.rb +688 -688
  91. data/generated/google/apis/datastore_v1/representations.rb +167 -167
  92. data/generated/google/apis/datastore_v1/service.rb +68 -68
  93. data/generated/google/apis/deploymentmanager_v2.rb +1 -1
  94. data/generated/google/apis/deploymentmanager_v2/classes.rb +13 -3
  95. data/generated/google/apis/dns_v1.rb +1 -1
  96. data/generated/google/apis/dns_v2beta1.rb +1 -1
  97. data/generated/google/apis/doubleclickbidmanager_v1.rb +1 -1
  98. data/generated/google/apis/doubleclickbidmanager_v1/classes.rb +1 -1
  99. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  100. data/generated/google/apis/drive_v2.rb +1 -1
  101. data/generated/google/apis/drive_v2/classes.rb +487 -15
  102. data/generated/google/apis/drive_v2/representations.rb +120 -0
  103. data/generated/google/apis/drive_v2/service.rb +355 -38
  104. data/generated/google/apis/drive_v3.rb +1 -1
  105. data/generated/google/apis/drive_v3/classes.rb +416 -14
  106. data/generated/google/apis/drive_v3/representations.rb +99 -0
  107. data/generated/google/apis/drive_v3/service.rb +315 -28
  108. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  109. data/generated/google/apis/games_management_v1management.rb +1 -1
  110. data/generated/google/apis/games_v1.rb +1 -1
  111. data/generated/google/apis/genomics_v1.rb +7 -7
  112. data/generated/google/apis/genomics_v1/classes.rb +2301 -2301
  113. data/generated/google/apis/genomics_v1/representations.rb +239 -239
  114. data/generated/google/apis/genomics_v1/service.rb +599 -599
  115. data/generated/google/apis/gmail_v1.rb +2 -2
  116. data/generated/google/apis/gmail_v1/service.rb +18 -1
  117. data/generated/google/apis/groupssettings_v1.rb +1 -1
  118. data/generated/google/apis/iam_v1.rb +1 -1
  119. data/generated/google/apis/iam_v1/classes.rb +440 -440
  120. data/generated/google/apis/iam_v1/representations.rb +96 -96
  121. data/generated/google/apis/iam_v1/service.rb +150 -150
  122. data/generated/google/apis/kgsearch_v1/service.rb +13 -13
  123. data/generated/google/apis/language_v1beta1.rb +1 -1
  124. data/generated/google/apis/language_v1beta1/classes.rb +235 -235
  125. data/generated/google/apis/language_v1beta1/representations.rb +73 -73
  126. data/generated/google/apis/language_v1beta1/service.rb +49 -49
  127. data/generated/google/apis/licensing_v1.rb +1 -1
  128. data/generated/google/apis/logging_v2beta1.rb +1 -1
  129. data/generated/google/apis/logging_v2beta1/classes.rb +888 -879
  130. data/generated/google/apis/logging_v2beta1/representations.rb +129 -129
  131. data/generated/google/apis/logging_v2beta1/service.rb +315 -316
  132. data/generated/google/apis/manufacturers_v1/classes.rb +139 -139
  133. data/generated/google/apis/manufacturers_v1/representations.rb +30 -30
  134. data/generated/google/apis/manufacturers_v1/service.rb +32 -32
  135. data/generated/google/apis/monitoring_v3.rb +4 -4
  136. data/generated/google/apis/monitoring_v3/classes.rb +229 -229
  137. data/generated/google/apis/monitoring_v3/representations.rb +45 -45
  138. data/generated/google/apis/monitoring_v3/service.rb +141 -141
  139. data/generated/google/apis/partners_v2.rb +3 -3
  140. data/generated/google/apis/partners_v2/classes.rb +1837 -483
  141. data/generated/google/apis/partners_v2/representations.rb +614 -157
  142. data/generated/google/apis/partners_v2/service.rb +881 -150
  143. data/generated/google/apis/people_v1.rb +1 -1
  144. data/generated/google/apis/people_v1/classes.rb +517 -465
  145. data/generated/google/apis/people_v1/representations.rb +138 -107
  146. data/generated/google/apis/people_v1/service.rb +56 -49
  147. data/generated/google/apis/plus_domains_v1.rb +1 -1
  148. data/generated/google/apis/plus_v1.rb +1 -1
  149. data/generated/google/apis/proximitybeacon_v1beta1.rb +1 -1
  150. data/generated/google/apis/proximitybeacon_v1beta1/classes.rb +529 -458
  151. data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +98 -97
  152. data/generated/google/apis/proximitybeacon_v1beta1/service.rb +494 -370
  153. data/generated/google/apis/pubsub_v1.rb +4 -4
  154. data/generated/google/apis/pubsub_v1/classes.rb +203 -203
  155. data/generated/google/apis/pubsub_v1/representations.rb +65 -65
  156. data/generated/google/apis/pubsub_v1/service.rb +226 -217
  157. data/generated/google/apis/reseller_v1.rb +1 -1
  158. data/generated/google/apis/reseller_v1/classes.rb +213 -61
  159. data/generated/google/apis/reseller_v1/representations.rb +27 -0
  160. data/generated/google/apis/reseller_v1/service.rb +240 -47
  161. data/generated/google/apis/script_v1.rb +14 -14
  162. data/generated/google/apis/script_v1/classes.rb +95 -95
  163. data/generated/google/apis/script_v1/representations.rb +25 -25
  164. data/generated/google/apis/sheets_v4.rb +1 -1
  165. data/generated/google/apis/sheets_v4/classes.rb +4346 -4300
  166. data/generated/google/apis/sheets_v4/representations.rb +853 -837
  167. data/generated/google/apis/sheets_v4/service.rb +32 -32
  168. data/generated/google/apis/slides_v1.rb +1 -1
  169. data/generated/google/apis/slides_v1/classes.rb +804 -748
  170. data/generated/google/apis/slides_v1/representations.rb +204 -187
  171. data/generated/google/apis/slides_v1/service.rb +16 -16
  172. data/generated/google/apis/speech_v1beta1.rb +1 -1
  173. data/generated/google/apis/speech_v1beta1/classes.rb +57 -57
  174. data/generated/google/apis/speech_v1beta1/representations.rb +19 -19
  175. data/generated/google/apis/speech_v1beta1/service.rb +66 -66
  176. data/generated/google/apis/sqladmin_v1beta4.rb +1 -1
  177. data/generated/google/apis/sqladmin_v1beta4/classes.rb +32 -7
  178. data/generated/google/apis/sqladmin_v1beta4/representations.rb +16 -0
  179. data/generated/google/apis/sqladmin_v1beta4/service.rb +9 -2
  180. data/generated/google/apis/storage_v1.rb +1 -1
  181. data/generated/google/apis/storage_v1/service.rb +10 -7
  182. data/generated/google/apis/vision_v1.rb +1 -1
  183. data/generated/google/apis/vision_v1/classes.rb +1393 -865
  184. data/generated/google/apis/vision_v1/representations.rb +367 -102
  185. data/generated/google/apis/vision_v1/service.rb +4 -4
  186. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  187. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  188. data/generated/google/apis/youtubereporting_v1.rb +4 -4
  189. data/generated/google/apis/youtubereporting_v1/classes.rb +93 -93
  190. data/generated/google/apis/youtubereporting_v1/representations.rb +25 -25
  191. data/generated/google/apis/youtubereporting_v1/service.rb +108 -108
  192. data/lib/google/apis/version.rb +1 -1
  193. metadata +34 -30
@@ -0,0 +1,448 @@
1
+ # Copyright 2015 Google Inc.
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 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module CloudkmsV1
24
+
25
+ class Condition
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class CounterOptions
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class AuditLogConfig
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class DecryptResponse
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class TestIamPermissionsRequest
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class ListLocationsResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class Policy
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class EncryptResponse
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class KeyRing
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class UpdateCryptoKeyPrimaryVersionRequest
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class RestoreCryptoKeyVersionRequest
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class DataAccessOptions
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class ListKeyRingsResponse
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class AuditConfig
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class CryptoKeyVersion
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class CloudAuditOptions
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class Binding
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class EncryptRequest
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class ListCryptoKeyVersionsResponse
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class TestIamPermissionsResponse
140
+ class Representation < Google::Apis::Core::JsonRepresentation; end
141
+
142
+ include Google::Apis::Core::JsonObjectSupport
143
+ end
144
+
145
+ class DestroyCryptoKeyVersionRequest
146
+ class Representation < Google::Apis::Core::JsonRepresentation; end
147
+
148
+ include Google::Apis::Core::JsonObjectSupport
149
+ end
150
+
151
+ class Rule
152
+ class Representation < Google::Apis::Core::JsonRepresentation; end
153
+
154
+ include Google::Apis::Core::JsonObjectSupport
155
+ end
156
+
157
+ class CryptoKey
158
+ class Representation < Google::Apis::Core::JsonRepresentation; end
159
+
160
+ include Google::Apis::Core::JsonObjectSupport
161
+ end
162
+
163
+ class LogConfig
164
+ class Representation < Google::Apis::Core::JsonRepresentation; end
165
+
166
+ include Google::Apis::Core::JsonObjectSupport
167
+ end
168
+
169
+ class SetIamPolicyRequest
170
+ class Representation < Google::Apis::Core::JsonRepresentation; end
171
+
172
+ include Google::Apis::Core::JsonObjectSupport
173
+ end
174
+
175
+ class DecryptRequest
176
+ class Representation < Google::Apis::Core::JsonRepresentation; end
177
+
178
+ include Google::Apis::Core::JsonObjectSupport
179
+ end
180
+
181
+ class Location
182
+ class Representation < Google::Apis::Core::JsonRepresentation; end
183
+
184
+ include Google::Apis::Core::JsonObjectSupport
185
+ end
186
+
187
+ class ListCryptoKeysResponse
188
+ class Representation < Google::Apis::Core::JsonRepresentation; end
189
+
190
+ include Google::Apis::Core::JsonObjectSupport
191
+ end
192
+
193
+ class Condition
194
+ # @private
195
+ class Representation < Google::Apis::Core::JsonRepresentation
196
+ property :op, as: 'op'
197
+ property :svc, as: 'svc'
198
+ property :sys, as: 'sys'
199
+ property :value, as: 'value'
200
+ collection :values, as: 'values'
201
+ property :iam, as: 'iam'
202
+ end
203
+ end
204
+
205
+ class CounterOptions
206
+ # @private
207
+ class Representation < Google::Apis::Core::JsonRepresentation
208
+ property :metric, as: 'metric'
209
+ property :field, as: 'field'
210
+ end
211
+ end
212
+
213
+ class AuditLogConfig
214
+ # @private
215
+ class Representation < Google::Apis::Core::JsonRepresentation
216
+ collection :exempted_members, as: 'exemptedMembers'
217
+ property :log_type, as: 'logType'
218
+ end
219
+ end
220
+
221
+ class DecryptResponse
222
+ # @private
223
+ class Representation < Google::Apis::Core::JsonRepresentation
224
+ property :plaintext, :base64 => true, as: 'plaintext'
225
+ end
226
+ end
227
+
228
+ class TestIamPermissionsRequest
229
+ # @private
230
+ class Representation < Google::Apis::Core::JsonRepresentation
231
+ collection :permissions, as: 'permissions'
232
+ end
233
+ end
234
+
235
+ class ListLocationsResponse
236
+ # @private
237
+ class Representation < Google::Apis::Core::JsonRepresentation
238
+ collection :locations, as: 'locations', class: Google::Apis::CloudkmsV1::Location, decorator: Google::Apis::CloudkmsV1::Location::Representation
239
+
240
+ property :next_page_token, as: 'nextPageToken'
241
+ end
242
+ end
243
+
244
+ class Policy
245
+ # @private
246
+ class Representation < Google::Apis::Core::JsonRepresentation
247
+ property :etag, :base64 => true, as: 'etag'
248
+ property :iam_owned, as: 'iamOwned'
249
+ collection :rules, as: 'rules', class: Google::Apis::CloudkmsV1::Rule, decorator: Google::Apis::CloudkmsV1::Rule::Representation
250
+
251
+ property :version, as: 'version'
252
+ collection :audit_configs, as: 'auditConfigs', class: Google::Apis::CloudkmsV1::AuditConfig, decorator: Google::Apis::CloudkmsV1::AuditConfig::Representation
253
+
254
+ collection :bindings, as: 'bindings', class: Google::Apis::CloudkmsV1::Binding, decorator: Google::Apis::CloudkmsV1::Binding::Representation
255
+
256
+ end
257
+ end
258
+
259
+ class EncryptResponse
260
+ # @private
261
+ class Representation < Google::Apis::Core::JsonRepresentation
262
+ property :ciphertext, :base64 => true, as: 'ciphertext'
263
+ property :name, as: 'name'
264
+ end
265
+ end
266
+
267
+ class KeyRing
268
+ # @private
269
+ class Representation < Google::Apis::Core::JsonRepresentation
270
+ property :create_time, as: 'createTime'
271
+ property :name, as: 'name'
272
+ end
273
+ end
274
+
275
+ class UpdateCryptoKeyPrimaryVersionRequest
276
+ # @private
277
+ class Representation < Google::Apis::Core::JsonRepresentation
278
+ property :crypto_key_version_id, as: 'cryptoKeyVersionId'
279
+ end
280
+ end
281
+
282
+ class RestoreCryptoKeyVersionRequest
283
+ # @private
284
+ class Representation < Google::Apis::Core::JsonRepresentation
285
+ end
286
+ end
287
+
288
+ class DataAccessOptions
289
+ # @private
290
+ class Representation < Google::Apis::Core::JsonRepresentation
291
+ end
292
+ end
293
+
294
+ class ListKeyRingsResponse
295
+ # @private
296
+ class Representation < Google::Apis::Core::JsonRepresentation
297
+ property :next_page_token, as: 'nextPageToken'
298
+ property :total_size, as: 'totalSize'
299
+ collection :key_rings, as: 'keyRings', class: Google::Apis::CloudkmsV1::KeyRing, decorator: Google::Apis::CloudkmsV1::KeyRing::Representation
300
+
301
+ end
302
+ end
303
+
304
+ class AuditConfig
305
+ # @private
306
+ class Representation < Google::Apis::Core::JsonRepresentation
307
+ collection :exempted_members, as: 'exemptedMembers'
308
+ property :service, as: 'service'
309
+ collection :audit_log_configs, as: 'auditLogConfigs', class: Google::Apis::CloudkmsV1::AuditLogConfig, decorator: Google::Apis::CloudkmsV1::AuditLogConfig::Representation
310
+
311
+ end
312
+ end
313
+
314
+ class CryptoKeyVersion
315
+ # @private
316
+ class Representation < Google::Apis::Core::JsonRepresentation
317
+ property :state, as: 'state'
318
+ property :name, as: 'name'
319
+ property :destroy_event_time, as: 'destroyEventTime'
320
+ property :destroy_time, as: 'destroyTime'
321
+ property :create_time, as: 'createTime'
322
+ end
323
+ end
324
+
325
+ class CloudAuditOptions
326
+ # @private
327
+ class Representation < Google::Apis::Core::JsonRepresentation
328
+ end
329
+ end
330
+
331
+ class Binding
332
+ # @private
333
+ class Representation < Google::Apis::Core::JsonRepresentation
334
+ collection :members, as: 'members'
335
+ property :role, as: 'role'
336
+ end
337
+ end
338
+
339
+ class EncryptRequest
340
+ # @private
341
+ class Representation < Google::Apis::Core::JsonRepresentation
342
+ property :plaintext, :base64 => true, as: 'plaintext'
343
+ property :additional_authenticated_data, :base64 => true, as: 'additionalAuthenticatedData'
344
+ end
345
+ end
346
+
347
+ class ListCryptoKeyVersionsResponse
348
+ # @private
349
+ class Representation < Google::Apis::Core::JsonRepresentation
350
+ property :next_page_token, as: 'nextPageToken'
351
+ property :total_size, as: 'totalSize'
352
+ collection :crypto_key_versions, as: 'cryptoKeyVersions', class: Google::Apis::CloudkmsV1::CryptoKeyVersion, decorator: Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
353
+
354
+ end
355
+ end
356
+
357
+ class TestIamPermissionsResponse
358
+ # @private
359
+ class Representation < Google::Apis::Core::JsonRepresentation
360
+ collection :permissions, as: 'permissions'
361
+ end
362
+ end
363
+
364
+ class DestroyCryptoKeyVersionRequest
365
+ # @private
366
+ class Representation < Google::Apis::Core::JsonRepresentation
367
+ end
368
+ end
369
+
370
+ class Rule
371
+ # @private
372
+ class Representation < Google::Apis::Core::JsonRepresentation
373
+ collection :not_in, as: 'notIn'
374
+ property :description, as: 'description'
375
+ collection :conditions, as: 'conditions', class: Google::Apis::CloudkmsV1::Condition, decorator: Google::Apis::CloudkmsV1::Condition::Representation
376
+
377
+ collection :log_config, as: 'logConfig', class: Google::Apis::CloudkmsV1::LogConfig, decorator: Google::Apis::CloudkmsV1::LogConfig::Representation
378
+
379
+ collection :in, as: 'in'
380
+ collection :permissions, as: 'permissions'
381
+ property :action, as: 'action'
382
+ end
383
+ end
384
+
385
+ class CryptoKey
386
+ # @private
387
+ class Representation < Google::Apis::Core::JsonRepresentation
388
+ property :purpose, as: 'purpose'
389
+ property :next_rotation_time, as: 'nextRotationTime'
390
+ property :create_time, as: 'createTime'
391
+ property :rotation_period, as: 'rotationPeriod'
392
+ property :primary, as: 'primary', class: Google::Apis::CloudkmsV1::CryptoKeyVersion, decorator: Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
393
+
394
+ property :name, as: 'name'
395
+ end
396
+ end
397
+
398
+ class LogConfig
399
+ # @private
400
+ class Representation < Google::Apis::Core::JsonRepresentation
401
+ property :counter, as: 'counter', class: Google::Apis::CloudkmsV1::CounterOptions, decorator: Google::Apis::CloudkmsV1::CounterOptions::Representation
402
+
403
+ property :data_access, as: 'dataAccess', class: Google::Apis::CloudkmsV1::DataAccessOptions, decorator: Google::Apis::CloudkmsV1::DataAccessOptions::Representation
404
+
405
+ property :cloud_audit, as: 'cloudAudit', class: Google::Apis::CloudkmsV1::CloudAuditOptions, decorator: Google::Apis::CloudkmsV1::CloudAuditOptions::Representation
406
+
407
+ end
408
+ end
409
+
410
+ class SetIamPolicyRequest
411
+ # @private
412
+ class Representation < Google::Apis::Core::JsonRepresentation
413
+ property :update_mask, as: 'updateMask'
414
+ property :policy, as: 'policy', class: Google::Apis::CloudkmsV1::Policy, decorator: Google::Apis::CloudkmsV1::Policy::Representation
415
+
416
+ end
417
+ end
418
+
419
+ class DecryptRequest
420
+ # @private
421
+ class Representation < Google::Apis::Core::JsonRepresentation
422
+ property :ciphertext, :base64 => true, as: 'ciphertext'
423
+ property :additional_authenticated_data, :base64 => true, as: 'additionalAuthenticatedData'
424
+ end
425
+ end
426
+
427
+ class Location
428
+ # @private
429
+ class Representation < Google::Apis::Core::JsonRepresentation
430
+ property :name, as: 'name'
431
+ property :location_id, as: 'locationId'
432
+ hash :metadata, as: 'metadata'
433
+ hash :labels, as: 'labels'
434
+ end
435
+ end
436
+
437
+ class ListCryptoKeysResponse
438
+ # @private
439
+ class Representation < Google::Apis::Core::JsonRepresentation
440
+ property :next_page_token, as: 'nextPageToken'
441
+ collection :crypto_keys, as: 'cryptoKeys', class: Google::Apis::CloudkmsV1::CryptoKey, decorator: Google::Apis::CloudkmsV1::CryptoKey::Representation
442
+
443
+ property :total_size, as: 'totalSize'
444
+ end
445
+ end
446
+ end
447
+ end
448
+ end
@@ -0,0 +1,933 @@
1
+ # Copyright 2015 Google Inc.
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
+ # Google Cloud Key Management Service (KMS) API
24
+ #
25
+ # Manages encryption for your cloud services the same way you do on-premise. You
26
+ # can generate, use, rotate, and destroy AES256 encryption keys.
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
+ # Available to use for quota purposes for server-side applications. Can be any
38
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
39
+ attr_accessor :quota_user
40
+
41
+ # @return [String]
42
+ # API key. Your API key identifies your project and provides you with API access,
43
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
44
+ attr_accessor :key
45
+
46
+ def initialize
47
+ super('https://cloudkms.googleapis.com/', '')
48
+ end
49
+
50
+ # Lists information about the supported locations for this service.
51
+ # @param [String] name
52
+ # The resource that owns the locations collection, if applicable.
53
+ # @param [String] filter
54
+ # The standard list filter.
55
+ # @param [String] page_token
56
+ # The standard list page token.
57
+ # @param [Fixnum] page_size
58
+ # The standard list page size.
59
+ # @param [String] quota_user
60
+ # Available to use for quota purposes for server-side applications. Can be any
61
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
62
+ # @param [String] fields
63
+ # Selector specifying which fields to include in a partial response.
64
+ # @param [Google::Apis::RequestOptions] options
65
+ # Request-specific options
66
+ #
67
+ # @yield [result, err] Result & error if block supplied
68
+ # @yieldparam result [Google::Apis::CloudkmsV1::ListLocationsResponse] parsed result object
69
+ # @yieldparam err [StandardError] error object if request failed
70
+ #
71
+ # @return [Google::Apis::CloudkmsV1::ListLocationsResponse]
72
+ #
73
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
74
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
75
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
76
+ def list_project_locations(name, filter: nil, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
77
+ command = make_simple_command(:get, 'v1/{+name}/locations', options)
78
+ command.response_representation = Google::Apis::CloudkmsV1::ListLocationsResponse::Representation
79
+ command.response_class = Google::Apis::CloudkmsV1::ListLocationsResponse
80
+ command.params['name'] = name unless name.nil?
81
+ command.query['filter'] = filter unless filter.nil?
82
+ command.query['pageToken'] = page_token unless page_token.nil?
83
+ command.query['pageSize'] = page_size unless page_size.nil?
84
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
85
+ command.query['fields'] = fields unless fields.nil?
86
+ execute_or_queue_command(command, &block)
87
+ end
88
+
89
+ # Get information about a location.
90
+ # @param [String] name
91
+ # Resource name for the location.
92
+ # @param [String] quota_user
93
+ # Available to use for quota purposes for server-side applications. Can be any
94
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
95
+ # @param [String] fields
96
+ # Selector specifying which fields to include in a partial response.
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::Location] parsed result object
102
+ # @yieldparam err [StandardError] error object if request failed
103
+ #
104
+ # @return [Google::Apis::CloudkmsV1::Location]
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 get_project_location(name, quota_user: nil, fields: nil, options: nil, &block)
110
+ command = make_simple_command(:get, 'v1/{+name}', options)
111
+ command.response_representation = Google::Apis::CloudkmsV1::Location::Representation
112
+ command.response_class = Google::Apis::CloudkmsV1::Location
113
+ command.params['name'] = name unless name.nil?
114
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
115
+ command.query['fields'] = fields unless fields.nil?
116
+ execute_or_queue_command(command, &block)
117
+ end
118
+
119
+ # Gets the access control policy for a resource.
120
+ # Returns an empty policy if the resource exists and does not have a policy
121
+ # set.
122
+ # @param [String] resource
123
+ # REQUIRED: The resource for which the policy is being requested.
124
+ # See the operation documentation for the appropriate value for this field.
125
+ # @param [String] quota_user
126
+ # Available to use for quota purposes for server-side applications. Can be any
127
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
128
+ # @param [String] fields
129
+ # Selector specifying which fields to include in a partial response.
130
+ # @param [Google::Apis::RequestOptions] options
131
+ # Request-specific options
132
+ #
133
+ # @yield [result, err] Result & error if block supplied
134
+ # @yieldparam result [Google::Apis::CloudkmsV1::Policy] parsed result object
135
+ # @yieldparam err [StandardError] error object if request failed
136
+ #
137
+ # @return [Google::Apis::CloudkmsV1::Policy]
138
+ #
139
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
140
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
141
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
142
+ def get_project_location_key_ring_iam_policy(resource, quota_user: nil, fields: nil, options: nil, &block)
143
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
144
+ command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
145
+ command.response_class = Google::Apis::CloudkmsV1::Policy
146
+ command.params['resource'] = resource unless resource.nil?
147
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
148
+ command.query['fields'] = fields unless fields.nil?
149
+ execute_or_queue_command(command, &block)
150
+ end
151
+
152
+ # Returns metadata for a given KeyRing.
153
+ # @param [String] name
154
+ # The name of the KeyRing to get.
155
+ # @param [String] quota_user
156
+ # Available to use for quota purposes for server-side applications. Can be any
157
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
158
+ # @param [String] fields
159
+ # Selector specifying which fields to include in a partial response.
160
+ # @param [Google::Apis::RequestOptions] options
161
+ # Request-specific options
162
+ #
163
+ # @yield [result, err] Result & error if block supplied
164
+ # @yieldparam result [Google::Apis::CloudkmsV1::KeyRing] parsed result object
165
+ # @yieldparam err [StandardError] error object if request failed
166
+ #
167
+ # @return [Google::Apis::CloudkmsV1::KeyRing]
168
+ #
169
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
170
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
171
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
172
+ def get_project_location_key_ring(name, quota_user: nil, fields: nil, options: nil, &block)
173
+ command = make_simple_command(:get, 'v1/{+name}', options)
174
+ command.response_representation = Google::Apis::CloudkmsV1::KeyRing::Representation
175
+ command.response_class = Google::Apis::CloudkmsV1::KeyRing
176
+ command.params['name'] = name unless name.nil?
177
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
178
+ command.query['fields'] = fields unless fields.nil?
179
+ execute_or_queue_command(command, &block)
180
+ end
181
+
182
+ # Returns permissions that a caller has on the specified resource.
183
+ # If the resource does not exist, this will return an empty set of
184
+ # permissions, not a NOT_FOUND error.
185
+ # Note: This operation is designed to be used for building permission-aware
186
+ # UIs and command-line tools, not for authorization checking. This operation
187
+ # may "fail open" without warning.
188
+ # @param [String] resource
189
+ # REQUIRED: The resource for which the policy detail is being requested.
190
+ # See the operation documentation for the appropriate value for this field.
191
+ # @param [Google::Apis::CloudkmsV1::TestIamPermissionsRequest] test_iam_permissions_request_object
192
+ # @param [String] quota_user
193
+ # Available to use for quota purposes for server-side applications. Can be any
194
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
195
+ # @param [String] fields
196
+ # Selector specifying which fields to include in a partial response.
197
+ # @param [Google::Apis::RequestOptions] options
198
+ # Request-specific options
199
+ #
200
+ # @yield [result, err] Result & error if block supplied
201
+ # @yieldparam result [Google::Apis::CloudkmsV1::TestIamPermissionsResponse] parsed result object
202
+ # @yieldparam err [StandardError] error object if request failed
203
+ #
204
+ # @return [Google::Apis::CloudkmsV1::TestIamPermissionsResponse]
205
+ #
206
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
207
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
208
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
209
+ def test_key_ring_iam_permissions(resource, test_iam_permissions_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
210
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
211
+ command.request_representation = Google::Apis::CloudkmsV1::TestIamPermissionsRequest::Representation
212
+ command.request_object = test_iam_permissions_request_object
213
+ command.response_representation = Google::Apis::CloudkmsV1::TestIamPermissionsResponse::Representation
214
+ command.response_class = Google::Apis::CloudkmsV1::TestIamPermissionsResponse
215
+ command.params['resource'] = resource unless resource.nil?
216
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
217
+ command.query['fields'] = fields unless fields.nil?
218
+ execute_or_queue_command(command, &block)
219
+ end
220
+
221
+ # Lists KeyRings.
222
+ # @param [String] parent
223
+ # Required. The resource name of the location associated with the
224
+ # KeyRings, in the format `projects/*/locations/*`.
225
+ # @param [String] page_token
226
+ # Optional pagination token, returned earlier via
227
+ # ListKeyRingsResponse.next_page_token.
228
+ # @param [Fixnum] page_size
229
+ # Optional limit on the number of KeyRings to include in the
230
+ # response. Further KeyRings can subsequently be obtained by
231
+ # including the ListKeyRingsResponse.next_page_token in a subsequent
232
+ # request. If unspecified, the server will pick an appropriate default.
233
+ # @param [String] quota_user
234
+ # Available to use for quota purposes for server-side applications. Can be any
235
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
236
+ # @param [String] fields
237
+ # Selector specifying which fields to include in a partial response.
238
+ # @param [Google::Apis::RequestOptions] options
239
+ # Request-specific options
240
+ #
241
+ # @yield [result, err] Result & error if block supplied
242
+ # @yieldparam result [Google::Apis::CloudkmsV1::ListKeyRingsResponse] parsed result object
243
+ # @yieldparam err [StandardError] error object if request failed
244
+ #
245
+ # @return [Google::Apis::CloudkmsV1::ListKeyRingsResponse]
246
+ #
247
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
248
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
249
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
250
+ def list_project_location_key_rings(parent, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
251
+ command = make_simple_command(:get, 'v1/{+parent}/keyRings', options)
252
+ command.response_representation = Google::Apis::CloudkmsV1::ListKeyRingsResponse::Representation
253
+ command.response_class = Google::Apis::CloudkmsV1::ListKeyRingsResponse
254
+ command.params['parent'] = parent unless parent.nil?
255
+ command.query['pageToken'] = page_token unless page_token.nil?
256
+ command.query['pageSize'] = page_size unless page_size.nil?
257
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
258
+ command.query['fields'] = fields unless fields.nil?
259
+ execute_or_queue_command(command, &block)
260
+ end
261
+
262
+ # Create a new KeyRing in a given Project and Location.
263
+ # @param [String] parent
264
+ # Required. The resource name of the location associated with the
265
+ # KeyRings, in the format `projects/*/locations/*`.
266
+ # @param [Google::Apis::CloudkmsV1::KeyRing] key_ring_object
267
+ # @param [String] key_ring_id
268
+ # Required. It must be unique within a location and match the regular
269
+ # expression `[a-zA-Z0-9_-]`1,63``
270
+ # @param [String] quota_user
271
+ # Available to use for quota purposes for server-side applications. Can be any
272
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
273
+ # @param [String] fields
274
+ # Selector specifying which fields to include in a partial response.
275
+ # @param [Google::Apis::RequestOptions] options
276
+ # Request-specific options
277
+ #
278
+ # @yield [result, err] Result & error if block supplied
279
+ # @yieldparam result [Google::Apis::CloudkmsV1::KeyRing] parsed result object
280
+ # @yieldparam err [StandardError] error object if request failed
281
+ #
282
+ # @return [Google::Apis::CloudkmsV1::KeyRing]
283
+ #
284
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
285
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
286
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
287
+ def create_project_location_key_ring(parent, key_ring_object = nil, key_ring_id: nil, quota_user: nil, fields: nil, options: nil, &block)
288
+ command = make_simple_command(:post, 'v1/{+parent}/keyRings', options)
289
+ command.request_representation = Google::Apis::CloudkmsV1::KeyRing::Representation
290
+ command.request_object = key_ring_object
291
+ command.response_representation = Google::Apis::CloudkmsV1::KeyRing::Representation
292
+ command.response_class = Google::Apis::CloudkmsV1::KeyRing
293
+ command.params['parent'] = parent unless parent.nil?
294
+ command.query['keyRingId'] = key_ring_id unless key_ring_id.nil?
295
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
296
+ command.query['fields'] = fields unless fields.nil?
297
+ execute_or_queue_command(command, &block)
298
+ end
299
+
300
+ # Sets the access control policy on the specified resource. Replaces any
301
+ # existing policy.
302
+ # @param [String] resource
303
+ # REQUIRED: The resource for which the policy is being specified.
304
+ # See the operation documentation for the appropriate value for this field.
305
+ # @param [Google::Apis::CloudkmsV1::SetIamPolicyRequest] set_iam_policy_request_object
306
+ # @param [String] quota_user
307
+ # Available to use for quota purposes for server-side applications. Can be any
308
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
309
+ # @param [String] fields
310
+ # Selector specifying which fields to include in a partial response.
311
+ # @param [Google::Apis::RequestOptions] options
312
+ # Request-specific options
313
+ #
314
+ # @yield [result, err] Result & error if block supplied
315
+ # @yieldparam result [Google::Apis::CloudkmsV1::Policy] parsed result object
316
+ # @yieldparam err [StandardError] error object if request failed
317
+ #
318
+ # @return [Google::Apis::CloudkmsV1::Policy]
319
+ #
320
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
321
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
322
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
323
+ def set_key_ring_iam_policy(resource, set_iam_policy_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
324
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
325
+ command.request_representation = Google::Apis::CloudkmsV1::SetIamPolicyRequest::Representation
326
+ command.request_object = set_iam_policy_request_object
327
+ command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
328
+ command.response_class = Google::Apis::CloudkmsV1::Policy
329
+ command.params['resource'] = resource unless resource.nil?
330
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
331
+ command.query['fields'] = fields unless fields.nil?
332
+ execute_or_queue_command(command, &block)
333
+ end
334
+
335
+ # Lists CryptoKeys.
336
+ # @param [String] parent
337
+ # Required. The resource name of the KeyRing to list, in the format
338
+ # `projects/*/locations/*/keyRings/*`.
339
+ # @param [String] page_token
340
+ # Optional pagination token, returned earlier via
341
+ # ListCryptoKeysResponse.next_page_token.
342
+ # @param [Fixnum] page_size
343
+ # Optional limit on the number of CryptoKeys to include in the
344
+ # response. Further CryptoKeys can subsequently be obtained by
345
+ # including the ListCryptoKeysResponse.next_page_token in a subsequent
346
+ # request. If unspecified, the server will pick an appropriate default.
347
+ # @param [String] quota_user
348
+ # Available to use for quota purposes for server-side applications. Can be any
349
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
350
+ # @param [String] fields
351
+ # Selector specifying which fields to include in a partial response.
352
+ # @param [Google::Apis::RequestOptions] options
353
+ # Request-specific options
354
+ #
355
+ # @yield [result, err] Result & error if block supplied
356
+ # @yieldparam result [Google::Apis::CloudkmsV1::ListCryptoKeysResponse] parsed result object
357
+ # @yieldparam err [StandardError] error object if request failed
358
+ #
359
+ # @return [Google::Apis::CloudkmsV1::ListCryptoKeysResponse]
360
+ #
361
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
362
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
363
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
364
+ def list_project_location_key_ring_crypto_keys(parent, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
365
+ command = make_simple_command(:get, 'v1/{+parent}/cryptoKeys', options)
366
+ command.response_representation = Google::Apis::CloudkmsV1::ListCryptoKeysResponse::Representation
367
+ command.response_class = Google::Apis::CloudkmsV1::ListCryptoKeysResponse
368
+ command.params['parent'] = parent unless parent.nil?
369
+ command.query['pageToken'] = page_token unless page_token.nil?
370
+ command.query['pageSize'] = page_size unless page_size.nil?
371
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
372
+ command.query['fields'] = fields unless fields.nil?
373
+ execute_or_queue_command(command, &block)
374
+ end
375
+
376
+ # Encrypt data, so that it can only be recovered by a call to Decrypt.
377
+ # @param [String] name
378
+ # Required. The resource name of the CryptoKey or CryptoKeyVersion
379
+ # to use for encryption.
380
+ # If a CryptoKey is specified, the server will use its
381
+ # primary version.
382
+ # @param [Google::Apis::CloudkmsV1::EncryptRequest] encrypt_request_object
383
+ # @param [String] quota_user
384
+ # Available to use for quota purposes for server-side applications. Can be any
385
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
386
+ # @param [String] fields
387
+ # Selector specifying which fields to include in a partial response.
388
+ # @param [Google::Apis::RequestOptions] options
389
+ # Request-specific options
390
+ #
391
+ # @yield [result, err] Result & error if block supplied
392
+ # @yieldparam result [Google::Apis::CloudkmsV1::EncryptResponse] parsed result object
393
+ # @yieldparam err [StandardError] error object if request failed
394
+ #
395
+ # @return [Google::Apis::CloudkmsV1::EncryptResponse]
396
+ #
397
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
398
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
399
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
400
+ def encrypt_crypto_key(name, encrypt_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
401
+ command = make_simple_command(:post, 'v1/{+name}:encrypt', options)
402
+ command.request_representation = Google::Apis::CloudkmsV1::EncryptRequest::Representation
403
+ command.request_object = encrypt_request_object
404
+ command.response_representation = Google::Apis::CloudkmsV1::EncryptResponse::Representation
405
+ command.response_class = Google::Apis::CloudkmsV1::EncryptResponse
406
+ command.params['name'] = name unless name.nil?
407
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
408
+ command.query['fields'] = fields unless fields.nil?
409
+ execute_or_queue_command(command, &block)
410
+ end
411
+
412
+ # Create a new CryptoKey within a KeyRing.
413
+ # CryptoKey.purpose is required.
414
+ # @param [String] parent
415
+ # Required. The name of the KeyRing associated with the
416
+ # CryptoKeys.
417
+ # @param [Google::Apis::CloudkmsV1::CryptoKey] crypto_key_object
418
+ # @param [String] crypto_key_id
419
+ # Required. It must be unique within a KeyRing and match the regular
420
+ # expression `[a-zA-Z0-9_-]`1,63``
421
+ # @param [String] quota_user
422
+ # Available to use for quota purposes for server-side applications. Can be any
423
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
424
+ # @param [String] fields
425
+ # Selector specifying which fields to include in a partial response.
426
+ # @param [Google::Apis::RequestOptions] options
427
+ # Request-specific options
428
+ #
429
+ # @yield [result, err] Result & error if block supplied
430
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKey] parsed result object
431
+ # @yieldparam err [StandardError] error object if request failed
432
+ #
433
+ # @return [Google::Apis::CloudkmsV1::CryptoKey]
434
+ #
435
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
436
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
437
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
438
+ def create_project_location_key_ring_crypto_key(parent, crypto_key_object = nil, crypto_key_id: nil, quota_user: nil, fields: nil, options: nil, &block)
439
+ command = make_simple_command(:post, 'v1/{+parent}/cryptoKeys', options)
440
+ command.request_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
441
+ command.request_object = crypto_key_object
442
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
443
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKey
444
+ command.params['parent'] = parent unless parent.nil?
445
+ command.query['cryptoKeyId'] = crypto_key_id unless crypto_key_id.nil?
446
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
447
+ command.query['fields'] = fields unless fields.nil?
448
+ execute_or_queue_command(command, &block)
449
+ end
450
+
451
+ # Sets the access control policy on the specified resource. Replaces any
452
+ # existing policy.
453
+ # @param [String] resource
454
+ # REQUIRED: The resource for which the policy is being specified.
455
+ # See the operation documentation for the appropriate value for this field.
456
+ # @param [Google::Apis::CloudkmsV1::SetIamPolicyRequest] set_iam_policy_request_object
457
+ # @param [String] quota_user
458
+ # Available to use for quota purposes for server-side applications. Can be any
459
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
460
+ # @param [String] fields
461
+ # Selector specifying which fields to include in a partial response.
462
+ # @param [Google::Apis::RequestOptions] options
463
+ # Request-specific options
464
+ #
465
+ # @yield [result, err] Result & error if block supplied
466
+ # @yieldparam result [Google::Apis::CloudkmsV1::Policy] parsed result object
467
+ # @yieldparam err [StandardError] error object if request failed
468
+ #
469
+ # @return [Google::Apis::CloudkmsV1::Policy]
470
+ #
471
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
472
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
473
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
474
+ def set_crypto_key_iam_policy(resource, set_iam_policy_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
475
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
476
+ command.request_representation = Google::Apis::CloudkmsV1::SetIamPolicyRequest::Representation
477
+ command.request_object = set_iam_policy_request_object
478
+ command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
479
+ command.response_class = Google::Apis::CloudkmsV1::Policy
480
+ command.params['resource'] = resource unless resource.nil?
481
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
482
+ command.query['fields'] = fields unless fields.nil?
483
+ execute_or_queue_command(command, &block)
484
+ end
485
+
486
+ # Update the version of a CryptoKey that will be used in Encrypt
487
+ # @param [String] name
488
+ # The resource name of the CryptoKey to update.
489
+ # @param [Google::Apis::CloudkmsV1::UpdateCryptoKeyPrimaryVersionRequest] update_crypto_key_primary_version_request_object
490
+ # @param [String] quota_user
491
+ # Available to use for quota purposes for server-side applications. Can be any
492
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
493
+ # @param [String] fields
494
+ # Selector specifying which fields to include in a partial response.
495
+ # @param [Google::Apis::RequestOptions] options
496
+ # Request-specific options
497
+ #
498
+ # @yield [result, err] Result & error if block supplied
499
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKey] parsed result object
500
+ # @yieldparam err [StandardError] error object if request failed
501
+ #
502
+ # @return [Google::Apis::CloudkmsV1::CryptoKey]
503
+ #
504
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
505
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
506
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
507
+ def update_project_location_key_ring_crypto_key_primary_version(name, update_crypto_key_primary_version_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
508
+ command = make_simple_command(:post, 'v1/{+name}:updatePrimaryVersion', options)
509
+ command.request_representation = Google::Apis::CloudkmsV1::UpdateCryptoKeyPrimaryVersionRequest::Representation
510
+ command.request_object = update_crypto_key_primary_version_request_object
511
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
512
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKey
513
+ command.params['name'] = name unless name.nil?
514
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
515
+ command.query['fields'] = fields unless fields.nil?
516
+ execute_or_queue_command(command, &block)
517
+ end
518
+
519
+ # Gets the access control policy for a resource.
520
+ # Returns an empty policy if the resource exists and does not have a policy
521
+ # set.
522
+ # @param [String] resource
523
+ # REQUIRED: The resource for which the policy is being requested.
524
+ # See the operation documentation for the appropriate value for this field.
525
+ # @param [String] quota_user
526
+ # Available to use for quota purposes for server-side applications. Can be any
527
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
528
+ # @param [String] fields
529
+ # Selector specifying which fields to include in a partial response.
530
+ # @param [Google::Apis::RequestOptions] options
531
+ # Request-specific options
532
+ #
533
+ # @yield [result, err] Result & error if block supplied
534
+ # @yieldparam result [Google::Apis::CloudkmsV1::Policy] parsed result object
535
+ # @yieldparam err [StandardError] error object if request failed
536
+ #
537
+ # @return [Google::Apis::CloudkmsV1::Policy]
538
+ #
539
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
540
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
541
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
542
+ def get_project_location_key_ring_crypto_key_iam_policy(resource, quota_user: nil, fields: nil, options: nil, &block)
543
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
544
+ command.response_representation = Google::Apis::CloudkmsV1::Policy::Representation
545
+ command.response_class = Google::Apis::CloudkmsV1::Policy
546
+ command.params['resource'] = resource unless resource.nil?
547
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
548
+ command.query['fields'] = fields unless fields.nil?
549
+ execute_or_queue_command(command, &block)
550
+ end
551
+
552
+ # Returns metadata for a given CryptoKey, as well as its
553
+ # primary CryptoKeyVersion.
554
+ # @param [String] name
555
+ # The name of the CryptoKey to get.
556
+ # @param [String] quota_user
557
+ # Available to use for quota purposes for server-side applications. Can be any
558
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
559
+ # @param [String] fields
560
+ # Selector specifying which fields to include in a partial response.
561
+ # @param [Google::Apis::RequestOptions] options
562
+ # Request-specific options
563
+ #
564
+ # @yield [result, err] Result & error if block supplied
565
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKey] parsed result object
566
+ # @yieldparam err [StandardError] error object if request failed
567
+ #
568
+ # @return [Google::Apis::CloudkmsV1::CryptoKey]
569
+ #
570
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
571
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
572
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
573
+ def get_project_location_key_ring_crypto_key(name, quota_user: nil, fields: nil, options: nil, &block)
574
+ command = make_simple_command(:get, 'v1/{+name}', options)
575
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
576
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKey
577
+ command.params['name'] = name unless name.nil?
578
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
579
+ command.query['fields'] = fields unless fields.nil?
580
+ execute_or_queue_command(command, &block)
581
+ end
582
+
583
+ # Update a CryptoKey.
584
+ # @param [String] name
585
+ # Output only. The resource name for this CryptoKey in the format
586
+ # `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
587
+ # @param [Google::Apis::CloudkmsV1::CryptoKey] crypto_key_object
588
+ # @param [String] update_mask
589
+ # Required list of fields to be updated in this request.
590
+ # @param [String] quota_user
591
+ # Available to use for quota purposes for server-side applications. Can be any
592
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
593
+ # @param [String] fields
594
+ # Selector specifying which fields to include in a partial response.
595
+ # @param [Google::Apis::RequestOptions] options
596
+ # Request-specific options
597
+ #
598
+ # @yield [result, err] Result & error if block supplied
599
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKey] parsed result object
600
+ # @yieldparam err [StandardError] error object if request failed
601
+ #
602
+ # @return [Google::Apis::CloudkmsV1::CryptoKey]
603
+ #
604
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
605
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
606
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
607
+ def patch_project_location_key_ring_crypto_key(name, crypto_key_object = nil, update_mask: nil, quota_user: nil, fields: nil, options: nil, &block)
608
+ command = make_simple_command(:patch, 'v1/{+name}', options)
609
+ command.request_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
610
+ command.request_object = crypto_key_object
611
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKey::Representation
612
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKey
613
+ command.params['name'] = name unless name.nil?
614
+ command.query['updateMask'] = update_mask unless update_mask.nil?
615
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
616
+ command.query['fields'] = fields unless fields.nil?
617
+ execute_or_queue_command(command, &block)
618
+ end
619
+
620
+ # Returns permissions that a caller has on the specified resource.
621
+ # If the resource does not exist, this will return an empty set of
622
+ # permissions, not a NOT_FOUND error.
623
+ # Note: This operation is designed to be used for building permission-aware
624
+ # UIs and command-line tools, not for authorization checking. This operation
625
+ # may "fail open" without warning.
626
+ # @param [String] resource
627
+ # REQUIRED: The resource for which the policy detail is being requested.
628
+ # See the operation documentation for the appropriate value for this field.
629
+ # @param [Google::Apis::CloudkmsV1::TestIamPermissionsRequest] test_iam_permissions_request_object
630
+ # @param [String] quota_user
631
+ # Available to use for quota purposes for server-side applications. Can be any
632
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
633
+ # @param [String] fields
634
+ # Selector specifying which fields to include in a partial response.
635
+ # @param [Google::Apis::RequestOptions] options
636
+ # Request-specific options
637
+ #
638
+ # @yield [result, err] Result & error if block supplied
639
+ # @yieldparam result [Google::Apis::CloudkmsV1::TestIamPermissionsResponse] parsed result object
640
+ # @yieldparam err [StandardError] error object if request failed
641
+ #
642
+ # @return [Google::Apis::CloudkmsV1::TestIamPermissionsResponse]
643
+ #
644
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
645
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
646
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
647
+ def test_crypto_key_iam_permissions(resource, test_iam_permissions_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
648
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
649
+ command.request_representation = Google::Apis::CloudkmsV1::TestIamPermissionsRequest::Representation
650
+ command.request_object = test_iam_permissions_request_object
651
+ command.response_representation = Google::Apis::CloudkmsV1::TestIamPermissionsResponse::Representation
652
+ command.response_class = Google::Apis::CloudkmsV1::TestIamPermissionsResponse
653
+ command.params['resource'] = resource unless resource.nil?
654
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
655
+ command.query['fields'] = fields unless fields.nil?
656
+ execute_or_queue_command(command, &block)
657
+ end
658
+
659
+ # Decrypt data that was protected by Encrypt.
660
+ # @param [String] name
661
+ # Required. The resource name of the CryptoKey to use for decryption.
662
+ # The server will choose the appropriate version.
663
+ # @param [Google::Apis::CloudkmsV1::DecryptRequest] decrypt_request_object
664
+ # @param [String] quota_user
665
+ # Available to use for quota purposes for server-side applications. Can be any
666
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
667
+ # @param [String] fields
668
+ # Selector specifying which fields to include in a partial response.
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::CloudkmsV1::DecryptResponse] parsed result object
674
+ # @yieldparam err [StandardError] error object if request failed
675
+ #
676
+ # @return [Google::Apis::CloudkmsV1::DecryptResponse]
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 decrypt_crypto_key(name, decrypt_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
682
+ command = make_simple_command(:post, 'v1/{+name}:decrypt', options)
683
+ command.request_representation = Google::Apis::CloudkmsV1::DecryptRequest::Representation
684
+ command.request_object = decrypt_request_object
685
+ command.response_representation = Google::Apis::CloudkmsV1::DecryptResponse::Representation
686
+ command.response_class = Google::Apis::CloudkmsV1::DecryptResponse
687
+ command.params['name'] = name unless name.nil?
688
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
689
+ command.query['fields'] = fields unless fields.nil?
690
+ execute_or_queue_command(command, &block)
691
+ end
692
+
693
+ # Restore a CryptoKeyVersion in the
694
+ # DESTROY_SCHEDULED,
695
+ # state.
696
+ # Upon restoration of the CryptoKeyVersion, state
697
+ # will be set to DISABLED,
698
+ # and destroy_time will be cleared.
699
+ # @param [String] name
700
+ # The resource name of the CryptoKeyVersion to restore.
701
+ # @param [Google::Apis::CloudkmsV1::RestoreCryptoKeyVersionRequest] restore_crypto_key_version_request_object
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 [String] fields
706
+ # Selector specifying which fields to include in a partial response.
707
+ # @param [Google::Apis::RequestOptions] options
708
+ # Request-specific options
709
+ #
710
+ # @yield [result, err] Result & error if block supplied
711
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKeyVersion] parsed result object
712
+ # @yieldparam err [StandardError] error object if request failed
713
+ #
714
+ # @return [Google::Apis::CloudkmsV1::CryptoKeyVersion]
715
+ #
716
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
717
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
718
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
719
+ def restore_crypto_key_version(name, restore_crypto_key_version_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
720
+ command = make_simple_command(:post, 'v1/{+name}:restore', options)
721
+ command.request_representation = Google::Apis::CloudkmsV1::RestoreCryptoKeyVersionRequest::Representation
722
+ command.request_object = restore_crypto_key_version_request_object
723
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
724
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
725
+ command.params['name'] = name unless name.nil?
726
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
727
+ command.query['fields'] = fields unless fields.nil?
728
+ execute_or_queue_command(command, &block)
729
+ end
730
+
731
+ # Returns metadata for a given CryptoKeyVersion.
732
+ # @param [String] name
733
+ # The name of the CryptoKeyVersion to get.
734
+ # @param [String] quota_user
735
+ # Available to use for quota purposes for server-side applications. Can be any
736
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
737
+ # @param [String] fields
738
+ # Selector specifying which fields to include in a partial response.
739
+ # @param [Google::Apis::RequestOptions] options
740
+ # Request-specific options
741
+ #
742
+ # @yield [result, err] Result & error if block supplied
743
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKeyVersion] parsed result object
744
+ # @yieldparam err [StandardError] error object if request failed
745
+ #
746
+ # @return [Google::Apis::CloudkmsV1::CryptoKeyVersion]
747
+ #
748
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
749
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
750
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
751
+ def get_project_location_key_ring_crypto_key_crypto_key_version(name, quota_user: nil, fields: nil, options: nil, &block)
752
+ command = make_simple_command(:get, 'v1/{+name}', options)
753
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
754
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
755
+ command.params['name'] = name unless name.nil?
756
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
757
+ command.query['fields'] = fields unless fields.nil?
758
+ execute_or_queue_command(command, &block)
759
+ end
760
+
761
+ # Update a CryptoKeyVersion's metadata.
762
+ # state may be changed between
763
+ # ENABLED and
764
+ # DISABLED using this
765
+ # method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to
766
+ # move between other states.
767
+ # @param [String] name
768
+ # Output only. The resource name for this CryptoKeyVersion in the format
769
+ # `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
770
+ # @param [Google::Apis::CloudkmsV1::CryptoKeyVersion] crypto_key_version_object
771
+ # @param [String] update_mask
772
+ # Required list of fields to be updated in this request.
773
+ # @param [String] quota_user
774
+ # Available to use for quota purposes for server-side applications. Can be any
775
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
776
+ # @param [String] fields
777
+ # Selector specifying which fields to include in a partial response.
778
+ # @param [Google::Apis::RequestOptions] options
779
+ # Request-specific options
780
+ #
781
+ # @yield [result, err] Result & error if block supplied
782
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKeyVersion] parsed result object
783
+ # @yieldparam err [StandardError] error object if request failed
784
+ #
785
+ # @return [Google::Apis::CloudkmsV1::CryptoKeyVersion]
786
+ #
787
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
788
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
789
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
790
+ def patch_project_location_key_ring_crypto_key_crypto_key_version(name, crypto_key_version_object = nil, update_mask: nil, quota_user: nil, fields: nil, options: nil, &block)
791
+ command = make_simple_command(:patch, 'v1/{+name}', options)
792
+ command.request_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
793
+ command.request_object = crypto_key_version_object
794
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
795
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
796
+ command.params['name'] = name unless name.nil?
797
+ command.query['updateMask'] = update_mask unless update_mask.nil?
798
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
799
+ command.query['fields'] = fields unless fields.nil?
800
+ execute_or_queue_command(command, &block)
801
+ end
802
+
803
+ # Lists CryptoKeyVersions.
804
+ # @param [String] parent
805
+ # Required. The resource name of the CryptoKey to list, in the format
806
+ # `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
807
+ # @param [String] page_token
808
+ # Optional pagination token, returned earlier via
809
+ # ListCryptoKeyVersionsResponse.next_page_token.
810
+ # @param [Fixnum] page_size
811
+ # Optional limit on the number of CryptoKeyVersions to
812
+ # include in the response. Further CryptoKeyVersions can
813
+ # subsequently be obtained by including the
814
+ # ListCryptoKeyVersionsResponse.next_page_token in a subsequent request.
815
+ # If unspecified, the server will pick an appropriate default.
816
+ # @param [String] quota_user
817
+ # Available to use for quota purposes for server-side applications. Can be any
818
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
819
+ # @param [String] fields
820
+ # Selector specifying which fields to include in a partial response.
821
+ # @param [Google::Apis::RequestOptions] options
822
+ # Request-specific options
823
+ #
824
+ # @yield [result, err] Result & error if block supplied
825
+ # @yieldparam result [Google::Apis::CloudkmsV1::ListCryptoKeyVersionsResponse] parsed result object
826
+ # @yieldparam err [StandardError] error object if request failed
827
+ #
828
+ # @return [Google::Apis::CloudkmsV1::ListCryptoKeyVersionsResponse]
829
+ #
830
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
831
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
832
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
833
+ def list_project_location_key_ring_crypto_key_crypto_key_versions(parent, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
834
+ command = make_simple_command(:get, 'v1/{+parent}/cryptoKeyVersions', options)
835
+ command.response_representation = Google::Apis::CloudkmsV1::ListCryptoKeyVersionsResponse::Representation
836
+ command.response_class = Google::Apis::CloudkmsV1::ListCryptoKeyVersionsResponse
837
+ command.params['parent'] = parent unless parent.nil?
838
+ command.query['pageToken'] = page_token unless page_token.nil?
839
+ command.query['pageSize'] = page_size unless page_size.nil?
840
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
841
+ command.query['fields'] = fields unless fields.nil?
842
+ execute_or_queue_command(command, &block)
843
+ end
844
+
845
+ # Create a new CryptoKeyVersion in a CryptoKey.
846
+ # The server will assign the next sequential id. If unset,
847
+ # state will be set to
848
+ # ENABLED.
849
+ # @param [String] parent
850
+ # Required. The name of the CryptoKey associated with
851
+ # the CryptoKeyVersions.
852
+ # @param [Google::Apis::CloudkmsV1::CryptoKeyVersion] crypto_key_version_object
853
+ # @param [String] quota_user
854
+ # Available to use for quota purposes for server-side applications. Can be any
855
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
856
+ # @param [String] fields
857
+ # Selector specifying which fields to include in a partial response.
858
+ # @param [Google::Apis::RequestOptions] options
859
+ # Request-specific options
860
+ #
861
+ # @yield [result, err] Result & error if block supplied
862
+ # @yieldparam result [Google::Apis::CloudkmsV1::CryptoKeyVersion] parsed result object
863
+ # @yieldparam err [StandardError] error object if request failed
864
+ #
865
+ # @return [Google::Apis::CloudkmsV1::CryptoKeyVersion]
866
+ #
867
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
868
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
869
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
870
+ def create_project_location_key_ring_crypto_key_crypto_key_version(parent, crypto_key_version_object = nil, quota_user: nil, fields: nil, options: nil, &block)
871
+ command = make_simple_command(:post, 'v1/{+parent}/cryptoKeyVersions', options)
872
+ command.request_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
873
+ command.request_object = crypto_key_version_object
874
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
875
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
876
+ command.params['parent'] = parent unless parent.nil?
877
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
878
+ command.query['fields'] = fields unless fields.nil?
879
+ execute_or_queue_command(command, &block)
880
+ end
881
+
882
+ # Schedule a CryptoKeyVersion for destruction.
883
+ # Upon calling this method, CryptoKeyVersion.state will be set to
884
+ # DESTROY_SCHEDULED
885
+ # and destroy_time will be set to a time 24
886
+ # hours in the future, at which point the state
887
+ # will be changed to
888
+ # DESTROYED, and the key
889
+ # material will be irrevocably destroyed.
890
+ # Before the destroy_time is reached,
891
+ # RestoreCryptoKeyVersion may be called to reverse the process.
892
+ # @param [String] name
893
+ # The resource name of the CryptoKeyVersion to destroy.
894
+ # @param [Google::Apis::CloudkmsV1::DestroyCryptoKeyVersionRequest] destroy_crypto_key_version_request_object
895
+ # @param [String] quota_user
896
+ # Available to use for quota purposes for server-side applications. Can be any
897
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
898
+ # @param [String] fields
899
+ # Selector specifying which fields to include in a partial response.
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::CloudkmsV1::CryptoKeyVersion] parsed result object
905
+ # @yieldparam err [StandardError] error object if request failed
906
+ #
907
+ # @return [Google::Apis::CloudkmsV1::CryptoKeyVersion]
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 destroy_crypto_key_version(name, destroy_crypto_key_version_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
913
+ command = make_simple_command(:post, 'v1/{+name}:destroy', options)
914
+ command.request_representation = Google::Apis::CloudkmsV1::DestroyCryptoKeyVersionRequest::Representation
915
+ command.request_object = destroy_crypto_key_version_request_object
916
+ command.response_representation = Google::Apis::CloudkmsV1::CryptoKeyVersion::Representation
917
+ command.response_class = Google::Apis::CloudkmsV1::CryptoKeyVersion
918
+ command.params['name'] = name unless name.nil?
919
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
920
+ command.query['fields'] = fields unless fields.nil?
921
+ execute_or_queue_command(command, &block)
922
+ end
923
+
924
+ protected
925
+
926
+ def apply_command_defaults(command)
927
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
928
+ command.query['key'] = key unless key.nil?
929
+ end
930
+ end
931
+ end
932
+ end
933
+ end