google-api-client 0.11.3 → 0.12.0

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