google-api-client 0.8.6 → 0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +20 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +7 -0
  5. data/.rubocop_todo.yml +63 -0
  6. data/.travis.yml +22 -0
  7. data/.yardopts +12 -0
  8. data/CHANGELOG.md +41 -2
  9. data/CONTRIBUTING.md +31 -0
  10. data/Gemfile +32 -2
  11. data/MIGRATING.md +171 -0
  12. data/README.md +181 -148
  13. data/Rakefile +1 -40
  14. data/api_names.yaml +1036 -0
  15. data/api_names_out.yaml +26053 -0
  16. data/bin/generate-api +95 -0
  17. data/generated/google/apis/adexchangebuyer_v1_3.rb +35 -0
  18. data/generated/google/apis/adexchangebuyer_v1_3/classes.rb +1335 -0
  19. data/generated/google/apis/adexchangebuyer_v1_3/representations.rb +446 -0
  20. data/generated/google/apis/adexchangebuyer_v1_3/service.rb +872 -0
  21. data/generated/google/apis/adexchangeseller_v2_0.rb +38 -0
  22. data/generated/google/apis/adexchangeseller_v2_0/classes.rb +792 -0
  23. data/generated/google/apis/adexchangeseller_v2_0/representations.rb +309 -0
  24. data/generated/google/apis/adexchangeseller_v2_0/service.rb +668 -0
  25. data/generated/google/apis/admin_datatransfer_v1.rb +37 -0
  26. data/generated/google/apis/admin_datatransfer_v1/classes.rb +267 -0
  27. data/generated/google/apis/admin_datatransfer_v1/representations.rb +118 -0
  28. data/generated/google/apis/admin_datatransfer_v1/service.rb +262 -0
  29. data/generated/google/apis/admin_directory_v1.rb +113 -0
  30. data/generated/google/apis/admin_directory_v1/classes.rb +3141 -0
  31. data/generated/google/apis/admin_directory_v1/representations.rb +1029 -0
  32. data/generated/google/apis/admin_directory_v1/service.rb +3818 -0
  33. data/generated/google/apis/admin_reports_v1.rb +38 -0
  34. data/generated/google/apis/admin_reports_v1/classes.rb +582 -0
  35. data/generated/google/apis/admin_reports_v1/representations.rb +231 -0
  36. data/generated/google/apis/admin_reports_v1/service.rb +336 -0
  37. data/generated/google/apis/adsense_v1_4.rb +38 -0
  38. data/generated/google/apis/adsense_v1_4/classes.rb +1285 -0
  39. data/generated/google/apis/adsense_v1_4/representations.rb +494 -0
  40. data/generated/google/apis/adsense_v1_4/service.rb +1714 -0
  41. data/generated/google/apis/adsensehost_v4_1.rb +35 -0
  42. data/generated/google/apis/adsensehost_v4_1/classes.rb +834 -0
  43. data/generated/google/apis/adsensehost_v4_1/representations.rb +327 -0
  44. data/generated/google/apis/adsensehost_v4_1/service.rb +1164 -0
  45. data/generated/google/apis/analytics_v3.rb +49 -0
  46. data/generated/google/apis/analytics_v3/classes.rb +5118 -0
  47. data/generated/google/apis/analytics_v3/representations.rb +1662 -0
  48. data/generated/google/apis/analytics_v3/service.rb +3568 -0
  49. data/generated/google/apis/androidenterprise_v1.rb +35 -0
  50. data/generated/google/apis/androidenterprise_v1/classes.rb +1443 -0
  51. data/generated/google/apis/androidenterprise_v1/representations.rb +538 -0
  52. data/generated/google/apis/androidenterprise_v1/service.rb +2602 -0
  53. data/generated/google/apis/androidpublisher_v2.rb +34 -0
  54. data/generated/google/apis/androidpublisher_v2/classes.rb +1411 -0
  55. data/generated/google/apis/androidpublisher_v2/representations.rb +646 -0
  56. data/generated/google/apis/androidpublisher_v2/service.rb +2338 -0
  57. data/generated/google/apis/appengine_v1beta4.rb +35 -0
  58. data/generated/google/apis/appengine_v1beta4/classes.rb +1532 -0
  59. data/generated/google/apis/appengine_v1beta4/representations.rb +526 -0
  60. data/generated/google/apis/appengine_v1beta4/service.rb +476 -0
  61. data/generated/google/apis/appsactivity_v1.rb +46 -0
  62. data/generated/google/apis/appsactivity_v1/classes.rb +392 -0
  63. data/generated/google/apis/appsactivity_v1/representations.rb +184 -0
  64. data/generated/google/apis/appsactivity_v1/service.rb +128 -0
  65. data/generated/google/apis/appstate_v1.rb +34 -0
  66. data/generated/google/apis/appstate_v1/classes.rb +154 -0
  67. data/generated/google/apis/appstate_v1/representations.rb +79 -0
  68. data/generated/google/apis/appstate_v1/service.rb +260 -0
  69. data/generated/google/apis/autoscaler_v1beta2.rb +38 -0
  70. data/generated/google/apis/autoscaler_v1beta2/classes.rb +747 -0
  71. data/generated/google/apis/autoscaler_v1beta2/representations.rb +281 -0
  72. data/generated/google/apis/autoscaler_v1beta2/service.rb +478 -0
  73. data/generated/google/apis/bigquery_v2.rb +52 -0
  74. data/generated/google/apis/bigquery_v2/classes.rb +2471 -0
  75. data/generated/google/apis/bigquery_v2/representations.rb +816 -0
  76. data/generated/google/apis/bigquery_v2/service.rb +982 -0
  77. data/generated/google/apis/blogger_v3.rb +37 -0
  78. data/generated/google/apis/blogger_v3/classes.rb +1354 -0
  79. data/generated/google/apis/blogger_v3/representations.rb +562 -0
  80. data/generated/google/apis/blogger_v3/service.rb +1587 -0
  81. data/generated/google/apis/books_v1.rb +34 -0
  82. data/generated/google/apis/books_v1/classes.rb +3956 -0
  83. data/generated/google/apis/books_v1/representations.rb +1538 -0
  84. data/generated/google/apis/books_v1/service.rb +2290 -0
  85. data/generated/google/apis/calendar_v3.rb +37 -0
  86. data/generated/google/apis/calendar_v3/classes.rb +1742 -0
  87. data/generated/google/apis/calendar_v3/representations.rb +567 -0
  88. data/generated/google/apis/calendar_v3/service.rb +1968 -0
  89. data/{lib/google/api_client/service_account.rb → generated/google/apis/civicinfo_v2.rb} +18 -8
  90. data/generated/google/apis/civicinfo_v2/classes.rb +1127 -0
  91. data/generated/google/apis/civicinfo_v2/representations.rb +383 -0
  92. data/generated/google/apis/civicinfo_v2/service.rb +279 -0
  93. data/generated/google/apis/classroom_v1.rb +49 -0
  94. data/generated/google/apis/classroom_v1/classes.rb +512 -0
  95. data/generated/google/apis/classroom_v1/representations.rb +217 -0
  96. data/generated/google/apis/classroom_v1/service.rb +970 -0
  97. data/generated/google/apis/classroom_v1beta1.rb +49 -0
  98. data/generated/google/apis/classroom_v1beta1/classes.rb +447 -0
  99. data/generated/google/apis/classroom_v1beta1/representations.rb +190 -0
  100. data/generated/google/apis/classroom_v1beta1/service.rb +791 -0
  101. data/generated/google/apis/cloudbilling_v1.rb +35 -0
  102. data/generated/google/apis/cloudbilling_v1/classes.rb +169 -0
  103. data/generated/google/apis/cloudbilling_v1/representations.rb +79 -0
  104. data/generated/google/apis/cloudbilling_v1/service.rb +258 -0
  105. data/generated/google/apis/clouddebugger_v2.rb +41 -0
  106. data/generated/google/apis/clouddebugger_v2/classes.rb +1004 -0
  107. data/generated/google/apis/clouddebugger_v2/representations.rb +410 -0
  108. data/generated/google/apis/clouddebugger_v2/service.rb +370 -0
  109. data/generated/google/apis/cloudmonitoring_v2beta2.rb +37 -0
  110. data/generated/google/apis/cloudmonitoring_v2beta2/classes.rb +679 -0
  111. data/generated/google/apis/cloudmonitoring_v2beta2/representations.rb +311 -0
  112. data/generated/google/apis/cloudmonitoring_v2beta2/service.rb +452 -0
  113. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +38 -0
  114. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +437 -0
  115. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +188 -0
  116. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +623 -0
  117. data/generated/google/apis/cloudtrace_v1.rb +35 -0
  118. data/generated/google/apis/cloudtrace_v1/classes.rb +188 -0
  119. data/generated/google/apis/cloudtrace_v1/representations.rb +92 -0
  120. data/generated/google/apis/cloudtrace_v1/service.rb +190 -0
  121. data/generated/google/apis/clouduseraccounts_beta.rb +43 -0
  122. data/generated/google/apis/clouduseraccounts_beta/classes.rb +823 -0
  123. data/generated/google/apis/clouduseraccounts_beta/representations.rb +313 -0
  124. data/generated/google/apis/clouduseraccounts_beta/service.rb +854 -0
  125. data/generated/google/apis/compute_beta.rb +49 -0
  126. data/generated/google/apis/compute_beta/classes.rb +9128 -0
  127. data/generated/google/apis/compute_beta/representations.rb +3048 -0
  128. data/generated/google/apis/compute_beta/service.rb +10154 -0
  129. data/generated/google/apis/compute_v1.rb +49 -0
  130. data/generated/google/apis/compute_v1/classes.rb +8681 -0
  131. data/generated/google/apis/compute_v1/representations.rb +2895 -0
  132. data/generated/google/apis/compute_v1/service.rb +9252 -0
  133. data/generated/google/apis/container_v1.rb +35 -0
  134. data/generated/google/apis/container_v1/classes.rb +463 -0
  135. data/generated/google/apis/container_v1/representations.rb +175 -0
  136. data/generated/google/apis/container_v1/service.rb +367 -0
  137. data/generated/google/apis/container_v1beta1.rb +35 -0
  138. data/generated/google/apis/container_v1beta1/classes.rb +466 -0
  139. data/generated/google/apis/container_v1beta1/representations.rb +177 -0
  140. data/generated/google/apis/container_v1beta1/service.rb +394 -0
  141. data/generated/google/apis/content_v2.rb +35 -0
  142. data/generated/google/apis/content_v2/classes.rb +5986 -0
  143. data/generated/google/apis/content_v2/representations.rb +2288 -0
  144. data/generated/google/apis/content_v2/service.rb +2338 -0
  145. data/generated/google/apis/coordinate_v1.rb +37 -0
  146. data/generated/google/apis/coordinate_v1/classes.rb +669 -0
  147. data/generated/google/apis/coordinate_v1/representations.rb +285 -0
  148. data/generated/google/apis/coordinate_v1/service.rb +678 -0
  149. data/{lib/google/api_client/auth/compute_service_account.rb → generated/google/apis/customsearch_v1.rb} +13 -10
  150. data/generated/google/apis/customsearch_v1/classes.rb +771 -0
  151. data/generated/google/apis/customsearch_v1/representations.rb +276 -0
  152. data/generated/google/apis/customsearch_v1/service.rb +207 -0
  153. data/generated/google/apis/datastore_v1beta2.rb +40 -0
  154. data/generated/google/apis/datastore_v1beta2/classes.rb +1186 -0
  155. data/generated/google/apis/datastore_v1beta2/representations.rb +526 -0
  156. data/generated/google/apis/datastore_v1beta2/service.rb +294 -0
  157. data/generated/google/apis/deploymentmanager_v2.rb +44 -0
  158. data/generated/google/apis/deploymentmanager_v2/classes.rb +1091 -0
  159. data/generated/google/apis/deploymentmanager_v2/representations.rb +422 -0
  160. data/generated/google/apis/deploymentmanager_v2/service.rb +857 -0
  161. data/generated/google/apis/deploymentmanager_v2beta2.rb +44 -0
  162. data/generated/google/apis/deploymentmanager_v2beta2/classes.rb +843 -0
  163. data/generated/google/apis/deploymentmanager_v2beta2/representations.rb +306 -0
  164. data/generated/google/apis/deploymentmanager_v2beta2/service.rb +689 -0
  165. data/generated/google/apis/dfareporting_v2_1.rb +37 -0
  166. data/generated/google/apis/dfareporting_v2_1/classes.rb +10770 -0
  167. data/generated/google/apis/dfareporting_v2_1/representations.rb +3438 -0
  168. data/generated/google/apis/dfareporting_v2_1/service.rb +8585 -0
  169. data/generated/google/apis/discovery_v1.rb +32 -0
  170. data/generated/google/apis/discovery_v1/classes.rb +961 -0
  171. data/generated/google/apis/discovery_v1/representations.rb +357 -0
  172. data/generated/google/apis/discovery_v1/service.rb +142 -0
  173. data/generated/google/apis/dns_v1.rb +44 -0
  174. data/generated/google/apis/dns_v1/classes.rb +406 -0
  175. data/generated/google/apis/dns_v1/representations.rb +151 -0
  176. data/generated/google/apis/dns_v1/service.rb +454 -0
  177. data/generated/google/apis/doubleclickbidmanager_v1.rb +31 -0
  178. data/generated/google/apis/doubleclickbidmanager_v1/classes.rb +716 -0
  179. data/generated/google/apis/doubleclickbidmanager_v1/representations.rb +298 -0
  180. data/generated/google/apis/doubleclickbidmanager_v1/service.rb +341 -0
  181. data/generated/google/apis/doubleclicksearch_v2.rb +35 -0
  182. data/generated/google/apis/doubleclicksearch_v2/classes.rb +956 -0
  183. data/generated/google/apis/doubleclicksearch_v2/representations.rb +316 -0
  184. data/generated/google/apis/doubleclicksearch_v2/service.rb +480 -0
  185. data/generated/google/apis/drive_v2.rb +58 -0
  186. data/generated/google/apis/drive_v2/classes.rb +2562 -0
  187. data/generated/google/apis/drive_v2/representations.rb +795 -0
  188. data/generated/google/apis/drive_v2/service.rb +2696 -0
  189. data/generated/google/apis/drive_v3.rb +55 -0
  190. data/generated/google/apis/drive_v3/classes.rb +1534 -0
  191. data/generated/google/apis/drive_v3/representations.rb +497 -0
  192. data/generated/google/apis/drive_v3/service.rb +1541 -0
  193. data/generated/google/apis/fitness_v1.rb +49 -0
  194. data/generated/google/apis/fitness_v1/classes.rb +885 -0
  195. data/generated/google/apis/fitness_v1/representations.rb +320 -0
  196. data/generated/google/apis/fitness_v1/service.rb +675 -0
  197. data/generated/google/apis/fusiontables_v2.rb +37 -0
  198. data/generated/google/apis/fusiontables_v2/classes.rb +1048 -0
  199. data/generated/google/apis/fusiontables_v2/representations.rb +409 -0
  200. data/generated/google/apis/fusiontables_v2/service.rb +1463 -0
  201. data/generated/google/apis/games_configuration_v1configuration.rb +34 -0
  202. data/generated/google/apis/games_configuration_v1configuration/classes.rb +506 -0
  203. data/generated/google/apis/games_configuration_v1configuration/representations.rb +206 -0
  204. data/generated/google/apis/games_configuration_v1configuration/service.rb +565 -0
  205. data/generated/google/apis/games_management_v1management.rb +37 -0
  206. data/generated/google/apis/games_management_v1management/classes.rb +524 -0
  207. data/generated/google/apis/games_management_v1management/representations.rb +231 -0
  208. data/generated/google/apis/games_management_v1management/service.rb +994 -0
  209. data/generated/google/apis/games_v1.rb +40 -0
  210. data/generated/google/apis/games_v1/classes.rb +4617 -0
  211. data/generated/google/apis/games_v1/representations.rb +1584 -0
  212. data/generated/google/apis/games_v1/service.rb +2290 -0
  213. data/generated/google/apis/gan_v1beta1.rb +31 -0
  214. data/generated/google/apis/gan_v1beta1/classes.rb +1428 -0
  215. data/generated/google/apis/gan_v1beta1/representations.rb +428 -0
  216. data/generated/google/apis/gan_v1beta1/service.rb +682 -0
  217. data/generated/google/apis/genomics_v1.rb +49 -0
  218. data/generated/google/apis/genomics_v1/classes.rb +2609 -0
  219. data/generated/google/apis/genomics_v1/representations.rb +909 -0
  220. data/generated/google/apis/genomics_v1/service.rb +1676 -0
  221. data/generated/google/apis/genomics_v1beta2.rb +46 -0
  222. data/generated/google/apis/genomics_v1beta2/classes.rb +3288 -0
  223. data/generated/google/apis/genomics_v1beta2/representations.rb +1194 -0
  224. data/generated/google/apis/genomics_v1beta2/service.rb +2392 -0
  225. data/generated/google/apis/gmail_v1.rb +52 -0
  226. data/generated/google/apis/gmail_v1/classes.rb +794 -0
  227. data/generated/google/apis/gmail_v1/representations.rb +339 -0
  228. data/generated/google/apis/gmail_v1/service.rb +1470 -0
  229. data/generated/google/apis/groupsmigration_v1.rb +34 -0
  230. data/generated/google/apis/groupsmigration_v1/classes.rb +51 -0
  231. data/generated/google/apis/groupsmigration_v1/representations.rb +38 -0
  232. data/generated/google/apis/groupsmigration_v1/service.rb +110 -0
  233. data/generated/google/apis/groupssettings_v1.rb +34 -0
  234. data/generated/google/apis/groupssettings_v1/classes.rb +221 -0
  235. data/generated/google/apis/groupssettings_v1/representations.rb +64 -0
  236. data/generated/google/apis/groupssettings_v1/service.rb +179 -0
  237. data/generated/google/apis/identitytoolkit_v3.rb +31 -0
  238. data/generated/google/apis/identitytoolkit_v3/classes.rb +1466 -0
  239. data/generated/google/apis/identitytoolkit_v3/representations.rb +509 -0
  240. data/generated/google/apis/identitytoolkit_v3/service.rb +581 -0
  241. data/{spec/google/api_client/request_spec.rb → generated/google/apis/kgsearch_v1.rb} +16 -13
  242. data/generated/google/apis/kgsearch_v1/classes.rb +59 -0
  243. data/generated/google/apis/kgsearch_v1/representations.rb +39 -0
  244. data/generated/google/apis/kgsearch_v1/service.rb +111 -0
  245. data/generated/google/apis/licensing_v1.rb +34 -0
  246. data/generated/google/apis/licensing_v1/classes.rb +132 -0
  247. data/generated/google/apis/licensing_v1/representations.rb +68 -0
  248. data/generated/google/apis/licensing_v1/service.rb +369 -0
  249. data/generated/google/apis/logging_v1beta3.rb +47 -0
  250. data/generated/google/apis/logging_v1beta3/classes.rb +1079 -0
  251. data/generated/google/apis/logging_v1beta3/representations.rb +366 -0
  252. data/generated/google/apis/logging_v1beta3/service.rb +1001 -0
  253. data/generated/google/apis/manager_v1beta2.rb +53 -0
  254. data/generated/google/apis/manager_v1beta2/classes.rb +1287 -0
  255. data/generated/google/apis/manager_v1beta2/representations.rb +536 -0
  256. data/generated/google/apis/manager_v1beta2/service.rb +372 -0
  257. data/generated/google/apis/mapsengine_v1.rb +38 -0
  258. data/generated/google/apis/mapsengine_v1/classes.rb +2873 -0
  259. data/generated/google/apis/mapsengine_v1/representations.rb +1235 -0
  260. data/generated/google/apis/mapsengine_v1/service.rb +3388 -0
  261. data/generated/google/apis/mirror_v1.rb +37 -0
  262. data/generated/google/apis/mirror_v1/classes.rb +1072 -0
  263. data/generated/google/apis/mirror_v1/representations.rb +350 -0
  264. data/generated/google/apis/mirror_v1/service.rb +977 -0
  265. data/generated/google/apis/oauth2_v2.rb +43 -0
  266. data/generated/google/apis/oauth2_v2/classes.rb +245 -0
  267. data/generated/google/apis/oauth2_v2/representations.rb +94 -0
  268. data/generated/google/apis/oauth2_v2/service.rb +199 -0
  269. data/generated/google/apis/pagespeedonline_v2.rb +32 -0
  270. data/generated/google/apis/pagespeedonline_v2/classes.rb +614 -0
  271. data/generated/google/apis/pagespeedonline_v2/representations.rb +244 -0
  272. data/generated/google/apis/pagespeedonline_v2/service.rb +119 -0
  273. data/generated/google/apis/partners_v2.rb +32 -0
  274. data/generated/google/apis/partners_v2/classes.rb +942 -0
  275. data/generated/google/apis/partners_v2/representations.rb +402 -0
  276. data/generated/google/apis/partners_v2/service.rb +400 -0
  277. data/generated/google/apis/plus_domains_v1.rb +61 -0
  278. data/generated/google/apis/plus_domains_v1/classes.rb +2609 -0
  279. data/generated/google/apis/plus_domains_v1/representations.rb +987 -0
  280. data/generated/google/apis/plus_domains_v1/service.rb +904 -0
  281. data/generated/google/apis/plus_v1.rb +43 -0
  282. data/generated/google/apis/plus_v1/classes.rb +2094 -0
  283. data/generated/google/apis/plus_v1/representations.rb +805 -0
  284. data/generated/google/apis/plus_v1/service.rb +470 -0
  285. data/generated/google/apis/prediction_v1_6.rb +44 -0
  286. data/generated/google/apis/prediction_v1_6/classes.rb +751 -0
  287. data/generated/google/apis/prediction_v1_6/representations.rb +327 -0
  288. data/generated/google/apis/prediction_v1_6/service.rb +380 -0
  289. data/generated/google/apis/proximitybeacon_v1beta1.rb +31 -0
  290. data/generated/google/apis/proximitybeacon_v1beta1/classes.rb +639 -0
  291. data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +274 -0
  292. data/generated/google/apis/proximitybeacon_v1beta1/service.rb +591 -0
  293. data/generated/google/apis/pubsub_v1.rb +37 -0
  294. data/generated/google/apis/pubsub_v1/classes.rb +614 -0
  295. data/generated/google/apis/pubsub_v1/representations.rb +281 -0
  296. data/generated/google/apis/pubsub_v1/service.rb +774 -0
  297. data/generated/google/apis/pubsub_v1beta2.rb +37 -0
  298. data/generated/google/apis/pubsub_v1beta2/classes.rb +620 -0
  299. data/generated/google/apis/pubsub_v1beta2/representations.rb +282 -0
  300. data/generated/google/apis/pubsub_v1beta2/service.rb +774 -0
  301. data/generated/google/apis/qpx_express_v1.rb +31 -0
  302. data/generated/google/apis/qpx_express_v1/classes.rb +1268 -0
  303. data/generated/google/apis/qpx_express_v1/representations.rb +424 -0
  304. data/generated/google/apis/qpx_express_v1/service.rb +100 -0
  305. data/generated/google/apis/replicapool_v1beta2.rb +44 -0
  306. data/generated/google/apis/replicapool_v1beta2/classes.rb +631 -0
  307. data/generated/google/apis/replicapool_v1beta2/representations.rb +236 -0
  308. data/generated/google/apis/replicapool_v1beta2/service.rb +608 -0
  309. data/generated/google/apis/replicapoolupdater_v1beta1.rb +44 -0
  310. data/generated/google/apis/replicapoolupdater_v1beta1/classes.rb +733 -0
  311. data/generated/google/apis/replicapoolupdater_v1beta1/representations.rb +264 -0
  312. data/generated/google/apis/replicapoolupdater_v1beta1/service.rb +508 -0
  313. data/generated/google/apis/reseller_v1.rb +37 -0
  314. data/generated/google/apis/reseller_v1/classes.rb +520 -0
  315. data/generated/google/apis/reseller_v1/representations.rb +200 -0
  316. data/generated/google/apis/reseller_v1/service.rb +623 -0
  317. data/generated/google/apis/resourceviews_v1beta2.rb +50 -0
  318. data/generated/google/apis/resourceviews_v1beta2/classes.rb +660 -0
  319. data/generated/google/apis/resourceviews_v1beta2/representations.rb +269 -0
  320. data/generated/google/apis/resourceviews_v1beta2/service.rb +563 -0
  321. data/generated/google/apis/script_v1.rb +61 -0
  322. data/generated/google/apis/script_v1/classes.rb +259 -0
  323. data/generated/google/apis/script_v1/representations.rb +106 -0
  324. data/generated/google/apis/script_v1/service.rb +98 -0
  325. data/generated/google/apis/site_verification_v1.rb +37 -0
  326. data/generated/google/apis/site_verification_v1/classes.rb +185 -0
  327. data/generated/google/apis/site_verification_v1/representations.rb +101 -0
  328. data/generated/google/apis/site_verification_v1/service.rb +315 -0
  329. data/generated/google/apis/sqladmin_v1beta4.rb +37 -0
  330. data/generated/google/apis/sqladmin_v1beta4/classes.rb +2001 -0
  331. data/generated/google/apis/sqladmin_v1beta4/representations.rb +758 -0
  332. data/generated/google/apis/sqladmin_v1beta4/service.rb +1625 -0
  333. data/generated/google/apis/storage_v1.rb +46 -0
  334. data/generated/google/apis/storage_v1/classes.rb +1222 -0
  335. data/generated/google/apis/storage_v1/representations.rb +445 -0
  336. data/generated/google/apis/storage_v1/service.rb +1903 -0
  337. data/generated/google/apis/storagetransfer_v1.rb +35 -0
  338. data/generated/google/apis/storagetransfer_v1/classes.rb +1046 -0
  339. data/generated/google/apis/storagetransfer_v1/representations.rb +370 -0
  340. data/generated/google/apis/storagetransfer_v1/service.rb +473 -0
  341. data/generated/google/apis/tagmanager_v1.rb +52 -0
  342. data/generated/google/apis/tagmanager_v1/classes.rb +1384 -0
  343. data/generated/google/apis/tagmanager_v1/representations.rb +515 -0
  344. data/generated/google/apis/tagmanager_v1/service.rb +1817 -0
  345. data/generated/google/apis/taskqueue_v1beta2.rb +37 -0
  346. data/generated/google/apis/taskqueue_v1beta2/classes.rb +254 -0
  347. data/generated/google/apis/taskqueue_v1beta2/representations.rb +114 -0
  348. data/generated/google/apis/taskqueue_v1beta2/service.rb +408 -0
  349. data/generated/google/apis/tasks_v1.rb +37 -0
  350. data/generated/google/apis/tasks_v1/classes.rb +296 -0
  351. data/generated/google/apis/tasks_v1/representations.rb +115 -0
  352. data/generated/google/apis/tasks_v1/service.rb +643 -0
  353. data/generated/google/apis/translate_v2.rb +31 -0
  354. data/generated/google/apis/translate_v2/classes.rb +168 -0
  355. data/generated/google/apis/translate_v2/representations.rb +109 -0
  356. data/generated/google/apis/translate_v2/service.rb +182 -0
  357. data/generated/google/apis/urlshortener_v1.rb +34 -0
  358. data/generated/google/apis/urlshortener_v1/classes.rb +246 -0
  359. data/generated/google/apis/urlshortener_v1/representations.rb +111 -0
  360. data/generated/google/apis/urlshortener_v1/service.rb +176 -0
  361. data/generated/google/apis/webmasters_v3.rb +37 -0
  362. data/generated/google/apis/webmasters_v3/classes.rb +563 -0
  363. data/generated/google/apis/webmasters_v3/representations.rb +250 -0
  364. data/generated/google/apis/webmasters_v3/service.rb +573 -0
  365. data/generated/google/apis/youtube_analytics_v1.rb +46 -0
  366. data/generated/google/apis/youtube_analytics_v1/classes.rb +546 -0
  367. data/generated/google/apis/youtube_analytics_v1/representations.rb +243 -0
  368. data/generated/google/apis/youtube_analytics_v1/service.rb +562 -0
  369. data/generated/google/apis/youtube_v3.rb +49 -0
  370. data/generated/google/apis/youtube_v3/classes.rb +8136 -0
  371. data/generated/google/apis/youtube_v3/representations.rb +2838 -0
  372. data/generated/google/apis/youtube_v3/service.rb +4403 -0
  373. data/generated/google/apis/youtubereporting_v1.rb +38 -0
  374. data/generated/google/apis/youtubereporting_v1/classes.rb +258 -0
  375. data/generated/google/apis/youtubereporting_v1/representations.rb +128 -0
  376. data/generated/google/apis/youtubereporting_v1/service.rb +364 -0
  377. data/google-api-client.gemspec +27 -39
  378. data/lib/google/api_client/auth/installed_app.rb +7 -5
  379. data/lib/google/api_client/auth/key_utils.rb +1 -0
  380. data/lib/google/api_client/auth/storage.rb +4 -2
  381. data/lib/google/api_client/auth/storages/file_store.rb +2 -3
  382. data/lib/google/api_client/auth/storages/redis_store.rb +7 -2
  383. data/lib/google/api_client/client_secrets.rb +4 -5
  384. data/lib/google/apis.rb +48 -0
  385. data/lib/google/apis/core/api_command.rb +135 -0
  386. data/lib/google/apis/core/base_service.rb +317 -0
  387. data/lib/google/apis/core/batch.rb +239 -0
  388. data/lib/google/apis/core/download.rb +94 -0
  389. data/lib/google/apis/core/hashable.rb +44 -0
  390. data/lib/google/apis/core/http_client_adapter.rb +82 -0
  391. data/lib/google/apis/core/http_command.rb +312 -0
  392. data/lib/google/apis/core/json_representation.rb +127 -0
  393. data/lib/google/{api_client/version.rb → apis/core/logging.rb} +12 -8
  394. data/lib/google/apis/core/multipart.rb +187 -0
  395. data/lib/google/apis/core/upload.rb +288 -0
  396. data/lib/google/{api_client → apis}/errors.rb +39 -28
  397. data/lib/google/apis/generator.rb +70 -0
  398. data/lib/google/apis/generator/annotator.rb +295 -0
  399. data/lib/google/apis/generator/helpers.rb +74 -0
  400. data/lib/google/apis/generator/model.rb +143 -0
  401. data/lib/google/apis/generator/template.rb +124 -0
  402. data/lib/google/apis/generator/templates/_class.tmpl +40 -0
  403. data/lib/google/apis/generator/templates/_method.tmpl +92 -0
  404. data/lib/google/apis/generator/templates/_representation.tmpl +51 -0
  405. data/lib/google/apis/generator/templates/_representation_stub.tmpl +15 -0
  406. data/lib/google/apis/generator/templates/_representation_type.tmpl +10 -0
  407. data/lib/google/{api_client/reference.rb → apis/generator/templates/classes.rb.tmpl} +11 -9
  408. data/lib/google/apis/generator/templates/module.rb.tmpl +40 -0
  409. data/lib/google/apis/generator/templates/representations.rb.tmpl +32 -0
  410. data/lib/google/apis/generator/templates/service.rb.tmpl +60 -0
  411. data/lib/google/apis/options.rb +85 -0
  412. data/lib/google/apis/version.rb +39 -0
  413. data/rakelib/metrics.rake +22 -0
  414. data/rakelib/rubocop.rake +10 -0
  415. data/rakelib/spec.rake +11 -0
  416. data/rakelib/yard.rake +11 -0
  417. data/samples/Gemfile +7 -0
  418. data/samples/README.md +51 -0
  419. data/samples/google-api-samples +32 -0
  420. data/samples/lib/base_cli.rb +94 -0
  421. data/samples/lib/samples/analytics.rb +62 -0
  422. data/samples/lib/samples/calendar.rb +83 -0
  423. data/samples/lib/samples/drive.rb +82 -0
  424. data/samples/lib/samples/gmail.rb +50 -0
  425. data/samples/lib/samples/pubsub.rb +114 -0
  426. data/samples/lib/samples/translate.rb +44 -0
  427. data/samples/lib/samples/you_tube.rb +44 -0
  428. data/script/generate +95 -0
  429. data/script/package +8 -0
  430. data/script/release +15 -0
  431. data/spec/fixtures/files/api_names.yaml +3 -0
  432. data/spec/fixtures/files/auth_stored_credentials.json +8 -0
  433. data/spec/fixtures/files/child/.gitignore +0 -0
  434. data/spec/fixtures/files/client_secrets.json +1 -0
  435. data/spec/fixtures/files/invalid.json +1 -0
  436. data/spec/fixtures/files/test.blah +1 -0
  437. data/spec/fixtures/files/test.txt +1 -0
  438. data/spec/fixtures/files/test_api.json +440 -0
  439. data/spec/google/api_client/auth/storage_spec.rb +1 -3
  440. data/spec/google/api_client/auth/storages/file_store_spec.rb +1 -2
  441. data/spec/google/api_client/auth/storages/redis_store_spec.rb +1 -3
  442. data/spec/google/api_client/client_secrets_spec.rb +38 -1
  443. data/spec/google/apis/core/api_command_spec.rb +209 -0
  444. data/spec/google/apis/core/batch_spec.rb +142 -0
  445. data/spec/google/apis/core/download_spec.rb +103 -0
  446. data/spec/google/apis/core/hashable_spec.rb +60 -0
  447. data/spec/google/apis/core/http_command_spec.rb +284 -0
  448. data/spec/google/apis/core/json_representation_spec.rb +192 -0
  449. data/spec/google/apis/core/service_spec.rb +247 -0
  450. data/spec/google/apis/core/upload_spec.rb +300 -0
  451. data/{lib/google/api_client/discovery.rb → spec/google/apis/generated_spec.rb} +13 -5
  452. data/spec/google/apis/generator/generator_spec.rb +272 -0
  453. data/spec/google/apis/logging_spec.rb +45 -0
  454. data/spec/google/apis/options_spec.rb +40 -0
  455. data/spec/integration_tests/adsense_spec.rb +29 -0
  456. data/spec/integration_tests/drive_spec.rb +35 -0
  457. data/spec/integration_tests/pubsub_spec.rb +48 -0
  458. data/spec/integration_tests/url_shortener_spec.rb +45 -0
  459. data/spec/spec_helper.rb +131 -44
  460. data/spec/spec_helper/load_path_spec.rb +33 -0
  461. data/third_party/hurley_patches.rb +103 -0
  462. metadata +533 -170
  463. data/lib/compat/multi_json.rb +0 -19
  464. data/lib/google/api_client.rb +0 -750
  465. data/lib/google/api_client/auth/file_storage.rb +0 -59
  466. data/lib/google/api_client/auth/jwt_asserter.rb +0 -126
  467. data/lib/google/api_client/auth/pkcs12.rb +0 -41
  468. data/lib/google/api_client/batch.rb +0 -326
  469. data/lib/google/api_client/charset.rb +0 -33
  470. data/lib/google/api_client/discovery/api.rb +0 -310
  471. data/lib/google/api_client/discovery/media.rb +0 -77
  472. data/lib/google/api_client/discovery/method.rb +0 -363
  473. data/lib/google/api_client/discovery/resource.rb +0 -156
  474. data/lib/google/api_client/discovery/schema.rb +0 -117
  475. data/lib/google/api_client/environment.rb +0 -42
  476. data/lib/google/api_client/gzip.rb +0 -28
  477. data/lib/google/api_client/logging.rb +0 -32
  478. data/lib/google/api_client/media.rb +0 -259
  479. data/lib/google/api_client/railtie.rb +0 -18
  480. data/lib/google/api_client/request.rb +0 -350
  481. data/lib/google/api_client/result.rb +0 -255
  482. data/lib/google/api_client/service.rb +0 -233
  483. data/lib/google/api_client/service/batch.rb +0 -110
  484. data/lib/google/api_client/service/request.rb +0 -144
  485. data/lib/google/api_client/service/resource.rb +0 -40
  486. data/lib/google/api_client/service/result.rb +0 -162
  487. data/lib/google/api_client/service/simple_file_store.rb +0 -151
  488. data/lib/google/api_client/service/stub_generator.rb +0 -61
  489. data/spec/google/api_client/batch_spec.rb +0 -248
  490. data/spec/google/api_client/discovery_spec.rb +0 -708
  491. data/spec/google/api_client/gzip_spec.rb +0 -98
  492. data/spec/google/api_client/media_spec.rb +0 -178
  493. data/spec/google/api_client/result_spec.rb +0 -207
  494. data/spec/google/api_client/service_account_spec.rb +0 -169
  495. data/spec/google/api_client/service_spec.rb +0 -618
  496. data/spec/google/api_client/simple_file_store_spec.rb +0 -133
  497. data/spec/google/api_client_spec.rb +0 -352
@@ -0,0 +1,339 @@
1
+ # Copyright 2015 Google Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module GmailV1
24
+
25
+ class Draft
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+ end
28
+
29
+ class History
30
+ class Representation < Google::Apis::Core::JsonRepresentation; end
31
+ end
32
+
33
+ class HistoryLabelAdded
34
+ class Representation < Google::Apis::Core::JsonRepresentation; end
35
+ end
36
+
37
+ class HistoryLabelRemoved
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+ end
40
+
41
+ class HistoryMessageAdded
42
+ class Representation < Google::Apis::Core::JsonRepresentation; end
43
+ end
44
+
45
+ class HistoryMessageDeleted
46
+ class Representation < Google::Apis::Core::JsonRepresentation; end
47
+ end
48
+
49
+ class Label
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+ end
52
+
53
+ class ListDraftsResponse
54
+ class Representation < Google::Apis::Core::JsonRepresentation; end
55
+ end
56
+
57
+ class ListHistoryResponse
58
+ class Representation < Google::Apis::Core::JsonRepresentation; end
59
+ end
60
+
61
+ class ListLabelsResponse
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+ end
64
+
65
+ class ListMessagesResponse
66
+ class Representation < Google::Apis::Core::JsonRepresentation; end
67
+ end
68
+
69
+ class ListThreadsResponse
70
+ class Representation < Google::Apis::Core::JsonRepresentation; end
71
+ end
72
+
73
+ class Message
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+ end
76
+
77
+ class MessagePart
78
+ class Representation < Google::Apis::Core::JsonRepresentation; end
79
+ end
80
+
81
+ class MessagePartBody
82
+ class Representation < Google::Apis::Core::JsonRepresentation; end
83
+ end
84
+
85
+ class MessagePartHeader
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+ end
88
+
89
+ class ModifyMessageRequest
90
+ class Representation < Google::Apis::Core::JsonRepresentation; end
91
+ end
92
+
93
+ class ModifyThreadRequest
94
+ class Representation < Google::Apis::Core::JsonRepresentation; end
95
+ end
96
+
97
+ class Profile
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+ end
100
+
101
+ class Thread
102
+ class Representation < Google::Apis::Core::JsonRepresentation; end
103
+ end
104
+
105
+ class WatchRequest
106
+ class Representation < Google::Apis::Core::JsonRepresentation; end
107
+ end
108
+
109
+ class WatchResponse
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+ end
112
+
113
+ class Draft
114
+ # @private
115
+ class Representation < Google::Apis::Core::JsonRepresentation
116
+ property :id, as: 'id'
117
+ property :message, as: 'message', class: Google::Apis::GmailV1::Message, decorator: Google::Apis::GmailV1::Message::Representation
118
+
119
+ end
120
+ end
121
+
122
+ class History
123
+ # @private
124
+ class Representation < Google::Apis::Core::JsonRepresentation
125
+ property :id, as: 'id'
126
+ collection :labels_added, as: 'labelsAdded', class: Google::Apis::GmailV1::HistoryLabelAdded, decorator: Google::Apis::GmailV1::HistoryLabelAdded::Representation
127
+
128
+ collection :labels_removed, as: 'labelsRemoved', class: Google::Apis::GmailV1::HistoryLabelRemoved, decorator: Google::Apis::GmailV1::HistoryLabelRemoved::Representation
129
+
130
+ collection :messages, as: 'messages', class: Google::Apis::GmailV1::Message, decorator: Google::Apis::GmailV1::Message::Representation
131
+
132
+ collection :messages_added, as: 'messagesAdded', class: Google::Apis::GmailV1::HistoryMessageAdded, decorator: Google::Apis::GmailV1::HistoryMessageAdded::Representation
133
+
134
+ collection :messages_deleted, as: 'messagesDeleted', class: Google::Apis::GmailV1::HistoryMessageDeleted, decorator: Google::Apis::GmailV1::HistoryMessageDeleted::Representation
135
+
136
+ end
137
+ end
138
+
139
+ class HistoryLabelAdded
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ collection :label_ids, as: 'labelIds'
143
+ property :message, as: 'message', class: Google::Apis::GmailV1::Message, decorator: Google::Apis::GmailV1::Message::Representation
144
+
145
+ end
146
+ end
147
+
148
+ class HistoryLabelRemoved
149
+ # @private
150
+ class Representation < Google::Apis::Core::JsonRepresentation
151
+ collection :label_ids, as: 'labelIds'
152
+ property :message, as: 'message', class: Google::Apis::GmailV1::Message, decorator: Google::Apis::GmailV1::Message::Representation
153
+
154
+ end
155
+ end
156
+
157
+ class HistoryMessageAdded
158
+ # @private
159
+ class Representation < Google::Apis::Core::JsonRepresentation
160
+ property :message, as: 'message', class: Google::Apis::GmailV1::Message, decorator: Google::Apis::GmailV1::Message::Representation
161
+
162
+ end
163
+ end
164
+
165
+ class HistoryMessageDeleted
166
+ # @private
167
+ class Representation < Google::Apis::Core::JsonRepresentation
168
+ property :message, as: 'message', class: Google::Apis::GmailV1::Message, decorator: Google::Apis::GmailV1::Message::Representation
169
+
170
+ end
171
+ end
172
+
173
+ class Label
174
+ # @private
175
+ class Representation < Google::Apis::Core::JsonRepresentation
176
+ property :id, as: 'id'
177
+ property :label_list_visibility, as: 'labelListVisibility'
178
+ property :message_list_visibility, as: 'messageListVisibility'
179
+ property :messages_total, as: 'messagesTotal'
180
+ property :messages_unread, as: 'messagesUnread'
181
+ property :name, as: 'name'
182
+ property :threads_total, as: 'threadsTotal'
183
+ property :threads_unread, as: 'threadsUnread'
184
+ property :type, as: 'type'
185
+ end
186
+ end
187
+
188
+ class ListDraftsResponse
189
+ # @private
190
+ class Representation < Google::Apis::Core::JsonRepresentation
191
+ collection :drafts, as: 'drafts', class: Google::Apis::GmailV1::Draft, decorator: Google::Apis::GmailV1::Draft::Representation
192
+
193
+ property :next_page_token, as: 'nextPageToken'
194
+ property :result_size_estimate, as: 'resultSizeEstimate'
195
+ end
196
+ end
197
+
198
+ class ListHistoryResponse
199
+ # @private
200
+ class Representation < Google::Apis::Core::JsonRepresentation
201
+ collection :history, as: 'history', class: Google::Apis::GmailV1::History, decorator: Google::Apis::GmailV1::History::Representation
202
+
203
+ property :history_id, as: 'historyId'
204
+ property :next_page_token, as: 'nextPageToken'
205
+ end
206
+ end
207
+
208
+ class ListLabelsResponse
209
+ # @private
210
+ class Representation < Google::Apis::Core::JsonRepresentation
211
+ collection :labels, as: 'labels', class: Google::Apis::GmailV1::Label, decorator: Google::Apis::GmailV1::Label::Representation
212
+
213
+ end
214
+ end
215
+
216
+ class ListMessagesResponse
217
+ # @private
218
+ class Representation < Google::Apis::Core::JsonRepresentation
219
+ collection :messages, as: 'messages', class: Google::Apis::GmailV1::Message, decorator: Google::Apis::GmailV1::Message::Representation
220
+
221
+ property :next_page_token, as: 'nextPageToken'
222
+ property :result_size_estimate, as: 'resultSizeEstimate'
223
+ end
224
+ end
225
+
226
+ class ListThreadsResponse
227
+ # @private
228
+ class Representation < Google::Apis::Core::JsonRepresentation
229
+ property :next_page_token, as: 'nextPageToken'
230
+ property :result_size_estimate, as: 'resultSizeEstimate'
231
+ collection :threads, as: 'threads', class: Google::Apis::GmailV1::Thread, decorator: Google::Apis::GmailV1::Thread::Representation
232
+
233
+ end
234
+ end
235
+
236
+ class Message
237
+ # @private
238
+ class Representation < Google::Apis::Core::JsonRepresentation
239
+ property :history_id, as: 'historyId'
240
+ property :id, as: 'id'
241
+ property :internal_date, as: 'internalDate'
242
+ collection :label_ids, as: 'labelIds'
243
+ property :payload, as: 'payload', class: Google::Apis::GmailV1::MessagePart, decorator: Google::Apis::GmailV1::MessagePart::Representation
244
+
245
+ property :raw, :base64 => true, as: 'raw'
246
+ property :size_estimate, as: 'sizeEstimate'
247
+ property :snippet, as: 'snippet'
248
+ property :thread_id, as: 'threadId'
249
+ end
250
+ end
251
+
252
+ class MessagePart
253
+ # @private
254
+ class Representation < Google::Apis::Core::JsonRepresentation
255
+ property :body, as: 'body', class: Google::Apis::GmailV1::MessagePartBody, decorator: Google::Apis::GmailV1::MessagePartBody::Representation
256
+
257
+ property :filename, as: 'filename'
258
+ collection :headers, as: 'headers', class: Google::Apis::GmailV1::MessagePartHeader, decorator: Google::Apis::GmailV1::MessagePartHeader::Representation
259
+
260
+ property :mime_type, as: 'mimeType'
261
+ property :part_id, as: 'partId'
262
+ collection :parts, as: 'parts', class: Google::Apis::GmailV1::MessagePart, decorator: Google::Apis::GmailV1::MessagePart::Representation
263
+
264
+ end
265
+ end
266
+
267
+ class MessagePartBody
268
+ # @private
269
+ class Representation < Google::Apis::Core::JsonRepresentation
270
+ property :attachment_id, as: 'attachmentId'
271
+ property :data, :base64 => true, as: 'data'
272
+ property :size, as: 'size'
273
+ end
274
+ end
275
+
276
+ class MessagePartHeader
277
+ # @private
278
+ class Representation < Google::Apis::Core::JsonRepresentation
279
+ property :name, as: 'name'
280
+ property :value, as: 'value'
281
+ end
282
+ end
283
+
284
+ class ModifyMessageRequest
285
+ # @private
286
+ class Representation < Google::Apis::Core::JsonRepresentation
287
+ collection :add_label_ids, as: 'addLabelIds'
288
+ collection :remove_label_ids, as: 'removeLabelIds'
289
+ end
290
+ end
291
+
292
+ class ModifyThreadRequest
293
+ # @private
294
+ class Representation < Google::Apis::Core::JsonRepresentation
295
+ collection :add_label_ids, as: 'addLabelIds'
296
+ collection :remove_label_ids, as: 'removeLabelIds'
297
+ end
298
+ end
299
+
300
+ class Profile
301
+ # @private
302
+ class Representation < Google::Apis::Core::JsonRepresentation
303
+ property :email_address, as: 'emailAddress'
304
+ property :history_id, as: 'historyId'
305
+ property :messages_total, as: 'messagesTotal'
306
+ property :threads_total, as: 'threadsTotal'
307
+ end
308
+ end
309
+
310
+ class Thread
311
+ # @private
312
+ class Representation < Google::Apis::Core::JsonRepresentation
313
+ property :history_id, as: 'historyId'
314
+ property :id, as: 'id'
315
+ collection :messages, as: 'messages', class: Google::Apis::GmailV1::Message, decorator: Google::Apis::GmailV1::Message::Representation
316
+
317
+ property :snippet, as: 'snippet'
318
+ end
319
+ end
320
+
321
+ class WatchRequest
322
+ # @private
323
+ class Representation < Google::Apis::Core::JsonRepresentation
324
+ property :label_filter_action, as: 'labelFilterAction'
325
+ collection :label_ids, as: 'labelIds'
326
+ property :topic_name, as: 'topicName'
327
+ end
328
+ end
329
+
330
+ class WatchResponse
331
+ # @private
332
+ class Representation < Google::Apis::Core::JsonRepresentation
333
+ property :expiration, as: 'expiration'
334
+ property :history_id, as: 'historyId'
335
+ end
336
+ end
337
+ end
338
+ end
339
+ end
@@ -0,0 +1,1470 @@
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 GmailV1
23
+ # Gmail API
24
+ #
25
+ # The Gmail REST API.
26
+ #
27
+ # @example
28
+ # require 'google/apis/gmail_v1'
29
+ #
30
+ # Gmail = Google::Apis::GmailV1 # Alias the module
31
+ # service = Gmail::GmailService.new
32
+ #
33
+ # @see https://developers.google.com/gmail/api/
34
+ class GmailService < 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/', 'gmail/v1/users/')
53
+ end
54
+
55
+ # Gets the current user's Gmail profile.
56
+ # @param [String] user_id
57
+ # The user's email address. The special value me can be used to indicate the
58
+ # authenticated user.
59
+ # @param [String] fields
60
+ # Selector specifying which fields to include in a partial response.
61
+ # @param [String] quota_user
62
+ # Available to use for quota purposes for server-side applications. Can be any
63
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
64
+ # Overrides userIp if both are provided.
65
+ # @param [String] user_ip
66
+ # IP address of the site where the request originates. Use this if you want to
67
+ # enforce per-user limits.
68
+ # @param [Google::Apis::RequestOptions] options
69
+ # Request-specific options
70
+ #
71
+ # @yield [result, err] Result & error if block supplied
72
+ # @yieldparam result [Google::Apis::GmailV1::Profile] parsed result object
73
+ # @yieldparam err [StandardError] error object if request failed
74
+ #
75
+ # @return [Google::Apis::GmailV1::Profile]
76
+ #
77
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
78
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
79
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
80
+ def get_user_profile(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
81
+ command = make_simple_command(:get, '{userId}/profile', options)
82
+ command.response_representation = Google::Apis::GmailV1::Profile::Representation
83
+ command.response_class = Google::Apis::GmailV1::Profile
84
+ command.params['userId'] = user_id unless user_id.nil?
85
+ command.query['fields'] = fields unless fields.nil?
86
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
87
+ command.query['userIp'] = user_ip unless user_ip.nil?
88
+ execute_or_queue_command(command, &block)
89
+ end
90
+
91
+ # Stop receiving push notifications for the given user mailbox.
92
+ # @param [String] user_id
93
+ # The user's email address. The special value me can be used to indicate the
94
+ # authenticated user.
95
+ # @param [String] fields
96
+ # Selector specifying which fields to include in a partial response.
97
+ # @param [String] quota_user
98
+ # Available to use for quota purposes for server-side applications. Can be any
99
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
100
+ # Overrides userIp if both are provided.
101
+ # @param [String] user_ip
102
+ # IP address of the site where the request originates. Use this if you want to
103
+ # enforce per-user limits.
104
+ # @param [Google::Apis::RequestOptions] options
105
+ # Request-specific options
106
+ #
107
+ # @yield [result, err] Result & error if block supplied
108
+ # @yieldparam result [NilClass] No result returned for this method
109
+ # @yieldparam err [StandardError] error object if request failed
110
+ #
111
+ # @return [void]
112
+ #
113
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
114
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
115
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
116
+ def stop_user(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
117
+ command = make_simple_command(:post, '{userId}/stop', options)
118
+ command.params['userId'] = user_id unless user_id.nil?
119
+ command.query['fields'] = fields unless fields.nil?
120
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
121
+ command.query['userIp'] = user_ip unless user_ip.nil?
122
+ execute_or_queue_command(command, &block)
123
+ end
124
+
125
+ # Set up or update a push notification watch on the given user mailbox.
126
+ # @param [String] user_id
127
+ # The user's email address. The special value me can be used to indicate the
128
+ # authenticated user.
129
+ # @param [Google::Apis::GmailV1::WatchRequest] watch_request_object
130
+ # @param [String] fields
131
+ # Selector specifying which fields to include in a partial response.
132
+ # @param [String] quota_user
133
+ # Available to use for quota purposes for server-side applications. Can be any
134
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
135
+ # Overrides userIp if both are provided.
136
+ # @param [String] user_ip
137
+ # IP address of the site where the request originates. Use this if you want to
138
+ # enforce per-user limits.
139
+ # @param [Google::Apis::RequestOptions] options
140
+ # Request-specific options
141
+ #
142
+ # @yield [result, err] Result & error if block supplied
143
+ # @yieldparam result [Google::Apis::GmailV1::WatchResponse] parsed result object
144
+ # @yieldparam err [StandardError] error object if request failed
145
+ #
146
+ # @return [Google::Apis::GmailV1::WatchResponse]
147
+ #
148
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
149
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
150
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
151
+ def watch_user(user_id, watch_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
152
+ command = make_simple_command(:post, '{userId}/watch', options)
153
+ command.request_representation = Google::Apis::GmailV1::WatchRequest::Representation
154
+ command.request_object = watch_request_object
155
+ command.response_representation = Google::Apis::GmailV1::WatchResponse::Representation
156
+ command.response_class = Google::Apis::GmailV1::WatchResponse
157
+ command.params['userId'] = user_id unless user_id.nil?
158
+ command.query['fields'] = fields unless fields.nil?
159
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
160
+ command.query['userIp'] = user_ip unless user_ip.nil?
161
+ execute_or_queue_command(command, &block)
162
+ end
163
+
164
+ # Creates a new draft with the DRAFT label.
165
+ # @param [String] user_id
166
+ # The user's email address. The special value me can be used to indicate the
167
+ # authenticated user.
168
+ # @param [Google::Apis::GmailV1::Draft] draft_object
169
+ # @param [String] fields
170
+ # Selector specifying which fields to include in a partial response.
171
+ # @param [String] quota_user
172
+ # Available to use for quota purposes for server-side applications. Can be any
173
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
174
+ # Overrides userIp if both are provided.
175
+ # @param [String] user_ip
176
+ # IP address of the site where the request originates. Use this if you want to
177
+ # enforce per-user limits.
178
+ # @param [IO, String] upload_source
179
+ # IO stream or filename containing content to upload
180
+ # @param [String] content_type
181
+ # Content type of the uploaded content.
182
+ # @param [Google::Apis::RequestOptions] options
183
+ # Request-specific options
184
+ #
185
+ # @yield [result, err] Result & error if block supplied
186
+ # @yieldparam result [Google::Apis::GmailV1::Draft] parsed result object
187
+ # @yieldparam err [StandardError] error object if request failed
188
+ #
189
+ # @return [Google::Apis::GmailV1::Draft]
190
+ #
191
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
192
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
193
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
194
+ def create_user_draft(user_id, draft_object = nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
195
+ if upload_source.nil?
196
+ command = make_simple_command(:post, '{userId}/drafts', options)
197
+ else
198
+ command = make_upload_command(:post, '{userId}/drafts', options)
199
+ command.upload_source = upload_source
200
+ command.upload_content_type = content_type
201
+ end
202
+ command.request_representation = Google::Apis::GmailV1::Draft::Representation
203
+ command.request_object = draft_object
204
+ command.response_representation = Google::Apis::GmailV1::Draft::Representation
205
+ command.response_class = Google::Apis::GmailV1::Draft
206
+ command.params['userId'] = user_id unless user_id.nil?
207
+ command.query['fields'] = fields unless fields.nil?
208
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
209
+ command.query['userIp'] = user_ip unless user_ip.nil?
210
+ execute_or_queue_command(command, &block)
211
+ end
212
+
213
+ # Immediately and permanently deletes the specified draft. Does not simply trash
214
+ # it.
215
+ # @param [String] user_id
216
+ # The user's email address. The special value me can be used to indicate the
217
+ # authenticated user.
218
+ # @param [String] id
219
+ # The ID of the draft to delete.
220
+ # @param [String] fields
221
+ # Selector specifying which fields to include in a partial response.
222
+ # @param [String] quota_user
223
+ # Available to use for quota purposes for server-side applications. Can be any
224
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
225
+ # Overrides userIp if both are provided.
226
+ # @param [String] user_ip
227
+ # IP address of the site where the request originates. Use this if you want to
228
+ # enforce per-user limits.
229
+ # @param [Google::Apis::RequestOptions] options
230
+ # Request-specific options
231
+ #
232
+ # @yield [result, err] Result & error if block supplied
233
+ # @yieldparam result [NilClass] No result returned for this method
234
+ # @yieldparam err [StandardError] error object if request failed
235
+ #
236
+ # @return [void]
237
+ #
238
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
239
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
240
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
241
+ def delete_user_draft(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
242
+ command = make_simple_command(:delete, '{userId}/drafts/{id}', options)
243
+ command.params['userId'] = user_id unless user_id.nil?
244
+ command.params['id'] = id unless id.nil?
245
+ command.query['fields'] = fields unless fields.nil?
246
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
247
+ command.query['userIp'] = user_ip unless user_ip.nil?
248
+ execute_or_queue_command(command, &block)
249
+ end
250
+
251
+ # Gets the specified draft.
252
+ # @param [String] user_id
253
+ # The user's email address. The special value me can be used to indicate the
254
+ # authenticated user.
255
+ # @param [String] id
256
+ # The ID of the draft to retrieve.
257
+ # @param [String] format
258
+ # The format to return the draft in.
259
+ # @param [String] fields
260
+ # Selector specifying which fields to include in a partial response.
261
+ # @param [String] quota_user
262
+ # Available to use for quota purposes for server-side applications. Can be any
263
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
264
+ # Overrides userIp if both are provided.
265
+ # @param [String] user_ip
266
+ # IP address of the site where the request originates. Use this if you want to
267
+ # enforce per-user limits.
268
+ # @param [Google::Apis::RequestOptions] options
269
+ # Request-specific options
270
+ #
271
+ # @yield [result, err] Result & error if block supplied
272
+ # @yieldparam result [Google::Apis::GmailV1::Draft] parsed result object
273
+ # @yieldparam err [StandardError] error object if request failed
274
+ #
275
+ # @return [Google::Apis::GmailV1::Draft]
276
+ #
277
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
278
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
279
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
280
+ def get_user_draft(user_id, id, format: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
281
+ command = make_simple_command(:get, '{userId}/drafts/{id}', options)
282
+ command.response_representation = Google::Apis::GmailV1::Draft::Representation
283
+ command.response_class = Google::Apis::GmailV1::Draft
284
+ command.params['userId'] = user_id unless user_id.nil?
285
+ command.params['id'] = id unless id.nil?
286
+ command.query['format'] = format unless format.nil?
287
+ command.query['fields'] = fields unless fields.nil?
288
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
289
+ command.query['userIp'] = user_ip unless user_ip.nil?
290
+ execute_or_queue_command(command, &block)
291
+ end
292
+
293
+ # Lists the drafts in the user's mailbox.
294
+ # @param [String] user_id
295
+ # The user's email address. The special value me can be used to indicate the
296
+ # authenticated user.
297
+ # @param [Fixnum] max_results
298
+ # Maximum number of drafts to return.
299
+ # @param [String] page_token
300
+ # Page token to retrieve a specific page of results in the list.
301
+ # @param [String] fields
302
+ # Selector specifying which fields to include in a partial response.
303
+ # @param [String] quota_user
304
+ # Available to use for quota purposes for server-side applications. Can be any
305
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
306
+ # Overrides userIp if both are provided.
307
+ # @param [String] user_ip
308
+ # IP address of the site where the request originates. Use this if you want to
309
+ # enforce per-user limits.
310
+ # @param [Google::Apis::RequestOptions] options
311
+ # Request-specific options
312
+ #
313
+ # @yield [result, err] Result & error if block supplied
314
+ # @yieldparam result [Google::Apis::GmailV1::ListDraftsResponse] parsed result object
315
+ # @yieldparam err [StandardError] error object if request failed
316
+ #
317
+ # @return [Google::Apis::GmailV1::ListDraftsResponse]
318
+ #
319
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
320
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
321
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
322
+ def list_user_drafts(user_id, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
323
+ command = make_simple_command(:get, '{userId}/drafts', options)
324
+ command.response_representation = Google::Apis::GmailV1::ListDraftsResponse::Representation
325
+ command.response_class = Google::Apis::GmailV1::ListDraftsResponse
326
+ command.params['userId'] = user_id unless user_id.nil?
327
+ command.query['maxResults'] = max_results unless max_results.nil?
328
+ command.query['pageToken'] = page_token unless page_token.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
+ # Sends the specified, existing draft to the recipients in the To, Cc, and Bcc
336
+ # headers.
337
+ # @param [String] user_id
338
+ # The user's email address. The special value me can be used to indicate the
339
+ # authenticated user.
340
+ # @param [Google::Apis::GmailV1::Draft] draft_object
341
+ # @param [String] fields
342
+ # Selector specifying which fields to include in a partial response.
343
+ # @param [String] quota_user
344
+ # Available to use for quota purposes for server-side applications. Can be any
345
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
346
+ # Overrides userIp if both are provided.
347
+ # @param [String] user_ip
348
+ # IP address of the site where the request originates. Use this if you want to
349
+ # enforce per-user limits.
350
+ # @param [IO, String] upload_source
351
+ # IO stream or filename containing content to upload
352
+ # @param [String] content_type
353
+ # Content type of the uploaded content.
354
+ # @param [Google::Apis::RequestOptions] options
355
+ # Request-specific options
356
+ #
357
+ # @yield [result, err] Result & error if block supplied
358
+ # @yieldparam result [Google::Apis::GmailV1::Message] parsed result object
359
+ # @yieldparam err [StandardError] error object if request failed
360
+ #
361
+ # @return [Google::Apis::GmailV1::Message]
362
+ #
363
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
364
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
365
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
366
+ def send_user_draft(user_id, draft_object = nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
367
+ if upload_source.nil?
368
+ command = make_simple_command(:post, '{userId}/drafts/send', options)
369
+ else
370
+ command = make_upload_command(:post, '{userId}/drafts/send', options)
371
+ command.upload_source = upload_source
372
+ command.upload_content_type = content_type
373
+ end
374
+ command.request_representation = Google::Apis::GmailV1::Draft::Representation
375
+ command.request_object = draft_object
376
+ command.response_representation = Google::Apis::GmailV1::Message::Representation
377
+ command.response_class = Google::Apis::GmailV1::Message
378
+ command.params['userId'] = user_id unless user_id.nil?
379
+ command.query['fields'] = fields unless fields.nil?
380
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
381
+ command.query['userIp'] = user_ip unless user_ip.nil?
382
+ execute_or_queue_command(command, &block)
383
+ end
384
+
385
+ # Replaces a draft's content.
386
+ # @param [String] user_id
387
+ # The user's email address. The special value me can be used to indicate the
388
+ # authenticated user.
389
+ # @param [String] id
390
+ # The ID of the draft to update.
391
+ # @param [Google::Apis::GmailV1::Draft] draft_object
392
+ # @param [String] fields
393
+ # Selector specifying which fields to include in a partial response.
394
+ # @param [String] quota_user
395
+ # Available to use for quota purposes for server-side applications. Can be any
396
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
397
+ # Overrides userIp if both are provided.
398
+ # @param [String] user_ip
399
+ # IP address of the site where the request originates. Use this if you want to
400
+ # enforce per-user limits.
401
+ # @param [IO, String] upload_source
402
+ # IO stream or filename containing content to upload
403
+ # @param [String] content_type
404
+ # Content type of the uploaded content.
405
+ # @param [Google::Apis::RequestOptions] options
406
+ # Request-specific options
407
+ #
408
+ # @yield [result, err] Result & error if block supplied
409
+ # @yieldparam result [Google::Apis::GmailV1::Draft] parsed result object
410
+ # @yieldparam err [StandardError] error object if request failed
411
+ #
412
+ # @return [Google::Apis::GmailV1::Draft]
413
+ #
414
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
415
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
416
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
417
+ def update_user_draft(user_id, id, draft_object = nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
418
+ if upload_source.nil?
419
+ command = make_simple_command(:put, '{userId}/drafts/{id}', options)
420
+ else
421
+ command = make_upload_command(:put, '{userId}/drafts/{id}', options)
422
+ command.upload_source = upload_source
423
+ command.upload_content_type = content_type
424
+ end
425
+ command.request_representation = Google::Apis::GmailV1::Draft::Representation
426
+ command.request_object = draft_object
427
+ command.response_representation = Google::Apis::GmailV1::Draft::Representation
428
+ command.response_class = Google::Apis::GmailV1::Draft
429
+ command.params['userId'] = user_id unless user_id.nil?
430
+ command.params['id'] = id unless id.nil?
431
+ command.query['fields'] = fields unless fields.nil?
432
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
433
+ command.query['userIp'] = user_ip unless user_ip.nil?
434
+ execute_or_queue_command(command, &block)
435
+ end
436
+
437
+ # Lists the history of all changes to the given mailbox. History results are
438
+ # returned in chronological order (increasing historyId).
439
+ # @param [String] user_id
440
+ # The user's email address. The special value me can be used to indicate the
441
+ # authenticated user.
442
+ # @param [String] label_id
443
+ # Only return messages with a label matching the ID.
444
+ # @param [Fixnum] max_results
445
+ # The maximum number of history records to return.
446
+ # @param [String] page_token
447
+ # Page token to retrieve a specific page of results in the list.
448
+ # @param [String] start_history_id
449
+ # Required. Returns history records after the specified startHistoryId. The
450
+ # supplied startHistoryId should be obtained from the historyId of a message,
451
+ # thread, or previous list response. History IDs increase chronologically but
452
+ # are not contiguous with random gaps in between valid IDs. Supplying an invalid
453
+ # or out of date startHistoryId typically returns an HTTP 404 error code. A
454
+ # historyId is typically valid for at least a week, but in some rare
455
+ # circumstances may be valid for only a few hours. If you receive an HTTP 404
456
+ # error response, your application should perform a full sync. If you receive no
457
+ # nextPageToken in the response, there are no updates to retrieve and you can
458
+ # store the returned historyId for a future request.
459
+ # @param [String] fields
460
+ # Selector specifying which fields to include in a partial response.
461
+ # @param [String] quota_user
462
+ # Available to use for quota purposes for server-side applications. Can be any
463
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
464
+ # Overrides userIp if both are provided.
465
+ # @param [String] user_ip
466
+ # IP address of the site where the request originates. Use this if you want to
467
+ # enforce per-user limits.
468
+ # @param [Google::Apis::RequestOptions] options
469
+ # Request-specific options
470
+ #
471
+ # @yield [result, err] Result & error if block supplied
472
+ # @yieldparam result [Google::Apis::GmailV1::ListHistoryResponse] parsed result object
473
+ # @yieldparam err [StandardError] error object if request failed
474
+ #
475
+ # @return [Google::Apis::GmailV1::ListHistoryResponse]
476
+ #
477
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
478
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
479
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
480
+ def list_user_histories(user_id, label_id: nil, max_results: nil, page_token: nil, start_history_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
481
+ command = make_simple_command(:get, '{userId}/history', options)
482
+ command.response_representation = Google::Apis::GmailV1::ListHistoryResponse::Representation
483
+ command.response_class = Google::Apis::GmailV1::ListHistoryResponse
484
+ command.params['userId'] = user_id unless user_id.nil?
485
+ command.query['labelId'] = label_id unless label_id.nil?
486
+ command.query['maxResults'] = max_results unless max_results.nil?
487
+ command.query['pageToken'] = page_token unless page_token.nil?
488
+ command.query['startHistoryId'] = start_history_id unless start_history_id.nil?
489
+ command.query['fields'] = fields unless fields.nil?
490
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
491
+ command.query['userIp'] = user_ip unless user_ip.nil?
492
+ execute_or_queue_command(command, &block)
493
+ end
494
+
495
+ # Creates a new label.
496
+ # @param [String] user_id
497
+ # The user's email address. The special value me can be used to indicate the
498
+ # authenticated user.
499
+ # @param [Google::Apis::GmailV1::Label] label_object
500
+ # @param [String] fields
501
+ # Selector specifying which fields to include in a partial response.
502
+ # @param [String] quota_user
503
+ # Available to use for quota purposes for server-side applications. Can be any
504
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
505
+ # Overrides userIp if both are provided.
506
+ # @param [String] user_ip
507
+ # IP address of the site where the request originates. Use this if you want to
508
+ # enforce per-user limits.
509
+ # @param [Google::Apis::RequestOptions] options
510
+ # Request-specific options
511
+ #
512
+ # @yield [result, err] Result & error if block supplied
513
+ # @yieldparam result [Google::Apis::GmailV1::Label] parsed result object
514
+ # @yieldparam err [StandardError] error object if request failed
515
+ #
516
+ # @return [Google::Apis::GmailV1::Label]
517
+ #
518
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
519
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
520
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
521
+ def create_user_label(user_id, label_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
522
+ command = make_simple_command(:post, '{userId}/labels', options)
523
+ command.request_representation = Google::Apis::GmailV1::Label::Representation
524
+ command.request_object = label_object
525
+ command.response_representation = Google::Apis::GmailV1::Label::Representation
526
+ command.response_class = Google::Apis::GmailV1::Label
527
+ command.params['userId'] = user_id unless user_id.nil?
528
+ command.query['fields'] = fields unless fields.nil?
529
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
530
+ command.query['userIp'] = user_ip unless user_ip.nil?
531
+ execute_or_queue_command(command, &block)
532
+ end
533
+
534
+ # Immediately and permanently deletes the specified label and removes it from
535
+ # any messages and threads that it is applied to.
536
+ # @param [String] user_id
537
+ # The user's email address. The special value me can be used to indicate the
538
+ # authenticated user.
539
+ # @param [String] id
540
+ # The ID of the label to delete.
541
+ # @param [String] fields
542
+ # Selector specifying which fields to include in a partial response.
543
+ # @param [String] quota_user
544
+ # Available to use for quota purposes for server-side applications. Can be any
545
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
546
+ # Overrides userIp if both are provided.
547
+ # @param [String] user_ip
548
+ # IP address of the site where the request originates. Use this if you want to
549
+ # enforce per-user limits.
550
+ # @param [Google::Apis::RequestOptions] options
551
+ # Request-specific options
552
+ #
553
+ # @yield [result, err] Result & error if block supplied
554
+ # @yieldparam result [NilClass] No result returned for this method
555
+ # @yieldparam err [StandardError] error object if request failed
556
+ #
557
+ # @return [void]
558
+ #
559
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
560
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
561
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
562
+ def delete_user_label(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
563
+ command = make_simple_command(:delete, '{userId}/labels/{id}', options)
564
+ command.params['userId'] = user_id unless user_id.nil?
565
+ command.params['id'] = id unless id.nil?
566
+ command.query['fields'] = fields unless fields.nil?
567
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
568
+ command.query['userIp'] = user_ip unless user_ip.nil?
569
+ execute_or_queue_command(command, &block)
570
+ end
571
+
572
+ # Gets the specified label.
573
+ # @param [String] user_id
574
+ # The user's email address. The special value me can be used to indicate the
575
+ # authenticated user.
576
+ # @param [String] id
577
+ # The ID of the label to retrieve.
578
+ # @param [String] fields
579
+ # Selector specifying which fields to include in a partial response.
580
+ # @param [String] quota_user
581
+ # Available to use for quota purposes for server-side applications. Can be any
582
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
583
+ # Overrides userIp if both are provided.
584
+ # @param [String] user_ip
585
+ # IP address of the site where the request originates. Use this if you want to
586
+ # enforce per-user limits.
587
+ # @param [Google::Apis::RequestOptions] options
588
+ # Request-specific options
589
+ #
590
+ # @yield [result, err] Result & error if block supplied
591
+ # @yieldparam result [Google::Apis::GmailV1::Label] parsed result object
592
+ # @yieldparam err [StandardError] error object if request failed
593
+ #
594
+ # @return [Google::Apis::GmailV1::Label]
595
+ #
596
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
597
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
598
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
599
+ def get_user_label(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
600
+ command = make_simple_command(:get, '{userId}/labels/{id}', options)
601
+ command.response_representation = Google::Apis::GmailV1::Label::Representation
602
+ command.response_class = Google::Apis::GmailV1::Label
603
+ command.params['userId'] = user_id unless user_id.nil?
604
+ command.params['id'] = id unless id.nil?
605
+ command.query['fields'] = fields unless fields.nil?
606
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
607
+ command.query['userIp'] = user_ip unless user_ip.nil?
608
+ execute_or_queue_command(command, &block)
609
+ end
610
+
611
+ # Lists all labels in the user's mailbox.
612
+ # @param [String] user_id
613
+ # The user's email address. The special value me can be used to indicate the
614
+ # authenticated user.
615
+ # @param [String] fields
616
+ # Selector specifying which fields to include in a partial response.
617
+ # @param [String] quota_user
618
+ # Available to use for quota purposes for server-side applications. Can be any
619
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
620
+ # Overrides userIp if both are provided.
621
+ # @param [String] user_ip
622
+ # IP address of the site where the request originates. Use this if you want to
623
+ # enforce per-user limits.
624
+ # @param [Google::Apis::RequestOptions] options
625
+ # Request-specific options
626
+ #
627
+ # @yield [result, err] Result & error if block supplied
628
+ # @yieldparam result [Google::Apis::GmailV1::ListLabelsResponse] parsed result object
629
+ # @yieldparam err [StandardError] error object if request failed
630
+ #
631
+ # @return [Google::Apis::GmailV1::ListLabelsResponse]
632
+ #
633
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
634
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
635
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
636
+ def list_user_labels(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
637
+ command = make_simple_command(:get, '{userId}/labels', options)
638
+ command.response_representation = Google::Apis::GmailV1::ListLabelsResponse::Representation
639
+ command.response_class = Google::Apis::GmailV1::ListLabelsResponse
640
+ command.params['userId'] = user_id unless user_id.nil?
641
+ command.query['fields'] = fields unless fields.nil?
642
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
643
+ command.query['userIp'] = user_ip unless user_ip.nil?
644
+ execute_or_queue_command(command, &block)
645
+ end
646
+
647
+ # Updates the specified label. This method supports patch semantics.
648
+ # @param [String] user_id
649
+ # The user's email address. The special value me can be used to indicate the
650
+ # authenticated user.
651
+ # @param [String] id
652
+ # The ID of the label to update.
653
+ # @param [Google::Apis::GmailV1::Label] label_object
654
+ # @param [String] fields
655
+ # Selector specifying which fields to include in a partial response.
656
+ # @param [String] quota_user
657
+ # Available to use for quota purposes for server-side applications. Can be any
658
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
659
+ # Overrides userIp if both are provided.
660
+ # @param [String] user_ip
661
+ # IP address of the site where the request originates. Use this if you want to
662
+ # enforce per-user limits.
663
+ # @param [Google::Apis::RequestOptions] options
664
+ # Request-specific options
665
+ #
666
+ # @yield [result, err] Result & error if block supplied
667
+ # @yieldparam result [Google::Apis::GmailV1::Label] parsed result object
668
+ # @yieldparam err [StandardError] error object if request failed
669
+ #
670
+ # @return [Google::Apis::GmailV1::Label]
671
+ #
672
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
673
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
674
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
675
+ def patch_user_label(user_id, id, label_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
676
+ command = make_simple_command(:patch, '{userId}/labels/{id}', options)
677
+ command.request_representation = Google::Apis::GmailV1::Label::Representation
678
+ command.request_object = label_object
679
+ command.response_representation = Google::Apis::GmailV1::Label::Representation
680
+ command.response_class = Google::Apis::GmailV1::Label
681
+ command.params['userId'] = user_id unless user_id.nil?
682
+ command.params['id'] = id unless id.nil?
683
+ command.query['fields'] = fields unless fields.nil?
684
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
685
+ command.query['userIp'] = user_ip unless user_ip.nil?
686
+ execute_or_queue_command(command, &block)
687
+ end
688
+
689
+ # Updates the specified label.
690
+ # @param [String] user_id
691
+ # The user's email address. The special value me can be used to indicate the
692
+ # authenticated user.
693
+ # @param [String] id
694
+ # The ID of the label to update.
695
+ # @param [Google::Apis::GmailV1::Label] label_object
696
+ # @param [String] fields
697
+ # Selector specifying which fields to include in a partial response.
698
+ # @param [String] quota_user
699
+ # Available to use for quota purposes for server-side applications. Can be any
700
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
701
+ # Overrides userIp if both are provided.
702
+ # @param [String] user_ip
703
+ # IP address of the site where the request originates. Use this if you want to
704
+ # enforce per-user limits.
705
+ # @param [Google::Apis::RequestOptions] options
706
+ # Request-specific options
707
+ #
708
+ # @yield [result, err] Result & error if block supplied
709
+ # @yieldparam result [Google::Apis::GmailV1::Label] parsed result object
710
+ # @yieldparam err [StandardError] error object if request failed
711
+ #
712
+ # @return [Google::Apis::GmailV1::Label]
713
+ #
714
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
715
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
716
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
717
+ def update_user_label(user_id, id, label_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
718
+ command = make_simple_command(:put, '{userId}/labels/{id}', options)
719
+ command.request_representation = Google::Apis::GmailV1::Label::Representation
720
+ command.request_object = label_object
721
+ command.response_representation = Google::Apis::GmailV1::Label::Representation
722
+ command.response_class = Google::Apis::GmailV1::Label
723
+ command.params['userId'] = user_id unless user_id.nil?
724
+ command.params['id'] = id unless id.nil?
725
+ command.query['fields'] = fields unless fields.nil?
726
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
727
+ command.query['userIp'] = user_ip unless user_ip.nil?
728
+ execute_or_queue_command(command, &block)
729
+ end
730
+
731
+ # Immediately and permanently deletes the specified message. This operation
732
+ # cannot be undone. Prefer messages.trash instead.
733
+ # @param [String] user_id
734
+ # The user's email address. The special value me can be used to indicate the
735
+ # authenticated user.
736
+ # @param [String] id
737
+ # The ID of the message to delete.
738
+ # @param [String] fields
739
+ # Selector specifying which fields to include in a partial response.
740
+ # @param [String] quota_user
741
+ # Available to use for quota purposes for server-side applications. Can be any
742
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
743
+ # Overrides userIp if both are provided.
744
+ # @param [String] user_ip
745
+ # IP address of the site where the request originates. Use this if you want to
746
+ # enforce per-user limits.
747
+ # @param [Google::Apis::RequestOptions] options
748
+ # Request-specific options
749
+ #
750
+ # @yield [result, err] Result & error if block supplied
751
+ # @yieldparam result [NilClass] No result returned for this method
752
+ # @yieldparam err [StandardError] error object if request failed
753
+ #
754
+ # @return [void]
755
+ #
756
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
757
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
758
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
759
+ def delete_user_message(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
760
+ command = make_simple_command(:delete, '{userId}/messages/{id}', options)
761
+ command.params['userId'] = user_id unless user_id.nil?
762
+ command.params['id'] = id unless id.nil?
763
+ command.query['fields'] = fields unless fields.nil?
764
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
765
+ command.query['userIp'] = user_ip unless user_ip.nil?
766
+ execute_or_queue_command(command, &block)
767
+ end
768
+
769
+ # Gets the specified message.
770
+ # @param [String] user_id
771
+ # The user's email address. The special value me can be used to indicate the
772
+ # authenticated user.
773
+ # @param [String] id
774
+ # The ID of the message to retrieve.
775
+ # @param [String] format
776
+ # The format to return the message in.
777
+ # @param [Array<String>, String] metadata_headers
778
+ # When given and format is METADATA, only include headers specified.
779
+ # @param [String] fields
780
+ # Selector specifying which fields to include in a partial response.
781
+ # @param [String] quota_user
782
+ # Available to use for quota purposes for server-side applications. Can be any
783
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
784
+ # Overrides userIp if both are provided.
785
+ # @param [String] user_ip
786
+ # IP address of the site where the request originates. Use this if you want to
787
+ # enforce per-user limits.
788
+ # @param [Google::Apis::RequestOptions] options
789
+ # Request-specific options
790
+ #
791
+ # @yield [result, err] Result & error if block supplied
792
+ # @yieldparam result [Google::Apis::GmailV1::Message] parsed result object
793
+ # @yieldparam err [StandardError] error object if request failed
794
+ #
795
+ # @return [Google::Apis::GmailV1::Message]
796
+ #
797
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
798
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
799
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
800
+ def get_user_message(user_id, id, format: nil, metadata_headers: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
801
+ command = make_simple_command(:get, '{userId}/messages/{id}', options)
802
+ command.response_representation = Google::Apis::GmailV1::Message::Representation
803
+ command.response_class = Google::Apis::GmailV1::Message
804
+ command.params['userId'] = user_id unless user_id.nil?
805
+ command.params['id'] = id unless id.nil?
806
+ command.query['format'] = format unless format.nil?
807
+ command.query['metadataHeaders'] = metadata_headers unless metadata_headers.nil?
808
+ command.query['fields'] = fields unless fields.nil?
809
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
810
+ command.query['userIp'] = user_ip unless user_ip.nil?
811
+ execute_or_queue_command(command, &block)
812
+ end
813
+
814
+ # Imports a message into only this user's mailbox, with standard email delivery
815
+ # scanning and classification similar to receiving via SMTP. Does not send a
816
+ # message.
817
+ # @param [String] user_id
818
+ # The user's email address. The special value me can be used to indicate the
819
+ # authenticated user.
820
+ # @param [Google::Apis::GmailV1::Message] message_object
821
+ # @param [Boolean] deleted
822
+ # Mark the email as permanently deleted (not TRASH) and only visible in Google
823
+ # Apps Vault to a Vault administrator. Only used for Google Apps for Work
824
+ # accounts.
825
+ # @param [String] internal_date_source
826
+ # Source for Gmail's internal date of the message.
827
+ # @param [Boolean] never_mark_spam
828
+ # Ignore the Gmail spam classifier decision and never mark this email as SPAM in
829
+ # the mailbox.
830
+ # @param [Boolean] process_for_calendar
831
+ # Process calendar invites in the email and add any extracted meetings to the
832
+ # Google Calendar for this user.
833
+ # @param [String] fields
834
+ # Selector specifying which fields to include in a partial response.
835
+ # @param [String] quota_user
836
+ # Available to use for quota purposes for server-side applications. Can be any
837
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
838
+ # Overrides userIp if both are provided.
839
+ # @param [String] user_ip
840
+ # IP address of the site where the request originates. Use this if you want to
841
+ # enforce per-user limits.
842
+ # @param [IO, String] upload_source
843
+ # IO stream or filename containing content to upload
844
+ # @param [String] content_type
845
+ # Content type of the uploaded content.
846
+ # @param [Google::Apis::RequestOptions] options
847
+ # Request-specific options
848
+ #
849
+ # @yield [result, err] Result & error if block supplied
850
+ # @yieldparam result [Google::Apis::GmailV1::Message] parsed result object
851
+ # @yieldparam err [StandardError] error object if request failed
852
+ #
853
+ # @return [Google::Apis::GmailV1::Message]
854
+ #
855
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
856
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
857
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
858
+ def import_user_message(user_id, message_object = nil, deleted: nil, internal_date_source: nil, never_mark_spam: nil, process_for_calendar: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
859
+ if upload_source.nil?
860
+ command = make_simple_command(:post, '{userId}/messages/import', options)
861
+ else
862
+ command = make_upload_command(:post, '{userId}/messages/import', options)
863
+ command.upload_source = upload_source
864
+ command.upload_content_type = content_type
865
+ end
866
+ command.request_representation = Google::Apis::GmailV1::Message::Representation
867
+ command.request_object = message_object
868
+ command.response_representation = Google::Apis::GmailV1::Message::Representation
869
+ command.response_class = Google::Apis::GmailV1::Message
870
+ command.params['userId'] = user_id unless user_id.nil?
871
+ command.query['deleted'] = deleted unless deleted.nil?
872
+ command.query['internalDateSource'] = internal_date_source unless internal_date_source.nil?
873
+ command.query['neverMarkSpam'] = never_mark_spam unless never_mark_spam.nil?
874
+ command.query['processForCalendar'] = process_for_calendar unless process_for_calendar.nil?
875
+ command.query['fields'] = fields unless fields.nil?
876
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
877
+ command.query['userIp'] = user_ip unless user_ip.nil?
878
+ execute_or_queue_command(command, &block)
879
+ end
880
+
881
+ # Directly inserts a message into only this user's mailbox similar to IMAP
882
+ # APPEND, bypassing most scanning and classification. Does not send a message.
883
+ # @param [String] user_id
884
+ # The user's email address. The special value me can be used to indicate the
885
+ # authenticated user.
886
+ # @param [Google::Apis::GmailV1::Message] message_object
887
+ # @param [Boolean] deleted
888
+ # Mark the email as permanently deleted (not TRASH) and only visible in Google
889
+ # Apps Vault to a Vault administrator. Only used for Google Apps for Work
890
+ # accounts.
891
+ # @param [String] internal_date_source
892
+ # Source for Gmail's internal date of the message.
893
+ # @param [String] fields
894
+ # Selector specifying which fields to include in a partial response.
895
+ # @param [String] quota_user
896
+ # Available to use for quota purposes for server-side applications. Can be any
897
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
898
+ # Overrides userIp if both are provided.
899
+ # @param [String] user_ip
900
+ # IP address of the site where the request originates. Use this if you want to
901
+ # enforce per-user limits.
902
+ # @param [IO, String] upload_source
903
+ # IO stream or filename containing content to upload
904
+ # @param [String] content_type
905
+ # Content type of the uploaded content.
906
+ # @param [Google::Apis::RequestOptions] options
907
+ # Request-specific options
908
+ #
909
+ # @yield [result, err] Result & error if block supplied
910
+ # @yieldparam result [Google::Apis::GmailV1::Message] parsed result object
911
+ # @yieldparam err [StandardError] error object if request failed
912
+ #
913
+ # @return [Google::Apis::GmailV1::Message]
914
+ #
915
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
916
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
917
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
918
+ def insert_user_message(user_id, message_object = nil, deleted: nil, internal_date_source: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
919
+ if upload_source.nil?
920
+ command = make_simple_command(:post, '{userId}/messages', options)
921
+ else
922
+ command = make_upload_command(:post, '{userId}/messages', options)
923
+ command.upload_source = upload_source
924
+ command.upload_content_type = content_type
925
+ end
926
+ command.request_representation = Google::Apis::GmailV1::Message::Representation
927
+ command.request_object = message_object
928
+ command.response_representation = Google::Apis::GmailV1::Message::Representation
929
+ command.response_class = Google::Apis::GmailV1::Message
930
+ command.params['userId'] = user_id unless user_id.nil?
931
+ command.query['deleted'] = deleted unless deleted.nil?
932
+ command.query['internalDateSource'] = internal_date_source unless internal_date_source.nil?
933
+ command.query['fields'] = fields unless fields.nil?
934
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
935
+ command.query['userIp'] = user_ip unless user_ip.nil?
936
+ execute_or_queue_command(command, &block)
937
+ end
938
+
939
+ # Lists the messages in the user's mailbox.
940
+ # @param [String] user_id
941
+ # The user's email address. The special value me can be used to indicate the
942
+ # authenticated user.
943
+ # @param [Boolean] include_spam_trash
944
+ # Include messages from SPAM and TRASH in the results.
945
+ # @param [Array<String>, String] label_ids
946
+ # Only return messages with labels that match all of the specified label IDs.
947
+ # @param [Fixnum] max_results
948
+ # Maximum number of messages to return.
949
+ # @param [String] page_token
950
+ # Page token to retrieve a specific page of results in the list.
951
+ # @param [String] q
952
+ # Only return messages matching the specified query. Supports the same query
953
+ # format as the Gmail search box. For example, "from:someuser@example.com
954
+ # rfc822msgid: is:unread".
955
+ # @param [String] fields
956
+ # Selector specifying which fields to include in a partial response.
957
+ # @param [String] quota_user
958
+ # Available to use for quota purposes for server-side applications. Can be any
959
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
960
+ # Overrides userIp if both are provided.
961
+ # @param [String] user_ip
962
+ # IP address of the site where the request originates. Use this if you want to
963
+ # enforce per-user limits.
964
+ # @param [Google::Apis::RequestOptions] options
965
+ # Request-specific options
966
+ #
967
+ # @yield [result, err] Result & error if block supplied
968
+ # @yieldparam result [Google::Apis::GmailV1::ListMessagesResponse] parsed result object
969
+ # @yieldparam err [StandardError] error object if request failed
970
+ #
971
+ # @return [Google::Apis::GmailV1::ListMessagesResponse]
972
+ #
973
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
974
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
975
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
976
+ def list_user_messages(user_id, include_spam_trash: nil, label_ids: nil, max_results: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
977
+ command = make_simple_command(:get, '{userId}/messages', options)
978
+ command.response_representation = Google::Apis::GmailV1::ListMessagesResponse::Representation
979
+ command.response_class = Google::Apis::GmailV1::ListMessagesResponse
980
+ command.params['userId'] = user_id unless user_id.nil?
981
+ command.query['includeSpamTrash'] = include_spam_trash unless include_spam_trash.nil?
982
+ command.query['labelIds'] = label_ids unless label_ids.nil?
983
+ command.query['maxResults'] = max_results unless max_results.nil?
984
+ command.query['pageToken'] = page_token unless page_token.nil?
985
+ command.query['q'] = q unless q.nil?
986
+ command.query['fields'] = fields unless fields.nil?
987
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
988
+ command.query['userIp'] = user_ip unless user_ip.nil?
989
+ execute_or_queue_command(command, &block)
990
+ end
991
+
992
+ # Modifies the labels on the specified message.
993
+ # @param [String] user_id
994
+ # The user's email address. The special value me can be used to indicate the
995
+ # authenticated user.
996
+ # @param [String] id
997
+ # The ID of the message to modify.
998
+ # @param [Google::Apis::GmailV1::ModifyMessageRequest] modify_message_request_object
999
+ # @param [String] fields
1000
+ # Selector specifying which fields to include in a partial response.
1001
+ # @param [String] quota_user
1002
+ # Available to use for quota purposes for server-side applications. Can be any
1003
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1004
+ # Overrides userIp if both are provided.
1005
+ # @param [String] user_ip
1006
+ # IP address of the site where the request originates. Use this if you want to
1007
+ # enforce per-user limits.
1008
+ # @param [Google::Apis::RequestOptions] options
1009
+ # Request-specific options
1010
+ #
1011
+ # @yield [result, err] Result & error if block supplied
1012
+ # @yieldparam result [Google::Apis::GmailV1::Message] parsed result object
1013
+ # @yieldparam err [StandardError] error object if request failed
1014
+ #
1015
+ # @return [Google::Apis::GmailV1::Message]
1016
+ #
1017
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1018
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1019
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1020
+ def modify_message(user_id, id, modify_message_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1021
+ command = make_simple_command(:post, '{userId}/messages/{id}/modify', options)
1022
+ command.request_representation = Google::Apis::GmailV1::ModifyMessageRequest::Representation
1023
+ command.request_object = modify_message_request_object
1024
+ command.response_representation = Google::Apis::GmailV1::Message::Representation
1025
+ command.response_class = Google::Apis::GmailV1::Message
1026
+ command.params['userId'] = user_id unless user_id.nil?
1027
+ command.params['id'] = id unless id.nil?
1028
+ command.query['fields'] = fields unless fields.nil?
1029
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1030
+ command.query['userIp'] = user_ip unless user_ip.nil?
1031
+ execute_or_queue_command(command, &block)
1032
+ end
1033
+
1034
+ # Sends the specified message to the recipients in the To, Cc, and Bcc headers.
1035
+ # @param [String] user_id
1036
+ # The user's email address. The special value me can be used to indicate the
1037
+ # authenticated user.
1038
+ # @param [Google::Apis::GmailV1::Message] message_object
1039
+ # @param [String] fields
1040
+ # Selector specifying which fields to include in a partial response.
1041
+ # @param [String] quota_user
1042
+ # Available to use for quota purposes for server-side applications. Can be any
1043
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1044
+ # Overrides userIp if both are provided.
1045
+ # @param [String] user_ip
1046
+ # IP address of the site where the request originates. Use this if you want to
1047
+ # enforce per-user limits.
1048
+ # @param [IO, String] upload_source
1049
+ # IO stream or filename containing content to upload
1050
+ # @param [String] content_type
1051
+ # Content type of the uploaded content.
1052
+ # @param [Google::Apis::RequestOptions] options
1053
+ # Request-specific options
1054
+ #
1055
+ # @yield [result, err] Result & error if block supplied
1056
+ # @yieldparam result [Google::Apis::GmailV1::Message] parsed result object
1057
+ # @yieldparam err [StandardError] error object if request failed
1058
+ #
1059
+ # @return [Google::Apis::GmailV1::Message]
1060
+ #
1061
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1062
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1063
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1064
+ def send_user_message(user_id, message_object = nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
1065
+ if upload_source.nil?
1066
+ command = make_simple_command(:post, '{userId}/messages/send', options)
1067
+ else
1068
+ command = make_upload_command(:post, '{userId}/messages/send', options)
1069
+ command.upload_source = upload_source
1070
+ command.upload_content_type = content_type
1071
+ end
1072
+ command.request_representation = Google::Apis::GmailV1::Message::Representation
1073
+ command.request_object = message_object
1074
+ command.response_representation = Google::Apis::GmailV1::Message::Representation
1075
+ command.response_class = Google::Apis::GmailV1::Message
1076
+ command.params['userId'] = user_id unless user_id.nil?
1077
+ command.query['fields'] = fields unless fields.nil?
1078
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1079
+ command.query['userIp'] = user_ip unless user_ip.nil?
1080
+ execute_or_queue_command(command, &block)
1081
+ end
1082
+
1083
+ # Moves the specified message to the trash.
1084
+ # @param [String] user_id
1085
+ # The user's email address. The special value me can be used to indicate the
1086
+ # authenticated user.
1087
+ # @param [String] id
1088
+ # The ID of the message to Trash.
1089
+ # @param [String] fields
1090
+ # Selector specifying which fields to include in a partial response.
1091
+ # @param [String] quota_user
1092
+ # Available to use for quota purposes for server-side applications. Can be any
1093
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1094
+ # Overrides userIp if both are provided.
1095
+ # @param [String] user_ip
1096
+ # IP address of the site where the request originates. Use this if you want to
1097
+ # enforce per-user limits.
1098
+ # @param [Google::Apis::RequestOptions] options
1099
+ # Request-specific options
1100
+ #
1101
+ # @yield [result, err] Result & error if block supplied
1102
+ # @yieldparam result [Google::Apis::GmailV1::Message] parsed result object
1103
+ # @yieldparam err [StandardError] error object if request failed
1104
+ #
1105
+ # @return [Google::Apis::GmailV1::Message]
1106
+ #
1107
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1108
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1109
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1110
+ def trash_user_message(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1111
+ command = make_simple_command(:post, '{userId}/messages/{id}/trash', options)
1112
+ command.response_representation = Google::Apis::GmailV1::Message::Representation
1113
+ command.response_class = Google::Apis::GmailV1::Message
1114
+ command.params['userId'] = user_id unless user_id.nil?
1115
+ command.params['id'] = id unless id.nil?
1116
+ command.query['fields'] = fields unless fields.nil?
1117
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1118
+ command.query['userIp'] = user_ip unless user_ip.nil?
1119
+ execute_or_queue_command(command, &block)
1120
+ end
1121
+
1122
+ # Removes the specified message from the trash.
1123
+ # @param [String] user_id
1124
+ # The user's email address. The special value me can be used to indicate the
1125
+ # authenticated user.
1126
+ # @param [String] id
1127
+ # The ID of the message to remove from Trash.
1128
+ # @param [String] fields
1129
+ # Selector specifying which fields to include in a partial response.
1130
+ # @param [String] quota_user
1131
+ # Available to use for quota purposes for server-side applications. Can be any
1132
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1133
+ # Overrides userIp if both are provided.
1134
+ # @param [String] user_ip
1135
+ # IP address of the site where the request originates. Use this if you want to
1136
+ # enforce per-user limits.
1137
+ # @param [Google::Apis::RequestOptions] options
1138
+ # Request-specific options
1139
+ #
1140
+ # @yield [result, err] Result & error if block supplied
1141
+ # @yieldparam result [Google::Apis::GmailV1::Message] parsed result object
1142
+ # @yieldparam err [StandardError] error object if request failed
1143
+ #
1144
+ # @return [Google::Apis::GmailV1::Message]
1145
+ #
1146
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1147
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1148
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1149
+ def untrash_user_message(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1150
+ command = make_simple_command(:post, '{userId}/messages/{id}/untrash', options)
1151
+ command.response_representation = Google::Apis::GmailV1::Message::Representation
1152
+ command.response_class = Google::Apis::GmailV1::Message
1153
+ command.params['userId'] = user_id unless user_id.nil?
1154
+ command.params['id'] = id unless id.nil?
1155
+ command.query['fields'] = fields unless fields.nil?
1156
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1157
+ command.query['userIp'] = user_ip unless user_ip.nil?
1158
+ execute_or_queue_command(command, &block)
1159
+ end
1160
+
1161
+ # Gets the specified message attachment.
1162
+ # @param [String] user_id
1163
+ # The user's email address. The special value me can be used to indicate the
1164
+ # authenticated user.
1165
+ # @param [String] message_id
1166
+ # The ID of the message containing the attachment.
1167
+ # @param [String] id
1168
+ # The ID of the attachment.
1169
+ # @param [String] fields
1170
+ # Selector specifying which fields to include in a partial response.
1171
+ # @param [String] quota_user
1172
+ # Available to use for quota purposes for server-side applications. Can be any
1173
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1174
+ # Overrides userIp if both are provided.
1175
+ # @param [String] user_ip
1176
+ # IP address of the site where the request originates. Use this if you want to
1177
+ # enforce per-user limits.
1178
+ # @param [Google::Apis::RequestOptions] options
1179
+ # Request-specific options
1180
+ #
1181
+ # @yield [result, err] Result & error if block supplied
1182
+ # @yieldparam result [Google::Apis::GmailV1::MessagePartBody] parsed result object
1183
+ # @yieldparam err [StandardError] error object if request failed
1184
+ #
1185
+ # @return [Google::Apis::GmailV1::MessagePartBody]
1186
+ #
1187
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1188
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1189
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1190
+ def get_user_message_attachment(user_id, message_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1191
+ command = make_simple_command(:get, '{userId}/messages/{messageId}/attachments/{id}', options)
1192
+ command.response_representation = Google::Apis::GmailV1::MessagePartBody::Representation
1193
+ command.response_class = Google::Apis::GmailV1::MessagePartBody
1194
+ command.params['userId'] = user_id unless user_id.nil?
1195
+ command.params['messageId'] = message_id unless message_id.nil?
1196
+ command.params['id'] = id unless id.nil?
1197
+ command.query['fields'] = fields unless fields.nil?
1198
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1199
+ command.query['userIp'] = user_ip unless user_ip.nil?
1200
+ execute_or_queue_command(command, &block)
1201
+ end
1202
+
1203
+ # Immediately and permanently deletes the specified thread. This operation
1204
+ # cannot be undone. Prefer threads.trash instead.
1205
+ # @param [String] user_id
1206
+ # The user's email address. The special value me can be used to indicate the
1207
+ # authenticated user.
1208
+ # @param [String] id
1209
+ # ID of the Thread to delete.
1210
+ # @param [String] fields
1211
+ # Selector specifying which fields to include in a partial response.
1212
+ # @param [String] quota_user
1213
+ # Available to use for quota purposes for server-side applications. Can be any
1214
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1215
+ # Overrides userIp if both are provided.
1216
+ # @param [String] user_ip
1217
+ # IP address of the site where the request originates. Use this if you want to
1218
+ # enforce per-user limits.
1219
+ # @param [Google::Apis::RequestOptions] options
1220
+ # Request-specific options
1221
+ #
1222
+ # @yield [result, err] Result & error if block supplied
1223
+ # @yieldparam result [NilClass] No result returned for this method
1224
+ # @yieldparam err [StandardError] error object if request failed
1225
+ #
1226
+ # @return [void]
1227
+ #
1228
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1229
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1230
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1231
+ def delete_user_thread(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1232
+ command = make_simple_command(:delete, '{userId}/threads/{id}', options)
1233
+ command.params['userId'] = user_id unless user_id.nil?
1234
+ command.params['id'] = id unless id.nil?
1235
+ command.query['fields'] = fields unless fields.nil?
1236
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1237
+ command.query['userIp'] = user_ip unless user_ip.nil?
1238
+ execute_or_queue_command(command, &block)
1239
+ end
1240
+
1241
+ # Gets the specified thread.
1242
+ # @param [String] user_id
1243
+ # The user's email address. The special value me can be used to indicate the
1244
+ # authenticated user.
1245
+ # @param [String] id
1246
+ # The ID of the thread to retrieve.
1247
+ # @param [String] format
1248
+ # The format to return the messages in.
1249
+ # @param [Array<String>, String] metadata_headers
1250
+ # When given and format is METADATA, only include headers specified.
1251
+ # @param [String] fields
1252
+ # Selector specifying which fields to include in a partial response.
1253
+ # @param [String] quota_user
1254
+ # Available to use for quota purposes for server-side applications. Can be any
1255
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1256
+ # Overrides userIp if both are provided.
1257
+ # @param [String] user_ip
1258
+ # IP address of the site where the request originates. Use this if you want to
1259
+ # enforce per-user limits.
1260
+ # @param [Google::Apis::RequestOptions] options
1261
+ # Request-specific options
1262
+ #
1263
+ # @yield [result, err] Result & error if block supplied
1264
+ # @yieldparam result [Google::Apis::GmailV1::Thread] parsed result object
1265
+ # @yieldparam err [StandardError] error object if request failed
1266
+ #
1267
+ # @return [Google::Apis::GmailV1::Thread]
1268
+ #
1269
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1270
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1271
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1272
+ def get_user_thread(user_id, id, format: nil, metadata_headers: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1273
+ command = make_simple_command(:get, '{userId}/threads/{id}', options)
1274
+ command.response_representation = Google::Apis::GmailV1::Thread::Representation
1275
+ command.response_class = Google::Apis::GmailV1::Thread
1276
+ command.params['userId'] = user_id unless user_id.nil?
1277
+ command.params['id'] = id unless id.nil?
1278
+ command.query['format'] = format unless format.nil?
1279
+ command.query['metadataHeaders'] = metadata_headers unless metadata_headers.nil?
1280
+ command.query['fields'] = fields unless fields.nil?
1281
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1282
+ command.query['userIp'] = user_ip unless user_ip.nil?
1283
+ execute_or_queue_command(command, &block)
1284
+ end
1285
+
1286
+ # Lists the threads in the user's mailbox.
1287
+ # @param [String] user_id
1288
+ # The user's email address. The special value me can be used to indicate the
1289
+ # authenticated user.
1290
+ # @param [Boolean] include_spam_trash
1291
+ # Include threads from SPAM and TRASH in the results.
1292
+ # @param [Array<String>, String] label_ids
1293
+ # Only return threads with labels that match all of the specified label IDs.
1294
+ # @param [Fixnum] max_results
1295
+ # Maximum number of threads to return.
1296
+ # @param [String] page_token
1297
+ # Page token to retrieve a specific page of results in the list.
1298
+ # @param [String] q
1299
+ # Only return threads matching the specified query. Supports the same query
1300
+ # format as the Gmail search box. For example, "from:someuser@example.com
1301
+ # rfc822msgid: is:unread".
1302
+ # @param [String] fields
1303
+ # Selector specifying which fields to include in a partial response.
1304
+ # @param [String] quota_user
1305
+ # Available to use for quota purposes for server-side applications. Can be any
1306
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1307
+ # Overrides userIp if both are provided.
1308
+ # @param [String] user_ip
1309
+ # IP address of the site where the request originates. Use this if you want to
1310
+ # enforce per-user limits.
1311
+ # @param [Google::Apis::RequestOptions] options
1312
+ # Request-specific options
1313
+ #
1314
+ # @yield [result, err] Result & error if block supplied
1315
+ # @yieldparam result [Google::Apis::GmailV1::ListThreadsResponse] parsed result object
1316
+ # @yieldparam err [StandardError] error object if request failed
1317
+ #
1318
+ # @return [Google::Apis::GmailV1::ListThreadsResponse]
1319
+ #
1320
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1321
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1322
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1323
+ def list_user_threads(user_id, include_spam_trash: nil, label_ids: nil, max_results: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1324
+ command = make_simple_command(:get, '{userId}/threads', options)
1325
+ command.response_representation = Google::Apis::GmailV1::ListThreadsResponse::Representation
1326
+ command.response_class = Google::Apis::GmailV1::ListThreadsResponse
1327
+ command.params['userId'] = user_id unless user_id.nil?
1328
+ command.query['includeSpamTrash'] = include_spam_trash unless include_spam_trash.nil?
1329
+ command.query['labelIds'] = label_ids unless label_ids.nil?
1330
+ command.query['maxResults'] = max_results unless max_results.nil?
1331
+ command.query['pageToken'] = page_token unless page_token.nil?
1332
+ command.query['q'] = q unless q.nil?
1333
+ command.query['fields'] = fields unless fields.nil?
1334
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1335
+ command.query['userIp'] = user_ip unless user_ip.nil?
1336
+ execute_or_queue_command(command, &block)
1337
+ end
1338
+
1339
+ # Modifies the labels applied to the thread. This applies to all messages in the
1340
+ # thread.
1341
+ # @param [String] user_id
1342
+ # The user's email address. The special value me can be used to indicate the
1343
+ # authenticated user.
1344
+ # @param [String] id
1345
+ # The ID of the thread to modify.
1346
+ # @param [Google::Apis::GmailV1::ModifyThreadRequest] modify_thread_request_object
1347
+ # @param [String] fields
1348
+ # Selector specifying which fields to include in a partial response.
1349
+ # @param [String] quota_user
1350
+ # Available to use for quota purposes for server-side applications. Can be any
1351
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1352
+ # Overrides userIp if both are provided.
1353
+ # @param [String] user_ip
1354
+ # IP address of the site where the request originates. Use this if you want to
1355
+ # enforce per-user limits.
1356
+ # @param [Google::Apis::RequestOptions] options
1357
+ # Request-specific options
1358
+ #
1359
+ # @yield [result, err] Result & error if block supplied
1360
+ # @yieldparam result [Google::Apis::GmailV1::Thread] parsed result object
1361
+ # @yieldparam err [StandardError] error object if request failed
1362
+ #
1363
+ # @return [Google::Apis::GmailV1::Thread]
1364
+ #
1365
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1366
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1367
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1368
+ def modify_thread(user_id, id, modify_thread_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1369
+ command = make_simple_command(:post, '{userId}/threads/{id}/modify', options)
1370
+ command.request_representation = Google::Apis::GmailV1::ModifyThreadRequest::Representation
1371
+ command.request_object = modify_thread_request_object
1372
+ command.response_representation = Google::Apis::GmailV1::Thread::Representation
1373
+ command.response_class = Google::Apis::GmailV1::Thread
1374
+ command.params['userId'] = user_id unless user_id.nil?
1375
+ command.params['id'] = id unless id.nil?
1376
+ command.query['fields'] = fields unless fields.nil?
1377
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1378
+ command.query['userIp'] = user_ip unless user_ip.nil?
1379
+ execute_or_queue_command(command, &block)
1380
+ end
1381
+
1382
+ # Moves the specified thread to the trash.
1383
+ # @param [String] user_id
1384
+ # The user's email address. The special value me can be used to indicate the
1385
+ # authenticated user.
1386
+ # @param [String] id
1387
+ # The ID of the thread to Trash.
1388
+ # @param [String] fields
1389
+ # Selector specifying which fields to include in a partial response.
1390
+ # @param [String] quota_user
1391
+ # Available to use for quota purposes for server-side applications. Can be any
1392
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1393
+ # Overrides userIp if both are provided.
1394
+ # @param [String] user_ip
1395
+ # IP address of the site where the request originates. Use this if you want to
1396
+ # enforce per-user limits.
1397
+ # @param [Google::Apis::RequestOptions] options
1398
+ # Request-specific options
1399
+ #
1400
+ # @yield [result, err] Result & error if block supplied
1401
+ # @yieldparam result [Google::Apis::GmailV1::Thread] parsed result object
1402
+ # @yieldparam err [StandardError] error object if request failed
1403
+ #
1404
+ # @return [Google::Apis::GmailV1::Thread]
1405
+ #
1406
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1407
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1408
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1409
+ def trash_user_thread(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1410
+ command = make_simple_command(:post, '{userId}/threads/{id}/trash', options)
1411
+ command.response_representation = Google::Apis::GmailV1::Thread::Representation
1412
+ command.response_class = Google::Apis::GmailV1::Thread
1413
+ command.params['userId'] = user_id unless user_id.nil?
1414
+ command.params['id'] = id unless id.nil?
1415
+ command.query['fields'] = fields unless fields.nil?
1416
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1417
+ command.query['userIp'] = user_ip unless user_ip.nil?
1418
+ execute_or_queue_command(command, &block)
1419
+ end
1420
+
1421
+ # Removes the specified thread from the trash.
1422
+ # @param [String] user_id
1423
+ # The user's email address. The special value me can be used to indicate the
1424
+ # authenticated user.
1425
+ # @param [String] id
1426
+ # The ID of the thread to remove from Trash.
1427
+ # @param [String] fields
1428
+ # Selector specifying which fields to include in a partial response.
1429
+ # @param [String] quota_user
1430
+ # Available to use for quota purposes for server-side applications. Can be any
1431
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1432
+ # Overrides userIp if both are provided.
1433
+ # @param [String] user_ip
1434
+ # IP address of the site where the request originates. Use this if you want to
1435
+ # enforce per-user limits.
1436
+ # @param [Google::Apis::RequestOptions] options
1437
+ # Request-specific options
1438
+ #
1439
+ # @yield [result, err] Result & error if block supplied
1440
+ # @yieldparam result [Google::Apis::GmailV1::Thread] parsed result object
1441
+ # @yieldparam err [StandardError] error object if request failed
1442
+ #
1443
+ # @return [Google::Apis::GmailV1::Thread]
1444
+ #
1445
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1446
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1447
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1448
+ def untrash_user_thread(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1449
+ command = make_simple_command(:post, '{userId}/threads/{id}/untrash', options)
1450
+ command.response_representation = Google::Apis::GmailV1::Thread::Representation
1451
+ command.response_class = Google::Apis::GmailV1::Thread
1452
+ command.params['userId'] = user_id unless user_id.nil?
1453
+ command.params['id'] = id unless id.nil?
1454
+ command.query['fields'] = fields unless fields.nil?
1455
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1456
+ command.query['userIp'] = user_ip unless user_ip.nil?
1457
+ execute_or_queue_command(command, &block)
1458
+ end
1459
+
1460
+ protected
1461
+
1462
+ def apply_command_defaults(command)
1463
+ command.query['key'] = key unless key.nil?
1464
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1465
+ command.query['userIp'] = user_ip unless user_ip.nil?
1466
+ end
1467
+ end
1468
+ end
1469
+ end
1470
+ end