google-api-client 0.11.1 → 0.11.2

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