google-api-client 0.9.8 → 0.10.2

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 (320) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +15 -8
  3. data/CHANGELOG.md +84 -0
  4. data/Gemfile +10 -2
  5. data/README.md +10 -2
  6. data/api_names.yaml +37172 -135
  7. data/generated/google/apis/adexchangebuyer2_v2beta1.rb +35 -0
  8. data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +1200 -0
  9. data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +526 -0
  10. data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +844 -0
  11. data/generated/google/apis/adexchangebuyer_v1_4.rb +1 -1
  12. data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +310 -28
  13. data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +84 -0
  14. data/generated/google/apis/adexchangebuyer_v1_4/service.rb +60 -8
  15. data/generated/google/apis/adexchangeseller_v2_0.rb +2 -3
  16. data/generated/google/apis/adexchangeseller_v2_0/service.rb +1 -2
  17. data/generated/google/apis/admin_directory_v1.rb +1 -1
  18. data/generated/google/apis/admin_directory_v1/classes.rb +206 -0
  19. data/generated/google/apis/admin_directory_v1/representations.rb +63 -0
  20. data/generated/google/apis/admin_directory_v1/service.rb +41 -2
  21. data/generated/google/apis/admin_reports_v1.rb +5 -5
  22. data/generated/google/apis/admin_reports_v1/service.rb +6 -6
  23. data/generated/google/apis/adsense_v1_4.rb +1 -1
  24. data/generated/google/apis/adsense_v1_4/classes.rb +1 -1
  25. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  26. data/generated/google/apis/adsensehost_v4_1/classes.rb +1 -2
  27. data/generated/google/apis/analytics_v3.rb +1 -1
  28. data/generated/google/apis/analytics_v3/classes.rb +379 -3
  29. data/generated/google/apis/analytics_v3/representations.rb +136 -0
  30. data/generated/google/apis/analytics_v3/service.rb +256 -0
  31. data/generated/google/apis/analyticsreporting_v4.rb +1 -1
  32. data/generated/google/apis/analyticsreporting_v4/classes.rb +858 -823
  33. data/generated/google/apis/analyticsreporting_v4/representations.rb +194 -193
  34. data/generated/google/apis/analyticsreporting_v4/service.rb +4 -4
  35. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  36. data/generated/google/apis/androidenterprise_v1/classes.rb +913 -220
  37. data/generated/google/apis/androidenterprise_v1/representations.rb +337 -30
  38. data/generated/google/apis/androidenterprise_v1/service.rb +1163 -561
  39. data/generated/google/apis/androidpublisher_v2.rb +1 -1
  40. data/generated/google/apis/androidpublisher_v2/classes.rb +230 -8
  41. data/generated/google/apis/androidpublisher_v2/representations.rb +90 -0
  42. data/generated/google/apis/androidpublisher_v2/service.rb +116 -3
  43. data/generated/google/apis/appengine_v1beta5.rb +7 -1
  44. data/generated/google/apis/appengine_v1beta5/classes.rb +810 -395
  45. data/generated/google/apis/appengine_v1beta5/representations.rb +188 -22
  46. data/generated/google/apis/appengine_v1beta5/service.rb +343 -39
  47. data/generated/google/apis/appsactivity_v1.rb +3 -3
  48. data/generated/google/apis/appsactivity_v1/classes.rb +7 -0
  49. data/generated/google/apis/appsactivity_v1/representations.rb +1 -0
  50. data/generated/google/apis/appsactivity_v1/service.rb +1 -1
  51. data/generated/google/apis/appstate_v1.rb +1 -1
  52. data/generated/google/apis/bigquery_v2.rb +1 -1
  53. data/generated/google/apis/bigquery_v2/classes.rb +360 -38
  54. data/generated/google/apis/bigquery_v2/representations.rb +106 -0
  55. data/generated/google/apis/bigquery_v2/service.rb +18 -4
  56. data/generated/google/apis/books_v1.rb +2 -2
  57. data/generated/google/apis/books_v1/classes.rb +83 -0
  58. data/generated/google/apis/books_v1/representations.rb +35 -0
  59. data/generated/google/apis/books_v1/service.rb +7 -3
  60. data/generated/google/apis/calendar_v3.rb +1 -1
  61. data/generated/google/apis/calendar_v3/classes.rb +208 -5
  62. data/generated/google/apis/calendar_v3/representations.rb +97 -0
  63. data/generated/google/apis/civicinfo_v2.rb +3 -2
  64. data/generated/google/apis/civicinfo_v2/classes.rb +377 -5
  65. data/generated/google/apis/civicinfo_v2/representations.rb +149 -0
  66. data/generated/google/apis/civicinfo_v2/service.rb +27 -6
  67. data/generated/google/apis/classroom_v1.rb +22 -25
  68. data/generated/google/apis/classroom_v1/classes.rb +998 -761
  69. data/generated/google/apis/classroom_v1/representations.rb +263 -198
  70. data/generated/google/apis/classroom_v1/service.rb +1349 -672
  71. data/generated/google/apis/cloudbilling_v1.rb +3 -3
  72. data/generated/google/apis/cloudbilling_v1/classes.rb +76 -75
  73. data/generated/google/apis/cloudbilling_v1/representations.rb +17 -17
  74. data/generated/google/apis/cloudbilling_v1/service.rb +117 -110
  75. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  76. data/generated/google/apis/cloudbuild_v1/classes.rb +661 -264
  77. data/generated/google/apis/cloudbuild_v1/representations.rb +198 -48
  78. data/generated/google/apis/cloudbuild_v1/service.rb +259 -44
  79. data/generated/google/apis/clouddebugger_v2.rb +5 -8
  80. data/generated/google/apis/clouddebugger_v2/classes.rb +686 -616
  81. data/generated/google/apis/clouddebugger_v2/representations.rb +151 -151
  82. data/generated/google/apis/clouddebugger_v2/service.rb +165 -159
  83. data/generated/google/apis/cloudkms_v1.rb +35 -0
  84. data/generated/google/apis/cloudkms_v1/classes.rb +1022 -0
  85. data/generated/google/apis/cloudkms_v1/representations.rb +448 -0
  86. data/generated/google/apis/cloudkms_v1/service.rb +933 -0
  87. data/generated/google/apis/cloudkms_v1beta1.rb +35 -0
  88. data/generated/google/apis/cloudkms_v1beta1/classes.rb +1039 -0
  89. data/generated/google/apis/cloudkms_v1beta1/representations.rb +448 -0
  90. data/generated/google/apis/cloudkms_v1beta1/service.rb +933 -0
  91. data/generated/google/apis/cloudmonitoring_v2beta2.rb +1 -1
  92. data/generated/google/apis/cloudresourcemanager_v1.rb +4 -4
  93. data/generated/google/apis/cloudresourcemanager_v1/classes.rb +1529 -167
  94. data/generated/google/apis/cloudresourcemanager_v1/representations.rb +491 -26
  95. data/generated/google/apis/cloudresourcemanager_v1/service.rb +1593 -135
  96. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
  97. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +1155 -235
  98. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +344 -44
  99. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +702 -310
  100. data/generated/google/apis/cloudtrace_v1.rb +9 -9
  101. data/generated/google/apis/cloudtrace_v1/classes.rb +98 -92
  102. data/generated/google/apis/cloudtrace_v1/representations.rb +24 -24
  103. data/generated/google/apis/cloudtrace_v1/service.rb +42 -37
  104. data/generated/google/apis/compute_beta.rb +1 -1
  105. data/generated/google/apis/compute_beta/classes.rb +7007 -3648
  106. data/generated/google/apis/compute_beta/representations.rb +1459 -120
  107. data/generated/google/apis/compute_beta/service.rb +7943 -3726
  108. data/generated/google/apis/compute_v1.rb +1 -1
  109. data/generated/google/apis/compute_v1/classes.rb +2567 -370
  110. data/generated/google/apis/compute_v1/representations.rb +855 -0
  111. data/generated/google/apis/compute_v1/service.rb +6388 -2908
  112. data/generated/google/apis/container_v1.rb +1 -1
  113. data/generated/google/apis/container_v1/classes.rb +287 -16
  114. data/generated/google/apis/container_v1/representations.rb +113 -2
  115. data/generated/google/apis/container_v1/service.rb +130 -0
  116. data/generated/google/apis/content_v2.rb +1 -1
  117. data/generated/google/apis/content_v2/classes.rb +778 -10
  118. data/generated/google/apis/content_v2/representations.rb +339 -0
  119. data/generated/google/apis/content_v2/service.rb +364 -49
  120. data/generated/google/apis/dataflow_v1b3.rb +37 -0
  121. data/generated/google/apis/dataflow_v1b3/classes.rb +4941 -0
  122. data/generated/google/apis/dataflow_v1b3/representations.rb +2037 -0
  123. data/generated/google/apis/dataflow_v1b3/service.rb +957 -0
  124. data/generated/google/apis/dataproc_v1.rb +1 -1
  125. data/generated/google/apis/dataproc_v1/classes.rb +1235 -963
  126. data/generated/google/apis/dataproc_v1/representations.rb +299 -225
  127. data/generated/google/apis/dataproc_v1/service.rb +277 -192
  128. data/generated/google/apis/datastore_v1.rb +38 -0
  129. data/generated/google/apis/datastore_v1/classes.rb +1289 -0
  130. data/generated/google/apis/datastore_v1/representations.rb +572 -0
  131. data/generated/google/apis/datastore_v1/service.rb +259 -0
  132. data/generated/google/apis/datastore_v1beta3.rb +38 -0
  133. data/generated/google/apis/datastore_v1beta3/classes.rb +1284 -0
  134. data/generated/google/apis/datastore_v1beta3/representations.rb +572 -0
  135. data/generated/google/apis/datastore_v1beta3/service.rb +259 -0
  136. data/generated/google/apis/deploymentmanager_v2.rb +1 -1
  137. data/generated/google/apis/deploymentmanager_v2/classes.rb +436 -3
  138. data/generated/google/apis/deploymentmanager_v2/representations.rb +178 -0
  139. data/generated/google/apis/deploymentmanager_v2/service.rb +226 -61
  140. data/generated/google/apis/dfareporting_v2_5.rb +40 -0
  141. data/generated/google/apis/dfareporting_v2_5/classes.rb +11225 -0
  142. data/generated/google/apis/dfareporting_v2_5/representations.rb +3982 -0
  143. data/generated/google/apis/dfareporting_v2_5/service.rb +8755 -0
  144. data/generated/google/apis/dfareporting_v2_6.rb +40 -0
  145. data/generated/google/apis/dfareporting_v2_6/classes.rb +11586 -0
  146. data/generated/google/apis/dfareporting_v2_6/representations.rb +4119 -0
  147. data/generated/google/apis/dfareporting_v2_6/service.rb +9025 -0
  148. data/generated/google/apis/dfareporting_v2_7.rb +40 -0
  149. data/generated/google/apis/dfareporting_v2_7/classes.rb +11876 -0
  150. data/generated/google/apis/dfareporting_v2_7/representations.rb +4243 -0
  151. data/generated/google/apis/dfareporting_v2_7/service.rb +9095 -0
  152. data/generated/google/apis/dns_v1.rb +1 -1
  153. data/generated/google/apis/dns_v1/classes.rb +1 -1
  154. data/generated/google/apis/dns_v2beta1.rb +43 -0
  155. data/generated/google/apis/dns_v2beta1/classes.rb +915 -0
  156. data/generated/google/apis/dns_v2beta1/representations.rb +368 -0
  157. data/generated/google/apis/dns_v2beta1/service.rb +768 -0
  158. data/generated/google/apis/doubleclickbidmanager_v1.rb +1 -1
  159. data/generated/google/apis/doubleclickbidmanager_v1/classes.rb +79 -86
  160. data/generated/google/apis/doubleclickbidmanager_v1/representations.rb +25 -28
  161. data/generated/google/apis/doubleclickbidmanager_v1/service.rb +10 -8
  162. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  163. data/generated/google/apis/doubleclicksearch_v2/classes.rb +6 -4
  164. data/generated/google/apis/drive_v2.rb +1 -1
  165. data/generated/google/apis/drive_v2/classes.rb +595 -37
  166. data/generated/google/apis/drive_v2/representations.rb +140 -0
  167. data/generated/google/apis/drive_v2/service.rb +406 -40
  168. data/generated/google/apis/drive_v3.rb +1 -1
  169. data/generated/google/apis/drive_v3/classes.rb +507 -40
  170. data/generated/google/apis/drive_v3/representations.rb +105 -0
  171. data/generated/google/apis/drive_v3/service.rb +326 -29
  172. data/generated/google/apis/fitness_v1.rb +38 -2
  173. data/generated/google/apis/fitness_v1/classes.rb +65 -7
  174. data/generated/google/apis/fitness_v1/representations.rb +20 -0
  175. data/generated/google/apis/fitness_v1/service.rb +17 -18
  176. data/generated/google/apis/fusiontables_v2.rb +1 -1
  177. data/generated/google/apis/fusiontables_v2/classes.rb +4 -3
  178. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  179. data/generated/google/apis/games_management_v1management.rb +1 -1
  180. data/generated/google/apis/games_v1.rb +1 -1
  181. data/generated/google/apis/genomics_v1.rb +10 -12
  182. data/generated/google/apis/genomics_v1/classes.rb +2276 -2165
  183. data/generated/google/apis/genomics_v1/representations.rb +468 -496
  184. data/generated/google/apis/genomics_v1/service.rb +978 -882
  185. data/generated/google/apis/gmail_v1.rb +11 -2
  186. data/generated/google/apis/gmail_v1/classes.rb +655 -5
  187. data/generated/google/apis/gmail_v1/representations.rb +261 -0
  188. data/generated/google/apis/gmail_v1/service.rb +1211 -48
  189. data/generated/google/apis/groupssettings_v1.rb +2 -2
  190. data/generated/google/apis/groupssettings_v1/classes.rb +12 -0
  191. data/generated/google/apis/groupssettings_v1/representations.rb +2 -0
  192. data/generated/google/apis/iam_v1.rb +2 -2
  193. data/generated/google/apis/iam_v1/classes.rb +446 -368
  194. data/generated/google/apis/iam_v1/representations.rb +109 -91
  195. data/generated/google/apis/iam_v1/service.rb +249 -162
  196. data/generated/google/apis/identitytoolkit_v3.rb +7 -1
  197. data/generated/google/apis/identitytoolkit_v3/classes.rb +254 -2
  198. data/generated/google/apis/identitytoolkit_v3/representations.rb +38 -0
  199. data/generated/google/apis/kgsearch_v1.rb +2 -3
  200. data/generated/google/apis/kgsearch_v1/classes.rb +13 -13
  201. data/generated/google/apis/kgsearch_v1/representations.rb +2 -2
  202. data/generated/google/apis/kgsearch_v1/service.rb +26 -24
  203. data/generated/google/apis/language_v1beta1.rb +36 -0
  204. data/generated/google/apis/language_v1beta1/classes.rb +757 -0
  205. data/generated/google/apis/language_v1beta1/representations.rb +339 -0
  206. data/generated/google/apis/language_v1beta1/service.rb +185 -0
  207. data/generated/google/apis/licensing_v1.rb +3 -3
  208. data/generated/google/apis/licensing_v1/classes.rb +14 -2
  209. data/generated/google/apis/licensing_v1/representations.rb +2 -0
  210. data/generated/google/apis/licensing_v1/service.rb +1 -1
  211. data/generated/google/apis/logging_v2beta1.rb +6 -6
  212. data/generated/google/apis/logging_v2beta1/classes.rb +900 -775
  213. data/generated/google/apis/logging_v2beta1/representations.rb +163 -142
  214. data/generated/google/apis/logging_v2beta1/service.rb +427 -155
  215. data/generated/google/apis/manufacturers_v1.rb +34 -0
  216. data/generated/google/apis/manufacturers_v1/classes.rb +605 -0
  217. data/generated/google/apis/manufacturers_v1/representations.rb +223 -0
  218. data/generated/google/apis/manufacturers_v1/service.rb +138 -0
  219. data/generated/google/apis/mirror_v1.rb +2 -2
  220. data/generated/google/apis/mirror_v1/service.rb +1 -1
  221. data/generated/google/apis/monitoring_v3.rb +45 -0
  222. data/generated/google/apis/monitoring_v3/classes.rb +1333 -0
  223. data/generated/google/apis/monitoring_v3/representations.rb +516 -0
  224. data/generated/google/apis/monitoring_v3/service.rb +706 -0
  225. data/generated/google/apis/oauth2_v2.rb +1 -1
  226. data/generated/google/apis/pagespeedonline_v2.rb +1 -1
  227. data/generated/google/apis/partners_v2.rb +3 -3
  228. data/generated/google/apis/partners_v2/classes.rb +1831 -477
  229. data/generated/google/apis/partners_v2/representations.rb +571 -114
  230. data/generated/google/apis/partners_v2/service.rb +898 -167
  231. data/generated/google/apis/people_v1.rb +15 -16
  232. data/generated/google/apis/people_v1/classes.rb +1047 -859
  233. data/generated/google/apis/people_v1/representations.rb +252 -213
  234. data/generated/google/apis/people_v1/service.rb +75 -62
  235. data/generated/google/apis/plus_domains_v1.rb +1 -1
  236. data/generated/google/apis/plus_v1.rb +1 -1
  237. data/generated/google/apis/proximitybeacon_v1beta1.rb +1 -1
  238. data/generated/google/apis/proximitybeacon_v1beta1/classes.rb +527 -456
  239. data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +101 -100
  240. data/generated/google/apis/proximitybeacon_v1beta1/service.rb +467 -343
  241. data/generated/google/apis/pubsub_v1.rb +1 -1
  242. data/generated/google/apis/pubsub_v1/classes.rb +363 -310
  243. data/generated/google/apis/pubsub_v1/representations.rb +76 -76
  244. data/generated/google/apis/pubsub_v1/service.rb +464 -335
  245. data/generated/google/apis/qpx_express_v1.rb +1 -1
  246. data/generated/google/apis/qpx_express_v1/classes.rb +6 -0
  247. data/generated/google/apis/qpx_express_v1/representations.rb +1 -0
  248. data/generated/google/apis/replicapool_v1beta2.rb +1 -1
  249. data/generated/google/apis/replicapoolupdater_v1beta1.rb +4 -2
  250. data/generated/google/apis/replicapoolupdater_v1beta1/service.rb +3 -1
  251. data/generated/google/apis/reseller_v1.rb +1 -1
  252. data/generated/google/apis/reseller_v1/classes.rb +222 -61
  253. data/generated/google/apis/reseller_v1/representations.rb +28 -0
  254. data/generated/google/apis/reseller_v1/service.rb +240 -47
  255. data/generated/google/apis/script_v1.rb +19 -19
  256. data/generated/google/apis/script_v1/classes.rb +151 -137
  257. data/generated/google/apis/script_v1/representations.rb +26 -26
  258. data/generated/google/apis/script_v1/service.rb +9 -8
  259. data/generated/google/apis/sheets_v4.rb +7 -7
  260. data/generated/google/apis/sheets_v4/classes.rb +4530 -3506
  261. data/generated/google/apis/sheets_v4/representations.rb +988 -737
  262. data/generated/google/apis/sheets_v4/service.rb +266 -99
  263. data/generated/google/apis/site_verification_v1.rb +1 -1
  264. data/generated/google/apis/slides_v1.rb +49 -0
  265. data/generated/google/apis/slides_v1/classes.rb +4480 -0
  266. data/generated/google/apis/slides_v1/representations.rb +1926 -0
  267. data/generated/google/apis/slides_v1/service.rb +245 -0
  268. data/generated/google/apis/speech_v1beta1.rb +34 -0
  269. data/generated/google/apis/speech_v1beta1/classes.rb +498 -0
  270. data/generated/google/apis/speech_v1beta1/representations.rb +206 -0
  271. data/generated/google/apis/speech_v1beta1/service.rb +270 -0
  272. data/generated/google/apis/sqladmin_v1beta4.rb +1 -1
  273. data/generated/google/apis/sqladmin_v1beta4/classes.rb +131 -10
  274. data/generated/google/apis/sqladmin_v1beta4/representations.rb +50 -0
  275. data/generated/google/apis/sqladmin_v1beta4/service.rb +92 -2
  276. data/generated/google/apis/storage_v1.rb +1 -1
  277. data/generated/google/apis/storage_v1/classes.rb +205 -21
  278. data/generated/google/apis/storage_v1/representations.rb +51 -1
  279. data/generated/google/apis/storage_v1/service.rb +263 -9
  280. data/generated/google/apis/tagmanager_v1.rb +5 -5
  281. data/generated/google/apis/translate_v2.rb +2 -2
  282. data/generated/google/apis/translate_v2/service.rb +1 -1
  283. data/generated/google/apis/vision_v1.rb +1 -1
  284. data/generated/google/apis/vision_v1/classes.rb +1275 -731
  285. data/generated/google/apis/vision_v1/representations.rb +378 -111
  286. data/generated/google/apis/vision_v1/service.rb +4 -4
  287. data/generated/google/apis/webmasters_v3.rb +1 -1
  288. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  289. data/generated/google/apis/youtube_analytics_v1/classes.rb +0 -209
  290. data/generated/google/apis/youtube_analytics_v1/representations.rb +0 -99
  291. data/generated/google/apis/youtube_analytics_v1/service.rb +5 -77
  292. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  293. data/generated/google/apis/youtube_partner_v1/classes.rb +155 -0
  294. data/generated/google/apis/youtube_partner_v1/representations.rb +69 -0
  295. data/generated/google/apis/youtube_partner_v1/service.rb +107 -3
  296. data/generated/google/apis/youtube_v3.rb +1 -1
  297. data/generated/google/apis/youtube_v3/classes.rb +430 -22
  298. data/generated/google/apis/youtube_v3/representations.rb +171 -4
  299. data/generated/google/apis/youtube_v3/service.rb +100 -9
  300. data/generated/google/apis/youtubereporting_v1.rb +4 -4
  301. data/generated/google/apis/youtubereporting_v1/classes.rb +140 -131
  302. data/generated/google/apis/youtubereporting_v1/representations.rb +37 -37
  303. data/generated/google/apis/youtubereporting_v1/service.rb +139 -135
  304. data/google-api-client.gemspec +4 -3
  305. data/lib/google/apis/core/api_command.rb +16 -6
  306. data/lib/google/apis/core/base_service.rb +17 -9
  307. data/lib/google/apis/core/download.rb +7 -2
  308. data/lib/google/apis/core/http_command.rb +5 -1
  309. data/lib/google/apis/core/json_representation.rb +2 -2
  310. data/lib/google/apis/core/upload.rb +7 -1
  311. data/lib/google/apis/errors.rb +6 -2
  312. data/lib/google/apis/generator/annotator.rb +6 -0
  313. data/lib/google/apis/version.rb +1 -1
  314. data/samples/cli/lib/samples/bigquery.rb +101 -0
  315. data/samples/cli/lib/samples/calendar.rb +1 -1
  316. data/samples/cli/lib/samples/gmail.rb +74 -0
  317. data/samples/cli/lib/samples/sheets.rb +61 -0
  318. data/samples/cli/lib/samples/you_tube.rb +4 -1
  319. data/sync.rb +71 -0
  320. metadata +86 -18
@@ -373,6 +373,41 @@ module Google
373
373
  execute_or_queue_command(command, &block)
374
374
  end
375
375
 
376
+ # Returns an IAM policy for the specified bucket.
377
+ # @param [String] bucket
378
+ # Name of a bucket.
379
+ # @param [String] fields
380
+ # Selector specifying which fields to include in a partial response.
381
+ # @param [String] quota_user
382
+ # Available to use for quota purposes for server-side applications. Can be any
383
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
384
+ # Overrides userIp if both are provided.
385
+ # @param [String] user_ip
386
+ # IP address of the site where the request originates. Use this if you want to
387
+ # enforce per-user limits.
388
+ # @param [Google::Apis::RequestOptions] options
389
+ # Request-specific options
390
+ #
391
+ # @yield [result, err] Result & error if block supplied
392
+ # @yieldparam result [Google::Apis::StorageV1::Policy] parsed result object
393
+ # @yieldparam err [StandardError] error object if request failed
394
+ #
395
+ # @return [Google::Apis::StorageV1::Policy]
396
+ #
397
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
398
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
399
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
400
+ def get_bucket_iam_policy(bucket, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
401
+ command = make_simple_command(:get, 'b/{bucket}/iam', options)
402
+ command.response_representation = Google::Apis::StorageV1::Policy::Representation
403
+ command.response_class = Google::Apis::StorageV1::Policy
404
+ command.params['bucket'] = bucket unless bucket.nil?
405
+ command.query['fields'] = fields unless fields.nil?
406
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
407
+ command.query['userIp'] = user_ip unless user_ip.nil?
408
+ execute_or_queue_command(command, &block)
409
+ end
410
+
376
411
  # Creates a new bucket.
377
412
  # @param [String] project
378
413
  # A valid API project identifier.
@@ -425,7 +460,8 @@ module Google
425
460
  # @param [String] project
426
461
  # A valid API project identifier.
427
462
  # @param [Fixnum] max_results
428
- # Maximum number of buckets to return.
463
+ # Maximum number of buckets to return in a single response. The service will use
464
+ # this parameter or 1,000 items, whichever is smaller.
429
465
  # @param [String] page_token
430
466
  # A previously-returned page token representing part of the larger set of
431
467
  # results to view.
@@ -469,7 +505,9 @@ module Google
469
505
  execute_or_queue_command(command, &block)
470
506
  end
471
507
 
472
- # Updates a bucket. This method supports patch semantics.
508
+ # Updates a bucket. Changes to the bucket will be readable immediately after
509
+ # writing, but configuration changes may take time to propagate. This method
510
+ # supports patch semantics.
473
511
  # @param [String] bucket
474
512
  # Name of a bucket.
475
513
  # @param [Google::Apis::StorageV1::Bucket] bucket_object
@@ -524,7 +562,85 @@ module Google
524
562
  execute_or_queue_command(command, &block)
525
563
  end
526
564
 
527
- # Updates a bucket.
565
+ # Updates an IAM policy for the specified bucket.
566
+ # @param [String] bucket
567
+ # Name of a bucket.
568
+ # @param [Google::Apis::StorageV1::Policy] policy_object
569
+ # @param [String] fields
570
+ # Selector specifying which fields to include in a partial response.
571
+ # @param [String] quota_user
572
+ # Available to use for quota purposes for server-side applications. Can be any
573
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
574
+ # Overrides userIp if both are provided.
575
+ # @param [String] user_ip
576
+ # IP address of the site where the request originates. Use this if you want to
577
+ # enforce per-user limits.
578
+ # @param [Google::Apis::RequestOptions] options
579
+ # Request-specific options
580
+ #
581
+ # @yield [result, err] Result & error if block supplied
582
+ # @yieldparam result [Google::Apis::StorageV1::Policy] parsed result object
583
+ # @yieldparam err [StandardError] error object if request failed
584
+ #
585
+ # @return [Google::Apis::StorageV1::Policy]
586
+ #
587
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
588
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
589
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
590
+ def set_bucket_iam_policy(bucket, policy_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
591
+ command = make_simple_command(:put, 'b/{bucket}/iam', options)
592
+ command.request_representation = Google::Apis::StorageV1::Policy::Representation
593
+ command.request_object = policy_object
594
+ command.response_representation = Google::Apis::StorageV1::Policy::Representation
595
+ command.response_class = Google::Apis::StorageV1::Policy
596
+ command.params['bucket'] = bucket unless bucket.nil?
597
+ command.query['fields'] = fields unless fields.nil?
598
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
599
+ command.query['userIp'] = user_ip unless user_ip.nil?
600
+ execute_or_queue_command(command, &block)
601
+ end
602
+
603
+ # Tests a set of permissions on the given bucket to see which, if any, are held
604
+ # by the caller.
605
+ # @param [String] bucket
606
+ # Name of a bucket.
607
+ # @param [Array<String>, String] permissions
608
+ # Permissions to test.
609
+ # @param [String] fields
610
+ # Selector specifying which fields to include in a partial response.
611
+ # @param [String] quota_user
612
+ # Available to use for quota purposes for server-side applications. Can be any
613
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
614
+ # Overrides userIp if both are provided.
615
+ # @param [String] user_ip
616
+ # IP address of the site where the request originates. Use this if you want to
617
+ # enforce per-user limits.
618
+ # @param [Google::Apis::RequestOptions] options
619
+ # Request-specific options
620
+ #
621
+ # @yield [result, err] Result & error if block supplied
622
+ # @yieldparam result [Google::Apis::StorageV1::TestIamPermissionsResponse] parsed result object
623
+ # @yieldparam err [StandardError] error object if request failed
624
+ #
625
+ # @return [Google::Apis::StorageV1::TestIamPermissionsResponse]
626
+ #
627
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
628
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
629
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
630
+ def test_bucket_iam_permissions(bucket, permissions, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
631
+ command = make_simple_command(:get, 'b/{bucket}/iam/testPermissions', options)
632
+ command.response_representation = Google::Apis::StorageV1::TestIamPermissionsResponse::Representation
633
+ command.response_class = Google::Apis::StorageV1::TestIamPermissionsResponse
634
+ command.params['bucket'] = bucket unless bucket.nil?
635
+ command.query['permissions'] = permissions unless permissions.nil?
636
+ command.query['fields'] = fields unless fields.nil?
637
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
638
+ command.query['userIp'] = user_ip unless user_ip.nil?
639
+ execute_or_queue_command(command, &block)
640
+ end
641
+
642
+ # Updates a bucket. Changes to the bucket will be readable immediately after
643
+ # writing, but configuration changes may take time to propagate.
528
644
  # @param [String] bucket
529
645
  # Name of a bucket.
530
646
  # @param [Google::Apis::StorageV1::Bucket] bucket_object
@@ -1427,6 +1543,49 @@ module Google
1427
1543
  execute_or_queue_command(command, &block)
1428
1544
  end
1429
1545
 
1546
+ # Returns an IAM policy for the specified object.
1547
+ # @param [String] bucket
1548
+ # Name of the bucket in which the object resides.
1549
+ # @param [String] object
1550
+ # Name of the object. For information about how to URL encode object names to be
1551
+ # path safe, see Encoding URI Path Parts.
1552
+ # @param [String] generation
1553
+ # If present, selects a specific revision of this object (as opposed to the
1554
+ # latest version, the default).
1555
+ # @param [String] fields
1556
+ # Selector specifying which fields to include in a partial response.
1557
+ # @param [String] quota_user
1558
+ # Available to use for quota purposes for server-side applications. Can be any
1559
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1560
+ # Overrides userIp if both are provided.
1561
+ # @param [String] user_ip
1562
+ # IP address of the site where the request originates. Use this if you want to
1563
+ # enforce per-user limits.
1564
+ # @param [Google::Apis::RequestOptions] options
1565
+ # Request-specific options
1566
+ #
1567
+ # @yield [result, err] Result & error if block supplied
1568
+ # @yieldparam result [Google::Apis::StorageV1::Policy] parsed result object
1569
+ # @yieldparam err [StandardError] error object if request failed
1570
+ #
1571
+ # @return [Google::Apis::StorageV1::Policy]
1572
+ #
1573
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1574
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1575
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1576
+ def get_object_iam_policy(bucket, object, generation: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1577
+ command = make_simple_command(:get, 'b/{bucket}/o/{object}/iam', options)
1578
+ command.response_representation = Google::Apis::StorageV1::Policy::Representation
1579
+ command.response_class = Google::Apis::StorageV1::Policy
1580
+ command.params['bucket'] = bucket unless bucket.nil?
1581
+ command.params['object'] = object unless object.nil?
1582
+ command.query['generation'] = generation unless generation.nil?
1583
+ command.query['fields'] = fields unless fields.nil?
1584
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1585
+ command.query['userIp'] = user_ip unless user_ip.nil?
1586
+ execute_or_queue_command(command, &block)
1587
+ end
1588
+
1430
1589
  # Stores a new object and metadata.
1431
1590
  # @param [String] bucket
1432
1591
  # Name of the bucket in which to store the new object. Overrides the provided
@@ -1521,9 +1680,10 @@ module Google
1521
1680
  # truncated after the delimiter, returned in prefixes. Duplicate prefixes are
1522
1681
  # omitted.
1523
1682
  # @param [Fixnum] max_results
1524
- # Maximum number of items plus prefixes to return. As duplicate prefixes are
1525
- # omitted, fewer total results may be returned than requested. The default value
1526
- # of this parameter is 1,000 items.
1683
+ # Maximum number of items plus prefixes to return in a single page of responses.
1684
+ # As duplicate prefixes are omitted, fewer total results may be returned than
1685
+ # requested. The service will use this parameter or 1,000 items, whichever is
1686
+ # smaller.
1527
1687
  # @param [String] page_token
1528
1688
  # A previously-returned page token representing part of the larger set of
1529
1689
  # results to view.
@@ -1751,6 +1911,99 @@ module Google
1751
1911
  execute_or_queue_command(command, &block)
1752
1912
  end
1753
1913
 
1914
+ # Updates an IAM policy for the specified object.
1915
+ # @param [String] bucket
1916
+ # Name of the bucket in which the object resides.
1917
+ # @param [String] object
1918
+ # Name of the object. For information about how to URL encode object names to be
1919
+ # path safe, see Encoding URI Path Parts.
1920
+ # @param [Google::Apis::StorageV1::Policy] policy_object
1921
+ # @param [String] generation
1922
+ # If present, selects a specific revision of this object (as opposed to the
1923
+ # latest version, the default).
1924
+ # @param [String] fields
1925
+ # Selector specifying which fields to include in a partial response.
1926
+ # @param [String] quota_user
1927
+ # Available to use for quota purposes for server-side applications. Can be any
1928
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1929
+ # Overrides userIp if both are provided.
1930
+ # @param [String] user_ip
1931
+ # IP address of the site where the request originates. Use this if you want to
1932
+ # enforce per-user limits.
1933
+ # @param [Google::Apis::RequestOptions] options
1934
+ # Request-specific options
1935
+ #
1936
+ # @yield [result, err] Result & error if block supplied
1937
+ # @yieldparam result [Google::Apis::StorageV1::Policy] parsed result object
1938
+ # @yieldparam err [StandardError] error object if request failed
1939
+ #
1940
+ # @return [Google::Apis::StorageV1::Policy]
1941
+ #
1942
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1943
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1944
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1945
+ def set_object_iam_policy(bucket, object, policy_object = nil, generation: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1946
+ command = make_simple_command(:put, 'b/{bucket}/o/{object}/iam', options)
1947
+ command.request_representation = Google::Apis::StorageV1::Policy::Representation
1948
+ command.request_object = policy_object
1949
+ command.response_representation = Google::Apis::StorageV1::Policy::Representation
1950
+ command.response_class = Google::Apis::StorageV1::Policy
1951
+ command.params['bucket'] = bucket unless bucket.nil?
1952
+ command.params['object'] = object unless object.nil?
1953
+ command.query['generation'] = generation unless generation.nil?
1954
+ command.query['fields'] = fields unless fields.nil?
1955
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1956
+ command.query['userIp'] = user_ip unless user_ip.nil?
1957
+ execute_or_queue_command(command, &block)
1958
+ end
1959
+
1960
+ # Tests a set of permissions on the given object to see which, if any, are held
1961
+ # by the caller.
1962
+ # @param [String] bucket
1963
+ # Name of the bucket in which the object resides.
1964
+ # @param [String] object
1965
+ # Name of the object. For information about how to URL encode object names to be
1966
+ # path safe, see Encoding URI Path Parts.
1967
+ # @param [Array<String>, String] permissions
1968
+ # Permissions to test.
1969
+ # @param [String] generation
1970
+ # If present, selects a specific revision of this object (as opposed to the
1971
+ # latest version, the default).
1972
+ # @param [String] fields
1973
+ # Selector specifying which fields to include in a partial response.
1974
+ # @param [String] quota_user
1975
+ # Available to use for quota purposes for server-side applications. Can be any
1976
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1977
+ # Overrides userIp if both are provided.
1978
+ # @param [String] user_ip
1979
+ # IP address of the site where the request originates. Use this if you want to
1980
+ # enforce per-user limits.
1981
+ # @param [Google::Apis::RequestOptions] options
1982
+ # Request-specific options
1983
+ #
1984
+ # @yield [result, err] Result & error if block supplied
1985
+ # @yieldparam result [Google::Apis::StorageV1::TestIamPermissionsResponse] parsed result object
1986
+ # @yieldparam err [StandardError] error object if request failed
1987
+ #
1988
+ # @return [Google::Apis::StorageV1::TestIamPermissionsResponse]
1989
+ #
1990
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1991
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1992
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1993
+ def test_object_iam_permissions(bucket, object, permissions, generation: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
1994
+ command = make_simple_command(:get, 'b/{bucket}/o/{object}/iam/testPermissions', options)
1995
+ command.response_representation = Google::Apis::StorageV1::TestIamPermissionsResponse::Representation
1996
+ command.response_class = Google::Apis::StorageV1::TestIamPermissionsResponse
1997
+ command.params['bucket'] = bucket unless bucket.nil?
1998
+ command.params['object'] = object unless object.nil?
1999
+ command.query['generation'] = generation unless generation.nil?
2000
+ command.query['permissions'] = permissions unless permissions.nil?
2001
+ command.query['fields'] = fields unless fields.nil?
2002
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2003
+ command.query['userIp'] = user_ip unless user_ip.nil?
2004
+ execute_or_queue_command(command, &block)
2005
+ end
2006
+
1754
2007
  # Updates an object's metadata.
1755
2008
  # @param [String] bucket
1756
2009
  # Name of the bucket in which the object resides.
@@ -1837,9 +2090,10 @@ module Google
1837
2090
  # truncated after the delimiter, returned in prefixes. Duplicate prefixes are
1838
2091
  # omitted.
1839
2092
  # @param [Fixnum] max_results
1840
- # Maximum number of items plus prefixes to return. As duplicate prefixes are
1841
- # omitted, fewer total results may be returned than requested. The default value
1842
- # of this parameter is 1,000 items.
2093
+ # Maximum number of items plus prefixes to return in a single page of responses.
2094
+ # As duplicate prefixes are omitted, fewer total results may be returned than
2095
+ # requested. The service will use this parameter or 1,000 items, whichever is
2096
+ # smaller.
1843
2097
  # @param [String] page_token
1844
2098
  # A previously-returned page token representing part of the larger set of
1845
2099
  # results to view.
@@ -30,22 +30,22 @@ module Google
30
30
  # Delete your Google Tag Manager containers
31
31
  AUTH_TAGMANAGER_DELETE_CONTAINERS = 'https://www.googleapis.com/auth/tagmanager.delete.containers'
32
32
 
33
- # Manage your Google Tag Manager containers
33
+ # Manage your Google Tag Manager container and its subcomponents, excluding versioning and publishing
34
34
  AUTH_TAGMANAGER_EDIT_CONTAINERS = 'https://www.googleapis.com/auth/tagmanager.edit.containers'
35
35
 
36
36
  # Manage your Google Tag Manager container versions
37
37
  AUTH_TAGMANAGER_EDIT_CONTAINERVERSIONS = 'https://www.googleapis.com/auth/tagmanager.edit.containerversions'
38
38
 
39
- # Manage your Google Tag Manager accounts
39
+ # View and manage your Google Tag Manager accounts
40
40
  AUTH_TAGMANAGER_MANAGE_ACCOUNTS = 'https://www.googleapis.com/auth/tagmanager.manage.accounts'
41
41
 
42
- # Manage user permissions of your Google Tag Manager data
42
+ # Manage user permissions of your Google Tag Manager account and container
43
43
  AUTH_TAGMANAGER_MANAGE_USERS = 'https://www.googleapis.com/auth/tagmanager.manage.users'
44
44
 
45
- # Publish your Google Tag Manager containers
45
+ # Publish your Google Tag Manager container versions
46
46
  AUTH_TAGMANAGER_PUBLISH = 'https://www.googleapis.com/auth/tagmanager.publish'
47
47
 
48
- # View your Google Tag Manager containers
48
+ # View your Google Tag Manager container and its subcomponents
49
49
  AUTH_TAGMANAGER_READONLY = 'https://www.googleapis.com/auth/tagmanager.readonly'
50
50
  end
51
51
  end
@@ -20,12 +20,12 @@ module Google
20
20
  module Apis
21
21
  # Translate API
22
22
  #
23
- # Lets you translate text from one language to another
23
+ # Translates text from one language to another.
24
24
  #
25
25
  # @see https://developers.google.com/translate/v2/using_rest
26
26
  module TranslateV2
27
27
  VERSION = 'V2'
28
- REVISION = '20160217'
28
+ REVISION = '20160627'
29
29
  end
30
30
  end
31
31
  end
@@ -22,7 +22,7 @@ module Google
22
22
  module TranslateV2
23
23
  # Translate API
24
24
  #
25
- # Lets you translate text from one language to another
25
+ # Translates text from one language to another.
26
26
  #
27
27
  # @example
28
28
  # require 'google/apis/translate_v2'
@@ -27,7 +27,7 @@ module Google
27
27
  # @see https://cloud.google.com/vision/
28
28
  module VisionV1
29
29
  VERSION = 'V1'
30
- REVISION = '20160519'
30
+ REVISION = '20170321'
31
31
 
32
32
  # View and manage your data across Google Cloud Platform services
33
33
  AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
@@ -22,28 +22,6 @@ module Google
22
22
  module Apis
23
23
  module VisionV1
24
24
 
25
- # External image source (Google Cloud Storage image location).
26
- class ImageSource
27
- include Google::Apis::Core::Hashable
28
-
29
- # Google Cloud Storage image URI. It must be in the following form:
30
- # `gs://bucket_name/object_name`. For more
31
- # details, please see: https://cloud.google.com/storage/docs/reference-uris.
32
- # NOTE: Cloud Storage object versioning is not supported!
33
- # Corresponds to the JSON property `gcsImageUri`
34
- # @return [String]
35
- attr_accessor :gcs_image_uri
36
-
37
- def initialize(**args)
38
- update!(**args)
39
- end
40
-
41
- # Update properties of this object
42
- def update!(**args)
43
- @gcs_image_uri = args[:gcs_image_uri] if args.key?(:gcs_image_uri)
44
- end
45
- end
46
-
47
25
  # Request for performing Google Cloud Vision API tasks over a user-provided
48
26
  # image, with user-requested features.
49
27
  class AnnotateImageRequest
@@ -54,16 +32,16 @@ module Google
54
32
  # @return [Google::Apis::VisionV1::Image]
55
33
  attr_accessor :image
56
34
 
57
- # Image context.
58
- # Corresponds to the JSON property `imageContext`
59
- # @return [Google::Apis::VisionV1::ImageContext]
60
- attr_accessor :image_context
61
-
62
35
  # Requested features.
63
36
  # Corresponds to the JSON property `features`
64
37
  # @return [Array<Google::Apis::VisionV1::Feature>]
65
38
  attr_accessor :features
66
39
 
40
+ # Image context and/or feature-specific parameters.
41
+ # Corresponds to the JSON property `imageContext`
42
+ # @return [Google::Apis::VisionV1::ImageContext]
43
+ attr_accessor :image_context
44
+
67
45
  def initialize(**args)
68
46
  update!(**args)
69
47
  end
@@ -71,94 +49,70 @@ module Google
71
49
  # Update properties of this object
72
50
  def update!(**args)
73
51
  @image = args[:image] if args.key?(:image)
74
- @image_context = args[:image_context] if args.key?(:image_context)
75
52
  @features = args[:features] if args.key?(:features)
53
+ @image_context = args[:image_context] if args.key?(:image_context)
76
54
  end
77
55
  end
78
56
 
79
- # Response to an image annotation request.
80
- class AnnotateImageResponse
57
+ # The `Status` type defines a logical error model that is suitable for different
58
+ # programming environments, including REST APIs and RPC APIs. It is used by
59
+ # [gRPC](https://github.com/grpc). The error model is designed to be:
60
+ # - Simple to use and understand for most users
61
+ # - Flexible enough to meet unexpected needs
62
+ # # Overview
63
+ # The `Status` message contains three pieces of data: error code, error message,
64
+ # and error details. The error code should be an enum value of
65
+ # google.rpc.Code, but it may accept additional error codes if needed. The
66
+ # error message should be a developer-facing English message that helps
67
+ # developers *understand* and *resolve* the error. If a localized user-facing
68
+ # error message is needed, put the localized message in the error details or
69
+ # localize it in the client. The optional error details may contain arbitrary
70
+ # information about the error. There is a predefined set of error detail types
71
+ # in the package `google.rpc` which can be used for common error conditions.
72
+ # # Language mapping
73
+ # The `Status` message is the logical representation of the error model, but it
74
+ # is not necessarily the actual wire format. When the `Status` message is
75
+ # exposed in different client libraries and different wire protocols, it can be
76
+ # mapped differently. For example, it will likely be mapped to some exceptions
77
+ # in Java, but more likely mapped to some error codes in C.
78
+ # # Other uses
79
+ # The error model and the `Status` message can be used in a variety of
80
+ # environments, either with or without APIs, to provide a
81
+ # consistent developer experience across different environments.
82
+ # Example uses of this error model include:
83
+ # - Partial errors. If a service needs to return partial errors to the client,
84
+ # it may embed the `Status` in the normal response to indicate the partial
85
+ # errors.
86
+ # - Workflow errors. A typical workflow has multiple steps. Each step may
87
+ # have a `Status` message for error reporting purpose.
88
+ # - Batch operations. If a client uses batch request and batch response, the
89
+ # `Status` message should be used directly inside batch response, one for
90
+ # each error sub-response.
91
+ # - Asynchronous operations. If an API call embeds asynchronous operation
92
+ # results in its response, the status of those operations should be
93
+ # represented directly using the `Status` message.
94
+ # - Logging. If some API errors are stored in logs, the message `Status` could
95
+ # be used directly after any stripping needed for security/privacy reasons.
96
+ class Status
81
97
  include Google::Apis::Core::Hashable
82
98
 
83
- # If present, label detection completed successfully.
84
- # Corresponds to the JSON property `labelAnnotations`
85
- # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
86
- attr_accessor :label_annotations
87
-
88
- # If present, landmark detection completed successfully.
89
- # Corresponds to the JSON property `landmarkAnnotations`
90
- # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
91
- attr_accessor :landmark_annotations
92
-
93
- # Set of features pertaining to the image, computed by various computer vision
94
- # methods over safe-search verticals (for example, adult, spoof, medical,
95
- # violence).
96
- # Corresponds to the JSON property `safeSearchAnnotation`
97
- # @return [Google::Apis::VisionV1::SafeSearchAnnotation]
98
- attr_accessor :safe_search_annotation
99
-
100
- # Stores image properties (e.g. dominant colors).
101
- # Corresponds to the JSON property `imagePropertiesAnnotation`
102
- # @return [Google::Apis::VisionV1::ImageProperties]
103
- attr_accessor :image_properties_annotation
104
-
105
- # If present, text (OCR) detection completed successfully.
106
- # Corresponds to the JSON property `textAnnotations`
107
- # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
108
- attr_accessor :text_annotations
109
-
110
- # If present, logo detection completed successfully.
111
- # Corresponds to the JSON property `logoAnnotations`
112
- # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
113
- attr_accessor :logo_annotations
99
+ # The status code, which should be an enum value of google.rpc.Code.
100
+ # Corresponds to the JSON property `code`
101
+ # @return [Fixnum]
102
+ attr_accessor :code
114
103
 
115
- # If present, face detection completed successfully.
116
- # Corresponds to the JSON property `faceAnnotations`
117
- # @return [Array<Google::Apis::VisionV1::FaceAnnotation>]
118
- attr_accessor :face_annotations
104
+ # A developer-facing error message, which should be in English. Any
105
+ # user-facing error message should be localized and sent in the
106
+ # google.rpc.Status.details field, or localized by the client.
107
+ # Corresponds to the JSON property `message`
108
+ # @return [String]
109
+ attr_accessor :message
119
110
 
120
- # The `Status` type defines a logical error model that is suitable for different
121
- # programming environments, including REST APIs and RPC APIs. It is used by
122
- # [gRPC](https://github.com/grpc). The error model is designed to be:
123
- # - Simple to use and understand for most users
124
- # - Flexible enough to meet unexpected needs
125
- # # Overview
126
- # The `Status` message contains three pieces of data: error code, error message,
127
- # and error details. The error code should be an enum value of
128
- # google.rpc.Code, but it may accept additional error codes if needed. The
129
- # error message should be a developer-facing English message that helps
130
- # developers *understand* and *resolve* the error. If a localized user-facing
131
- # error message is needed, put the localized message in the error details or
132
- # localize it in the client. The optional error details may contain arbitrary
133
- # information about the error. There is a predefined set of error detail types
134
- # in the package `google.rpc` which can be used for common error conditions.
135
- # # Language mapping
136
- # The `Status` message is the logical representation of the error model, but it
137
- # is not necessarily the actual wire format. When the `Status` message is
138
- # exposed in different client libraries and different wire protocols, it can be
139
- # mapped differently. For example, it will likely be mapped to some exceptions
140
- # in Java, but more likely mapped to some error codes in C.
141
- # # Other uses
142
- # The error model and the `Status` message can be used in a variety of
143
- # environments, either with or without APIs, to provide a
144
- # consistent developer experience across different environments.
145
- # Example uses of this error model include:
146
- # - Partial errors. If a service needs to return partial errors to the client,
147
- # it may embed the `Status` in the normal response to indicate the partial
148
- # errors.
149
- # - Workflow errors. A typical workflow has multiple steps. Each step may
150
- # have a `Status` message for error reporting purpose.
151
- # - Batch operations. If a client uses batch request and batch response, the
152
- # `Status` message should be used directly inside batch response, one for
153
- # each error sub-response.
154
- # - Asynchronous operations. If an API call embeds asynchronous operation
155
- # results in its response, the status of those operations should be
156
- # represented directly using the `Status` message.
157
- # - Logging. If some API errors are stored in logs, the message `Status` could
158
- # be used directly after any stripping needed for security/privacy reasons.
159
- # Corresponds to the JSON property `error`
160
- # @return [Google::Apis::VisionV1::Status]
161
- attr_accessor :error
111
+ # A list of messages that carry the error details. There will be a
112
+ # common set of message types for APIs to use.
113
+ # Corresponds to the JSON property `details`
114
+ # @return [Array<Hash<String,Object>>]
115
+ attr_accessor :details
162
116
 
163
117
  def initialize(**args)
164
118
  update!(**args)
@@ -166,18 +120,13 @@ module Google
166
120
 
167
121
  # Update properties of this object
168
122
  def update!(**args)
169
- @label_annotations = args[:label_annotations] if args.key?(:label_annotations)
170
- @landmark_annotations = args[:landmark_annotations] if args.key?(:landmark_annotations)
171
- @safe_search_annotation = args[:safe_search_annotation] if args.key?(:safe_search_annotation)
172
- @image_properties_annotation = args[:image_properties_annotation] if args.key?(:image_properties_annotation)
173
- @text_annotations = args[:text_annotations] if args.key?(:text_annotations)
174
- @logo_annotations = args[:logo_annotations] if args.key?(:logo_annotations)
175
- @face_annotations = args[:face_annotations] if args.key?(:face_annotations)
176
- @error = args[:error] if args.key?(:error)
123
+ @code = args[:code] if args.key?(:code)
124
+ @message = args[:message] if args.key?(:message)
125
+ @details = args[:details] if args.key?(:details)
177
126
  end
178
127
  end
179
128
 
180
- # Rectangle determined by min and max LatLng pairs.
129
+ # Rectangle determined by min and max `LatLng` pairs.
181
130
  class LatLongRect
182
131
  include Google::Apis::Core::Hashable
183
132
 
@@ -216,9 +165,11 @@ module Google
216
165
  # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
217
166
  # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
218
167
  # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
219
- # Corresponds to the JSON property `maxLatLng`
168
+ # The code in logs/storage/validator/logs_validator_traits.cc treats this type
169
+ # as if it were annotated as ST_LOCATION.
170
+ # Corresponds to the JSON property `minLatLng`
220
171
  # @return [Google::Apis::VisionV1::LatLng]
221
- attr_accessor :max_lat_lng
172
+ attr_accessor :min_lat_lng
222
173
 
223
174
  # An object representing a latitude/longitude pair. This is expressed as a pair
224
175
  # of doubles representing degrees latitude and degrees longitude. Unless
@@ -255,9 +206,11 @@ module Google
255
206
  # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
256
207
  # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
257
208
  # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
258
- # Corresponds to the JSON property `minLatLng`
209
+ # The code in logs/storage/validator/logs_validator_traits.cc treats this type
210
+ # as if it were annotated as ST_LOCATION.
211
+ # Corresponds to the JSON property `maxLatLng`
259
212
  # @return [Google::Apis::VisionV1::LatLng]
260
- attr_accessor :min_lat_lng
213
+ attr_accessor :max_lat_lng
261
214
 
262
215
  def initialize(**args)
263
216
  update!(**args)
@@ -265,70 +218,29 @@ module Google
265
218
 
266
219
  # Update properties of this object
267
220
  def update!(**args)
268
- @max_lat_lng = args[:max_lat_lng] if args.key?(:max_lat_lng)
269
221
  @min_lat_lng = args[:min_lat_lng] if args.key?(:min_lat_lng)
222
+ @max_lat_lng = args[:max_lat_lng] if args.key?(:max_lat_lng)
270
223
  end
271
224
  end
272
225
 
273
- # The `Status` type defines a logical error model that is suitable for different
274
- # programming environments, including REST APIs and RPC APIs. It is used by
275
- # [gRPC](https://github.com/grpc). The error model is designed to be:
276
- # - Simple to use and understand for most users
277
- # - Flexible enough to meet unexpected needs
278
- # # Overview
279
- # The `Status` message contains three pieces of data: error code, error message,
280
- # and error details. The error code should be an enum value of
281
- # google.rpc.Code, but it may accept additional error codes if needed. The
282
- # error message should be a developer-facing English message that helps
283
- # developers *understand* and *resolve* the error. If a localized user-facing
284
- # error message is needed, put the localized message in the error details or
285
- # localize it in the client. The optional error details may contain arbitrary
286
- # information about the error. There is a predefined set of error detail types
287
- # in the package `google.rpc` which can be used for common error conditions.
288
- # # Language mapping
289
- # The `Status` message is the logical representation of the error model, but it
290
- # is not necessarily the actual wire format. When the `Status` message is
291
- # exposed in different client libraries and different wire protocols, it can be
292
- # mapped differently. For example, it will likely be mapped to some exceptions
293
- # in Java, but more likely mapped to some error codes in C.
294
- # # Other uses
295
- # The error model and the `Status` message can be used in a variety of
296
- # environments, either with or without APIs, to provide a
297
- # consistent developer experience across different environments.
298
- # Example uses of this error model include:
299
- # - Partial errors. If a service needs to return partial errors to the client,
300
- # it may embed the `Status` in the normal response to indicate the partial
301
- # errors.
302
- # - Workflow errors. A typical workflow has multiple steps. Each step may
303
- # have a `Status` message for error reporting purpose.
304
- # - Batch operations. If a client uses batch request and batch response, the
305
- # `Status` message should be used directly inside batch response, one for
306
- # each error sub-response.
307
- # - Asynchronous operations. If an API call embeds asynchronous operation
308
- # results in its response, the status of those operations should be
309
- # represented directly using the `Status` message.
310
- # - Logging. If some API errors are stored in logs, the message `Status` could
311
- # be used directly after any stripping needed for security/privacy reasons.
312
- class Status
226
+ # A single symbol representation.
227
+ class Symbol
313
228
  include Google::Apis::Core::Hashable
314
229
 
315
- # The status code, which should be an enum value of google.rpc.Code.
316
- # Corresponds to the JSON property `code`
317
- # @return [Fixnum]
318
- attr_accessor :code
230
+ # The actual UTF-8 representation of the symbol.
231
+ # Corresponds to the JSON property `text`
232
+ # @return [String]
233
+ attr_accessor :text
319
234
 
320
- # A list of messages that carry the error details. There will be a
321
- # common set of message types for APIs to use.
322
- # Corresponds to the JSON property `details`
323
- # @return [Array<Hash<String,Object>>]
324
- attr_accessor :details
235
+ # Additional information detected on the structural component.
236
+ # Corresponds to the JSON property `property`
237
+ # @return [Google::Apis::VisionV1::TextProperty]
238
+ attr_accessor :property
325
239
 
326
- # A developer-facing error message, which should be in English. Any
327
- # user-facing error message should be localized and sent in the
328
- # google.rpc.Status.details field, or localized by the client.
329
- # Corresponds to the JSON property `message`
330
- # @return [String]
331
- attr_accessor :message
240
+ # A bounding polygon for the detected image annotation.
241
+ # Corresponds to the JSON property `boundingBox`
242
+ # @return [Google::Apis::VisionV1::BoundingPoly]
243
+ attr_accessor :bounding_box
332
244
 
333
245
  def initialize(**args)
334
246
  update!(**args)
@@ -336,97 +248,866 @@ module Google
336
248
 
337
249
  # Update properties of this object
338
250
  def update!(**args)
339
- @code = args[:code] if args.key?(:code)
340
- @details = args[:details] if args.key?(:details)
341
- @message = args[:message] if args.key?(:message)
251
+ @text = args[:text] if args.key?(:text)
252
+ @property = args[:property] if args.key?(:property)
253
+ @bounding_box = args[:bounding_box] if args.key?(:bounding_box)
342
254
  end
343
255
  end
344
256
 
345
- # A face annotation object contains the results of face detection.
346
- class FaceAnnotation
257
+ # Set of crop hints that are used to generate new crops when serving images.
258
+ class CropHintsAnnotation
347
259
  include Google::Apis::Core::Hashable
348
260
 
349
- # Pitch angle. Indicates the upwards/downwards angle that the face is
350
- # pointing
351
- # relative to the image's horizontal plane. Range [-180,180].
352
- # Corresponds to the JSON property `tiltAngle`
353
- # @return [Float]
354
- attr_accessor :tilt_angle
355
-
356
- # Under-exposed likelihood.
357
- # Corresponds to the JSON property `underExposedLikelihood`
358
- # @return [String]
359
- attr_accessor :under_exposed_likelihood
261
+ # Crop hint results.
262
+ # Corresponds to the JSON property `cropHints`
263
+ # @return [Array<Google::Apis::VisionV1::CropHint>]
264
+ attr_accessor :crop_hints
360
265
 
361
- # A bounding polygon for the detected image annotation.
362
- # Corresponds to the JSON property `fdBoundingPoly`
363
- # @return [Google::Apis::VisionV1::BoundingPoly]
364
- attr_accessor :fd_bounding_poly
266
+ def initialize(**args)
267
+ update!(**args)
268
+ end
365
269
 
366
- # Face landmarking confidence. Range [0, 1].
367
- # Corresponds to the JSON property `landmarkingConfidence`
270
+ # Update properties of this object
271
+ def update!(**args)
272
+ @crop_hints = args[:crop_hints] if args.key?(:crop_hints)
273
+ end
274
+ end
275
+
276
+ # An object representing a latitude/longitude pair. This is expressed as a pair
277
+ # of doubles representing degrees latitude and degrees longitude. Unless
278
+ # specified otherwise, this must conform to the
279
+ # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
280
+ # standard</a>. Values must be within normalized ranges.
281
+ # Example of normalization code in Python:
282
+ # def NormalizeLongitude(longitude):
283
+ # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
284
+ # q, r = divmod(longitude, 360.0)
285
+ # if r > 180.0 or (r == 180.0 and q <= -1.0):
286
+ # return r - 360.0
287
+ # return r
288
+ # def NormalizeLatLng(latitude, longitude):
289
+ # """Wraps decimal degrees latitude and longitude to
290
+ # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
291
+ # r = latitude % 360.0
292
+ # if r <= 90.0:
293
+ # return r, NormalizeLongitude(longitude)
294
+ # elif r >= 270.0:
295
+ # return r - 360, NormalizeLongitude(longitude)
296
+ # else:
297
+ # return 180 - r, NormalizeLongitude(longitude + 180.0)
298
+ # assert 180.0 == NormalizeLongitude(180.0)
299
+ # assert -180.0 == NormalizeLongitude(-180.0)
300
+ # assert -179.0 == NormalizeLongitude(181.0)
301
+ # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
302
+ # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
303
+ # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
304
+ # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
305
+ # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
306
+ # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
307
+ # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
308
+ # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
309
+ # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
310
+ # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
311
+ # The code in logs/storage/validator/logs_validator_traits.cc treats this type
312
+ # as if it were annotated as ST_LOCATION.
313
+ class LatLng
314
+ include Google::Apis::Core::Hashable
315
+
316
+ # The latitude in degrees. It must be in the range [-90.0, +90.0].
317
+ # Corresponds to the JSON property `latitude`
318
+ # @return [Float]
319
+ attr_accessor :latitude
320
+
321
+ # The longitude in degrees. It must be in the range [-180.0, +180.0].
322
+ # Corresponds to the JSON property `longitude`
323
+ # @return [Float]
324
+ attr_accessor :longitude
325
+
326
+ def initialize(**args)
327
+ update!(**args)
328
+ end
329
+
330
+ # Update properties of this object
331
+ def update!(**args)
332
+ @latitude = args[:latitude] if args.key?(:latitude)
333
+ @longitude = args[:longitude] if args.key?(:longitude)
334
+ end
335
+ end
336
+
337
+ # Represents a color in the RGBA color space. This representation is designed
338
+ # for simplicity of conversion to/from color representations in various
339
+ # languages over compactness; for example, the fields of this representation
340
+ # can be trivially provided to the constructor of "java.awt.Color" in Java; it
341
+ # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
342
+ # method in iOS; and, with just a little work, it can be easily formatted into
343
+ # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
344
+ # Example (Java):
345
+ # import com.google.type.Color;
346
+ # // ...
347
+ # public static java.awt.Color fromProto(Color protocolor) `
348
+ # float alpha = protocolor.hasAlpha()
349
+ # ? protocolor.getAlpha().getValue()
350
+ # : 1.0;
351
+ # return new java.awt.Color(
352
+ # protocolor.getRed(),
353
+ # protocolor.getGreen(),
354
+ # protocolor.getBlue(),
355
+ # alpha);
356
+ # `
357
+ # public static Color toProto(java.awt.Color color) `
358
+ # float red = (float) color.getRed();
359
+ # float green = (float) color.getGreen();
360
+ # float blue = (float) color.getBlue();
361
+ # float denominator = 255.0;
362
+ # Color.Builder resultBuilder =
363
+ # Color
364
+ # .newBuilder()
365
+ # .setRed(red / denominator)
366
+ # .setGreen(green / denominator)
367
+ # .setBlue(blue / denominator);
368
+ # int alpha = color.getAlpha();
369
+ # if (alpha != 255) `
370
+ # result.setAlpha(
371
+ # FloatValue
372
+ # .newBuilder()
373
+ # .setValue(((float) alpha) / denominator)
374
+ # .build());
375
+ # `
376
+ # return resultBuilder.build();
377
+ # `
378
+ # // ...
379
+ # Example (iOS / Obj-C):
380
+ # // ...
381
+ # static UIColor* fromProto(Color* protocolor) `
382
+ # float red = [protocolor red];
383
+ # float green = [protocolor green];
384
+ # float blue = [protocolor blue];
385
+ # FloatValue* alpha_wrapper = [protocolor alpha];
386
+ # float alpha = 1.0;
387
+ # if (alpha_wrapper != nil) `
388
+ # alpha = [alpha_wrapper value];
389
+ # `
390
+ # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
391
+ # `
392
+ # static Color* toProto(UIColor* color) `
393
+ # CGFloat red, green, blue, alpha;
394
+ # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
395
+ # return nil;
396
+ # `
397
+ # Color* result = [Color alloc] init];
398
+ # [result setRed:red];
399
+ # [result setGreen:green];
400
+ # [result setBlue:blue];
401
+ # if (alpha <= 0.9999) `
402
+ # [result setAlpha:floatWrapperWithValue(alpha)];
403
+ # `
404
+ # [result autorelease];
405
+ # return result;
406
+ # `
407
+ # // ...
408
+ # Example (JavaScript):
409
+ # // ...
410
+ # var protoToCssColor = function(rgb_color) `
411
+ # var redFrac = rgb_color.red || 0.0;
412
+ # var greenFrac = rgb_color.green || 0.0;
413
+ # var blueFrac = rgb_color.blue || 0.0;
414
+ # var red = Math.floor(redFrac * 255);
415
+ # var green = Math.floor(greenFrac * 255);
416
+ # var blue = Math.floor(blueFrac * 255);
417
+ # if (!('alpha' in rgb_color)) `
418
+ # return rgbToCssColor_(red, green, blue);
419
+ # `
420
+ # var alphaFrac = rgb_color.alpha.value || 0.0;
421
+ # var rgbParams = [red, green, blue].join(',');
422
+ # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
423
+ # `;
424
+ # var rgbToCssColor_ = function(red, green, blue) `
425
+ # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
426
+ # var hexString = rgbNumber.toString(16);
427
+ # var missingZeros = 6 - hexString.length;
428
+ # var resultBuilder = ['#'];
429
+ # for (var i = 0; i < missingZeros; i++) `
430
+ # resultBuilder.push('0');
431
+ # `
432
+ # resultBuilder.push(hexString);
433
+ # return resultBuilder.join('');
434
+ # `;
435
+ # // ...
436
+ class Color
437
+ include Google::Apis::Core::Hashable
438
+
439
+ # The amount of green in the color as a value in the interval [0, 1].
440
+ # Corresponds to the JSON property `green`
441
+ # @return [Float]
442
+ attr_accessor :green
443
+
444
+ # The amount of blue in the color as a value in the interval [0, 1].
445
+ # Corresponds to the JSON property `blue`
446
+ # @return [Float]
447
+ attr_accessor :blue
448
+
449
+ # The fraction of this color that should be applied to the pixel. That is,
450
+ # the final pixel color is defined by the equation:
451
+ # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
452
+ # This means that a value of 1.0 corresponds to a solid color, whereas
453
+ # a value of 0.0 corresponds to a completely transparent color. This
454
+ # uses a wrapper message rather than a simple float scalar so that it is
455
+ # possible to distinguish between a default value and the value being unset.
456
+ # If omitted, this color object is to be rendered as a solid color
457
+ # (as if the alpha value had been explicitly given with a value of 1.0).
458
+ # Corresponds to the JSON property `alpha`
459
+ # @return [Float]
460
+ attr_accessor :alpha
461
+
462
+ # The amount of red in the color as a value in the interval [0, 1].
463
+ # Corresponds to the JSON property `red`
464
+ # @return [Float]
465
+ attr_accessor :red
466
+
467
+ def initialize(**args)
468
+ update!(**args)
469
+ end
470
+
471
+ # Update properties of this object
472
+ def update!(**args)
473
+ @green = args[:green] if args.key?(:green)
474
+ @blue = args[:blue] if args.key?(:blue)
475
+ @alpha = args[:alpha] if args.key?(:alpha)
476
+ @red = args[:red] if args.key?(:red)
477
+ end
478
+ end
479
+
480
+ # Stores image properties, such as dominant colors.
481
+ class ImageProperties
482
+ include Google::Apis::Core::Hashable
483
+
484
+ # Set of dominant colors and their corresponding scores.
485
+ # Corresponds to the JSON property `dominantColors`
486
+ # @return [Google::Apis::VisionV1::DominantColorsAnnotation]
487
+ attr_accessor :dominant_colors
488
+
489
+ def initialize(**args)
490
+ update!(**args)
491
+ end
492
+
493
+ # Update properties of this object
494
+ def update!(**args)
495
+ @dominant_colors = args[:dominant_colors] if args.key?(:dominant_colors)
496
+ end
497
+ end
498
+
499
+ # Users describe the type of Google Cloud Vision API tasks to perform over
500
+ # images by using *Feature*s. Each Feature indicates a type of image
501
+ # detection task to perform. Features encode the Cloud Vision API
502
+ # vertical to operate on and the number of top-scoring results to return.
503
+ class Feature
504
+ include Google::Apis::Core::Hashable
505
+
506
+ # The feature type.
507
+ # Corresponds to the JSON property `type`
508
+ # @return [String]
509
+ attr_accessor :type
510
+
511
+ # Maximum number of results of this type.
512
+ # Corresponds to the JSON property `maxResults`
513
+ # @return [Fixnum]
514
+ attr_accessor :max_results
515
+
516
+ def initialize(**args)
517
+ update!(**args)
518
+ end
519
+
520
+ # Update properties of this object
521
+ def update!(**args)
522
+ @type = args[:type] if args.key?(:type)
523
+ @max_results = args[:max_results] if args.key?(:max_results)
524
+ end
525
+ end
526
+
527
+ # Set of features pertaining to the image, computed by computer vision
528
+ # methods over safe-search verticals (for example, adult, spoof, medical,
529
+ # violence).
530
+ class SafeSearchAnnotation
531
+ include Google::Apis::Core::Hashable
532
+
533
+ # Represents the adult content likelihood for the image.
534
+ # Corresponds to the JSON property `adult`
535
+ # @return [String]
536
+ attr_accessor :adult
537
+
538
+ # Spoof likelihood. The likelihood that an modification
539
+ # was made to the image's canonical version to make it appear
540
+ # funny or offensive.
541
+ # Corresponds to the JSON property `spoof`
542
+ # @return [String]
543
+ attr_accessor :spoof
544
+
545
+ # Likelihood that this is a medical image.
546
+ # Corresponds to the JSON property `medical`
547
+ # @return [String]
548
+ attr_accessor :medical
549
+
550
+ # Violence likelihood.
551
+ # Corresponds to the JSON property `violence`
552
+ # @return [String]
553
+ attr_accessor :violence
554
+
555
+ def initialize(**args)
556
+ update!(**args)
557
+ end
558
+
559
+ # Update properties of this object
560
+ def update!(**args)
561
+ @adult = args[:adult] if args.key?(:adult)
562
+ @spoof = args[:spoof] if args.key?(:spoof)
563
+ @medical = args[:medical] if args.key?(:medical)
564
+ @violence = args[:violence] if args.key?(:violence)
565
+ end
566
+ end
567
+
568
+ # Set of dominant colors and their corresponding scores.
569
+ class DominantColorsAnnotation
570
+ include Google::Apis::Core::Hashable
571
+
572
+ # RGB color values with their score and pixel fraction.
573
+ # Corresponds to the JSON property `colors`
574
+ # @return [Array<Google::Apis::VisionV1::ColorInfo>]
575
+ attr_accessor :colors
576
+
577
+ def initialize(**args)
578
+ update!(**args)
579
+ end
580
+
581
+ # Update properties of this object
582
+ def update!(**args)
583
+ @colors = args[:colors] if args.key?(:colors)
584
+ end
585
+ end
586
+
587
+ # TextAnnotation contains a structured representation of OCR extracted text.
588
+ # The hierarchy of an OCR extracted text structure is like this:
589
+ # TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
590
+ # Each structural component, starting from Page, may further have their own
591
+ # properties. Properties describe detected languages, breaks etc.. Please
592
+ # refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message
593
+ # definition below for more detail.
594
+ class TextAnnotation
595
+ include Google::Apis::Core::Hashable
596
+
597
+ # List of pages detected by OCR.
598
+ # Corresponds to the JSON property `pages`
599
+ # @return [Array<Google::Apis::VisionV1::Page>]
600
+ attr_accessor :pages
601
+
602
+ # UTF-8 text detected on the pages.
603
+ # Corresponds to the JSON property `text`
604
+ # @return [String]
605
+ attr_accessor :text
606
+
607
+ def initialize(**args)
608
+ update!(**args)
609
+ end
610
+
611
+ # Update properties of this object
612
+ def update!(**args)
613
+ @pages = args[:pages] if args.key?(:pages)
614
+ @text = args[:text] if args.key?(:text)
615
+ end
616
+ end
617
+
618
+ # A vertex represents a 2D point in the image.
619
+ # NOTE: the vertex coordinates are in the same scale as the original image.
620
+ class Vertex
621
+ include Google::Apis::Core::Hashable
622
+
623
+ # X coordinate.
624
+ # Corresponds to the JSON property `x`
625
+ # @return [Fixnum]
626
+ attr_accessor :x
627
+
628
+ # Y coordinate.
629
+ # Corresponds to the JSON property `y`
630
+ # @return [Fixnum]
631
+ attr_accessor :y
632
+
633
+ def initialize(**args)
634
+ update!(**args)
635
+ end
636
+
637
+ # Update properties of this object
638
+ def update!(**args)
639
+ @x = args[:x] if args.key?(:x)
640
+ @y = args[:y] if args.key?(:y)
641
+ end
642
+ end
643
+
644
+ # Detected language for a structural component.
645
+ class DetectedLanguage
646
+ include Google::Apis::Core::Hashable
647
+
648
+ # Confidence of detected language. Range [0, 1].
649
+ # Corresponds to the JSON property `confidence`
368
650
  # @return [Float]
369
- attr_accessor :landmarking_confidence
651
+ attr_accessor :confidence
370
652
 
371
- # Joy likelihood.
372
- # Corresponds to the JSON property `joyLikelihood`
653
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
654
+ # information, see
655
+ # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
656
+ # Corresponds to the JSON property `languageCode`
373
657
  # @return [String]
374
- attr_accessor :joy_likelihood
658
+ attr_accessor :language_code
375
659
 
376
- # Detection confidence. Range [0, 1].
377
- # Corresponds to the JSON property `detectionConfidence`
660
+ def initialize(**args)
661
+ update!(**args)
662
+ end
663
+
664
+ # Update properties of this object
665
+ def update!(**args)
666
+ @confidence = args[:confidence] if args.key?(:confidence)
667
+ @language_code = args[:language_code] if args.key?(:language_code)
668
+ end
669
+ end
670
+
671
+ # Entity deduced from similar images on the Internet.
672
+ class WebEntity
673
+ include Google::Apis::Core::Hashable
674
+
675
+ # Opaque entity ID.
676
+ # Corresponds to the JSON property `entityId`
677
+ # @return [String]
678
+ attr_accessor :entity_id
679
+
680
+ # Canonical description of the entity, in English.
681
+ # Corresponds to the JSON property `description`
682
+ # @return [String]
683
+ attr_accessor :description
684
+
685
+ # Overall relevancy score for the entity.
686
+ # Not normalized and not comparable across different image queries.
687
+ # Corresponds to the JSON property `score`
378
688
  # @return [Float]
379
- attr_accessor :detection_confidence
689
+ attr_accessor :score
690
+
691
+ def initialize(**args)
692
+ update!(**args)
693
+ end
694
+
695
+ # Update properties of this object
696
+ def update!(**args)
697
+ @entity_id = args[:entity_id] if args.key?(:entity_id)
698
+ @description = args[:description] if args.key?(:description)
699
+ @score = args[:score] if args.key?(:score)
700
+ end
701
+ end
702
+
703
+ # Additional information detected on the structural component.
704
+ class TextProperty
705
+ include Google::Apis::Core::Hashable
706
+
707
+ # Detected start or end of a structural component.
708
+ # Corresponds to the JSON property `detectedBreak`
709
+ # @return [Google::Apis::VisionV1::DetectedBreak]
710
+ attr_accessor :detected_break
711
+
712
+ # A list of detected languages together with confidence.
713
+ # Corresponds to the JSON property `detectedLanguages`
714
+ # @return [Array<Google::Apis::VisionV1::DetectedLanguage>]
715
+ attr_accessor :detected_languages
716
+
717
+ def initialize(**args)
718
+ update!(**args)
719
+ end
720
+
721
+ # Update properties of this object
722
+ def update!(**args)
723
+ @detected_break = args[:detected_break] if args.key?(:detected_break)
724
+ @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
725
+ end
726
+ end
727
+
728
+ # A bounding polygon for the detected image annotation.
729
+ class BoundingPoly
730
+ include Google::Apis::Core::Hashable
731
+
732
+ # The bounding polygon vertices.
733
+ # Corresponds to the JSON property `vertices`
734
+ # @return [Array<Google::Apis::VisionV1::Vertex>]
735
+ attr_accessor :vertices
736
+
737
+ def initialize(**args)
738
+ update!(**args)
739
+ end
740
+
741
+ # Update properties of this object
742
+ def update!(**args)
743
+ @vertices = args[:vertices] if args.key?(:vertices)
744
+ end
745
+ end
746
+
747
+ # Response to an image annotation request.
748
+ class AnnotateImageResponse
749
+ include Google::Apis::Core::Hashable
750
+
751
+ # The `Status` type defines a logical error model that is suitable for different
752
+ # programming environments, including REST APIs and RPC APIs. It is used by
753
+ # [gRPC](https://github.com/grpc). The error model is designed to be:
754
+ # - Simple to use and understand for most users
755
+ # - Flexible enough to meet unexpected needs
756
+ # # Overview
757
+ # The `Status` message contains three pieces of data: error code, error message,
758
+ # and error details. The error code should be an enum value of
759
+ # google.rpc.Code, but it may accept additional error codes if needed. The
760
+ # error message should be a developer-facing English message that helps
761
+ # developers *understand* and *resolve* the error. If a localized user-facing
762
+ # error message is needed, put the localized message in the error details or
763
+ # localize it in the client. The optional error details may contain arbitrary
764
+ # information about the error. There is a predefined set of error detail types
765
+ # in the package `google.rpc` which can be used for common error conditions.
766
+ # # Language mapping
767
+ # The `Status` message is the logical representation of the error model, but it
768
+ # is not necessarily the actual wire format. When the `Status` message is
769
+ # exposed in different client libraries and different wire protocols, it can be
770
+ # mapped differently. For example, it will likely be mapped to some exceptions
771
+ # in Java, but more likely mapped to some error codes in C.
772
+ # # Other uses
773
+ # The error model and the `Status` message can be used in a variety of
774
+ # environments, either with or without APIs, to provide a
775
+ # consistent developer experience across different environments.
776
+ # Example uses of this error model include:
777
+ # - Partial errors. If a service needs to return partial errors to the client,
778
+ # it may embed the `Status` in the normal response to indicate the partial
779
+ # errors.
780
+ # - Workflow errors. A typical workflow has multiple steps. Each step may
781
+ # have a `Status` message for error reporting purpose.
782
+ # - Batch operations. If a client uses batch request and batch response, the
783
+ # `Status` message should be used directly inside batch response, one for
784
+ # each error sub-response.
785
+ # - Asynchronous operations. If an API call embeds asynchronous operation
786
+ # results in its response, the status of those operations should be
787
+ # represented directly using the `Status` message.
788
+ # - Logging. If some API errors are stored in logs, the message `Status` could
789
+ # be used directly after any stripping needed for security/privacy reasons.
790
+ # Corresponds to the JSON property `error`
791
+ # @return [Google::Apis::VisionV1::Status]
792
+ attr_accessor :error
793
+
794
+ # TextAnnotation contains a structured representation of OCR extracted text.
795
+ # The hierarchy of an OCR extracted text structure is like this:
796
+ # TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
797
+ # Each structural component, starting from Page, may further have their own
798
+ # properties. Properties describe detected languages, breaks etc.. Please
799
+ # refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message
800
+ # definition below for more detail.
801
+ # Corresponds to the JSON property `fullTextAnnotation`
802
+ # @return [Google::Apis::VisionV1::TextAnnotation]
803
+ attr_accessor :full_text_annotation
804
+
805
+ # If present, landmark detection has completed successfully.
806
+ # Corresponds to the JSON property `landmarkAnnotations`
807
+ # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
808
+ attr_accessor :landmark_annotations
809
+
810
+ # If present, text (OCR) detection has completed successfully.
811
+ # Corresponds to the JSON property `textAnnotations`
812
+ # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
813
+ attr_accessor :text_annotations
814
+
815
+ # If present, face detection has completed successfully.
816
+ # Corresponds to the JSON property `faceAnnotations`
817
+ # @return [Array<Google::Apis::VisionV1::FaceAnnotation>]
818
+ attr_accessor :face_annotations
819
+
820
+ # Stores image properties, such as dominant colors.
821
+ # Corresponds to the JSON property `imagePropertiesAnnotation`
822
+ # @return [Google::Apis::VisionV1::ImageProperties]
823
+ attr_accessor :image_properties_annotation
824
+
825
+ # If present, logo detection has completed successfully.
826
+ # Corresponds to the JSON property `logoAnnotations`
827
+ # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
828
+ attr_accessor :logo_annotations
829
+
830
+ # Relevant information for the image from the Internet.
831
+ # Corresponds to the JSON property `webDetection`
832
+ # @return [Google::Apis::VisionV1::WebDetection]
833
+ attr_accessor :web_detection
834
+
835
+ # Set of crop hints that are used to generate new crops when serving images.
836
+ # Corresponds to the JSON property `cropHintsAnnotation`
837
+ # @return [Google::Apis::VisionV1::CropHintsAnnotation]
838
+ attr_accessor :crop_hints_annotation
839
+
840
+ # Set of features pertaining to the image, computed by computer vision
841
+ # methods over safe-search verticals (for example, adult, spoof, medical,
842
+ # violence).
843
+ # Corresponds to the JSON property `safeSearchAnnotation`
844
+ # @return [Google::Apis::VisionV1::SafeSearchAnnotation]
845
+ attr_accessor :safe_search_annotation
846
+
847
+ # If present, label detection has completed successfully.
848
+ # Corresponds to the JSON property `labelAnnotations`
849
+ # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
850
+ attr_accessor :label_annotations
851
+
852
+ def initialize(**args)
853
+ update!(**args)
854
+ end
855
+
856
+ # Update properties of this object
857
+ def update!(**args)
858
+ @error = args[:error] if args.key?(:error)
859
+ @full_text_annotation = args[:full_text_annotation] if args.key?(:full_text_annotation)
860
+ @landmark_annotations = args[:landmark_annotations] if args.key?(:landmark_annotations)
861
+ @text_annotations = args[:text_annotations] if args.key?(:text_annotations)
862
+ @face_annotations = args[:face_annotations] if args.key?(:face_annotations)
863
+ @image_properties_annotation = args[:image_properties_annotation] if args.key?(:image_properties_annotation)
864
+ @logo_annotations = args[:logo_annotations] if args.key?(:logo_annotations)
865
+ @web_detection = args[:web_detection] if args.key?(:web_detection)
866
+ @crop_hints_annotation = args[:crop_hints_annotation] if args.key?(:crop_hints_annotation)
867
+ @safe_search_annotation = args[:safe_search_annotation] if args.key?(:safe_search_annotation)
868
+ @label_annotations = args[:label_annotations] if args.key?(:label_annotations)
869
+ end
870
+ end
871
+
872
+ # Parameters for crop hints annotation request.
873
+ class CropHintsParams
874
+ include Google::Apis::Core::Hashable
875
+
876
+ # Aspect ratios in floats, representing the ratio of the width to the height
877
+ # of the image. For example, if the desired aspect ratio is 4/3, the
878
+ # corresponding float value should be 1.33333. If not specified, the
879
+ # best possible crop is returned. The number of provided aspect ratios is
880
+ # limited to a maximum of 16; any aspect ratios provided after the 16th are
881
+ # ignored.
882
+ # Corresponds to the JSON property `aspectRatios`
883
+ # @return [Array<Float>]
884
+ attr_accessor :aspect_ratios
885
+
886
+ def initialize(**args)
887
+ update!(**args)
888
+ end
889
+
890
+ # Update properties of this object
891
+ def update!(**args)
892
+ @aspect_ratios = args[:aspect_ratios] if args.key?(:aspect_ratios)
893
+ end
894
+ end
895
+
896
+ # Logical element on the page.
897
+ class Block
898
+ include Google::Apis::Core::Hashable
899
+
900
+ # Additional information detected on the structural component.
901
+ # Corresponds to the JSON property `property`
902
+ # @return [Google::Apis::VisionV1::TextProperty]
903
+ attr_accessor :property
904
+
905
+ # Detected block type (text, image etc) for this block.
906
+ # Corresponds to the JSON property `blockType`
907
+ # @return [String]
908
+ attr_accessor :block_type
909
+
910
+ # A bounding polygon for the detected image annotation.
911
+ # Corresponds to the JSON property `boundingBox`
912
+ # @return [Google::Apis::VisionV1::BoundingPoly]
913
+ attr_accessor :bounding_box
914
+
915
+ # List of paragraphs in this block (if this blocks is of type text).
916
+ # Corresponds to the JSON property `paragraphs`
917
+ # @return [Array<Google::Apis::VisionV1::Paragraph>]
918
+ attr_accessor :paragraphs
919
+
920
+ def initialize(**args)
921
+ update!(**args)
922
+ end
923
+
924
+ # Update properties of this object
925
+ def update!(**args)
926
+ @property = args[:property] if args.key?(:property)
927
+ @block_type = args[:block_type] if args.key?(:block_type)
928
+ @bounding_box = args[:bounding_box] if args.key?(:bounding_box)
929
+ @paragraphs = args[:paragraphs] if args.key?(:paragraphs)
930
+ end
931
+ end
932
+
933
+ # Relevant information for the image from the Internet.
934
+ class WebDetection
935
+ include Google::Apis::Core::Hashable
936
+
937
+ # Fully matching images from the Internet.
938
+ # They're definite neardups and most often a copy of the query image with
939
+ # merely a size change.
940
+ # Corresponds to the JSON property `fullMatchingImages`
941
+ # @return [Array<Google::Apis::VisionV1::WebImage>]
942
+ attr_accessor :full_matching_images
943
+
944
+ # Deduced entities from similar images on the Internet.
945
+ # Corresponds to the JSON property `webEntities`
946
+ # @return [Array<Google::Apis::VisionV1::WebEntity>]
947
+ attr_accessor :web_entities
948
+
949
+ # Web pages containing the matching images from the Internet.
950
+ # Corresponds to the JSON property `pagesWithMatchingImages`
951
+ # @return [Array<Google::Apis::VisionV1::WebPage>]
952
+ attr_accessor :pages_with_matching_images
953
+
954
+ # Partial matching images from the Internet.
955
+ # Those images are similar enough to share some key-point features. For
956
+ # example an original image will likely have partial matching for its crops.
957
+ # Corresponds to the JSON property `partialMatchingImages`
958
+ # @return [Array<Google::Apis::VisionV1::WebImage>]
959
+ attr_accessor :partial_matching_images
960
+
961
+ # The visually similar image results.
962
+ # Corresponds to the JSON property `visuallySimilarImages`
963
+ # @return [Array<Google::Apis::VisionV1::WebImage>]
964
+ attr_accessor :visually_similar_images
965
+
966
+ def initialize(**args)
967
+ update!(**args)
968
+ end
969
+
970
+ # Update properties of this object
971
+ def update!(**args)
972
+ @full_matching_images = args[:full_matching_images] if args.key?(:full_matching_images)
973
+ @web_entities = args[:web_entities] if args.key?(:web_entities)
974
+ @pages_with_matching_images = args[:pages_with_matching_images] if args.key?(:pages_with_matching_images)
975
+ @partial_matching_images = args[:partial_matching_images] if args.key?(:partial_matching_images)
976
+ @visually_similar_images = args[:visually_similar_images] if args.key?(:visually_similar_images)
977
+ end
978
+ end
979
+
980
+ # Response to a batch image annotation request.
981
+ class BatchAnnotateImagesResponse
982
+ include Google::Apis::Core::Hashable
983
+
984
+ # Individual responses to image annotation requests within the batch.
985
+ # Corresponds to the JSON property `responses`
986
+ # @return [Array<Google::Apis::VisionV1::AnnotateImageResponse>]
987
+ attr_accessor :responses
988
+
989
+ def initialize(**args)
990
+ update!(**args)
991
+ end
992
+
993
+ # Update properties of this object
994
+ def update!(**args)
995
+ @responses = args[:responses] if args.key?(:responses)
996
+ end
997
+ end
998
+
999
+ # External image source (Google Cloud Storage image location).
1000
+ class ImageSource
1001
+ include Google::Apis::Core::Hashable
380
1002
 
381
- # Surprise likelihood.
382
- # Corresponds to the JSON property `surpriseLikelihood`
1003
+ # Image URI which supports:
1004
+ # 1) Google Cloud Storage image URI, which must be in the following form:
1005
+ # `gs://bucket_name/object_name` (for details, see
1006
+ # [Google Cloud Storage Request
1007
+ # URIs](https://cloud.google.com/storage/docs/reference-uris)).
1008
+ # NOTE: Cloud Storage object versioning is not supported.
1009
+ # 2) Publicly accessible image HTTP/HTTPS URL.
1010
+ # This is preferred over the legacy `gcs_image_uri` above. When both
1011
+ # `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
1012
+ # precedence.
1013
+ # Corresponds to the JSON property `imageUri`
383
1014
  # @return [String]
384
- attr_accessor :surprise_likelihood
385
-
386
- # Anger likelihood.
387
- # Corresponds to the JSON property `angerLikelihood`
1015
+ attr_accessor :image_uri
1016
+
1017
+ # NOTE: For new code `image_uri` below is preferred.
1018
+ # Google Cloud Storage image URI, which must be in the following form:
1019
+ # `gs://bucket_name/object_name` (for details, see
1020
+ # [Google Cloud Storage Request
1021
+ # URIs](https://cloud.google.com/storage/docs/reference-uris)).
1022
+ # NOTE: Cloud Storage object versioning is not supported.
1023
+ # Corresponds to the JSON property `gcsImageUri`
388
1024
  # @return [String]
389
- attr_accessor :anger_likelihood
1025
+ attr_accessor :gcs_image_uri
390
1026
 
391
- # Headwear likelihood.
392
- # Corresponds to the JSON property `headwearLikelihood`
393
- # @return [String]
394
- attr_accessor :headwear_likelihood
1027
+ def initialize(**args)
1028
+ update!(**args)
1029
+ end
395
1030
 
396
- # Yaw angle. Indicates the leftward/rightward angle that the face is
397
- # pointing, relative to the vertical plane perpendicular to the image. Range
398
- # [-180,180].
399
- # Corresponds to the JSON property `panAngle`
400
- # @return [Float]
401
- attr_accessor :pan_angle
1031
+ # Update properties of this object
1032
+ def update!(**args)
1033
+ @image_uri = args[:image_uri] if args.key?(:image_uri)
1034
+ @gcs_image_uri = args[:gcs_image_uri] if args.key?(:gcs_image_uri)
1035
+ end
1036
+ end
402
1037
 
403
- # A bounding polygon for the detected image annotation.
404
- # Corresponds to the JSON property `boundingPoly`
405
- # @return [Google::Apis::VisionV1::BoundingPoly]
406
- attr_accessor :bounding_poly
1038
+ # Detected entity location information.
1039
+ class LocationInfo
1040
+ include Google::Apis::Core::Hashable
407
1041
 
408
- # Detected face landmarks.
409
- # Corresponds to the JSON property `landmarks`
410
- # @return [Array<Google::Apis::VisionV1::Landmark>]
411
- attr_accessor :landmarks
1042
+ # An object representing a latitude/longitude pair. This is expressed as a pair
1043
+ # of doubles representing degrees latitude and degrees longitude. Unless
1044
+ # specified otherwise, this must conform to the
1045
+ # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
1046
+ # standard</a>. Values must be within normalized ranges.
1047
+ # Example of normalization code in Python:
1048
+ # def NormalizeLongitude(longitude):
1049
+ # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
1050
+ # q, r = divmod(longitude, 360.0)
1051
+ # if r > 180.0 or (r == 180.0 and q <= -1.0):
1052
+ # return r - 360.0
1053
+ # return r
1054
+ # def NormalizeLatLng(latitude, longitude):
1055
+ # """Wraps decimal degrees latitude and longitude to
1056
+ # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
1057
+ # r = latitude % 360.0
1058
+ # if r <= 90.0:
1059
+ # return r, NormalizeLongitude(longitude)
1060
+ # elif r >= 270.0:
1061
+ # return r - 360, NormalizeLongitude(longitude)
1062
+ # else:
1063
+ # return 180 - r, NormalizeLongitude(longitude + 180.0)
1064
+ # assert 180.0 == NormalizeLongitude(180.0)
1065
+ # assert -180.0 == NormalizeLongitude(-180.0)
1066
+ # assert -179.0 == NormalizeLongitude(181.0)
1067
+ # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
1068
+ # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
1069
+ # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
1070
+ # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
1071
+ # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
1072
+ # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
1073
+ # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
1074
+ # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
1075
+ # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
1076
+ # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
1077
+ # The code in logs/storage/validator/logs_validator_traits.cc treats this type
1078
+ # as if it were annotated as ST_LOCATION.
1079
+ # Corresponds to the JSON property `latLng`
1080
+ # @return [Google::Apis::VisionV1::LatLng]
1081
+ attr_accessor :lat_lng
412
1082
 
413
- # Blurred likelihood.
414
- # Corresponds to the JSON property `blurredLikelihood`
1083
+ def initialize(**args)
1084
+ update!(**args)
1085
+ end
1086
+
1087
+ # Update properties of this object
1088
+ def update!(**args)
1089
+ @lat_lng = args[:lat_lng] if args.key?(:lat_lng)
1090
+ end
1091
+ end
1092
+
1093
+ # A `Property` consists of a user-supplied name/value pair.
1094
+ class Property
1095
+ include Google::Apis::Core::Hashable
1096
+
1097
+ # Value of the property.
1098
+ # Corresponds to the JSON property `value`
415
1099
  # @return [String]
416
- attr_accessor :blurred_likelihood
1100
+ attr_accessor :value
417
1101
 
418
- # Roll angle. Indicates the amount of clockwise/anti-clockwise rotation of
419
- # the
420
- # face relative to the image vertical, about the axis perpendicular to the
421
- # face. Range [-180,180].
422
- # Corresponds to the JSON property `rollAngle`
423
- # @return [Float]
424
- attr_accessor :roll_angle
1102
+ # Value of numeric properties.
1103
+ # Corresponds to the JSON property `uint64Value`
1104
+ # @return [String]
1105
+ attr_accessor :uint64_value
425
1106
 
426
- # Sorrow likelihood.
427
- # Corresponds to the JSON property `sorrowLikelihood`
1107
+ # Name of the property.
1108
+ # Corresponds to the JSON property `name`
428
1109
  # @return [String]
429
- attr_accessor :sorrow_likelihood
1110
+ attr_accessor :name
430
1111
 
431
1112
  def initialize(**args)
432
1113
  update!(**args)
@@ -434,39 +1115,33 @@ module Google
434
1115
 
435
1116
  # Update properties of this object
436
1117
  def update!(**args)
437
- @tilt_angle = args[:tilt_angle] if args.key?(:tilt_angle)
438
- @under_exposed_likelihood = args[:under_exposed_likelihood] if args.key?(:under_exposed_likelihood)
439
- @fd_bounding_poly = args[:fd_bounding_poly] if args.key?(:fd_bounding_poly)
440
- @landmarking_confidence = args[:landmarking_confidence] if args.key?(:landmarking_confidence)
441
- @joy_likelihood = args[:joy_likelihood] if args.key?(:joy_likelihood)
442
- @detection_confidence = args[:detection_confidence] if args.key?(:detection_confidence)
443
- @surprise_likelihood = args[:surprise_likelihood] if args.key?(:surprise_likelihood)
444
- @anger_likelihood = args[:anger_likelihood] if args.key?(:anger_likelihood)
445
- @headwear_likelihood = args[:headwear_likelihood] if args.key?(:headwear_likelihood)
446
- @pan_angle = args[:pan_angle] if args.key?(:pan_angle)
447
- @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
448
- @landmarks = args[:landmarks] if args.key?(:landmarks)
449
- @blurred_likelihood = args[:blurred_likelihood] if args.key?(:blurred_likelihood)
450
- @roll_angle = args[:roll_angle] if args.key?(:roll_angle)
451
- @sorrow_likelihood = args[:sorrow_likelihood] if args.key?(:sorrow_likelihood)
1118
+ @value = args[:value] if args.key?(:value)
1119
+ @uint64_value = args[:uint64_value] if args.key?(:uint64_value)
1120
+ @name = args[:name] if args.key?(:name)
452
1121
  end
453
1122
  end
454
1123
 
455
- # A vertex represents a 2D point in the image.
456
- # NOTE: the vertex coordinates are in the same scale as the original image.
457
- class Vertex
1124
+ # A 3D position in the image, used primarily for Face detection landmarks.
1125
+ # A valid Position must have both x and y coordinates.
1126
+ # The position coordinates are in the same scale as the original image.
1127
+ class Position
458
1128
  include Google::Apis::Core::Hashable
459
1129
 
460
1130
  # Y coordinate.
461
1131
  # Corresponds to the JSON property `y`
462
- # @return [Fixnum]
1132
+ # @return [Float]
463
1133
  attr_accessor :y
464
1134
 
465
1135
  # X coordinate.
466
1136
  # Corresponds to the JSON property `x`
467
- # @return [Fixnum]
1137
+ # @return [Float]
468
1138
  attr_accessor :x
469
1139
 
1140
+ # Z coordinate (or depth).
1141
+ # Corresponds to the JSON property `z`
1142
+ # @return [Float]
1143
+ attr_accessor :z
1144
+
470
1145
  def initialize(**args)
471
1146
  update!(**args)
472
1147
  end
@@ -475,15 +1150,47 @@ module Google
475
1150
  def update!(**args)
476
1151
  @y = args[:y] if args.key?(:y)
477
1152
  @x = args[:x] if args.key?(:x)
1153
+ @z = args[:z] if args.key?(:z)
1154
+ end
1155
+ end
1156
+
1157
+ # Metadata for web pages.
1158
+ class WebPage
1159
+ include Google::Apis::Core::Hashable
1160
+
1161
+ # Overall relevancy score for the web page.
1162
+ # Not normalized and not comparable across different image queries.
1163
+ # Corresponds to the JSON property `score`
1164
+ # @return [Float]
1165
+ attr_accessor :score
1166
+
1167
+ # The result web page URL.
1168
+ # Corresponds to the JSON property `url`
1169
+ # @return [String]
1170
+ attr_accessor :url
1171
+
1172
+ def initialize(**args)
1173
+ update!(**args)
1174
+ end
1175
+
1176
+ # Update properties of this object
1177
+ def update!(**args)
1178
+ @score = args[:score] if args.key?(:score)
1179
+ @url = args[:url] if args.key?(:url)
478
1180
  end
479
1181
  end
480
1182
 
481
- # Color information consists of RGB channels, score and fraction of
482
- # image the color occupies in the image.
1183
+ # Color information consists of RGB channels, score, and the fraction of
1184
+ # the image that the color occupies in the image.
483
1185
  class ColorInfo
484
1186
  include Google::Apis::Core::Hashable
485
1187
 
486
- # Stores the fraction of pixels the color occupies in the image.
1188
+ # Image-specific score for this color. Value in range [0, 1].
1189
+ # Corresponds to the JSON property `score`
1190
+ # @return [Float]
1191
+ attr_accessor :score
1192
+
1193
+ # The fraction of pixels the color occupies in the image.
487
1194
  # Value in range [0, 1].
488
1195
  # Corresponds to the JSON property `pixelFraction`
489
1196
  # @return [Float]
@@ -592,122 +1299,15 @@ module Google
592
1299
  # @return [Google::Apis::VisionV1::Color]
593
1300
  attr_accessor :color
594
1301
 
595
- # Image-specific score for this color. Value in range [0, 1].
596
- # Corresponds to the JSON property `score`
597
- # @return [Float]
598
- attr_accessor :score
599
-
600
1302
  def initialize(**args)
601
1303
  update!(**args)
602
1304
  end
603
1305
 
604
1306
  # Update properties of this object
605
1307
  def update!(**args)
1308
+ @score = args[:score] if args.key?(:score)
606
1309
  @pixel_fraction = args[:pixel_fraction] if args.key?(:pixel_fraction)
607
1310
  @color = args[:color] if args.key?(:color)
608
- @score = args[:score] if args.key?(:score)
609
- end
610
- end
611
-
612
- # A bounding polygon for the detected image annotation.
613
- class BoundingPoly
614
- include Google::Apis::Core::Hashable
615
-
616
- # The bounding polygon vertices.
617
- # Corresponds to the JSON property `vertices`
618
- # @return [Array<Google::Apis::VisionV1::Vertex>]
619
- attr_accessor :vertices
620
-
621
- def initialize(**args)
622
- update!(**args)
623
- end
624
-
625
- # Update properties of this object
626
- def update!(**args)
627
- @vertices = args[:vertices] if args.key?(:vertices)
628
- end
629
- end
630
-
631
- # A face-specific landmark (for example, a face feature).
632
- # Landmark positions may fall outside the bounds of the image
633
- # when the face is near one or more edges of the image.
634
- # Therefore it is NOT guaranteed that 0 <= x < width or 0 <= y < height.
635
- class Landmark
636
- include Google::Apis::Core::Hashable
637
-
638
- # A 3D position in the image, used primarily for Face detection landmarks.
639
- # A valid Position must have both x and y coordinates.
640
- # The position coordinates are in the same scale as the original image.
641
- # Corresponds to the JSON property `position`
642
- # @return [Google::Apis::VisionV1::Position]
643
- attr_accessor :position
644
-
645
- # Face landmark type.
646
- # Corresponds to the JSON property `type`
647
- # @return [String]
648
- attr_accessor :type
649
-
650
- def initialize(**args)
651
- update!(**args)
652
- end
653
-
654
- # Update properties of this object
655
- def update!(**args)
656
- @position = args[:position] if args.key?(:position)
657
- @type = args[:type] if args.key?(:type)
658
- end
659
- end
660
-
661
- # Image context.
662
- class ImageContext
663
- include Google::Apis::Core::Hashable
664
-
665
- # Rectangle determined by min and max LatLng pairs.
666
- # Corresponds to the JSON property `latLongRect`
667
- # @return [Google::Apis::VisionV1::LatLongRect]
668
- attr_accessor :lat_long_rect
669
-
670
- # List of languages to use for TEXT_DETECTION. In most cases, an empty value
671
- # will yield the best results as it will allow text detection to
672
- # automatically detect the text language. For languages based on the latin
673
- # alphabet a hint is not needed. In rare cases, when the language of
674
- # the text in the image is known in advance, setting this hint will help get
675
- # better results (although it will hurt a great deal if the hint is wrong).
676
- # Text detection will return an error if one or more of the languages
677
- # specified here are not supported. The exact list of supported languages are
678
- # specified here:
679
- # https://cloud.google.com/translate/v2/using_rest#language-params
680
- # Corresponds to the JSON property `languageHints`
681
- # @return [Array<String>]
682
- attr_accessor :language_hints
683
-
684
- def initialize(**args)
685
- update!(**args)
686
- end
687
-
688
- # Update properties of this object
689
- def update!(**args)
690
- @lat_long_rect = args[:lat_long_rect] if args.key?(:lat_long_rect)
691
- @language_hints = args[:language_hints] if args.key?(:language_hints)
692
- end
693
- end
694
-
695
- # Multiple image annotation requests are batched into a single service call.
696
- class BatchAnnotateImagesRequest
697
- include Google::Apis::Core::Hashable
698
-
699
- # Individual image annotation requests for this batch.
700
- # Corresponds to the JSON property `requests`
701
- # @return [Array<Google::Apis::VisionV1::AnnotateImageRequest>]
702
- attr_accessor :requests
703
-
704
- def initialize(**args)
705
- update!(**args)
706
- end
707
-
708
- # Update properties of this object
709
- def update!(**args)
710
- @requests = args[:requests] if args.key?(:requests)
711
1311
  end
712
1312
  end
713
1313
 
@@ -715,35 +1315,48 @@ module Google
715
1315
  class EntityAnnotation
716
1316
  include Google::Apis::Core::Hashable
717
1317
 
718
- # Opaque entity ID. Some IDs might be available in Knowledge Graph(KG).
719
- # For more details on KG please see:
720
- # https://developers.google.com/knowledge-graph/
1318
+ # Opaque entity ID. Some IDs may be available in
1319
+ # [Google Knowledge Graph Search API](https://developers.google.com/knowledge-
1320
+ # graph/).
721
1321
  # Corresponds to the JSON property `mid`
722
1322
  # @return [String]
723
1323
  attr_accessor :mid
724
1324
 
725
- # Entity textual description, expressed in its <code>locale</code> language.
1325
+ # The accuracy of the entity detection in an image.
1326
+ # For example, for an image in which the "Eiffel Tower" entity is detected,
1327
+ # this field represents the confidence that there is a tower in the query
1328
+ # image. Range [0, 1].
1329
+ # Corresponds to the JSON property `confidence`
1330
+ # @return [Float]
1331
+ attr_accessor :confidence
1332
+
1333
+ # The language code for the locale in which the entity textual
1334
+ # `description` is expressed.
1335
+ # Corresponds to the JSON property `locale`
1336
+ # @return [String]
1337
+ attr_accessor :locale
1338
+
1339
+ # A bounding polygon for the detected image annotation.
1340
+ # Corresponds to the JSON property `boundingPoly`
1341
+ # @return [Google::Apis::VisionV1::BoundingPoly]
1342
+ attr_accessor :bounding_poly
1343
+
1344
+ # Entity textual description, expressed in its `locale` language.
726
1345
  # Corresponds to the JSON property `description`
727
1346
  # @return [String]
728
1347
  attr_accessor :description
729
1348
 
730
1349
  # The relevancy of the ICA (Image Content Annotation) label to the
731
- # image. For example, the relevancy of 'tower' to an image containing
732
- # 'Eiffel Tower' is likely higher than an image containing a distant towering
733
- # building, though the confidence that there is a tower may be the same.
734
- # Range [0, 1].
1350
+ # image. For example, the relevancy of "tower" is likely higher to an image
1351
+ # containing the detected "Eiffel Tower" than to an image containing a
1352
+ # detected distant towering building, even though the confidence that
1353
+ # there is a tower in each image may be the same. Range [0, 1].
735
1354
  # Corresponds to the JSON property `topicality`
736
1355
  # @return [Float]
737
1356
  attr_accessor :topicality
738
1357
 
739
- # The language code for the locale in which the entity textual
740
- # <code>description</code> (next field) is expressed.
741
- # Corresponds to the JSON property `locale`
742
- # @return [String]
743
- attr_accessor :locale
744
-
745
- # Some entities can have additional optional <code>Property</code> fields.
746
- # For example a different kind of score or string that qualifies the entity.
1358
+ # Some entities may have optional user-supplied `Property` (name/value)
1359
+ # fields, such a score or string that qualifies the entity.
747
1360
  # Corresponds to the JSON property `properties`
748
1361
  # @return [Array<Google::Apis::VisionV1::Property>]
749
1362
  attr_accessor :properties
@@ -753,27 +1366,15 @@ module Google
753
1366
  # @return [Float]
754
1367
  attr_accessor :score
755
1368
 
756
- # A bounding polygon for the detected image annotation.
757
- # Corresponds to the JSON property `boundingPoly`
758
- # @return [Google::Apis::VisionV1::BoundingPoly]
759
- attr_accessor :bounding_poly
760
-
761
1369
  # The location information for the detected entity. Multiple
762
- # <code>LocationInfo</code> elements can be present since one location may
763
- # indicate the location of the scene in the query image, and another the
764
- # location of the place where the query image was taken. Location information
765
- # is usually present for landmarks.
1370
+ # `LocationInfo` elements can be present because one location may
1371
+ # indicate the location of the scene in the image, and another location
1372
+ # may indicate the location of the place where the image was taken.
1373
+ # Location information is usually present for landmarks.
766
1374
  # Corresponds to the JSON property `locations`
767
1375
  # @return [Array<Google::Apis::VisionV1::LocationInfo>]
768
1376
  attr_accessor :locations
769
1377
 
770
- # The accuracy of the entity detection in an image.
771
- # For example, for an image containing 'Eiffel Tower,' this field represents
772
- # the confidence that there is a tower in the query image. Range [0, 1].
773
- # Corresponds to the JSON property `confidence`
774
- # @return [Float]
775
- attr_accessor :confidence
776
-
777
1378
  def initialize(**args)
778
1379
  update!(**args)
779
1380
  end
@@ -781,30 +1382,36 @@ module Google
781
1382
  # Update properties of this object
782
1383
  def update!(**args)
783
1384
  @mid = args[:mid] if args.key?(:mid)
1385
+ @confidence = args[:confidence] if args.key?(:confidence)
1386
+ @locale = args[:locale] if args.key?(:locale)
1387
+ @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
784
1388
  @description = args[:description] if args.key?(:description)
785
1389
  @topicality = args[:topicality] if args.key?(:topicality)
786
- @locale = args[:locale] if args.key?(:locale)
787
1390
  @properties = args[:properties] if args.key?(:properties)
788
1391
  @score = args[:score] if args.key?(:score)
789
- @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
790
1392
  @locations = args[:locations] if args.key?(:locations)
791
- @confidence = args[:confidence] if args.key?(:confidence)
792
1393
  end
793
1394
  end
794
1395
 
795
- # Arbitrary name/value pair.
796
- class Property
1396
+ # Single crop hint that is used to generate a new crop when serving an image.
1397
+ class CropHint
797
1398
  include Google::Apis::Core::Hashable
798
1399
 
799
- # Value of the property.
800
- # Corresponds to the JSON property `value`
801
- # @return [String]
802
- attr_accessor :value
1400
+ # Confidence of this being a salient region. Range [0, 1].
1401
+ # Corresponds to the JSON property `confidence`
1402
+ # @return [Float]
1403
+ attr_accessor :confidence
803
1404
 
804
- # Name of the property.
805
- # Corresponds to the JSON property `name`
806
- # @return [String]
807
- attr_accessor :name
1405
+ # Fraction of importance of this salient region with respect to the original
1406
+ # image.
1407
+ # Corresponds to the JSON property `importanceFraction`
1408
+ # @return [Float]
1409
+ attr_accessor :importance_fraction
1410
+
1411
+ # A bounding polygon for the detected image annotation.
1412
+ # Corresponds to the JSON property `boundingPoly`
1413
+ # @return [Google::Apis::VisionV1::BoundingPoly]
1414
+ attr_accessor :bounding_poly
808
1415
 
809
1416
  def initialize(**args)
810
1417
  update!(**args)
@@ -812,140 +1419,57 @@ module Google
812
1419
 
813
1420
  # Update properties of this object
814
1421
  def update!(**args)
815
- @value = args[:value] if args.key?(:value)
816
- @name = args[:name] if args.key?(:name)
1422
+ @confidence = args[:confidence] if args.key?(:confidence)
1423
+ @importance_fraction = args[:importance_fraction] if args.key?(:importance_fraction)
1424
+ @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
817
1425
  end
818
1426
  end
819
1427
 
820
- # Represents a color in the RGBA color space. This representation is designed
821
- # for simplicity of conversion to/from color representations in various
822
- # languages over compactness; for example, the fields of this representation
823
- # can be trivially provided to the constructor of "java.awt.Color" in Java; it
824
- # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
825
- # method in iOS; and, with just a little work, it can be easily formatted into
826
- # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
827
- # Example (Java):
828
- # import com.google.type.Color;
829
- # // ...
830
- # public static java.awt.Color fromProto(Color protocolor) `
831
- # float alpha = protocolor.hasAlpha()
832
- # ? protocolor.getAlpha().getValue()
833
- # : 1.0;
834
- # return new java.awt.Color(
835
- # protocolor.getRed(),
836
- # protocolor.getGreen(),
837
- # protocolor.getBlue(),
838
- # alpha);
839
- # `
840
- # public static Color toProto(java.awt.Color color) `
841
- # float red = (float) color.getRed();
842
- # float green = (float) color.getGreen();
843
- # float blue = (float) color.getBlue();
844
- # float denominator = 255.0;
845
- # Color.Builder resultBuilder =
846
- # Color
847
- # .newBuilder()
848
- # .setRed(red / denominator)
849
- # .setGreen(green / denominator)
850
- # .setBlue(blue / denominator);
851
- # int alpha = color.getAlpha();
852
- # if (alpha != 255) `
853
- # result.setAlpha(
854
- # FloatValue
855
- # .newBuilder()
856
- # .setValue(((float) alpha) / denominator)
857
- # .build());
858
- # `
859
- # return resultBuilder.build();
860
- # `
861
- # // ...
862
- # Example (iOS / Obj-C):
863
- # // ...
864
- # static UIColor* fromProto(Color* protocolor) `
865
- # float red = [protocolor red];
866
- # float green = [protocolor green];
867
- # float blue = [protocolor blue];
868
- # FloatValue* alpha_wrapper = [protocolor alpha];
869
- # float alpha = 1.0;
870
- # if (alpha_wrapper != nil) `
871
- # alpha = [alpha_wrapper value];
872
- # `
873
- # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
874
- # `
875
- # static Color* toProto(UIColor* color) `
876
- # CGFloat red, green, blue, alpha;
877
- # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
878
- # return nil;
879
- # `
880
- # Color* result = [Color alloc] init];
881
- # [result setRed:red];
882
- # [result setGreen:green];
883
- # [result setBlue:blue];
884
- # if (alpha <= 0.9999) `
885
- # [result setAlpha:floatWrapperWithValue(alpha)];
886
- # `
887
- # [result autorelease];
888
- # return result;
889
- # `
890
- # // ...
891
- # Example (JavaScript):
892
- # // ...
893
- # var protoToCssColor = function(rgb_color) `
894
- # var redFrac = rgb_color.red || 0.0;
895
- # var greenFrac = rgb_color.green || 0.0;
896
- # var blueFrac = rgb_color.blue || 0.0;
897
- # var red = Math.floor(redFrac * 255);
898
- # var green = Math.floor(greenFrac * 255);
899
- # var blue = Math.floor(blueFrac * 255);
900
- # if (!('alpha' in rgb_color)) `
901
- # return rgbToCssColor_(red, green, blue);
902
- # `
903
- # var alphaFrac = rgb_color.alpha.value || 0.0;
904
- # var rgbParams = [red, green, blue].join(',');
905
- # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
906
- # `;
907
- # var rgbToCssColor_ = function(red, green, blue) `
908
- # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
909
- # var hexString = rgbNumber.toString(16);
910
- # var missingZeros = 6 - hexString.length;
911
- # var resultBuilder = ['#'];
912
- # for (var i = 0; i < missingZeros; i++) `
913
- # resultBuilder.push('0');
914
- # `
915
- # resultBuilder.push(hexString);
916
- # return resultBuilder.join('');
917
- # `;
918
- # // ...
919
- class Color
1428
+ # A face-specific landmark (for example, a face feature).
1429
+ # Landmark positions may fall outside the bounds of the image
1430
+ # if the face is near one or more edges of the image.
1431
+ # Therefore it is NOT guaranteed that `0 <= x < width` or
1432
+ # `0 <= y < height`.
1433
+ class Landmark
920
1434
  include Google::Apis::Core::Hashable
921
1435
 
922
- # The amount of green in the color as a value in the interval [0, 1].
923
- # Corresponds to the JSON property `green`
924
- # @return [Float]
925
- attr_accessor :green
1436
+ # A 3D position in the image, used primarily for Face detection landmarks.
1437
+ # A valid Position must have both x and y coordinates.
1438
+ # The position coordinates are in the same scale as the original image.
1439
+ # Corresponds to the JSON property `position`
1440
+ # @return [Google::Apis::VisionV1::Position]
1441
+ attr_accessor :position
926
1442
 
927
- # The amount of blue in the color as a value in the interval [0, 1].
928
- # Corresponds to the JSON property `blue`
929
- # @return [Float]
930
- attr_accessor :blue
1443
+ # Face landmark type.
1444
+ # Corresponds to the JSON property `type`
1445
+ # @return [String]
1446
+ attr_accessor :type
931
1447
 
932
- # The amount of red in the color as a value in the interval [0, 1].
933
- # Corresponds to the JSON property `red`
934
- # @return [Float]
935
- attr_accessor :red
1448
+ def initialize(**args)
1449
+ update!(**args)
1450
+ end
936
1451
 
937
- # The fraction of this color that should be applied to the pixel. That is,
938
- # the final pixel color is defined by the equation:
939
- # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
940
- # This means that a value of 1.0 corresponds to a solid color, whereas
941
- # a value of 0.0 corresponds to a completely transparent color. This
942
- # uses a wrapper message rather than a simple float scalar so that it is
943
- # possible to distinguish between a default value and the value being unset.
944
- # If omitted, this color object is to be rendered as a solid color
945
- # (as if the alpha value had been explicitly given with a value of 1.0).
946
- # Corresponds to the JSON property `alpha`
1452
+ # Update properties of this object
1453
+ def update!(**args)
1454
+ @position = args[:position] if args.key?(:position)
1455
+ @type = args[:type] if args.key?(:type)
1456
+ end
1457
+ end
1458
+
1459
+ # Metadata for online images.
1460
+ class WebImage
1461
+ include Google::Apis::Core::Hashable
1462
+
1463
+ # Overall relevancy score for the image.
1464
+ # Not normalized and not comparable across different image queries.
1465
+ # Corresponds to the JSON property `score`
947
1466
  # @return [Float]
948
- attr_accessor :alpha
1467
+ attr_accessor :score
1468
+
1469
+ # The result image URL.
1470
+ # Corresponds to the JSON property `url`
1471
+ # @return [String]
1472
+ attr_accessor :url
949
1473
 
950
1474
  def initialize(**args)
951
1475
  update!(**args)
@@ -953,93 +1477,61 @@ module Google
953
1477
 
954
1478
  # Update properties of this object
955
1479
  def update!(**args)
956
- @green = args[:green] if args.key?(:green)
957
- @blue = args[:blue] if args.key?(:blue)
958
- @red = args[:red] if args.key?(:red)
959
- @alpha = args[:alpha] if args.key?(:alpha)
1480
+ @score = args[:score] if args.key?(:score)
1481
+ @url = args[:url] if args.key?(:url)
960
1482
  end
961
1483
  end
962
1484
 
963
- # Detected entity location information.
964
- class LocationInfo
1485
+ # A word representation.
1486
+ class Word
965
1487
  include Google::Apis::Core::Hashable
966
1488
 
967
- # An object representing a latitude/longitude pair. This is expressed as a pair
968
- # of doubles representing degrees latitude and degrees longitude. Unless
969
- # specified otherwise, this must conform to the
970
- # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
971
- # standard</a>. Values must be within normalized ranges.
972
- # Example of normalization code in Python:
973
- # def NormalizeLongitude(longitude):
974
- # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
975
- # q, r = divmod(longitude, 360.0)
976
- # if r > 180.0 or (r == 180.0 and q <= -1.0):
977
- # return r - 360.0
978
- # return r
979
- # def NormalizeLatLng(latitude, longitude):
980
- # """Wraps decimal degrees latitude and longitude to
981
- # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
982
- # r = latitude % 360.0
983
- # if r <= 90.0:
984
- # return r, NormalizeLongitude(longitude)
985
- # elif r >= 270.0:
986
- # return r - 360, NormalizeLongitude(longitude)
987
- # else:
988
- # return 180 - r, NormalizeLongitude(longitude + 180.0)
989
- # assert 180.0 == NormalizeLongitude(180.0)
990
- # assert -180.0 == NormalizeLongitude(-180.0)
991
- # assert -179.0 == NormalizeLongitude(181.0)
992
- # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
993
- # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
994
- # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
995
- # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
996
- # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
997
- # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
998
- # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
999
- # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
1000
- # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
1001
- # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
1002
- # Corresponds to the JSON property `latLng`
1003
- # @return [Google::Apis::VisionV1::LatLng]
1004
- attr_accessor :lat_lng
1005
-
1489
+ # A bounding polygon for the detected image annotation.
1490
+ # Corresponds to the JSON property `boundingBox`
1491
+ # @return [Google::Apis::VisionV1::BoundingPoly]
1492
+ attr_accessor :bounding_box
1493
+
1494
+ # List of symbols in the word.
1495
+ # The order of the symbols follows the natural reading order.
1496
+ # Corresponds to the JSON property `symbols`
1497
+ # @return [Array<Google::Apis::VisionV1::Symbol>]
1498
+ attr_accessor :symbols
1499
+
1500
+ # Additional information detected on the structural component.
1501
+ # Corresponds to the JSON property `property`
1502
+ # @return [Google::Apis::VisionV1::TextProperty]
1503
+ attr_accessor :property
1504
+
1006
1505
  def initialize(**args)
1007
1506
  update!(**args)
1008
1507
  end
1009
1508
 
1010
1509
  # Update properties of this object
1011
1510
  def update!(**args)
1012
- @lat_lng = args[:lat_lng] if args.key?(:lat_lng)
1511
+ @bounding_box = args[:bounding_box] if args.key?(:bounding_box)
1512
+ @symbols = args[:symbols] if args.key?(:symbols)
1513
+ @property = args[:property] if args.key?(:property)
1013
1514
  end
1014
1515
  end
1015
1516
 
1016
- # Set of features pertaining to the image, computed by various computer vision
1017
- # methods over safe-search verticals (for example, adult, spoof, medical,
1018
- # violence).
1019
- class SafeSearchAnnotation
1517
+ # Structural unit of text representing a number of words in certain order.
1518
+ class Paragraph
1020
1519
  include Google::Apis::Core::Hashable
1021
1520
 
1022
- # Likelihood this is a medical image.
1023
- # Corresponds to the JSON property `medical`
1024
- # @return [String]
1025
- attr_accessor :medical
1026
-
1027
- # Spoof likelihood. The likelihood that an obvious modification
1028
- # was made to the image's canonical version to make it appear
1029
- # funny or offensive.
1030
- # Corresponds to the JSON property `spoof`
1031
- # @return [String]
1032
- attr_accessor :spoof
1521
+ # Additional information detected on the structural component.
1522
+ # Corresponds to the JSON property `property`
1523
+ # @return [Google::Apis::VisionV1::TextProperty]
1524
+ attr_accessor :property
1033
1525
 
1034
- # Violence likelihood.
1035
- # Corresponds to the JSON property `violence`
1036
- # @return [String]
1037
- attr_accessor :violence
1526
+ # A bounding polygon for the detected image annotation.
1527
+ # Corresponds to the JSON property `boundingBox`
1528
+ # @return [Google::Apis::VisionV1::BoundingPoly]
1529
+ attr_accessor :bounding_box
1038
1530
 
1039
- # Represents the adult contents likelihood for the image.
1040
- # Corresponds to the JSON property `adult`
1041
- # @return [String]
1042
- attr_accessor :adult
1531
+ # List of words in this paragraph.
1532
+ # Corresponds to the JSON property `words`
1533
+ # @return [Array<Google::Apis::VisionV1::Word>]
1534
+ attr_accessor :words
1043
1535
 
1044
1536
  def initialize(**args)
1045
1537
  update!(**args)
@@ -1047,10 +1539,9 @@ module Google
1047
1539
 
1048
1540
  # Update properties of this object
1049
1541
  def update!(**args)
1050
- @medical = args[:medical] if args.key?(:medical)
1051
- @spoof = args[:spoof] if args.key?(:spoof)
1052
- @violence = args[:violence] if args.key?(:violence)
1053
- @adult = args[:adult] if args.key?(:adult)
1542
+ @property = args[:property] if args.key?(:property)
1543
+ @bounding_box = args[:bounding_box] if args.key?(:bounding_box)
1544
+ @words = args[:words] if args.key?(:words)
1054
1545
  end
1055
1546
  end
1056
1547
 
@@ -1058,62 +1549,112 @@ module Google
1058
1549
  class Image
1059
1550
  include Google::Apis::Core::Hashable
1060
1551
 
1061
- # External image source (Google Cloud Storage image location).
1062
- # Corresponds to the JSON property `source`
1063
- # @return [Google::Apis::VisionV1::ImageSource]
1064
- attr_accessor :source
1065
-
1066
1552
  # Image content, represented as a stream of bytes.
1553
+ # Note: as with all `bytes` fields, protobuffers use a pure binary
1554
+ # representation, whereas JSON representations use base64.
1067
1555
  # Corresponds to the JSON property `content`
1068
1556
  # @return [String]
1069
1557
  attr_accessor :content
1070
1558
 
1559
+ # External image source (Google Cloud Storage image location).
1560
+ # Corresponds to the JSON property `source`
1561
+ # @return [Google::Apis::VisionV1::ImageSource]
1562
+ attr_accessor :source
1563
+
1071
1564
  def initialize(**args)
1072
1565
  update!(**args)
1073
1566
  end
1074
1567
 
1075
1568
  # Update properties of this object
1076
1569
  def update!(**args)
1077
- @source = args[:source] if args.key?(:source)
1078
1570
  @content = args[:content] if args.key?(:content)
1571
+ @source = args[:source] if args.key?(:source)
1079
1572
  end
1080
1573
  end
1081
1574
 
1082
- # Set of dominant colors and their corresponding scores.
1083
- class DominantColorsAnnotation
1575
+ # A face annotation object contains the results of face detection.
1576
+ class FaceAnnotation
1084
1577
  include Google::Apis::Core::Hashable
1085
1578
 
1086
- # RGB color values, with their score and pixel fraction.
1087
- # Corresponds to the JSON property `colors`
1088
- # @return [Array<Google::Apis::VisionV1::ColorInfo>]
1089
- attr_accessor :colors
1579
+ # Pitch angle, which indicates the upwards/downwards angle that the face is
1580
+ # pointing relative to the image's horizontal plane. Range [-180,180].
1581
+ # Corresponds to the JSON property `tiltAngle`
1582
+ # @return [Float]
1583
+ attr_accessor :tilt_angle
1090
1584
 
1091
- def initialize(**args)
1092
- update!(**args)
1093
- end
1585
+ # A bounding polygon for the detected image annotation.
1586
+ # Corresponds to the JSON property `fdBoundingPoly`
1587
+ # @return [Google::Apis::VisionV1::BoundingPoly]
1588
+ attr_accessor :fd_bounding_poly
1094
1589
 
1095
- # Update properties of this object
1096
- def update!(**args)
1097
- @colors = args[:colors] if args.key?(:colors)
1098
- end
1099
- end
1590
+ # Anger likelihood.
1591
+ # Corresponds to the JSON property `angerLikelihood`
1592
+ # @return [String]
1593
+ attr_accessor :anger_likelihood
1100
1594
 
1101
- # The <em>Feature</em> indicates what type of image detection task to perform.
1102
- # Users describe the type of Google Cloud Vision API tasks to perform over
1103
- # images by using <em>Feature</em>s. Features encode the Cloud Vision API
1104
- # vertical to operate on and the number of top-scoring results to return.
1105
- class Feature
1106
- include Google::Apis::Core::Hashable
1595
+ # Detected face landmarks.
1596
+ # Corresponds to the JSON property `landmarks`
1597
+ # @return [Array<Google::Apis::VisionV1::Landmark>]
1598
+ attr_accessor :landmarks
1107
1599
 
1108
- # The feature type.
1109
- # Corresponds to the JSON property `type`
1600
+ # Surprise likelihood.
1601
+ # Corresponds to the JSON property `surpriseLikelihood`
1110
1602
  # @return [String]
1111
- attr_accessor :type
1603
+ attr_accessor :surprise_likelihood
1112
1604
 
1113
- # Maximum number of results of this type.
1114
- # Corresponds to the JSON property `maxResults`
1115
- # @return [Fixnum]
1116
- attr_accessor :max_results
1605
+ # Face landmarking confidence. Range [0, 1].
1606
+ # Corresponds to the JSON property `landmarkingConfidence`
1607
+ # @return [Float]
1608
+ attr_accessor :landmarking_confidence
1609
+
1610
+ # Joy likelihood.
1611
+ # Corresponds to the JSON property `joyLikelihood`
1612
+ # @return [String]
1613
+ attr_accessor :joy_likelihood
1614
+
1615
+ # Detection confidence. Range [0, 1].
1616
+ # Corresponds to the JSON property `detectionConfidence`
1617
+ # @return [Float]
1618
+ attr_accessor :detection_confidence
1619
+
1620
+ # Yaw angle, which indicates the leftward/rightward angle that the face is
1621
+ # pointing relative to the vertical plane perpendicular to the image. Range
1622
+ # [-180,180].
1623
+ # Corresponds to the JSON property `panAngle`
1624
+ # @return [Float]
1625
+ attr_accessor :pan_angle
1626
+
1627
+ # Under-exposed likelihood.
1628
+ # Corresponds to the JSON property `underExposedLikelihood`
1629
+ # @return [String]
1630
+ attr_accessor :under_exposed_likelihood
1631
+
1632
+ # Blurred likelihood.
1633
+ # Corresponds to the JSON property `blurredLikelihood`
1634
+ # @return [String]
1635
+ attr_accessor :blurred_likelihood
1636
+
1637
+ # Headwear likelihood.
1638
+ # Corresponds to the JSON property `headwearLikelihood`
1639
+ # @return [String]
1640
+ attr_accessor :headwear_likelihood
1641
+
1642
+ # A bounding polygon for the detected image annotation.
1643
+ # Corresponds to the JSON property `boundingPoly`
1644
+ # @return [Google::Apis::VisionV1::BoundingPoly]
1645
+ attr_accessor :bounding_poly
1646
+
1647
+ # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
1648
+ # of the face relative to the image vertical about the axis perpendicular to
1649
+ # the face. Range [-180,180].
1650
+ # Corresponds to the JSON property `rollAngle`
1651
+ # @return [Float]
1652
+ attr_accessor :roll_angle
1653
+
1654
+ # Sorrow likelihood.
1655
+ # Corresponds to the JSON property `sorrowLikelihood`
1656
+ # @return [String]
1657
+ attr_accessor :sorrow_likelihood
1117
1658
 
1118
1659
  def initialize(**args)
1119
1660
  update!(**args)
@@ -1121,19 +1662,32 @@ module Google
1121
1662
 
1122
1663
  # Update properties of this object
1123
1664
  def update!(**args)
1124
- @type = args[:type] if args.key?(:type)
1125
- @max_results = args[:max_results] if args.key?(:max_results)
1665
+ @tilt_angle = args[:tilt_angle] if args.key?(:tilt_angle)
1666
+ @fd_bounding_poly = args[:fd_bounding_poly] if args.key?(:fd_bounding_poly)
1667
+ @anger_likelihood = args[:anger_likelihood] if args.key?(:anger_likelihood)
1668
+ @landmarks = args[:landmarks] if args.key?(:landmarks)
1669
+ @surprise_likelihood = args[:surprise_likelihood] if args.key?(:surprise_likelihood)
1670
+ @landmarking_confidence = args[:landmarking_confidence] if args.key?(:landmarking_confidence)
1671
+ @joy_likelihood = args[:joy_likelihood] if args.key?(:joy_likelihood)
1672
+ @detection_confidence = args[:detection_confidence] if args.key?(:detection_confidence)
1673
+ @pan_angle = args[:pan_angle] if args.key?(:pan_angle)
1674
+ @under_exposed_likelihood = args[:under_exposed_likelihood] if args.key?(:under_exposed_likelihood)
1675
+ @blurred_likelihood = args[:blurred_likelihood] if args.key?(:blurred_likelihood)
1676
+ @headwear_likelihood = args[:headwear_likelihood] if args.key?(:headwear_likelihood)
1677
+ @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
1678
+ @roll_angle = args[:roll_angle] if args.key?(:roll_angle)
1679
+ @sorrow_likelihood = args[:sorrow_likelihood] if args.key?(:sorrow_likelihood)
1126
1680
  end
1127
1681
  end
1128
1682
 
1129
- # Response to a batch image annotation request.
1130
- class BatchAnnotateImagesResponse
1683
+ # Multiple image annotation requests are batched into a single service call.
1684
+ class BatchAnnotateImagesRequest
1131
1685
  include Google::Apis::Core::Hashable
1132
1686
 
1133
- # Individual responses to image annotation requests within the batch.
1134
- # Corresponds to the JSON property `responses`
1135
- # @return [Array<Google::Apis::VisionV1::AnnotateImageResponse>]
1136
- attr_accessor :responses
1687
+ # Individual image annotation requests for this batch.
1688
+ # Corresponds to the JSON property `requests`
1689
+ # @return [Array<Google::Apis::VisionV1::AnnotateImageRequest>]
1690
+ attr_accessor :requests
1137
1691
 
1138
1692
  def initialize(**args)
1139
1693
  update!(**args)
@@ -1141,18 +1695,24 @@ module Google
1141
1695
 
1142
1696
  # Update properties of this object
1143
1697
  def update!(**args)
1144
- @responses = args[:responses] if args.key?(:responses)
1698
+ @requests = args[:requests] if args.key?(:requests)
1145
1699
  end
1146
1700
  end
1147
1701
 
1148
- # Stores image properties (e.g. dominant colors).
1149
- class ImageProperties
1702
+ # Detected start or end of a structural component.
1703
+ class DetectedBreak
1150
1704
  include Google::Apis::Core::Hashable
1151
1705
 
1152
- # Set of dominant colors and their corresponding scores.
1153
- # Corresponds to the JSON property `dominantColors`
1154
- # @return [Google::Apis::VisionV1::DominantColorsAnnotation]
1155
- attr_accessor :dominant_colors
1706
+ # Detected break type.
1707
+ # Corresponds to the JSON property `type`
1708
+ # @return [String]
1709
+ attr_accessor :type
1710
+
1711
+ # True if break prepends the element.
1712
+ # Corresponds to the JSON property `isPrefix`
1713
+ # @return [Boolean]
1714
+ attr_accessor :is_prefix
1715
+ alias_method :is_prefix?, :is_prefix
1156
1716
 
1157
1717
  def initialize(**args)
1158
1718
  update!(**args)
@@ -1160,57 +1720,36 @@ module Google
1160
1720
 
1161
1721
  # Update properties of this object
1162
1722
  def update!(**args)
1163
- @dominant_colors = args[:dominant_colors] if args.key?(:dominant_colors)
1723
+ @type = args[:type] if args.key?(:type)
1724
+ @is_prefix = args[:is_prefix] if args.key?(:is_prefix)
1164
1725
  end
1165
1726
  end
1166
1727
 
1167
- # An object representing a latitude/longitude pair. This is expressed as a pair
1168
- # of doubles representing degrees latitude and degrees longitude. Unless
1169
- # specified otherwise, this must conform to the
1170
- # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
1171
- # standard</a>. Values must be within normalized ranges.
1172
- # Example of normalization code in Python:
1173
- # def NormalizeLongitude(longitude):
1174
- # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
1175
- # q, r = divmod(longitude, 360.0)
1176
- # if r > 180.0 or (r == 180.0 and q <= -1.0):
1177
- # return r - 360.0
1178
- # return r
1179
- # def NormalizeLatLng(latitude, longitude):
1180
- # """Wraps decimal degrees latitude and longitude to
1181
- # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
1182
- # r = latitude % 360.0
1183
- # if r <= 90.0:
1184
- # return r, NormalizeLongitude(longitude)
1185
- # elif r >= 270.0:
1186
- # return r - 360, NormalizeLongitude(longitude)
1187
- # else:
1188
- # return 180 - r, NormalizeLongitude(longitude + 180.0)
1189
- # assert 180.0 == NormalizeLongitude(180.0)
1190
- # assert -180.0 == NormalizeLongitude(-180.0)
1191
- # assert -179.0 == NormalizeLongitude(181.0)
1192
- # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
1193
- # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
1194
- # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
1195
- # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
1196
- # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
1197
- # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
1198
- # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
1199
- # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
1200
- # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
1201
- # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
1202
- class LatLng
1728
+ # Image context and/or feature-specific parameters.
1729
+ class ImageContext
1203
1730
  include Google::Apis::Core::Hashable
1204
1731
 
1205
- # The latitude in degrees. It must be in the range [-90.0, +90.0].
1206
- # Corresponds to the JSON property `latitude`
1207
- # @return [Float]
1208
- attr_accessor :latitude
1732
+ # List of languages to use for TEXT_DETECTION. In most cases, an empty value
1733
+ # yields the best results since it enables automatic language detection. For
1734
+ # languages based on the Latin alphabet, setting `language_hints` is not
1735
+ # needed. In rare cases, when the language of the text in the image is known,
1736
+ # setting a hint will help get better results (although it will be a
1737
+ # significant hindrance if the hint is wrong). Text detection returns an
1738
+ # error if one or more of the specified languages is not one of the
1739
+ # [supported languages](/vision/docs/languages).
1740
+ # Corresponds to the JSON property `languageHints`
1741
+ # @return [Array<String>]
1742
+ attr_accessor :language_hints
1209
1743
 
1210
- # The longitude in degrees. It must be in the range [-180.0, +180.0].
1211
- # Corresponds to the JSON property `longitude`
1212
- # @return [Float]
1213
- attr_accessor :longitude
1744
+ # Rectangle determined by min and max `LatLng` pairs.
1745
+ # Corresponds to the JSON property `latLongRect`
1746
+ # @return [Google::Apis::VisionV1::LatLongRect]
1747
+ attr_accessor :lat_long_rect
1748
+
1749
+ # Parameters for crop hints annotation request.
1750
+ # Corresponds to the JSON property `cropHintsParams`
1751
+ # @return [Google::Apis::VisionV1::CropHintsParams]
1752
+ attr_accessor :crop_hints_params
1214
1753
 
1215
1754
  def initialize(**args)
1216
1755
  update!(**args)
@@ -1218,31 +1757,35 @@ module Google
1218
1757
 
1219
1758
  # Update properties of this object
1220
1759
  def update!(**args)
1221
- @latitude = args[:latitude] if args.key?(:latitude)
1222
- @longitude = args[:longitude] if args.key?(:longitude)
1760
+ @language_hints = args[:language_hints] if args.key?(:language_hints)
1761
+ @lat_long_rect = args[:lat_long_rect] if args.key?(:lat_long_rect)
1762
+ @crop_hints_params = args[:crop_hints_params] if args.key?(:crop_hints_params)
1223
1763
  end
1224
1764
  end
1225
1765
 
1226
- # A 3D position in the image, used primarily for Face detection landmarks.
1227
- # A valid Position must have both x and y coordinates.
1228
- # The position coordinates are in the same scale as the original image.
1229
- class Position
1766
+ # Detected page from OCR.
1767
+ class Page
1230
1768
  include Google::Apis::Core::Hashable
1231
1769
 
1232
- # Y coordinate.
1233
- # Corresponds to the JSON property `y`
1234
- # @return [Float]
1235
- attr_accessor :y
1770
+ # Page width in pixels.
1771
+ # Corresponds to the JSON property `width`
1772
+ # @return [Fixnum]
1773
+ attr_accessor :width
1236
1774
 
1237
- # X coordinate.
1238
- # Corresponds to the JSON property `x`
1239
- # @return [Float]
1240
- attr_accessor :x
1775
+ # List of blocks of text, images etc on this page.
1776
+ # Corresponds to the JSON property `blocks`
1777
+ # @return [Array<Google::Apis::VisionV1::Block>]
1778
+ attr_accessor :blocks
1241
1779
 
1242
- # Z coordinate (or depth).
1243
- # Corresponds to the JSON property `z`
1244
- # @return [Float]
1245
- attr_accessor :z
1780
+ # Additional information detected on the structural component.
1781
+ # Corresponds to the JSON property `property`
1782
+ # @return [Google::Apis::VisionV1::TextProperty]
1783
+ attr_accessor :property
1784
+
1785
+ # Page height in pixels.
1786
+ # Corresponds to the JSON property `height`
1787
+ # @return [Fixnum]
1788
+ attr_accessor :height
1246
1789
 
1247
1790
  def initialize(**args)
1248
1791
  update!(**args)
@@ -1250,9 +1793,10 @@ module Google
1250
1793
 
1251
1794
  # Update properties of this object
1252
1795
  def update!(**args)
1253
- @y = args[:y] if args.key?(:y)
1254
- @x = args[:x] if args.key?(:x)
1255
- @z = args[:z] if args.key?(:z)
1796
+ @width = args[:width] if args.key?(:width)
1797
+ @blocks = args[:blocks] if args.key?(:blocks)
1798
+ @property = args[:property] if args.key?(:property)
1799
+ @height = args[:height] if args.key?(:height)
1256
1800
  end
1257
1801
  end
1258
1802
  end