google-api-client 0.8.6 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (537) 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 +23 -0
  7. data/.yardopts +12 -0
  8. data/CHANGELOG.md +58 -2
  9. data/CONTRIBUTING.md +31 -0
  10. data/Gemfile +38 -2
  11. data/MIGRATING.md +171 -0
  12. data/README.md +189 -147
  13. data/Rakefile +1 -40
  14. data/api_names.yaml +1088 -0
  15. data/api_names_out.yaml +26978 -0
  16. data/bin/generate-api +109 -0
  17. data/generated/google/apis/adexchangebuyer_v1_3/classes.rb +1335 -0
  18. data/generated/google/apis/adexchangebuyer_v1_3/representations.rb +446 -0
  19. data/generated/google/apis/adexchangebuyer_v1_3/service.rb +872 -0
  20. data/generated/google/apis/adexchangebuyer_v1_3.rb +35 -0
  21. data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +3025 -0
  22. data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +1240 -0
  23. data/generated/google/apis/adexchangebuyer_v1_4/service.rb +1446 -0
  24. data/generated/google/apis/adexchangebuyer_v1_4.rb +35 -0
  25. data/generated/google/apis/adexchangeseller_v2_0/classes.rb +792 -0
  26. data/generated/google/apis/adexchangeseller_v2_0/representations.rb +347 -0
  27. data/generated/google/apis/adexchangeseller_v2_0/service.rb +668 -0
  28. data/generated/google/apis/adexchangeseller_v2_0.rb +38 -0
  29. data/generated/google/apis/admin_datatransfer_v1/classes.rb +267 -0
  30. data/generated/google/apis/admin_datatransfer_v1/representations.rb +130 -0
  31. data/generated/google/apis/admin_datatransfer_v1/service.rb +262 -0
  32. data/generated/google/apis/admin_datatransfer_v1.rb +37 -0
  33. data/generated/google/apis/admin_directory_v1/classes.rb +3141 -0
  34. data/generated/google/apis/admin_directory_v1/representations.rb +1147 -0
  35. data/generated/google/apis/admin_directory_v1/service.rb +3818 -0
  36. data/generated/google/apis/admin_directory_v1.rb +113 -0
  37. data/generated/google/apis/admin_reports_v1/classes.rb +582 -0
  38. data/generated/google/apis/admin_reports_v1/representations.rb +257 -0
  39. data/generated/google/apis/admin_reports_v1/service.rb +336 -0
  40. data/generated/google/apis/admin_reports_v1.rb +38 -0
  41. data/generated/google/apis/adsense_v1_4/classes.rb +1280 -0
  42. data/generated/google/apis/adsense_v1_4/representations.rb +555 -0
  43. data/generated/google/apis/adsense_v1_4/service.rb +1714 -0
  44. data/generated/google/apis/adsense_v1_4.rb +38 -0
  45. data/generated/google/apis/adsensehost_v4_1/classes.rb +837 -0
  46. data/generated/google/apis/adsensehost_v4_1/representations.rb +367 -0
  47. data/generated/google/apis/adsensehost_v4_1/service.rb +1164 -0
  48. data/generated/google/apis/adsensehost_v4_1.rb +35 -0
  49. data/generated/google/apis/analytics_v3/classes.rb +5118 -0
  50. data/generated/google/apis/analytics_v3/representations.rb +1850 -0
  51. data/generated/google/apis/analytics_v3/service.rb +3568 -0
  52. data/generated/google/apis/analytics_v3.rb +49 -0
  53. data/generated/google/apis/androidenterprise_v1/classes.rb +1443 -0
  54. data/generated/google/apis/androidenterprise_v1/representations.rb +614 -0
  55. data/generated/google/apis/androidenterprise_v1/service.rb +2607 -0
  56. data/generated/google/apis/androidenterprise_v1.rb +35 -0
  57. data/generated/google/apis/androidpublisher_v2/classes.rb +1411 -0
  58. data/generated/google/apis/androidpublisher_v2/representations.rb +738 -0
  59. data/generated/google/apis/androidpublisher_v2/service.rb +2338 -0
  60. data/generated/google/apis/androidpublisher_v2.rb +34 -0
  61. data/generated/google/apis/appengine_v1beta4/classes.rb +1585 -0
  62. data/generated/google/apis/appengine_v1beta4/representations.rb +542 -0
  63. data/generated/google/apis/appengine_v1beta4/service.rb +477 -0
  64. data/generated/google/apis/appengine_v1beta4.rb +35 -0
  65. data/generated/google/apis/appengine_v1beta5/classes.rb +1544 -0
  66. data/generated/google/apis/appengine_v1beta5/representations.rb +594 -0
  67. data/generated/google/apis/appengine_v1beta5/service.rb +521 -0
  68. data/generated/google/apis/appengine_v1beta5.rb +35 -0
  69. data/generated/google/apis/appsactivity_v1/classes.rb +392 -0
  70. data/generated/google/apis/appsactivity_v1/representations.rb +206 -0
  71. data/generated/google/apis/appsactivity_v1/service.rb +128 -0
  72. data/generated/google/apis/appsactivity_v1.rb +46 -0
  73. data/generated/google/apis/appstate_v1/classes.rb +154 -0
  74. data/generated/google/apis/appstate_v1/representations.rb +87 -0
  75. data/generated/google/apis/appstate_v1/service.rb +260 -0
  76. data/generated/google/apis/appstate_v1.rb +34 -0
  77. data/generated/google/apis/autoscaler_v1beta2/classes.rb +747 -0
  78. data/generated/google/apis/autoscaler_v1beta2/representations.rb +313 -0
  79. data/generated/google/apis/autoscaler_v1beta2/service.rb +478 -0
  80. data/generated/google/apis/autoscaler_v1beta2.rb +38 -0
  81. data/generated/google/apis/bigquery_v2/classes.rb +2503 -0
  82. data/generated/google/apis/bigquery_v2/representations.rb +914 -0
  83. data/generated/google/apis/bigquery_v2/service.rb +982 -0
  84. data/generated/google/apis/bigquery_v2.rb +52 -0
  85. data/generated/google/apis/blogger_v3/classes.rb +1354 -0
  86. data/generated/google/apis/blogger_v3/representations.rb +632 -0
  87. data/generated/google/apis/blogger_v3/service.rb +1587 -0
  88. data/generated/google/apis/blogger_v3.rb +37 -0
  89. data/generated/google/apis/books_v1/classes.rb +4006 -0
  90. data/generated/google/apis/books_v1/representations.rb +1742 -0
  91. data/generated/google/apis/books_v1/service.rb +2293 -0
  92. data/generated/google/apis/books_v1.rb +34 -0
  93. data/generated/google/apis/calendar_v3/classes.rb +1742 -0
  94. data/generated/google/apis/calendar_v3/representations.rb +631 -0
  95. data/generated/google/apis/calendar_v3/service.rb +1968 -0
  96. data/generated/google/apis/calendar_v3.rb +37 -0
  97. data/generated/google/apis/civicinfo_v2/classes.rb +1127 -0
  98. data/generated/google/apis/civicinfo_v2/representations.rb +423 -0
  99. data/generated/google/apis/civicinfo_v2/service.rb +279 -0
  100. data/generated/google/apis/civicinfo_v2.rb +31 -0
  101. data/generated/google/apis/classroom_v1/classes.rb +512 -0
  102. data/generated/google/apis/classroom_v1/representations.rb +245 -0
  103. data/generated/google/apis/classroom_v1/service.rb +970 -0
  104. data/generated/google/apis/classroom_v1.rb +49 -0
  105. data/generated/google/apis/classroom_v1beta1/classes.rb +447 -0
  106. data/generated/google/apis/classroom_v1beta1/representations.rb +190 -0
  107. data/generated/google/apis/classroom_v1beta1/service.rb +791 -0
  108. data/generated/google/apis/classroom_v1beta1.rb +49 -0
  109. data/generated/google/apis/cloudbilling_v1/classes.rb +169 -0
  110. data/generated/google/apis/cloudbilling_v1/representations.rb +87 -0
  111. data/generated/google/apis/cloudbilling_v1/service.rb +258 -0
  112. data/generated/google/apis/cloudbilling_v1.rb +35 -0
  113. data/generated/google/apis/cloudbuild_v1/classes.rb +521 -0
  114. data/generated/google/apis/cloudbuild_v1/representations.rb +214 -0
  115. data/generated/google/apis/cloudbuild_v1/service.rb +278 -0
  116. data/generated/google/apis/cloudbuild_v1.rb +35 -0
  117. data/generated/google/apis/clouddebugger_v2/classes.rb +1004 -0
  118. data/generated/google/apis/clouddebugger_v2/representations.rb +464 -0
  119. data/generated/google/apis/clouddebugger_v2/service.rb +370 -0
  120. data/generated/google/apis/clouddebugger_v2.rb +41 -0
  121. data/generated/google/apis/cloudlatencytest_v2/classes.rb +195 -0
  122. data/generated/google/apis/cloudlatencytest_v2/representations.rb +127 -0
  123. data/generated/google/apis/cloudlatencytest_v2/service.rb +135 -0
  124. data/generated/google/apis/cloudlatencytest_v2.rb +34 -0
  125. data/generated/google/apis/cloudmonitoring_v2beta2/classes.rb +679 -0
  126. data/generated/google/apis/cloudmonitoring_v2beta2/representations.rb +353 -0
  127. data/generated/google/apis/cloudmonitoring_v2beta2/service.rb +452 -0
  128. data/generated/google/apis/cloudmonitoring_v2beta2.rb +37 -0
  129. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +450 -0
  130. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +226 -0
  131. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +626 -0
  132. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +38 -0
  133. data/generated/google/apis/cloudtrace_v1/classes.rb +188 -0
  134. data/generated/google/apis/cloudtrace_v1/representations.rb +102 -0
  135. data/generated/google/apis/cloudtrace_v1/service.rb +190 -0
  136. data/generated/google/apis/cloudtrace_v1.rb +35 -0
  137. data/generated/google/apis/clouduseraccounts_beta/classes.rb +823 -0
  138. data/generated/google/apis/clouduseraccounts_beta/representations.rb +351 -0
  139. data/generated/google/apis/clouduseraccounts_beta/service.rb +854 -0
  140. data/generated/google/apis/clouduseraccounts_beta.rb +43 -0
  141. data/generated/google/apis/compute_beta/classes.rb +9741 -0
  142. data/generated/google/apis/compute_beta/representations.rb +3649 -0
  143. data/generated/google/apis/compute_beta/service.rb +10636 -0
  144. data/generated/google/apis/compute_beta.rb +49 -0
  145. data/generated/google/apis/compute_v1/classes.rb +9095 -0
  146. data/generated/google/apis/compute_v1/representations.rb +3389 -0
  147. data/generated/google/apis/compute_v1/service.rb +9627 -0
  148. data/generated/google/apis/compute_v1.rb +49 -0
  149. data/generated/google/apis/container_v1/classes.rb +463 -0
  150. data/generated/google/apis/container_v1/representations.rb +195 -0
  151. data/generated/google/apis/container_v1/service.rb +367 -0
  152. data/generated/google/apis/container_v1.rb +35 -0
  153. data/generated/google/apis/container_v1beta1/classes.rb +466 -0
  154. data/generated/google/apis/container_v1beta1/representations.rb +177 -0
  155. data/generated/google/apis/container_v1beta1/service.rb +394 -0
  156. data/generated/google/apis/container_v1beta1.rb +35 -0
  157. data/generated/google/apis/content_v2/classes.rb +6114 -0
  158. data/generated/google/apis/content_v2/representations.rb +2624 -0
  159. data/generated/google/apis/content_v2/service.rb +2338 -0
  160. data/generated/google/apis/content_v2.rb +35 -0
  161. data/generated/google/apis/coordinate_v1/classes.rb +669 -0
  162. data/generated/google/apis/coordinate_v1/representations.rb +321 -0
  163. data/generated/google/apis/coordinate_v1/service.rb +678 -0
  164. data/generated/google/apis/coordinate_v1.rb +37 -0
  165. data/generated/google/apis/customsearch_v1/classes.rb +771 -0
  166. data/generated/google/apis/customsearch_v1/representations.rb +302 -0
  167. data/generated/google/apis/customsearch_v1/service.rb +207 -0
  168. data/{lib/google/api_client/auth/compute_service_account.rb → generated/google/apis/customsearch_v1.rb} +13 -10
  169. data/generated/google/apis/dataproc_v1/classes.rb +1590 -0
  170. data/generated/google/apis/dataproc_v1/representations.rb +653 -0
  171. data/generated/google/apis/dataproc_v1/service.rb +719 -0
  172. data/generated/google/apis/dataproc_v1.rb +43 -0
  173. data/generated/google/apis/datastore_v1beta2/classes.rb +1186 -0
  174. data/generated/google/apis/datastore_v1beta2/representations.rb +594 -0
  175. data/generated/google/apis/datastore_v1beta2/service.rb +294 -0
  176. data/generated/google/apis/datastore_v1beta2.rb +40 -0
  177. data/generated/google/apis/deploymentmanager_v2/classes.rb +1162 -0
  178. data/generated/google/apis/deploymentmanager_v2/representations.rb +508 -0
  179. data/generated/google/apis/deploymentmanager_v2/service.rb +862 -0
  180. data/generated/google/apis/deploymentmanager_v2.rb +44 -0
  181. data/generated/google/apis/deploymentmanager_v2beta2/classes.rb +843 -0
  182. data/generated/google/apis/deploymentmanager_v2beta2/representations.rb +306 -0
  183. data/generated/google/apis/deploymentmanager_v2beta2/service.rb +689 -0
  184. data/generated/google/apis/deploymentmanager_v2beta2.rb +44 -0
  185. data/generated/google/apis/dfareporting_v2_1/classes.rb +10770 -0
  186. data/generated/google/apis/dfareporting_v2_1/representations.rb +3438 -0
  187. data/generated/google/apis/dfareporting_v2_1/service.rb +8585 -0
  188. data/generated/google/apis/dfareporting_v2_1.rb +37 -0
  189. data/generated/google/apis/dfareporting_v2_3/classes.rb +10830 -0
  190. data/generated/google/apis/dfareporting_v2_3/representations.rb +3829 -0
  191. data/generated/google/apis/dfareporting_v2_3/service.rb +8581 -0
  192. data/generated/google/apis/dfareporting_v2_3.rb +37 -0
  193. data/generated/google/apis/discovery_v1/classes.rb +961 -0
  194. data/generated/google/apis/discovery_v1/representations.rb +397 -0
  195. data/generated/google/apis/discovery_v1/service.rb +142 -0
  196. data/generated/google/apis/discovery_v1.rb +32 -0
  197. data/generated/google/apis/dns_v1/classes.rb +406 -0
  198. data/generated/google/apis/dns_v1/representations.rb +167 -0
  199. data/generated/google/apis/dns_v1/service.rb +454 -0
  200. data/generated/google/apis/dns_v1.rb +44 -0
  201. data/generated/google/apis/doubleclickbidmanager_v1/classes.rb +802 -0
  202. data/generated/google/apis/doubleclickbidmanager_v1/representations.rb +371 -0
  203. data/generated/google/apis/doubleclickbidmanager_v1/service.rb +374 -0
  204. data/generated/google/apis/doubleclickbidmanager_v1.rb +31 -0
  205. data/generated/google/apis/doubleclicksearch_v2/classes.rb +958 -0
  206. data/generated/google/apis/doubleclicksearch_v2/representations.rb +350 -0
  207. data/generated/google/apis/doubleclicksearch_v2/service.rb +480 -0
  208. data/generated/google/apis/doubleclicksearch_v2.rb +35 -0
  209. data/generated/google/apis/drive_v2/classes.rb +2569 -0
  210. data/generated/google/apis/drive_v2/representations.rb +878 -0
  211. data/generated/google/apis/drive_v2/service.rb +2740 -0
  212. data/generated/google/apis/drive_v2.rb +58 -0
  213. data/generated/google/apis/drive_v3/classes.rb +1541 -0
  214. data/generated/google/apis/drive_v3/representations.rb +548 -0
  215. data/generated/google/apis/drive_v3/service.rb +1542 -0
  216. data/generated/google/apis/drive_v3.rb +55 -0
  217. data/generated/google/apis/fitness_v1/classes.rb +885 -0
  218. data/generated/google/apis/fitness_v1/representations.rb +360 -0
  219. data/generated/google/apis/fitness_v1/service.rb +675 -0
  220. data/generated/google/apis/fitness_v1.rb +49 -0
  221. data/generated/google/apis/fusiontables_v2/classes.rb +1048 -0
  222. data/generated/google/apis/fusiontables_v2/representations.rb +457 -0
  223. data/generated/google/apis/fusiontables_v2/service.rb +1463 -0
  224. data/generated/google/apis/fusiontables_v2.rb +37 -0
  225. data/generated/google/apis/games_configuration_v1configuration/classes.rb +506 -0
  226. data/generated/google/apis/games_configuration_v1configuration/representations.rb +228 -0
  227. data/generated/google/apis/games_configuration_v1configuration/service.rb +565 -0
  228. data/generated/google/apis/games_configuration_v1configuration.rb +34 -0
  229. data/generated/google/apis/games_management_v1management/classes.rb +533 -0
  230. data/generated/google/apis/games_management_v1management/representations.rb +262 -0
  231. data/generated/google/apis/games_management_v1management/service.rb +994 -0
  232. data/generated/google/apis/games_management_v1management.rb +37 -0
  233. data/generated/google/apis/games_v1/classes.rb +4626 -0
  234. data/generated/google/apis/games_v1/representations.rb +1783 -0
  235. data/generated/google/apis/games_v1/service.rb +2290 -0
  236. data/generated/google/apis/games_v1.rb +40 -0
  237. data/generated/google/apis/gan_v1beta1/classes.rb +1428 -0
  238. data/generated/google/apis/gan_v1beta1/representations.rb +462 -0
  239. data/generated/google/apis/gan_v1beta1/service.rb +682 -0
  240. data/generated/google/apis/gan_v1beta1.rb +31 -0
  241. data/generated/google/apis/genomics_v1/classes.rb +2609 -0
  242. data/generated/google/apis/genomics_v1/representations.rb +1029 -0
  243. data/generated/google/apis/genomics_v1/service.rb +1676 -0
  244. data/generated/google/apis/genomics_v1.rb +49 -0
  245. data/generated/google/apis/genomics_v1beta2/classes.rb +3288 -0
  246. data/generated/google/apis/genomics_v1beta2/representations.rb +1194 -0
  247. data/generated/google/apis/genomics_v1beta2/service.rb +2392 -0
  248. data/generated/google/apis/genomics_v1beta2.rb +46 -0
  249. data/generated/google/apis/gmail_v1/classes.rb +794 -0
  250. data/generated/google/apis/gmail_v1/representations.rb +383 -0
  251. data/generated/google/apis/gmail_v1/service.rb +1470 -0
  252. data/generated/google/apis/gmail_v1.rb +52 -0
  253. data/generated/google/apis/groupsmigration_v1/classes.rb +51 -0
  254. data/generated/google/apis/groupsmigration_v1/representations.rb +40 -0
  255. data/generated/google/apis/groupsmigration_v1/service.rb +110 -0
  256. data/generated/google/apis/groupsmigration_v1.rb +34 -0
  257. data/generated/google/apis/groupssettings_v1/classes.rb +221 -0
  258. data/generated/google/apis/groupssettings_v1/representations.rb +66 -0
  259. data/generated/google/apis/groupssettings_v1/service.rb +179 -0
  260. data/generated/google/apis/groupssettings_v1.rb +34 -0
  261. data/generated/google/apis/identitytoolkit_v3/classes.rb +1637 -0
  262. data/generated/google/apis/identitytoolkit_v3/representations.rb +618 -0
  263. data/generated/google/apis/identitytoolkit_v3/service.rb +616 -0
  264. data/generated/google/apis/identitytoolkit_v3.rb +31 -0
  265. data/generated/google/apis/kgsearch_v1/classes.rb +59 -0
  266. data/generated/google/apis/kgsearch_v1/representations.rb +41 -0
  267. data/generated/google/apis/kgsearch_v1/service.rb +111 -0
  268. data/{spec/google/api_client/request_spec.rb → generated/google/apis/kgsearch_v1.rb} +16 -13
  269. data/generated/google/apis/licensing_v1/classes.rb +132 -0
  270. data/generated/google/apis/licensing_v1/representations.rb +74 -0
  271. data/generated/google/apis/licensing_v1/service.rb +369 -0
  272. data/generated/google/apis/licensing_v1.rb +34 -0
  273. data/generated/google/apis/logging_v1beta3/classes.rb +1079 -0
  274. data/generated/google/apis/logging_v1beta3/representations.rb +366 -0
  275. data/generated/google/apis/logging_v1beta3/service.rb +1001 -0
  276. data/generated/google/apis/logging_v1beta3.rb +47 -0
  277. data/generated/google/apis/logging_v2beta1/classes.rb +990 -0
  278. data/generated/google/apis/logging_v2beta1/representations.rb +377 -0
  279. data/generated/google/apis/logging_v2beta1/service.rb +547 -0
  280. data/generated/google/apis/logging_v2beta1.rb +47 -0
  281. data/generated/google/apis/manager_v1beta2/classes.rb +1287 -0
  282. data/generated/google/apis/manager_v1beta2/representations.rb +606 -0
  283. data/generated/google/apis/manager_v1beta2/service.rb +372 -0
  284. data/generated/google/apis/manager_v1beta2.rb +53 -0
  285. data/generated/google/apis/mirror_v1/classes.rb +1072 -0
  286. data/generated/google/apis/mirror_v1/representations.rb +390 -0
  287. data/generated/google/apis/mirror_v1/service.rb +977 -0
  288. data/generated/google/apis/mirror_v1.rb +37 -0
  289. data/generated/google/apis/oauth2_v2/classes.rb +245 -0
  290. data/generated/google/apis/oauth2_v2/representations.rb +102 -0
  291. data/generated/google/apis/oauth2_v2/service.rb +199 -0
  292. data/generated/google/apis/oauth2_v2.rb +43 -0
  293. data/generated/google/apis/pagespeedonline_v2/classes.rb +614 -0
  294. data/generated/google/apis/pagespeedonline_v2/representations.rb +272 -0
  295. data/generated/google/apis/pagespeedonline_v2/service.rb +119 -0
  296. data/generated/google/apis/pagespeedonline_v2.rb +32 -0
  297. data/generated/google/apis/partners_v2/classes.rb +942 -0
  298. data/generated/google/apis/partners_v2/representations.rb +454 -0
  299. data/generated/google/apis/partners_v2/service.rb +400 -0
  300. data/generated/google/apis/partners_v2.rb +32 -0
  301. data/generated/google/apis/people_v1/classes.rb +1521 -0
  302. data/generated/google/apis/people_v1/representations.rb +663 -0
  303. data/generated/google/apis/people_v1/service.rb +189 -0
  304. data/generated/google/apis/people_v1.rb +59 -0
  305. data/generated/google/apis/plus_domains_v1/classes.rb +2609 -0
  306. data/generated/google/apis/plus_domains_v1/representations.rb +1111 -0
  307. data/generated/google/apis/plus_domains_v1/service.rb +904 -0
  308. data/generated/google/apis/plus_domains_v1.rb +61 -0
  309. data/generated/google/apis/plus_v1/classes.rb +2094 -0
  310. data/generated/google/apis/plus_v1/representations.rb +907 -0
  311. data/generated/google/apis/plus_v1/service.rb +470 -0
  312. data/generated/google/apis/plus_v1.rb +43 -0
  313. data/generated/google/apis/prediction_v1_6/classes.rb +751 -0
  314. data/generated/google/apis/prediction_v1_6/representations.rb +369 -0
  315. data/generated/google/apis/prediction_v1_6/service.rb +380 -0
  316. data/generated/google/apis/prediction_v1_6.rb +44 -0
  317. data/generated/google/apis/proximitybeacon_v1beta1/classes.rb +639 -0
  318. data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +312 -0
  319. data/generated/google/apis/proximitybeacon_v1beta1/service.rb +591 -0
  320. data/generated/google/apis/proximitybeacon_v1beta1.rb +31 -0
  321. data/generated/google/apis/pubsub_v1/classes.rb +614 -0
  322. data/generated/google/apis/pubsub_v1/representations.rb +323 -0
  323. data/generated/google/apis/pubsub_v1/service.rb +774 -0
  324. data/generated/google/apis/pubsub_v1.rb +37 -0
  325. data/generated/google/apis/pubsub_v1beta2/classes.rb +620 -0
  326. data/generated/google/apis/pubsub_v1beta2/representations.rb +282 -0
  327. data/generated/google/apis/pubsub_v1beta2/service.rb +774 -0
  328. data/generated/google/apis/pubsub_v1beta2.rb +37 -0
  329. data/generated/google/apis/qpx_express_v1/classes.rb +1268 -0
  330. data/generated/google/apis/qpx_express_v1/representations.rb +472 -0
  331. data/generated/google/apis/qpx_express_v1/service.rb +100 -0
  332. data/generated/google/apis/qpx_express_v1.rb +31 -0
  333. data/generated/google/apis/replicapool_v1beta2/classes.rb +631 -0
  334. data/generated/google/apis/replicapool_v1beta2/representations.rb +264 -0
  335. data/generated/google/apis/replicapool_v1beta2/service.rb +608 -0
  336. data/generated/google/apis/replicapool_v1beta2.rb +44 -0
  337. data/generated/google/apis/replicapoolupdater_v1beta1/classes.rb +733 -0
  338. data/generated/google/apis/replicapoolupdater_v1beta1/representations.rb +294 -0
  339. data/generated/google/apis/replicapoolupdater_v1beta1/service.rb +508 -0
  340. data/generated/google/apis/replicapoolupdater_v1beta1.rb +44 -0
  341. data/generated/google/apis/reseller_v1/classes.rb +526 -0
  342. data/generated/google/apis/reseller_v1/representations.rb +223 -0
  343. data/generated/google/apis/reseller_v1/service.rb +623 -0
  344. data/generated/google/apis/reseller_v1.rb +37 -0
  345. data/generated/google/apis/resourceviews_v1beta2/classes.rb +660 -0
  346. data/generated/google/apis/resourceviews_v1beta2/representations.rb +301 -0
  347. data/generated/google/apis/resourceviews_v1beta2/service.rb +563 -0
  348. data/generated/google/apis/resourceviews_v1beta2.rb +50 -0
  349. data/generated/google/apis/script_v1/classes.rb +259 -0
  350. data/generated/google/apis/script_v1/representations.rb +118 -0
  351. data/generated/google/apis/script_v1/service.rb +98 -0
  352. data/generated/google/apis/script_v1.rb +61 -0
  353. data/generated/google/apis/site_verification_v1/classes.rb +185 -0
  354. data/generated/google/apis/site_verification_v1/representations.rb +113 -0
  355. data/generated/google/apis/site_verification_v1/service.rb +315 -0
  356. data/generated/google/apis/site_verification_v1.rb +37 -0
  357. data/generated/google/apis/sqladmin_v1beta4/classes.rb +2030 -0
  358. data/generated/google/apis/sqladmin_v1beta4/representations.rb +856 -0
  359. data/generated/google/apis/sqladmin_v1beta4/service.rb +1625 -0
  360. data/generated/google/apis/sqladmin_v1beta4.rb +37 -0
  361. data/generated/google/apis/storage_v1/classes.rb +1222 -0
  362. data/generated/google/apis/storage_v1/representations.rb +497 -0
  363. data/generated/google/apis/storage_v1/service.rb +1903 -0
  364. data/generated/google/apis/storage_v1.rb +46 -0
  365. data/generated/google/apis/storagetransfer_v1/classes.rb +1046 -0
  366. data/generated/google/apis/storagetransfer_v1/representations.rb +418 -0
  367. data/generated/google/apis/storagetransfer_v1/service.rb +473 -0
  368. data/generated/google/apis/storagetransfer_v1.rb +35 -0
  369. data/generated/google/apis/tagmanager_v1/classes.rb +1494 -0
  370. data/generated/google/apis/tagmanager_v1/representations.rb +611 -0
  371. data/generated/google/apis/tagmanager_v1/service.rb +2119 -0
  372. data/generated/google/apis/tagmanager_v1.rb +52 -0
  373. data/generated/google/apis/taskqueue_v1beta2/classes.rb +254 -0
  374. data/generated/google/apis/taskqueue_v1beta2/representations.rb +126 -0
  375. data/generated/google/apis/taskqueue_v1beta2/service.rb +408 -0
  376. data/generated/google/apis/taskqueue_v1beta2.rb +37 -0
  377. data/generated/google/apis/tasks_v1/classes.rb +296 -0
  378. data/generated/google/apis/tasks_v1/representations.rb +125 -0
  379. data/generated/google/apis/tasks_v1/service.rb +643 -0
  380. data/generated/google/apis/tasks_v1.rb +37 -0
  381. data/generated/google/apis/translate_v2/classes.rb +168 -0
  382. data/generated/google/apis/translate_v2/representations.rb +121 -0
  383. data/generated/google/apis/translate_v2/service.rb +182 -0
  384. data/generated/google/apis/translate_v2.rb +31 -0
  385. data/generated/google/apis/urlshortener_v1/classes.rb +246 -0
  386. data/generated/google/apis/urlshortener_v1/representations.rb +121 -0
  387. data/generated/google/apis/urlshortener_v1/service.rb +176 -0
  388. data/generated/google/apis/urlshortener_v1.rb +34 -0
  389. data/generated/google/apis/vision_v1/classes.rb +1259 -0
  390. data/generated/google/apis/vision_v1/representations.rb +418 -0
  391. data/generated/google/apis/vision_v1/service.rb +91 -0
  392. data/generated/google/apis/vision_v1.rb +37 -0
  393. data/generated/google/apis/webmasters_v3/classes.rb +563 -0
  394. data/generated/google/apis/webmasters_v3/representations.rb +282 -0
  395. data/generated/google/apis/webmasters_v3/service.rb +573 -0
  396. data/generated/google/apis/webmasters_v3.rb +37 -0
  397. data/generated/google/apis/youtube_analytics_v1/classes.rb +546 -0
  398. data/generated/google/apis/youtube_analytics_v1/representations.rb +273 -0
  399. data/generated/google/apis/youtube_analytics_v1/service.rb +562 -0
  400. data/generated/google/apis/youtube_analytics_v1.rb +46 -0
  401. data/generated/google/apis/youtube_v3/classes.rb +8071 -0
  402. data/generated/google/apis/youtube_v3/representations.rb +3134 -0
  403. data/generated/google/apis/youtube_v3/service.rb +4403 -0
  404. data/generated/google/apis/youtube_v3.rb +49 -0
  405. data/generated/google/apis/youtubereporting_v1/classes.rb +258 -0
  406. data/generated/google/apis/youtubereporting_v1/representations.rb +144 -0
  407. data/generated/google/apis/youtubereporting_v1/service.rb +364 -0
  408. data/generated/google/apis/youtubereporting_v1.rb +38 -0
  409. data/google-api-client.gemspec +25 -39
  410. data/lib/google/api_client/auth/installed_app.rb +7 -5
  411. data/lib/google/api_client/auth/key_utils.rb +1 -0
  412. data/lib/google/api_client/auth/storage.rb +4 -2
  413. data/lib/google/api_client/auth/storages/file_store.rb +2 -3
  414. data/lib/google/api_client/auth/storages/redis_store.rb +7 -2
  415. data/lib/google/api_client/client_secrets.rb +7 -9
  416. data/lib/google/apis/core/api_command.rb +136 -0
  417. data/lib/google/apis/core/base_service.rb +317 -0
  418. data/lib/google/apis/core/batch.rb +239 -0
  419. data/lib/google/apis/core/download.rb +94 -0
  420. data/lib/google/apis/core/hashable.rb +44 -0
  421. data/lib/google/apis/core/http_client_adapter.rb +82 -0
  422. data/lib/google/apis/core/http_command.rb +328 -0
  423. data/lib/google/apis/core/json_representation.rb +145 -0
  424. data/lib/google/{api_client/version.rb → apis/core/logging.rb} +12 -8
  425. data/lib/google/apis/core/multipart.rb +187 -0
  426. data/lib/google/apis/core/upload.rb +289 -0
  427. data/lib/google/{api_client → apis}/errors.rb +39 -28
  428. data/lib/google/apis/generator/annotator.rb +295 -0
  429. data/lib/google/apis/generator/helpers.rb +74 -0
  430. data/lib/google/apis/generator/model.rb +143 -0
  431. data/lib/google/apis/generator/template.rb +124 -0
  432. data/lib/google/apis/generator/templates/_class.tmpl +40 -0
  433. data/lib/google/apis/generator/templates/_method.tmpl +92 -0
  434. data/lib/google/apis/generator/templates/_representation.tmpl +51 -0
  435. data/lib/google/apis/generator/templates/_representation_stub.tmpl +17 -0
  436. data/lib/google/apis/generator/templates/_representation_type.tmpl +10 -0
  437. data/lib/google/{api_client/reference.rb → apis/generator/templates/classes.rb.tmpl} +11 -9
  438. data/lib/google/apis/generator/templates/module.rb.tmpl +40 -0
  439. data/lib/google/apis/generator/templates/representations.rb.tmpl +32 -0
  440. data/lib/google/apis/generator/templates/service.rb.tmpl +60 -0
  441. data/lib/google/apis/generator.rb +70 -0
  442. data/lib/google/apis/options.rb +85 -0
  443. data/lib/google/apis/version.rb +39 -0
  444. data/lib/google/apis.rb +48 -0
  445. data/rakelib/metrics.rake +22 -0
  446. data/rakelib/rubocop.rake +10 -0
  447. data/rakelib/spec.rake +11 -0
  448. data/rakelib/yard.rake +11 -0
  449. data/samples/cli/Gemfile +7 -0
  450. data/samples/cli/README.md +51 -0
  451. data/samples/cli/google-api-samples +32 -0
  452. data/samples/cli/lib/base_cli.rb +95 -0
  453. data/samples/cli/lib/samples/analytics.rb +62 -0
  454. data/samples/cli/lib/samples/androidpublisher.rb +47 -0
  455. data/samples/cli/lib/samples/calendar.rb +83 -0
  456. data/samples/cli/lib/samples/drive.rb +82 -0
  457. data/samples/cli/lib/samples/gmail.rb +50 -0
  458. data/samples/cli/lib/samples/pubsub.rb +114 -0
  459. data/samples/cli/lib/samples/translate.rb +44 -0
  460. data/samples/cli/lib/samples/you_tube.rb +44 -0
  461. data/samples/web/Gemfile +7 -0
  462. data/samples/web/README.md +44 -0
  463. data/samples/web/app.rb +120 -0
  464. data/samples/web/views/calendar.erb +34 -0
  465. data/{lib/google/api_client/service_account.rb → samples/web/views/drive.erb} +20 -8
  466. data/samples/web/views/home.erb +35 -0
  467. data/samples/web/views/layout.erb +40 -0
  468. data/script/generate +100 -0
  469. data/script/package +8 -0
  470. data/script/release +15 -0
  471. data/spec/fixtures/files/api_names.yaml +3 -0
  472. data/spec/fixtures/files/auth_stored_credentials.json +8 -0
  473. data/spec/fixtures/files/child/.gitignore +0 -0
  474. data/spec/fixtures/files/client_secrets.json +1 -0
  475. data/spec/fixtures/files/invalid.json +1 -0
  476. data/spec/fixtures/files/test.blah +1 -0
  477. data/spec/fixtures/files/test.txt +1 -0
  478. data/spec/fixtures/files/test_api.json +440 -0
  479. data/spec/google/api_client/auth/storage_spec.rb +1 -3
  480. data/spec/google/api_client/auth/storages/file_store_spec.rb +1 -2
  481. data/spec/google/api_client/auth/storages/redis_store_spec.rb +1 -3
  482. data/spec/google/api_client/client_secrets_spec.rb +338 -2
  483. data/spec/google/apis/core/api_command_spec.rb +209 -0
  484. data/spec/google/apis/core/batch_spec.rb +142 -0
  485. data/spec/google/apis/core/download_spec.rb +103 -0
  486. data/spec/google/apis/core/hashable_spec.rb +60 -0
  487. data/spec/google/apis/core/http_command_spec.rb +303 -0
  488. data/spec/google/apis/core/json_representation_spec.rb +199 -0
  489. data/spec/google/apis/core/service_spec.rb +247 -0
  490. data/spec/google/apis/core/upload_spec.rb +300 -0
  491. data/{lib/google/api_client/discovery.rb → spec/google/apis/generated_spec.rb} +13 -5
  492. data/spec/google/apis/generator/generator_spec.rb +324 -0
  493. data/spec/google/apis/logging_spec.rb +45 -0
  494. data/spec/google/apis/options_spec.rb +40 -0
  495. data/spec/integration_tests/adsense_spec.rb +29 -0
  496. data/spec/integration_tests/drive_spec.rb +35 -0
  497. data/spec/integration_tests/pubsub_spec.rb +48 -0
  498. data/spec/integration_tests/url_shortener_spec.rb +45 -0
  499. data/spec/spec_helper/load_path_spec.rb +33 -0
  500. data/spec/spec_helper.rb +131 -44
  501. data/third_party/hurley_patches.rb +103 -0
  502. metadata +563 -188
  503. data/lib/compat/multi_json.rb +0 -19
  504. data/lib/google/api_client/auth/file_storage.rb +0 -59
  505. data/lib/google/api_client/auth/jwt_asserter.rb +0 -126
  506. data/lib/google/api_client/auth/pkcs12.rb +0 -41
  507. data/lib/google/api_client/batch.rb +0 -326
  508. data/lib/google/api_client/charset.rb +0 -33
  509. data/lib/google/api_client/discovery/api.rb +0 -310
  510. data/lib/google/api_client/discovery/media.rb +0 -77
  511. data/lib/google/api_client/discovery/method.rb +0 -363
  512. data/lib/google/api_client/discovery/resource.rb +0 -156
  513. data/lib/google/api_client/discovery/schema.rb +0 -117
  514. data/lib/google/api_client/environment.rb +0 -42
  515. data/lib/google/api_client/gzip.rb +0 -28
  516. data/lib/google/api_client/logging.rb +0 -32
  517. data/lib/google/api_client/media.rb +0 -259
  518. data/lib/google/api_client/railtie.rb +0 -18
  519. data/lib/google/api_client/request.rb +0 -350
  520. data/lib/google/api_client/result.rb +0 -255
  521. data/lib/google/api_client/service/batch.rb +0 -110
  522. data/lib/google/api_client/service/request.rb +0 -144
  523. data/lib/google/api_client/service/resource.rb +0 -40
  524. data/lib/google/api_client/service/result.rb +0 -162
  525. data/lib/google/api_client/service/simple_file_store.rb +0 -151
  526. data/lib/google/api_client/service/stub_generator.rb +0 -61
  527. data/lib/google/api_client/service.rb +0 -233
  528. data/lib/google/api_client.rb +0 -750
  529. data/spec/google/api_client/batch_spec.rb +0 -248
  530. data/spec/google/api_client/discovery_spec.rb +0 -708
  531. data/spec/google/api_client/gzip_spec.rb +0 -98
  532. data/spec/google/api_client/media_spec.rb +0 -178
  533. data/spec/google/api_client/result_spec.rb +0 -207
  534. data/spec/google/api_client/service_account_spec.rb +0 -169
  535. data/spec/google/api_client/service_spec.rb +0 -618
  536. data/spec/google/api_client/simple_file_store_spec.rb +0 -133
  537. data/spec/google/api_client_spec.rb +0 -352
@@ -0,0 +1,2740 @@
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 DriveV2
23
+ # Drive API
24
+ #
25
+ # The API to interact with Drive.
26
+ #
27
+ # @example
28
+ # require 'google/apis/drive_v2'
29
+ #
30
+ # Drive = Google::Apis::DriveV2 # Alias the module
31
+ # service = Drive::DriveService.new
32
+ #
33
+ # @see https://developers.google.com/drive/
34
+ class DriveService < 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/', 'drive/v2/')
53
+ end
54
+
55
+ # Gets the information about the current user along with Drive API settings
56
+ # @param [Boolean] include_subscribed
57
+ # When calculating the number of remaining change IDs, whether to include public
58
+ # files the user has opened and shared files. When set to false, this counts
59
+ # only change IDs for owned files and any shared or public files that the user
60
+ # has explicitly added to a folder they own.
61
+ # @param [String] max_change_id_count
62
+ # Maximum number of remaining change IDs to count
63
+ # @param [String] start_change_id
64
+ # Change ID to start counting from when calculating number of remaining change
65
+ # IDs
66
+ # @param [String] fields
67
+ # Selector specifying which fields to include in a partial response.
68
+ # @param [String] quota_user
69
+ # Available to use for quota purposes for server-side applications. Can be any
70
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
71
+ # Overrides userIp if both are provided.
72
+ # @param [String] user_ip
73
+ # IP address of the site where the request originates. Use this if you want to
74
+ # enforce per-user limits.
75
+ # @param [Google::Apis::RequestOptions] options
76
+ # Request-specific options
77
+ #
78
+ # @yield [result, err] Result & error if block supplied
79
+ # @yieldparam result [Google::Apis::DriveV2::About] parsed result object
80
+ # @yieldparam err [StandardError] error object if request failed
81
+ #
82
+ # @return [Google::Apis::DriveV2::About]
83
+ #
84
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
85
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
86
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
87
+ def get_about(include_subscribed: nil, max_change_id_count: nil, start_change_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
88
+ command = make_simple_command(:get, 'about', options)
89
+ command.response_representation = Google::Apis::DriveV2::About::Representation
90
+ command.response_class = Google::Apis::DriveV2::About
91
+ command.query['includeSubscribed'] = include_subscribed unless include_subscribed.nil?
92
+ command.query['maxChangeIdCount'] = max_change_id_count unless max_change_id_count.nil?
93
+ command.query['startChangeId'] = start_change_id unless start_change_id.nil?
94
+ command.query['fields'] = fields unless fields.nil?
95
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
96
+ command.query['userIp'] = user_ip unless user_ip.nil?
97
+ execute_or_queue_command(command, &block)
98
+ end
99
+
100
+ # Gets a specific app.
101
+ # @param [String] app_id
102
+ # The ID of the app.
103
+ # @param [String] fields
104
+ # Selector specifying which fields to include in a partial response.
105
+ # @param [String] quota_user
106
+ # Available to use for quota purposes for server-side applications. Can be any
107
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
108
+ # Overrides userIp if both are provided.
109
+ # @param [String] user_ip
110
+ # IP address of the site where the request originates. Use this if you want to
111
+ # enforce per-user limits.
112
+ # @param [Google::Apis::RequestOptions] options
113
+ # Request-specific options
114
+ #
115
+ # @yield [result, err] Result & error if block supplied
116
+ # @yieldparam result [Google::Apis::DriveV2::App] parsed result object
117
+ # @yieldparam err [StandardError] error object if request failed
118
+ #
119
+ # @return [Google::Apis::DriveV2::App]
120
+ #
121
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
122
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
123
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
124
+ def get_app(app_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
125
+ command = make_simple_command(:get, 'apps/{appId}', options)
126
+ command.response_representation = Google::Apis::DriveV2::App::Representation
127
+ command.response_class = Google::Apis::DriveV2::App
128
+ command.params['appId'] = app_id unless app_id.nil?
129
+ command.query['fields'] = fields unless fields.nil?
130
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
131
+ command.query['userIp'] = user_ip unless user_ip.nil?
132
+ execute_or_queue_command(command, &block)
133
+ end
134
+
135
+ # Lists a user's installed apps.
136
+ # @param [String] app_filter_extensions
137
+ # A comma-separated list of file extensions for open with filtering. All apps
138
+ # within the given app query scope which can open any of the given file
139
+ # extensions will be included in the response. If appFilterMimeTypes are
140
+ # provided as well, the result is a union of the two resulting app lists.
141
+ # @param [String] app_filter_mime_types
142
+ # A comma-separated list of MIME types for open with filtering. All apps within
143
+ # the given app query scope which can open any of the given MIME types will be
144
+ # included in the response. If appFilterExtensions are provided as well, the
145
+ # result is a union of the two resulting app lists.
146
+ # @param [String] language_code
147
+ # A language or locale code, as defined by BCP 47, with some extensions from
148
+ # Unicode's LDML format (http://www.unicode.org/reports/tr35/).
149
+ # @param [String] fields
150
+ # Selector specifying which fields to include in a partial response.
151
+ # @param [String] quota_user
152
+ # Available to use for quota purposes for server-side applications. Can be any
153
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
154
+ # Overrides userIp if both are provided.
155
+ # @param [String] user_ip
156
+ # IP address of the site where the request originates. Use this if you want to
157
+ # enforce per-user limits.
158
+ # @param [Google::Apis::RequestOptions] options
159
+ # Request-specific options
160
+ #
161
+ # @yield [result, err] Result & error if block supplied
162
+ # @yieldparam result [Google::Apis::DriveV2::AppList] parsed result object
163
+ # @yieldparam err [StandardError] error object if request failed
164
+ #
165
+ # @return [Google::Apis::DriveV2::AppList]
166
+ #
167
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
168
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
169
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
170
+ def list_apps(app_filter_extensions: nil, app_filter_mime_types: nil, language_code: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
171
+ command = make_simple_command(:get, 'apps', options)
172
+ command.response_representation = Google::Apis::DriveV2::AppList::Representation
173
+ command.response_class = Google::Apis::DriveV2::AppList
174
+ command.query['appFilterExtensions'] = app_filter_extensions unless app_filter_extensions.nil?
175
+ command.query['appFilterMimeTypes'] = app_filter_mime_types unless app_filter_mime_types.nil?
176
+ command.query['languageCode'] = language_code unless language_code.nil?
177
+ command.query['fields'] = fields unless fields.nil?
178
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
179
+ command.query['userIp'] = user_ip unless user_ip.nil?
180
+ execute_or_queue_command(command, &block)
181
+ end
182
+
183
+ # Gets a specific change.
184
+ # @param [String] change_id
185
+ # The ID of the change.
186
+ # @param [String] fields
187
+ # Selector specifying which fields to include in a partial response.
188
+ # @param [String] quota_user
189
+ # Available to use for quota purposes for server-side applications. Can be any
190
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
191
+ # Overrides userIp if both are provided.
192
+ # @param [String] user_ip
193
+ # IP address of the site where the request originates. Use this if you want to
194
+ # enforce per-user limits.
195
+ # @param [Google::Apis::RequestOptions] options
196
+ # Request-specific options
197
+ #
198
+ # @yield [result, err] Result & error if block supplied
199
+ # @yieldparam result [Google::Apis::DriveV2::Change] parsed result object
200
+ # @yieldparam err [StandardError] error object if request failed
201
+ #
202
+ # @return [Google::Apis::DriveV2::Change]
203
+ #
204
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
205
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
206
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
207
+ def get_change(change_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
208
+ command = make_simple_command(:get, 'changes/{changeId}', options)
209
+ command.response_representation = Google::Apis::DriveV2::Change::Representation
210
+ command.response_class = Google::Apis::DriveV2::Change
211
+ command.params['changeId'] = change_id unless change_id.nil?
212
+ command.query['fields'] = fields unless fields.nil?
213
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
214
+ command.query['userIp'] = user_ip unless user_ip.nil?
215
+ execute_or_queue_command(command, &block)
216
+ end
217
+
218
+ # Lists the changes for a user.
219
+ # @param [Boolean] include_deleted
220
+ # Whether to include deleted items.
221
+ # @param [Boolean] include_subscribed
222
+ # Whether to include public files the user has opened and shared files. When set
223
+ # to false, the list only includes owned files plus any shared or public files
224
+ # the user has explicitly added to a folder they own.
225
+ # @param [Fixnum] max_results
226
+ # Maximum number of changes to return.
227
+ # @param [String] page_token
228
+ # Page token for changes.
229
+ # @param [String] spaces
230
+ # A comma-separated list of spaces to query. Supported values are 'drive', '
231
+ # appDataFolder' and 'photos'.
232
+ # @param [String] start_change_id
233
+ # Change ID to start listing changes from.
234
+ # @param [String] fields
235
+ # Selector specifying which fields to include in a partial response.
236
+ # @param [String] quota_user
237
+ # Available to use for quota purposes for server-side applications. Can be any
238
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
239
+ # Overrides userIp if both are provided.
240
+ # @param [String] user_ip
241
+ # IP address of the site where the request originates. Use this if you want to
242
+ # enforce per-user limits.
243
+ # @param [Google::Apis::RequestOptions] options
244
+ # Request-specific options
245
+ #
246
+ # @yield [result, err] Result & error if block supplied
247
+ # @yieldparam result [Google::Apis::DriveV2::ChangeList] parsed result object
248
+ # @yieldparam err [StandardError] error object if request failed
249
+ #
250
+ # @return [Google::Apis::DriveV2::ChangeList]
251
+ #
252
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
253
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
254
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
255
+ def list_changes(include_deleted: nil, include_subscribed: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
256
+ command = make_simple_command(:get, 'changes', options)
257
+ command.response_representation = Google::Apis::DriveV2::ChangeList::Representation
258
+ command.response_class = Google::Apis::DriveV2::ChangeList
259
+ command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
260
+ command.query['includeSubscribed'] = include_subscribed unless include_subscribed.nil?
261
+ command.query['maxResults'] = max_results unless max_results.nil?
262
+ command.query['pageToken'] = page_token unless page_token.nil?
263
+ command.query['spaces'] = spaces unless spaces.nil?
264
+ command.query['startChangeId'] = start_change_id unless start_change_id.nil?
265
+ command.query['fields'] = fields unless fields.nil?
266
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
267
+ command.query['userIp'] = user_ip unless user_ip.nil?
268
+ execute_or_queue_command(command, &block)
269
+ end
270
+
271
+ # Subscribe to changes for a user.
272
+ # @param [Google::Apis::DriveV2::Channel] channel_object
273
+ # @param [Boolean] include_deleted
274
+ # Whether to include deleted items.
275
+ # @param [Boolean] include_subscribed
276
+ # Whether to include public files the user has opened and shared files. When set
277
+ # to false, the list only includes owned files plus any shared or public files
278
+ # the user has explicitly added to a folder they own.
279
+ # @param [Fixnum] max_results
280
+ # Maximum number of changes to return.
281
+ # @param [String] page_token
282
+ # Page token for changes.
283
+ # @param [String] spaces
284
+ # A comma-separated list of spaces to query. Supported values are 'drive', '
285
+ # appDataFolder' and 'photos'.
286
+ # @param [String] start_change_id
287
+ # Change ID to start listing changes from.
288
+ # @param [String] fields
289
+ # Selector specifying which fields to include in a partial response.
290
+ # @param [String] quota_user
291
+ # Available to use for quota purposes for server-side applications. Can be any
292
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
293
+ # Overrides userIp if both are provided.
294
+ # @param [String] user_ip
295
+ # IP address of the site where the request originates. Use this if you want to
296
+ # enforce per-user limits.
297
+ # @param [Google::Apis::RequestOptions] options
298
+ # Request-specific options
299
+ #
300
+ # @yield [result, err] Result & error if block supplied
301
+ # @yieldparam result [Google::Apis::DriveV2::Channel] parsed result object
302
+ # @yieldparam err [StandardError] error object if request failed
303
+ #
304
+ # @return [Google::Apis::DriveV2::Channel]
305
+ #
306
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
307
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
308
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
309
+ def watch_change(channel_object = nil, include_deleted: nil, include_subscribed: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
310
+ command = make_simple_command(:post, 'changes/watch', options)
311
+ command.request_representation = Google::Apis::DriveV2::Channel::Representation
312
+ command.request_object = channel_object
313
+ command.response_representation = Google::Apis::DriveV2::Channel::Representation
314
+ command.response_class = Google::Apis::DriveV2::Channel
315
+ command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
316
+ command.query['includeSubscribed'] = include_subscribed unless include_subscribed.nil?
317
+ command.query['maxResults'] = max_results unless max_results.nil?
318
+ command.query['pageToken'] = page_token unless page_token.nil?
319
+ command.query['spaces'] = spaces unless spaces.nil?
320
+ command.query['startChangeId'] = start_change_id unless start_change_id.nil?
321
+ command.query['fields'] = fields unless fields.nil?
322
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
323
+ command.query['userIp'] = user_ip unless user_ip.nil?
324
+ execute_or_queue_command(command, &block)
325
+ end
326
+
327
+ # Stop watching resources through this channel
328
+ # @param [Google::Apis::DriveV2::Channel] channel_object
329
+ # @param [String] fields
330
+ # Selector specifying which fields to include in a partial response.
331
+ # @param [String] quota_user
332
+ # Available to use for quota purposes for server-side applications. Can be any
333
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
334
+ # Overrides userIp if both are provided.
335
+ # @param [String] user_ip
336
+ # IP address of the site where the request originates. Use this if you want to
337
+ # enforce per-user limits.
338
+ # @param [Google::Apis::RequestOptions] options
339
+ # Request-specific options
340
+ #
341
+ # @yield [result, err] Result & error if block supplied
342
+ # @yieldparam result [NilClass] No result returned for this method
343
+ # @yieldparam err [StandardError] error object if request failed
344
+ #
345
+ # @return [void]
346
+ #
347
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
348
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
349
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
350
+ def stop_channel(channel_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
351
+ command = make_simple_command(:post, 'channels/stop', options)
352
+ command.request_representation = Google::Apis::DriveV2::Channel::Representation
353
+ command.request_object = channel_object
354
+ command.query['fields'] = fields unless fields.nil?
355
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
356
+ command.query['userIp'] = user_ip unless user_ip.nil?
357
+ execute_or_queue_command(command, &block)
358
+ end
359
+
360
+ # Removes a child from a folder.
361
+ # @param [String] folder_id
362
+ # The ID of the folder.
363
+ # @param [String] child_id
364
+ # The ID of the child.
365
+ # @param [String] fields
366
+ # Selector specifying which fields to include in a partial response.
367
+ # @param [String] quota_user
368
+ # Available to use for quota purposes for server-side applications. Can be any
369
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
370
+ # Overrides userIp if both are provided.
371
+ # @param [String] user_ip
372
+ # IP address of the site where the request originates. Use this if you want to
373
+ # enforce per-user limits.
374
+ # @param [Google::Apis::RequestOptions] options
375
+ # Request-specific options
376
+ #
377
+ # @yield [result, err] Result & error if block supplied
378
+ # @yieldparam result [NilClass] No result returned for this method
379
+ # @yieldparam err [StandardError] error object if request failed
380
+ #
381
+ # @return [void]
382
+ #
383
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
384
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
385
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
386
+ def delete_child(folder_id, child_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
387
+ command = make_simple_command(:delete, 'files/{folderId}/children/{childId}', options)
388
+ command.params['folderId'] = folder_id unless folder_id.nil?
389
+ command.params['childId'] = child_id unless child_id.nil?
390
+ command.query['fields'] = fields unless fields.nil?
391
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
392
+ command.query['userIp'] = user_ip unless user_ip.nil?
393
+ execute_or_queue_command(command, &block)
394
+ end
395
+
396
+ # Gets a specific child reference.
397
+ # @param [String] folder_id
398
+ # The ID of the folder.
399
+ # @param [String] child_id
400
+ # The ID of the child.
401
+ # @param [String] fields
402
+ # Selector specifying which fields to include in a partial response.
403
+ # @param [String] quota_user
404
+ # Available to use for quota purposes for server-side applications. Can be any
405
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
406
+ # Overrides userIp if both are provided.
407
+ # @param [String] user_ip
408
+ # IP address of the site where the request originates. Use this if you want to
409
+ # enforce per-user limits.
410
+ # @param [Google::Apis::RequestOptions] options
411
+ # Request-specific options
412
+ #
413
+ # @yield [result, err] Result & error if block supplied
414
+ # @yieldparam result [Google::Apis::DriveV2::ChildReference] parsed result object
415
+ # @yieldparam err [StandardError] error object if request failed
416
+ #
417
+ # @return [Google::Apis::DriveV2::ChildReference]
418
+ #
419
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
420
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
421
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
422
+ def get_child(folder_id, child_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
423
+ command = make_simple_command(:get, 'files/{folderId}/children/{childId}', options)
424
+ command.response_representation = Google::Apis::DriveV2::ChildReference::Representation
425
+ command.response_class = Google::Apis::DriveV2::ChildReference
426
+ command.params['folderId'] = folder_id unless folder_id.nil?
427
+ command.params['childId'] = child_id unless child_id.nil?
428
+ command.query['fields'] = fields unless fields.nil?
429
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
430
+ command.query['userIp'] = user_ip unless user_ip.nil?
431
+ execute_or_queue_command(command, &block)
432
+ end
433
+
434
+ # Inserts a file into a folder.
435
+ # @param [String] folder_id
436
+ # The ID of the folder.
437
+ # @param [Google::Apis::DriveV2::ChildReference] child_reference_object
438
+ # @param [String] fields
439
+ # Selector specifying which fields to include in a partial response.
440
+ # @param [String] quota_user
441
+ # Available to use for quota purposes for server-side applications. Can be any
442
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
443
+ # Overrides userIp if both are provided.
444
+ # @param [String] user_ip
445
+ # IP address of the site where the request originates. Use this if you want to
446
+ # enforce per-user limits.
447
+ # @param [Google::Apis::RequestOptions] options
448
+ # Request-specific options
449
+ #
450
+ # @yield [result, err] Result & error if block supplied
451
+ # @yieldparam result [Google::Apis::DriveV2::ChildReference] parsed result object
452
+ # @yieldparam err [StandardError] error object if request failed
453
+ #
454
+ # @return [Google::Apis::DriveV2::ChildReference]
455
+ #
456
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
457
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
458
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
459
+ def insert_child(folder_id, child_reference_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
460
+ command = make_simple_command(:post, 'files/{folderId}/children', options)
461
+ command.request_representation = Google::Apis::DriveV2::ChildReference::Representation
462
+ command.request_object = child_reference_object
463
+ command.response_representation = Google::Apis::DriveV2::ChildReference::Representation
464
+ command.response_class = Google::Apis::DriveV2::ChildReference
465
+ command.params['folderId'] = folder_id unless folder_id.nil?
466
+ command.query['fields'] = fields unless fields.nil?
467
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
468
+ command.query['userIp'] = user_ip unless user_ip.nil?
469
+ execute_or_queue_command(command, &block)
470
+ end
471
+
472
+ # Lists a folder's children.
473
+ # @param [String] folder_id
474
+ # The ID of the folder.
475
+ # @param [Fixnum] max_results
476
+ # Maximum number of children to return.
477
+ # @param [String] order_by
478
+ # A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', '
479
+ # lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', '
480
+ # recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending
481
+ # by default, but may be reversed with the 'desc' modifier. Example usage: ?
482
+ # orderBy=folder,modifiedDate desc,title. Please note that there is a current
483
+ # limitation for users with approximately one million files in which the
484
+ # requested sort order is ignored.
485
+ # @param [String] page_token
486
+ # Page token for children.
487
+ # @param [String] q
488
+ # Query string for searching children.
489
+ # @param [String] fields
490
+ # Selector specifying which fields to include in a partial response.
491
+ # @param [String] quota_user
492
+ # Available to use for quota purposes for server-side applications. Can be any
493
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
494
+ # Overrides userIp if both are provided.
495
+ # @param [String] user_ip
496
+ # IP address of the site where the request originates. Use this if you want to
497
+ # enforce per-user limits.
498
+ # @param [Google::Apis::RequestOptions] options
499
+ # Request-specific options
500
+ #
501
+ # @yield [result, err] Result & error if block supplied
502
+ # @yieldparam result [Google::Apis::DriveV2::ChildList] parsed result object
503
+ # @yieldparam err [StandardError] error object if request failed
504
+ #
505
+ # @return [Google::Apis::DriveV2::ChildList]
506
+ #
507
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
508
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
509
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
510
+ def list_children(folder_id, max_results: nil, order_by: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
511
+ command = make_simple_command(:get, 'files/{folderId}/children', options)
512
+ command.response_representation = Google::Apis::DriveV2::ChildList::Representation
513
+ command.response_class = Google::Apis::DriveV2::ChildList
514
+ command.params['folderId'] = folder_id unless folder_id.nil?
515
+ command.query['maxResults'] = max_results unless max_results.nil?
516
+ command.query['orderBy'] = order_by unless order_by.nil?
517
+ command.query['pageToken'] = page_token unless page_token.nil?
518
+ command.query['q'] = q unless q.nil?
519
+ command.query['fields'] = fields unless fields.nil?
520
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
521
+ command.query['userIp'] = user_ip unless user_ip.nil?
522
+ execute_or_queue_command(command, &block)
523
+ end
524
+
525
+ # Deletes a comment.
526
+ # @param [String] file_id
527
+ # The ID of the file.
528
+ # @param [String] comment_id
529
+ # The ID of the comment.
530
+ # @param [String] fields
531
+ # Selector specifying which fields to include in a partial response.
532
+ # @param [String] quota_user
533
+ # Available to use for quota purposes for server-side applications. Can be any
534
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
535
+ # Overrides userIp if both are provided.
536
+ # @param [String] user_ip
537
+ # IP address of the site where the request originates. Use this if you want to
538
+ # enforce per-user limits.
539
+ # @param [Google::Apis::RequestOptions] options
540
+ # Request-specific options
541
+ #
542
+ # @yield [result, err] Result & error if block supplied
543
+ # @yieldparam result [NilClass] No result returned for this method
544
+ # @yieldparam err [StandardError] error object if request failed
545
+ #
546
+ # @return [void]
547
+ #
548
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
549
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
550
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
551
+ def delete_comment(file_id, comment_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
552
+ command = make_simple_command(:delete, 'files/{fileId}/comments/{commentId}', options)
553
+ command.params['fileId'] = file_id unless file_id.nil?
554
+ command.params['commentId'] = comment_id unless comment_id.nil?
555
+ command.query['fields'] = fields unless fields.nil?
556
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
557
+ command.query['userIp'] = user_ip unless user_ip.nil?
558
+ execute_or_queue_command(command, &block)
559
+ end
560
+
561
+ # Gets a comment by ID.
562
+ # @param [String] file_id
563
+ # The ID of the file.
564
+ # @param [String] comment_id
565
+ # The ID of the comment.
566
+ # @param [Boolean] include_deleted
567
+ # If set, this will succeed when retrieving a deleted comment, and will include
568
+ # any deleted replies.
569
+ # @param [String] fields
570
+ # Selector specifying which fields to include in a partial response.
571
+ # @param [String] quota_user
572
+ # Available to use for quota purposes for server-side applications. Can be any
573
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
574
+ # Overrides userIp if both are provided.
575
+ # @param [String] user_ip
576
+ # IP address of the site where the request originates. Use this if you want to
577
+ # enforce per-user limits.
578
+ # @param [Google::Apis::RequestOptions] options
579
+ # Request-specific options
580
+ #
581
+ # @yield [result, err] Result & error if block supplied
582
+ # @yieldparam result [Google::Apis::DriveV2::Comment] parsed result object
583
+ # @yieldparam err [StandardError] error object if request failed
584
+ #
585
+ # @return [Google::Apis::DriveV2::Comment]
586
+ #
587
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
588
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
589
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
590
+ def get_comment(file_id, comment_id, include_deleted: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
591
+ command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}', options)
592
+ command.response_representation = Google::Apis::DriveV2::Comment::Representation
593
+ command.response_class = Google::Apis::DriveV2::Comment
594
+ command.params['fileId'] = file_id unless file_id.nil?
595
+ command.params['commentId'] = comment_id unless comment_id.nil?
596
+ command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
597
+ command.query['fields'] = fields unless fields.nil?
598
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
599
+ command.query['userIp'] = user_ip unless user_ip.nil?
600
+ execute_or_queue_command(command, &block)
601
+ end
602
+
603
+ # Creates a new comment on the given file.
604
+ # @param [String] file_id
605
+ # The ID of the file.
606
+ # @param [Google::Apis::DriveV2::Comment] comment_object
607
+ # @param [String] fields
608
+ # Selector specifying which fields to include in a partial response.
609
+ # @param [String] quota_user
610
+ # Available to use for quota purposes for server-side applications. Can be any
611
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
612
+ # Overrides userIp if both are provided.
613
+ # @param [String] user_ip
614
+ # IP address of the site where the request originates. Use this if you want to
615
+ # enforce per-user limits.
616
+ # @param [Google::Apis::RequestOptions] options
617
+ # Request-specific options
618
+ #
619
+ # @yield [result, err] Result & error if block supplied
620
+ # @yieldparam result [Google::Apis::DriveV2::Comment] parsed result object
621
+ # @yieldparam err [StandardError] error object if request failed
622
+ #
623
+ # @return [Google::Apis::DriveV2::Comment]
624
+ #
625
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
626
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
627
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
628
+ def insert_comment(file_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
629
+ command = make_simple_command(:post, 'files/{fileId}/comments', options)
630
+ command.request_representation = Google::Apis::DriveV2::Comment::Representation
631
+ command.request_object = comment_object
632
+ command.response_representation = Google::Apis::DriveV2::Comment::Representation
633
+ command.response_class = Google::Apis::DriveV2::Comment
634
+ command.params['fileId'] = file_id unless file_id.nil?
635
+ command.query['fields'] = fields unless fields.nil?
636
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
637
+ command.query['userIp'] = user_ip unless user_ip.nil?
638
+ execute_or_queue_command(command, &block)
639
+ end
640
+
641
+ # Lists a file's comments.
642
+ # @param [String] file_id
643
+ # The ID of the file.
644
+ # @param [Boolean] include_deleted
645
+ # If set, all comments and replies, including deleted comments and replies (with
646
+ # content stripped) will be returned.
647
+ # @param [Fixnum] max_results
648
+ # The maximum number of discussions to include in the response, used for paging.
649
+ # @param [String] page_token
650
+ # The continuation token, used to page through large result sets. To get the
651
+ # next page of results, set this parameter to the value of "nextPageToken" from
652
+ # the previous response.
653
+ # @param [String] updated_min
654
+ # Only discussions that were updated after this timestamp will be returned.
655
+ # Formatted as an RFC 3339 timestamp.
656
+ # @param [String] fields
657
+ # Selector specifying which fields to include in a partial response.
658
+ # @param [String] quota_user
659
+ # Available to use for quota purposes for server-side applications. Can be any
660
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
661
+ # Overrides userIp if both are provided.
662
+ # @param [String] user_ip
663
+ # IP address of the site where the request originates. Use this if you want to
664
+ # enforce per-user limits.
665
+ # @param [Google::Apis::RequestOptions] options
666
+ # Request-specific options
667
+ #
668
+ # @yield [result, err] Result & error if block supplied
669
+ # @yieldparam result [Google::Apis::DriveV2::CommentList] parsed result object
670
+ # @yieldparam err [StandardError] error object if request failed
671
+ #
672
+ # @return [Google::Apis::DriveV2::CommentList]
673
+ #
674
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
675
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
676
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
677
+ def list_comments(file_id, include_deleted: nil, max_results: nil, page_token: nil, updated_min: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
678
+ command = make_simple_command(:get, 'files/{fileId}/comments', options)
679
+ command.response_representation = Google::Apis::DriveV2::CommentList::Representation
680
+ command.response_class = Google::Apis::DriveV2::CommentList
681
+ command.params['fileId'] = file_id unless file_id.nil?
682
+ command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
683
+ command.query['maxResults'] = max_results unless max_results.nil?
684
+ command.query['pageToken'] = page_token unless page_token.nil?
685
+ command.query['updatedMin'] = updated_min unless updated_min.nil?
686
+ command.query['fields'] = fields unless fields.nil?
687
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
688
+ command.query['userIp'] = user_ip unless user_ip.nil?
689
+ execute_or_queue_command(command, &block)
690
+ end
691
+
692
+ # Updates an existing comment. This method supports patch semantics.
693
+ # @param [String] file_id
694
+ # The ID of the file.
695
+ # @param [String] comment_id
696
+ # The ID of the comment.
697
+ # @param [Google::Apis::DriveV2::Comment] comment_object
698
+ # @param [String] fields
699
+ # Selector specifying which fields to include in a partial response.
700
+ # @param [String] quota_user
701
+ # Available to use for quota purposes for server-side applications. Can be any
702
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
703
+ # Overrides userIp if both are provided.
704
+ # @param [String] user_ip
705
+ # IP address of the site where the request originates. Use this if you want to
706
+ # enforce per-user limits.
707
+ # @param [Google::Apis::RequestOptions] options
708
+ # Request-specific options
709
+ #
710
+ # @yield [result, err] Result & error if block supplied
711
+ # @yieldparam result [Google::Apis::DriveV2::Comment] parsed result object
712
+ # @yieldparam err [StandardError] error object if request failed
713
+ #
714
+ # @return [Google::Apis::DriveV2::Comment]
715
+ #
716
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
717
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
718
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
719
+ def patch_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
720
+ command = make_simple_command(:patch, 'files/{fileId}/comments/{commentId}', options)
721
+ command.request_representation = Google::Apis::DriveV2::Comment::Representation
722
+ command.request_object = comment_object
723
+ command.response_representation = Google::Apis::DriveV2::Comment::Representation
724
+ command.response_class = Google::Apis::DriveV2::Comment
725
+ command.params['fileId'] = file_id unless file_id.nil?
726
+ command.params['commentId'] = comment_id unless comment_id.nil?
727
+ command.query['fields'] = fields unless fields.nil?
728
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
729
+ command.query['userIp'] = user_ip unless user_ip.nil?
730
+ execute_or_queue_command(command, &block)
731
+ end
732
+
733
+ # Updates an existing comment.
734
+ # @param [String] file_id
735
+ # The ID of the file.
736
+ # @param [String] comment_id
737
+ # The ID of the comment.
738
+ # @param [Google::Apis::DriveV2::Comment] comment_object
739
+ # @param [String] fields
740
+ # Selector specifying which fields to include in a partial response.
741
+ # @param [String] quota_user
742
+ # Available to use for quota purposes for server-side applications. Can be any
743
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
744
+ # Overrides userIp if both are provided.
745
+ # @param [String] user_ip
746
+ # IP address of the site where the request originates. Use this if you want to
747
+ # enforce per-user limits.
748
+ # @param [Google::Apis::RequestOptions] options
749
+ # Request-specific options
750
+ #
751
+ # @yield [result, err] Result & error if block supplied
752
+ # @yieldparam result [Google::Apis::DriveV2::Comment] parsed result object
753
+ # @yieldparam err [StandardError] error object if request failed
754
+ #
755
+ # @return [Google::Apis::DriveV2::Comment]
756
+ #
757
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
758
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
759
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
760
+ def update_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
761
+ command = make_simple_command(:put, 'files/{fileId}/comments/{commentId}', options)
762
+ command.request_representation = Google::Apis::DriveV2::Comment::Representation
763
+ command.request_object = comment_object
764
+ command.response_representation = Google::Apis::DriveV2::Comment::Representation
765
+ command.response_class = Google::Apis::DriveV2::Comment
766
+ command.params['fileId'] = file_id unless file_id.nil?
767
+ command.params['commentId'] = comment_id unless comment_id.nil?
768
+ command.query['fields'] = fields unless fields.nil?
769
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
770
+ command.query['userIp'] = user_ip unless user_ip.nil?
771
+ execute_or_queue_command(command, &block)
772
+ end
773
+
774
+ # Creates a copy of the specified file.
775
+ # @param [String] file_id
776
+ # The ID of the file to copy.
777
+ # @param [Google::Apis::DriveV2::File] file_object
778
+ # @param [Boolean] convert
779
+ # Whether to convert this file to the corresponding Google Docs format.
780
+ # @param [Boolean] ocr
781
+ # Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
782
+ # @param [String] ocr_language
783
+ # If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
784
+ # @param [Boolean] pinned
785
+ # Whether to pin the head revision of the new copy. A file can have a maximum of
786
+ # 200 pinned revisions.
787
+ # @param [String] timed_text_language
788
+ # The language of the timed text.
789
+ # @param [String] timed_text_track_name
790
+ # The timed text track name.
791
+ # @param [String] visibility
792
+ # The visibility of the new file. This parameter is only relevant when the
793
+ # source is not a native Google Doc and convert=false.
794
+ # @param [String] fields
795
+ # Selector specifying which fields to include in a partial response.
796
+ # @param [String] quota_user
797
+ # Available to use for quota purposes for server-side applications. Can be any
798
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
799
+ # Overrides userIp if both are provided.
800
+ # @param [String] user_ip
801
+ # IP address of the site where the request originates. Use this if you want to
802
+ # enforce per-user limits.
803
+ # @param [Google::Apis::RequestOptions] options
804
+ # Request-specific options
805
+ #
806
+ # @yield [result, err] Result & error if block supplied
807
+ # @yieldparam result [Google::Apis::DriveV2::File] parsed result object
808
+ # @yieldparam err [StandardError] error object if request failed
809
+ #
810
+ # @return [Google::Apis::DriveV2::File]
811
+ #
812
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
813
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
814
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
815
+ def copy_file(file_id, file_object = nil, convert: nil, ocr: nil, ocr_language: nil, pinned: nil, timed_text_language: nil, timed_text_track_name: nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
816
+ command = make_simple_command(:post, 'files/{fileId}/copy', options)
817
+ command.request_representation = Google::Apis::DriveV2::File::Representation
818
+ command.request_object = file_object
819
+ command.response_representation = Google::Apis::DriveV2::File::Representation
820
+ command.response_class = Google::Apis::DriveV2::File
821
+ command.params['fileId'] = file_id unless file_id.nil?
822
+ command.query['convert'] = convert unless convert.nil?
823
+ command.query['ocr'] = ocr unless ocr.nil?
824
+ command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
825
+ command.query['pinned'] = pinned unless pinned.nil?
826
+ command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil?
827
+ command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil?
828
+ command.query['visibility'] = visibility unless visibility.nil?
829
+ command.query['fields'] = fields unless fields.nil?
830
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
831
+ command.query['userIp'] = user_ip unless user_ip.nil?
832
+ execute_or_queue_command(command, &block)
833
+ end
834
+
835
+ # Permanently deletes a file by ID. Skips the trash. The currently authenticated
836
+ # user must own the file.
837
+ # @param [String] file_id
838
+ # The ID of the file to delete.
839
+ # @param [String] fields
840
+ # Selector specifying which fields to include in a partial response.
841
+ # @param [String] quota_user
842
+ # Available to use for quota purposes for server-side applications. Can be any
843
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
844
+ # Overrides userIp if both are provided.
845
+ # @param [String] user_ip
846
+ # IP address of the site where the request originates. Use this if you want to
847
+ # enforce per-user limits.
848
+ # @param [Google::Apis::RequestOptions] options
849
+ # Request-specific options
850
+ #
851
+ # @yield [result, err] Result & error if block supplied
852
+ # @yieldparam result [NilClass] No result returned for this method
853
+ # @yieldparam err [StandardError] error object if request failed
854
+ #
855
+ # @return [void]
856
+ #
857
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
858
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
859
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
860
+ def delete_file(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
861
+ command = make_simple_command(:delete, 'files/{fileId}', options)
862
+ command.params['fileId'] = file_id unless file_id.nil?
863
+ command.query['fields'] = fields unless fields.nil?
864
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
865
+ command.query['userIp'] = user_ip unless user_ip.nil?
866
+ execute_or_queue_command(command, &block)
867
+ end
868
+
869
+ # Permanently deletes all of the user's trashed files.
870
+ # @param [String] fields
871
+ # Selector specifying which fields to include in a partial response.
872
+ # @param [String] quota_user
873
+ # Available to use for quota purposes for server-side applications. Can be any
874
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
875
+ # Overrides userIp if both are provided.
876
+ # @param [String] user_ip
877
+ # IP address of the site where the request originates. Use this if you want to
878
+ # enforce per-user limits.
879
+ # @param [Google::Apis::RequestOptions] options
880
+ # Request-specific options
881
+ #
882
+ # @yield [result, err] Result & error if block supplied
883
+ # @yieldparam result [NilClass] No result returned for this method
884
+ # @yieldparam err [StandardError] error object if request failed
885
+ #
886
+ # @return [void]
887
+ #
888
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
889
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
890
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
891
+ def empty_trash(fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
892
+ command = make_simple_command(:delete, 'files/trash', options)
893
+ command.query['fields'] = fields unless fields.nil?
894
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
895
+ command.query['userIp'] = user_ip unless user_ip.nil?
896
+ execute_or_queue_command(command, &block)
897
+ end
898
+
899
+ # Exports a Google Doc to the requested MIME type and returns the exported
900
+ # content.
901
+ # @param [String] file_id
902
+ # The ID of the file.
903
+ # @param [String] mime_type
904
+ # The MIME type of the format requested for this export.
905
+ # @param [String] fields
906
+ # Selector specifying which fields to include in a partial response.
907
+ # @param [String] quota_user
908
+ # Available to use for quota purposes for server-side applications. Can be any
909
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
910
+ # Overrides userIp if both are provided.
911
+ # @param [String] user_ip
912
+ # IP address of the site where the request originates. Use this if you want to
913
+ # enforce per-user limits.
914
+ # @param [IO, String] download_dest
915
+ # IO stream or filename to receive content download
916
+ # @param [Google::Apis::RequestOptions] options
917
+ # Request-specific options
918
+ #
919
+ # @yield [result, err] Result & error if block supplied
920
+ # @yieldparam result [NilClass] No result returned for this method
921
+ # @yieldparam err [StandardError] error object if request failed
922
+ #
923
+ # @return [void]
924
+ #
925
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
926
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
927
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
928
+ def export_file(file_id, mime_type, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
929
+ if download_dest.nil?
930
+ command = make_simple_command(:get, 'files/{fileId}/export', options)
931
+ else
932
+ command = make_download_command(:get, 'files/{fileId}/export', options)
933
+ command.download_dest = download_dest
934
+ end
935
+ command.params['fileId'] = file_id unless file_id.nil?
936
+ command.query['mimeType'] = mime_type unless mime_type.nil?
937
+ command.query['fields'] = fields unless fields.nil?
938
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
939
+ command.query['userIp'] = user_ip unless user_ip.nil?
940
+ execute_or_queue_command(command, &block)
941
+ end
942
+
943
+ # Generates a set of file IDs which can be provided in insert requests.
944
+ # @param [Fixnum] max_results
945
+ # Maximum number of IDs to return.
946
+ # @param [String] space
947
+ # The space in which the IDs can be used to create new files. Supported values
948
+ # are 'drive' and 'appDataFolder'.
949
+ # @param [String] fields
950
+ # Selector specifying which fields to include in a partial response.
951
+ # @param [String] quota_user
952
+ # Available to use for quota purposes for server-side applications. Can be any
953
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
954
+ # Overrides userIp if both are provided.
955
+ # @param [String] user_ip
956
+ # IP address of the site where the request originates. Use this if you want to
957
+ # enforce per-user limits.
958
+ # @param [Google::Apis::RequestOptions] options
959
+ # Request-specific options
960
+ #
961
+ # @yield [result, err] Result & error if block supplied
962
+ # @yieldparam result [Google::Apis::DriveV2::GeneratedIds] parsed result object
963
+ # @yieldparam err [StandardError] error object if request failed
964
+ #
965
+ # @return [Google::Apis::DriveV2::GeneratedIds]
966
+ #
967
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
968
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
969
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
970
+ def generate_file_ids(max_results: nil, space: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
971
+ command = make_simple_command(:get, 'files/generateIds', options)
972
+ command.response_representation = Google::Apis::DriveV2::GeneratedIds::Representation
973
+ command.response_class = Google::Apis::DriveV2::GeneratedIds
974
+ command.query['maxResults'] = max_results unless max_results.nil?
975
+ command.query['space'] = space unless space.nil?
976
+ command.query['fields'] = fields unless fields.nil?
977
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
978
+ command.query['userIp'] = user_ip unless user_ip.nil?
979
+ execute_or_queue_command(command, &block)
980
+ end
981
+
982
+ # Gets a file's metadata by ID.
983
+ # @param [String] file_id
984
+ # The ID for the file in question.
985
+ # @param [Boolean] acknowledge_abuse
986
+ # Whether the user is acknowledging the risk of downloading known malware or
987
+ # other abusive files.
988
+ # @param [String] projection
989
+ # This parameter is deprecated and has no function.
990
+ # @param [String] revision_id
991
+ # Specifies the Revision ID that should be downloaded. Ignored unless alt=media
992
+ # is specified.
993
+ # @param [Boolean] update_viewed_date
994
+ # Deprecated: Use files.update with modifiedDateBehavior=noChange,
995
+ # updateViewedDate=true and an empty request body.
996
+ # @param [String] fields
997
+ # Selector specifying which fields to include in a partial response.
998
+ # @param [String] quota_user
999
+ # Available to use for quota purposes for server-side applications. Can be any
1000
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1001
+ # Overrides userIp if both are provided.
1002
+ # @param [String] user_ip
1003
+ # IP address of the site where the request originates. Use this if you want to
1004
+ # enforce per-user limits.
1005
+ # @param [IO, String] download_dest
1006
+ # IO stream or filename to receive content download
1007
+ # @param [Google::Apis::RequestOptions] options
1008
+ # Request-specific options
1009
+ #
1010
+ # @yield [result, err] Result & error if block supplied
1011
+ # @yieldparam result [Google::Apis::DriveV2::File] parsed result object
1012
+ # @yieldparam err [StandardError] error object if request failed
1013
+ #
1014
+ # @return [Google::Apis::DriveV2::File]
1015
+ #
1016
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1017
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1018
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1019
+ def get_file(file_id, acknowledge_abuse: nil, projection: nil, revision_id: nil, update_viewed_date: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
1020
+ if download_dest.nil?
1021
+ command = make_simple_command(:get, 'files/{fileId}', options)
1022
+ else
1023
+ command = make_download_command(:get, 'files/{fileId}', options)
1024
+ command.download_dest = download_dest
1025
+ end
1026
+ command.response_representation = Google::Apis::DriveV2::File::Representation
1027
+ command.response_class = Google::Apis::DriveV2::File
1028
+ command.params['fileId'] = file_id unless file_id.nil?
1029
+ command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.nil?
1030
+ command.query['projection'] = projection unless projection.nil?
1031
+ command.query['revisionId'] = revision_id unless revision_id.nil?
1032
+ command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil?
1033
+ command.query['fields'] = fields unless fields.nil?
1034
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1035
+ command.query['userIp'] = user_ip unless user_ip.nil?
1036
+ execute_or_queue_command(command, &block)
1037
+ end
1038
+
1039
+ # Insert a new file.
1040
+ # @param [Google::Apis::DriveV2::File] file_object
1041
+ # @param [Boolean] convert
1042
+ # Whether to convert this file to the corresponding Google Docs format.
1043
+ # @param [Boolean] ocr
1044
+ # Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
1045
+ # @param [String] ocr_language
1046
+ # If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
1047
+ # @param [Boolean] pinned
1048
+ # Whether to pin the head revision of the uploaded file. A file can have a
1049
+ # maximum of 200 pinned revisions.
1050
+ # @param [String] timed_text_language
1051
+ # The language of the timed text.
1052
+ # @param [String] timed_text_track_name
1053
+ # The timed text track name.
1054
+ # @param [Boolean] use_content_as_indexable_text
1055
+ # Whether to use the content as indexable text.
1056
+ # @param [String] visibility
1057
+ # The visibility of the new file. This parameter is only relevant when convert=
1058
+ # false.
1059
+ # @param [String] fields
1060
+ # Selector specifying which fields to include in a partial response.
1061
+ # @param [String] quota_user
1062
+ # Available to use for quota purposes for server-side applications. Can be any
1063
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1064
+ # Overrides userIp if both are provided.
1065
+ # @param [String] user_ip
1066
+ # IP address of the site where the request originates. Use this if you want to
1067
+ # enforce per-user limits.
1068
+ # @param [IO, String] upload_source
1069
+ # IO stream or filename containing content to upload
1070
+ # @param [String] content_type
1071
+ # Content type of the uploaded content.
1072
+ # @param [Google::Apis::RequestOptions] options
1073
+ # Request-specific options
1074
+ #
1075
+ # @yield [result, err] Result & error if block supplied
1076
+ # @yieldparam result [Google::Apis::DriveV2::File] parsed result object
1077
+ # @yieldparam err [StandardError] error object if request failed
1078
+ #
1079
+ # @return [Google::Apis::DriveV2::File]
1080
+ #
1081
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1082
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1083
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1084
+ def insert_file(file_object = nil, convert: nil, ocr: nil, ocr_language: nil, pinned: nil, timed_text_language: nil, timed_text_track_name: nil, use_content_as_indexable_text: nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
1085
+ if upload_source.nil?
1086
+ command = make_simple_command(:post, 'files', options)
1087
+ else
1088
+ command = make_upload_command(:post, 'files', options)
1089
+ command.upload_source = upload_source
1090
+ command.upload_content_type = content_type
1091
+ end
1092
+ command.request_representation = Google::Apis::DriveV2::File::Representation
1093
+ command.request_object = file_object
1094
+ command.response_representation = Google::Apis::DriveV2::File::Representation
1095
+ command.response_class = Google::Apis::DriveV2::File
1096
+ command.query['convert'] = convert unless convert.nil?
1097
+ command.query['ocr'] = ocr unless ocr.nil?
1098
+ command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
1099
+ command.query['pinned'] = pinned unless pinned.nil?
1100
+ command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil?
1101
+ command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil?
1102
+ command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil?
1103
+ command.query['visibility'] = visibility unless visibility.nil?
1104
+ command.query['fields'] = fields unless fields.nil?
1105
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1106
+ command.query['userIp'] = user_ip unless user_ip.nil?
1107
+ execute_or_queue_command(command, &block)
1108
+ end
1109
+
1110
+ # Lists the user's files.
1111
+ # @param [String] corpus
1112
+ # The body of items (files/documents) to which the query applies.
1113
+ # @param [Fixnum] max_results
1114
+ # Maximum number of files to return.
1115
+ # @param [String] order_by
1116
+ # A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', '
1117
+ # lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', '
1118
+ # recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending
1119
+ # by default, but may be reversed with the 'desc' modifier. Example usage: ?
1120
+ # orderBy=folder,modifiedDate desc,title. Please note that there is a current
1121
+ # limitation for users with approximately one million files in which the
1122
+ # requested sort order is ignored.
1123
+ # @param [String] page_token
1124
+ # Page token for files.
1125
+ # @param [String] projection
1126
+ # This parameter is deprecated and has no function.
1127
+ # @param [String] q
1128
+ # Query string for searching files.
1129
+ # @param [String] spaces
1130
+ # A comma-separated list of spaces to query. Supported values are 'drive', '
1131
+ # appDataFolder' and 'photos'.
1132
+ # @param [String] fields
1133
+ # Selector specifying which fields to include in a partial response.
1134
+ # @param [String] quota_user
1135
+ # Available to use for quota purposes for server-side applications. Can be any
1136
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1137
+ # Overrides userIp if both are provided.
1138
+ # @param [String] user_ip
1139
+ # IP address of the site where the request originates. Use this if you want to
1140
+ # enforce per-user limits.
1141
+ # @param [Google::Apis::RequestOptions] options
1142
+ # Request-specific options
1143
+ #
1144
+ # @yield [result, err] Result & error if block supplied
1145
+ # @yieldparam result [Google::Apis::DriveV2::FileList] parsed result object
1146
+ # @yieldparam err [StandardError] error object if request failed
1147
+ #
1148
+ # @return [Google::Apis::DriveV2::FileList]
1149
+ #
1150
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1151
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1152
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1153
+ def list_files(corpus: nil, max_results: nil, order_by: nil, page_token: nil, projection: nil, q: nil, spaces: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1154
+ command = make_simple_command(:get, 'files', options)
1155
+ command.response_representation = Google::Apis::DriveV2::FileList::Representation
1156
+ command.response_class = Google::Apis::DriveV2::FileList
1157
+ command.query['corpus'] = corpus unless corpus.nil?
1158
+ command.query['maxResults'] = max_results unless max_results.nil?
1159
+ command.query['orderBy'] = order_by unless order_by.nil?
1160
+ command.query['pageToken'] = page_token unless page_token.nil?
1161
+ command.query['projection'] = projection unless projection.nil?
1162
+ command.query['q'] = q unless q.nil?
1163
+ command.query['spaces'] = spaces unless spaces.nil?
1164
+ command.query['fields'] = fields unless fields.nil?
1165
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1166
+ command.query['userIp'] = user_ip unless user_ip.nil?
1167
+ execute_or_queue_command(command, &block)
1168
+ end
1169
+
1170
+ # Updates file metadata and/or content. This method supports patch semantics.
1171
+ # @param [String] file_id
1172
+ # The ID of the file to update.
1173
+ # @param [Google::Apis::DriveV2::File] file_object
1174
+ # @param [String] add_parents
1175
+ # Comma-separated list of parent IDs to add.
1176
+ # @param [Boolean] convert
1177
+ # This parameter is deprecated and has no function.
1178
+ # @param [String] modified_date_behavior
1179
+ # Determines the behavior in which modifiedDate is updated. This overrides
1180
+ # setModifiedDate.
1181
+ # @param [Boolean] new_revision
1182
+ # Whether a blob upload should create a new revision. If false, the blob data in
1183
+ # the current head revision is replaced. If true or not set, a new blob is
1184
+ # created as head revision, and previous unpinned revisions are preserved for a
1185
+ # short period of time. Pinned revisions are stored indefinitely, using
1186
+ # additional storage quota, up to a maximum of 200 revisions. For details on how
1187
+ # revisions are retained, see the Drive Help Center.
1188
+ # @param [Boolean] ocr
1189
+ # Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
1190
+ # @param [String] ocr_language
1191
+ # If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
1192
+ # @param [Boolean] pinned
1193
+ # Whether to pin the new revision. A file can have a maximum of 200 pinned
1194
+ # revisions.
1195
+ # @param [String] remove_parents
1196
+ # Comma-separated list of parent IDs to remove.
1197
+ # @param [Boolean] set_modified_date
1198
+ # Whether to set the modified date with the supplied modified date.
1199
+ # @param [String] timed_text_language
1200
+ # The language of the timed text.
1201
+ # @param [String] timed_text_track_name
1202
+ # The timed text track name.
1203
+ # @param [Boolean] update_viewed_date
1204
+ # Whether to update the view date after successfully updating the file.
1205
+ # @param [Boolean] use_content_as_indexable_text
1206
+ # Whether to use the content as indexable text.
1207
+ # @param [String] fields
1208
+ # Selector specifying which fields to include in a partial response.
1209
+ # @param [String] quota_user
1210
+ # Available to use for quota purposes for server-side applications. Can be any
1211
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1212
+ # Overrides userIp if both are provided.
1213
+ # @param [String] user_ip
1214
+ # IP address of the site where the request originates. Use this if you want to
1215
+ # enforce per-user limits.
1216
+ # @param [Google::Apis::RequestOptions] options
1217
+ # Request-specific options
1218
+ #
1219
+ # @yield [result, err] Result & error if block supplied
1220
+ # @yieldparam result [Google::Apis::DriveV2::File] parsed result object
1221
+ # @yieldparam err [StandardError] error object if request failed
1222
+ #
1223
+ # @return [Google::Apis::DriveV2::File]
1224
+ #
1225
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1226
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1227
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1228
+ def patch_file(file_id, file_object = nil, add_parents: nil, convert: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1229
+ command = make_simple_command(:patch, 'files/{fileId}', options)
1230
+ command.request_representation = Google::Apis::DriveV2::File::Representation
1231
+ command.request_object = file_object
1232
+ command.response_representation = Google::Apis::DriveV2::File::Representation
1233
+ command.response_class = Google::Apis::DriveV2::File
1234
+ command.params['fileId'] = file_id unless file_id.nil?
1235
+ command.query['addParents'] = add_parents unless add_parents.nil?
1236
+ command.query['convert'] = convert unless convert.nil?
1237
+ command.query['modifiedDateBehavior'] = modified_date_behavior unless modified_date_behavior.nil?
1238
+ command.query['newRevision'] = new_revision unless new_revision.nil?
1239
+ command.query['ocr'] = ocr unless ocr.nil?
1240
+ command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
1241
+ command.query['pinned'] = pinned unless pinned.nil?
1242
+ command.query['removeParents'] = remove_parents unless remove_parents.nil?
1243
+ command.query['setModifiedDate'] = set_modified_date unless set_modified_date.nil?
1244
+ command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil?
1245
+ command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil?
1246
+ command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil?
1247
+ command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil?
1248
+ command.query['fields'] = fields unless fields.nil?
1249
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1250
+ command.query['userIp'] = user_ip unless user_ip.nil?
1251
+ execute_or_queue_command(command, &block)
1252
+ end
1253
+
1254
+ # Set the file's updated time to the current server time.
1255
+ # @param [String] file_id
1256
+ # The ID of the file to update.
1257
+ # @param [String] fields
1258
+ # Selector specifying which fields to include in a partial response.
1259
+ # @param [String] quota_user
1260
+ # Available to use for quota purposes for server-side applications. Can be any
1261
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1262
+ # Overrides userIp if both are provided.
1263
+ # @param [String] user_ip
1264
+ # IP address of the site where the request originates. Use this if you want to
1265
+ # enforce per-user limits.
1266
+ # @param [Google::Apis::RequestOptions] options
1267
+ # Request-specific options
1268
+ #
1269
+ # @yield [result, err] Result & error if block supplied
1270
+ # @yieldparam result [Google::Apis::DriveV2::File] parsed result object
1271
+ # @yieldparam err [StandardError] error object if request failed
1272
+ #
1273
+ # @return [Google::Apis::DriveV2::File]
1274
+ #
1275
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1276
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1277
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1278
+ def touch_file(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1279
+ command = make_simple_command(:post, 'files/{fileId}/touch', options)
1280
+ command.response_representation = Google::Apis::DriveV2::File::Representation
1281
+ command.response_class = Google::Apis::DriveV2::File
1282
+ command.params['fileId'] = file_id unless file_id.nil?
1283
+ command.query['fields'] = fields unless fields.nil?
1284
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1285
+ command.query['userIp'] = user_ip unless user_ip.nil?
1286
+ execute_or_queue_command(command, &block)
1287
+ end
1288
+
1289
+ # Moves a file to the trash. The currently authenticated user must own the file.
1290
+ # @param [String] file_id
1291
+ # The ID of the file to trash.
1292
+ # @param [String] fields
1293
+ # Selector specifying which fields to include in a partial response.
1294
+ # @param [String] quota_user
1295
+ # Available to use for quota purposes for server-side applications. Can be any
1296
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1297
+ # Overrides userIp if both are provided.
1298
+ # @param [String] user_ip
1299
+ # IP address of the site where the request originates. Use this if you want to
1300
+ # enforce per-user limits.
1301
+ # @param [Google::Apis::RequestOptions] options
1302
+ # Request-specific options
1303
+ #
1304
+ # @yield [result, err] Result & error if block supplied
1305
+ # @yieldparam result [Google::Apis::DriveV2::File] parsed result object
1306
+ # @yieldparam err [StandardError] error object if request failed
1307
+ #
1308
+ # @return [Google::Apis::DriveV2::File]
1309
+ #
1310
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1311
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1312
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1313
+ def trash_file(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1314
+ command = make_simple_command(:post, 'files/{fileId}/trash', options)
1315
+ command.response_representation = Google::Apis::DriveV2::File::Representation
1316
+ command.response_class = Google::Apis::DriveV2::File
1317
+ command.params['fileId'] = file_id unless file_id.nil?
1318
+ command.query['fields'] = fields unless fields.nil?
1319
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1320
+ command.query['userIp'] = user_ip unless user_ip.nil?
1321
+ execute_or_queue_command(command, &block)
1322
+ end
1323
+
1324
+ # Restores a file from the trash.
1325
+ # @param [String] file_id
1326
+ # The ID of the file to untrash.
1327
+ # @param [String] fields
1328
+ # Selector specifying which fields to include in a partial response.
1329
+ # @param [String] quota_user
1330
+ # Available to use for quota purposes for server-side applications. Can be any
1331
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1332
+ # Overrides userIp if both are provided.
1333
+ # @param [String] user_ip
1334
+ # IP address of the site where the request originates. Use this if you want to
1335
+ # enforce per-user limits.
1336
+ # @param [Google::Apis::RequestOptions] options
1337
+ # Request-specific options
1338
+ #
1339
+ # @yield [result, err] Result & error if block supplied
1340
+ # @yieldparam result [Google::Apis::DriveV2::File] parsed result object
1341
+ # @yieldparam err [StandardError] error object if request failed
1342
+ #
1343
+ # @return [Google::Apis::DriveV2::File]
1344
+ #
1345
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1346
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1347
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1348
+ def untrash_file(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1349
+ command = make_simple_command(:post, 'files/{fileId}/untrash', options)
1350
+ command.response_representation = Google::Apis::DriveV2::File::Representation
1351
+ command.response_class = Google::Apis::DriveV2::File
1352
+ command.params['fileId'] = file_id unless file_id.nil?
1353
+ command.query['fields'] = fields unless fields.nil?
1354
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1355
+ command.query['userIp'] = user_ip unless user_ip.nil?
1356
+ execute_or_queue_command(command, &block)
1357
+ end
1358
+
1359
+ # Updates file metadata and/or content.
1360
+ # @param [String] file_id
1361
+ # The ID of the file to update.
1362
+ # @param [Google::Apis::DriveV2::File] file_object
1363
+ # @param [String] add_parents
1364
+ # Comma-separated list of parent IDs to add.
1365
+ # @param [Boolean] convert
1366
+ # This parameter is deprecated and has no function.
1367
+ # @param [String] modified_date_behavior
1368
+ # Determines the behavior in which modifiedDate is updated. This overrides
1369
+ # setModifiedDate.
1370
+ # @param [Boolean] new_revision
1371
+ # Whether a blob upload should create a new revision. If false, the blob data in
1372
+ # the current head revision is replaced. If true or not set, a new blob is
1373
+ # created as head revision, and previous unpinned revisions are preserved for a
1374
+ # short period of time. Pinned revisions are stored indefinitely, using
1375
+ # additional storage quota, up to a maximum of 200 revisions. For details on how
1376
+ # revisions are retained, see the Drive Help Center.
1377
+ # @param [Boolean] ocr
1378
+ # Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
1379
+ # @param [String] ocr_language
1380
+ # If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
1381
+ # @param [Boolean] pinned
1382
+ # Whether to pin the new revision. A file can have a maximum of 200 pinned
1383
+ # revisions.
1384
+ # @param [String] remove_parents
1385
+ # Comma-separated list of parent IDs to remove.
1386
+ # @param [Boolean] set_modified_date
1387
+ # Whether to set the modified date with the supplied modified date.
1388
+ # @param [String] timed_text_language
1389
+ # The language of the timed text.
1390
+ # @param [String] timed_text_track_name
1391
+ # The timed text track name.
1392
+ # @param [Boolean] update_viewed_date
1393
+ # Whether to update the view date after successfully updating the file.
1394
+ # @param [Boolean] use_content_as_indexable_text
1395
+ # Whether to use the content as indexable text.
1396
+ # @param [String] fields
1397
+ # Selector specifying which fields to include in a partial response.
1398
+ # @param [String] quota_user
1399
+ # Available to use for quota purposes for server-side applications. Can be any
1400
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1401
+ # Overrides userIp if both are provided.
1402
+ # @param [String] user_ip
1403
+ # IP address of the site where the request originates. Use this if you want to
1404
+ # enforce per-user limits.
1405
+ # @param [IO, String] upload_source
1406
+ # IO stream or filename containing content to upload
1407
+ # @param [String] content_type
1408
+ # Content type of the uploaded content.
1409
+ # @param [Google::Apis::RequestOptions] options
1410
+ # Request-specific options
1411
+ #
1412
+ # @yield [result, err] Result & error if block supplied
1413
+ # @yieldparam result [Google::Apis::DriveV2::File] parsed result object
1414
+ # @yieldparam err [StandardError] error object if request failed
1415
+ #
1416
+ # @return [Google::Apis::DriveV2::File]
1417
+ #
1418
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1419
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1420
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1421
+ def update_file(file_id, file_object = nil, add_parents: nil, convert: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
1422
+ if upload_source.nil?
1423
+ command = make_simple_command(:put, 'files/{fileId}', options)
1424
+ else
1425
+ command = make_upload_command(:put, 'files/{fileId}', options)
1426
+ command.upload_source = upload_source
1427
+ command.upload_content_type = content_type
1428
+ end
1429
+ command.request_representation = Google::Apis::DriveV2::File::Representation
1430
+ command.request_object = file_object
1431
+ command.response_representation = Google::Apis::DriveV2::File::Representation
1432
+ command.response_class = Google::Apis::DriveV2::File
1433
+ command.params['fileId'] = file_id unless file_id.nil?
1434
+ command.query['addParents'] = add_parents unless add_parents.nil?
1435
+ command.query['convert'] = convert unless convert.nil?
1436
+ command.query['modifiedDateBehavior'] = modified_date_behavior unless modified_date_behavior.nil?
1437
+ command.query['newRevision'] = new_revision unless new_revision.nil?
1438
+ command.query['ocr'] = ocr unless ocr.nil?
1439
+ command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
1440
+ command.query['pinned'] = pinned unless pinned.nil?
1441
+ command.query['removeParents'] = remove_parents unless remove_parents.nil?
1442
+ command.query['setModifiedDate'] = set_modified_date unless set_modified_date.nil?
1443
+ command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil?
1444
+ command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil?
1445
+ command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil?
1446
+ command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil?
1447
+ command.query['fields'] = fields unless fields.nil?
1448
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1449
+ command.query['userIp'] = user_ip unless user_ip.nil?
1450
+ execute_or_queue_command(command, &block)
1451
+ end
1452
+
1453
+ # Subscribe to changes on a file
1454
+ # @param [String] file_id
1455
+ # The ID for the file in question.
1456
+ # @param [Google::Apis::DriveV2::Channel] channel_object
1457
+ # @param [Boolean] acknowledge_abuse
1458
+ # Whether the user is acknowledging the risk of downloading known malware or
1459
+ # other abusive files.
1460
+ # @param [String] projection
1461
+ # This parameter is deprecated and has no function.
1462
+ # @param [String] revision_id
1463
+ # Specifies the Revision ID that should be downloaded. Ignored unless alt=media
1464
+ # is specified.
1465
+ # @param [Boolean] update_viewed_date
1466
+ # Deprecated: Use files.update with modifiedDateBehavior=noChange,
1467
+ # updateViewedDate=true and an empty request body.
1468
+ # @param [String] fields
1469
+ # Selector specifying which fields to include in a partial response.
1470
+ # @param [String] quota_user
1471
+ # Available to use for quota purposes for server-side applications. Can be any
1472
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1473
+ # Overrides userIp if both are provided.
1474
+ # @param [String] user_ip
1475
+ # IP address of the site where the request originates. Use this if you want to
1476
+ # enforce per-user limits.
1477
+ # @param [IO, String] download_dest
1478
+ # IO stream or filename to receive content download
1479
+ # @param [Google::Apis::RequestOptions] options
1480
+ # Request-specific options
1481
+ #
1482
+ # @yield [result, err] Result & error if block supplied
1483
+ # @yieldparam result [Google::Apis::DriveV2::Channel] parsed result object
1484
+ # @yieldparam err [StandardError] error object if request failed
1485
+ #
1486
+ # @return [Google::Apis::DriveV2::Channel]
1487
+ #
1488
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1489
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1490
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1491
+ def watch_file(file_id, channel_object = nil, acknowledge_abuse: nil, projection: nil, revision_id: nil, update_viewed_date: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
1492
+ if download_dest.nil?
1493
+ command = make_simple_command(:post, 'files/{fileId}/watch', options)
1494
+ else
1495
+ command = make_download_command(:post, 'files/{fileId}/watch', options)
1496
+ command.download_dest = download_dest
1497
+ end
1498
+ command.request_representation = Google::Apis::DriveV2::Channel::Representation
1499
+ command.request_object = channel_object
1500
+ command.response_representation = Google::Apis::DriveV2::Channel::Representation
1501
+ command.response_class = Google::Apis::DriveV2::Channel
1502
+ command.params['fileId'] = file_id unless file_id.nil?
1503
+ command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.nil?
1504
+ command.query['projection'] = projection unless projection.nil?
1505
+ command.query['revisionId'] = revision_id unless revision_id.nil?
1506
+ command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil?
1507
+ command.query['fields'] = fields unless fields.nil?
1508
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1509
+ command.query['userIp'] = user_ip unless user_ip.nil?
1510
+ execute_or_queue_command(command, &block)
1511
+ end
1512
+
1513
+ # Removes a parent from a file.
1514
+ # @param [String] file_id
1515
+ # The ID of the file.
1516
+ # @param [String] parent_id
1517
+ # The ID of the parent.
1518
+ # @param [String] fields
1519
+ # Selector specifying which fields to include in a partial response.
1520
+ # @param [String] quota_user
1521
+ # Available to use for quota purposes for server-side applications. Can be any
1522
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1523
+ # Overrides userIp if both are provided.
1524
+ # @param [String] user_ip
1525
+ # IP address of the site where the request originates. Use this if you want to
1526
+ # enforce per-user limits.
1527
+ # @param [Google::Apis::RequestOptions] options
1528
+ # Request-specific options
1529
+ #
1530
+ # @yield [result, err] Result & error if block supplied
1531
+ # @yieldparam result [NilClass] No result returned for this method
1532
+ # @yieldparam err [StandardError] error object if request failed
1533
+ #
1534
+ # @return [void]
1535
+ #
1536
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1537
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1538
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1539
+ def delete_parent(file_id, parent_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1540
+ command = make_simple_command(:delete, 'files/{fileId}/parents/{parentId}', options)
1541
+ command.params['fileId'] = file_id unless file_id.nil?
1542
+ command.params['parentId'] = parent_id unless parent_id.nil?
1543
+ command.query['fields'] = fields unless fields.nil?
1544
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1545
+ command.query['userIp'] = user_ip unless user_ip.nil?
1546
+ execute_or_queue_command(command, &block)
1547
+ end
1548
+
1549
+ # Gets a specific parent reference.
1550
+ # @param [String] file_id
1551
+ # The ID of the file.
1552
+ # @param [String] parent_id
1553
+ # The ID of the parent.
1554
+ # @param [String] fields
1555
+ # Selector specifying which fields to include in a partial response.
1556
+ # @param [String] quota_user
1557
+ # Available to use for quota purposes for server-side applications. Can be any
1558
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1559
+ # Overrides userIp if both are provided.
1560
+ # @param [String] user_ip
1561
+ # IP address of the site where the request originates. Use this if you want to
1562
+ # enforce per-user limits.
1563
+ # @param [Google::Apis::RequestOptions] options
1564
+ # Request-specific options
1565
+ #
1566
+ # @yield [result, err] Result & error if block supplied
1567
+ # @yieldparam result [Google::Apis::DriveV2::ParentReference] parsed result object
1568
+ # @yieldparam err [StandardError] error object if request failed
1569
+ #
1570
+ # @return [Google::Apis::DriveV2::ParentReference]
1571
+ #
1572
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1573
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1574
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1575
+ def get_parent(file_id, parent_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1576
+ command = make_simple_command(:get, 'files/{fileId}/parents/{parentId}', options)
1577
+ command.response_representation = Google::Apis::DriveV2::ParentReference::Representation
1578
+ command.response_class = Google::Apis::DriveV2::ParentReference
1579
+ command.params['fileId'] = file_id unless file_id.nil?
1580
+ command.params['parentId'] = parent_id unless parent_id.nil?
1581
+ command.query['fields'] = fields unless fields.nil?
1582
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1583
+ command.query['userIp'] = user_ip unless user_ip.nil?
1584
+ execute_or_queue_command(command, &block)
1585
+ end
1586
+
1587
+ # Adds a parent folder for a file.
1588
+ # @param [String] file_id
1589
+ # The ID of the file.
1590
+ # @param [Google::Apis::DriveV2::ParentReference] parent_reference_object
1591
+ # @param [String] fields
1592
+ # Selector specifying which fields to include in a partial response.
1593
+ # @param [String] quota_user
1594
+ # Available to use for quota purposes for server-side applications. Can be any
1595
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1596
+ # Overrides userIp if both are provided.
1597
+ # @param [String] user_ip
1598
+ # IP address of the site where the request originates. Use this if you want to
1599
+ # enforce per-user limits.
1600
+ # @param [Google::Apis::RequestOptions] options
1601
+ # Request-specific options
1602
+ #
1603
+ # @yield [result, err] Result & error if block supplied
1604
+ # @yieldparam result [Google::Apis::DriveV2::ParentReference] parsed result object
1605
+ # @yieldparam err [StandardError] error object if request failed
1606
+ #
1607
+ # @return [Google::Apis::DriveV2::ParentReference]
1608
+ #
1609
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1610
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1611
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1612
+ def insert_parent(file_id, parent_reference_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1613
+ command = make_simple_command(:post, 'files/{fileId}/parents', options)
1614
+ command.request_representation = Google::Apis::DriveV2::ParentReference::Representation
1615
+ command.request_object = parent_reference_object
1616
+ command.response_representation = Google::Apis::DriveV2::ParentReference::Representation
1617
+ command.response_class = Google::Apis::DriveV2::ParentReference
1618
+ command.params['fileId'] = file_id unless file_id.nil?
1619
+ command.query['fields'] = fields unless fields.nil?
1620
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1621
+ command.query['userIp'] = user_ip unless user_ip.nil?
1622
+ execute_or_queue_command(command, &block)
1623
+ end
1624
+
1625
+ # Lists a file's parents.
1626
+ # @param [String] file_id
1627
+ # The ID of the file.
1628
+ # @param [String] fields
1629
+ # Selector specifying which fields to include in a partial response.
1630
+ # @param [String] quota_user
1631
+ # Available to use for quota purposes for server-side applications. Can be any
1632
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1633
+ # Overrides userIp if both are provided.
1634
+ # @param [String] user_ip
1635
+ # IP address of the site where the request originates. Use this if you want to
1636
+ # enforce per-user limits.
1637
+ # @param [Google::Apis::RequestOptions] options
1638
+ # Request-specific options
1639
+ #
1640
+ # @yield [result, err] Result & error if block supplied
1641
+ # @yieldparam result [Google::Apis::DriveV2::ParentList] parsed result object
1642
+ # @yieldparam err [StandardError] error object if request failed
1643
+ #
1644
+ # @return [Google::Apis::DriveV2::ParentList]
1645
+ #
1646
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1647
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1648
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1649
+ def list_parents(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1650
+ command = make_simple_command(:get, 'files/{fileId}/parents', options)
1651
+ command.response_representation = Google::Apis::DriveV2::ParentList::Representation
1652
+ command.response_class = Google::Apis::DriveV2::ParentList
1653
+ command.params['fileId'] = file_id unless file_id.nil?
1654
+ command.query['fields'] = fields unless fields.nil?
1655
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1656
+ command.query['userIp'] = user_ip unless user_ip.nil?
1657
+ execute_or_queue_command(command, &block)
1658
+ end
1659
+
1660
+ # Deletes a permission from a file.
1661
+ # @param [String] file_id
1662
+ # The ID for the file.
1663
+ # @param [String] permission_id
1664
+ # The ID for the permission.
1665
+ # @param [String] fields
1666
+ # Selector specifying which fields to include in a partial response.
1667
+ # @param [String] quota_user
1668
+ # Available to use for quota purposes for server-side applications. Can be any
1669
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1670
+ # Overrides userIp if both are provided.
1671
+ # @param [String] user_ip
1672
+ # IP address of the site where the request originates. Use this if you want to
1673
+ # enforce per-user limits.
1674
+ # @param [Google::Apis::RequestOptions] options
1675
+ # Request-specific options
1676
+ #
1677
+ # @yield [result, err] Result & error if block supplied
1678
+ # @yieldparam result [NilClass] No result returned for this method
1679
+ # @yieldparam err [StandardError] error object if request failed
1680
+ #
1681
+ # @return [void]
1682
+ #
1683
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1684
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1685
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1686
+ def delete_permission(file_id, permission_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1687
+ command = make_simple_command(:delete, 'files/{fileId}/permissions/{permissionId}', options)
1688
+ command.params['fileId'] = file_id unless file_id.nil?
1689
+ command.params['permissionId'] = permission_id unless permission_id.nil?
1690
+ command.query['fields'] = fields unless fields.nil?
1691
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1692
+ command.query['userIp'] = user_ip unless user_ip.nil?
1693
+ execute_or_queue_command(command, &block)
1694
+ end
1695
+
1696
+ # Gets a permission by ID.
1697
+ # @param [String] file_id
1698
+ # The ID for the file.
1699
+ # @param [String] permission_id
1700
+ # The ID for the permission.
1701
+ # @param [String] fields
1702
+ # Selector specifying which fields to include in a partial response.
1703
+ # @param [String] quota_user
1704
+ # Available to use for quota purposes for server-side applications. Can be any
1705
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1706
+ # Overrides userIp if both are provided.
1707
+ # @param [String] user_ip
1708
+ # IP address of the site where the request originates. Use this if you want to
1709
+ # enforce per-user limits.
1710
+ # @param [Google::Apis::RequestOptions] options
1711
+ # Request-specific options
1712
+ #
1713
+ # @yield [result, err] Result & error if block supplied
1714
+ # @yieldparam result [Google::Apis::DriveV2::Permission] parsed result object
1715
+ # @yieldparam err [StandardError] error object if request failed
1716
+ #
1717
+ # @return [Google::Apis::DriveV2::Permission]
1718
+ #
1719
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1720
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1721
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1722
+ def get_permission(file_id, permission_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1723
+ command = make_simple_command(:get, 'files/{fileId}/permissions/{permissionId}', options)
1724
+ command.response_representation = Google::Apis::DriveV2::Permission::Representation
1725
+ command.response_class = Google::Apis::DriveV2::Permission
1726
+ command.params['fileId'] = file_id unless file_id.nil?
1727
+ command.params['permissionId'] = permission_id unless permission_id.nil?
1728
+ command.query['fields'] = fields unless fields.nil?
1729
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1730
+ command.query['userIp'] = user_ip unless user_ip.nil?
1731
+ execute_or_queue_command(command, &block)
1732
+ end
1733
+
1734
+ # Returns the permission ID for an email address.
1735
+ # @param [String] email
1736
+ # The email address for which to return a permission ID
1737
+ # @param [String] fields
1738
+ # Selector specifying which fields to include in a partial response.
1739
+ # @param [String] quota_user
1740
+ # Available to use for quota purposes for server-side applications. Can be any
1741
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1742
+ # Overrides userIp if both are provided.
1743
+ # @param [String] user_ip
1744
+ # IP address of the site where the request originates. Use this if you want to
1745
+ # enforce per-user limits.
1746
+ # @param [Google::Apis::RequestOptions] options
1747
+ # Request-specific options
1748
+ #
1749
+ # @yield [result, err] Result & error if block supplied
1750
+ # @yieldparam result [Google::Apis::DriveV2::PermissionId] parsed result object
1751
+ # @yieldparam err [StandardError] error object if request failed
1752
+ #
1753
+ # @return [Google::Apis::DriveV2::PermissionId]
1754
+ #
1755
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1756
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1757
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1758
+ def get_permission_id_for_email(email, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1759
+ command = make_simple_command(:get, 'permissionIds/{email}', options)
1760
+ command.response_representation = Google::Apis::DriveV2::PermissionId::Representation
1761
+ command.response_class = Google::Apis::DriveV2::PermissionId
1762
+ command.params['email'] = email unless email.nil?
1763
+ command.query['fields'] = fields unless fields.nil?
1764
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1765
+ command.query['userIp'] = user_ip unless user_ip.nil?
1766
+ execute_or_queue_command(command, &block)
1767
+ end
1768
+
1769
+ # Inserts a permission for a file.
1770
+ # @param [String] file_id
1771
+ # The ID for the file.
1772
+ # @param [Google::Apis::DriveV2::Permission] permission_object
1773
+ # @param [String] email_message
1774
+ # A custom message to include in notification emails.
1775
+ # @param [Boolean] send_notification_emails
1776
+ # Whether to send notification emails when sharing to users or groups. This
1777
+ # parameter is ignored and an email is sent if the role is owner.
1778
+ # @param [String] fields
1779
+ # Selector specifying which fields to include in a partial response.
1780
+ # @param [String] quota_user
1781
+ # Available to use for quota purposes for server-side applications. Can be any
1782
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1783
+ # Overrides userIp if both are provided.
1784
+ # @param [String] user_ip
1785
+ # IP address of the site where the request originates. Use this if you want to
1786
+ # enforce per-user limits.
1787
+ # @param [Google::Apis::RequestOptions] options
1788
+ # Request-specific options
1789
+ #
1790
+ # @yield [result, err] Result & error if block supplied
1791
+ # @yieldparam result [Google::Apis::DriveV2::Permission] parsed result object
1792
+ # @yieldparam err [StandardError] error object if request failed
1793
+ #
1794
+ # @return [Google::Apis::DriveV2::Permission]
1795
+ #
1796
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1797
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1798
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1799
+ def insert_permission(file_id, permission_object = nil, email_message: nil, send_notification_emails: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1800
+ command = make_simple_command(:post, 'files/{fileId}/permissions', options)
1801
+ command.request_representation = Google::Apis::DriveV2::Permission::Representation
1802
+ command.request_object = permission_object
1803
+ command.response_representation = Google::Apis::DriveV2::Permission::Representation
1804
+ command.response_class = Google::Apis::DriveV2::Permission
1805
+ command.params['fileId'] = file_id unless file_id.nil?
1806
+ command.query['emailMessage'] = email_message unless email_message.nil?
1807
+ command.query['sendNotificationEmails'] = send_notification_emails unless send_notification_emails.nil?
1808
+ command.query['fields'] = fields unless fields.nil?
1809
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1810
+ command.query['userIp'] = user_ip unless user_ip.nil?
1811
+ execute_or_queue_command(command, &block)
1812
+ end
1813
+
1814
+ # Lists a file's permissions.
1815
+ # @param [String] file_id
1816
+ # The ID for the file.
1817
+ # @param [String] fields
1818
+ # Selector specifying which fields to include in a partial response.
1819
+ # @param [String] quota_user
1820
+ # Available to use for quota purposes for server-side applications. Can be any
1821
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1822
+ # Overrides userIp if both are provided.
1823
+ # @param [String] user_ip
1824
+ # IP address of the site where the request originates. Use this if you want to
1825
+ # enforce per-user limits.
1826
+ # @param [Google::Apis::RequestOptions] options
1827
+ # Request-specific options
1828
+ #
1829
+ # @yield [result, err] Result & error if block supplied
1830
+ # @yieldparam result [Google::Apis::DriveV2::PermissionList] parsed result object
1831
+ # @yieldparam err [StandardError] error object if request failed
1832
+ #
1833
+ # @return [Google::Apis::DriveV2::PermissionList]
1834
+ #
1835
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1836
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1837
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1838
+ def list_permissions(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1839
+ command = make_simple_command(:get, 'files/{fileId}/permissions', options)
1840
+ command.response_representation = Google::Apis::DriveV2::PermissionList::Representation
1841
+ command.response_class = Google::Apis::DriveV2::PermissionList
1842
+ command.params['fileId'] = file_id unless file_id.nil?
1843
+ command.query['fields'] = fields unless fields.nil?
1844
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1845
+ command.query['userIp'] = user_ip unless user_ip.nil?
1846
+ execute_or_queue_command(command, &block)
1847
+ end
1848
+
1849
+ # Updates a permission using patch semantics.
1850
+ # @param [String] file_id
1851
+ # The ID for the file.
1852
+ # @param [String] permission_id
1853
+ # The ID for the permission.
1854
+ # @param [Google::Apis::DriveV2::Permission] permission_object
1855
+ # @param [Boolean] transfer_ownership
1856
+ # Whether changing a role to 'owner' downgrades the current owners to writers.
1857
+ # Does nothing if the specified role is not 'owner'.
1858
+ # @param [String] fields
1859
+ # Selector specifying which fields to include in a partial response.
1860
+ # @param [String] quota_user
1861
+ # Available to use for quota purposes for server-side applications. Can be any
1862
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1863
+ # Overrides userIp if both are provided.
1864
+ # @param [String] user_ip
1865
+ # IP address of the site where the request originates. Use this if you want to
1866
+ # enforce per-user limits.
1867
+ # @param [Google::Apis::RequestOptions] options
1868
+ # Request-specific options
1869
+ #
1870
+ # @yield [result, err] Result & error if block supplied
1871
+ # @yieldparam result [Google::Apis::DriveV2::Permission] parsed result object
1872
+ # @yieldparam err [StandardError] error object if request failed
1873
+ #
1874
+ # @return [Google::Apis::DriveV2::Permission]
1875
+ #
1876
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1877
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1878
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1879
+ def patch_permission(file_id, permission_id, permission_object = nil, transfer_ownership: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1880
+ command = make_simple_command(:patch, 'files/{fileId}/permissions/{permissionId}', options)
1881
+ command.request_representation = Google::Apis::DriveV2::Permission::Representation
1882
+ command.request_object = permission_object
1883
+ command.response_representation = Google::Apis::DriveV2::Permission::Representation
1884
+ command.response_class = Google::Apis::DriveV2::Permission
1885
+ command.params['fileId'] = file_id unless file_id.nil?
1886
+ command.params['permissionId'] = permission_id unless permission_id.nil?
1887
+ command.query['transferOwnership'] = transfer_ownership unless transfer_ownership.nil?
1888
+ command.query['fields'] = fields unless fields.nil?
1889
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1890
+ command.query['userIp'] = user_ip unless user_ip.nil?
1891
+ execute_or_queue_command(command, &block)
1892
+ end
1893
+
1894
+ # Updates a permission.
1895
+ # @param [String] file_id
1896
+ # The ID for the file.
1897
+ # @param [String] permission_id
1898
+ # The ID for the permission.
1899
+ # @param [Google::Apis::DriveV2::Permission] permission_object
1900
+ # @param [Boolean] transfer_ownership
1901
+ # Whether changing a role to 'owner' downgrades the current owners to writers.
1902
+ # Does nothing if the specified role is not 'owner'.
1903
+ # @param [String] fields
1904
+ # Selector specifying which fields to include in a partial response.
1905
+ # @param [String] quota_user
1906
+ # Available to use for quota purposes for server-side applications. Can be any
1907
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1908
+ # Overrides userIp if both are provided.
1909
+ # @param [String] user_ip
1910
+ # IP address of the site where the request originates. Use this if you want to
1911
+ # enforce per-user limits.
1912
+ # @param [Google::Apis::RequestOptions] options
1913
+ # Request-specific options
1914
+ #
1915
+ # @yield [result, err] Result & error if block supplied
1916
+ # @yieldparam result [Google::Apis::DriveV2::Permission] parsed result object
1917
+ # @yieldparam err [StandardError] error object if request failed
1918
+ #
1919
+ # @return [Google::Apis::DriveV2::Permission]
1920
+ #
1921
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1922
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1923
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1924
+ def update_permission(file_id, permission_id, permission_object = nil, transfer_ownership: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1925
+ command = make_simple_command(:put, 'files/{fileId}/permissions/{permissionId}', options)
1926
+ command.request_representation = Google::Apis::DriveV2::Permission::Representation
1927
+ command.request_object = permission_object
1928
+ command.response_representation = Google::Apis::DriveV2::Permission::Representation
1929
+ command.response_class = Google::Apis::DriveV2::Permission
1930
+ command.params['fileId'] = file_id unless file_id.nil?
1931
+ command.params['permissionId'] = permission_id unless permission_id.nil?
1932
+ command.query['transferOwnership'] = transfer_ownership unless transfer_ownership.nil?
1933
+ command.query['fields'] = fields unless fields.nil?
1934
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1935
+ command.query['userIp'] = user_ip unless user_ip.nil?
1936
+ execute_or_queue_command(command, &block)
1937
+ end
1938
+
1939
+ # Deletes a property.
1940
+ # @param [String] file_id
1941
+ # The ID of the file.
1942
+ # @param [String] property_key
1943
+ # The key of the property.
1944
+ # @param [String] visibility
1945
+ # The visibility of the property.
1946
+ # @param [String] fields
1947
+ # Selector specifying which fields to include in a partial response.
1948
+ # @param [String] quota_user
1949
+ # Available to use for quota purposes for server-side applications. Can be any
1950
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1951
+ # Overrides userIp if both are provided.
1952
+ # @param [String] user_ip
1953
+ # IP address of the site where the request originates. Use this if you want to
1954
+ # enforce per-user limits.
1955
+ # @param [Google::Apis::RequestOptions] options
1956
+ # Request-specific options
1957
+ #
1958
+ # @yield [result, err] Result & error if block supplied
1959
+ # @yieldparam result [NilClass] No result returned for this method
1960
+ # @yieldparam err [StandardError] error object if request failed
1961
+ #
1962
+ # @return [void]
1963
+ #
1964
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1965
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1966
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1967
+ def delete_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1968
+ command = make_simple_command(:delete, 'files/{fileId}/properties/{propertyKey}', options)
1969
+ command.params['fileId'] = file_id unless file_id.nil?
1970
+ command.params['propertyKey'] = property_key unless property_key.nil?
1971
+ command.query['visibility'] = visibility unless visibility.nil?
1972
+ command.query['fields'] = fields unless fields.nil?
1973
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1974
+ command.query['userIp'] = user_ip unless user_ip.nil?
1975
+ execute_or_queue_command(command, &block)
1976
+ end
1977
+
1978
+ # Gets a property by its key.
1979
+ # @param [String] file_id
1980
+ # The ID of the file.
1981
+ # @param [String] property_key
1982
+ # The key of the property.
1983
+ # @param [String] visibility
1984
+ # The visibility of the property.
1985
+ # @param [String] fields
1986
+ # Selector specifying which fields to include in a partial response.
1987
+ # @param [String] quota_user
1988
+ # Available to use for quota purposes for server-side applications. Can be any
1989
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1990
+ # Overrides userIp if both are provided.
1991
+ # @param [String] user_ip
1992
+ # IP address of the site where the request originates. Use this if you want to
1993
+ # enforce per-user limits.
1994
+ # @param [Google::Apis::RequestOptions] options
1995
+ # Request-specific options
1996
+ #
1997
+ # @yield [result, err] Result & error if block supplied
1998
+ # @yieldparam result [Google::Apis::DriveV2::Property] parsed result object
1999
+ # @yieldparam err [StandardError] error object if request failed
2000
+ #
2001
+ # @return [Google::Apis::DriveV2::Property]
2002
+ #
2003
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2004
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2005
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2006
+ def get_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2007
+ command = make_simple_command(:get, 'files/{fileId}/properties/{propertyKey}', options)
2008
+ command.response_representation = Google::Apis::DriveV2::Property::Representation
2009
+ command.response_class = Google::Apis::DriveV2::Property
2010
+ command.params['fileId'] = file_id unless file_id.nil?
2011
+ command.params['propertyKey'] = property_key unless property_key.nil?
2012
+ command.query['visibility'] = visibility unless visibility.nil?
2013
+ command.query['fields'] = fields unless fields.nil?
2014
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2015
+ command.query['userIp'] = user_ip unless user_ip.nil?
2016
+ execute_or_queue_command(command, &block)
2017
+ end
2018
+
2019
+ # Adds a property to a file, or updates it if it already exists.
2020
+ # @param [String] file_id
2021
+ # The ID of the file.
2022
+ # @param [Google::Apis::DriveV2::Property] property_object
2023
+ # @param [String] fields
2024
+ # Selector specifying which fields to include in a partial response.
2025
+ # @param [String] quota_user
2026
+ # Available to use for quota purposes for server-side applications. Can be any
2027
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2028
+ # Overrides userIp if both are provided.
2029
+ # @param [String] user_ip
2030
+ # IP address of the site where the request originates. Use this if you want to
2031
+ # enforce per-user limits.
2032
+ # @param [Google::Apis::RequestOptions] options
2033
+ # Request-specific options
2034
+ #
2035
+ # @yield [result, err] Result & error if block supplied
2036
+ # @yieldparam result [Google::Apis::DriveV2::Property] parsed result object
2037
+ # @yieldparam err [StandardError] error object if request failed
2038
+ #
2039
+ # @return [Google::Apis::DriveV2::Property]
2040
+ #
2041
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2042
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2043
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2044
+ def insert_property(file_id, property_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2045
+ command = make_simple_command(:post, 'files/{fileId}/properties', options)
2046
+ command.request_representation = Google::Apis::DriveV2::Property::Representation
2047
+ command.request_object = property_object
2048
+ command.response_representation = Google::Apis::DriveV2::Property::Representation
2049
+ command.response_class = Google::Apis::DriveV2::Property
2050
+ command.params['fileId'] = file_id unless file_id.nil?
2051
+ command.query['fields'] = fields unless fields.nil?
2052
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2053
+ command.query['userIp'] = user_ip unless user_ip.nil?
2054
+ execute_or_queue_command(command, &block)
2055
+ end
2056
+
2057
+ # Lists a file's properties.
2058
+ # @param [String] file_id
2059
+ # The ID of the file.
2060
+ # @param [String] fields
2061
+ # Selector specifying which fields to include in a partial response.
2062
+ # @param [String] quota_user
2063
+ # Available to use for quota purposes for server-side applications. Can be any
2064
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2065
+ # Overrides userIp if both are provided.
2066
+ # @param [String] user_ip
2067
+ # IP address of the site where the request originates. Use this if you want to
2068
+ # enforce per-user limits.
2069
+ # @param [Google::Apis::RequestOptions] options
2070
+ # Request-specific options
2071
+ #
2072
+ # @yield [result, err] Result & error if block supplied
2073
+ # @yieldparam result [Google::Apis::DriveV2::PropertyList] parsed result object
2074
+ # @yieldparam err [StandardError] error object if request failed
2075
+ #
2076
+ # @return [Google::Apis::DriveV2::PropertyList]
2077
+ #
2078
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2079
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2080
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2081
+ def list_properties(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2082
+ command = make_simple_command(:get, 'files/{fileId}/properties', options)
2083
+ command.response_representation = Google::Apis::DriveV2::PropertyList::Representation
2084
+ command.response_class = Google::Apis::DriveV2::PropertyList
2085
+ command.params['fileId'] = file_id unless file_id.nil?
2086
+ command.query['fields'] = fields unless fields.nil?
2087
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2088
+ command.query['userIp'] = user_ip unless user_ip.nil?
2089
+ execute_or_queue_command(command, &block)
2090
+ end
2091
+
2092
+ # Updates a property, or adds it if it doesn't exist. This method supports patch
2093
+ # semantics.
2094
+ # @param [String] file_id
2095
+ # The ID of the file.
2096
+ # @param [String] property_key
2097
+ # The key of the property.
2098
+ # @param [Google::Apis::DriveV2::Property] property_object
2099
+ # @param [String] visibility
2100
+ # The visibility of the property.
2101
+ # @param [String] fields
2102
+ # Selector specifying which fields to include in a partial response.
2103
+ # @param [String] quota_user
2104
+ # Available to use for quota purposes for server-side applications. Can be any
2105
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2106
+ # Overrides userIp if both are provided.
2107
+ # @param [String] user_ip
2108
+ # IP address of the site where the request originates. Use this if you want to
2109
+ # enforce per-user limits.
2110
+ # @param [Google::Apis::RequestOptions] options
2111
+ # Request-specific options
2112
+ #
2113
+ # @yield [result, err] Result & error if block supplied
2114
+ # @yieldparam result [Google::Apis::DriveV2::Property] parsed result object
2115
+ # @yieldparam err [StandardError] error object if request failed
2116
+ #
2117
+ # @return [Google::Apis::DriveV2::Property]
2118
+ #
2119
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2120
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2121
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2122
+ def patch_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2123
+ command = make_simple_command(:patch, 'files/{fileId}/properties/{propertyKey}', options)
2124
+ command.request_representation = Google::Apis::DriveV2::Property::Representation
2125
+ command.request_object = property_object
2126
+ command.response_representation = Google::Apis::DriveV2::Property::Representation
2127
+ command.response_class = Google::Apis::DriveV2::Property
2128
+ command.params['fileId'] = file_id unless file_id.nil?
2129
+ command.params['propertyKey'] = property_key unless property_key.nil?
2130
+ command.query['visibility'] = visibility unless visibility.nil?
2131
+ command.query['fields'] = fields unless fields.nil?
2132
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2133
+ command.query['userIp'] = user_ip unless user_ip.nil?
2134
+ execute_or_queue_command(command, &block)
2135
+ end
2136
+
2137
+ # Updates a property, or adds it if it doesn't exist.
2138
+ # @param [String] file_id
2139
+ # The ID of the file.
2140
+ # @param [String] property_key
2141
+ # The key of the property.
2142
+ # @param [Google::Apis::DriveV2::Property] property_object
2143
+ # @param [String] visibility
2144
+ # The visibility of the property.
2145
+ # @param [String] fields
2146
+ # Selector specifying which fields to include in a partial response.
2147
+ # @param [String] quota_user
2148
+ # Available to use for quota purposes for server-side applications. Can be any
2149
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2150
+ # Overrides userIp if both are provided.
2151
+ # @param [String] user_ip
2152
+ # IP address of the site where the request originates. Use this if you want to
2153
+ # enforce per-user limits.
2154
+ # @param [Google::Apis::RequestOptions] options
2155
+ # Request-specific options
2156
+ #
2157
+ # @yield [result, err] Result & error if block supplied
2158
+ # @yieldparam result [Google::Apis::DriveV2::Property] parsed result object
2159
+ # @yieldparam err [StandardError] error object if request failed
2160
+ #
2161
+ # @return [Google::Apis::DriveV2::Property]
2162
+ #
2163
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2164
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2165
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2166
+ def update_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2167
+ command = make_simple_command(:put, 'files/{fileId}/properties/{propertyKey}', options)
2168
+ command.request_representation = Google::Apis::DriveV2::Property::Representation
2169
+ command.request_object = property_object
2170
+ command.response_representation = Google::Apis::DriveV2::Property::Representation
2171
+ command.response_class = Google::Apis::DriveV2::Property
2172
+ command.params['fileId'] = file_id unless file_id.nil?
2173
+ command.params['propertyKey'] = property_key unless property_key.nil?
2174
+ command.query['visibility'] = visibility unless visibility.nil?
2175
+ command.query['fields'] = fields unless fields.nil?
2176
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2177
+ command.query['userIp'] = user_ip unless user_ip.nil?
2178
+ execute_or_queue_command(command, &block)
2179
+ end
2180
+
2181
+ # Exports the contents of the Realtime API data model associated with this file
2182
+ # as JSON.
2183
+ # @param [String] file_id
2184
+ # The ID of the file that the Realtime API data model is associated with.
2185
+ # @param [Fixnum] revision
2186
+ # The revision of the Realtime API data model to export. Revisions start at 1 (
2187
+ # the initial empty data model) and are incremented with each change. If this
2188
+ # parameter is excluded, the most recent data model will be returned.
2189
+ # @param [String] fields
2190
+ # Selector specifying which fields to include in a partial response.
2191
+ # @param [String] quota_user
2192
+ # Available to use for quota purposes for server-side applications. Can be any
2193
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2194
+ # Overrides userIp if both are provided.
2195
+ # @param [String] user_ip
2196
+ # IP address of the site where the request originates. Use this if you want to
2197
+ # enforce per-user limits.
2198
+ # @param [IO, String] download_dest
2199
+ # IO stream or filename to receive content download
2200
+ # @param [Google::Apis::RequestOptions] options
2201
+ # Request-specific options
2202
+ #
2203
+ # @yield [result, err] Result & error if block supplied
2204
+ # @yieldparam result [NilClass] No result returned for this method
2205
+ # @yieldparam err [StandardError] error object if request failed
2206
+ #
2207
+ # @return [void]
2208
+ #
2209
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2210
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2211
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2212
+ def get_realtime(file_id, revision: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
2213
+ if download_dest.nil?
2214
+ command = make_simple_command(:get, 'files/{fileId}/realtime', options)
2215
+ else
2216
+ command = make_download_command(:get, 'files/{fileId}/realtime', options)
2217
+ command.download_dest = download_dest
2218
+ end
2219
+ command.params['fileId'] = file_id unless file_id.nil?
2220
+ command.query['revision'] = revision unless revision.nil?
2221
+ command.query['fields'] = fields unless fields.nil?
2222
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2223
+ command.query['userIp'] = user_ip unless user_ip.nil?
2224
+ execute_or_queue_command(command, &block)
2225
+ end
2226
+
2227
+ # Overwrites the Realtime API data model associated with this file with the
2228
+ # provided JSON data model.
2229
+ # @param [String] file_id
2230
+ # The ID of the file that the Realtime API data model is associated with.
2231
+ # @param [String] base_revision
2232
+ # The revision of the model to diff the uploaded model against. If set, the
2233
+ # uploaded model is diffed against the provided revision and those differences
2234
+ # are merged with any changes made to the model after the provided revision. If
2235
+ # not set, the uploaded model replaces the current model on the server.
2236
+ # @param [String] fields
2237
+ # Selector specifying which fields to include in a partial response.
2238
+ # @param [String] quota_user
2239
+ # Available to use for quota purposes for server-side applications. Can be any
2240
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2241
+ # Overrides userIp if both are provided.
2242
+ # @param [String] user_ip
2243
+ # IP address of the site where the request originates. Use this if you want to
2244
+ # enforce per-user limits.
2245
+ # @param [IO, String] upload_source
2246
+ # IO stream or filename containing content to upload
2247
+ # @param [String] content_type
2248
+ # Content type of the uploaded content.
2249
+ # @param [Google::Apis::RequestOptions] options
2250
+ # Request-specific options
2251
+ #
2252
+ # @yield [result, err] Result & error if block supplied
2253
+ # @yieldparam result [NilClass] No result returned for this method
2254
+ # @yieldparam err [StandardError] error object if request failed
2255
+ #
2256
+ # @return [void]
2257
+ #
2258
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2259
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2260
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2261
+ def update_realtime(file_id, base_revision: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
2262
+ if upload_source.nil?
2263
+ command = make_simple_command(:put, 'files/{fileId}/realtime', options)
2264
+ else
2265
+ command = make_upload_command(:put, 'files/{fileId}/realtime', options)
2266
+ command.upload_source = upload_source
2267
+ command.upload_content_type = content_type
2268
+ end
2269
+ command.params['fileId'] = file_id unless file_id.nil?
2270
+ command.query['baseRevision'] = base_revision unless base_revision.nil?
2271
+ command.query['fields'] = fields unless fields.nil?
2272
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2273
+ command.query['userIp'] = user_ip unless user_ip.nil?
2274
+ execute_or_queue_command(command, &block)
2275
+ end
2276
+
2277
+ # Deletes a reply.
2278
+ # @param [String] file_id
2279
+ # The ID of the file.
2280
+ # @param [String] comment_id
2281
+ # The ID of the comment.
2282
+ # @param [String] reply_id
2283
+ # The ID of the reply.
2284
+ # @param [String] fields
2285
+ # Selector specifying which fields to include in a partial response.
2286
+ # @param [String] quota_user
2287
+ # Available to use for quota purposes for server-side applications. Can be any
2288
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2289
+ # Overrides userIp if both are provided.
2290
+ # @param [String] user_ip
2291
+ # IP address of the site where the request originates. Use this if you want to
2292
+ # enforce per-user limits.
2293
+ # @param [Google::Apis::RequestOptions] options
2294
+ # Request-specific options
2295
+ #
2296
+ # @yield [result, err] Result & error if block supplied
2297
+ # @yieldparam result [NilClass] No result returned for this method
2298
+ # @yieldparam err [StandardError] error object if request failed
2299
+ #
2300
+ # @return [void]
2301
+ #
2302
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2303
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2304
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2305
+ def delete_reply(file_id, comment_id, reply_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2306
+ command = make_simple_command(:delete, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
2307
+ command.params['fileId'] = file_id unless file_id.nil?
2308
+ command.params['commentId'] = comment_id unless comment_id.nil?
2309
+ command.params['replyId'] = reply_id unless reply_id.nil?
2310
+ command.query['fields'] = fields unless fields.nil?
2311
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2312
+ command.query['userIp'] = user_ip unless user_ip.nil?
2313
+ execute_or_queue_command(command, &block)
2314
+ end
2315
+
2316
+ # Gets a reply.
2317
+ # @param [String] file_id
2318
+ # The ID of the file.
2319
+ # @param [String] comment_id
2320
+ # The ID of the comment.
2321
+ # @param [String] reply_id
2322
+ # The ID of the reply.
2323
+ # @param [Boolean] include_deleted
2324
+ # If set, this will succeed when retrieving a deleted reply.
2325
+ # @param [String] fields
2326
+ # Selector specifying which fields to include in a partial response.
2327
+ # @param [String] quota_user
2328
+ # Available to use for quota purposes for server-side applications. Can be any
2329
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2330
+ # Overrides userIp if both are provided.
2331
+ # @param [String] user_ip
2332
+ # IP address of the site where the request originates. Use this if you want to
2333
+ # enforce per-user limits.
2334
+ # @param [Google::Apis::RequestOptions] options
2335
+ # Request-specific options
2336
+ #
2337
+ # @yield [result, err] Result & error if block supplied
2338
+ # @yieldparam result [Google::Apis::DriveV2::CommentReply] parsed result object
2339
+ # @yieldparam err [StandardError] error object if request failed
2340
+ #
2341
+ # @return [Google::Apis::DriveV2::CommentReply]
2342
+ #
2343
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2344
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2345
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2346
+ def get_reply(file_id, comment_id, reply_id, include_deleted: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2347
+ command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
2348
+ command.response_representation = Google::Apis::DriveV2::CommentReply::Representation
2349
+ command.response_class = Google::Apis::DriveV2::CommentReply
2350
+ command.params['fileId'] = file_id unless file_id.nil?
2351
+ command.params['commentId'] = comment_id unless comment_id.nil?
2352
+ command.params['replyId'] = reply_id unless reply_id.nil?
2353
+ command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
2354
+ command.query['fields'] = fields unless fields.nil?
2355
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2356
+ command.query['userIp'] = user_ip unless user_ip.nil?
2357
+ execute_or_queue_command(command, &block)
2358
+ end
2359
+
2360
+ # Creates a new reply to the given comment.
2361
+ # @param [String] file_id
2362
+ # The ID of the file.
2363
+ # @param [String] comment_id
2364
+ # The ID of the comment.
2365
+ # @param [Google::Apis::DriveV2::CommentReply] comment_reply_object
2366
+ # @param [String] fields
2367
+ # Selector specifying which fields to include in a partial response.
2368
+ # @param [String] quota_user
2369
+ # Available to use for quota purposes for server-side applications. Can be any
2370
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2371
+ # Overrides userIp if both are provided.
2372
+ # @param [String] user_ip
2373
+ # IP address of the site where the request originates. Use this if you want to
2374
+ # enforce per-user limits.
2375
+ # @param [Google::Apis::RequestOptions] options
2376
+ # Request-specific options
2377
+ #
2378
+ # @yield [result, err] Result & error if block supplied
2379
+ # @yieldparam result [Google::Apis::DriveV2::CommentReply] parsed result object
2380
+ # @yieldparam err [StandardError] error object if request failed
2381
+ #
2382
+ # @return [Google::Apis::DriveV2::CommentReply]
2383
+ #
2384
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2385
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2386
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2387
+ def insert_reply(file_id, comment_id, comment_reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2388
+ command = make_simple_command(:post, 'files/{fileId}/comments/{commentId}/replies', options)
2389
+ command.request_representation = Google::Apis::DriveV2::CommentReply::Representation
2390
+ command.request_object = comment_reply_object
2391
+ command.response_representation = Google::Apis::DriveV2::CommentReply::Representation
2392
+ command.response_class = Google::Apis::DriveV2::CommentReply
2393
+ command.params['fileId'] = file_id unless file_id.nil?
2394
+ command.params['commentId'] = comment_id unless comment_id.nil?
2395
+ command.query['fields'] = fields unless fields.nil?
2396
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2397
+ command.query['userIp'] = user_ip unless user_ip.nil?
2398
+ execute_or_queue_command(command, &block)
2399
+ end
2400
+
2401
+ # Lists all of the replies to a comment.
2402
+ # @param [String] file_id
2403
+ # The ID of the file.
2404
+ # @param [String] comment_id
2405
+ # The ID of the comment.
2406
+ # @param [Boolean] include_deleted
2407
+ # If set, all replies, including deleted replies (with content stripped) will be
2408
+ # returned.
2409
+ # @param [Fixnum] max_results
2410
+ # The maximum number of replies to include in the response, used for paging.
2411
+ # @param [String] page_token
2412
+ # The continuation token, used to page through large result sets. To get the
2413
+ # next page of results, set this parameter to the value of "nextPageToken" from
2414
+ # the previous response.
2415
+ # @param [String] fields
2416
+ # Selector specifying which fields to include in a partial response.
2417
+ # @param [String] quota_user
2418
+ # Available to use for quota purposes for server-side applications. Can be any
2419
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2420
+ # Overrides userIp if both are provided.
2421
+ # @param [String] user_ip
2422
+ # IP address of the site where the request originates. Use this if you want to
2423
+ # enforce per-user limits.
2424
+ # @param [Google::Apis::RequestOptions] options
2425
+ # Request-specific options
2426
+ #
2427
+ # @yield [result, err] Result & error if block supplied
2428
+ # @yieldparam result [Google::Apis::DriveV2::CommentReplyList] parsed result object
2429
+ # @yieldparam err [StandardError] error object if request failed
2430
+ #
2431
+ # @return [Google::Apis::DriveV2::CommentReplyList]
2432
+ #
2433
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2434
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2435
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2436
+ def list_replies(file_id, comment_id, include_deleted: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2437
+ command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}/replies', options)
2438
+ command.response_representation = Google::Apis::DriveV2::CommentReplyList::Representation
2439
+ command.response_class = Google::Apis::DriveV2::CommentReplyList
2440
+ command.params['fileId'] = file_id unless file_id.nil?
2441
+ command.params['commentId'] = comment_id unless comment_id.nil?
2442
+ command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
2443
+ command.query['maxResults'] = max_results unless max_results.nil?
2444
+ command.query['pageToken'] = page_token unless page_token.nil?
2445
+ command.query['fields'] = fields unless fields.nil?
2446
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2447
+ command.query['userIp'] = user_ip unless user_ip.nil?
2448
+ execute_or_queue_command(command, &block)
2449
+ end
2450
+
2451
+ # Updates an existing reply. This method supports patch semantics.
2452
+ # @param [String] file_id
2453
+ # The ID of the file.
2454
+ # @param [String] comment_id
2455
+ # The ID of the comment.
2456
+ # @param [String] reply_id
2457
+ # The ID of the reply.
2458
+ # @param [Google::Apis::DriveV2::CommentReply] comment_reply_object
2459
+ # @param [String] fields
2460
+ # Selector specifying which fields to include in a partial response.
2461
+ # @param [String] quota_user
2462
+ # Available to use for quota purposes for server-side applications. Can be any
2463
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2464
+ # Overrides userIp if both are provided.
2465
+ # @param [String] user_ip
2466
+ # IP address of the site where the request originates. Use this if you want to
2467
+ # enforce per-user limits.
2468
+ # @param [Google::Apis::RequestOptions] options
2469
+ # Request-specific options
2470
+ #
2471
+ # @yield [result, err] Result & error if block supplied
2472
+ # @yieldparam result [Google::Apis::DriveV2::CommentReply] parsed result object
2473
+ # @yieldparam err [StandardError] error object if request failed
2474
+ #
2475
+ # @return [Google::Apis::DriveV2::CommentReply]
2476
+ #
2477
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2478
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2479
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2480
+ def patch_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2481
+ command = make_simple_command(:patch, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
2482
+ command.request_representation = Google::Apis::DriveV2::CommentReply::Representation
2483
+ command.request_object = comment_reply_object
2484
+ command.response_representation = Google::Apis::DriveV2::CommentReply::Representation
2485
+ command.response_class = Google::Apis::DriveV2::CommentReply
2486
+ command.params['fileId'] = file_id unless file_id.nil?
2487
+ command.params['commentId'] = comment_id unless comment_id.nil?
2488
+ command.params['replyId'] = reply_id unless reply_id.nil?
2489
+ command.query['fields'] = fields unless fields.nil?
2490
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2491
+ command.query['userIp'] = user_ip unless user_ip.nil?
2492
+ execute_or_queue_command(command, &block)
2493
+ end
2494
+
2495
+ # Updates an existing reply.
2496
+ # @param [String] file_id
2497
+ # The ID of the file.
2498
+ # @param [String] comment_id
2499
+ # The ID of the comment.
2500
+ # @param [String] reply_id
2501
+ # The ID of the reply.
2502
+ # @param [Google::Apis::DriveV2::CommentReply] comment_reply_object
2503
+ # @param [String] fields
2504
+ # Selector specifying which fields to include in a partial response.
2505
+ # @param [String] quota_user
2506
+ # Available to use for quota purposes for server-side applications. Can be any
2507
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2508
+ # Overrides userIp if both are provided.
2509
+ # @param [String] user_ip
2510
+ # IP address of the site where the request originates. Use this if you want to
2511
+ # enforce per-user limits.
2512
+ # @param [Google::Apis::RequestOptions] options
2513
+ # Request-specific options
2514
+ #
2515
+ # @yield [result, err] Result & error if block supplied
2516
+ # @yieldparam result [Google::Apis::DriveV2::CommentReply] parsed result object
2517
+ # @yieldparam err [StandardError] error object if request failed
2518
+ #
2519
+ # @return [Google::Apis::DriveV2::CommentReply]
2520
+ #
2521
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2522
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2523
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2524
+ def update_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2525
+ command = make_simple_command(:put, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
2526
+ command.request_representation = Google::Apis::DriveV2::CommentReply::Representation
2527
+ command.request_object = comment_reply_object
2528
+ command.response_representation = Google::Apis::DriveV2::CommentReply::Representation
2529
+ command.response_class = Google::Apis::DriveV2::CommentReply
2530
+ command.params['fileId'] = file_id unless file_id.nil?
2531
+ command.params['commentId'] = comment_id unless comment_id.nil?
2532
+ command.params['replyId'] = reply_id unless reply_id.nil?
2533
+ command.query['fields'] = fields unless fields.nil?
2534
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2535
+ command.query['userIp'] = user_ip unless user_ip.nil?
2536
+ execute_or_queue_command(command, &block)
2537
+ end
2538
+
2539
+ # Removes a revision.
2540
+ # @param [String] file_id
2541
+ # The ID of the file.
2542
+ # @param [String] revision_id
2543
+ # The ID of the revision.
2544
+ # @param [String] fields
2545
+ # Selector specifying which fields to include in a partial response.
2546
+ # @param [String] quota_user
2547
+ # Available to use for quota purposes for server-side applications. Can be any
2548
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2549
+ # Overrides userIp if both are provided.
2550
+ # @param [String] user_ip
2551
+ # IP address of the site where the request originates. Use this if you want to
2552
+ # enforce per-user limits.
2553
+ # @param [Google::Apis::RequestOptions] options
2554
+ # Request-specific options
2555
+ #
2556
+ # @yield [result, err] Result & error if block supplied
2557
+ # @yieldparam result [NilClass] No result returned for this method
2558
+ # @yieldparam err [StandardError] error object if request failed
2559
+ #
2560
+ # @return [void]
2561
+ #
2562
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2563
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2564
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2565
+ def delete_revision(file_id, revision_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2566
+ command = make_simple_command(:delete, 'files/{fileId}/revisions/{revisionId}', options)
2567
+ command.params['fileId'] = file_id unless file_id.nil?
2568
+ command.params['revisionId'] = revision_id unless revision_id.nil?
2569
+ command.query['fields'] = fields unless fields.nil?
2570
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2571
+ command.query['userIp'] = user_ip unless user_ip.nil?
2572
+ execute_or_queue_command(command, &block)
2573
+ end
2574
+
2575
+ # Gets a specific revision.
2576
+ # @param [String] file_id
2577
+ # The ID of the file.
2578
+ # @param [String] revision_id
2579
+ # The ID of the revision.
2580
+ # @param [String] fields
2581
+ # Selector specifying which fields to include in a partial response.
2582
+ # @param [String] quota_user
2583
+ # Available to use for quota purposes for server-side applications. Can be any
2584
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2585
+ # Overrides userIp if both are provided.
2586
+ # @param [String] user_ip
2587
+ # IP address of the site where the request originates. Use this if you want to
2588
+ # enforce per-user limits.
2589
+ # @param [Google::Apis::RequestOptions] options
2590
+ # Request-specific options
2591
+ #
2592
+ # @yield [result, err] Result & error if block supplied
2593
+ # @yieldparam result [Google::Apis::DriveV2::Revision] parsed result object
2594
+ # @yieldparam err [StandardError] error object if request failed
2595
+ #
2596
+ # @return [Google::Apis::DriveV2::Revision]
2597
+ #
2598
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2599
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2600
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2601
+ def get_revision(file_id, revision_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2602
+ command = make_simple_command(:get, 'files/{fileId}/revisions/{revisionId}', options)
2603
+ command.response_representation = Google::Apis::DriveV2::Revision::Representation
2604
+ command.response_class = Google::Apis::DriveV2::Revision
2605
+ command.params['fileId'] = file_id unless file_id.nil?
2606
+ command.params['revisionId'] = revision_id unless revision_id.nil?
2607
+ command.query['fields'] = fields unless fields.nil?
2608
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2609
+ command.query['userIp'] = user_ip unless user_ip.nil?
2610
+ execute_or_queue_command(command, &block)
2611
+ end
2612
+
2613
+ # Lists a file's revisions.
2614
+ # @param [String] file_id
2615
+ # The ID of the file.
2616
+ # @param [String] fields
2617
+ # Selector specifying which fields to include in a partial response.
2618
+ # @param [String] quota_user
2619
+ # Available to use for quota purposes for server-side applications. Can be any
2620
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2621
+ # Overrides userIp if both are provided.
2622
+ # @param [String] user_ip
2623
+ # IP address of the site where the request originates. Use this if you want to
2624
+ # enforce per-user limits.
2625
+ # @param [Google::Apis::RequestOptions] options
2626
+ # Request-specific options
2627
+ #
2628
+ # @yield [result, err] Result & error if block supplied
2629
+ # @yieldparam result [Google::Apis::DriveV2::RevisionList] parsed result object
2630
+ # @yieldparam err [StandardError] error object if request failed
2631
+ #
2632
+ # @return [Google::Apis::DriveV2::RevisionList]
2633
+ #
2634
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2635
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2636
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2637
+ def list_revisions(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2638
+ command = make_simple_command(:get, 'files/{fileId}/revisions', options)
2639
+ command.response_representation = Google::Apis::DriveV2::RevisionList::Representation
2640
+ command.response_class = Google::Apis::DriveV2::RevisionList
2641
+ command.params['fileId'] = file_id unless file_id.nil?
2642
+ command.query['fields'] = fields unless fields.nil?
2643
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2644
+ command.query['userIp'] = user_ip unless user_ip.nil?
2645
+ execute_or_queue_command(command, &block)
2646
+ end
2647
+
2648
+ # Updates a revision. This method supports patch semantics.
2649
+ # @param [String] file_id
2650
+ # The ID for the file.
2651
+ # @param [String] revision_id
2652
+ # The ID for the revision.
2653
+ # @param [Google::Apis::DriveV2::Revision] revision_object
2654
+ # @param [String] fields
2655
+ # Selector specifying which fields to include in a partial response.
2656
+ # @param [String] quota_user
2657
+ # Available to use for quota purposes for server-side applications. Can be any
2658
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2659
+ # Overrides userIp if both are provided.
2660
+ # @param [String] user_ip
2661
+ # IP address of the site where the request originates. Use this if you want to
2662
+ # enforce per-user limits.
2663
+ # @param [Google::Apis::RequestOptions] options
2664
+ # Request-specific options
2665
+ #
2666
+ # @yield [result, err] Result & error if block supplied
2667
+ # @yieldparam result [Google::Apis::DriveV2::Revision] parsed result object
2668
+ # @yieldparam err [StandardError] error object if request failed
2669
+ #
2670
+ # @return [Google::Apis::DriveV2::Revision]
2671
+ #
2672
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2673
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2674
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2675
+ def patch_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2676
+ command = make_simple_command(:patch, 'files/{fileId}/revisions/{revisionId}', options)
2677
+ command.request_representation = Google::Apis::DriveV2::Revision::Representation
2678
+ command.request_object = revision_object
2679
+ command.response_representation = Google::Apis::DriveV2::Revision::Representation
2680
+ command.response_class = Google::Apis::DriveV2::Revision
2681
+ command.params['fileId'] = file_id unless file_id.nil?
2682
+ command.params['revisionId'] = revision_id unless revision_id.nil?
2683
+ command.query['fields'] = fields unless fields.nil?
2684
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2685
+ command.query['userIp'] = user_ip unless user_ip.nil?
2686
+ execute_or_queue_command(command, &block)
2687
+ end
2688
+
2689
+ # Updates a revision.
2690
+ # @param [String] file_id
2691
+ # The ID for the file.
2692
+ # @param [String] revision_id
2693
+ # The ID for the revision.
2694
+ # @param [Google::Apis::DriveV2::Revision] revision_object
2695
+ # @param [String] fields
2696
+ # Selector specifying which fields to include in a partial response.
2697
+ # @param [String] quota_user
2698
+ # Available to use for quota purposes for server-side applications. Can be any
2699
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2700
+ # Overrides userIp if both are provided.
2701
+ # @param [String] user_ip
2702
+ # IP address of the site where the request originates. Use this if you want to
2703
+ # enforce per-user limits.
2704
+ # @param [Google::Apis::RequestOptions] options
2705
+ # Request-specific options
2706
+ #
2707
+ # @yield [result, err] Result & error if block supplied
2708
+ # @yieldparam result [Google::Apis::DriveV2::Revision] parsed result object
2709
+ # @yieldparam err [StandardError] error object if request failed
2710
+ #
2711
+ # @return [Google::Apis::DriveV2::Revision]
2712
+ #
2713
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2714
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2715
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2716
+ def update_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2717
+ command = make_simple_command(:put, 'files/{fileId}/revisions/{revisionId}', options)
2718
+ command.request_representation = Google::Apis::DriveV2::Revision::Representation
2719
+ command.request_object = revision_object
2720
+ command.response_representation = Google::Apis::DriveV2::Revision::Representation
2721
+ command.response_class = Google::Apis::DriveV2::Revision
2722
+ command.params['fileId'] = file_id unless file_id.nil?
2723
+ command.params['revisionId'] = revision_id unless revision_id.nil?
2724
+ command.query['fields'] = fields unless fields.nil?
2725
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2726
+ command.query['userIp'] = user_ip unless user_ip.nil?
2727
+ execute_or_queue_command(command, &block)
2728
+ end
2729
+
2730
+ protected
2731
+
2732
+ def apply_command_defaults(command)
2733
+ command.query['key'] = key unless key.nil?
2734
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2735
+ command.query['userIp'] = user_ip unless user_ip.nil?
2736
+ end
2737
+ end
2738
+ end
2739
+ end
2740
+ end