google-api-client 0.12.0 → 0.13.0

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