google-api-client 0.10.2 → 0.10.3

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