google-api-client 0.9.8 → 0.10.2

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