google-api-client 0.8.7 → 0.9.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (397) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +20 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +7 -0
  5. data/.rubocop_todo.yml +63 -0
  6. data/.travis.yml +21 -0
  7. data/.yardopts +12 -0
  8. data/CHANGELOG.md +6 -3
  9. data/CONTRIBUTING.md +31 -0
  10. data/Gemfile +28 -2
  11. data/MIGRATING.md +171 -0
  12. data/README.md +158 -150
  13. data/Rakefile +1 -40
  14. data/api_names.yaml +872 -0
  15. data/api_names_out.yaml +20843 -0
  16. data/bin/generate-api +93 -0
  17. data/generated/google/apis/adexchangebuyer_v1_3.rb +35 -0
  18. data/generated/google/apis/adexchangebuyer_v1_3/classes.rb +1124 -0
  19. data/generated/google/apis/adexchangebuyer_v1_3/representations.rb +375 -0
  20. data/generated/google/apis/adexchangebuyer_v1_3/service.rb +893 -0
  21. data/generated/google/apis/adexchangeseller_v2_0.rb +38 -0
  22. data/generated/google/apis/adexchangeseller_v2_0/classes.rb +792 -0
  23. data/generated/google/apis/adexchangeseller_v2_0/representations.rb +309 -0
  24. data/generated/google/apis/adexchangeseller_v2_0/service.rb +682 -0
  25. data/generated/google/apis/admin_directory_v1.rb +89 -0
  26. data/generated/google/apis/admin_directory_v1/classes.rb +2389 -0
  27. data/generated/google/apis/admin_directory_v1/representations.rb +780 -0
  28. data/generated/google/apis/admin_directory_v1/service.rb +2805 -0
  29. data/generated/google/apis/admin_reports_v1.rb +38 -0
  30. data/generated/google/apis/admin_reports_v1/classes.rb +582 -0
  31. data/generated/google/apis/admin_reports_v1/representations.rb +231 -0
  32. data/generated/google/apis/admin_reports_v1/service.rb +341 -0
  33. data/generated/google/apis/adsense_v1_4.rb +38 -0
  34. data/generated/google/apis/adsense_v1_4/classes.rb +1279 -0
  35. data/generated/google/apis/adsense_v1_4/representations.rb +493 -0
  36. data/generated/google/apis/adsense_v1_4/service.rb +1752 -0
  37. data/generated/google/apis/adsensehost_v4_1.rb +35 -0
  38. data/generated/google/apis/adsensehost_v4_1/classes.rb +834 -0
  39. data/generated/google/apis/adsensehost_v4_1/representations.rb +327 -0
  40. data/generated/google/apis/adsensehost_v4_1/service.rb +1190 -0
  41. data/generated/google/apis/analytics_v3.rb +49 -0
  42. data/generated/google/apis/analytics_v3/classes.rb +5113 -0
  43. data/generated/google/apis/analytics_v3/representations.rb +1661 -0
  44. data/generated/google/apis/analytics_v3/service.rb +3600 -0
  45. data/generated/google/apis/androidenterprise_v1.rb +34 -0
  46. data/generated/google/apis/androidenterprise_v1/classes.rb +1162 -0
  47. data/generated/google/apis/androidenterprise_v1/representations.rb +431 -0
  48. data/generated/google/apis/androidenterprise_v1/service.rb +1979 -0
  49. data/generated/google/apis/androidpublisher_v2.rb +34 -0
  50. data/generated/google/apis/androidpublisher_v2/classes.rb +1374 -0
  51. data/generated/google/apis/androidpublisher_v2/representations.rb +630 -0
  52. data/generated/google/apis/androidpublisher_v2/service.rb +2390 -0
  53. data/generated/google/apis/appsactivity_v1.rb +46 -0
  54. data/generated/google/apis/appsactivity_v1/classes.rb +392 -0
  55. data/generated/google/apis/appsactivity_v1/representations.rb +184 -0
  56. data/generated/google/apis/appsactivity_v1/service.rb +129 -0
  57. data/generated/google/apis/appstate_v1.rb +34 -0
  58. data/generated/google/apis/appstate_v1/classes.rb +154 -0
  59. data/generated/google/apis/appstate_v1/representations.rb +79 -0
  60. data/generated/google/apis/appstate_v1/service.rb +265 -0
  61. data/generated/google/apis/autoscaler_v1beta2.rb +38 -0
  62. data/generated/google/apis/autoscaler_v1beta2/classes.rb +747 -0
  63. data/generated/google/apis/autoscaler_v1beta2/representations.rb +281 -0
  64. data/generated/google/apis/autoscaler_v1beta2/service.rb +488 -0
  65. data/generated/google/apis/bigquery_v2.rb +49 -0
  66. data/generated/google/apis/bigquery_v2/classes.rb +2255 -0
  67. data/generated/google/apis/bigquery_v2/representations.rb +754 -0
  68. data/generated/google/apis/bigquery_v2/service.rb +1003 -0
  69. data/generated/google/apis/blogger_v3.rb +37 -0
  70. data/generated/google/apis/blogger_v3/classes.rb +1354 -0
  71. data/generated/google/apis/blogger_v3/representations.rb +562 -0
  72. data/generated/google/apis/blogger_v3/service.rb +1620 -0
  73. data/generated/google/apis/books_v1.rb +34 -0
  74. data/generated/google/apis/books_v1/classes.rb +3515 -0
  75. data/generated/google/apis/books_v1/representations.rb +1361 -0
  76. data/generated/google/apis/books_v1/service.rb +2170 -0
  77. data/generated/google/apis/calendar_v3.rb +37 -0
  78. data/generated/google/apis/calendar_v3/classes.rb +1702 -0
  79. data/generated/google/apis/calendar_v3/representations.rb +566 -0
  80. data/generated/google/apis/calendar_v3/service.rb +1943 -0
  81. data/generated/google/apis/civicinfo_v2.rb +31 -0
  82. data/generated/google/apis/civicinfo_v2/classes.rb +1057 -0
  83. data/generated/google/apis/civicinfo_v2/representations.rb +374 -0
  84. data/generated/google/apis/civicinfo_v2/service.rb +284 -0
  85. data/generated/google/apis/cloudmonitoring_v2beta2.rb +34 -0
  86. data/generated/google/apis/cloudmonitoring_v2beta2/classes.rb +679 -0
  87. data/generated/google/apis/cloudmonitoring_v2beta2/representations.rb +311 -0
  88. data/generated/google/apis/cloudmonitoring_v2beta2/service.rb +458 -0
  89. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +38 -0
  90. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +139 -0
  91. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +65 -0
  92. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +301 -0
  93. data/generated/google/apis/compute_v1.rb +49 -0
  94. data/generated/google/apis/compute_v1/classes.rb +6391 -0
  95. data/generated/google/apis/compute_v1/representations.rb +2209 -0
  96. data/generated/google/apis/compute_v1/service.rb +6352 -0
  97. data/generated/google/apis/container_v1beta1.rb +35 -0
  98. data/generated/google/apis/container_v1beta1/classes.rb +466 -0
  99. data/generated/google/apis/container_v1beta1/representations.rb +177 -0
  100. data/generated/google/apis/container_v1beta1/service.rb +394 -0
  101. data/generated/google/apis/content_v2.rb +35 -0
  102. data/generated/google/apis/content_v2/classes.rb +3780 -0
  103. data/generated/google/apis/content_v2/representations.rb +1456 -0
  104. data/generated/google/apis/content_v2/service.rb +1706 -0
  105. data/generated/google/apis/coordinate_v1.rb +37 -0
  106. data/generated/google/apis/coordinate_v1/classes.rb +669 -0
  107. data/generated/google/apis/coordinate_v1/representations.rb +285 -0
  108. data/generated/google/apis/coordinate_v1/service.rb +687 -0
  109. data/{lib/google/api_client/auth/compute_service_account.rb → generated/google/apis/customsearch_v1.rb} +13 -10
  110. data/generated/google/apis/customsearch_v1/classes.rb +771 -0
  111. data/generated/google/apis/customsearch_v1/representations.rb +276 -0
  112. data/generated/google/apis/customsearch_v1/service.rb +208 -0
  113. data/generated/google/apis/datastore_v1beta2.rb +40 -0
  114. data/generated/google/apis/datastore_v1beta2/classes.rb +1186 -0
  115. data/generated/google/apis/datastore_v1beta2/representations.rb +526 -0
  116. data/generated/google/apis/datastore_v1beta2/service.rb +300 -0
  117. data/generated/google/apis/deploymentmanager_v2beta2.rb +41 -0
  118. data/generated/google/apis/deploymentmanager_v2beta2/classes.rb +820 -0
  119. data/generated/google/apis/deploymentmanager_v2beta2/representations.rb +303 -0
  120. data/generated/google/apis/deploymentmanager_v2beta2/service.rb +647 -0
  121. data/generated/google/apis/dfareporting_v2_1.rb +37 -0
  122. data/generated/google/apis/dfareporting_v2_1/classes.rb +10755 -0
  123. data/generated/google/apis/dfareporting_v2_1/representations.rb +3438 -0
  124. data/generated/google/apis/dfareporting_v2_1/service.rb +8775 -0
  125. data/generated/google/apis/discovery_v1.rb +32 -0
  126. data/generated/google/apis/discovery_v1/classes.rb +947 -0
  127. data/generated/google/apis/discovery_v1/representations.rb +355 -0
  128. data/generated/google/apis/discovery_v1/service.rb +144 -0
  129. data/generated/google/apis/dns_v1.rb +41 -0
  130. data/generated/google/apis/dns_v1/classes.rb +406 -0
  131. data/generated/google/apis/dns_v1/representations.rb +151 -0
  132. data/generated/google/apis/dns_v1/service.rb +460 -0
  133. data/{spec/google/api_client/request_spec.rb → generated/google/apis/doubleclickbidmanager_v1.rb} +15 -13
  134. data/generated/google/apis/doubleclickbidmanager_v1/classes.rb +709 -0
  135. data/generated/google/apis/doubleclickbidmanager_v1/representations.rb +297 -0
  136. data/generated/google/apis/doubleclickbidmanager_v1/service.rb +349 -0
  137. data/generated/google/apis/doubleclicksearch_v2.rb +35 -0
  138. data/generated/google/apis/doubleclicksearch_v2/classes.rb +947 -0
  139. data/generated/google/apis/doubleclicksearch_v2/representations.rb +315 -0
  140. data/generated/google/apis/doubleclicksearch_v2/service.rb +490 -0
  141. data/generated/google/apis/drive_v2.rb +55 -0
  142. data/generated/google/apis/drive_v2/classes.rb +2519 -0
  143. data/generated/google/apis/drive_v2/representations.rb +781 -0
  144. data/generated/google/apis/drive_v2/service.rb +2685 -0
  145. data/generated/google/apis/fitness_v1.rb +49 -0
  146. data/generated/google/apis/fitness_v1/classes.rb +809 -0
  147. data/generated/google/apis/fitness_v1/representations.rb +295 -0
  148. data/generated/google/apis/fitness_v1/service.rb +684 -0
  149. data/generated/google/apis/fusiontables_v2.rb +37 -0
  150. data/generated/google/apis/fusiontables_v2/classes.rb +1048 -0
  151. data/generated/google/apis/fusiontables_v2/representations.rb +409 -0
  152. data/generated/google/apis/fusiontables_v2/service.rb +1496 -0
  153. data/generated/google/apis/games_configuration_v1configuration.rb +34 -0
  154. data/generated/google/apis/games_configuration_v1configuration/classes.rb +506 -0
  155. data/generated/google/apis/games_configuration_v1configuration/representations.rb +206 -0
  156. data/generated/google/apis/games_configuration_v1configuration/service.rb +578 -0
  157. data/generated/google/apis/games_v1.rb +40 -0
  158. data/generated/google/apis/games_v1/classes.rb +4578 -0
  159. data/generated/google/apis/games_v1/representations.rb +1570 -0
  160. data/generated/google/apis/games_v1/service.rb +2306 -0
  161. data/generated/google/apis/gan_v1beta1.rb +31 -0
  162. data/generated/google/apis/gan_v1beta1/classes.rb +1428 -0
  163. data/generated/google/apis/gan_v1beta1/representations.rb +428 -0
  164. data/generated/google/apis/gan_v1beta1/service.rb +692 -0
  165. data/generated/google/apis/genomics_v1beta2.rb +46 -0
  166. data/generated/google/apis/genomics_v1beta2/classes.rb +3288 -0
  167. data/generated/google/apis/genomics_v1beta2/representations.rb +1194 -0
  168. data/generated/google/apis/genomics_v1beta2/service.rb +2356 -0
  169. data/generated/google/apis/gmail_v1.rb +49 -0
  170. data/generated/google/apis/gmail_v1/classes.rb +794 -0
  171. data/generated/google/apis/gmail_v1/representations.rb +339 -0
  172. data/generated/google/apis/gmail_v1/service.rb +1502 -0
  173. data/generated/google/apis/groupsmigration_v1.rb +34 -0
  174. data/generated/google/apis/groupsmigration_v1/classes.rb +51 -0
  175. data/generated/google/apis/groupsmigration_v1/representations.rb +38 -0
  176. data/generated/google/apis/groupsmigration_v1/service.rb +111 -0
  177. data/generated/google/apis/groupssettings_v1.rb +34 -0
  178. data/generated/google/apis/groupssettings_v1/classes.rb +221 -0
  179. data/generated/google/apis/groupssettings_v1/representations.rb +64 -0
  180. data/generated/google/apis/groupssettings_v1/service.rb +179 -0
  181. data/generated/google/apis/identitytoolkit_v3.rb +31 -0
  182. data/generated/google/apis/identitytoolkit_v3/classes.rb +1229 -0
  183. data/generated/google/apis/identitytoolkit_v3/representations.rb +422 -0
  184. data/generated/google/apis/identitytoolkit_v3/service.rb +491 -0
  185. data/generated/google/apis/licensing_v1.rb +34 -0
  186. data/generated/google/apis/licensing_v1/classes.rb +132 -0
  187. data/generated/google/apis/licensing_v1/representations.rb +68 -0
  188. data/generated/google/apis/licensing_v1/service.rb +376 -0
  189. data/generated/google/apis/logging_v1beta3.rb +35 -0
  190. data/generated/google/apis/logging_v1beta3/classes.rb +505 -0
  191. data/generated/google/apis/logging_v1beta3/representations.rb +222 -0
  192. data/generated/google/apis/logging_v1beta3/service.rb +670 -0
  193. data/generated/google/apis/manager_v1beta2.rb +50 -0
  194. data/generated/google/apis/manager_v1beta2/classes.rb +1287 -0
  195. data/generated/google/apis/manager_v1beta2/representations.rb +536 -0
  196. data/generated/google/apis/manager_v1beta2/service.rb +380 -0
  197. data/generated/google/apis/mapsengine_v1.rb +38 -0
  198. data/generated/google/apis/mapsengine_v1/classes.rb +2873 -0
  199. data/generated/google/apis/mapsengine_v1/representations.rb +1235 -0
  200. data/generated/google/apis/mapsengine_v1/service.rb +3465 -0
  201. data/generated/google/apis/mirror_v1.rb +37 -0
  202. data/generated/google/apis/mirror_v1/classes.rb +1072 -0
  203. data/generated/google/apis/mirror_v1/representations.rb +350 -0
  204. data/generated/google/apis/mirror_v1/service.rb +1001 -0
  205. data/generated/google/apis/oauth2_v2.rb +43 -0
  206. data/generated/google/apis/oauth2_v2/classes.rb +245 -0
  207. data/generated/google/apis/oauth2_v2/representations.rb +94 -0
  208. data/generated/google/apis/oauth2_v2/service.rb +203 -0
  209. data/generated/google/apis/pagespeedonline_v2.rb +32 -0
  210. data/generated/google/apis/pagespeedonline_v2/classes.rb +614 -0
  211. data/generated/google/apis/pagespeedonline_v2/representations.rb +244 -0
  212. data/generated/google/apis/pagespeedonline_v2/service.rb +120 -0
  213. data/generated/google/apis/plus_domains_v1.rb +61 -0
  214. data/generated/google/apis/plus_domains_v1/classes.rb +2402 -0
  215. data/generated/google/apis/plus_domains_v1/representations.rb +873 -0
  216. data/generated/google/apis/plus_domains_v1/service.rb +924 -0
  217. data/generated/google/apis/plus_v1.rb +43 -0
  218. data/generated/google/apis/plus_v1/classes.rb +2384 -0
  219. data/generated/google/apis/plus_v1/representations.rb +812 -0
  220. data/generated/google/apis/plus_v1/service.rb +616 -0
  221. data/generated/google/apis/prediction_v1_6.rb +44 -0
  222. data/generated/google/apis/prediction_v1_6/classes.rb +751 -0
  223. data/generated/google/apis/prediction_v1_6/representations.rb +327 -0
  224. data/generated/google/apis/prediction_v1_6/service.rb +388 -0
  225. data/generated/google/apis/pubsub_v1beta2.rb +37 -0
  226. data/generated/google/apis/pubsub_v1beta2/classes.rb +824 -0
  227. data/generated/google/apis/pubsub_v1beta2/representations.rb +366 -0
  228. data/generated/google/apis/pubsub_v1beta2/service.rb +778 -0
  229. data/generated/google/apis/qpx_express_v1.rb +31 -0
  230. data/generated/google/apis/qpx_express_v1/classes.rb +1268 -0
  231. data/generated/google/apis/qpx_express_v1/representations.rb +424 -0
  232. data/generated/google/apis/qpx_express_v1/service.rb +101 -0
  233. data/generated/google/apis/replicapool_v1beta2.rb +41 -0
  234. data/generated/google/apis/replicapool_v1beta2/classes.rb +621 -0
  235. data/generated/google/apis/replicapool_v1beta2/representations.rb +235 -0
  236. data/generated/google/apis/replicapool_v1beta2/service.rb +620 -0
  237. data/generated/google/apis/replicapoolupdater_v1beta1.rb +41 -0
  238. data/generated/google/apis/replicapoolupdater_v1beta1/classes.rb +682 -0
  239. data/generated/google/apis/replicapoolupdater_v1beta1/representations.rb +247 -0
  240. data/generated/google/apis/replicapoolupdater_v1beta1/service.rb +472 -0
  241. data/generated/google/apis/reseller_v1.rb +37 -0
  242. data/generated/google/apis/reseller_v1/classes.rb +502 -0
  243. data/generated/google/apis/reseller_v1/representations.rb +199 -0
  244. data/generated/google/apis/reseller_v1/service.rb +637 -0
  245. data/generated/google/apis/resourceviews_v1beta2.rb +47 -0
  246. data/generated/google/apis/resourceviews_v1beta2/classes.rb +660 -0
  247. data/generated/google/apis/resourceviews_v1beta2/representations.rb +269 -0
  248. data/generated/google/apis/resourceviews_v1beta2/service.rb +574 -0
  249. data/generated/google/apis/site_verification_v1.rb +37 -0
  250. data/generated/google/apis/site_verification_v1/classes.rb +185 -0
  251. data/generated/google/apis/site_verification_v1/representations.rb +101 -0
  252. data/generated/google/apis/site_verification_v1/service.rb +322 -0
  253. data/generated/google/apis/sqladmin_v1beta4.rb +37 -0
  254. data/generated/google/apis/sqladmin_v1beta4/classes.rb +1817 -0
  255. data/generated/google/apis/sqladmin_v1beta4/representations.rb +688 -0
  256. data/generated/google/apis/sqladmin_v1beta4/service.rb +1534 -0
  257. data/generated/google/apis/storage_v1.rb +43 -0
  258. data/generated/google/apis/storage_v1/classes.rb +1177 -0
  259. data/generated/google/apis/storage_v1/representations.rb +427 -0
  260. data/generated/google/apis/storage_v1/service.rb +1920 -0
  261. data/generated/google/apis/tagmanager_v1.rb +52 -0
  262. data/generated/google/apis/tagmanager_v1/classes.rb +1226 -0
  263. data/generated/google/apis/tagmanager_v1/representations.rb +461 -0
  264. data/generated/google/apis/tagmanager_v1/service.rb +1978 -0
  265. data/generated/google/apis/taskqueue_v1beta2.rb +37 -0
  266. data/generated/google/apis/taskqueue_v1beta2/classes.rb +254 -0
  267. data/generated/google/apis/taskqueue_v1beta2/representations.rb +114 -0
  268. data/generated/google/apis/taskqueue_v1beta2/service.rb +416 -0
  269. data/generated/google/apis/tasks_v1.rb +37 -0
  270. data/generated/google/apis/tasks_v1/classes.rb +296 -0
  271. data/generated/google/apis/tasks_v1/representations.rb +115 -0
  272. data/generated/google/apis/tasks_v1/service.rb +657 -0
  273. data/generated/google/apis/translate_v2.rb +31 -0
  274. data/generated/google/apis/translate_v2/classes.rb +168 -0
  275. data/generated/google/apis/translate_v2/representations.rb +109 -0
  276. data/generated/google/apis/translate_v2/service.rb +185 -0
  277. data/generated/google/apis/urlshortener_v1.rb +34 -0
  278. data/generated/google/apis/urlshortener_v1/classes.rb +246 -0
  279. data/generated/google/apis/urlshortener_v1/representations.rb +111 -0
  280. data/generated/google/apis/urlshortener_v1/service.rb +179 -0
  281. data/generated/google/apis/webmasters_v3.rb +37 -0
  282. data/generated/google/apis/webmasters_v3/classes.rb +563 -0
  283. data/generated/google/apis/webmasters_v3/representations.rb +250 -0
  284. data/generated/google/apis/webmasters_v3/service.rb +587 -0
  285. data/generated/google/apis/youtube_analytics_v1.rb +46 -0
  286. data/generated/google/apis/youtube_analytics_v1/classes.rb +540 -0
  287. data/generated/google/apis/youtube_analytics_v1/representations.rb +242 -0
  288. data/generated/google/apis/youtube_analytics_v1/service.rb +567 -0
  289. data/generated/google/apis/youtube_v3.rb +49 -0
  290. data/generated/google/apis/youtube_v3/classes.rb +7225 -0
  291. data/generated/google/apis/youtube_v3/representations.rb +2529 -0
  292. data/generated/google/apis/youtube_v3/service.rb +4051 -0
  293. data/google-api-client.gemspec +27 -39
  294. data/lib/google/api_client/auth/storage.rb +3 -2
  295. data/lib/google/api_client/auth/storages/file_store.rb +1 -3
  296. data/lib/google/api_client/auth/storages/redis_store.rb +6 -2
  297. data/lib/google/apis.rb +48 -0
  298. data/lib/google/apis/core/api_command.rb +128 -0
  299. data/lib/google/apis/core/base_service.rb +314 -0
  300. data/lib/google/apis/core/batch.rb +222 -0
  301. data/lib/google/apis/core/download.rb +94 -0
  302. data/lib/google/apis/core/hashable.rb +44 -0
  303. data/lib/google/apis/core/http_command.rb +275 -0
  304. data/lib/google/apis/core/json_representation.rb +122 -0
  305. data/lib/google/{api_client/version.rb → apis/core/logging.rb} +12 -8
  306. data/lib/google/apis/core/multipart.rb +173 -0
  307. data/lib/google/apis/core/upload.rb +275 -0
  308. data/lib/google/{api_client → apis}/errors.rb +32 -28
  309. data/lib/google/apis/generator.rb +70 -0
  310. data/lib/google/apis/generator/annotator.rb +271 -0
  311. data/lib/google/apis/generator/helpers.rb +74 -0
  312. data/lib/google/apis/generator/model.rb +130 -0
  313. data/lib/google/apis/generator/template.rb +124 -0
  314. data/lib/google/apis/generator/templates/_class.tmpl +40 -0
  315. data/lib/google/apis/generator/templates/_method.tmpl +90 -0
  316. data/lib/google/apis/generator/templates/_representation.tmpl +51 -0
  317. data/lib/google/apis/generator/templates/_representation_stub.tmpl +15 -0
  318. data/lib/google/apis/generator/templates/_representation_type.tmpl +10 -0
  319. data/lib/google/{api_client/reference.rb → apis/generator/templates/classes.rb.tmpl} +11 -9
  320. data/lib/google/apis/generator/templates/module.rb.tmpl +40 -0
  321. data/lib/google/apis/generator/templates/representations.rb.tmpl +32 -0
  322. data/lib/google/apis/generator/templates/service.rb.tmpl +60 -0
  323. data/lib/google/apis/options.rb +79 -0
  324. data/lib/google/apis/version.rb +39 -0
  325. data/rakelib/metrics.rake +22 -0
  326. data/rakelib/rubocop.rake +10 -0
  327. data/rakelib/spec.rake +11 -0
  328. data/rakelib/yard.rake +11 -0
  329. data/samples/calendar/calendar.rb +43 -0
  330. data/samples/drive/drive.rb +40 -0
  331. data/samples/pubsub/pubsub.rb +52 -0
  332. data/{lib/google/api_client/discovery.rb → samples/translate/translate.rb} +14 -5
  333. data/script/generate +79 -0
  334. data/script/package +8 -0
  335. data/script/release +15 -0
  336. data/spec/fixtures/files/api_names.yaml +3 -0
  337. data/spec/fixtures/files/auth_stored_credentials.json +8 -0
  338. data/spec/fixtures/files/client_secrets.json +1 -0
  339. data/spec/fixtures/files/test.blah +1 -0
  340. data/spec/fixtures/files/test.txt +1 -0
  341. data/spec/fixtures/files/test_api.json +440 -0
  342. data/spec/google/api_client/auth/storage_spec.rb +1 -3
  343. data/spec/google/api_client/auth/storages/file_store_spec.rb +1 -2
  344. data/spec/google/api_client/auth/storages/redis_store_spec.rb +1 -3
  345. data/spec/google/apis/core/api_command_spec.rb +170 -0
  346. data/spec/google/apis/core/batch_spec.rb +128 -0
  347. data/spec/google/apis/core/download_spec.rb +90 -0
  348. data/spec/google/apis/core/hashable_spec.rb +60 -0
  349. data/spec/google/apis/core/http_command_spec.rb +238 -0
  350. data/spec/google/apis/core/json_representation_spec.rb +192 -0
  351. data/spec/google/apis/core/service_spec.rb +247 -0
  352. data/spec/google/apis/core/upload_spec.rb +238 -0
  353. data/{lib/google/api_client/service_account.rb → spec/google/apis/generated_spec.rb} +14 -8
  354. data/spec/google/apis/generator/generator_spec.rb +272 -0
  355. data/spec/google/apis/logging_spec.rb +45 -0
  356. data/spec/google/apis/options_spec.rb +40 -0
  357. data/spec/integration_tests/drive_spec.rb +35 -0
  358. data/spec/integration_tests/pubsub_spec.rb +48 -0
  359. data/spec/integration_tests/url_shortener_spec.rb +31 -0
  360. data/spec/spec_helper.rb +102 -46
  361. metadata +433 -178
  362. data/lib/compat/multi_json.rb +0 -19
  363. data/lib/google/api_client.rb +0 -750
  364. data/lib/google/api_client/auth/file_storage.rb +0 -59
  365. data/lib/google/api_client/auth/jwt_asserter.rb +0 -126
  366. data/lib/google/api_client/auth/key_utils.rb +0 -93
  367. data/lib/google/api_client/auth/pkcs12.rb +0 -41
  368. data/lib/google/api_client/batch.rb +0 -326
  369. data/lib/google/api_client/charset.rb +0 -33
  370. data/lib/google/api_client/discovery/api.rb +0 -310
  371. data/lib/google/api_client/discovery/media.rb +0 -77
  372. data/lib/google/api_client/discovery/method.rb +0 -363
  373. data/lib/google/api_client/discovery/resource.rb +0 -156
  374. data/lib/google/api_client/discovery/schema.rb +0 -117
  375. data/lib/google/api_client/environment.rb +0 -42
  376. data/lib/google/api_client/gzip.rb +0 -28
  377. data/lib/google/api_client/logging.rb +0 -32
  378. data/lib/google/api_client/media.rb +0 -259
  379. data/lib/google/api_client/railtie.rb +0 -18
  380. data/lib/google/api_client/request.rb +0 -350
  381. data/lib/google/api_client/result.rb +0 -255
  382. data/lib/google/api_client/service.rb +0 -233
  383. data/lib/google/api_client/service/batch.rb +0 -110
  384. data/lib/google/api_client/service/request.rb +0 -144
  385. data/lib/google/api_client/service/resource.rb +0 -40
  386. data/lib/google/api_client/service/result.rb +0 -162
  387. data/lib/google/api_client/service/simple_file_store.rb +0 -151
  388. data/lib/google/api_client/service/stub_generator.rb +0 -61
  389. data/spec/google/api_client/batch_spec.rb +0 -248
  390. data/spec/google/api_client/discovery_spec.rb +0 -708
  391. data/spec/google/api_client/gzip_spec.rb +0 -98
  392. data/spec/google/api_client/media_spec.rb +0 -178
  393. data/spec/google/api_client/result_spec.rb +0 -207
  394. data/spec/google/api_client/service_account_spec.rb +0 -169
  395. data/spec/google/api_client/service_spec.rb +0 -618
  396. data/spec/google/api_client/simple_file_store_spec.rb +0 -133
  397. data/spec/google/api_client_spec.rb +0 -352
@@ -0,0 +1,1534 @@
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 SqladminV1beta4
23
+ # Cloud SQL Administration API
24
+ #
25
+ # API for Cloud SQL database instance management.
26
+ #
27
+ # @example
28
+ # require 'google/apis/sqladmin_v1beta4'
29
+ #
30
+ # Sqladmin = Google::Apis::SqladminV1beta4 # Alias the module
31
+ # service = Sqladmin::SQLAdminService.new
32
+ #
33
+ # @see https://cloud.google.com/sql/docs/reference/latest
34
+ class SQLAdminService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ # Overrides userIp if both are provided.
44
+ attr_accessor :quota_user
45
+
46
+ # @return [String]
47
+ # IP address of the site where the request originates. Use this if you want to
48
+ # enforce per-user limits.
49
+ attr_accessor :user_ip
50
+
51
+ def initialize
52
+ super('https://www.googleapis.com/', 'sql/v1beta4/')
53
+ end
54
+
55
+ # Retrieves a resource containing information about a backup run.
56
+ # @param [String] project
57
+ # Project ID of the project that contains the instance.
58
+ # @param [String] instance
59
+ # Cloud SQL instance ID. This does not include the project ID.
60
+ # @param [String] id
61
+ # The ID of this Backup Run.
62
+ # @param [String] fields
63
+ # Selector specifying which fields to include in a partial response.
64
+ # @param [String] quota_user
65
+ # Available to use for quota purposes for server-side applications. Can be any
66
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
67
+ # Overrides userIp if both are provided.
68
+ # @param [String] user_ip
69
+ # IP address of the site where the request originates. Use this if you want to
70
+ # enforce per-user limits.
71
+ # @param [Google::Apis::RequestOptions] options
72
+ # Request-specific options
73
+ #
74
+ # @yield [result, err] Result & error if block supplied
75
+ # @yieldparam result [Google::Apis::SqladminV1beta4::BackupRun] parsed result object
76
+ # @yieldparam err [StandardError] error object if request failed
77
+ #
78
+ # @return [Google::Apis::SqladminV1beta4::BackupRun]
79
+ #
80
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
81
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
82
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
83
+ def get_backup_run(project, instance, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
84
+ path = 'projects/{project}/instances/{instance}/backupRuns/{id}'
85
+ command = make_simple_command(:get, path, options)
86
+ command.response_representation = Google::Apis::SqladminV1beta4::BackupRun::Representation
87
+ command.response_class = Google::Apis::SqladminV1beta4::BackupRun
88
+ command.params['project'] = project unless project.nil?
89
+ command.params['instance'] = instance unless instance.nil?
90
+ command.params['id'] = id unless id.nil?
91
+ command.query['fields'] = fields unless fields.nil?
92
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
93
+ command.query['userIp'] = user_ip unless user_ip.nil?
94
+ execute_or_queue_command(command, &block)
95
+ end
96
+
97
+ # Lists all backup runs associated with a given instance and configuration in
98
+ # the reverse chronological order of the enqueued time.
99
+ # @param [String] project
100
+ # Project ID of the project that contains the instance.
101
+ # @param [String] instance
102
+ # Cloud SQL instance ID. This does not include the project ID.
103
+ # @param [Fixnum] max_results
104
+ # Maximum number of backup runs per response.
105
+ # @param [String] page_token
106
+ # A previously-returned page token representing part of the larger set of
107
+ # results to view.
108
+ # @param [String] fields
109
+ # Selector specifying which fields to include in a partial response.
110
+ # @param [String] quota_user
111
+ # Available to use for quota purposes for server-side applications. Can be any
112
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
113
+ # Overrides userIp if both are provided.
114
+ # @param [String] user_ip
115
+ # IP address of the site where the request originates. Use this if you want to
116
+ # enforce per-user limits.
117
+ # @param [Google::Apis::RequestOptions] options
118
+ # Request-specific options
119
+ #
120
+ # @yield [result, err] Result & error if block supplied
121
+ # @yieldparam result [Google::Apis::SqladminV1beta4::ListBackupRunsResponse] parsed result object
122
+ # @yieldparam err [StandardError] error object if request failed
123
+ #
124
+ # @return [Google::Apis::SqladminV1beta4::ListBackupRunsResponse]
125
+ #
126
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
127
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
128
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
129
+ def list_backup_runs(project, instance, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
130
+ path = 'projects/{project}/instances/{instance}/backupRuns'
131
+ command = make_simple_command(:get, path, options)
132
+ command.response_representation = Google::Apis::SqladminV1beta4::ListBackupRunsResponse::Representation
133
+ command.response_class = Google::Apis::SqladminV1beta4::ListBackupRunsResponse
134
+ command.params['project'] = project unless project.nil?
135
+ command.params['instance'] = instance unless instance.nil?
136
+ command.query['maxResults'] = max_results unless max_results.nil?
137
+ command.query['pageToken'] = page_token unless page_token.nil?
138
+ command.query['fields'] = fields unless fields.nil?
139
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
140
+ command.query['userIp'] = user_ip unless user_ip.nil?
141
+ execute_or_queue_command(command, &block)
142
+ end
143
+
144
+ # Deletes a resource containing information about a database inside a Cloud SQL
145
+ # instance.
146
+ # @param [String] project
147
+ # Project ID of the project that contains the instance.
148
+ # @param [String] instance
149
+ # Database instance ID. This does not include the project ID.
150
+ # @param [String] database
151
+ # Name of the database to be deleted in the instance.
152
+ # @param [String] fields
153
+ # Selector specifying which fields to include in a partial response.
154
+ # @param [String] quota_user
155
+ # Available to use for quota purposes for server-side applications. Can be any
156
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
157
+ # Overrides userIp if both are provided.
158
+ # @param [String] user_ip
159
+ # IP address of the site where the request originates. Use this if you want to
160
+ # enforce per-user limits.
161
+ # @param [Google::Apis::RequestOptions] options
162
+ # Request-specific options
163
+ #
164
+ # @yield [result, err] Result & error if block supplied
165
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
166
+ # @yieldparam err [StandardError] error object if request failed
167
+ #
168
+ # @return [Google::Apis::SqladminV1beta4::Operation]
169
+ #
170
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
171
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
172
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
173
+ def delete_database(project, instance, database, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
174
+ path = 'projects/{project}/instances/{instance}/databases/{database}'
175
+ command = make_simple_command(:delete, path, options)
176
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
177
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
178
+ command.params['project'] = project unless project.nil?
179
+ command.params['instance'] = instance unless instance.nil?
180
+ command.params['database'] = database unless database.nil?
181
+ command.query['fields'] = fields unless fields.nil?
182
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
183
+ command.query['userIp'] = user_ip unless user_ip.nil?
184
+ execute_or_queue_command(command, &block)
185
+ end
186
+
187
+ # Retrieves a resource containing information about a database inside a Cloud
188
+ # SQL instance.
189
+ # @param [String] project
190
+ # Project ID of the project that contains the instance.
191
+ # @param [String] instance
192
+ # Database instance ID. This does not include the project ID.
193
+ # @param [String] database
194
+ # Name of the database in the instance.
195
+ # @param [String] fields
196
+ # Selector specifying which fields to include in a partial response.
197
+ # @param [String] quota_user
198
+ # Available to use for quota purposes for server-side applications. Can be any
199
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
200
+ # Overrides userIp if both are provided.
201
+ # @param [String] user_ip
202
+ # IP address of the site where the request originates. Use this if you want to
203
+ # enforce per-user limits.
204
+ # @param [Google::Apis::RequestOptions] options
205
+ # Request-specific options
206
+ #
207
+ # @yield [result, err] Result & error if block supplied
208
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Database] parsed result object
209
+ # @yieldparam err [StandardError] error object if request failed
210
+ #
211
+ # @return [Google::Apis::SqladminV1beta4::Database]
212
+ #
213
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
214
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
215
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
216
+ def get_database(project, instance, database, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
217
+ path = 'projects/{project}/instances/{instance}/databases/{database}'
218
+ command = make_simple_command(:get, path, options)
219
+ command.response_representation = Google::Apis::SqladminV1beta4::Database::Representation
220
+ command.response_class = Google::Apis::SqladminV1beta4::Database
221
+ command.params['project'] = project unless project.nil?
222
+ command.params['instance'] = instance unless instance.nil?
223
+ command.params['database'] = database unless database.nil?
224
+ command.query['fields'] = fields unless fields.nil?
225
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
226
+ command.query['userIp'] = user_ip unless user_ip.nil?
227
+ execute_or_queue_command(command, &block)
228
+ end
229
+
230
+ # Inserts a resource containing information about a database inside a Cloud SQL
231
+ # instance.
232
+ # @param [String] project
233
+ # Project ID of the project that contains the instance.
234
+ # @param [String] instance
235
+ # Database instance ID. This does not include the project ID.
236
+ # @param [Google::Apis::SqladminV1beta4::Database] database_object
237
+ # @param [String] fields
238
+ # Selector specifying which fields to include in a partial response.
239
+ # @param [String] quota_user
240
+ # Available to use for quota purposes for server-side applications. Can be any
241
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
242
+ # Overrides userIp if both are provided.
243
+ # @param [String] user_ip
244
+ # IP address of the site where the request originates. Use this if you want to
245
+ # enforce per-user limits.
246
+ # @param [Google::Apis::RequestOptions] options
247
+ # Request-specific options
248
+ #
249
+ # @yield [result, err] Result & error if block supplied
250
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
251
+ # @yieldparam err [StandardError] error object if request failed
252
+ #
253
+ # @return [Google::Apis::SqladminV1beta4::Operation]
254
+ #
255
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
256
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
257
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
258
+ def insert_database(project, instance, database_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
259
+ path = 'projects/{project}/instances/{instance}/databases'
260
+ command = make_simple_command(:post, path, options)
261
+ command.request_representation = Google::Apis::SqladminV1beta4::Database::Representation
262
+ command.request_object = database_object
263
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
264
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
265
+ command.params['project'] = project unless project.nil?
266
+ command.params['instance'] = instance unless instance.nil?
267
+ command.query['fields'] = fields unless fields.nil?
268
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
269
+ command.query['userIp'] = user_ip unless user_ip.nil?
270
+ execute_or_queue_command(command, &block)
271
+ end
272
+
273
+ # Lists databases in the specified Cloud SQL instance.
274
+ # @param [String] project
275
+ # Project ID of the project for which to list Cloud SQL instances.
276
+ # @param [String] instance
277
+ # Cloud SQL instance ID. This does not include the project ID.
278
+ # @param [String] fields
279
+ # Selector specifying which fields to include in a partial response.
280
+ # @param [String] quota_user
281
+ # Available to use for quota purposes for server-side applications. Can be any
282
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
283
+ # Overrides userIp if both are provided.
284
+ # @param [String] user_ip
285
+ # IP address of the site where the request originates. Use this if you want to
286
+ # enforce per-user limits.
287
+ # @param [Google::Apis::RequestOptions] options
288
+ # Request-specific options
289
+ #
290
+ # @yield [result, err] Result & error if block supplied
291
+ # @yieldparam result [Google::Apis::SqladminV1beta4::ListDatabasesResponse] parsed result object
292
+ # @yieldparam err [StandardError] error object if request failed
293
+ #
294
+ # @return [Google::Apis::SqladminV1beta4::ListDatabasesResponse]
295
+ #
296
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
297
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
298
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
299
+ def list_databases(project, instance, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
300
+ path = 'projects/{project}/instances/{instance}/databases'
301
+ command = make_simple_command(:get, path, options)
302
+ command.response_representation = Google::Apis::SqladminV1beta4::ListDatabasesResponse::Representation
303
+ command.response_class = Google::Apis::SqladminV1beta4::ListDatabasesResponse
304
+ command.params['project'] = project unless project.nil?
305
+ command.params['instance'] = instance unless instance.nil?
306
+ command.query['fields'] = fields unless fields.nil?
307
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
308
+ command.query['userIp'] = user_ip unless user_ip.nil?
309
+ execute_or_queue_command(command, &block)
310
+ end
311
+
312
+ # Updates a resource containing information about a database inside a Cloud SQL
313
+ # instance. This method supports patch semantics.
314
+ # @param [String] project
315
+ # Project ID of the project that contains the instance.
316
+ # @param [String] instance
317
+ # Database instance ID. This does not include the project ID.
318
+ # @param [String] database
319
+ # Name of the database to be updated in the instance.
320
+ # @param [Google::Apis::SqladminV1beta4::Database] database_object
321
+ # @param [String] fields
322
+ # Selector specifying which fields to include in a partial response.
323
+ # @param [String] quota_user
324
+ # Available to use for quota purposes for server-side applications. Can be any
325
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
326
+ # Overrides userIp if both are provided.
327
+ # @param [String] user_ip
328
+ # IP address of the site where the request originates. Use this if you want to
329
+ # enforce per-user limits.
330
+ # @param [Google::Apis::RequestOptions] options
331
+ # Request-specific options
332
+ #
333
+ # @yield [result, err] Result & error if block supplied
334
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
335
+ # @yieldparam err [StandardError] error object if request failed
336
+ #
337
+ # @return [Google::Apis::SqladminV1beta4::Operation]
338
+ #
339
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
340
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
341
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
342
+ def patch_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
343
+ path = 'projects/{project}/instances/{instance}/databases/{database}'
344
+ command = make_simple_command(:patch, path, options)
345
+ command.request_representation = Google::Apis::SqladminV1beta4::Database::Representation
346
+ command.request_object = database_object
347
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
348
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
349
+ command.params['project'] = project unless project.nil?
350
+ command.params['instance'] = instance unless instance.nil?
351
+ command.params['database'] = database unless database.nil?
352
+ command.query['fields'] = fields unless fields.nil?
353
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
354
+ command.query['userIp'] = user_ip unless user_ip.nil?
355
+ execute_or_queue_command(command, &block)
356
+ end
357
+
358
+ # Updates a resource containing information about a database inside a Cloud SQL
359
+ # instance.
360
+ # @param [String] project
361
+ # Project ID of the project that contains the instance.
362
+ # @param [String] instance
363
+ # Database instance ID. This does not include the project ID.
364
+ # @param [String] database
365
+ # Name of the database to be updated in the instance.
366
+ # @param [Google::Apis::SqladminV1beta4::Database] database_object
367
+ # @param [String] fields
368
+ # Selector specifying which fields to include in a partial response.
369
+ # @param [String] quota_user
370
+ # Available to use for quota purposes for server-side applications. Can be any
371
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
372
+ # Overrides userIp if both are provided.
373
+ # @param [String] user_ip
374
+ # IP address of the site where the request originates. Use this if you want to
375
+ # enforce per-user limits.
376
+ # @param [Google::Apis::RequestOptions] options
377
+ # Request-specific options
378
+ #
379
+ # @yield [result, err] Result & error if block supplied
380
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
381
+ # @yieldparam err [StandardError] error object if request failed
382
+ #
383
+ # @return [Google::Apis::SqladminV1beta4::Operation]
384
+ #
385
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
386
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
387
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
388
+ def update_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
389
+ path = 'projects/{project}/instances/{instance}/databases/{database}'
390
+ command = make_simple_command(:put, path, options)
391
+ command.request_representation = Google::Apis::SqladminV1beta4::Database::Representation
392
+ command.request_object = database_object
393
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
394
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
395
+ command.params['project'] = project unless project.nil?
396
+ command.params['instance'] = instance unless instance.nil?
397
+ command.params['database'] = database unless database.nil?
398
+ command.query['fields'] = fields unless fields.nil?
399
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
400
+ command.query['userIp'] = user_ip unless user_ip.nil?
401
+ execute_or_queue_command(command, &block)
402
+ end
403
+
404
+ # List all available database flags for Google Cloud SQL instances.
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
+ # Overrides userIp if both are provided.
411
+ # @param [String] user_ip
412
+ # IP address of the site where the request originates. Use this if you want to
413
+ # enforce per-user limits.
414
+ # @param [Google::Apis::RequestOptions] options
415
+ # Request-specific options
416
+ #
417
+ # @yield [result, err] Result & error if block supplied
418
+ # @yieldparam result [Google::Apis::SqladminV1beta4::ListFlagsResponse] parsed result object
419
+ # @yieldparam err [StandardError] error object if request failed
420
+ #
421
+ # @return [Google::Apis::SqladminV1beta4::ListFlagsResponse]
422
+ #
423
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
424
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
425
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
426
+ def list_flags(fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
427
+ path = 'flags'
428
+ command = make_simple_command(:get, path, options)
429
+ command.response_representation = Google::Apis::SqladminV1beta4::ListFlagsResponse::Representation
430
+ command.response_class = Google::Apis::SqladminV1beta4::ListFlagsResponse
431
+ command.query['fields'] = fields unless fields.nil?
432
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
433
+ command.query['userIp'] = user_ip unless user_ip.nil?
434
+ execute_or_queue_command(command, &block)
435
+ end
436
+
437
+ # Creates a Cloud SQL instance as a clone of the source instance.
438
+ # @param [String] project
439
+ # Project ID of the source as well as the clone Cloud SQL instance.
440
+ # @param [String] instance
441
+ # The ID of the Cloud SQL instance to be cloned (source). This does not include
442
+ # the project ID.
443
+ # @param [Google::Apis::SqladminV1beta4::CloneInstancesRequest] clone_instances_request_object
444
+ # @param [String] fields
445
+ # Selector specifying which fields to include in a partial response.
446
+ # @param [String] quota_user
447
+ # Available to use for quota purposes for server-side applications. Can be any
448
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
449
+ # Overrides userIp if both are provided.
450
+ # @param [String] user_ip
451
+ # IP address of the site where the request originates. Use this if you want to
452
+ # enforce per-user limits.
453
+ # @param [Google::Apis::RequestOptions] options
454
+ # Request-specific options
455
+ #
456
+ # @yield [result, err] Result & error if block supplied
457
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
458
+ # @yieldparam err [StandardError] error object if request failed
459
+ #
460
+ # @return [Google::Apis::SqladminV1beta4::Operation]
461
+ #
462
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
463
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
464
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
465
+ def clone_instance(project, instance, clone_instances_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
466
+ path = 'projects/{project}/instances/{instance}/clone'
467
+ command = make_simple_command(:post, path, options)
468
+ command.request_representation = Google::Apis::SqladminV1beta4::CloneInstancesRequest::Representation
469
+ command.request_object = clone_instances_request_object
470
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
471
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
472
+ command.params['project'] = project unless project.nil?
473
+ command.params['instance'] = instance unless instance.nil?
474
+ command.query['fields'] = fields unless fields.nil?
475
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
476
+ command.query['userIp'] = user_ip unless user_ip.nil?
477
+ execute_or_queue_command(command, &block)
478
+ end
479
+
480
+ # Deletes a Cloud SQL instance.
481
+ # @param [String] project
482
+ # Project ID of the project that contains the instance to be deleted.
483
+ # @param [String] instance
484
+ # Cloud SQL instance ID. This does not include the project ID.
485
+ # @param [String] fields
486
+ # Selector specifying which fields to include in a partial response.
487
+ # @param [String] quota_user
488
+ # Available to use for quota purposes for server-side applications. Can be any
489
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
490
+ # Overrides userIp if both are provided.
491
+ # @param [String] user_ip
492
+ # IP address of the site where the request originates. Use this if you want to
493
+ # enforce per-user limits.
494
+ # @param [Google::Apis::RequestOptions] options
495
+ # Request-specific options
496
+ #
497
+ # @yield [result, err] Result & error if block supplied
498
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
499
+ # @yieldparam err [StandardError] error object if request failed
500
+ #
501
+ # @return [Google::Apis::SqladminV1beta4::Operation]
502
+ #
503
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
504
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
505
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
506
+ def delete_instance(project, instance, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
507
+ path = 'projects/{project}/instances/{instance}'
508
+ command = make_simple_command(:delete, path, options)
509
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
510
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
511
+ command.params['project'] = project unless project.nil?
512
+ command.params['instance'] = instance unless instance.nil?
513
+ command.query['fields'] = fields unless fields.nil?
514
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
515
+ command.query['userIp'] = user_ip unless user_ip.nil?
516
+ execute_or_queue_command(command, &block)
517
+ end
518
+
519
+ # Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as a
520
+ # MySQL dump file.
521
+ # @param [String] project
522
+ # Project ID of the project that contains the instance to be exported.
523
+ # @param [String] instance
524
+ # Cloud SQL instance ID. This does not include the project ID.
525
+ # @param [Google::Apis::SqladminV1beta4::ExportInstancesRequest] export_instances_request_object
526
+ # @param [String] fields
527
+ # Selector specifying which fields to include in a partial response.
528
+ # @param [String] quota_user
529
+ # Available to use for quota purposes for server-side applications. Can be any
530
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
531
+ # Overrides userIp if both are provided.
532
+ # @param [String] user_ip
533
+ # IP address of the site where the request originates. Use this if you want to
534
+ # enforce per-user limits.
535
+ # @param [Google::Apis::RequestOptions] options
536
+ # Request-specific options
537
+ #
538
+ # @yield [result, err] Result & error if block supplied
539
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
540
+ # @yieldparam err [StandardError] error object if request failed
541
+ #
542
+ # @return [Google::Apis::SqladminV1beta4::Operation]
543
+ #
544
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
545
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
546
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
547
+ def export_instance(project, instance, export_instances_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
548
+ path = 'projects/{project}/instances/{instance}/export'
549
+ command = make_simple_command(:post, path, options)
550
+ command.request_representation = Google::Apis::SqladminV1beta4::ExportInstancesRequest::Representation
551
+ command.request_object = export_instances_request_object
552
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
553
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
554
+ command.params['project'] = project unless project.nil?
555
+ command.params['instance'] = instance unless instance.nil?
556
+ command.query['fields'] = fields unless fields.nil?
557
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
558
+ command.query['userIp'] = user_ip unless user_ip.nil?
559
+ execute_or_queue_command(command, &block)
560
+ end
561
+
562
+ # Retrieves a resource containing information about a Cloud SQL instance.
563
+ # @param [String] project
564
+ # Project ID of the project that contains the instance.
565
+ # @param [String] instance
566
+ # Database instance ID. This does not include the project ID.
567
+ # @param [String] fields
568
+ # Selector specifying which fields to include in a partial response.
569
+ # @param [String] quota_user
570
+ # Available to use for quota purposes for server-side applications. Can be any
571
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
572
+ # Overrides userIp if both are provided.
573
+ # @param [String] user_ip
574
+ # IP address of the site where the request originates. Use this if you want to
575
+ # enforce per-user limits.
576
+ # @param [Google::Apis::RequestOptions] options
577
+ # Request-specific options
578
+ #
579
+ # @yield [result, err] Result & error if block supplied
580
+ # @yieldparam result [Google::Apis::SqladminV1beta4::DatabaseInstance] parsed result object
581
+ # @yieldparam err [StandardError] error object if request failed
582
+ #
583
+ # @return [Google::Apis::SqladminV1beta4::DatabaseInstance]
584
+ #
585
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
586
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
587
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
588
+ def get_instance(project, instance, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
589
+ path = 'projects/{project}/instances/{instance}'
590
+ command = make_simple_command(:get, path, options)
591
+ command.response_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
592
+ command.response_class = Google::Apis::SqladminV1beta4::DatabaseInstance
593
+ command.params['project'] = project unless project.nil?
594
+ command.params['instance'] = instance unless instance.nil?
595
+ command.query['fields'] = fields unless fields.nil?
596
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
597
+ command.query['userIp'] = user_ip unless user_ip.nil?
598
+ execute_or_queue_command(command, &block)
599
+ end
600
+
601
+ # Imports data into a Cloud SQL instance from a MySQL dump file in Google Cloud
602
+ # Storage.
603
+ # @param [String] project
604
+ # Project ID of the project that contains the instance.
605
+ # @param [String] instance
606
+ # Cloud SQL instance ID. This does not include the project ID.
607
+ # @param [Google::Apis::SqladminV1beta4::ImportInstancesRequest] import_instances_request_object
608
+ # @param [String] fields
609
+ # Selector specifying which fields to include in a partial response.
610
+ # @param [String] quota_user
611
+ # Available to use for quota purposes for server-side applications. Can be any
612
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
613
+ # Overrides userIp if both are provided.
614
+ # @param [String] user_ip
615
+ # IP address of the site where the request originates. Use this if you want to
616
+ # enforce per-user limits.
617
+ # @param [Google::Apis::RequestOptions] options
618
+ # Request-specific options
619
+ #
620
+ # @yield [result, err] Result & error if block supplied
621
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
622
+ # @yieldparam err [StandardError] error object if request failed
623
+ #
624
+ # @return [Google::Apis::SqladminV1beta4::Operation]
625
+ #
626
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
627
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
628
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
629
+ def import_instance(project, instance, import_instances_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
630
+ path = 'projects/{project}/instances/{instance}/import'
631
+ command = make_simple_command(:post, path, options)
632
+ command.request_representation = Google::Apis::SqladminV1beta4::ImportInstancesRequest::Representation
633
+ command.request_object = import_instances_request_object
634
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
635
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
636
+ command.params['project'] = project unless project.nil?
637
+ command.params['instance'] = instance unless instance.nil?
638
+ command.query['fields'] = fields unless fields.nil?
639
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
640
+ command.query['userIp'] = user_ip unless user_ip.nil?
641
+ execute_or_queue_command(command, &block)
642
+ end
643
+
644
+ # Creates a new Cloud SQL instance.
645
+ # @param [String] project
646
+ # Project ID of the project to which the newly created Cloud SQL instances
647
+ # should belong.
648
+ # @param [Google::Apis::SqladminV1beta4::DatabaseInstance] database_instance_object
649
+ # @param [String] fields
650
+ # Selector specifying which fields to include in a partial response.
651
+ # @param [String] quota_user
652
+ # Available to use for quota purposes for server-side applications. Can be any
653
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
654
+ # Overrides userIp if both are provided.
655
+ # @param [String] user_ip
656
+ # IP address of the site where the request originates. Use this if you want to
657
+ # enforce per-user limits.
658
+ # @param [Google::Apis::RequestOptions] options
659
+ # Request-specific options
660
+ #
661
+ # @yield [result, err] Result & error if block supplied
662
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
663
+ # @yieldparam err [StandardError] error object if request failed
664
+ #
665
+ # @return [Google::Apis::SqladminV1beta4::Operation]
666
+ #
667
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
668
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
669
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
670
+ def insert_instance(project, database_instance_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
671
+ path = 'projects/{project}/instances'
672
+ command = make_simple_command(:post, path, options)
673
+ command.request_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
674
+ command.request_object = database_instance_object
675
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
676
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
677
+ command.params['project'] = project unless project.nil?
678
+ command.query['fields'] = fields unless fields.nil?
679
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
680
+ command.query['userIp'] = user_ip unless user_ip.nil?
681
+ execute_or_queue_command(command, &block)
682
+ end
683
+
684
+ # Lists instances under a given project in the alphabetical order of the
685
+ # instance name.
686
+ # @param [String] project
687
+ # Project ID of the project for which to list Cloud SQL instances.
688
+ # @param [Fixnum] max_results
689
+ # The maximum number of results to return per response.
690
+ # @param [String] page_token
691
+ # A previously-returned page token representing part of the larger set of
692
+ # results to view.
693
+ # @param [String] fields
694
+ # Selector specifying which fields to include in a partial response.
695
+ # @param [String] quota_user
696
+ # Available to use for quota purposes for server-side applications. Can be any
697
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
698
+ # Overrides userIp if both are provided.
699
+ # @param [String] user_ip
700
+ # IP address of the site where the request originates. Use this if you want to
701
+ # enforce per-user limits.
702
+ # @param [Google::Apis::RequestOptions] options
703
+ # Request-specific options
704
+ #
705
+ # @yield [result, err] Result & error if block supplied
706
+ # @yieldparam result [Google::Apis::SqladminV1beta4::ListInstancesResponse] parsed result object
707
+ # @yieldparam err [StandardError] error object if request failed
708
+ #
709
+ # @return [Google::Apis::SqladminV1beta4::ListInstancesResponse]
710
+ #
711
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
712
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
713
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
714
+ def list_instances(project, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
715
+ path = 'projects/{project}/instances'
716
+ command = make_simple_command(:get, path, options)
717
+ command.response_representation = Google::Apis::SqladminV1beta4::ListInstancesResponse::Representation
718
+ command.response_class = Google::Apis::SqladminV1beta4::ListInstancesResponse
719
+ command.params['project'] = project unless project.nil?
720
+ command.query['maxResults'] = max_results unless max_results.nil?
721
+ command.query['pageToken'] = page_token unless page_token.nil?
722
+ command.query['fields'] = fields unless fields.nil?
723
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
724
+ command.query['userIp'] = user_ip unless user_ip.nil?
725
+ execute_or_queue_command(command, &block)
726
+ end
727
+
728
+ # Updates settings of a Cloud SQL instance. Caution: This is not a partial
729
+ # update, so you must include values for all the settings that you want to
730
+ # retain. For partial updates, use patch.. This method supports patch semantics.
731
+ # @param [String] project
732
+ # Project ID of the project that contains the instance.
733
+ # @param [String] instance
734
+ # Cloud SQL instance ID. This does not include the project ID.
735
+ # @param [Google::Apis::SqladminV1beta4::DatabaseInstance] database_instance_object
736
+ # @param [String] fields
737
+ # Selector specifying which fields to include in a partial response.
738
+ # @param [String] quota_user
739
+ # Available to use for quota purposes for server-side applications. Can be any
740
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
741
+ # Overrides userIp if both are provided.
742
+ # @param [String] user_ip
743
+ # IP address of the site where the request originates. Use this if you want to
744
+ # enforce per-user limits.
745
+ # @param [Google::Apis::RequestOptions] options
746
+ # Request-specific options
747
+ #
748
+ # @yield [result, err] Result & error if block supplied
749
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
750
+ # @yieldparam err [StandardError] error object if request failed
751
+ #
752
+ # @return [Google::Apis::SqladminV1beta4::Operation]
753
+ #
754
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
755
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
756
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
757
+ def patch_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
758
+ path = 'projects/{project}/instances/{instance}'
759
+ command = make_simple_command(:patch, path, options)
760
+ command.request_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
761
+ command.request_object = database_instance_object
762
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
763
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
764
+ command.params['project'] = project unless project.nil?
765
+ command.params['instance'] = instance unless instance.nil?
766
+ command.query['fields'] = fields unless fields.nil?
767
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
768
+ command.query['userIp'] = user_ip unless user_ip.nil?
769
+ execute_or_queue_command(command, &block)
770
+ end
771
+
772
+ # Promotes the read replica instance to be a stand-alone Cloud SQL instance.
773
+ # @param [String] project
774
+ # ID of the project that contains the read replica.
775
+ # @param [String] instance
776
+ # Cloud SQL read replica instance name.
777
+ # @param [String] fields
778
+ # Selector specifying which fields to include in a partial response.
779
+ # @param [String] quota_user
780
+ # Available to use for quota purposes for server-side applications. Can be any
781
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
782
+ # Overrides userIp if both are provided.
783
+ # @param [String] user_ip
784
+ # IP address of the site where the request originates. Use this if you want to
785
+ # enforce per-user limits.
786
+ # @param [Google::Apis::RequestOptions] options
787
+ # Request-specific options
788
+ #
789
+ # @yield [result, err] Result & error if block supplied
790
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
791
+ # @yieldparam err [StandardError] error object if request failed
792
+ #
793
+ # @return [Google::Apis::SqladminV1beta4::Operation]
794
+ #
795
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
796
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
797
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
798
+ def promote_replica_instance(project, instance, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
799
+ path = 'projects/{project}/instances/{instance}/promoteReplica'
800
+ command = make_simple_command(:post, path, options)
801
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
802
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
803
+ command.params['project'] = project unless project.nil?
804
+ command.params['instance'] = instance unless instance.nil?
805
+ command.query['fields'] = fields unless fields.nil?
806
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
807
+ command.query['userIp'] = user_ip unless user_ip.nil?
808
+ execute_or_queue_command(command, &block)
809
+ end
810
+
811
+ # Deletes all client certificates and generates a new server SSL certificate for
812
+ # the instance. The changes will not take effect until the instance is restarted.
813
+ # Existing instances without a server certificate will need to call this once
814
+ # to set a server certificate.
815
+ # @param [String] project
816
+ # Project ID of the project that contains the instance.
817
+ # @param [String] instance
818
+ # Cloud SQL instance ID. This does not include the project ID.
819
+ # @param [String] fields
820
+ # Selector specifying which fields to include in a partial response.
821
+ # @param [String] quota_user
822
+ # Available to use for quota purposes for server-side applications. Can be any
823
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
824
+ # Overrides userIp if both are provided.
825
+ # @param [String] user_ip
826
+ # IP address of the site where the request originates. Use this if you want to
827
+ # enforce per-user limits.
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::SqladminV1beta4::Operation] parsed result object
833
+ # @yieldparam err [StandardError] error object if request failed
834
+ #
835
+ # @return [Google::Apis::SqladminV1beta4::Operation]
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 reset_ssl_config_instance(project, instance, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
841
+ path = 'projects/{project}/instances/{instance}/resetSslConfig'
842
+ command = make_simple_command(:post, path, options)
843
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
844
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
845
+ command.params['project'] = project unless project.nil?
846
+ command.params['instance'] = instance unless instance.nil?
847
+ command.query['fields'] = fields unless fields.nil?
848
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
849
+ command.query['userIp'] = user_ip unless user_ip.nil?
850
+ execute_or_queue_command(command, &block)
851
+ end
852
+
853
+ # Restarts a Cloud SQL instance.
854
+ # @param [String] project
855
+ # Project ID of the project that contains the instance to be restarted.
856
+ # @param [String] instance
857
+ # Cloud SQL instance ID. This does not include the project ID.
858
+ # @param [String] fields
859
+ # Selector specifying which fields to include in a partial response.
860
+ # @param [String] quota_user
861
+ # Available to use for quota purposes for server-side applications. Can be any
862
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
863
+ # Overrides userIp if both are provided.
864
+ # @param [String] user_ip
865
+ # IP address of the site where the request originates. Use this if you want to
866
+ # enforce per-user limits.
867
+ # @param [Google::Apis::RequestOptions] options
868
+ # Request-specific options
869
+ #
870
+ # @yield [result, err] Result & error if block supplied
871
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
872
+ # @yieldparam err [StandardError] error object if request failed
873
+ #
874
+ # @return [Google::Apis::SqladminV1beta4::Operation]
875
+ #
876
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
877
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
878
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
879
+ def restart_instance(project, instance, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
880
+ path = 'projects/{project}/instances/{instance}/restart'
881
+ command = make_simple_command(:post, path, options)
882
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
883
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
884
+ command.params['project'] = project unless project.nil?
885
+ command.params['instance'] = instance unless instance.nil?
886
+ command.query['fields'] = fields unless fields.nil?
887
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
888
+ command.query['userIp'] = user_ip unless user_ip.nil?
889
+ execute_or_queue_command(command, &block)
890
+ end
891
+
892
+ # Restores a backup of a Cloud SQL instance.
893
+ # @param [String] project
894
+ # Project ID of the project that contains the instance.
895
+ # @param [String] instance
896
+ # Cloud SQL instance ID. This does not include the project ID.
897
+ # @param [Google::Apis::SqladminV1beta4::RestoreInstancesBackupRequest] restore_instances_backup_request_object
898
+ # @param [String] fields
899
+ # Selector specifying which fields to include in a partial response.
900
+ # @param [String] quota_user
901
+ # Available to use for quota purposes for server-side applications. Can be any
902
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
903
+ # Overrides userIp if both are provided.
904
+ # @param [String] user_ip
905
+ # IP address of the site where the request originates. Use this if you want to
906
+ # enforce per-user limits.
907
+ # @param [Google::Apis::RequestOptions] options
908
+ # Request-specific options
909
+ #
910
+ # @yield [result, err] Result & error if block supplied
911
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
912
+ # @yieldparam err [StandardError] error object if request failed
913
+ #
914
+ # @return [Google::Apis::SqladminV1beta4::Operation]
915
+ #
916
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
917
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
918
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
919
+ def restore_backup_instance(project, instance, restore_instances_backup_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
920
+ path = 'projects/{project}/instances/{instance}/restoreBackup'
921
+ command = make_simple_command(:post, path, options)
922
+ command.request_representation = Google::Apis::SqladminV1beta4::RestoreInstancesBackupRequest::Representation
923
+ command.request_object = restore_instances_backup_request_object
924
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
925
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
926
+ command.params['project'] = project unless project.nil?
927
+ command.params['instance'] = instance unless instance.nil?
928
+ command.query['fields'] = fields unless fields.nil?
929
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
930
+ command.query['userIp'] = user_ip unless user_ip.nil?
931
+ execute_or_queue_command(command, &block)
932
+ end
933
+
934
+ # Starts the replication in the read replica instance.
935
+ # @param [String] project
936
+ # ID of the project that contains the read replica.
937
+ # @param [String] instance
938
+ # Cloud SQL read replica instance name.
939
+ # @param [String] fields
940
+ # Selector specifying which fields to include in a partial response.
941
+ # @param [String] quota_user
942
+ # Available to use for quota purposes for server-side applications. Can be any
943
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
944
+ # Overrides userIp if both are provided.
945
+ # @param [String] user_ip
946
+ # IP address of the site where the request originates. Use this if you want to
947
+ # enforce per-user limits.
948
+ # @param [Google::Apis::RequestOptions] options
949
+ # Request-specific options
950
+ #
951
+ # @yield [result, err] Result & error if block supplied
952
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
953
+ # @yieldparam err [StandardError] error object if request failed
954
+ #
955
+ # @return [Google::Apis::SqladminV1beta4::Operation]
956
+ #
957
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
958
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
959
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
960
+ def start_replica_instance(project, instance, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
961
+ path = 'projects/{project}/instances/{instance}/startReplica'
962
+ command = make_simple_command(:post, path, options)
963
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
964
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
965
+ command.params['project'] = project unless project.nil?
966
+ command.params['instance'] = instance unless instance.nil?
967
+ command.query['fields'] = fields unless fields.nil?
968
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
969
+ command.query['userIp'] = user_ip unless user_ip.nil?
970
+ execute_or_queue_command(command, &block)
971
+ end
972
+
973
+ # Stops the replication in the read replica instance.
974
+ # @param [String] project
975
+ # ID of the project that contains the read replica.
976
+ # @param [String] instance
977
+ # Cloud SQL read replica instance name.
978
+ # @param [String] fields
979
+ # Selector specifying which fields to include in a partial response.
980
+ # @param [String] quota_user
981
+ # Available to use for quota purposes for server-side applications. Can be any
982
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
983
+ # Overrides userIp if both are provided.
984
+ # @param [String] user_ip
985
+ # IP address of the site where the request originates. Use this if you want to
986
+ # enforce per-user limits.
987
+ # @param [Google::Apis::RequestOptions] options
988
+ # Request-specific options
989
+ #
990
+ # @yield [result, err] Result & error if block supplied
991
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
992
+ # @yieldparam err [StandardError] error object if request failed
993
+ #
994
+ # @return [Google::Apis::SqladminV1beta4::Operation]
995
+ #
996
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
997
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
998
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
999
+ def stop_replica_instance(project, instance, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1000
+ path = 'projects/{project}/instances/{instance}/stopReplica'
1001
+ command = make_simple_command(:post, path, options)
1002
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1003
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1004
+ command.params['project'] = project unless project.nil?
1005
+ command.params['instance'] = instance unless instance.nil?
1006
+ command.query['fields'] = fields unless fields.nil?
1007
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1008
+ command.query['userIp'] = user_ip unless user_ip.nil?
1009
+ execute_or_queue_command(command, &block)
1010
+ end
1011
+
1012
+ # Updates settings of a Cloud SQL instance. Caution: This is not a partial
1013
+ # update, so you must include values for all the settings that you want to
1014
+ # retain. For partial updates, use patch.
1015
+ # @param [String] project
1016
+ # Project ID of the project that contains the instance.
1017
+ # @param [String] instance
1018
+ # Cloud SQL instance ID. This does not include the project ID.
1019
+ # @param [Google::Apis::SqladminV1beta4::DatabaseInstance] database_instance_object
1020
+ # @param [String] fields
1021
+ # Selector specifying which fields to include in a partial response.
1022
+ # @param [String] quota_user
1023
+ # Available to use for quota purposes for server-side applications. Can be any
1024
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1025
+ # Overrides userIp if both are provided.
1026
+ # @param [String] user_ip
1027
+ # IP address of the site where the request originates. Use this if you want to
1028
+ # enforce per-user limits.
1029
+ # @param [Google::Apis::RequestOptions] options
1030
+ # Request-specific options
1031
+ #
1032
+ # @yield [result, err] Result & error if block supplied
1033
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1034
+ # @yieldparam err [StandardError] error object if request failed
1035
+ #
1036
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1037
+ #
1038
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1039
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1040
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1041
+ def update_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1042
+ path = 'projects/{project}/instances/{instance}'
1043
+ command = make_simple_command(:put, path, options)
1044
+ command.request_representation = Google::Apis::SqladminV1beta4::DatabaseInstance::Representation
1045
+ command.request_object = database_instance_object
1046
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1047
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1048
+ command.params['project'] = project unless project.nil?
1049
+ command.params['instance'] = instance unless instance.nil?
1050
+ command.query['fields'] = fields unless fields.nil?
1051
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1052
+ command.query['userIp'] = user_ip unless user_ip.nil?
1053
+ execute_or_queue_command(command, &block)
1054
+ end
1055
+
1056
+ # Retrieves an instance operation that has been performed on an instance.
1057
+ # @param [String] project
1058
+ # Project ID of the project that contains the instance.
1059
+ # @param [String] operation
1060
+ # Instance operation ID.
1061
+ # @param [String] fields
1062
+ # Selector specifying which fields to include in a partial response.
1063
+ # @param [String] quota_user
1064
+ # Available to use for quota purposes for server-side applications. Can be any
1065
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1066
+ # Overrides userIp if both are provided.
1067
+ # @param [String] user_ip
1068
+ # IP address of the site where the request originates. Use this if you want to
1069
+ # enforce per-user limits.
1070
+ # @param [Google::Apis::RequestOptions] options
1071
+ # Request-specific options
1072
+ #
1073
+ # @yield [result, err] Result & error if block supplied
1074
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1075
+ # @yieldparam err [StandardError] error object if request failed
1076
+ #
1077
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1078
+ #
1079
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1080
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1081
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1082
+ def get_operation(project, operation, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1083
+ path = 'projects/{project}/operations/{operation}'
1084
+ command = make_simple_command(:get, path, options)
1085
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1086
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1087
+ command.params['project'] = project unless project.nil?
1088
+ command.params['operation'] = operation unless operation.nil?
1089
+ command.query['fields'] = fields unless fields.nil?
1090
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1091
+ command.query['userIp'] = user_ip unless user_ip.nil?
1092
+ execute_or_queue_command(command, &block)
1093
+ end
1094
+
1095
+ # Lists all instance operations that have been performed on the given Cloud SQL
1096
+ # instance in the reverse chronological order of the start time.
1097
+ # @param [String] project
1098
+ # Project ID of the project that contains the instance.
1099
+ # @param [String] instance
1100
+ # Cloud SQL instance ID. This does not include the project ID.
1101
+ # @param [Fixnum] max_results
1102
+ # Maximum number of operations per response.
1103
+ # @param [String] page_token
1104
+ # A previously-returned page token representing part of the larger set of
1105
+ # results to view.
1106
+ # @param [String] fields
1107
+ # Selector specifying which fields to include in a partial response.
1108
+ # @param [String] quota_user
1109
+ # Available to use for quota purposes for server-side applications. Can be any
1110
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1111
+ # Overrides userIp if both are provided.
1112
+ # @param [String] user_ip
1113
+ # IP address of the site where the request originates. Use this if you want to
1114
+ # enforce per-user limits.
1115
+ # @param [Google::Apis::RequestOptions] options
1116
+ # Request-specific options
1117
+ #
1118
+ # @yield [result, err] Result & error if block supplied
1119
+ # @yieldparam result [Google::Apis::SqladminV1beta4::ListOperationsResponse] parsed result object
1120
+ # @yieldparam err [StandardError] error object if request failed
1121
+ #
1122
+ # @return [Google::Apis::SqladminV1beta4::ListOperationsResponse]
1123
+ #
1124
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1125
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1126
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1127
+ def list_operations(project, instance: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1128
+ path = 'projects/{project}/operations'
1129
+ command = make_simple_command(:get, path, options)
1130
+ command.response_representation = Google::Apis::SqladminV1beta4::ListOperationsResponse::Representation
1131
+ command.response_class = Google::Apis::SqladminV1beta4::ListOperationsResponse
1132
+ command.params['project'] = project unless project.nil?
1133
+ command.query['instance'] = instance unless instance.nil?
1134
+ command.query['maxResults'] = max_results unless max_results.nil?
1135
+ command.query['pageToken'] = page_token unless page_token.nil?
1136
+ command.query['fields'] = fields unless fields.nil?
1137
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1138
+ command.query['userIp'] = user_ip unless user_ip.nil?
1139
+ execute_or_queue_command(command, &block)
1140
+ end
1141
+
1142
+ # Deletes the SSL certificate. The change will not take effect until the
1143
+ # instance is restarted.
1144
+ # @param [String] project
1145
+ # Project ID of the project that contains the instance to be deleted.
1146
+ # @param [String] instance
1147
+ # Cloud SQL instance ID. This does not include the project ID.
1148
+ # @param [String] sha1_fingerprint
1149
+ # Sha1 FingerPrint.
1150
+ # @param [String] fields
1151
+ # Selector specifying which fields to include in a partial response.
1152
+ # @param [String] quota_user
1153
+ # Available to use for quota purposes for server-side applications. Can be any
1154
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1155
+ # Overrides userIp if both are provided.
1156
+ # @param [String] user_ip
1157
+ # IP address of the site where the request originates. Use this if you want to
1158
+ # enforce per-user limits.
1159
+ # @param [Google::Apis::RequestOptions] options
1160
+ # Request-specific options
1161
+ #
1162
+ # @yield [result, err] Result & error if block supplied
1163
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1164
+ # @yieldparam err [StandardError] error object if request failed
1165
+ #
1166
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1167
+ #
1168
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1169
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1170
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1171
+ def delete_ssl_cert(project, instance, sha1_fingerprint, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1172
+ path = 'projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}'
1173
+ command = make_simple_command(:delete, path, options)
1174
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1175
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1176
+ command.params['project'] = project unless project.nil?
1177
+ command.params['instance'] = instance unless instance.nil?
1178
+ command.params['sha1Fingerprint'] = sha1_fingerprint unless sha1_fingerprint.nil?
1179
+ command.query['fields'] = fields unless fields.nil?
1180
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1181
+ command.query['userIp'] = user_ip unless user_ip.nil?
1182
+ execute_or_queue_command(command, &block)
1183
+ end
1184
+
1185
+ # Retrieves a particular SSL certificate. Does not include the private key (
1186
+ # required for usage). The private key must be saved from the response to
1187
+ # initial creation.
1188
+ # @param [String] project
1189
+ # Project ID of the project that contains the instance.
1190
+ # @param [String] instance
1191
+ # Cloud SQL instance ID. This does not include the project ID.
1192
+ # @param [String] sha1_fingerprint
1193
+ # Sha1 FingerPrint.
1194
+ # @param [String] fields
1195
+ # Selector specifying which fields to include in a partial response.
1196
+ # @param [String] quota_user
1197
+ # Available to use for quota purposes for server-side applications. Can be any
1198
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1199
+ # Overrides userIp if both are provided.
1200
+ # @param [String] user_ip
1201
+ # IP address of the site where the request originates. Use this if you want to
1202
+ # enforce per-user limits.
1203
+ # @param [Google::Apis::RequestOptions] options
1204
+ # Request-specific options
1205
+ #
1206
+ # @yield [result, err] Result & error if block supplied
1207
+ # @yieldparam result [Google::Apis::SqladminV1beta4::SslCert] parsed result object
1208
+ # @yieldparam err [StandardError] error object if request failed
1209
+ #
1210
+ # @return [Google::Apis::SqladminV1beta4::SslCert]
1211
+ #
1212
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1213
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1214
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1215
+ def get_ssl_cert(project, instance, sha1_fingerprint, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1216
+ path = 'projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}'
1217
+ command = make_simple_command(:get, path, options)
1218
+ command.response_representation = Google::Apis::SqladminV1beta4::SslCert::Representation
1219
+ command.response_class = Google::Apis::SqladminV1beta4::SslCert
1220
+ command.params['project'] = project unless project.nil?
1221
+ command.params['instance'] = instance unless instance.nil?
1222
+ command.params['sha1Fingerprint'] = sha1_fingerprint unless sha1_fingerprint.nil?
1223
+ command.query['fields'] = fields unless fields.nil?
1224
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1225
+ command.query['userIp'] = user_ip unless user_ip.nil?
1226
+ execute_or_queue_command(command, &block)
1227
+ end
1228
+
1229
+ # Creates an SSL certificate and returns it along with the private key and
1230
+ # server certificate authority. The new certificate will not be usable until the
1231
+ # instance is restarted.
1232
+ # @param [String] project
1233
+ # Project ID of the project to which the newly created Cloud SQL instances
1234
+ # should belong.
1235
+ # @param [String] instance
1236
+ # Cloud SQL instance ID. This does not include the project ID.
1237
+ # @param [Google::Apis::SqladminV1beta4::InsertSslCertsRequest] insert_ssl_certs_request_object
1238
+ # @param [String] fields
1239
+ # Selector specifying which fields to include in a partial response.
1240
+ # @param [String] quota_user
1241
+ # Available to use for quota purposes for server-side applications. Can be any
1242
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1243
+ # Overrides userIp if both are provided.
1244
+ # @param [String] user_ip
1245
+ # IP address of the site where the request originates. Use this if you want to
1246
+ # enforce per-user limits.
1247
+ # @param [Google::Apis::RequestOptions] options
1248
+ # Request-specific options
1249
+ #
1250
+ # @yield [result, err] Result & error if block supplied
1251
+ # @yieldparam result [Google::Apis::SqladminV1beta4::InsertSslCertsResponse] parsed result object
1252
+ # @yieldparam err [StandardError] error object if request failed
1253
+ #
1254
+ # @return [Google::Apis::SqladminV1beta4::InsertSslCertsResponse]
1255
+ #
1256
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1257
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1258
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1259
+ def insert_ssl_cert(project, instance, insert_ssl_certs_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1260
+ path = 'projects/{project}/instances/{instance}/sslCerts'
1261
+ command = make_simple_command(:post, path, options)
1262
+ command.request_representation = Google::Apis::SqladminV1beta4::InsertSslCertsRequest::Representation
1263
+ command.request_object = insert_ssl_certs_request_object
1264
+ command.response_representation = Google::Apis::SqladminV1beta4::InsertSslCertsResponse::Representation
1265
+ command.response_class = Google::Apis::SqladminV1beta4::InsertSslCertsResponse
1266
+ command.params['project'] = project unless project.nil?
1267
+ command.params['instance'] = instance unless instance.nil?
1268
+ command.query['fields'] = fields unless fields.nil?
1269
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1270
+ command.query['userIp'] = user_ip unless user_ip.nil?
1271
+ execute_or_queue_command(command, &block)
1272
+ end
1273
+
1274
+ # Lists all of the current SSL certificates for the instance.
1275
+ # @param [String] project
1276
+ # Project ID of the project for which to list Cloud SQL instances.
1277
+ # @param [String] instance
1278
+ # Cloud SQL instance ID. This does not include the project ID.
1279
+ # @param [String] fields
1280
+ # Selector specifying which fields to include in a partial response.
1281
+ # @param [String] quota_user
1282
+ # Available to use for quota purposes for server-side applications. Can be any
1283
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1284
+ # Overrides userIp if both are provided.
1285
+ # @param [String] user_ip
1286
+ # IP address of the site where the request originates. Use this if you want to
1287
+ # enforce per-user limits.
1288
+ # @param [Google::Apis::RequestOptions] options
1289
+ # Request-specific options
1290
+ #
1291
+ # @yield [result, err] Result & error if block supplied
1292
+ # @yieldparam result [Google::Apis::SqladminV1beta4::ListSslCertsResponse] parsed result object
1293
+ # @yieldparam err [StandardError] error object if request failed
1294
+ #
1295
+ # @return [Google::Apis::SqladminV1beta4::ListSslCertsResponse]
1296
+ #
1297
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1298
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1299
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1300
+ def list_ssl_certs(project, instance, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1301
+ path = 'projects/{project}/instances/{instance}/sslCerts'
1302
+ command = make_simple_command(:get, path, options)
1303
+ command.response_representation = Google::Apis::SqladminV1beta4::ListSslCertsResponse::Representation
1304
+ command.response_class = Google::Apis::SqladminV1beta4::ListSslCertsResponse
1305
+ command.params['project'] = project unless project.nil?
1306
+ command.params['instance'] = instance unless instance.nil?
1307
+ command.query['fields'] = fields unless fields.nil?
1308
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1309
+ command.query['userIp'] = user_ip unless user_ip.nil?
1310
+ execute_or_queue_command(command, &block)
1311
+ end
1312
+
1313
+ # Lists all available service tiers for Google Cloud SQL, for example D1, D2.
1314
+ # For related information, see Pricing.
1315
+ # @param [String] project
1316
+ # Project ID of the project for which to list tiers.
1317
+ # @param [String] fields
1318
+ # Selector specifying which fields to include in a partial response.
1319
+ # @param [String] quota_user
1320
+ # Available to use for quota purposes for server-side applications. Can be any
1321
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1322
+ # Overrides userIp if both are provided.
1323
+ # @param [String] user_ip
1324
+ # IP address of the site where the request originates. Use this if you want to
1325
+ # enforce per-user limits.
1326
+ # @param [Google::Apis::RequestOptions] options
1327
+ # Request-specific options
1328
+ #
1329
+ # @yield [result, err] Result & error if block supplied
1330
+ # @yieldparam result [Google::Apis::SqladminV1beta4::ListTiersResponse] parsed result object
1331
+ # @yieldparam err [StandardError] error object if request failed
1332
+ #
1333
+ # @return [Google::Apis::SqladminV1beta4::ListTiersResponse]
1334
+ #
1335
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1336
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1337
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1338
+ def list_tiers(project, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1339
+ path = 'projects/{project}/tiers'
1340
+ command = make_simple_command(:get, path, options)
1341
+ command.response_representation = Google::Apis::SqladminV1beta4::ListTiersResponse::Representation
1342
+ command.response_class = Google::Apis::SqladminV1beta4::ListTiersResponse
1343
+ command.params['project'] = project unless project.nil?
1344
+ command.query['fields'] = fields unless fields.nil?
1345
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1346
+ command.query['userIp'] = user_ip unless user_ip.nil?
1347
+ execute_or_queue_command(command, &block)
1348
+ end
1349
+
1350
+ # Deletes a user from a Cloud SQL instance.
1351
+ # @param [String] project
1352
+ # Project ID of the project that contains the instance.
1353
+ # @param [String] instance
1354
+ # Database instance ID. This does not include the project ID.
1355
+ # @param [String] host
1356
+ # Host of the user in the instance.
1357
+ # @param [String] name
1358
+ # Name of the user in the instance.
1359
+ # @param [String] fields
1360
+ # Selector specifying which fields to include in a partial response.
1361
+ # @param [String] quota_user
1362
+ # Available to use for quota purposes for server-side applications. Can be any
1363
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1364
+ # Overrides userIp if both are provided.
1365
+ # @param [String] user_ip
1366
+ # IP address of the site where the request originates. Use this if you want to
1367
+ # enforce per-user limits.
1368
+ # @param [Google::Apis::RequestOptions] options
1369
+ # Request-specific options
1370
+ #
1371
+ # @yield [result, err] Result & error if block supplied
1372
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1373
+ # @yieldparam err [StandardError] error object if request failed
1374
+ #
1375
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1376
+ #
1377
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1378
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1379
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1380
+ def delete_user(project, instance, host: nil, name: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1381
+ path = 'projects/{project}/instances/{instance}/users'
1382
+ command = make_simple_command(:delete, path, options)
1383
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1384
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1385
+ command.params['project'] = project unless project.nil?
1386
+ command.params['instance'] = instance unless instance.nil?
1387
+ command.query['host'] = host unless host.nil?
1388
+ command.query['name'] = name unless name.nil?
1389
+ command.query['fields'] = fields unless fields.nil?
1390
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1391
+ command.query['userIp'] = user_ip unless user_ip.nil?
1392
+ execute_or_queue_command(command, &block)
1393
+ end
1394
+
1395
+ # Creates a new user in a Cloud SQL instance.
1396
+ # @param [String] project
1397
+ # Project ID of the project that contains the instance.
1398
+ # @param [String] instance
1399
+ # Database instance ID. This does not include the project ID.
1400
+ # @param [Google::Apis::SqladminV1beta4::User] user_object
1401
+ # @param [String] fields
1402
+ # Selector specifying which fields to include in a partial response.
1403
+ # @param [String] quota_user
1404
+ # Available to use for quota purposes for server-side applications. Can be any
1405
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1406
+ # Overrides userIp if both are provided.
1407
+ # @param [String] user_ip
1408
+ # IP address of the site where the request originates. Use this if you want to
1409
+ # enforce per-user limits.
1410
+ # @param [Google::Apis::RequestOptions] options
1411
+ # Request-specific options
1412
+ #
1413
+ # @yield [result, err] Result & error if block supplied
1414
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1415
+ # @yieldparam err [StandardError] error object if request failed
1416
+ #
1417
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1418
+ #
1419
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1420
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1421
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1422
+ def insert_user(project, instance, user_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1423
+ path = 'projects/{project}/instances/{instance}/users'
1424
+ command = make_simple_command(:post, path, options)
1425
+ command.request_representation = Google::Apis::SqladminV1beta4::User::Representation
1426
+ command.request_object = user_object
1427
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1428
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1429
+ command.params['project'] = project unless project.nil?
1430
+ command.params['instance'] = instance unless instance.nil?
1431
+ command.query['fields'] = fields unless fields.nil?
1432
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1433
+ command.query['userIp'] = user_ip unless user_ip.nil?
1434
+ execute_or_queue_command(command, &block)
1435
+ end
1436
+
1437
+ # Lists users in the specified Cloud SQL instance.
1438
+ # @param [String] project
1439
+ # Project ID of the project that contains the instance.
1440
+ # @param [String] instance
1441
+ # Database instance ID. This does not include the project ID.
1442
+ # @param [String] fields
1443
+ # Selector specifying which fields to include in a partial response.
1444
+ # @param [String] quota_user
1445
+ # Available to use for quota purposes for server-side applications. Can be any
1446
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1447
+ # Overrides userIp if both are provided.
1448
+ # @param [String] user_ip
1449
+ # IP address of the site where the request originates. Use this if you want to
1450
+ # enforce per-user limits.
1451
+ # @param [Google::Apis::RequestOptions] options
1452
+ # Request-specific options
1453
+ #
1454
+ # @yield [result, err] Result & error if block supplied
1455
+ # @yieldparam result [Google::Apis::SqladminV1beta4::ListUsersResponse] parsed result object
1456
+ # @yieldparam err [StandardError] error object if request failed
1457
+ #
1458
+ # @return [Google::Apis::SqladminV1beta4::ListUsersResponse]
1459
+ #
1460
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1461
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1462
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1463
+ def list_users(project, instance, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1464
+ path = 'projects/{project}/instances/{instance}/users'
1465
+ command = make_simple_command(:get, path, options)
1466
+ command.response_representation = Google::Apis::SqladminV1beta4::ListUsersResponse::Representation
1467
+ command.response_class = Google::Apis::SqladminV1beta4::ListUsersResponse
1468
+ command.params['project'] = project unless project.nil?
1469
+ command.params['instance'] = instance unless instance.nil?
1470
+ command.query['fields'] = fields unless fields.nil?
1471
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1472
+ command.query['userIp'] = user_ip unless user_ip.nil?
1473
+ execute_or_queue_command(command, &block)
1474
+ end
1475
+
1476
+ # Updates an existing user in a Cloud SQL instance.
1477
+ # @param [String] project
1478
+ # Project ID of the project that contains the instance.
1479
+ # @param [String] instance
1480
+ # Database instance ID. This does not include the project ID.
1481
+ # @param [Google::Apis::SqladminV1beta4::User] user_object
1482
+ # @param [String] host
1483
+ # Host of the user in the instance.
1484
+ # @param [String] name
1485
+ # Name of the user in the instance.
1486
+ # @param [String] fields
1487
+ # Selector specifying which fields to include in a partial response.
1488
+ # @param [String] quota_user
1489
+ # Available to use for quota purposes for server-side applications. Can be any
1490
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1491
+ # Overrides userIp if both are provided.
1492
+ # @param [String] user_ip
1493
+ # IP address of the site where the request originates. Use this if you want to
1494
+ # enforce per-user limits.
1495
+ # @param [Google::Apis::RequestOptions] options
1496
+ # Request-specific options
1497
+ #
1498
+ # @yield [result, err] Result & error if block supplied
1499
+ # @yieldparam result [Google::Apis::SqladminV1beta4::Operation] parsed result object
1500
+ # @yieldparam err [StandardError] error object if request failed
1501
+ #
1502
+ # @return [Google::Apis::SqladminV1beta4::Operation]
1503
+ #
1504
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1505
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1506
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1507
+ def update_user(project, instance, user_object = nil, host: nil, name: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1508
+ path = 'projects/{project}/instances/{instance}/users'
1509
+ command = make_simple_command(:put, path, options)
1510
+ command.request_representation = Google::Apis::SqladminV1beta4::User::Representation
1511
+ command.request_object = user_object
1512
+ command.response_representation = Google::Apis::SqladminV1beta4::Operation::Representation
1513
+ command.response_class = Google::Apis::SqladminV1beta4::Operation
1514
+ command.params['project'] = project unless project.nil?
1515
+ command.params['instance'] = instance unless instance.nil?
1516
+ command.query['host'] = host unless host.nil?
1517
+ command.query['name'] = name unless name.nil?
1518
+ command.query['fields'] = fields unless fields.nil?
1519
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1520
+ command.query['userIp'] = user_ip unless user_ip.nil?
1521
+ execute_or_queue_command(command, &block)
1522
+ end
1523
+
1524
+ protected
1525
+
1526
+ def apply_command_defaults(command)
1527
+ command.query['key'] = key unless key.nil?
1528
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1529
+ command.query['userIp'] = user_ip unless user_ip.nil?
1530
+ end
1531
+ end
1532
+ end
1533
+ end
1534
+ end