google-api-client 0.8.7 → 0.9.pre1

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