google-api-client 0.9.8 → 0.10.2

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