google-api-client 0.9.pre3 → 0.9.pre4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (307) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGELOG.md +14 -2
  4. data/Gemfile +4 -0
  5. data/MIGRATING.md +1 -1
  6. data/README.md +17 -3
  7. data/api_names.yaml +127 -14
  8. data/api_names_out.yaml +5442 -710
  9. data/bin/generate-api +16 -14
  10. data/generated/google/apis/adexchangebuyer_v1_3.rb +1 -1
  11. data/generated/google/apis/adexchangebuyer_v1_3/classes.rb +213 -2
  12. data/generated/google/apis/adexchangebuyer_v1_3/representations.rb +71 -0
  13. data/generated/google/apis/adexchangebuyer_v1_3/service.rb +21 -42
  14. data/generated/google/apis/adexchangeseller_v2_0.rb +1 -1
  15. data/generated/google/apis/adexchangeseller_v2_0/service.rb +15 -29
  16. data/generated/google/apis/admin_datatransfer_v1.rb +37 -0
  17. data/generated/google/apis/admin_datatransfer_v1/classes.rb +267 -0
  18. data/generated/google/apis/admin_datatransfer_v1/representations.rb +118 -0
  19. data/generated/google/apis/admin_datatransfer_v1/service.rb +262 -0
  20. data/generated/google/apis/admin_directory_v1.rb +25 -1
  21. data/generated/google/apis/admin_directory_v1/classes.rb +718 -0
  22. data/generated/google/apis/admin_directory_v1/representations.rb +244 -0
  23. data/generated/google/apis/admin_directory_v1/service.rb +1522 -509
  24. data/generated/google/apis/admin_reports_v1.rb +1 -1
  25. data/generated/google/apis/admin_reports_v1/service.rb +5 -10
  26. data/generated/google/apis/adsense_v1_4.rb +1 -1
  27. data/generated/google/apis/adsense_v1_4/classes.rb +6 -0
  28. data/generated/google/apis/adsense_v1_4/representations.rb +1 -0
  29. data/generated/google/apis/adsense_v1_4/service.rb +40 -78
  30. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  31. data/generated/google/apis/adsensehost_v4_1/service.rb +26 -52
  32. data/generated/google/apis/analytics_v3.rb +1 -1
  33. data/generated/google/apis/analytics_v3/classes.rb +11 -13
  34. data/generated/google/apis/analytics_v3/service.rb +84 -158
  35. data/generated/google/apis/androidenterprise_v1.rb +2 -2
  36. data/generated/google/apis/androidenterprise_v1/classes.rb +276 -8
  37. data/generated/google/apis/androidenterprise_v1/representations.rb +106 -0
  38. data/generated/google/apis/androidenterprise_v1/service.rb +715 -97
  39. data/generated/google/apis/androidpublisher_v2.rb +1 -1
  40. data/generated/google/apis/androidpublisher_v2/classes.rb +2 -2
  41. data/generated/google/apis/androidpublisher_v2/service.rb +55 -107
  42. data/generated/google/apis/appengine_v1beta4.rb +35 -0
  43. data/generated/google/apis/appengine_v1beta4/classes.rb +1532 -0
  44. data/generated/google/apis/appengine_v1beta4/representations.rb +526 -0
  45. data/generated/google/apis/appengine_v1beta4/service.rb +476 -0
  46. data/generated/google/apis/appsactivity_v1.rb +1 -1
  47. data/generated/google/apis/appsactivity_v1/service.rb +1 -2
  48. data/generated/google/apis/appstate_v1.rb +1 -1
  49. data/generated/google/apis/appstate_v1/service.rb +6 -11
  50. data/generated/google/apis/autoscaler_v1beta2/service.rb +10 -20
  51. data/generated/google/apis/bigquery_v2.rb +4 -1
  52. data/generated/google/apis/bigquery_v2/classes.rb +231 -16
  53. data/generated/google/apis/bigquery_v2/representations.rb +62 -0
  54. data/generated/google/apis/bigquery_v2/service.rb +24 -45
  55. data/generated/google/apis/blogger_v3/service.rb +33 -66
  56. data/generated/google/apis/books_v1.rb +1 -1
  57. data/generated/google/apis/books_v1/classes.rb +441 -0
  58. data/generated/google/apis/books_v1/representations.rb +177 -0
  59. data/generated/google/apis/books_v1/service.rb +210 -90
  60. data/generated/google/apis/calendar_v3.rb +1 -1
  61. data/generated/google/apis/calendar_v3/classes.rb +34 -18
  62. data/generated/google/apis/calendar_v3/service.rb +118 -103
  63. data/generated/google/apis/civicinfo_v2.rb +1 -1
  64. data/generated/google/apis/civicinfo_v2/classes.rb +12 -3
  65. data/generated/google/apis/civicinfo_v2/representations.rb +1 -0
  66. data/generated/google/apis/civicinfo_v2/service.rb +5 -10
  67. data/generated/google/apis/classroom_v1.rb +49 -0
  68. data/generated/google/apis/classroom_v1/classes.rb +512 -0
  69. data/generated/google/apis/classroom_v1/representations.rb +217 -0
  70. data/generated/google/apis/classroom_v1/service.rb +970 -0
  71. data/generated/google/apis/cloudbilling_v1.rb +35 -0
  72. data/generated/google/apis/cloudbilling_v1/classes.rb +169 -0
  73. data/generated/google/apis/cloudbilling_v1/representations.rb +79 -0
  74. data/generated/google/apis/cloudbilling_v1/service.rb +258 -0
  75. data/generated/google/apis/clouddebugger_v2.rb +41 -0
  76. data/generated/google/apis/clouddebugger_v2/classes.rb +1004 -0
  77. data/generated/google/apis/clouddebugger_v2/representations.rb +410 -0
  78. data/generated/google/apis/clouddebugger_v2/service.rb +370 -0
  79. data/generated/google/apis/cloudmonitoring_v2beta2.rb +1 -1
  80. data/generated/google/apis/cloudmonitoring_v2beta2/service.rb +6 -12
  81. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +5 -2
  82. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +173 -249
  83. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +36 -68
  84. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +293 -80
  85. data/generated/google/apis/cloudtrace_v1.rb +35 -0
  86. data/generated/google/apis/cloudtrace_v1/classes.rb +188 -0
  87. data/generated/google/apis/cloudtrace_v1/representations.rb +92 -0
  88. data/generated/google/apis/cloudtrace_v1/service.rb +190 -0
  89. data/generated/google/apis/clouduseraccounts_beta.rb +43 -0
  90. data/generated/google/apis/clouduseraccounts_beta/classes.rb +823 -0
  91. data/generated/google/apis/clouduseraccounts_beta/representations.rb +313 -0
  92. data/generated/google/apis/clouduseraccounts_beta/service.rb +854 -0
  93. data/generated/google/apis/compute_beta.rb +49 -0
  94. data/generated/google/apis/compute_beta/classes.rb +9128 -0
  95. data/generated/google/apis/compute_beta/representations.rb +3048 -0
  96. data/generated/google/apis/compute_beta/service.rb +10154 -0
  97. data/generated/google/apis/compute_v1.rb +1 -1
  98. data/generated/google/apis/compute_v1/classes.rb +1305 -520
  99. data/generated/google/apis/compute_v1/representations.rb +122 -15
  100. data/generated/google/apis/compute_v1/service.rb +2202 -1085
  101. data/generated/google/apis/container_v1.rb +1 -1
  102. data/generated/google/apis/container_v1/classes.rb +56 -31
  103. data/generated/google/apis/container_v1/representations.rb +12 -0
  104. data/generated/google/apis/container_v1/service.rb +62 -41
  105. data/generated/google/apis/content_v2.rb +2 -2
  106. data/generated/google/apis/content_v2/classes.rb +2252 -56
  107. data/generated/google/apis/content_v2/representations.rb +917 -87
  108. data/generated/google/apis/content_v2/service.rb +680 -85
  109. data/generated/google/apis/coordinate_v1.rb +1 -1
  110. data/generated/google/apis/coordinate_v1/service.rb +16 -25
  111. data/generated/google/apis/customsearch_v1/service.rb +1 -2
  112. data/generated/google/apis/datastore_v1beta2.rb +1 -1
  113. data/generated/google/apis/datastore_v1beta2/service.rb +12 -18
  114. data/generated/google/apis/deploymentmanager_v2.rb +44 -0
  115. data/generated/google/apis/deploymentmanager_v2/classes.rb +1089 -0
  116. data/generated/google/apis/deploymentmanager_v2/representations.rb +422 -0
  117. data/generated/google/apis/deploymentmanager_v2/service.rb +857 -0
  118. data/generated/google/apis/deploymentmanager_v2beta2.rb +5 -2
  119. data/generated/google/apis/deploymentmanager_v2beta2/classes.rb +22 -3
  120. data/generated/google/apis/deploymentmanager_v2beta2/representations.rb +3 -0
  121. data/generated/google/apis/deploymentmanager_v2beta2/service.rb +14 -27
  122. data/generated/google/apis/dfareporting_v2_1.rb +1 -1
  123. data/generated/google/apis/dfareporting_v2_1/classes.rb +29 -14
  124. data/generated/google/apis/dfareporting_v2_1/service.rb +196 -389
  125. data/generated/google/apis/discovery_v1/classes.rb +7 -0
  126. data/generated/google/apis/discovery_v1/representations.rb +1 -0
  127. data/generated/google/apis/discovery_v1/service.rb +2 -4
  128. data/generated/google/apis/dns_v1.rb +4 -1
  129. data/generated/google/apis/dns_v1/service.rb +9 -18
  130. data/generated/google/apis/doubleclickbidmanager_v1.rb +1 -1
  131. data/generated/google/apis/doubleclickbidmanager_v1/classes.rb +9 -2
  132. data/generated/google/apis/doubleclickbidmanager_v1/representations.rb +1 -0
  133. data/generated/google/apis/doubleclickbidmanager_v1/service.rb +8 -16
  134. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  135. data/generated/google/apis/doubleclicksearch_v2/classes.rb +15 -6
  136. data/generated/google/apis/doubleclicksearch_v2/representations.rb +1 -0
  137. data/generated/google/apis/doubleclicksearch_v2/service.rb +13 -23
  138. data/generated/google/apis/drive_v2.rb +1 -1
  139. data/generated/google/apis/drive_v2/classes.rb +73 -30
  140. data/generated/google/apis/drive_v2/representations.rb +14 -0
  141. data/generated/google/apis/drive_v2/service.rb +139 -135
  142. data/generated/google/apis/drive_v3.rb +55 -0
  143. data/generated/google/apis/drive_v3/classes.rb +1534 -0
  144. data/generated/google/apis/drive_v3/representations.rb +497 -0
  145. data/generated/google/apis/drive_v3/service.rb +1541 -0
  146. data/generated/google/apis/fitness_v1.rb +1 -1
  147. data/generated/google/apis/fitness_v1/service.rb +14 -27
  148. data/generated/google/apis/fusiontables_v2/service.rb +40 -73
  149. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  150. data/generated/google/apis/games_configuration_v1configuration/service.rb +14 -27
  151. data/generated/google/apis/games_management_v1management.rb +37 -0
  152. data/generated/google/apis/games_management_v1management/classes.rb +524 -0
  153. data/generated/google/apis/games_management_v1management/representations.rb +231 -0
  154. data/generated/google/apis/games_management_v1management/service.rb +994 -0
  155. data/generated/google/apis/games_v1.rb +1 -1
  156. data/generated/google/apis/games_v1/classes.rb +39 -0
  157. data/generated/google/apis/games_v1/representations.rb +14 -0
  158. data/generated/google/apis/games_v1/service.rb +93 -109
  159. data/generated/google/apis/gan_v1beta1/service.rb +10 -20
  160. data/generated/google/apis/genomics_v1.rb +5 -3
  161. data/generated/google/apis/genomics_v1/classes.rb +519 -200
  162. data/generated/google/apis/genomics_v1/representations.rb +126 -13
  163. data/generated/google/apis/genomics_v1/service.rb +392 -236
  164. data/generated/google/apis/gmail_v1.rb +4 -1
  165. data/generated/google/apis/gmail_v1/service.rb +39 -71
  166. data/generated/google/apis/groupsmigration_v1/service.rb +2 -3
  167. data/generated/google/apis/groupssettings_v1/service.rb +3 -6
  168. data/generated/google/apis/identitytoolkit_v3.rb +1 -1
  169. data/generated/google/apis/identitytoolkit_v3/classes.rb +125 -0
  170. data/generated/google/apis/identitytoolkit_v3/representations.rb +37 -0
  171. data/generated/google/apis/identitytoolkit_v3/service.rb +44 -24
  172. data/generated/google/apis/kgsearch_v1.rb +32 -0
  173. data/generated/google/apis/kgsearch_v1/classes.rb +59 -0
  174. data/generated/google/apis/kgsearch_v1/representations.rb +39 -0
  175. data/generated/google/apis/kgsearch_v1/service.rb +111 -0
  176. data/generated/google/apis/licensing_v1.rb +1 -1
  177. data/generated/google/apis/licensing_v1/service.rb +7 -14
  178. data/generated/google/apis/logging_v1beta3.rb +16 -4
  179. data/generated/google/apis/logging_v1beta3/classes.rb +620 -46
  180. data/generated/google/apis/logging_v1beta3/representations.rb +144 -0
  181. data/generated/google/apis/logging_v1beta3/service.rb +435 -104
  182. data/generated/google/apis/manager_v1beta2.rb +3 -0
  183. data/generated/google/apis/manager_v1beta2/service.rb +8 -16
  184. data/generated/google/apis/mapsengine_v1.rb +1 -1
  185. data/generated/google/apis/mapsengine_v1/service.rb +85 -162
  186. data/generated/google/apis/mirror_v1.rb +1 -1
  187. data/generated/google/apis/mirror_v1/service.rb +28 -52
  188. data/generated/google/apis/oauth2_v2.rb +1 -1
  189. data/generated/google/apis/oauth2_v2/service.rb +4 -8
  190. data/generated/google/apis/pagespeedonline_v2/service.rb +1 -2
  191. data/generated/google/apis/partners_v2.rb +32 -0
  192. data/generated/google/apis/partners_v2/classes.rb +942 -0
  193. data/generated/google/apis/partners_v2/representations.rb +402 -0
  194. data/generated/google/apis/partners_v2/service.rb +400 -0
  195. data/generated/google/apis/plus_domains_v1.rb +1 -1
  196. data/generated/google/apis/plus_domains_v1/classes.rb +207 -0
  197. data/generated/google/apis/plus_domains_v1/representations.rb +114 -0
  198. data/generated/google/apis/plus_domains_v1/service.rb +21 -41
  199. data/generated/google/apis/plus_v1.rb +1 -1
  200. data/generated/google/apis/plus_v1/classes.rb +207 -0
  201. data/generated/google/apis/plus_v1/representations.rb +114 -0
  202. data/generated/google/apis/plus_v1/service.rb +11 -56
  203. data/generated/google/apis/prediction_v1_6.rb +1 -1
  204. data/generated/google/apis/prediction_v1_6/service.rb +8 -16
  205. data/generated/google/apis/proximitybeacon_v1beta1.rb +31 -0
  206. data/generated/google/apis/proximitybeacon_v1beta1/classes.rb +639 -0
  207. data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +274 -0
  208. data/generated/google/apis/proximitybeacon_v1beta1/service.rb +591 -0
  209. data/generated/google/apis/pubsub_v1.rb +37 -0
  210. data/generated/google/apis/pubsub_v1/classes.rb +614 -0
  211. data/generated/google/apis/pubsub_v1/representations.rb +281 -0
  212. data/generated/google/apis/pubsub_v1/service.rb +774 -0
  213. data/generated/google/apis/pubsub_v1beta2.rb +1 -1
  214. data/generated/google/apis/pubsub_v1beta2/classes.rb +78 -283
  215. data/generated/google/apis/pubsub_v1beta2/representations.rb +1 -85
  216. data/generated/google/apis/pubsub_v1beta2/service.rb +79 -87
  217. data/generated/google/apis/qpx_express_v1/service.rb +1 -2
  218. data/generated/google/apis/replicapool_v1beta2.rb +3 -0
  219. data/generated/google/apis/replicapool_v1beta2/service.rb +12 -24
  220. data/generated/google/apis/replicapoolupdater_v1beta1.rb +4 -1
  221. data/generated/google/apis/replicapoolupdater_v1beta1/classes.rb +46 -2
  222. data/generated/google/apis/replicapoolupdater_v1beta1/representations.rb +16 -0
  223. data/generated/google/apis/replicapoolupdater_v1beta1/service.rb +58 -18
  224. data/generated/google/apis/reseller_v1.rb +1 -1
  225. data/generated/google/apis/reseller_v1/classes.rb +19 -1
  226. data/generated/google/apis/reseller_v1/representations.rb +1 -0
  227. data/generated/google/apis/reseller_v1/service.rb +16 -30
  228. data/generated/google/apis/resourceviews_v1beta2.rb +3 -0
  229. data/generated/google/apis/resourceviews_v1beta2/service.rb +16 -27
  230. data/generated/google/apis/script_v1.rb +61 -0
  231. data/generated/google/apis/script_v1/classes.rb +259 -0
  232. data/generated/google/apis/script_v1/representations.rb +106 -0
  233. data/generated/google/apis/script_v1/service.rb +98 -0
  234. data/generated/google/apis/site_verification_v1.rb +1 -1
  235. data/generated/google/apis/site_verification_v1/service.rb +8 -15
  236. data/generated/google/apis/sqladmin_v1beta4.rb +1 -1
  237. data/generated/google/apis/sqladmin_v1beta4/classes.rb +186 -2
  238. data/generated/google/apis/sqladmin_v1beta4/representations.rb +70 -0
  239. data/generated/google/apis/sqladmin_v1beta4/service.rb +166 -75
  240. data/generated/google/apis/storage_v1.rb +5 -2
  241. data/generated/google/apis/storage_v1/classes.rb +47 -4
  242. data/generated/google/apis/storage_v1/representations.rb +18 -0
  243. data/generated/google/apis/storage_v1/service.rb +77 -94
  244. data/generated/google/apis/storagetransfer_v1.rb +35 -0
  245. data/generated/google/apis/storagetransfer_v1/classes.rb +1046 -0
  246. data/generated/google/apis/storagetransfer_v1/representations.rb +370 -0
  247. data/generated/google/apis/storagetransfer_v1/service.rb +473 -0
  248. data/generated/google/apis/tagmanager_v1.rb +1 -1
  249. data/generated/google/apis/tagmanager_v1/classes.rb +189 -31
  250. data/generated/google/apis/tagmanager_v1/representations.rb +69 -15
  251. data/generated/google/apis/tagmanager_v1/service.rb +114 -275
  252. data/generated/google/apis/taskqueue_v1beta2/service.rb +8 -16
  253. data/generated/google/apis/tasks_v1/service.rb +14 -28
  254. data/generated/google/apis/translate_v2/service.rb +3 -6
  255. data/generated/google/apis/urlshortener_v1/service.rb +3 -6
  256. data/generated/google/apis/webmasters_v3.rb +3 -3
  257. data/generated/google/apis/webmasters_v3/classes.rb +4 -4
  258. data/generated/google/apis/webmasters_v3/service.rb +16 -30
  259. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  260. data/generated/google/apis/youtube_analytics_v1/classes.rb +6 -0
  261. data/generated/google/apis/youtube_analytics_v1/representations.rb +1 -0
  262. data/generated/google/apis/youtube_analytics_v1/service.rb +16 -21
  263. data/generated/google/apis/youtube_v3.rb +1 -1
  264. data/generated/google/apis/youtube_v3/classes.rb +111 -78
  265. data/generated/google/apis/youtube_v3/representations.rb +2 -0
  266. data/generated/google/apis/youtube_v3/service.rb +78 -246
  267. data/generated/google/apis/youtubereporting_v1.rb +38 -0
  268. data/generated/google/apis/youtubereporting_v1/classes.rb +258 -0
  269. data/generated/google/apis/youtubereporting_v1/representations.rb +128 -0
  270. data/generated/google/apis/youtubereporting_v1/service.rb +364 -0
  271. data/google-api-client.gemspec +3 -3
  272. data/lib/google/api_client/auth/installed_app.rb +2 -2
  273. data/lib/google/api_client/auth/key_utils.rb +1 -0
  274. data/lib/google/api_client/auth/storage.rb +1 -0
  275. data/lib/google/api_client/auth/storages/file_store.rb +1 -0
  276. data/lib/google/api_client/auth/storages/redis_store.rb +1 -0
  277. data/lib/google/api_client/client_secrets.rb +4 -5
  278. data/lib/google/apis/core/api_command.rb +2 -2
  279. data/lib/google/apis/core/base_service.rb +1 -0
  280. data/lib/google/apis/core/batch.rb +25 -8
  281. data/lib/google/apis/core/download.rb +1 -1
  282. data/lib/google/apis/core/http_command.rb +24 -12
  283. data/lib/google/apis/core/multipart.rb +20 -6
  284. data/lib/google/apis/core/upload.rb +11 -4
  285. data/lib/google/apis/generator/annotator.rb +29 -10
  286. data/lib/google/apis/generator/helpers.rb +1 -1
  287. data/lib/google/apis/generator/templates/_method.tmpl +5 -6
  288. data/lib/google/apis/options.rb +7 -3
  289. data/lib/google/apis/version.rb +1 -1
  290. data/samples/calendar/calendar.rb +1 -1
  291. data/samples/drive/drive.rb +9 -2
  292. data/samples/pubsub/pubsub.rb +5 -6
  293. data/samples/translate/translate.rb +1 -5
  294. data/script/generate +20 -5
  295. data/spec/fixtures/files/child/.gitignore +0 -0
  296. data/spec/fixtures/files/invalid.json +1 -0
  297. data/spec/google/api_client/client_secrets_spec.rb +38 -1
  298. data/spec/google/apis/core/batch_spec.rb +22 -8
  299. data/spec/google/apis/core/download_spec.rb +13 -0
  300. data/spec/google/apis/core/http_command_spec.rb +26 -9
  301. data/spec/google/apis/core/upload_spec.rb +65 -17
  302. data/spec/google/apis/options_spec.rb +8 -0
  303. data/spec/integration_tests/adsense_spec.rb +28 -0
  304. data/spec/integration_tests/pubsub_spec.rb +3 -3
  305. data/spec/spec_helper.rb +5 -1
  306. data/third_party/hurley_patches.rb +103 -0
  307. metadata +87 -7
@@ -0,0 +1,1541 @@
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 DriveV3
23
+ # Drive API
24
+ #
25
+ # The API to interact with Drive.
26
+ #
27
+ # @example
28
+ # require 'google/apis/drive_v3'
29
+ #
30
+ # Drive = Google::Apis::DriveV3 # 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/v3/')
53
+ end
54
+
55
+ # Gets information about the user, the user's Drive, and system capabilities.
56
+ # @param [String] fields
57
+ # Selector specifying which fields to include in a partial response.
58
+ # @param [String] quota_user
59
+ # Available to use for quota purposes for server-side applications. Can be any
60
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
61
+ # Overrides userIp if both are provided.
62
+ # @param [String] user_ip
63
+ # IP address of the site where the request originates. Use this if you want to
64
+ # enforce per-user limits.
65
+ # @param [Google::Apis::RequestOptions] options
66
+ # Request-specific options
67
+ #
68
+ # @yield [result, err] Result & error if block supplied
69
+ # @yieldparam result [Google::Apis::DriveV3::About] parsed result object
70
+ # @yieldparam err [StandardError] error object if request failed
71
+ #
72
+ # @return [Google::Apis::DriveV3::About]
73
+ #
74
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
75
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
76
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
77
+ def get_about(fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
78
+ command = make_simple_command(:get, 'about', options)
79
+ command.response_representation = Google::Apis::DriveV3::About::Representation
80
+ command.response_class = Google::Apis::DriveV3::About
81
+ command.query['fields'] = fields unless fields.nil?
82
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
83
+ command.query['userIp'] = user_ip unless user_ip.nil?
84
+ execute_or_queue_command(command, &block)
85
+ end
86
+
87
+ # Gets the starting pageToken for listing future changes.
88
+ # @param [String] fields
89
+ # Selector specifying which fields to include in a partial response.
90
+ # @param [String] quota_user
91
+ # Available to use for quota purposes for server-side applications. Can be any
92
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
93
+ # Overrides userIp if both are provided.
94
+ # @param [String] user_ip
95
+ # IP address of the site where the request originates. Use this if you want to
96
+ # enforce per-user limits.
97
+ # @param [Google::Apis::RequestOptions] options
98
+ # Request-specific options
99
+ #
100
+ # @yield [result, err] Result & error if block supplied
101
+ # @yieldparam result [Google::Apis::DriveV3::StartPageToken] parsed result object
102
+ # @yieldparam err [StandardError] error object if request failed
103
+ #
104
+ # @return [Google::Apis::DriveV3::StartPageToken]
105
+ #
106
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
107
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
108
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
109
+ def get_changes_start_page_token(fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
110
+ command = make_simple_command(:get, 'changes/startPageToken', options)
111
+ command.response_representation = Google::Apis::DriveV3::StartPageToken::Representation
112
+ command.response_class = Google::Apis::DriveV3::StartPageToken
113
+ command.query['fields'] = fields unless fields.nil?
114
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
115
+ command.query['userIp'] = user_ip unless user_ip.nil?
116
+ execute_or_queue_command(command, &block)
117
+ end
118
+
119
+ # Lists changes for a user.
120
+ # @param [String] page_token
121
+ # The token for continuing a previous list request on the next page. This should
122
+ # be set to the value of 'nextPageToken' from the previous response or to the
123
+ # response from the getStartPageToken method.
124
+ # @param [Boolean] include_removed
125
+ # Whether to include changes indicating that items have left the view of the
126
+ # changes list, for example by deletion or lost access.
127
+ # @param [Fixnum] page_size
128
+ # The maximum number of changes to return per page.
129
+ # @param [Boolean] restrict_to_my_drive
130
+ # Whether to restrict the results to changes inside the My Drive hierarchy. This
131
+ # omits changes to files such as those in the Application Data folder or shared
132
+ # files which have not been added to My Drive.
133
+ # @param [String] spaces
134
+ # A comma-separated list of spaces to query within the user corpus. Supported
135
+ # values are 'drive', 'appDataFolder' and 'photos'.
136
+ # @param [String] fields
137
+ # Selector specifying which fields to include in a partial response.
138
+ # @param [String] quota_user
139
+ # Available to use for quota purposes for server-side applications. Can be any
140
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
141
+ # Overrides userIp if both are provided.
142
+ # @param [String] user_ip
143
+ # IP address of the site where the request originates. Use this if you want to
144
+ # enforce per-user limits.
145
+ # @param [Google::Apis::RequestOptions] options
146
+ # Request-specific options
147
+ #
148
+ # @yield [result, err] Result & error if block supplied
149
+ # @yieldparam result [Google::Apis::DriveV3::ChangeList] parsed result object
150
+ # @yieldparam err [StandardError] error object if request failed
151
+ #
152
+ # @return [Google::Apis::DriveV3::ChangeList]
153
+ #
154
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
155
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
156
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
157
+ def list_changes(page_token, include_removed: nil, page_size: nil, restrict_to_my_drive: nil, spaces: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
158
+ command = make_simple_command(:get, 'changes', options)
159
+ command.response_representation = Google::Apis::DriveV3::ChangeList::Representation
160
+ command.response_class = Google::Apis::DriveV3::ChangeList
161
+ command.query['includeRemoved'] = include_removed unless include_removed.nil?
162
+ command.query['pageSize'] = page_size unless page_size.nil?
163
+ command.query['pageToken'] = page_token unless page_token.nil?
164
+ command.query['restrictToMyDrive'] = restrict_to_my_drive unless restrict_to_my_drive.nil?
165
+ command.query['spaces'] = spaces unless spaces.nil?
166
+ command.query['fields'] = fields unless fields.nil?
167
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
168
+ command.query['userIp'] = user_ip unless user_ip.nil?
169
+ execute_or_queue_command(command, &block)
170
+ end
171
+
172
+ # Subscribes to changes for a user.
173
+ # @param [String] page_token
174
+ # The token for continuing a previous list request on the next page. This should
175
+ # be set to the value of 'nextPageToken' from the previous response or to the
176
+ # response from the getStartPageToken method.
177
+ # @param [Google::Apis::DriveV3::Channel] channel_object
178
+ # @param [Boolean] include_removed
179
+ # Whether to include changes indicating that items have left the view of the
180
+ # changes list, for example by deletion or lost access.
181
+ # @param [Fixnum] page_size
182
+ # The maximum number of changes to return per page.
183
+ # @param [Boolean] restrict_to_my_drive
184
+ # Whether to restrict the results to changes inside the My Drive hierarchy. This
185
+ # omits changes to files such as those in the Application Data folder or shared
186
+ # files which have not been added to My Drive.
187
+ # @param [String] spaces
188
+ # A comma-separated list of spaces to query within the user corpus. Supported
189
+ # values are 'drive', 'appDataFolder' and 'photos'.
190
+ # @param [String] fields
191
+ # Selector specifying which fields to include in a partial response.
192
+ # @param [String] quota_user
193
+ # Available to use for quota purposes for server-side applications. Can be any
194
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
195
+ # Overrides userIp if both are provided.
196
+ # @param [String] user_ip
197
+ # IP address of the site where the request originates. Use this if you want to
198
+ # enforce per-user limits.
199
+ # @param [Google::Apis::RequestOptions] options
200
+ # Request-specific options
201
+ #
202
+ # @yield [result, err] Result & error if block supplied
203
+ # @yieldparam result [Google::Apis::DriveV3::Channel] parsed result object
204
+ # @yieldparam err [StandardError] error object if request failed
205
+ #
206
+ # @return [Google::Apis::DriveV3::Channel]
207
+ #
208
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
209
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
210
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
211
+ def watch_change(page_token, channel_object = nil, include_removed: nil, page_size: nil, restrict_to_my_drive: nil, spaces: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
212
+ command = make_simple_command(:post, 'changes/watch', options)
213
+ command.request_representation = Google::Apis::DriveV3::Channel::Representation
214
+ command.request_object = channel_object
215
+ command.response_representation = Google::Apis::DriveV3::Channel::Representation
216
+ command.response_class = Google::Apis::DriveV3::Channel
217
+ command.query['includeRemoved'] = include_removed unless include_removed.nil?
218
+ command.query['pageSize'] = page_size unless page_size.nil?
219
+ command.query['pageToken'] = page_token unless page_token.nil?
220
+ command.query['restrictToMyDrive'] = restrict_to_my_drive unless restrict_to_my_drive.nil?
221
+ command.query['spaces'] = spaces unless spaces.nil?
222
+ command.query['fields'] = fields unless fields.nil?
223
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
224
+ command.query['userIp'] = user_ip unless user_ip.nil?
225
+ execute_or_queue_command(command, &block)
226
+ end
227
+
228
+ # Stop watching resources through this channel
229
+ # @param [Google::Apis::DriveV3::Channel] channel_object
230
+ # @param [String] fields
231
+ # Selector specifying which fields to include in a partial response.
232
+ # @param [String] quota_user
233
+ # Available to use for quota purposes for server-side applications. Can be any
234
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
235
+ # Overrides userIp if both are provided.
236
+ # @param [String] user_ip
237
+ # IP address of the site where the request originates. Use this if you want to
238
+ # enforce per-user limits.
239
+ # @param [Google::Apis::RequestOptions] options
240
+ # Request-specific options
241
+ #
242
+ # @yield [result, err] Result & error if block supplied
243
+ # @yieldparam result [NilClass] No result returned for this method
244
+ # @yieldparam err [StandardError] error object if request failed
245
+ #
246
+ # @return [void]
247
+ #
248
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
249
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
250
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
251
+ def stop_channel(channel_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
252
+ command = make_simple_command(:post, 'channels/stop', options)
253
+ command.request_representation = Google::Apis::DriveV3::Channel::Representation
254
+ command.request_object = channel_object
255
+ command.query['fields'] = fields unless fields.nil?
256
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
257
+ command.query['userIp'] = user_ip unless user_ip.nil?
258
+ execute_or_queue_command(command, &block)
259
+ end
260
+
261
+ # Creates a new comment on a file.
262
+ # @param [String] file_id
263
+ # The ID of the file.
264
+ # @param [Google::Apis::DriveV3::Comment] comment_object
265
+ # @param [String] fields
266
+ # Selector specifying which fields to include in a partial response.
267
+ # @param [String] quota_user
268
+ # Available to use for quota purposes for server-side applications. Can be any
269
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
270
+ # Overrides userIp if both are provided.
271
+ # @param [String] user_ip
272
+ # IP address of the site where the request originates. Use this if you want to
273
+ # enforce per-user limits.
274
+ # @param [Google::Apis::RequestOptions] options
275
+ # Request-specific options
276
+ #
277
+ # @yield [result, err] Result & error if block supplied
278
+ # @yieldparam result [Google::Apis::DriveV3::Comment] parsed result object
279
+ # @yieldparam err [StandardError] error object if request failed
280
+ #
281
+ # @return [Google::Apis::DriveV3::Comment]
282
+ #
283
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
284
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
285
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
286
+ def create_comment(file_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
287
+ command = make_simple_command(:post, 'files/{fileId}/comments', options)
288
+ command.request_representation = Google::Apis::DriveV3::Comment::Representation
289
+ command.request_object = comment_object
290
+ command.response_representation = Google::Apis::DriveV3::Comment::Representation
291
+ command.response_class = Google::Apis::DriveV3::Comment
292
+ command.params['fileId'] = file_id unless file_id.nil?
293
+ command.query['fields'] = fields unless fields.nil?
294
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
295
+ command.query['userIp'] = user_ip unless user_ip.nil?
296
+ execute_or_queue_command(command, &block)
297
+ end
298
+
299
+ # Deletes a comment.
300
+ # @param [String] file_id
301
+ # The ID of the file.
302
+ # @param [String] comment_id
303
+ # The ID of the comment.
304
+ # @param [String] fields
305
+ # Selector specifying which fields to include in a partial response.
306
+ # @param [String] quota_user
307
+ # Available to use for quota purposes for server-side applications. Can be any
308
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
309
+ # Overrides userIp if both are provided.
310
+ # @param [String] user_ip
311
+ # IP address of the site where the request originates. Use this if you want to
312
+ # enforce per-user limits.
313
+ # @param [Google::Apis::RequestOptions] options
314
+ # Request-specific options
315
+ #
316
+ # @yield [result, err] Result & error if block supplied
317
+ # @yieldparam result [NilClass] No result returned for this method
318
+ # @yieldparam err [StandardError] error object if request failed
319
+ #
320
+ # @return [void]
321
+ #
322
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
323
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
324
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
325
+ def delete_comment(file_id, comment_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
326
+ command = make_simple_command(:delete, 'files/{fileId}/comments/{commentId}', options)
327
+ command.params['fileId'] = file_id unless file_id.nil?
328
+ command.params['commentId'] = comment_id unless comment_id.nil?
329
+ command.query['fields'] = fields unless fields.nil?
330
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
331
+ command.query['userIp'] = user_ip unless user_ip.nil?
332
+ execute_or_queue_command(command, &block)
333
+ end
334
+
335
+ # Gets a comment by ID.
336
+ # @param [String] file_id
337
+ # The ID of the file.
338
+ # @param [String] comment_id
339
+ # The ID of the comment.
340
+ # @param [Boolean] include_deleted
341
+ # Whether to return deleted comments. Deleted comments will not include their
342
+ # original content.
343
+ # @param [String] fields
344
+ # Selector specifying which fields to include in a partial response.
345
+ # @param [String] quota_user
346
+ # Available to use for quota purposes for server-side applications. Can be any
347
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
348
+ # Overrides userIp if both are provided.
349
+ # @param [String] user_ip
350
+ # IP address of the site where the request originates. Use this if you want to
351
+ # enforce per-user limits.
352
+ # @param [Google::Apis::RequestOptions] options
353
+ # Request-specific options
354
+ #
355
+ # @yield [result, err] Result & error if block supplied
356
+ # @yieldparam result [Google::Apis::DriveV3::Comment] parsed result object
357
+ # @yieldparam err [StandardError] error object if request failed
358
+ #
359
+ # @return [Google::Apis::DriveV3::Comment]
360
+ #
361
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
362
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
363
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
364
+ def get_comment(file_id, comment_id, include_deleted: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
365
+ command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}', options)
366
+ command.response_representation = Google::Apis::DriveV3::Comment::Representation
367
+ command.response_class = Google::Apis::DriveV3::Comment
368
+ command.params['fileId'] = file_id unless file_id.nil?
369
+ command.params['commentId'] = comment_id unless comment_id.nil?
370
+ command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
371
+ command.query['fields'] = fields unless fields.nil?
372
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
373
+ command.query['userIp'] = user_ip unless user_ip.nil?
374
+ execute_or_queue_command(command, &block)
375
+ end
376
+
377
+ # Lists a file's comments.
378
+ # @param [String] file_id
379
+ # The ID of the file.
380
+ # @param [Boolean] include_deleted
381
+ # Whether to include deleted comments. Deleted comments will not include their
382
+ # original content.
383
+ # @param [Fixnum] page_size
384
+ # The maximum number of comments to return per page.
385
+ # @param [String] page_token
386
+ # The token for continuing a previous list request on the next page. This should
387
+ # be set to the value of 'nextPageToken' from the previous response.
388
+ # @param [String] start_modified_time
389
+ # The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-
390
+ # time).
391
+ # @param [String] fields
392
+ # Selector specifying which fields to include in a partial response.
393
+ # @param [String] quota_user
394
+ # Available to use for quota purposes for server-side applications. Can be any
395
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
396
+ # Overrides userIp if both are provided.
397
+ # @param [String] user_ip
398
+ # IP address of the site where the request originates. Use this if you want to
399
+ # enforce per-user limits.
400
+ # @param [Google::Apis::RequestOptions] options
401
+ # Request-specific options
402
+ #
403
+ # @yield [result, err] Result & error if block supplied
404
+ # @yieldparam result [Google::Apis::DriveV3::CommentList] parsed result object
405
+ # @yieldparam err [StandardError] error object if request failed
406
+ #
407
+ # @return [Google::Apis::DriveV3::CommentList]
408
+ #
409
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
410
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
411
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
412
+ def list_comments(file_id, include_deleted: nil, page_size: nil, page_token: nil, start_modified_time: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
413
+ command = make_simple_command(:get, 'files/{fileId}/comments', options)
414
+ command.response_representation = Google::Apis::DriveV3::CommentList::Representation
415
+ command.response_class = Google::Apis::DriveV3::CommentList
416
+ command.params['fileId'] = file_id unless file_id.nil?
417
+ command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
418
+ command.query['pageSize'] = page_size unless page_size.nil?
419
+ command.query['pageToken'] = page_token unless page_token.nil?
420
+ command.query['startModifiedTime'] = start_modified_time unless start_modified_time.nil?
421
+ command.query['fields'] = fields unless fields.nil?
422
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
423
+ command.query['userIp'] = user_ip unless user_ip.nil?
424
+ execute_or_queue_command(command, &block)
425
+ end
426
+
427
+ # Updates a comment with patch semantics.
428
+ # @param [String] file_id
429
+ # The ID of the file.
430
+ # @param [String] comment_id
431
+ # The ID of the comment.
432
+ # @param [Google::Apis::DriveV3::Comment] comment_object
433
+ # @param [String] fields
434
+ # Selector specifying which fields to include in a partial response.
435
+ # @param [String] quota_user
436
+ # Available to use for quota purposes for server-side applications. Can be any
437
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
438
+ # Overrides userIp if both are provided.
439
+ # @param [String] user_ip
440
+ # IP address of the site where the request originates. Use this if you want to
441
+ # enforce per-user limits.
442
+ # @param [Google::Apis::RequestOptions] options
443
+ # Request-specific options
444
+ #
445
+ # @yield [result, err] Result & error if block supplied
446
+ # @yieldparam result [Google::Apis::DriveV3::Comment] parsed result object
447
+ # @yieldparam err [StandardError] error object if request failed
448
+ #
449
+ # @return [Google::Apis::DriveV3::Comment]
450
+ #
451
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
452
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
453
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
454
+ def update_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
455
+ command = make_simple_command(:patch, 'files/{fileId}/comments/{commentId}', options)
456
+ command.request_representation = Google::Apis::DriveV3::Comment::Representation
457
+ command.request_object = comment_object
458
+ command.response_representation = Google::Apis::DriveV3::Comment::Representation
459
+ command.response_class = Google::Apis::DriveV3::Comment
460
+ command.params['fileId'] = file_id unless file_id.nil?
461
+ command.params['commentId'] = comment_id unless comment_id.nil?
462
+ command.query['fields'] = fields unless fields.nil?
463
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
464
+ command.query['userIp'] = user_ip unless user_ip.nil?
465
+ execute_or_queue_command(command, &block)
466
+ end
467
+
468
+ # Creates a copy of a file and applies any requested updates with patch
469
+ # semantics.
470
+ # @param [String] file_id
471
+ # The ID of the file.
472
+ # @param [Google::Apis::DriveV3::File] file_object
473
+ # @param [Boolean] ignore_default_visibility
474
+ # Whether to ignore the domain's default visibility settings for the created
475
+ # file. Domain administrators can choose to make all uploaded files visible to
476
+ # the domain by default; this parameter bypasses that behavior for the request.
477
+ # Permissions are still inherited from parent folders.
478
+ # @param [Boolean] keep_revision_forever
479
+ # Whether to set the 'keepForever' field in the new head revision. This is only
480
+ # applicable to files with binary content in Drive.
481
+ # @param [String] ocr_language
482
+ # A language hint for OCR processing during image import (ISO 639-1 code).
483
+ # @param [String] fields
484
+ # Selector specifying which fields to include in a partial response.
485
+ # @param [String] quota_user
486
+ # Available to use for quota purposes for server-side applications. Can be any
487
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
488
+ # Overrides userIp if both are provided.
489
+ # @param [String] user_ip
490
+ # IP address of the site where the request originates. Use this if you want to
491
+ # enforce per-user limits.
492
+ # @param [Google::Apis::RequestOptions] options
493
+ # Request-specific options
494
+ #
495
+ # @yield [result, err] Result & error if block supplied
496
+ # @yieldparam result [Google::Apis::DriveV3::File] parsed result object
497
+ # @yieldparam err [StandardError] error object if request failed
498
+ #
499
+ # @return [Google::Apis::DriveV3::File]
500
+ #
501
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
502
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
503
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
504
+ def copy_file(file_id, file_object = nil, ignore_default_visibility: nil, keep_revision_forever: nil, ocr_language: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
505
+ command = make_simple_command(:post, 'files/{fileId}/copy', options)
506
+ command.request_representation = Google::Apis::DriveV3::File::Representation
507
+ command.request_object = file_object
508
+ command.response_representation = Google::Apis::DriveV3::File::Representation
509
+ command.response_class = Google::Apis::DriveV3::File
510
+ command.params['fileId'] = file_id unless file_id.nil?
511
+ command.query['ignoreDefaultVisibility'] = ignore_default_visibility unless ignore_default_visibility.nil?
512
+ command.query['keepRevisionForever'] = keep_revision_forever unless keep_revision_forever.nil?
513
+ command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
514
+ command.query['fields'] = fields unless fields.nil?
515
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
516
+ command.query['userIp'] = user_ip unless user_ip.nil?
517
+ execute_or_queue_command(command, &block)
518
+ end
519
+
520
+ # Creates a new file.
521
+ # @param [Google::Apis::DriveV3::File] file_object
522
+ # @param [Boolean] ignore_default_visibility
523
+ # Whether to ignore the domain's default visibility settings for the created
524
+ # file. Domain administrators can choose to make all uploaded files visible to
525
+ # the domain by default; this parameter bypasses that behavior for the request.
526
+ # Permissions are still inherited from parent folders.
527
+ # @param [Boolean] keep_revision_forever
528
+ # Whether to set the 'keepForever' field in the new head revision. This is only
529
+ # applicable to files with binary content in Drive.
530
+ # @param [String] ocr_language
531
+ # A language hint for OCR processing during image import (ISO 639-1 code).
532
+ # @param [Boolean] use_content_as_indexable_text
533
+ # Whether to use the uploaded content as indexable text.
534
+ # @param [String] fields
535
+ # Selector specifying which fields to include in a partial response.
536
+ # @param [String] quota_user
537
+ # Available to use for quota purposes for server-side applications. Can be any
538
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
539
+ # Overrides userIp if both are provided.
540
+ # @param [String] user_ip
541
+ # IP address of the site where the request originates. Use this if you want to
542
+ # enforce per-user limits.
543
+ # @param [IO, String] upload_source
544
+ # IO stream or filename containing content to upload
545
+ # @param [String] content_type
546
+ # Content type of the uploaded content.
547
+ # @param [Google::Apis::RequestOptions] options
548
+ # Request-specific options
549
+ #
550
+ # @yield [result, err] Result & error if block supplied
551
+ # @yieldparam result [Google::Apis::DriveV3::File] parsed result object
552
+ # @yieldparam err [StandardError] error object if request failed
553
+ #
554
+ # @return [Google::Apis::DriveV3::File]
555
+ #
556
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
557
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
558
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
559
+ def create_file(file_object = nil, ignore_default_visibility: nil, keep_revision_forever: nil, ocr_language: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
560
+ if upload_source.nil?
561
+ command = make_simple_command(:post, 'files', options)
562
+ else
563
+ command = make_upload_command(:post, 'files', options)
564
+ command.upload_source = upload_source
565
+ command.upload_content_type = content_type
566
+ end
567
+ command.request_representation = Google::Apis::DriveV3::File::Representation
568
+ command.request_object = file_object
569
+ command.response_representation = Google::Apis::DriveV3::File::Representation
570
+ command.response_class = Google::Apis::DriveV3::File
571
+ command.query['ignoreDefaultVisibility'] = ignore_default_visibility unless ignore_default_visibility.nil?
572
+ command.query['keepRevisionForever'] = keep_revision_forever unless keep_revision_forever.nil?
573
+ command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
574
+ command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil?
575
+ command.query['fields'] = fields unless fields.nil?
576
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
577
+ command.query['userIp'] = user_ip unless user_ip.nil?
578
+ execute_or_queue_command(command, &block)
579
+ end
580
+
581
+ # Permanently deletes a file owned by the user without moving it to the trash.
582
+ # If the target is a folder, all descendants owned by the user are also deleted.
583
+ # @param [String] file_id
584
+ # The ID of the file.
585
+ # @param [String] fields
586
+ # Selector specifying which fields to include in a partial response.
587
+ # @param [String] quota_user
588
+ # Available to use for quota purposes for server-side applications. Can be any
589
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
590
+ # Overrides userIp if both are provided.
591
+ # @param [String] user_ip
592
+ # IP address of the site where the request originates. Use this if you want to
593
+ # enforce per-user limits.
594
+ # @param [Google::Apis::RequestOptions] options
595
+ # Request-specific options
596
+ #
597
+ # @yield [result, err] Result & error if block supplied
598
+ # @yieldparam result [NilClass] No result returned for this method
599
+ # @yieldparam err [StandardError] error object if request failed
600
+ #
601
+ # @return [void]
602
+ #
603
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
604
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
605
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
606
+ def delete_file(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
607
+ command = make_simple_command(:delete, 'files/{fileId}', options)
608
+ command.params['fileId'] = file_id unless file_id.nil?
609
+ command.query['fields'] = fields unless fields.nil?
610
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
611
+ command.query['userIp'] = user_ip unless user_ip.nil?
612
+ execute_or_queue_command(command, &block)
613
+ end
614
+
615
+ # Permanently deletes all of the user's trashed files.
616
+ # @param [String] fields
617
+ # Selector specifying which fields to include in a partial response.
618
+ # @param [String] quota_user
619
+ # Available to use for quota purposes for server-side applications. Can be any
620
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
621
+ # Overrides userIp if both are provided.
622
+ # @param [String] user_ip
623
+ # IP address of the site where the request originates. Use this if you want to
624
+ # enforce per-user limits.
625
+ # @param [Google::Apis::RequestOptions] options
626
+ # Request-specific options
627
+ #
628
+ # @yield [result, err] Result & error if block supplied
629
+ # @yieldparam result [NilClass] No result returned for this method
630
+ # @yieldparam err [StandardError] error object if request failed
631
+ #
632
+ # @return [void]
633
+ #
634
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
635
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
636
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
637
+ def empty_file_trash(fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
638
+ command = make_simple_command(:delete, 'files/trash', options)
639
+ command.query['fields'] = fields unless fields.nil?
640
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
641
+ command.query['userIp'] = user_ip unless user_ip.nil?
642
+ execute_or_queue_command(command, &block)
643
+ end
644
+
645
+ # Exports a Google Doc to the requested MIME type.
646
+ # @param [String] file_id
647
+ # The ID of the file.
648
+ # @param [String] mime_type
649
+ # The MIME type of the format requested for this export.
650
+ # @param [String] fields
651
+ # Selector specifying which fields to include in a partial response.
652
+ # @param [String] quota_user
653
+ # Available to use for quota purposes for server-side applications. Can be any
654
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
655
+ # Overrides userIp if both are provided.
656
+ # @param [String] user_ip
657
+ # IP address of the site where the request originates. Use this if you want to
658
+ # enforce per-user limits.
659
+ # @param [IO, String] download_dest
660
+ # IO stream or filename to receive content download
661
+ # @param [Google::Apis::RequestOptions] options
662
+ # Request-specific options
663
+ #
664
+ # @yield [result, err] Result & error if block supplied
665
+ # @yieldparam result [NilClass] No result returned for this method
666
+ # @yieldparam err [StandardError] error object if request failed
667
+ #
668
+ # @return [void]
669
+ #
670
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
671
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
672
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
673
+ def export_file(file_id, mime_type, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
674
+ if download_dest.nil?
675
+ command = make_simple_command(:get, 'files/{fileId}/export', options)
676
+ else
677
+ command = make_download_command(:get, 'files/{fileId}/export', options)
678
+ command.download_dest = download_dest
679
+ end
680
+ command.params['fileId'] = file_id unless file_id.nil?
681
+ command.query['mimeType'] = mime_type unless mime_type.nil?
682
+ command.query['fields'] = fields unless fields.nil?
683
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
684
+ command.query['userIp'] = user_ip unless user_ip.nil?
685
+ execute_or_queue_command(command, &block)
686
+ end
687
+
688
+ # Generates a set of file IDs which can be provided in create requests.
689
+ # @param [Fixnum] count
690
+ # The number of IDs to return.
691
+ # @param [String] space
692
+ # The space in which the IDs can be used to create new files. Supported values
693
+ # are 'drive' and 'appDataFolder'.
694
+ # @param [String] fields
695
+ # Selector specifying which fields to include in a partial response.
696
+ # @param [String] quota_user
697
+ # Available to use for quota purposes for server-side applications. Can be any
698
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
699
+ # Overrides userIp if both are provided.
700
+ # @param [String] user_ip
701
+ # IP address of the site where the request originates. Use this if you want to
702
+ # enforce per-user limits.
703
+ # @param [Google::Apis::RequestOptions] options
704
+ # Request-specific options
705
+ #
706
+ # @yield [result, err] Result & error if block supplied
707
+ # @yieldparam result [Google::Apis::DriveV3::GeneratedIds] parsed result object
708
+ # @yieldparam err [StandardError] error object if request failed
709
+ #
710
+ # @return [Google::Apis::DriveV3::GeneratedIds]
711
+ #
712
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
713
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
714
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
715
+ def generate_file_ids(count: nil, space: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
716
+ command = make_simple_command(:get, 'files/generateIds', options)
717
+ command.response_representation = Google::Apis::DriveV3::GeneratedIds::Representation
718
+ command.response_class = Google::Apis::DriveV3::GeneratedIds
719
+ command.query['count'] = count unless count.nil?
720
+ command.query['space'] = space unless space.nil?
721
+ command.query['fields'] = fields unless fields.nil?
722
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
723
+ command.query['userIp'] = user_ip unless user_ip.nil?
724
+ execute_or_queue_command(command, &block)
725
+ end
726
+
727
+ # Gets a file's metadata or content by ID.
728
+ # @param [String] file_id
729
+ # The ID of the file.
730
+ # @param [Boolean] acknowledge_abuse
731
+ # Whether the user is acknowledging the risk of downloading known malware or
732
+ # other abusive files. This is only applicable when alt=media.
733
+ # @param [String] fields
734
+ # Selector specifying which fields to include in a partial response.
735
+ # @param [String] quota_user
736
+ # Available to use for quota purposes for server-side applications. Can be any
737
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
738
+ # Overrides userIp if both are provided.
739
+ # @param [String] user_ip
740
+ # IP address of the site where the request originates. Use this if you want to
741
+ # enforce per-user limits.
742
+ # @param [IO, String] download_dest
743
+ # IO stream or filename to receive content download
744
+ # @param [Google::Apis::RequestOptions] options
745
+ # Request-specific options
746
+ #
747
+ # @yield [result, err] Result & error if block supplied
748
+ # @yieldparam result [Google::Apis::DriveV3::File] parsed result object
749
+ # @yieldparam err [StandardError] error object if request failed
750
+ #
751
+ # @return [Google::Apis::DriveV3::File]
752
+ #
753
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
754
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
755
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
756
+ def get_file(file_id, acknowledge_abuse: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
757
+ if download_dest.nil?
758
+ command = make_simple_command(:get, 'files/{fileId}', options)
759
+ else
760
+ command = make_download_command(:get, 'files/{fileId}', options)
761
+ command.download_dest = download_dest
762
+ end
763
+ command.response_representation = Google::Apis::DriveV3::File::Representation
764
+ command.response_class = Google::Apis::DriveV3::File
765
+ command.params['fileId'] = file_id unless file_id.nil?
766
+ command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.nil?
767
+ command.query['fields'] = fields unless fields.nil?
768
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
769
+ command.query['userIp'] = user_ip unless user_ip.nil?
770
+ execute_or_queue_command(command, &block)
771
+ end
772
+
773
+ # Lists or searches files.
774
+ # @param [String] corpus
775
+ # The source of files to list.
776
+ # @param [String] order_by
777
+ # A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', '
778
+ # modifiedByMeTime', 'modifiedTime', 'name', 'quotaBytesUsed', 'recency', '
779
+ # sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending
780
+ # by default, but may be reversed with the 'desc' modifier. Example usage: ?
781
+ # orderBy=folder,modifiedTime desc,name. Please note that there is a current
782
+ # limitation for users with approximately one million files in which the
783
+ # requested sort order is ignored.
784
+ # @param [Fixnum] page_size
785
+ # The maximum number of files to return per page.
786
+ # @param [String] page_token
787
+ # The token for continuing a previous list request on the next page. This should
788
+ # be set to the value of 'nextPageToken' from the previous response.
789
+ # @param [String] q
790
+ # A query for filtering the file results. See the "Search for Files" guide for
791
+ # supported syntax.
792
+ # @param [String] spaces
793
+ # A comma-separated list of spaces to query within the corpus. Supported values
794
+ # are 'drive', 'appDataFolder' and 'photos'.
795
+ # @param [String] fields
796
+ # Selector specifying which fields to include in a partial response.
797
+ # @param [String] quota_user
798
+ # Available to use for quota purposes for server-side applications. Can be any
799
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
800
+ # Overrides userIp if both are provided.
801
+ # @param [String] user_ip
802
+ # IP address of the site where the request originates. Use this if you want to
803
+ # enforce per-user limits.
804
+ # @param [Google::Apis::RequestOptions] options
805
+ # Request-specific options
806
+ #
807
+ # @yield [result, err] Result & error if block supplied
808
+ # @yieldparam result [Google::Apis::DriveV3::FileList] parsed result object
809
+ # @yieldparam err [StandardError] error object if request failed
810
+ #
811
+ # @return [Google::Apis::DriveV3::FileList]
812
+ #
813
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
814
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
815
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
816
+ def list_files(corpus: nil, order_by: nil, page_size: nil, page_token: nil, q: nil, spaces: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
817
+ command = make_simple_command(:get, 'files', options)
818
+ command.response_representation = Google::Apis::DriveV3::FileList::Representation
819
+ command.response_class = Google::Apis::DriveV3::FileList
820
+ command.query['corpus'] = corpus unless corpus.nil?
821
+ command.query['orderBy'] = order_by unless order_by.nil?
822
+ command.query['pageSize'] = page_size unless page_size.nil?
823
+ command.query['pageToken'] = page_token unless page_token.nil?
824
+ command.query['q'] = q unless q.nil?
825
+ command.query['spaces'] = spaces unless spaces.nil?
826
+ command.query['fields'] = fields unless fields.nil?
827
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
828
+ command.query['userIp'] = user_ip unless user_ip.nil?
829
+ execute_or_queue_command(command, &block)
830
+ end
831
+
832
+ # Updates a file's metadata and/or content with patch semantics.
833
+ # @param [String] file_id
834
+ # The ID of the file.
835
+ # @param [Google::Apis::DriveV3::File] file_object
836
+ # @param [String] add_parents
837
+ # A comma-separated list of parent IDs to add.
838
+ # @param [Boolean] keep_revision_forever
839
+ # Whether to set the 'keepForever' field in the new head revision. This is only
840
+ # applicable to files with binary content in Drive.
841
+ # @param [String] ocr_language
842
+ # A language hint for OCR processing during image import (ISO 639-1 code).
843
+ # @param [String] remove_parents
844
+ # A comma-separated list of parent IDs to remove.
845
+ # @param [Boolean] use_content_as_indexable_text
846
+ # Whether to use the uploaded content as indexable text.
847
+ # @param [String] fields
848
+ # Selector specifying which fields to include in a partial response.
849
+ # @param [String] quota_user
850
+ # Available to use for quota purposes for server-side applications. Can be any
851
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
852
+ # Overrides userIp if both are provided.
853
+ # @param [String] user_ip
854
+ # IP address of the site where the request originates. Use this if you want to
855
+ # enforce per-user limits.
856
+ # @param [IO, String] upload_source
857
+ # IO stream or filename containing content to upload
858
+ # @param [String] content_type
859
+ # Content type of the uploaded content.
860
+ # @param [Google::Apis::RequestOptions] options
861
+ # Request-specific options
862
+ #
863
+ # @yield [result, err] Result & error if block supplied
864
+ # @yieldparam result [Google::Apis::DriveV3::File] parsed result object
865
+ # @yieldparam err [StandardError] error object if request failed
866
+ #
867
+ # @return [Google::Apis::DriveV3::File]
868
+ #
869
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
870
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
871
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
872
+ def update_file(file_id, file_object = nil, add_parents: nil, keep_revision_forever: nil, ocr_language: nil, remove_parents: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
873
+ if upload_source.nil?
874
+ command = make_simple_command(:patch, 'files/{fileId}', options)
875
+ else
876
+ command = make_upload_command(:patch, 'files/{fileId}', options)
877
+ command.upload_source = upload_source
878
+ command.upload_content_type = content_type
879
+ end
880
+ command.request_representation = Google::Apis::DriveV3::File::Representation
881
+ command.request_object = file_object
882
+ command.response_representation = Google::Apis::DriveV3::File::Representation
883
+ command.response_class = Google::Apis::DriveV3::File
884
+ command.params['fileId'] = file_id unless file_id.nil?
885
+ command.query['addParents'] = add_parents unless add_parents.nil?
886
+ command.query['keepRevisionForever'] = keep_revision_forever unless keep_revision_forever.nil?
887
+ command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
888
+ command.query['removeParents'] = remove_parents unless remove_parents.nil?
889
+ command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil?
890
+ command.query['fields'] = fields unless fields.nil?
891
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
892
+ command.query['userIp'] = user_ip unless user_ip.nil?
893
+ execute_or_queue_command(command, &block)
894
+ end
895
+
896
+ # Subscribes to changes to a file
897
+ # @param [String] file_id
898
+ # The ID of the file.
899
+ # @param [Google::Apis::DriveV3::Channel] channel_object
900
+ # @param [Boolean] acknowledge_abuse
901
+ # Whether the user is acknowledging the risk of downloading known malware or
902
+ # other abusive files. This is only applicable when alt=media.
903
+ # @param [String] fields
904
+ # Selector specifying which fields to include in a partial response.
905
+ # @param [String] quota_user
906
+ # Available to use for quota purposes for server-side applications. Can be any
907
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
908
+ # Overrides userIp if both are provided.
909
+ # @param [String] user_ip
910
+ # IP address of the site where the request originates. Use this if you want to
911
+ # enforce per-user limits.
912
+ # @param [IO, String] download_dest
913
+ # IO stream or filename to receive content download
914
+ # @param [Google::Apis::RequestOptions] options
915
+ # Request-specific options
916
+ #
917
+ # @yield [result, err] Result & error if block supplied
918
+ # @yieldparam result [Google::Apis::DriveV3::Channel] parsed result object
919
+ # @yieldparam err [StandardError] error object if request failed
920
+ #
921
+ # @return [Google::Apis::DriveV3::Channel]
922
+ #
923
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
924
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
925
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
926
+ def watch_file(file_id, channel_object = nil, acknowledge_abuse: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
927
+ if download_dest.nil?
928
+ command = make_simple_command(:post, 'files/{fileId}/watch', options)
929
+ else
930
+ command = make_download_command(:post, 'files/{fileId}/watch', options)
931
+ command.download_dest = download_dest
932
+ end
933
+ command.request_representation = Google::Apis::DriveV3::Channel::Representation
934
+ command.request_object = channel_object
935
+ command.response_representation = Google::Apis::DriveV3::Channel::Representation
936
+ command.response_class = Google::Apis::DriveV3::Channel
937
+ command.params['fileId'] = file_id unless file_id.nil?
938
+ command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.nil?
939
+ command.query['fields'] = fields unless fields.nil?
940
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
941
+ command.query['userIp'] = user_ip unless user_ip.nil?
942
+ execute_or_queue_command(command, &block)
943
+ end
944
+
945
+ # Creates a permission for a file.
946
+ # @param [String] file_id
947
+ # The ID of the file.
948
+ # @param [Google::Apis::DriveV3::Permission] permission_object
949
+ # @param [String] email_message
950
+ # A custom message to include in the notification email.
951
+ # @param [Boolean] send_notification_email
952
+ # Whether to send a notification email when sharing to users or groups. This
953
+ # defaults to true for users and groups, and is not allowed for other requests.
954
+ # It must not be disabled for ownership transfers.
955
+ # @param [Boolean] transfer_ownership
956
+ # Whether to transfer ownership to the specified user and downgrade the current
957
+ # owner to a writer. This parameter is required as an acknowledgement of the
958
+ # side effect.
959
+ # @param [String] fields
960
+ # Selector specifying which fields to include in a partial response.
961
+ # @param [String] quota_user
962
+ # Available to use for quota purposes for server-side applications. Can be any
963
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
964
+ # Overrides userIp if both are provided.
965
+ # @param [String] user_ip
966
+ # IP address of the site where the request originates. Use this if you want to
967
+ # enforce per-user limits.
968
+ # @param [Google::Apis::RequestOptions] options
969
+ # Request-specific options
970
+ #
971
+ # @yield [result, err] Result & error if block supplied
972
+ # @yieldparam result [Google::Apis::DriveV3::Permission] parsed result object
973
+ # @yieldparam err [StandardError] error object if request failed
974
+ #
975
+ # @return [Google::Apis::DriveV3::Permission]
976
+ #
977
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
978
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
979
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
980
+ def create_permission(file_id, permission_object = nil, email_message: nil, send_notification_email: nil, transfer_ownership: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
981
+ command = make_simple_command(:post, 'files/{fileId}/permissions', options)
982
+ command.request_representation = Google::Apis::DriveV3::Permission::Representation
983
+ command.request_object = permission_object
984
+ command.response_representation = Google::Apis::DriveV3::Permission::Representation
985
+ command.response_class = Google::Apis::DriveV3::Permission
986
+ command.params['fileId'] = file_id unless file_id.nil?
987
+ command.query['emailMessage'] = email_message unless email_message.nil?
988
+ command.query['sendNotificationEmail'] = send_notification_email unless send_notification_email.nil?
989
+ command.query['transferOwnership'] = transfer_ownership unless transfer_ownership.nil?
990
+ command.query['fields'] = fields unless fields.nil?
991
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
992
+ command.query['userIp'] = user_ip unless user_ip.nil?
993
+ execute_or_queue_command(command, &block)
994
+ end
995
+
996
+ # Deletes a permission.
997
+ # @param [String] file_id
998
+ # The ID of the file.
999
+ # @param [String] permission_id
1000
+ # The ID of the permission.
1001
+ # @param [String] fields
1002
+ # Selector specifying which fields to include in a partial response.
1003
+ # @param [String] quota_user
1004
+ # Available to use for quota purposes for server-side applications. Can be any
1005
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1006
+ # Overrides userIp if both are provided.
1007
+ # @param [String] user_ip
1008
+ # IP address of the site where the request originates. Use this if you want to
1009
+ # enforce per-user limits.
1010
+ # @param [Google::Apis::RequestOptions] options
1011
+ # Request-specific options
1012
+ #
1013
+ # @yield [result, err] Result & error if block supplied
1014
+ # @yieldparam result [NilClass] No result returned for this method
1015
+ # @yieldparam err [StandardError] error object if request failed
1016
+ #
1017
+ # @return [void]
1018
+ #
1019
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1020
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1021
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1022
+ def delete_permission(file_id, permission_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1023
+ command = make_simple_command(:delete, 'files/{fileId}/permissions/{permissionId}', options)
1024
+ command.params['fileId'] = file_id unless file_id.nil?
1025
+ command.params['permissionId'] = permission_id unless permission_id.nil?
1026
+ command.query['fields'] = fields unless fields.nil?
1027
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1028
+ command.query['userIp'] = user_ip unless user_ip.nil?
1029
+ execute_or_queue_command(command, &block)
1030
+ end
1031
+
1032
+ # Gets a permission by ID.
1033
+ # @param [String] file_id
1034
+ # The ID of the file.
1035
+ # @param [String] permission_id
1036
+ # The ID of the permission.
1037
+ # @param [String] fields
1038
+ # Selector specifying which fields to include in a partial response.
1039
+ # @param [String] quota_user
1040
+ # Available to use for quota purposes for server-side applications. Can be any
1041
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1042
+ # Overrides userIp if both are provided.
1043
+ # @param [String] user_ip
1044
+ # IP address of the site where the request originates. Use this if you want to
1045
+ # enforce per-user limits.
1046
+ # @param [Google::Apis::RequestOptions] options
1047
+ # Request-specific options
1048
+ #
1049
+ # @yield [result, err] Result & error if block supplied
1050
+ # @yieldparam result [Google::Apis::DriveV3::Permission] parsed result object
1051
+ # @yieldparam err [StandardError] error object if request failed
1052
+ #
1053
+ # @return [Google::Apis::DriveV3::Permission]
1054
+ #
1055
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1056
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1057
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1058
+ def get_permission(file_id, permission_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1059
+ command = make_simple_command(:get, 'files/{fileId}/permissions/{permissionId}', options)
1060
+ command.response_representation = Google::Apis::DriveV3::Permission::Representation
1061
+ command.response_class = Google::Apis::DriveV3::Permission
1062
+ command.params['fileId'] = file_id unless file_id.nil?
1063
+ command.params['permissionId'] = permission_id unless permission_id.nil?
1064
+ command.query['fields'] = fields unless fields.nil?
1065
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1066
+ command.query['userIp'] = user_ip unless user_ip.nil?
1067
+ execute_or_queue_command(command, &block)
1068
+ end
1069
+
1070
+ # Lists a file's permissions.
1071
+ # @param [String] file_id
1072
+ # The ID of the file.
1073
+ # @param [String] fields
1074
+ # Selector specifying which fields to include in a partial response.
1075
+ # @param [String] quota_user
1076
+ # Available to use for quota purposes for server-side applications. Can be any
1077
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1078
+ # Overrides userIp if both are provided.
1079
+ # @param [String] user_ip
1080
+ # IP address of the site where the request originates. Use this if you want to
1081
+ # enforce per-user limits.
1082
+ # @param [Google::Apis::RequestOptions] options
1083
+ # Request-specific options
1084
+ #
1085
+ # @yield [result, err] Result & error if block supplied
1086
+ # @yieldparam result [Google::Apis::DriveV3::PermissionList] parsed result object
1087
+ # @yieldparam err [StandardError] error object if request failed
1088
+ #
1089
+ # @return [Google::Apis::DriveV3::PermissionList]
1090
+ #
1091
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1092
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1093
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1094
+ def list_permissions(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1095
+ command = make_simple_command(:get, 'files/{fileId}/permissions', options)
1096
+ command.response_representation = Google::Apis::DriveV3::PermissionList::Representation
1097
+ command.response_class = Google::Apis::DriveV3::PermissionList
1098
+ command.params['fileId'] = file_id unless file_id.nil?
1099
+ command.query['fields'] = fields unless fields.nil?
1100
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1101
+ command.query['userIp'] = user_ip unless user_ip.nil?
1102
+ execute_or_queue_command(command, &block)
1103
+ end
1104
+
1105
+ # Updates a permission with patch semantics.
1106
+ # @param [String] file_id
1107
+ # The ID of the file.
1108
+ # @param [String] permission_id
1109
+ # The ID of the permission.
1110
+ # @param [Google::Apis::DriveV3::Permission] permission_object
1111
+ # @param [Boolean] transfer_ownership
1112
+ # Whether to transfer ownership to the specified user and downgrade the current
1113
+ # owner to a writer. This parameter is required as an acknowledgement of the
1114
+ # side effect.
1115
+ # @param [String] fields
1116
+ # Selector specifying which fields to include in a partial response.
1117
+ # @param [String] quota_user
1118
+ # Available to use for quota purposes for server-side applications. Can be any
1119
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1120
+ # Overrides userIp if both are provided.
1121
+ # @param [String] user_ip
1122
+ # IP address of the site where the request originates. Use this if you want to
1123
+ # enforce per-user limits.
1124
+ # @param [Google::Apis::RequestOptions] options
1125
+ # Request-specific options
1126
+ #
1127
+ # @yield [result, err] Result & error if block supplied
1128
+ # @yieldparam result [Google::Apis::DriveV3::Permission] parsed result object
1129
+ # @yieldparam err [StandardError] error object if request failed
1130
+ #
1131
+ # @return [Google::Apis::DriveV3::Permission]
1132
+ #
1133
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1134
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1135
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1136
+ def update_permission(file_id, permission_id, permission_object = nil, transfer_ownership: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1137
+ command = make_simple_command(:patch, 'files/{fileId}/permissions/{permissionId}', options)
1138
+ command.request_representation = Google::Apis::DriveV3::Permission::Representation
1139
+ command.request_object = permission_object
1140
+ command.response_representation = Google::Apis::DriveV3::Permission::Representation
1141
+ command.response_class = Google::Apis::DriveV3::Permission
1142
+ command.params['fileId'] = file_id unless file_id.nil?
1143
+ command.params['permissionId'] = permission_id unless permission_id.nil?
1144
+ command.query['transferOwnership'] = transfer_ownership unless transfer_ownership.nil?
1145
+ command.query['fields'] = fields unless fields.nil?
1146
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1147
+ command.query['userIp'] = user_ip unless user_ip.nil?
1148
+ execute_or_queue_command(command, &block)
1149
+ end
1150
+
1151
+ # Creates a new reply to a comment.
1152
+ # @param [String] file_id
1153
+ # The ID of the file.
1154
+ # @param [String] comment_id
1155
+ # The ID of the comment.
1156
+ # @param [Google::Apis::DriveV3::Reply] reply_object
1157
+ # @param [String] fields
1158
+ # Selector specifying which fields to include in a partial response.
1159
+ # @param [String] quota_user
1160
+ # Available to use for quota purposes for server-side applications. Can be any
1161
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1162
+ # Overrides userIp if both are provided.
1163
+ # @param [String] user_ip
1164
+ # IP address of the site where the request originates. Use this if you want to
1165
+ # enforce per-user limits.
1166
+ # @param [Google::Apis::RequestOptions] options
1167
+ # Request-specific options
1168
+ #
1169
+ # @yield [result, err] Result & error if block supplied
1170
+ # @yieldparam result [Google::Apis::DriveV3::Reply] parsed result object
1171
+ # @yieldparam err [StandardError] error object if request failed
1172
+ #
1173
+ # @return [Google::Apis::DriveV3::Reply]
1174
+ #
1175
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1176
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1177
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1178
+ def create_reply(file_id, comment_id, reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1179
+ command = make_simple_command(:post, 'files/{fileId}/comments/{commentId}/replies', options)
1180
+ command.request_representation = Google::Apis::DriveV3::Reply::Representation
1181
+ command.request_object = reply_object
1182
+ command.response_representation = Google::Apis::DriveV3::Reply::Representation
1183
+ command.response_class = Google::Apis::DriveV3::Reply
1184
+ command.params['fileId'] = file_id unless file_id.nil?
1185
+ command.params['commentId'] = comment_id unless comment_id.nil?
1186
+ command.query['fields'] = fields unless fields.nil?
1187
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1188
+ command.query['userIp'] = user_ip unless user_ip.nil?
1189
+ execute_or_queue_command(command, &block)
1190
+ end
1191
+
1192
+ # Deletes a reply.
1193
+ # @param [String] file_id
1194
+ # The ID of the file.
1195
+ # @param [String] comment_id
1196
+ # The ID of the comment.
1197
+ # @param [String] reply_id
1198
+ # The ID of the reply.
1199
+ # @param [String] fields
1200
+ # Selector specifying which fields to include in a partial response.
1201
+ # @param [String] quota_user
1202
+ # Available to use for quota purposes for server-side applications. Can be any
1203
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1204
+ # Overrides userIp if both are provided.
1205
+ # @param [String] user_ip
1206
+ # IP address of the site where the request originates. Use this if you want to
1207
+ # enforce per-user limits.
1208
+ # @param [Google::Apis::RequestOptions] options
1209
+ # Request-specific options
1210
+ #
1211
+ # @yield [result, err] Result & error if block supplied
1212
+ # @yieldparam result [NilClass] No result returned for this method
1213
+ # @yieldparam err [StandardError] error object if request failed
1214
+ #
1215
+ # @return [void]
1216
+ #
1217
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1218
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1219
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1220
+ def delete_reply(file_id, comment_id, reply_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1221
+ command = make_simple_command(:delete, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
1222
+ command.params['fileId'] = file_id unless file_id.nil?
1223
+ command.params['commentId'] = comment_id unless comment_id.nil?
1224
+ command.params['replyId'] = reply_id unless reply_id.nil?
1225
+ command.query['fields'] = fields unless fields.nil?
1226
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1227
+ command.query['userIp'] = user_ip unless user_ip.nil?
1228
+ execute_or_queue_command(command, &block)
1229
+ end
1230
+
1231
+ # Gets a reply by ID.
1232
+ # @param [String] file_id
1233
+ # The ID of the file.
1234
+ # @param [String] comment_id
1235
+ # The ID of the comment.
1236
+ # @param [String] reply_id
1237
+ # The ID of the reply.
1238
+ # @param [Boolean] include_deleted
1239
+ # Whether to return deleted replies. Deleted replies will not include their
1240
+ # original content.
1241
+ # @param [String] fields
1242
+ # Selector specifying which fields to include in a partial response.
1243
+ # @param [String] quota_user
1244
+ # Available to use for quota purposes for server-side applications. Can be any
1245
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1246
+ # Overrides userIp if both are provided.
1247
+ # @param [String] user_ip
1248
+ # IP address of the site where the request originates. Use this if you want to
1249
+ # enforce per-user limits.
1250
+ # @param [Google::Apis::RequestOptions] options
1251
+ # Request-specific options
1252
+ #
1253
+ # @yield [result, err] Result & error if block supplied
1254
+ # @yieldparam result [Google::Apis::DriveV3::Reply] parsed result object
1255
+ # @yieldparam err [StandardError] error object if request failed
1256
+ #
1257
+ # @return [Google::Apis::DriveV3::Reply]
1258
+ #
1259
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1260
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1261
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1262
+ def get_reply(file_id, comment_id, reply_id, include_deleted: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1263
+ command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
1264
+ command.response_representation = Google::Apis::DriveV3::Reply::Representation
1265
+ command.response_class = Google::Apis::DriveV3::Reply
1266
+ command.params['fileId'] = file_id unless file_id.nil?
1267
+ command.params['commentId'] = comment_id unless comment_id.nil?
1268
+ command.params['replyId'] = reply_id unless reply_id.nil?
1269
+ command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
1270
+ command.query['fields'] = fields unless fields.nil?
1271
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1272
+ command.query['userIp'] = user_ip unless user_ip.nil?
1273
+ execute_or_queue_command(command, &block)
1274
+ end
1275
+
1276
+ # Lists a comment's replies.
1277
+ # @param [String] file_id
1278
+ # The ID of the file.
1279
+ # @param [String] comment_id
1280
+ # The ID of the comment.
1281
+ # @param [Boolean] include_deleted
1282
+ # Whether to include deleted replies. Deleted replies will not include their
1283
+ # original content.
1284
+ # @param [Fixnum] page_size
1285
+ # The maximum number of replies to return per page.
1286
+ # @param [String] page_token
1287
+ # The token for continuing a previous list request on the next page. This should
1288
+ # be set to the value of 'nextPageToken' from the previous response.
1289
+ # @param [String] fields
1290
+ # Selector specifying which fields to include in a partial response.
1291
+ # @param [String] quota_user
1292
+ # Available to use for quota purposes for server-side applications. Can be any
1293
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1294
+ # Overrides userIp if both are provided.
1295
+ # @param [String] user_ip
1296
+ # IP address of the site where the request originates. Use this if you want to
1297
+ # enforce per-user limits.
1298
+ # @param [Google::Apis::RequestOptions] options
1299
+ # Request-specific options
1300
+ #
1301
+ # @yield [result, err] Result & error if block supplied
1302
+ # @yieldparam result [Google::Apis::DriveV3::ReplyList] parsed result object
1303
+ # @yieldparam err [StandardError] error object if request failed
1304
+ #
1305
+ # @return [Google::Apis::DriveV3::ReplyList]
1306
+ #
1307
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1308
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1309
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1310
+ def list_replies(file_id, comment_id, include_deleted: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1311
+ command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}/replies', options)
1312
+ command.response_representation = Google::Apis::DriveV3::ReplyList::Representation
1313
+ command.response_class = Google::Apis::DriveV3::ReplyList
1314
+ command.params['fileId'] = file_id unless file_id.nil?
1315
+ command.params['commentId'] = comment_id unless comment_id.nil?
1316
+ command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
1317
+ command.query['pageSize'] = page_size unless page_size.nil?
1318
+ command.query['pageToken'] = page_token unless page_token.nil?
1319
+ command.query['fields'] = fields unless fields.nil?
1320
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1321
+ command.query['userIp'] = user_ip unless user_ip.nil?
1322
+ execute_or_queue_command(command, &block)
1323
+ end
1324
+
1325
+ # Updates a reply with patch semantics.
1326
+ # @param [String] file_id
1327
+ # The ID of the file.
1328
+ # @param [String] comment_id
1329
+ # The ID of the comment.
1330
+ # @param [String] reply_id
1331
+ # The ID of the reply.
1332
+ # @param [Google::Apis::DriveV3::Reply] reply_object
1333
+ # @param [String] fields
1334
+ # Selector specifying which fields to include in a partial response.
1335
+ # @param [String] quota_user
1336
+ # Available to use for quota purposes for server-side applications. Can be any
1337
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1338
+ # Overrides userIp if both are provided.
1339
+ # @param [String] user_ip
1340
+ # IP address of the site where the request originates. Use this if you want to
1341
+ # enforce per-user limits.
1342
+ # @param [Google::Apis::RequestOptions] options
1343
+ # Request-specific options
1344
+ #
1345
+ # @yield [result, err] Result & error if block supplied
1346
+ # @yieldparam result [Google::Apis::DriveV3::Reply] parsed result object
1347
+ # @yieldparam err [StandardError] error object if request failed
1348
+ #
1349
+ # @return [Google::Apis::DriveV3::Reply]
1350
+ #
1351
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1352
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1353
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1354
+ def update_reply(file_id, comment_id, reply_id, reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1355
+ command = make_simple_command(:patch, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
1356
+ command.request_representation = Google::Apis::DriveV3::Reply::Representation
1357
+ command.request_object = reply_object
1358
+ command.response_representation = Google::Apis::DriveV3::Reply::Representation
1359
+ command.response_class = Google::Apis::DriveV3::Reply
1360
+ command.params['fileId'] = file_id unless file_id.nil?
1361
+ command.params['commentId'] = comment_id unless comment_id.nil?
1362
+ command.params['replyId'] = reply_id unless reply_id.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
+ # Permanently deletes a revision. This method is only applicable to files with
1370
+ # binary content in Drive.
1371
+ # @param [String] file_id
1372
+ # The ID of the file.
1373
+ # @param [String] revision_id
1374
+ # The ID of the revision.
1375
+ # @param [String] fields
1376
+ # Selector specifying which fields to include in a partial response.
1377
+ # @param [String] quota_user
1378
+ # Available to use for quota purposes for server-side applications. Can be any
1379
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1380
+ # Overrides userIp if both are provided.
1381
+ # @param [String] user_ip
1382
+ # IP address of the site where the request originates. Use this if you want to
1383
+ # enforce per-user limits.
1384
+ # @param [Google::Apis::RequestOptions] options
1385
+ # Request-specific options
1386
+ #
1387
+ # @yield [result, err] Result & error if block supplied
1388
+ # @yieldparam result [NilClass] No result returned for this method
1389
+ # @yieldparam err [StandardError] error object if request failed
1390
+ #
1391
+ # @return [void]
1392
+ #
1393
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1394
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1395
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1396
+ def delete_revision(file_id, revision_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1397
+ command = make_simple_command(:delete, 'files/{fileId}/revisions/{revisionId}', options)
1398
+ command.params['fileId'] = file_id unless file_id.nil?
1399
+ command.params['revisionId'] = revision_id unless revision_id.nil?
1400
+ command.query['fields'] = fields unless fields.nil?
1401
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1402
+ command.query['userIp'] = user_ip unless user_ip.nil?
1403
+ execute_or_queue_command(command, &block)
1404
+ end
1405
+
1406
+ # Gets a revision's metadata or content by ID.
1407
+ # @param [String] file_id
1408
+ # The ID of the file.
1409
+ # @param [String] revision_id
1410
+ # The ID of the revision.
1411
+ # @param [Boolean] acknowledge_abuse
1412
+ # Whether the user is acknowledging the risk of downloading known malware or
1413
+ # other abusive files. This is only applicable when alt=media.
1414
+ # @param [String] fields
1415
+ # Selector specifying which fields to include in a partial response.
1416
+ # @param [String] quota_user
1417
+ # Available to use for quota purposes for server-side applications. Can be any
1418
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1419
+ # Overrides userIp if both are provided.
1420
+ # @param [String] user_ip
1421
+ # IP address of the site where the request originates. Use this if you want to
1422
+ # enforce per-user limits.
1423
+ # @param [IO, String] download_dest
1424
+ # IO stream or filename to receive content download
1425
+ # @param [Google::Apis::RequestOptions] options
1426
+ # Request-specific options
1427
+ #
1428
+ # @yield [result, err] Result & error if block supplied
1429
+ # @yieldparam result [Google::Apis::DriveV3::Revision] parsed result object
1430
+ # @yieldparam err [StandardError] error object if request failed
1431
+ #
1432
+ # @return [Google::Apis::DriveV3::Revision]
1433
+ #
1434
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1435
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1436
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1437
+ def get_revision(file_id, revision_id, acknowledge_abuse: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
1438
+ if download_dest.nil?
1439
+ command = make_simple_command(:get, 'files/{fileId}/revisions/{revisionId}', options)
1440
+ else
1441
+ command = make_download_command(:get, 'files/{fileId}/revisions/{revisionId}', options)
1442
+ command.download_dest = download_dest
1443
+ end
1444
+ command.response_representation = Google::Apis::DriveV3::Revision::Representation
1445
+ command.response_class = Google::Apis::DriveV3::Revision
1446
+ command.params['fileId'] = file_id unless file_id.nil?
1447
+ command.params['revisionId'] = revision_id unless revision_id.nil?
1448
+ command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.nil?
1449
+ command.query['fields'] = fields unless fields.nil?
1450
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1451
+ command.query['userIp'] = user_ip unless user_ip.nil?
1452
+ execute_or_queue_command(command, &block)
1453
+ end
1454
+
1455
+ # Lists a file's revisions.
1456
+ # @param [String] file_id
1457
+ # The ID of the file.
1458
+ # @param [String] fields
1459
+ # Selector specifying which fields to include in a partial response.
1460
+ # @param [String] quota_user
1461
+ # Available to use for quota purposes for server-side applications. Can be any
1462
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1463
+ # Overrides userIp if both are provided.
1464
+ # @param [String] user_ip
1465
+ # IP address of the site where the request originates. Use this if you want to
1466
+ # enforce per-user limits.
1467
+ # @param [Google::Apis::RequestOptions] options
1468
+ # Request-specific options
1469
+ #
1470
+ # @yield [result, err] Result & error if block supplied
1471
+ # @yieldparam result [Google::Apis::DriveV3::RevisionList] parsed result object
1472
+ # @yieldparam err [StandardError] error object if request failed
1473
+ #
1474
+ # @return [Google::Apis::DriveV3::RevisionList]
1475
+ #
1476
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1477
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1478
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1479
+ def list_revisions(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1480
+ command = make_simple_command(:get, 'files/{fileId}/revisions', options)
1481
+ command.response_representation = Google::Apis::DriveV3::RevisionList::Representation
1482
+ command.response_class = Google::Apis::DriveV3::RevisionList
1483
+ command.params['fileId'] = file_id unless file_id.nil?
1484
+ command.query['fields'] = fields unless fields.nil?
1485
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1486
+ command.query['userIp'] = user_ip unless user_ip.nil?
1487
+ execute_or_queue_command(command, &block)
1488
+ end
1489
+
1490
+ # Updates a revision with patch semantics.
1491
+ # @param [String] file_id
1492
+ # The ID of the file.
1493
+ # @param [String] revision_id
1494
+ # The ID of the revision.
1495
+ # @param [Google::Apis::DriveV3::Revision] revision_object
1496
+ # @param [String] fields
1497
+ # Selector specifying which fields to include in a partial response.
1498
+ # @param [String] quota_user
1499
+ # Available to use for quota purposes for server-side applications. Can be any
1500
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1501
+ # Overrides userIp if both are provided.
1502
+ # @param [String] user_ip
1503
+ # IP address of the site where the request originates. Use this if you want to
1504
+ # enforce per-user limits.
1505
+ # @param [Google::Apis::RequestOptions] options
1506
+ # Request-specific options
1507
+ #
1508
+ # @yield [result, err] Result & error if block supplied
1509
+ # @yieldparam result [Google::Apis::DriveV3::Revision] parsed result object
1510
+ # @yieldparam err [StandardError] error object if request failed
1511
+ #
1512
+ # @return [Google::Apis::DriveV3::Revision]
1513
+ #
1514
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1515
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1516
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1517
+ def update_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1518
+ command = make_simple_command(:patch, 'files/{fileId}/revisions/{revisionId}', options)
1519
+ command.request_representation = Google::Apis::DriveV3::Revision::Representation
1520
+ command.request_object = revision_object
1521
+ command.response_representation = Google::Apis::DriveV3::Revision::Representation
1522
+ command.response_class = Google::Apis::DriveV3::Revision
1523
+ command.params['fileId'] = file_id unless file_id.nil?
1524
+ command.params['revisionId'] = revision_id unless revision_id.nil?
1525
+ command.query['fields'] = fields unless fields.nil?
1526
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1527
+ command.query['userIp'] = user_ip unless user_ip.nil?
1528
+ execute_or_queue_command(command, &block)
1529
+ end
1530
+
1531
+ protected
1532
+
1533
+ def apply_command_defaults(command)
1534
+ command.query['key'] = key unless key.nil?
1535
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1536
+ command.query['userIp'] = user_ip unless user_ip.nil?
1537
+ end
1538
+ end
1539
+ end
1540
+ end
1541
+ end