google-api-client 0.9.26 → 0.9.28

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 (123) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/api_names.yaml +36326 -36213
  5. data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
  6. data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +155 -155
  7. data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +32 -32
  8. data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +104 -104
  9. data/generated/google/apis/adsense_v1_4.rb +1 -1
  10. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  11. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  12. data/generated/google/apis/appstate_v1.rb +1 -1
  13. data/generated/google/apis/calendar_v3.rb +1 -1
  14. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  15. data/generated/google/apis/cloudbuild_v1/classes.rb +260 -248
  16. data/generated/google/apis/cloudbuild_v1/representations.rb +47 -45
  17. data/generated/google/apis/cloudbuild_v1/service.rb +167 -167
  18. data/generated/google/apis/clouddebugger_v2.rb +3 -3
  19. data/generated/google/apis/clouddebugger_v2/classes.rb +569 -569
  20. data/generated/google/apis/clouddebugger_v2/representations.rb +146 -146
  21. data/generated/google/apis/clouddebugger_v2/service.rb +145 -145
  22. data/generated/google/apis/cloudkms_v1beta1.rb +4 -3
  23. data/generated/google/apis/cloudkms_v1beta1/classes.rb +428 -428
  24. data/generated/google/apis/cloudkms_v1beta1/representations.rb +115 -115
  25. data/generated/google/apis/cloudkms_v1beta1/service.rb +161 -160
  26. data/generated/google/apis/cloudmonitoring_v2beta2.rb +1 -1
  27. data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
  28. data/generated/google/apis/cloudresourcemanager_v1/classes.rb +583 -583
  29. data/generated/google/apis/cloudresourcemanager_v1/representations.rb +100 -100
  30. data/generated/google/apis/cloudresourcemanager_v1/service.rb +116 -116
  31. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
  32. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +195 -195
  33. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +58 -58
  34. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +316 -316
  35. data/generated/google/apis/content_v2.rb +1 -1
  36. data/generated/google/apis/content_v2/classes.rb +12 -0
  37. data/generated/google/apis/content_v2/representations.rb +2 -0
  38. data/generated/google/apis/dataflow_v1b3.rb +1 -1
  39. data/generated/google/apis/dataflow_v1b3/classes.rb +2833 -2694
  40. data/generated/google/apis/dataflow_v1b3/representations.rb +666 -666
  41. data/generated/google/apis/dataflow_v1b3/service.rb +351 -349
  42. data/generated/google/apis/datastore_v1.rb +1 -1
  43. data/generated/google/apis/deploymentmanager_v2.rb +1 -1
  44. data/generated/google/apis/deploymentmanager_v2/classes.rb +21 -12
  45. data/generated/google/apis/deploymentmanager_v2/representations.rb +1 -0
  46. data/generated/google/apis/deploymentmanager_v2/service.rb +5 -5
  47. data/generated/google/apis/dns_v1.rb +1 -1
  48. data/generated/google/apis/dns_v2beta1.rb +1 -1
  49. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  50. data/generated/google/apis/doubleclicksearch_v2/classes.rb +6 -4
  51. data/generated/google/apis/drive_v2.rb +1 -1
  52. data/generated/google/apis/drive_v2/classes.rb +26 -0
  53. data/generated/google/apis/drive_v2/representations.rb +14 -0
  54. data/generated/google/apis/drive_v2/service.rb +38 -2
  55. data/generated/google/apis/drive_v3.rb +1 -1
  56. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  57. data/generated/google/apis/games_management_v1management.rb +1 -1
  58. data/generated/google/apis/games_v1.rb +1 -1
  59. data/generated/google/apis/genomics_v1.rb +4 -4
  60. data/generated/google/apis/genomics_v1/classes.rb +2317 -2317
  61. data/generated/google/apis/genomics_v1/representations.rb +476 -476
  62. data/generated/google/apis/genomics_v1/service.rb +1038 -1038
  63. data/generated/google/apis/gmail_v1.rb +1 -1
  64. data/generated/google/apis/gmail_v1/classes.rb +82 -1
  65. data/generated/google/apis/gmail_v1/representations.rb +33 -0
  66. data/generated/google/apis/gmail_v1/service.rb +215 -5
  67. data/generated/google/apis/iam_v1.rb +1 -1
  68. data/generated/google/apis/iam_v1/classes.rb +446 -343
  69. data/generated/google/apis/iam_v1/representations.rb +112 -85
  70. data/generated/google/apis/iam_v1/service.rb +248 -192
  71. data/generated/google/apis/kgsearch_v1/classes.rb +6 -6
  72. data/generated/google/apis/kgsearch_v1/representations.rb +1 -1
  73. data/generated/google/apis/kgsearch_v1/service.rb +15 -15
  74. data/generated/google/apis/language_v1beta1.rb +1 -1
  75. data/generated/google/apis/language_v1beta1/classes.rb +396 -396
  76. data/generated/google/apis/language_v1beta1/representations.rb +97 -97
  77. data/generated/google/apis/language_v1beta1/service.rb +42 -42
  78. data/generated/google/apis/logging_v2beta1.rb +1 -1
  79. data/generated/google/apis/logging_v2beta1/classes.rb +855 -855
  80. data/generated/google/apis/logging_v2beta1/representations.rb +155 -155
  81. data/generated/google/apis/logging_v2beta1/service.rb +214 -214
  82. data/generated/google/apis/monitoring_v3.rb +4 -4
  83. data/generated/google/apis/monitoring_v3/classes.rb +551 -551
  84. data/generated/google/apis/monitoring_v3/representations.rb +123 -123
  85. data/generated/google/apis/monitoring_v3/service.rb +80 -80
  86. data/generated/google/apis/plus_domains_v1.rb +1 -1
  87. data/generated/google/apis/plus_v1.rb +1 -1
  88. data/generated/google/apis/pubsub_v1.rb +3 -3
  89. data/generated/google/apis/pubsub_v1/classes.rb +391 -391
  90. data/generated/google/apis/pubsub_v1/representations.rb +83 -83
  91. data/generated/google/apis/pubsub_v1/service.rb +257 -257
  92. data/generated/google/apis/sheets_v4.rb +1 -1
  93. data/generated/google/apis/sheets_v4/classes.rb +4334 -4334
  94. data/generated/google/apis/sheets_v4/representations.rb +861 -861
  95. data/generated/google/apis/sheets_v4/service.rb +191 -191
  96. data/generated/google/apis/slides_v1.rb +7 -7
  97. data/generated/google/apis/slides_v1/classes.rb +2726 -2555
  98. data/generated/google/apis/slides_v1/representations.rb +678 -607
  99. data/generated/google/apis/slides_v1/service.rb +16 -16
  100. data/generated/google/apis/speech_v1beta1.rb +1 -1
  101. data/generated/google/apis/speech_v1beta1/classes.rb +57 -59
  102. data/generated/google/apis/speech_v1beta1/representations.rb +9 -9
  103. data/generated/google/apis/speech_v1beta1/service.rb +63 -63
  104. data/generated/google/apis/storage_v1.rb +1 -1
  105. data/generated/google/apis/storage_v1/classes.rb +4 -3
  106. data/generated/google/apis/vision_v1/classes.rb +925 -925
  107. data/generated/google/apis/vision_v1/representations.rb +134 -134
  108. data/generated/google/apis/vision_v1/service.rb +4 -4
  109. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  110. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  111. data/generated/google/apis/youtube_v3.rb +1 -1
  112. data/generated/google/apis/youtube_v3/classes.rb +234 -1
  113. data/generated/google/apis/youtube_v3/representations.rb +83 -0
  114. data/generated/google/apis/youtube_v3/service.rb +55 -0
  115. data/generated/google/apis/youtubereporting_v1.rb +1 -1
  116. data/generated/google/apis/youtubereporting_v1/classes.rb +105 -105
  117. data/generated/google/apis/youtubereporting_v1/representations.rb +31 -31
  118. data/generated/google/apis/youtubereporting_v1/service.rb +78 -78
  119. data/lib/google/apis/core/api_command.rb +11 -5
  120. data/lib/google/apis/core/base_service.rb +7 -5
  121. data/lib/google/apis/errors.rb +4 -0
  122. data/lib/google/apis/version.rb +1 -1
  123. metadata +28 -28
@@ -25,7 +25,7 @@ module Google
25
25
  # @see https://developers.google.com/storage/docs/json_api/
26
26
  module StorageV1
27
27
  VERSION = 'V1'
28
- REVISION = '20170104'
28
+ REVISION = '20170123'
29
29
 
30
30
  # View and manage your data across Google Cloud Platform services
31
31
  AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
@@ -46,7 +46,7 @@ module Google
46
46
  # @return [String]
47
47
  attr_accessor :etag
48
48
 
49
- # The ID of the bucket.
49
+ # The ID of the bucket. For buckets, the id and name properities are the same.
50
50
  # Corresponds to the JSON property `id`
51
51
  # @return [String]
52
52
  attr_accessor :id
@@ -835,7 +835,8 @@ module Google
835
835
  # @return [String]
836
836
  attr_accessor :generation
837
837
 
838
- # The ID of the object.
838
+ # The ID of the object, including the bucket name, object name, and generation
839
+ # number.
839
840
  # Corresponds to the JSON property `id`
840
841
  # @return [String]
841
842
  attr_accessor :id
@@ -869,7 +870,7 @@ module Google
869
870
  # @return [String]
870
871
  attr_accessor :metageneration
871
872
 
872
- # The name of this object. Required if not specified by URL parameter.
873
+ # The name of the object. Required if not specified by URL parameter.
873
874
  # Corresponds to the JSON property `name`
874
875
  # @return [String]
875
876
  attr_accessor :name
@@ -22,65 +22,138 @@ module Google
22
22
  module Apis
23
23
  module VisionV1
24
24
 
25
- # The `Status` type defines a logical error model that is suitable for different
26
- # programming environments, including REST APIs and RPC APIs. It is used by
27
- # [gRPC](https://github.com/grpc). The error model is designed to be:
28
- # - Simple to use and understand for most users
29
- # - Flexible enough to meet unexpected needs
30
- # # Overview
31
- # The `Status` message contains three pieces of data: error code, error message,
32
- # and error details. The error code should be an enum value of
33
- # google.rpc.Code, but it may accept additional error codes if needed. The
34
- # error message should be a developer-facing English message that helps
35
- # developers *understand* and *resolve* the error. If a localized user-facing
36
- # error message is needed, put the localized message in the error details or
37
- # localize it in the client. The optional error details may contain arbitrary
38
- # information about the error. There is a predefined set of error detail types
39
- # in the package `google.rpc` which can be used for common error conditions.
40
- # # Language mapping
41
- # The `Status` message is the logical representation of the error model, but it
42
- # is not necessarily the actual wire format. When the `Status` message is
43
- # exposed in different client libraries and different wire protocols, it can be
44
- # mapped differently. For example, it will likely be mapped to some exceptions
45
- # in Java, but more likely mapped to some error codes in C.
46
- # # Other uses
47
- # The error model and the `Status` message can be used in a variety of
48
- # environments, either with or without APIs, to provide a
49
- # consistent developer experience across different environments.
50
- # Example uses of this error model include:
51
- # - Partial errors. If a service needs to return partial errors to the client,
52
- # it may embed the `Status` in the normal response to indicate the partial
53
- # errors.
54
- # - Workflow errors. A typical workflow has multiple steps. Each step may
55
- # have a `Status` message for error reporting purpose.
56
- # - Batch operations. If a client uses batch request and batch response, the
57
- # `Status` message should be used directly inside batch response, one for
58
- # each error sub-response.
59
- # - Asynchronous operations. If an API call embeds asynchronous operation
60
- # results in its response, the status of those operations should be
61
- # represented directly using the `Status` message.
62
- # - Logging. If some API errors are stored in logs, the message `Status` could
63
- # be used directly after any stripping needed for security/privacy reasons.
64
- class Status
25
+ # A bounding polygon for the detected image annotation.
26
+ class BoundingPoly
65
27
  include Google::Apis::Core::Hashable
66
28
 
67
- # A list of messages that carry the error details. There will be a
68
- # common set of message types for APIs to use.
69
- # Corresponds to the JSON property `details`
70
- # @return [Array<Hash<String,Object>>]
71
- attr_accessor :details
29
+ # The bounding polygon vertices.
30
+ # Corresponds to the JSON property `vertices`
31
+ # @return [Array<Google::Apis::VisionV1::Vertex>]
32
+ attr_accessor :vertices
72
33
 
73
- # The status code, which should be an enum value of google.rpc.Code.
74
- # Corresponds to the JSON property `code`
75
- # @return [Fixnum]
76
- attr_accessor :code
34
+ def initialize(**args)
35
+ update!(**args)
36
+ end
77
37
 
78
- # A developer-facing error message, which should be in English. Any
79
- # user-facing error message should be localized and sent in the
80
- # google.rpc.Status.details field, or localized by the client.
81
- # Corresponds to the JSON property `message`
38
+ # Update properties of this object
39
+ def update!(**args)
40
+ @vertices = args[:vertices] if args.key?(:vertices)
41
+ end
42
+ end
43
+
44
+ # Response to an image annotation request.
45
+ class AnnotateImageResponse
46
+ include Google::Apis::Core::Hashable
47
+
48
+ # If present, landmark detection has completed successfully.
49
+ # Corresponds to the JSON property `landmarkAnnotations`
50
+ # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
51
+ attr_accessor :landmark_annotations
52
+
53
+ # If present, text (OCR) detection or document (OCR) text detection has
54
+ # completed successfully.
55
+ # Corresponds to the JSON property `textAnnotations`
56
+ # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
57
+ attr_accessor :text_annotations
58
+
59
+ # If present, face detection has completed successfully.
60
+ # Corresponds to the JSON property `faceAnnotations`
61
+ # @return [Array<Google::Apis::VisionV1::FaceAnnotation>]
62
+ attr_accessor :face_annotations
63
+
64
+ # Stores image properties, such as dominant colors.
65
+ # Corresponds to the JSON property `imagePropertiesAnnotation`
66
+ # @return [Google::Apis::VisionV1::ImageProperties]
67
+ attr_accessor :image_properties_annotation
68
+
69
+ # If present, logo detection has completed successfully.
70
+ # Corresponds to the JSON property `logoAnnotations`
71
+ # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
72
+ attr_accessor :logo_annotations
73
+
74
+ # If present, safe-search annotation has completed successfully.
75
+ # Corresponds to the JSON property `safeSearchAnnotation`
76
+ # @return [Google::Apis::VisionV1::SafeSearchAnnotation]
77
+ attr_accessor :safe_search_annotation
78
+
79
+ # If present, label detection has completed successfully.
80
+ # Corresponds to the JSON property `labelAnnotations`
81
+ # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
82
+ attr_accessor :label_annotations
83
+
84
+ # The `Status` type defines a logical error model that is suitable for different
85
+ # programming environments, including REST APIs and RPC APIs. It is used by
86
+ # [gRPC](https://github.com/grpc). The error model is designed to be:
87
+ # - Simple to use and understand for most users
88
+ # - Flexible enough to meet unexpected needs
89
+ # # Overview
90
+ # The `Status` message contains three pieces of data: error code, error message,
91
+ # and error details. The error code should be an enum value of
92
+ # google.rpc.Code, but it may accept additional error codes if needed. The
93
+ # error message should be a developer-facing English message that helps
94
+ # developers *understand* and *resolve* the error. If a localized user-facing
95
+ # error message is needed, put the localized message in the error details or
96
+ # localize it in the client. The optional error details may contain arbitrary
97
+ # information about the error. There is a predefined set of error detail types
98
+ # in the package `google.rpc` which can be used for common error conditions.
99
+ # # Language mapping
100
+ # The `Status` message is the logical representation of the error model, but it
101
+ # is not necessarily the actual wire format. When the `Status` message is
102
+ # exposed in different client libraries and different wire protocols, it can be
103
+ # mapped differently. For example, it will likely be mapped to some exceptions
104
+ # in Java, but more likely mapped to some error codes in C.
105
+ # # Other uses
106
+ # The error model and the `Status` message can be used in a variety of
107
+ # environments, either with or without APIs, to provide a
108
+ # consistent developer experience across different environments.
109
+ # Example uses of this error model include:
110
+ # - Partial errors. If a service needs to return partial errors to the client,
111
+ # it may embed the `Status` in the normal response to indicate the partial
112
+ # errors.
113
+ # - Workflow errors. A typical workflow has multiple steps. Each step may
114
+ # have a `Status` message for error reporting purpose.
115
+ # - Batch operations. If a client uses batch request and batch response, the
116
+ # `Status` message should be used directly inside batch response, one for
117
+ # each error sub-response.
118
+ # - Asynchronous operations. If an API call embeds asynchronous operation
119
+ # results in its response, the status of those operations should be
120
+ # represented directly using the `Status` message.
121
+ # - Logging. If some API errors are stored in logs, the message `Status` could
122
+ # be used directly after any stripping needed for security/privacy reasons.
123
+ # Corresponds to the JSON property `error`
124
+ # @return [Google::Apis::VisionV1::Status]
125
+ attr_accessor :error
126
+
127
+ def initialize(**args)
128
+ update!(**args)
129
+ end
130
+
131
+ # Update properties of this object
132
+ def update!(**args)
133
+ @landmark_annotations = args[:landmark_annotations] if args.key?(:landmark_annotations)
134
+ @text_annotations = args[:text_annotations] if args.key?(:text_annotations)
135
+ @face_annotations = args[:face_annotations] if args.key?(:face_annotations)
136
+ @image_properties_annotation = args[:image_properties_annotation] if args.key?(:image_properties_annotation)
137
+ @logo_annotations = args[:logo_annotations] if args.key?(:logo_annotations)
138
+ @safe_search_annotation = args[:safe_search_annotation] if args.key?(:safe_search_annotation)
139
+ @label_annotations = args[:label_annotations] if args.key?(:label_annotations)
140
+ @error = args[:error] if args.key?(:error)
141
+ end
142
+ end
143
+
144
+ # External image source (Google Cloud Storage image location).
145
+ class ImageSource
146
+ include Google::Apis::Core::Hashable
147
+
148
+ # NOTE: For new code `image_uri` below is preferred.
149
+ # Google Cloud Storage image URI, which must be in the following form:
150
+ # `gs://bucket_name/object_name` (for details, see
151
+ # [Google Cloud Storage Request
152
+ # URIs](https://cloud.google.com/storage/docs/reference-uris)).
153
+ # NOTE: Cloud Storage object versioning is not supported.
154
+ # Corresponds to the JSON property `gcsImageUri`
82
155
  # @return [String]
83
- attr_accessor :message
156
+ attr_accessor :gcs_image_uri
84
157
 
85
158
  def initialize(**args)
86
159
  update!(**args)
@@ -88,56 +161,32 @@ module Google
88
161
 
89
162
  # Update properties of this object
90
163
  def update!(**args)
91
- @details = args[:details] if args.key?(:details)
92
- @code = args[:code] if args.key?(:code)
93
- @message = args[:message] if args.key?(:message)
164
+ @gcs_image_uri = args[:gcs_image_uri] if args.key?(:gcs_image_uri)
94
165
  end
95
166
  end
96
167
 
97
- # Rectangle determined by min and max `LatLng` pairs.
98
- class LatLongRect
168
+ # Response to a batch image annotation request.
169
+ class BatchAnnotateImagesResponse
99
170
  include Google::Apis::Core::Hashable
100
171
 
101
- # An object representing a latitude/longitude pair. This is expressed as a pair
102
- # of doubles representing degrees latitude and degrees longitude. Unless
103
- # specified otherwise, this must conform to the
104
- # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
105
- # standard</a>. Values must be within normalized ranges.
106
- # Example of normalization code in Python:
107
- # def NormalizeLongitude(longitude):
108
- # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
109
- # q, r = divmod(longitude, 360.0)
110
- # if r > 180.0 or (r == 180.0 and q <= -1.0):
111
- # return r - 360.0
112
- # return r
113
- # def NormalizeLatLng(latitude, longitude):
114
- # """Wraps decimal degrees latitude and longitude to
115
- # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
116
- # r = latitude % 360.0
117
- # if r <= 90.0:
118
- # return r, NormalizeLongitude(longitude)
119
- # elif r >= 270.0:
120
- # return r - 360, NormalizeLongitude(longitude)
121
- # else:
122
- # return 180 - r, NormalizeLongitude(longitude + 180.0)
123
- # assert 180.0 == NormalizeLongitude(180.0)
124
- # assert -180.0 == NormalizeLongitude(-180.0)
125
- # assert -179.0 == NormalizeLongitude(181.0)
126
- # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
127
- # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
128
- # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
129
- # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
130
- # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
131
- # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
132
- # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
133
- # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
134
- # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
135
- # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
136
- # The code in logs/storage/validator/logs_validator_traits.cc treats this type
137
- # as if it were annotated as ST_LOCATION.
138
- # Corresponds to the JSON property `maxLatLng`
139
- # @return [Google::Apis::VisionV1::LatLng]
140
- attr_accessor :max_lat_lng
172
+ # Individual responses to image annotation requests within the batch.
173
+ # Corresponds to the JSON property `responses`
174
+ # @return [Array<Google::Apis::VisionV1::AnnotateImageResponse>]
175
+ attr_accessor :responses
176
+
177
+ def initialize(**args)
178
+ update!(**args)
179
+ end
180
+
181
+ # Update properties of this object
182
+ def update!(**args)
183
+ @responses = args[:responses] if args.key?(:responses)
184
+ end
185
+ end
186
+
187
+ # Detected entity location information.
188
+ class LocationInfo
189
+ include Google::Apis::Core::Hashable
141
190
 
142
191
  # An object representing a latitude/longitude pair. This is expressed as a pair
143
192
  # of doubles representing degrees latitude and degrees longitude. Unless
@@ -176,9 +225,9 @@ module Google
176
225
  # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
177
226
  # The code in logs/storage/validator/logs_validator_traits.cc treats this type
178
227
  # as if it were annotated as ST_LOCATION.
179
- # Corresponds to the JSON property `minLatLng`
228
+ # Corresponds to the JSON property `latLng`
180
229
  # @return [Google::Apis::VisionV1::LatLng]
181
- attr_accessor :min_lat_lng
230
+ attr_accessor :lat_lng
182
231
 
183
232
  def initialize(**args)
184
233
  update!(**args)
@@ -186,60 +235,23 @@ module Google
186
235
 
187
236
  # Update properties of this object
188
237
  def update!(**args)
189
- @max_lat_lng = args[:max_lat_lng] if args.key?(:max_lat_lng)
190
- @min_lat_lng = args[:min_lat_lng] if args.key?(:min_lat_lng)
238
+ @lat_lng = args[:lat_lng] if args.key?(:lat_lng)
191
239
  end
192
240
  end
193
241
 
194
- # An object representing a latitude/longitude pair. This is expressed as a pair
195
- # of doubles representing degrees latitude and degrees longitude. Unless
196
- # specified otherwise, this must conform to the
197
- # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
198
- # standard</a>. Values must be within normalized ranges.
199
- # Example of normalization code in Python:
200
- # def NormalizeLongitude(longitude):
201
- # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
202
- # q, r = divmod(longitude, 360.0)
203
- # if r > 180.0 or (r == 180.0 and q <= -1.0):
204
- # return r - 360.0
205
- # return r
206
- # def NormalizeLatLng(latitude, longitude):
207
- # """Wraps decimal degrees latitude and longitude to
208
- # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
209
- # r = latitude % 360.0
210
- # if r <= 90.0:
211
- # return r, NormalizeLongitude(longitude)
212
- # elif r >= 270.0:
213
- # return r - 360, NormalizeLongitude(longitude)
214
- # else:
215
- # return 180 - r, NormalizeLongitude(longitude + 180.0)
216
- # assert 180.0 == NormalizeLongitude(180.0)
217
- # assert -180.0 == NormalizeLongitude(-180.0)
218
- # assert -179.0 == NormalizeLongitude(181.0)
219
- # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
220
- # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
221
- # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
222
- # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
223
- # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
224
- # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
225
- # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
226
- # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
227
- # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
228
- # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
229
- # The code in logs/storage/validator/logs_validator_traits.cc treats this type
230
- # as if it were annotated as ST_LOCATION.
231
- class LatLng
242
+ # A `Property` consists of a user-supplied name/value pair.
243
+ class Property
232
244
  include Google::Apis::Core::Hashable
233
245
 
234
- # The latitude in degrees. It must be in the range [-90.0, +90.0].
235
- # Corresponds to the JSON property `latitude`
236
- # @return [Float]
237
- attr_accessor :latitude
246
+ # Value of the property.
247
+ # Corresponds to the JSON property `value`
248
+ # @return [String]
249
+ attr_accessor :value
238
250
 
239
- # The longitude in degrees. It must be in the range [-180.0, +180.0].
240
- # Corresponds to the JSON property `longitude`
241
- # @return [Float]
242
- attr_accessor :longitude
251
+ # Name of the property.
252
+ # Corresponds to the JSON property `name`
253
+ # @return [String]
254
+ attr_accessor :name
243
255
 
244
256
  def initialize(**args)
245
257
  update!(**args)
@@ -247,189 +259,31 @@ module Google
247
259
 
248
260
  # Update properties of this object
249
261
  def update!(**args)
250
- @latitude = args[:latitude] if args.key?(:latitude)
251
- @longitude = args[:longitude] if args.key?(:longitude)
262
+ @value = args[:value] if args.key?(:value)
263
+ @name = args[:name] if args.key?(:name)
252
264
  end
253
265
  end
254
266
 
255
- # Represents a color in the RGBA color space. This representation is designed
256
- # for simplicity of conversion to/from color representations in various
257
- # languages over compactness; for example, the fields of this representation
258
- # can be trivially provided to the constructor of "java.awt.Color" in Java; it
259
- # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
260
- # method in iOS; and, with just a little work, it can be easily formatted into
261
- # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
262
- # Example (Java):
263
- # import com.google.type.Color;
264
- # // ...
265
- # public static java.awt.Color fromProto(Color protocolor) `
266
- # float alpha = protocolor.hasAlpha()
267
- # ? protocolor.getAlpha().getValue()
268
- # : 1.0;
269
- # return new java.awt.Color(
270
- # protocolor.getRed(),
271
- # protocolor.getGreen(),
272
- # protocolor.getBlue(),
273
- # alpha);
274
- # `
275
- # public static Color toProto(java.awt.Color color) `
276
- # float red = (float) color.getRed();
277
- # float green = (float) color.getGreen();
278
- # float blue = (float) color.getBlue();
279
- # float denominator = 255.0;
280
- # Color.Builder resultBuilder =
281
- # Color
282
- # .newBuilder()
283
- # .setRed(red / denominator)
284
- # .setGreen(green / denominator)
285
- # .setBlue(blue / denominator);
286
- # int alpha = color.getAlpha();
287
- # if (alpha != 255) `
288
- # result.setAlpha(
289
- # FloatValue
290
- # .newBuilder()
291
- # .setValue(((float) alpha) / denominator)
292
- # .build());
293
- # `
294
- # return resultBuilder.build();
295
- # `
296
- # // ...
297
- # Example (iOS / Obj-C):
298
- # // ...
299
- # static UIColor* fromProto(Color* protocolor) `
300
- # float red = [protocolor red];
301
- # float green = [protocolor green];
302
- # float blue = [protocolor blue];
303
- # FloatValue* alpha_wrapper = [protocolor alpha];
304
- # float alpha = 1.0;
305
- # if (alpha_wrapper != nil) `
306
- # alpha = [alpha_wrapper value];
307
- # `
308
- # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
309
- # `
310
- # static Color* toProto(UIColor* color) `
311
- # CGFloat red, green, blue, alpha;
312
- # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
313
- # return nil;
314
- # `
315
- # Color* result = [Color alloc] init];
316
- # [result setRed:red];
317
- # [result setGreen:green];
318
- # [result setBlue:blue];
319
- # if (alpha <= 0.9999) `
320
- # [result setAlpha:floatWrapperWithValue(alpha)];
321
- # `
322
- # [result autorelease];
323
- # return result;
324
- # `
325
- # // ...
326
- # Example (JavaScript):
327
- # // ...
328
- # var protoToCssColor = function(rgb_color) `
329
- # var redFrac = rgb_color.red || 0.0;
330
- # var greenFrac = rgb_color.green || 0.0;
331
- # var blueFrac = rgb_color.blue || 0.0;
332
- # var red = Math.floor(redFrac * 255);
333
- # var green = Math.floor(greenFrac * 255);
334
- # var blue = Math.floor(blueFrac * 255);
335
- # if (!('alpha' in rgb_color)) `
336
- # return rgbToCssColor_(red, green, blue);
337
- # `
338
- # var alphaFrac = rgb_color.alpha.value || 0.0;
339
- # var rgbParams = [red, green, blue].join(',');
340
- # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
341
- # `;
342
- # var rgbToCssColor_ = function(red, green, blue) `
343
- # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
344
- # var hexString = rgbNumber.toString(16);
345
- # var missingZeros = 6 - hexString.length;
346
- # var resultBuilder = ['#'];
347
- # for (var i = 0; i < missingZeros; i++) `
348
- # resultBuilder.push('0');
349
- # `
350
- # resultBuilder.push(hexString);
351
- # return resultBuilder.join('');
352
- # `;
353
- # // ...
354
- class Color
267
+ # A 3D position in the image, used primarily for Face detection landmarks.
268
+ # A valid Position must have both x and y coordinates.
269
+ # The position coordinates are in the same scale as the original image.
270
+ class Position
355
271
  include Google::Apis::Core::Hashable
356
272
 
357
- # The amount of red in the color as a value in the interval [0, 1].
358
- # Corresponds to the JSON property `red`
359
- # @return [Float]
360
- attr_accessor :red
361
-
362
- # The amount of green in the color as a value in the interval [0, 1].
363
- # Corresponds to the JSON property `green`
273
+ # Y coordinate.
274
+ # Corresponds to the JSON property `y`
364
275
  # @return [Float]
365
- attr_accessor :green
276
+ attr_accessor :y
366
277
 
367
- # The amount of blue in the color as a value in the interval [0, 1].
368
- # Corresponds to the JSON property `blue`
278
+ # X coordinate.
279
+ # Corresponds to the JSON property `x`
369
280
  # @return [Float]
370
- attr_accessor :blue
281
+ attr_accessor :x
371
282
 
372
- # The fraction of this color that should be applied to the pixel. That is,
373
- # the final pixel color is defined by the equation:
374
- # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
375
- # This means that a value of 1.0 corresponds to a solid color, whereas
376
- # a value of 0.0 corresponds to a completely transparent color. This
377
- # uses a wrapper message rather than a simple float scalar so that it is
378
- # possible to distinguish between a default value and the value being unset.
379
- # If omitted, this color object is to be rendered as a solid color
380
- # (as if the alpha value had been explicitly given with a value of 1.0).
381
- # Corresponds to the JSON property `alpha`
283
+ # Z coordinate (or depth).
284
+ # Corresponds to the JSON property `z`
382
285
  # @return [Float]
383
- attr_accessor :alpha
384
-
385
- def initialize(**args)
386
- update!(**args)
387
- end
388
-
389
- # Update properties of this object
390
- def update!(**args)
391
- @red = args[:red] if args.key?(:red)
392
- @green = args[:green] if args.key?(:green)
393
- @blue = args[:blue] if args.key?(:blue)
394
- @alpha = args[:alpha] if args.key?(:alpha)
395
- end
396
- end
397
-
398
- # Stores image properties, such as dominant colors.
399
- class ImageProperties
400
- include Google::Apis::Core::Hashable
401
-
402
- # Set of dominant colors and their corresponding scores.
403
- # Corresponds to the JSON property `dominantColors`
404
- # @return [Google::Apis::VisionV1::DominantColorsAnnotation]
405
- attr_accessor :dominant_colors
406
-
407
- def initialize(**args)
408
- update!(**args)
409
- end
410
-
411
- # Update properties of this object
412
- def update!(**args)
413
- @dominant_colors = args[:dominant_colors] if args.key?(:dominant_colors)
414
- end
415
- end
416
-
417
- # Users describe the type of Google Cloud Vision API tasks to perform over
418
- # images by using *Feature*s. Each Feature indicates a type of image
419
- # detection task to perform. Features encode the Cloud Vision API
420
- # vertical to operate on and the number of top-scoring results to return.
421
- class Feature
422
- include Google::Apis::Core::Hashable
423
-
424
- # The feature type.
425
- # Corresponds to the JSON property `type`
426
- # @return [String]
427
- attr_accessor :type
428
-
429
- # Maximum number of results of this type.
430
- # Corresponds to the JSON property `maxResults`
431
- # @return [Fixnum]
432
- attr_accessor :max_results
286
+ attr_accessor :z
433
287
 
434
288
  def initialize(**args)
435
289
  update!(**args)
@@ -437,36 +291,130 @@ module Google
437
291
 
438
292
  # Update properties of this object
439
293
  def update!(**args)
440
- @type = args[:type] if args.key?(:type)
441
- @max_results = args[:max_results] if args.key?(:max_results)
294
+ @y = args[:y] if args.key?(:y)
295
+ @x = args[:x] if args.key?(:x)
296
+ @z = args[:z] if args.key?(:z)
442
297
  end
443
298
  end
444
299
 
445
- #
446
- class SafeSearchAnnotation
300
+ # Color information consists of RGB channels, score, and the fraction of
301
+ # the image that the color occupies in the image.
302
+ class ColorInfo
447
303
  include Google::Apis::Core::Hashable
448
304
 
449
- # Spoof likelihood. The likelihood that an modification
450
- # was made to the image's canonical version to make it appear
451
- # funny or offensive.
452
- # Corresponds to the JSON property `spoof`
453
- # @return [String]
454
- attr_accessor :spoof
455
-
456
- # Likelihood that this is a medical image.
457
- # Corresponds to the JSON property `medical`
458
- # @return [String]
459
- attr_accessor :medical
305
+ # Represents a color in the RGBA color space. This representation is designed
306
+ # for simplicity of conversion to/from color representations in various
307
+ # languages over compactness; for example, the fields of this representation
308
+ # can be trivially provided to the constructor of "java.awt.Color" in Java; it
309
+ # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
310
+ # method in iOS; and, with just a little work, it can be easily formatted into
311
+ # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
312
+ # Example (Java):
313
+ # import com.google.type.Color;
314
+ # // ...
315
+ # public static java.awt.Color fromProto(Color protocolor) `
316
+ # float alpha = protocolor.hasAlpha()
317
+ # ? protocolor.getAlpha().getValue()
318
+ # : 1.0;
319
+ # return new java.awt.Color(
320
+ # protocolor.getRed(),
321
+ # protocolor.getGreen(),
322
+ # protocolor.getBlue(),
323
+ # alpha);
324
+ # `
325
+ # public static Color toProto(java.awt.Color color) `
326
+ # float red = (float) color.getRed();
327
+ # float green = (float) color.getGreen();
328
+ # float blue = (float) color.getBlue();
329
+ # float denominator = 255.0;
330
+ # Color.Builder resultBuilder =
331
+ # Color
332
+ # .newBuilder()
333
+ # .setRed(red / denominator)
334
+ # .setGreen(green / denominator)
335
+ # .setBlue(blue / denominator);
336
+ # int alpha = color.getAlpha();
337
+ # if (alpha != 255) `
338
+ # result.setAlpha(
339
+ # FloatValue
340
+ # .newBuilder()
341
+ # .setValue(((float) alpha) / denominator)
342
+ # .build());
343
+ # `
344
+ # return resultBuilder.build();
345
+ # `
346
+ # // ...
347
+ # Example (iOS / Obj-C):
348
+ # // ...
349
+ # static UIColor* fromProto(Color* protocolor) `
350
+ # float red = [protocolor red];
351
+ # float green = [protocolor green];
352
+ # float blue = [protocolor blue];
353
+ # FloatValue* alpha_wrapper = [protocolor alpha];
354
+ # float alpha = 1.0;
355
+ # if (alpha_wrapper != nil) `
356
+ # alpha = [alpha_wrapper value];
357
+ # `
358
+ # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
359
+ # `
360
+ # static Color* toProto(UIColor* color) `
361
+ # CGFloat red, green, blue, alpha;
362
+ # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
363
+ # return nil;
364
+ # `
365
+ # Color* result = [Color alloc] init];
366
+ # [result setRed:red];
367
+ # [result setGreen:green];
368
+ # [result setBlue:blue];
369
+ # if (alpha <= 0.9999) `
370
+ # [result setAlpha:floatWrapperWithValue(alpha)];
371
+ # `
372
+ # [result autorelease];
373
+ # return result;
374
+ # `
375
+ # // ...
376
+ # Example (JavaScript):
377
+ # // ...
378
+ # var protoToCssColor = function(rgb_color) `
379
+ # var redFrac = rgb_color.red || 0.0;
380
+ # var greenFrac = rgb_color.green || 0.0;
381
+ # var blueFrac = rgb_color.blue || 0.0;
382
+ # var red = Math.floor(redFrac * 255);
383
+ # var green = Math.floor(greenFrac * 255);
384
+ # var blue = Math.floor(blueFrac * 255);
385
+ # if (!('alpha' in rgb_color)) `
386
+ # return rgbToCssColor_(red, green, blue);
387
+ # `
388
+ # var alphaFrac = rgb_color.alpha.value || 0.0;
389
+ # var rgbParams = [red, green, blue].join(',');
390
+ # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
391
+ # `;
392
+ # var rgbToCssColor_ = function(red, green, blue) `
393
+ # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
394
+ # var hexString = rgbNumber.toString(16);
395
+ # var missingZeros = 6 - hexString.length;
396
+ # var resultBuilder = ['#'];
397
+ # for (var i = 0; i < missingZeros; i++) `
398
+ # resultBuilder.push('0');
399
+ # `
400
+ # resultBuilder.push(hexString);
401
+ # return resultBuilder.join('');
402
+ # `;
403
+ # // ...
404
+ # Corresponds to the JSON property `color`
405
+ # @return [Google::Apis::VisionV1::Color]
406
+ attr_accessor :color
460
407
 
461
- # Violence likelihood.
462
- # Corresponds to the JSON property `violence`
463
- # @return [String]
464
- attr_accessor :violence
408
+ # Image-specific score for this color. Value in range [0, 1].
409
+ # Corresponds to the JSON property `score`
410
+ # @return [Float]
411
+ attr_accessor :score
465
412
 
466
- # Represents the adult content likelihood for the image.
467
- # Corresponds to the JSON property `adult`
468
- # @return [String]
469
- attr_accessor :adult
413
+ # The fraction of pixels the color occupies in the image.
414
+ # Value in range [0, 1].
415
+ # Corresponds to the JSON property `pixelFraction`
416
+ # @return [Float]
417
+ attr_accessor :pixel_fraction
470
418
 
471
419
  def initialize(**args)
472
420
  update!(**args)
@@ -474,46 +422,75 @@ module Google
474
422
 
475
423
  # Update properties of this object
476
424
  def update!(**args)
477
- @spoof = args[:spoof] if args.key?(:spoof)
478
- @medical = args[:medical] if args.key?(:medical)
479
- @violence = args[:violence] if args.key?(:violence)
480
- @adult = args[:adult] if args.key?(:adult)
425
+ @color = args[:color] if args.key?(:color)
426
+ @score = args[:score] if args.key?(:score)
427
+ @pixel_fraction = args[:pixel_fraction] if args.key?(:pixel_fraction)
481
428
  end
482
429
  end
483
430
 
484
- # Set of dominant colors and their corresponding scores.
485
- class DominantColorsAnnotation
431
+ # Set of detected entity features.
432
+ class EntityAnnotation
486
433
  include Google::Apis::Core::Hashable
487
434
 
488
- # RGB color values with their score and pixel fraction.
489
- # Corresponds to the JSON property `colors`
490
- # @return [Array<Google::Apis::VisionV1::ColorInfo>]
491
- attr_accessor :colors
435
+ # A bounding polygon for the detected image annotation.
436
+ # Corresponds to the JSON property `boundingPoly`
437
+ # @return [Google::Apis::VisionV1::BoundingPoly]
438
+ attr_accessor :bounding_poly
492
439
 
493
- def initialize(**args)
494
- update!(**args)
495
- end
440
+ # The language code for the locale in which the entity textual
441
+ # `description` is expressed.
442
+ # Corresponds to the JSON property `locale`
443
+ # @return [String]
444
+ attr_accessor :locale
496
445
 
497
- # Update properties of this object
498
- def update!(**args)
499
- @colors = args[:colors] if args.key?(:colors)
500
- end
501
- end
446
+ # Entity textual description, expressed in its `locale` language.
447
+ # Corresponds to the JSON property `description`
448
+ # @return [String]
449
+ attr_accessor :description
502
450
 
503
- # A vertex represents a 2D point in the image.
504
- # NOTE: the vertex coordinates are in the same scale as the original image.
505
- class Vertex
506
- include Google::Apis::Core::Hashable
451
+ # The relevancy of the ICA (Image Content Annotation) label to the
452
+ # image. For example, the relevancy of "tower" is likely higher to an image
453
+ # containing the detected "Eiffel Tower" than to an image containing a
454
+ # detected distant towering building, even though the confidence that
455
+ # there is a tower in each image may be the same. Range [0, 1].
456
+ # Corresponds to the JSON property `topicality`
457
+ # @return [Float]
458
+ attr_accessor :topicality
507
459
 
508
- # Y coordinate.
509
- # Corresponds to the JSON property `y`
510
- # @return [Fixnum]
511
- attr_accessor :y
460
+ # Some entities may have optional user-supplied `Property` (name/value)
461
+ # fields, such a score or string that qualifies the entity.
462
+ # Corresponds to the JSON property `properties`
463
+ # @return [Array<Google::Apis::VisionV1::Property>]
464
+ attr_accessor :properties
512
465
 
513
- # X coordinate.
514
- # Corresponds to the JSON property `x`
515
- # @return [Fixnum]
516
- attr_accessor :x
466
+ # Overall score of the result. Range [0, 1].
467
+ # Corresponds to the JSON property `score`
468
+ # @return [Float]
469
+ attr_accessor :score
470
+
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
479
+
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
486
+
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
517
494
 
518
495
  def initialize(**args)
519
496
  update!(**args)
@@ -521,19 +498,37 @@ module Google
521
498
 
522
499
  # Update properties of this object
523
500
  def update!(**args)
524
- @y = args[:y] if args.key?(:y)
525
- @x = args[:x] if args.key?(:x)
501
+ @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
502
+ @locale = args[:locale] if args.key?(:locale)
503
+ @description = args[:description] if args.key?(:description)
504
+ @topicality = args[:topicality] if args.key?(:topicality)
505
+ @properties = args[:properties] if args.key?(:properties)
506
+ @score = args[:score] if args.key?(:score)
507
+ @locations = args[:locations] if args.key?(:locations)
508
+ @mid = args[:mid] if args.key?(:mid)
509
+ @confidence = args[:confidence] if args.key?(:confidence)
526
510
  end
527
511
  end
528
512
 
529
- # A bounding polygon for the detected image annotation.
530
- class BoundingPoly
513
+ # A face-specific landmark (for example, a face feature).
514
+ # Landmark positions may fall outside the bounds of the image
515
+ # if the face is near one or more edges of the image.
516
+ # Therefore it is NOT guaranteed that `0 <= x < width` or
517
+ # `0 <= y < height`.
518
+ class Landmark
531
519
  include Google::Apis::Core::Hashable
532
520
 
533
- # The bounding polygon vertices.
534
- # Corresponds to the JSON property `vertices`
535
- # @return [Array<Google::Apis::VisionV1::Vertex>]
536
- attr_accessor :vertices
521
+ # A 3D position in the image, used primarily for Face detection landmarks.
522
+ # A valid Position must have both x and y coordinates.
523
+ # The position coordinates are in the same scale as the original image.
524
+ # Corresponds to the JSON property `position`
525
+ # @return [Google::Apis::VisionV1::Position]
526
+ attr_accessor :position
527
+
528
+ # Face landmark type.
529
+ # Corresponds to the JSON property `type`
530
+ # @return [String]
531
+ attr_accessor :type
537
532
 
538
533
  def initialize(**args)
539
534
  update!(**args)
@@ -541,92 +536,26 @@ module Google
541
536
 
542
537
  # Update properties of this object
543
538
  def update!(**args)
544
- @vertices = args[:vertices] if args.key?(:vertices)
539
+ @position = args[:position] if args.key?(:position)
540
+ @type = args[:type] if args.key?(:type)
545
541
  end
546
542
  end
547
543
 
548
- # Response to an image annotation request.
549
- class AnnotateImageResponse
544
+ # Client image to perform Google Cloud Vision API tasks over.
545
+ class Image
550
546
  include Google::Apis::Core::Hashable
551
547
 
552
- # If present, logo detection has completed successfully.
553
- # Corresponds to the JSON property `logoAnnotations`
554
- # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
555
- attr_accessor :logo_annotations
556
-
557
- # If present, label detection has completed successfully.
558
- # Corresponds to the JSON property `labelAnnotations`
559
- # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
560
- attr_accessor :label_annotations
561
-
562
- # If present, safe-search annotation has completed successfully.
563
- # Corresponds to the JSON property `safeSearchAnnotation`
564
- # @return [Google::Apis::VisionV1::SafeSearchAnnotation]
565
- attr_accessor :safe_search_annotation
566
-
567
- # The `Status` type defines a logical error model that is suitable for different
568
- # programming environments, including REST APIs and RPC APIs. It is used by
569
- # [gRPC](https://github.com/grpc). The error model is designed to be:
570
- # - Simple to use and understand for most users
571
- # - Flexible enough to meet unexpected needs
572
- # # Overview
573
- # The `Status` message contains three pieces of data: error code, error message,
574
- # and error details. The error code should be an enum value of
575
- # google.rpc.Code, but it may accept additional error codes if needed. The
576
- # error message should be a developer-facing English message that helps
577
- # developers *understand* and *resolve* the error. If a localized user-facing
578
- # error message is needed, put the localized message in the error details or
579
- # localize it in the client. The optional error details may contain arbitrary
580
- # information about the error. There is a predefined set of error detail types
581
- # in the package `google.rpc` which can be used for common error conditions.
582
- # # Language mapping
583
- # The `Status` message is the logical representation of the error model, but it
584
- # is not necessarily the actual wire format. When the `Status` message is
585
- # exposed in different client libraries and different wire protocols, it can be
586
- # mapped differently. For example, it will likely be mapped to some exceptions
587
- # in Java, but more likely mapped to some error codes in C.
588
- # # Other uses
589
- # The error model and the `Status` message can be used in a variety of
590
- # environments, either with or without APIs, to provide a
591
- # consistent developer experience across different environments.
592
- # Example uses of this error model include:
593
- # - Partial errors. If a service needs to return partial errors to the client,
594
- # it may embed the `Status` in the normal response to indicate the partial
595
- # errors.
596
- # - Workflow errors. A typical workflow has multiple steps. Each step may
597
- # have a `Status` message for error reporting purpose.
598
- # - Batch operations. If a client uses batch request and batch response, the
599
- # `Status` message should be used directly inside batch response, one for
600
- # each error sub-response.
601
- # - Asynchronous operations. If an API call embeds asynchronous operation
602
- # results in its response, the status of those operations should be
603
- # represented directly using the `Status` message.
604
- # - Logging. If some API errors are stored in logs, the message `Status` could
605
- # be used directly after any stripping needed for security/privacy reasons.
606
- # Corresponds to the JSON property `error`
607
- # @return [Google::Apis::VisionV1::Status]
608
- attr_accessor :error
609
-
610
- # If present, landmark detection has completed successfully.
611
- # Corresponds to the JSON property `landmarkAnnotations`
612
- # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
613
- attr_accessor :landmark_annotations
614
-
615
- # If present, text (OCR) detection or document (OCR) text detection has
616
- # completed successfully.
617
- # Corresponds to the JSON property `textAnnotations`
618
- # @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
619
- attr_accessor :text_annotations
620
-
621
- # Stores image properties, such as dominant colors.
622
- # Corresponds to the JSON property `imagePropertiesAnnotation`
623
- # @return [Google::Apis::VisionV1::ImageProperties]
624
- attr_accessor :image_properties_annotation
548
+ # Image content, represented as a stream of bytes.
549
+ # Note: as with all `bytes` fields, protobuffers use a pure binary
550
+ # representation, whereas JSON representations use base64.
551
+ # Corresponds to the JSON property `content`
552
+ # @return [String]
553
+ attr_accessor :content
625
554
 
626
- # If present, face detection has completed successfully.
627
- # Corresponds to the JSON property `faceAnnotations`
628
- # @return [Array<Google::Apis::VisionV1::FaceAnnotation>]
629
- attr_accessor :face_annotations
555
+ # External image source (Google Cloud Storage image location).
556
+ # Corresponds to the JSON property `source`
557
+ # @return [Google::Apis::VisionV1::ImageSource]
558
+ attr_accessor :source
630
559
 
631
560
  def initialize(**args)
632
561
  update!(**args)
@@ -634,30 +563,94 @@ module Google
634
563
 
635
564
  # Update properties of this object
636
565
  def update!(**args)
637
- @logo_annotations = args[:logo_annotations] if args.key?(:logo_annotations)
638
- @label_annotations = args[:label_annotations] if args.key?(:label_annotations)
639
- @safe_search_annotation = args[:safe_search_annotation] if args.key?(:safe_search_annotation)
640
- @error = args[:error] if args.key?(:error)
641
- @landmark_annotations = args[:landmark_annotations] if args.key?(:landmark_annotations)
642
- @text_annotations = args[:text_annotations] if args.key?(:text_annotations)
643
- @image_properties_annotation = args[:image_properties_annotation] if args.key?(:image_properties_annotation)
644
- @face_annotations = args[:face_annotations] if args.key?(:face_annotations)
566
+ @content = args[:content] if args.key?(:content)
567
+ @source = args[:source] if args.key?(:source)
645
568
  end
646
569
  end
647
570
 
648
- # A `Property` consists of a user-supplied name/value pair.
649
- class Property
571
+ # A face annotation object contains the results of face detection.
572
+ class FaceAnnotation
650
573
  include Google::Apis::Core::Hashable
651
574
 
652
- # Value of the property.
653
- # Corresponds to the JSON property `value`
575
+ # A bounding polygon for the detected image annotation.
576
+ # Corresponds to the JSON property `boundingPoly`
577
+ # @return [Google::Apis::VisionV1::BoundingPoly]
578
+ attr_accessor :bounding_poly
579
+
580
+ # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
581
+ # of the face relative to the image vertical about the axis perpendicular to
582
+ # the face. Range [-180,180].
583
+ # Corresponds to the JSON property `rollAngle`
584
+ # @return [Float]
585
+ attr_accessor :roll_angle
586
+
587
+ # Sorrow likelihood.
588
+ # Corresponds to the JSON property `sorrowLikelihood`
654
589
  # @return [String]
655
- attr_accessor :value
590
+ attr_accessor :sorrow_likelihood
656
591
 
657
- # Name of the property.
658
- # Corresponds to the JSON property `name`
592
+ # Pitch angle, which indicates the upwards/downwards angle that the face is
593
+ # pointing relative to the image's horizontal plane. Range [-180,180].
594
+ # Corresponds to the JSON property `tiltAngle`
595
+ # @return [Float]
596
+ attr_accessor :tilt_angle
597
+
598
+ # A bounding polygon for the detected image annotation.
599
+ # Corresponds to the JSON property `fdBoundingPoly`
600
+ # @return [Google::Apis::VisionV1::BoundingPoly]
601
+ attr_accessor :fd_bounding_poly
602
+
603
+ # Anger likelihood.
604
+ # Corresponds to the JSON property `angerLikelihood`
659
605
  # @return [String]
660
- attr_accessor :name
606
+ attr_accessor :anger_likelihood
607
+
608
+ # Detected face landmarks.
609
+ # Corresponds to the JSON property `landmarks`
610
+ # @return [Array<Google::Apis::VisionV1::Landmark>]
611
+ attr_accessor :landmarks
612
+
613
+ # Surprise likelihood.
614
+ # Corresponds to the JSON property `surpriseLikelihood`
615
+ # @return [String]
616
+ attr_accessor :surprise_likelihood
617
+
618
+ # Face landmarking confidence. Range [0, 1].
619
+ # Corresponds to the JSON property `landmarkingConfidence`
620
+ # @return [Float]
621
+ attr_accessor :landmarking_confidence
622
+
623
+ # Joy likelihood.
624
+ # Corresponds to the JSON property `joyLikelihood`
625
+ # @return [String]
626
+ attr_accessor :joy_likelihood
627
+
628
+ # Under-exposed likelihood.
629
+ # Corresponds to the JSON property `underExposedLikelihood`
630
+ # @return [String]
631
+ attr_accessor :under_exposed_likelihood
632
+
633
+ # Yaw angle, which indicates the leftward/rightward angle that the face is
634
+ # pointing relative to the vertical plane perpendicular to the image. Range
635
+ # [-180,180].
636
+ # Corresponds to the JSON property `panAngle`
637
+ # @return [Float]
638
+ attr_accessor :pan_angle
639
+
640
+ # Detection confidence. Range [0, 1].
641
+ # Corresponds to the JSON property `detectionConfidence`
642
+ # @return [Float]
643
+ attr_accessor :detection_confidence
644
+
645
+ # Blurred likelihood.
646
+ # Corresponds to the JSON property `blurredLikelihood`
647
+ # @return [String]
648
+ attr_accessor :blurred_likelihood
649
+
650
+ # Headwear likelihood.
651
+ # Corresponds to the JSON property `headwearLikelihood`
652
+ # @return [String]
653
+ attr_accessor :headwear_likelihood
661
654
 
662
655
  def initialize(**args)
663
656
  update!(**args)
@@ -665,55 +658,32 @@ module Google
665
658
 
666
659
  # Update properties of this object
667
660
  def update!(**args)
668
- @value = args[:value] if args.key?(:value)
669
- @name = args[:name] if args.key?(:name)
661
+ @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
662
+ @roll_angle = args[:roll_angle] if args.key?(:roll_angle)
663
+ @sorrow_likelihood = args[:sorrow_likelihood] if args.key?(:sorrow_likelihood)
664
+ @tilt_angle = args[:tilt_angle] if args.key?(:tilt_angle)
665
+ @fd_bounding_poly = args[:fd_bounding_poly] if args.key?(:fd_bounding_poly)
666
+ @anger_likelihood = args[:anger_likelihood] if args.key?(:anger_likelihood)
667
+ @landmarks = args[:landmarks] if args.key?(:landmarks)
668
+ @surprise_likelihood = args[:surprise_likelihood] if args.key?(:surprise_likelihood)
669
+ @landmarking_confidence = args[:landmarking_confidence] if args.key?(:landmarking_confidence)
670
+ @joy_likelihood = args[:joy_likelihood] if args.key?(:joy_likelihood)
671
+ @under_exposed_likelihood = args[:under_exposed_likelihood] if args.key?(:under_exposed_likelihood)
672
+ @pan_angle = args[:pan_angle] if args.key?(:pan_angle)
673
+ @detection_confidence = args[:detection_confidence] if args.key?(:detection_confidence)
674
+ @blurred_likelihood = args[:blurred_likelihood] if args.key?(:blurred_likelihood)
675
+ @headwear_likelihood = args[:headwear_likelihood] if args.key?(:headwear_likelihood)
670
676
  end
671
677
  end
672
678
 
673
- # Detected entity location information.
674
- class LocationInfo
679
+ # Multiple image annotation requests are batched into a single service call.
680
+ class BatchAnnotateImagesRequest
675
681
  include Google::Apis::Core::Hashable
676
682
 
677
- # An object representing a latitude/longitude pair. This is expressed as a pair
678
- # of doubles representing degrees latitude and degrees longitude. Unless
679
- # specified otherwise, this must conform to the
680
- # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
681
- # standard</a>. Values must be within normalized ranges.
682
- # Example of normalization code in Python:
683
- # def NormalizeLongitude(longitude):
684
- # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
685
- # q, r = divmod(longitude, 360.0)
686
- # if r > 180.0 or (r == 180.0 and q <= -1.0):
687
- # return r - 360.0
688
- # return r
689
- # def NormalizeLatLng(latitude, longitude):
690
- # """Wraps decimal degrees latitude and longitude to
691
- # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
692
- # r = latitude % 360.0
693
- # if r <= 90.0:
694
- # return r, NormalizeLongitude(longitude)
695
- # elif r >= 270.0:
696
- # return r - 360, NormalizeLongitude(longitude)
697
- # else:
698
- # return 180 - r, NormalizeLongitude(longitude + 180.0)
699
- # assert 180.0 == NormalizeLongitude(180.0)
700
- # assert -180.0 == NormalizeLongitude(-180.0)
701
- # assert -179.0 == NormalizeLongitude(181.0)
702
- # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
703
- # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
704
- # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
705
- # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
706
- # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
707
- # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
708
- # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
709
- # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
710
- # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
711
- # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
712
- # The code in logs/storage/validator/logs_validator_traits.cc treats this type
713
- # as if it were annotated as ST_LOCATION.
714
- # Corresponds to the JSON property `latLng`
715
- # @return [Google::Apis::VisionV1::LatLng]
716
- attr_accessor :lat_lng
683
+ # Individual image annotation requests for this batch.
684
+ # Corresponds to the JSON property `requests`
685
+ # @return [Array<Google::Apis::VisionV1::AnnotateImageRequest>]
686
+ attr_accessor :requests
717
687
 
718
688
  def initialize(**args)
719
689
  update!(**args)
@@ -721,42 +691,30 @@ module Google
721
691
 
722
692
  # Update properties of this object
723
693
  def update!(**args)
724
- @lat_lng = args[:lat_lng] if args.key?(:lat_lng)
694
+ @requests = args[:requests] if args.key?(:requests)
725
695
  end
726
696
  end
727
697
 
728
- # Response to a batch image annotation request.
729
- class BatchAnnotateImagesResponse
698
+ # Image context and/or feature-specific parameters.
699
+ class ImageContext
730
700
  include Google::Apis::Core::Hashable
731
701
 
732
- # Individual responses to image annotation requests within the batch.
733
- # Corresponds to the JSON property `responses`
734
- # @return [Array<Google::Apis::VisionV1::AnnotateImageResponse>]
735
- attr_accessor :responses
736
-
737
- def initialize(**args)
738
- update!(**args)
739
- end
740
-
741
- # Update properties of this object
742
- def update!(**args)
743
- @responses = args[:responses] if args.key?(:responses)
744
- end
745
- end
746
-
747
- # External image source (Google Cloud Storage image location).
748
- class ImageSource
749
- include Google::Apis::Core::Hashable
702
+ # List of languages to use for TEXT_DETECTION. In most cases, an empty value
703
+ # yields the best results since it enables automatic language detection. For
704
+ # languages based on the Latin alphabet, setting `language_hints` is not
705
+ # needed. In rare cases, when the language of the text in the image is known,
706
+ # setting a hint will help get better results (although it will be a
707
+ # significant hindrance if the hint is wrong). Text detection returns an
708
+ # error if one or more of the specified languages is not one of the
709
+ # [supported languages](/vision/docs/languages).
710
+ # Corresponds to the JSON property `languageHints`
711
+ # @return [Array<String>]
712
+ attr_accessor :language_hints
750
713
 
751
- # NOTE: For new code `image_uri` below is preferred.
752
- # Google Cloud Storage image URI, which must be in the following form:
753
- # `gs://bucket_name/object_name` (for details, see
754
- # [Google Cloud Storage Request
755
- # URIs](https://cloud.google.com/storage/docs/reference-uris)).
756
- # NOTE: Cloud Storage object versioning is not supported.
757
- # Corresponds to the JSON property `gcsImageUri`
758
- # @return [String]
759
- attr_accessor :gcs_image_uri
714
+ # Rectangle determined by min and max `LatLng` pairs.
715
+ # Corresponds to the JSON property `latLongRect`
716
+ # @return [Google::Apis::VisionV1::LatLongRect]
717
+ attr_accessor :lat_long_rect
760
718
 
761
719
  def initialize(**args)
762
720
  update!(**args)
@@ -764,30 +722,30 @@ module Google
764
722
 
765
723
  # Update properties of this object
766
724
  def update!(**args)
767
- @gcs_image_uri = args[:gcs_image_uri] if args.key?(:gcs_image_uri)
725
+ @language_hints = args[:language_hints] if args.key?(:language_hints)
726
+ @lat_long_rect = args[:lat_long_rect] if args.key?(:lat_long_rect)
768
727
  end
769
728
  end
770
729
 
771
- # A 3D position in the image, used primarily for Face detection landmarks.
772
- # A valid Position must have both x and y coordinates.
773
- # The position coordinates are in the same scale as the original image.
774
- class Position
730
+ # Request for performing Google Cloud Vision API tasks over a user-provided
731
+ # image, with user-requested features.
732
+ class AnnotateImageRequest
775
733
  include Google::Apis::Core::Hashable
776
734
 
777
- # Y coordinate.
778
- # Corresponds to the JSON property `y`
779
- # @return [Float]
780
- attr_accessor :y
735
+ # Client image to perform Google Cloud Vision API tasks over.
736
+ # Corresponds to the JSON property `image`
737
+ # @return [Google::Apis::VisionV1::Image]
738
+ attr_accessor :image
781
739
 
782
- # X coordinate.
783
- # Corresponds to the JSON property `x`
784
- # @return [Float]
785
- attr_accessor :x
740
+ # Requested features.
741
+ # Corresponds to the JSON property `features`
742
+ # @return [Array<Google::Apis::VisionV1::Feature>]
743
+ attr_accessor :features
786
744
 
787
- # Z coordinate (or depth).
788
- # Corresponds to the JSON property `z`
789
- # @return [Float]
790
- attr_accessor :z
745
+ # Image context and/or feature-specific parameters.
746
+ # Corresponds to the JSON property `imageContext`
747
+ # @return [Google::Apis::VisionV1::ImageContext]
748
+ attr_accessor :image_context
791
749
 
792
750
  def initialize(**args)
793
751
  update!(**args)
@@ -795,130 +753,71 @@ module Google
795
753
 
796
754
  # Update properties of this object
797
755
  def update!(**args)
798
- @y = args[:y] if args.key?(:y)
799
- @x = args[:x] if args.key?(:x)
800
- @z = args[:z] if args.key?(:z)
756
+ @image = args[:image] if args.key?(:image)
757
+ @features = args[:features] if args.key?(:features)
758
+ @image_context = args[:image_context] if args.key?(:image_context)
801
759
  end
802
760
  end
803
761
 
804
- # Color information consists of RGB channels, score, and the fraction of
805
- # the image that the color occupies in the image.
806
- class ColorInfo
762
+ # The `Status` type defines a logical error model that is suitable for different
763
+ # programming environments, including REST APIs and RPC APIs. It is used by
764
+ # [gRPC](https://github.com/grpc). The error model is designed to be:
765
+ # - Simple to use and understand for most users
766
+ # - Flexible enough to meet unexpected needs
767
+ # # Overview
768
+ # The `Status` message contains three pieces of data: error code, error message,
769
+ # and error details. The error code should be an enum value of
770
+ # google.rpc.Code, but it may accept additional error codes if needed. The
771
+ # error message should be a developer-facing English message that helps
772
+ # developers *understand* and *resolve* the error. If a localized user-facing
773
+ # error message is needed, put the localized message in the error details or
774
+ # localize it in the client. The optional error details may contain arbitrary
775
+ # information about the error. There is a predefined set of error detail types
776
+ # in the package `google.rpc` which can be used for common error conditions.
777
+ # # Language mapping
778
+ # The `Status` message is the logical representation of the error model, but it
779
+ # is not necessarily the actual wire format. When the `Status` message is
780
+ # exposed in different client libraries and different wire protocols, it can be
781
+ # mapped differently. For example, it will likely be mapped to some exceptions
782
+ # in Java, but more likely mapped to some error codes in C.
783
+ # # Other uses
784
+ # The error model and the `Status` message can be used in a variety of
785
+ # environments, either with or without APIs, to provide a
786
+ # consistent developer experience across different environments.
787
+ # Example uses of this error model include:
788
+ # - Partial errors. If a service needs to return partial errors to the client,
789
+ # it may embed the `Status` in the normal response to indicate the partial
790
+ # errors.
791
+ # - Workflow errors. A typical workflow has multiple steps. Each step may
792
+ # have a `Status` message for error reporting purpose.
793
+ # - Batch operations. If a client uses batch request and batch response, the
794
+ # `Status` message should be used directly inside batch response, one for
795
+ # each error sub-response.
796
+ # - Asynchronous operations. If an API call embeds asynchronous operation
797
+ # results in its response, the status of those operations should be
798
+ # represented directly using the `Status` message.
799
+ # - Logging. If some API errors are stored in logs, the message `Status` could
800
+ # be used directly after any stripping needed for security/privacy reasons.
801
+ class Status
807
802
  include Google::Apis::Core::Hashable
808
803
 
809
- # The fraction of pixels the color occupies in the image.
810
- # Value in range [0, 1].
811
- # Corresponds to the JSON property `pixelFraction`
812
- # @return [Float]
813
- attr_accessor :pixel_fraction
804
+ # A developer-facing error message, which should be in English. Any
805
+ # user-facing error message should be localized and sent in the
806
+ # google.rpc.Status.details field, or localized by the client.
807
+ # Corresponds to the JSON property `message`
808
+ # @return [String]
809
+ attr_accessor :message
814
810
 
815
- # Represents a color in the RGBA color space. This representation is designed
816
- # for simplicity of conversion to/from color representations in various
817
- # languages over compactness; for example, the fields of this representation
818
- # can be trivially provided to the constructor of "java.awt.Color" in Java; it
819
- # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
820
- # method in iOS; and, with just a little work, it can be easily formatted into
821
- # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
822
- # Example (Java):
823
- # import com.google.type.Color;
824
- # // ...
825
- # public static java.awt.Color fromProto(Color protocolor) `
826
- # float alpha = protocolor.hasAlpha()
827
- # ? protocolor.getAlpha().getValue()
828
- # : 1.0;
829
- # return new java.awt.Color(
830
- # protocolor.getRed(),
831
- # protocolor.getGreen(),
832
- # protocolor.getBlue(),
833
- # alpha);
834
- # `
835
- # public static Color toProto(java.awt.Color color) `
836
- # float red = (float) color.getRed();
837
- # float green = (float) color.getGreen();
838
- # float blue = (float) color.getBlue();
839
- # float denominator = 255.0;
840
- # Color.Builder resultBuilder =
841
- # Color
842
- # .newBuilder()
843
- # .setRed(red / denominator)
844
- # .setGreen(green / denominator)
845
- # .setBlue(blue / denominator);
846
- # int alpha = color.getAlpha();
847
- # if (alpha != 255) `
848
- # result.setAlpha(
849
- # FloatValue
850
- # .newBuilder()
851
- # .setValue(((float) alpha) / denominator)
852
- # .build());
853
- # `
854
- # return resultBuilder.build();
855
- # `
856
- # // ...
857
- # Example (iOS / Obj-C):
858
- # // ...
859
- # static UIColor* fromProto(Color* protocolor) `
860
- # float red = [protocolor red];
861
- # float green = [protocolor green];
862
- # float blue = [protocolor blue];
863
- # FloatValue* alpha_wrapper = [protocolor alpha];
864
- # float alpha = 1.0;
865
- # if (alpha_wrapper != nil) `
866
- # alpha = [alpha_wrapper value];
867
- # `
868
- # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
869
- # `
870
- # static Color* toProto(UIColor* color) `
871
- # CGFloat red, green, blue, alpha;
872
- # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
873
- # return nil;
874
- # `
875
- # Color* result = [Color alloc] init];
876
- # [result setRed:red];
877
- # [result setGreen:green];
878
- # [result setBlue:blue];
879
- # if (alpha <= 0.9999) `
880
- # [result setAlpha:floatWrapperWithValue(alpha)];
881
- # `
882
- # [result autorelease];
883
- # return result;
884
- # `
885
- # // ...
886
- # Example (JavaScript):
887
- # // ...
888
- # var protoToCssColor = function(rgb_color) `
889
- # var redFrac = rgb_color.red || 0.0;
890
- # var greenFrac = rgb_color.green || 0.0;
891
- # var blueFrac = rgb_color.blue || 0.0;
892
- # var red = Math.floor(redFrac * 255);
893
- # var green = Math.floor(greenFrac * 255);
894
- # var blue = Math.floor(blueFrac * 255);
895
- # if (!('alpha' in rgb_color)) `
896
- # return rgbToCssColor_(red, green, blue);
897
- # `
898
- # var alphaFrac = rgb_color.alpha.value || 0.0;
899
- # var rgbParams = [red, green, blue].join(',');
900
- # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
901
- # `;
902
- # var rgbToCssColor_ = function(red, green, blue) `
903
- # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
904
- # var hexString = rgbNumber.toString(16);
905
- # var missingZeros = 6 - hexString.length;
906
- # var resultBuilder = ['#'];
907
- # for (var i = 0; i < missingZeros; i++) `
908
- # resultBuilder.push('0');
909
- # `
910
- # resultBuilder.push(hexString);
911
- # return resultBuilder.join('');
912
- # `;
913
- # // ...
914
- # Corresponds to the JSON property `color`
915
- # @return [Google::Apis::VisionV1::Color]
916
- attr_accessor :color
811
+ # A list of messages that carry the error details. There will be a
812
+ # common set of message types for APIs to use.
813
+ # Corresponds to the JSON property `details`
814
+ # @return [Array<Hash<String,Object>>]
815
+ attr_accessor :details
917
816
 
918
- # Image-specific score for this color. Value in range [0, 1].
919
- # Corresponds to the JSON property `score`
920
- # @return [Float]
921
- attr_accessor :score
817
+ # The status code, which should be an enum value of google.rpc.Code.
818
+ # Corresponds to the JSON property `code`
819
+ # @return [Fixnum]
820
+ attr_accessor :code
922
821
 
923
822
  def initialize(**args)
924
823
  update!(**args)
@@ -926,75 +825,299 @@ module Google
926
825
 
927
826
  # Update properties of this object
928
827
  def update!(**args)
929
- @pixel_fraction = args[:pixel_fraction] if args.key?(:pixel_fraction)
930
- @color = args[:color] if args.key?(:color)
931
- @score = args[:score] if args.key?(:score)
828
+ @message = args[:message] if args.key?(:message)
829
+ @details = args[:details] if args.key?(:details)
830
+ @code = args[:code] if args.key?(:code)
932
831
  end
933
832
  end
934
833
 
935
- # Set of detected entity features.
936
- class EntityAnnotation
834
+ # Rectangle determined by min and max `LatLng` pairs.
835
+ class LatLongRect
937
836
  include Google::Apis::Core::Hashable
938
837
 
939
- # The location information for the detected entity. Multiple
940
- # `LocationInfo` elements can be present because one location may
941
- # indicate the location of the scene in the image, and another location
942
- # may indicate the location of the place where the image was taken.
943
- # Location information is usually present for landmarks.
944
- # Corresponds to the JSON property `locations`
945
- # @return [Array<Google::Apis::VisionV1::LocationInfo>]
946
- attr_accessor :locations
838
+ # An object representing a latitude/longitude pair. This is expressed as a pair
839
+ # of doubles representing degrees latitude and degrees longitude. Unless
840
+ # specified otherwise, this must conform to the
841
+ # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
842
+ # standard</a>. Values must be within normalized ranges.
843
+ # Example of normalization code in Python:
844
+ # def NormalizeLongitude(longitude):
845
+ # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
846
+ # q, r = divmod(longitude, 360.0)
847
+ # if r > 180.0 or (r == 180.0 and q <= -1.0):
848
+ # return r - 360.0
849
+ # return r
850
+ # def NormalizeLatLng(latitude, longitude):
851
+ # """Wraps decimal degrees latitude and longitude to
852
+ # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
853
+ # r = latitude % 360.0
854
+ # if r <= 90.0:
855
+ # return r, NormalizeLongitude(longitude)
856
+ # elif r >= 270.0:
857
+ # return r - 360, NormalizeLongitude(longitude)
858
+ # else:
859
+ # return 180 - r, NormalizeLongitude(longitude + 180.0)
860
+ # assert 180.0 == NormalizeLongitude(180.0)
861
+ # assert -180.0 == NormalizeLongitude(-180.0)
862
+ # assert -179.0 == NormalizeLongitude(181.0)
863
+ # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
864
+ # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
865
+ # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
866
+ # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
867
+ # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
868
+ # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
869
+ # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
870
+ # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
871
+ # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
872
+ # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
873
+ # The code in logs/storage/validator/logs_validator_traits.cc treats this type
874
+ # as if it were annotated as ST_LOCATION.
875
+ # Corresponds to the JSON property `minLatLng`
876
+ # @return [Google::Apis::VisionV1::LatLng]
877
+ attr_accessor :min_lat_lng
947
878
 
948
- # Opaque entity ID. Some IDs may be available in
949
- # [Google Knowledge Graph Search API](https://developers.google.com/knowledge-
950
- # graph/).
951
- # Corresponds to the JSON property `mid`
952
- # @return [String]
953
- attr_accessor :mid
879
+ # An object representing a latitude/longitude pair. This is expressed as a pair
880
+ # of doubles representing degrees latitude and degrees longitude. Unless
881
+ # specified otherwise, this must conform to the
882
+ # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
883
+ # standard</a>. Values must be within normalized ranges.
884
+ # Example of normalization code in Python:
885
+ # def NormalizeLongitude(longitude):
886
+ # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
887
+ # q, r = divmod(longitude, 360.0)
888
+ # if r > 180.0 or (r == 180.0 and q <= -1.0):
889
+ # return r - 360.0
890
+ # return r
891
+ # def NormalizeLatLng(latitude, longitude):
892
+ # """Wraps decimal degrees latitude and longitude to
893
+ # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
894
+ # r = latitude % 360.0
895
+ # if r <= 90.0:
896
+ # return r, NormalizeLongitude(longitude)
897
+ # elif r >= 270.0:
898
+ # return r - 360, NormalizeLongitude(longitude)
899
+ # else:
900
+ # return 180 - r, NormalizeLongitude(longitude + 180.0)
901
+ # assert 180.0 == NormalizeLongitude(180.0)
902
+ # assert -180.0 == NormalizeLongitude(-180.0)
903
+ # assert -179.0 == NormalizeLongitude(181.0)
904
+ # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
905
+ # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
906
+ # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
907
+ # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
908
+ # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
909
+ # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
910
+ # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
911
+ # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
912
+ # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
913
+ # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
914
+ # The code in logs/storage/validator/logs_validator_traits.cc treats this type
915
+ # as if it were annotated as ST_LOCATION.
916
+ # Corresponds to the JSON property `maxLatLng`
917
+ # @return [Google::Apis::VisionV1::LatLng]
918
+ attr_accessor :max_lat_lng
954
919
 
955
- # The accuracy of the entity detection in an image.
956
- # For example, for an image in which the "Eiffel Tower" entity is detected,
957
- # this field represents the confidence that there is a tower in the query
958
- # image. Range [0, 1].
959
- # Corresponds to the JSON property `confidence`
920
+ def initialize(**args)
921
+ update!(**args)
922
+ end
923
+
924
+ # Update properties of this object
925
+ def update!(**args)
926
+ @min_lat_lng = args[:min_lat_lng] if args.key?(:min_lat_lng)
927
+ @max_lat_lng = args[:max_lat_lng] if args.key?(:max_lat_lng)
928
+ end
929
+ end
930
+
931
+ # An object representing a latitude/longitude pair. This is expressed as a pair
932
+ # of doubles representing degrees latitude and degrees longitude. Unless
933
+ # specified otherwise, this must conform to the
934
+ # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
935
+ # standard</a>. Values must be within normalized ranges.
936
+ # Example of normalization code in Python:
937
+ # def NormalizeLongitude(longitude):
938
+ # """Wraps decimal degrees longitude to [-180.0, 180.0]."""
939
+ # q, r = divmod(longitude, 360.0)
940
+ # if r > 180.0 or (r == 180.0 and q <= -1.0):
941
+ # return r - 360.0
942
+ # return r
943
+ # def NormalizeLatLng(latitude, longitude):
944
+ # """Wraps decimal degrees latitude and longitude to
945
+ # [-90.0, 90.0] and [-180.0, 180.0], respectively."""
946
+ # r = latitude % 360.0
947
+ # if r <= 90.0:
948
+ # return r, NormalizeLongitude(longitude)
949
+ # elif r >= 270.0:
950
+ # return r - 360, NormalizeLongitude(longitude)
951
+ # else:
952
+ # return 180 - r, NormalizeLongitude(longitude + 180.0)
953
+ # assert 180.0 == NormalizeLongitude(180.0)
954
+ # assert -180.0 == NormalizeLongitude(-180.0)
955
+ # assert -179.0 == NormalizeLongitude(181.0)
956
+ # assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
957
+ # assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
958
+ # assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
959
+ # assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
960
+ # assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
961
+ # assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
962
+ # assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
963
+ # assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
964
+ # assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
965
+ # assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
966
+ # The code in logs/storage/validator/logs_validator_traits.cc treats this type
967
+ # as if it were annotated as ST_LOCATION.
968
+ class LatLng
969
+ include Google::Apis::Core::Hashable
970
+
971
+ # The latitude in degrees. It must be in the range [-90.0, +90.0].
972
+ # Corresponds to the JSON property `latitude`
960
973
  # @return [Float]
961
- attr_accessor :confidence
974
+ attr_accessor :latitude
962
975
 
963
- # The language code for the locale in which the entity textual
964
- # `description` is expressed.
965
- # Corresponds to the JSON property `locale`
966
- # @return [String]
967
- attr_accessor :locale
976
+ # The longitude in degrees. It must be in the range [-180.0, +180.0].
977
+ # Corresponds to the JSON property `longitude`
978
+ # @return [Float]
979
+ attr_accessor :longitude
968
980
 
969
- # A bounding polygon for the detected image annotation.
970
- # Corresponds to the JSON property `boundingPoly`
971
- # @return [Google::Apis::VisionV1::BoundingPoly]
972
- attr_accessor :bounding_poly
981
+ def initialize(**args)
982
+ update!(**args)
983
+ end
973
984
 
974
- # The relevancy of the ICA (Image Content Annotation) label to the
975
- # image. For example, the relevancy of "tower" is likely higher to an image
976
- # containing the detected "Eiffel Tower" than to an image containing a
977
- # detected distant towering building, even though the confidence that
978
- # there is a tower in each image may be the same. Range [0, 1].
979
- # Corresponds to the JSON property `topicality`
985
+ # Update properties of this object
986
+ def update!(**args)
987
+ @latitude = args[:latitude] if args.key?(:latitude)
988
+ @longitude = args[:longitude] if args.key?(:longitude)
989
+ end
990
+ end
991
+
992
+ # Represents a color in the RGBA color space. This representation is designed
993
+ # for simplicity of conversion to/from color representations in various
994
+ # languages over compactness; for example, the fields of this representation
995
+ # can be trivially provided to the constructor of "java.awt.Color" in Java; it
996
+ # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
997
+ # method in iOS; and, with just a little work, it can be easily formatted into
998
+ # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
999
+ # Example (Java):
1000
+ # import com.google.type.Color;
1001
+ # // ...
1002
+ # public static java.awt.Color fromProto(Color protocolor) `
1003
+ # float alpha = protocolor.hasAlpha()
1004
+ # ? protocolor.getAlpha().getValue()
1005
+ # : 1.0;
1006
+ # return new java.awt.Color(
1007
+ # protocolor.getRed(),
1008
+ # protocolor.getGreen(),
1009
+ # protocolor.getBlue(),
1010
+ # alpha);
1011
+ # `
1012
+ # public static Color toProto(java.awt.Color color) `
1013
+ # float red = (float) color.getRed();
1014
+ # float green = (float) color.getGreen();
1015
+ # float blue = (float) color.getBlue();
1016
+ # float denominator = 255.0;
1017
+ # Color.Builder resultBuilder =
1018
+ # Color
1019
+ # .newBuilder()
1020
+ # .setRed(red / denominator)
1021
+ # .setGreen(green / denominator)
1022
+ # .setBlue(blue / denominator);
1023
+ # int alpha = color.getAlpha();
1024
+ # if (alpha != 255) `
1025
+ # result.setAlpha(
1026
+ # FloatValue
1027
+ # .newBuilder()
1028
+ # .setValue(((float) alpha) / denominator)
1029
+ # .build());
1030
+ # `
1031
+ # return resultBuilder.build();
1032
+ # `
1033
+ # // ...
1034
+ # Example (iOS / Obj-C):
1035
+ # // ...
1036
+ # static UIColor* fromProto(Color* protocolor) `
1037
+ # float red = [protocolor red];
1038
+ # float green = [protocolor green];
1039
+ # float blue = [protocolor blue];
1040
+ # FloatValue* alpha_wrapper = [protocolor alpha];
1041
+ # float alpha = 1.0;
1042
+ # if (alpha_wrapper != nil) `
1043
+ # alpha = [alpha_wrapper value];
1044
+ # `
1045
+ # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
1046
+ # `
1047
+ # static Color* toProto(UIColor* color) `
1048
+ # CGFloat red, green, blue, alpha;
1049
+ # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
1050
+ # return nil;
1051
+ # `
1052
+ # Color* result = [Color alloc] init];
1053
+ # [result setRed:red];
1054
+ # [result setGreen:green];
1055
+ # [result setBlue:blue];
1056
+ # if (alpha <= 0.9999) `
1057
+ # [result setAlpha:floatWrapperWithValue(alpha)];
1058
+ # `
1059
+ # [result autorelease];
1060
+ # return result;
1061
+ # `
1062
+ # // ...
1063
+ # Example (JavaScript):
1064
+ # // ...
1065
+ # var protoToCssColor = function(rgb_color) `
1066
+ # var redFrac = rgb_color.red || 0.0;
1067
+ # var greenFrac = rgb_color.green || 0.0;
1068
+ # var blueFrac = rgb_color.blue || 0.0;
1069
+ # var red = Math.floor(redFrac * 255);
1070
+ # var green = Math.floor(greenFrac * 255);
1071
+ # var blue = Math.floor(blueFrac * 255);
1072
+ # if (!('alpha' in rgb_color)) `
1073
+ # return rgbToCssColor_(red, green, blue);
1074
+ # `
1075
+ # var alphaFrac = rgb_color.alpha.value || 0.0;
1076
+ # var rgbParams = [red, green, blue].join(',');
1077
+ # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
1078
+ # `;
1079
+ # var rgbToCssColor_ = function(red, green, blue) `
1080
+ # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
1081
+ # var hexString = rgbNumber.toString(16);
1082
+ # var missingZeros = 6 - hexString.length;
1083
+ # var resultBuilder = ['#'];
1084
+ # for (var i = 0; i < missingZeros; i++) `
1085
+ # resultBuilder.push('0');
1086
+ # `
1087
+ # resultBuilder.push(hexString);
1088
+ # return resultBuilder.join('');
1089
+ # `;
1090
+ # // ...
1091
+ class Color
1092
+ include Google::Apis::Core::Hashable
1093
+
1094
+ # The amount of green in the color as a value in the interval [0, 1].
1095
+ # Corresponds to the JSON property `green`
980
1096
  # @return [Float]
981
- attr_accessor :topicality
1097
+ attr_accessor :green
982
1098
 
983
- # Entity textual description, expressed in its `locale` language.
984
- # Corresponds to the JSON property `description`
985
- # @return [String]
986
- attr_accessor :description
1099
+ # The amount of blue in the color as a value in the interval [0, 1].
1100
+ # Corresponds to the JSON property `blue`
1101
+ # @return [Float]
1102
+ attr_accessor :blue
987
1103
 
988
- # Some entities may have optional user-supplied `Property` (name/value)
989
- # fields, such a score or string that qualifies the entity.
990
- # Corresponds to the JSON property `properties`
991
- # @return [Array<Google::Apis::VisionV1::Property>]
992
- attr_accessor :properties
1104
+ # The fraction of this color that should be applied to the pixel. That is,
1105
+ # the final pixel color is defined by the equation:
1106
+ # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
1107
+ # This means that a value of 1.0 corresponds to a solid color, whereas
1108
+ # a value of 0.0 corresponds to a completely transparent color. This
1109
+ # uses a wrapper message rather than a simple float scalar so that it is
1110
+ # possible to distinguish between a default value and the value being unset.
1111
+ # If omitted, this color object is to be rendered as a solid color
1112
+ # (as if the alpha value had been explicitly given with a value of 1.0).
1113
+ # Corresponds to the JSON property `alpha`
1114
+ # @return [Float]
1115
+ attr_accessor :alpha
993
1116
 
994
- # Overall score of the result. Range [0, 1].
995
- # Corresponds to the JSON property `score`
1117
+ # The amount of red in the color as a value in the interval [0, 1].
1118
+ # Corresponds to the JSON property `red`
996
1119
  # @return [Float]
997
- attr_accessor :score
1120
+ attr_accessor :red
998
1121
 
999
1122
  def initialize(**args)
1000
1123
  update!(**args)
@@ -1002,37 +1125,29 @@ module Google
1002
1125
 
1003
1126
  # Update properties of this object
1004
1127
  def update!(**args)
1005
- @locations = args[:locations] if args.key?(:locations)
1006
- @mid = args[:mid] if args.key?(:mid)
1007
- @confidence = args[:confidence] if args.key?(:confidence)
1008
- @locale = args[:locale] if args.key?(:locale)
1009
- @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
1010
- @topicality = args[:topicality] if args.key?(:topicality)
1011
- @description = args[:description] if args.key?(:description)
1012
- @properties = args[:properties] if args.key?(:properties)
1013
- @score = args[:score] if args.key?(:score)
1128
+ @green = args[:green] if args.key?(:green)
1129
+ @blue = args[:blue] if args.key?(:blue)
1130
+ @alpha = args[:alpha] if args.key?(:alpha)
1131
+ @red = args[:red] if args.key?(:red)
1014
1132
  end
1015
1133
  end
1016
1134
 
1017
- # A face-specific landmark (for example, a face feature).
1018
- # Landmark positions may fall outside the bounds of the image
1019
- # if the face is near one or more edges of the image.
1020
- # Therefore it is NOT guaranteed that `0 <= x < width` or
1021
- # `0 <= y < height`.
1022
- class Landmark
1135
+ # Users describe the type of Google Cloud Vision API tasks to perform over
1136
+ # images by using *Feature*s. Each Feature indicates a type of image
1137
+ # detection task to perform. Features encode the Cloud Vision API
1138
+ # vertical to operate on and the number of top-scoring results to return.
1139
+ class Feature
1023
1140
  include Google::Apis::Core::Hashable
1024
1141
 
1025
- # Face landmark type.
1142
+ # The feature type.
1026
1143
  # Corresponds to the JSON property `type`
1027
1144
  # @return [String]
1028
1145
  attr_accessor :type
1029
1146
 
1030
- # A 3D position in the image, used primarily for Face detection landmarks.
1031
- # A valid Position must have both x and y coordinates.
1032
- # The position coordinates are in the same scale as the original image.
1033
- # Corresponds to the JSON property `position`
1034
- # @return [Google::Apis::VisionV1::Position]
1035
- attr_accessor :position
1147
+ # Maximum number of results of this type.
1148
+ # Corresponds to the JSON property `maxResults`
1149
+ # @return [Fixnum]
1150
+ attr_accessor :max_results
1036
1151
 
1037
1152
  def initialize(**args)
1038
1153
  update!(**args)
@@ -1041,25 +1156,18 @@ module Google
1041
1156
  # Update properties of this object
1042
1157
  def update!(**args)
1043
1158
  @type = args[:type] if args.key?(:type)
1044
- @position = args[:position] if args.key?(:position)
1159
+ @max_results = args[:max_results] if args.key?(:max_results)
1045
1160
  end
1046
1161
  end
1047
1162
 
1048
- # Client image to perform Google Cloud Vision API tasks over.
1049
- class Image
1163
+ # Stores image properties, such as dominant colors.
1164
+ class ImageProperties
1050
1165
  include Google::Apis::Core::Hashable
1051
1166
 
1052
- # Image content, represented as a stream of bytes.
1053
- # Note: as with all `bytes` fields, protobuffers use a pure binary
1054
- # representation, whereas JSON representations use base64.
1055
- # Corresponds to the JSON property `content`
1056
- # @return [String]
1057
- attr_accessor :content
1058
-
1059
- # External image source (Google Cloud Storage image location).
1060
- # Corresponds to the JSON property `source`
1061
- # @return [Google::Apis::VisionV1::ImageSource]
1062
- attr_accessor :source
1167
+ # Set of dominant colors and their corresponding scores.
1168
+ # Corresponds to the JSON property `dominantColors`
1169
+ # @return [Google::Apis::VisionV1::DominantColorsAnnotation]
1170
+ attr_accessor :dominant_colors
1063
1171
 
1064
1172
  def initialize(**args)
1065
1173
  update!(**args)
@@ -1067,127 +1175,35 @@ module Google
1067
1175
 
1068
1176
  # Update properties of this object
1069
1177
  def update!(**args)
1070
- @content = args[:content] if args.key?(:content)
1071
- @source = args[:source] if args.key?(:source)
1178
+ @dominant_colors = args[:dominant_colors] if args.key?(:dominant_colors)
1072
1179
  end
1073
1180
  end
1074
1181
 
1075
- # A face annotation object contains the results of face detection.
1076
- class FaceAnnotation
1182
+ #
1183
+ class SafeSearchAnnotation
1077
1184
  include Google::Apis::Core::Hashable
1078
1185
 
1079
- # A bounding polygon for the detected image annotation.
1080
- # Corresponds to the JSON property `fdBoundingPoly`
1081
- # @return [Google::Apis::VisionV1::BoundingPoly]
1082
- attr_accessor :fd_bounding_poly
1083
-
1084
- # Anger likelihood.
1085
- # Corresponds to the JSON property `angerLikelihood`
1086
- # @return [String]
1087
- attr_accessor :anger_likelihood
1088
-
1089
- # Detected face landmarks.
1090
- # Corresponds to the JSON property `landmarks`
1091
- # @return [Array<Google::Apis::VisionV1::Landmark>]
1092
- attr_accessor :landmarks
1093
-
1094
- # Surprise likelihood.
1095
- # Corresponds to the JSON property `surpriseLikelihood`
1096
- # @return [String]
1097
- attr_accessor :surprise_likelihood
1098
-
1099
- # Face landmarking confidence. Range [0, 1].
1100
- # Corresponds to the JSON property `landmarkingConfidence`
1101
- # @return [Float]
1102
- attr_accessor :landmarking_confidence
1103
-
1104
- # Joy likelihood.
1105
- # Corresponds to the JSON property `joyLikelihood`
1106
- # @return [String]
1107
- attr_accessor :joy_likelihood
1108
-
1109
- # Under-exposed likelihood.
1110
- # Corresponds to the JSON property `underExposedLikelihood`
1186
+ # Represents the adult content likelihood for the image.
1187
+ # Corresponds to the JSON property `adult`
1111
1188
  # @return [String]
1112
- attr_accessor :under_exposed_likelihood
1113
-
1114
- # Yaw angle, which indicates the leftward/rightward angle that the face is
1115
- # pointing relative to the vertical plane perpendicular to the image. Range
1116
- # [-180,180].
1117
- # Corresponds to the JSON property `panAngle`
1118
- # @return [Float]
1119
- attr_accessor :pan_angle
1120
-
1121
- # Detection confidence. Range [0, 1].
1122
- # Corresponds to the JSON property `detectionConfidence`
1123
- # @return [Float]
1124
- attr_accessor :detection_confidence
1189
+ attr_accessor :adult
1125
1190
 
1126
- # Blurred likelihood.
1127
- # Corresponds to the JSON property `blurredLikelihood`
1191
+ # Spoof likelihood. The likelihood that an modification
1192
+ # was made to the image's canonical version to make it appear
1193
+ # funny or offensive.
1194
+ # Corresponds to the JSON property `spoof`
1128
1195
  # @return [String]
1129
- attr_accessor :blurred_likelihood
1196
+ attr_accessor :spoof
1130
1197
 
1131
- # Headwear likelihood.
1132
- # Corresponds to the JSON property `headwearLikelihood`
1198
+ # Likelihood that this is a medical image.
1199
+ # Corresponds to the JSON property `medical`
1133
1200
  # @return [String]
1134
- attr_accessor :headwear_likelihood
1135
-
1136
- # A bounding polygon for the detected image annotation.
1137
- # Corresponds to the JSON property `boundingPoly`
1138
- # @return [Google::Apis::VisionV1::BoundingPoly]
1139
- attr_accessor :bounding_poly
1140
-
1141
- # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
1142
- # of the face relative to the image vertical about the axis perpendicular to
1143
- # the face. Range [-180,180].
1144
- # Corresponds to the JSON property `rollAngle`
1145
- # @return [Float]
1146
- attr_accessor :roll_angle
1201
+ attr_accessor :medical
1147
1202
 
1148
- # Sorrow likelihood.
1149
- # Corresponds to the JSON property `sorrowLikelihood`
1203
+ # Violence likelihood.
1204
+ # Corresponds to the JSON property `violence`
1150
1205
  # @return [String]
1151
- attr_accessor :sorrow_likelihood
1152
-
1153
- # Pitch angle, which indicates the upwards/downwards angle that the face is
1154
- # pointing relative to the image's horizontal plane. Range [-180,180].
1155
- # Corresponds to the JSON property `tiltAngle`
1156
- # @return [Float]
1157
- attr_accessor :tilt_angle
1158
-
1159
- def initialize(**args)
1160
- update!(**args)
1161
- end
1162
-
1163
- # Update properties of this object
1164
- def update!(**args)
1165
- @fd_bounding_poly = args[:fd_bounding_poly] if args.key?(:fd_bounding_poly)
1166
- @anger_likelihood = args[:anger_likelihood] if args.key?(:anger_likelihood)
1167
- @landmarks = args[:landmarks] if args.key?(:landmarks)
1168
- @surprise_likelihood = args[:surprise_likelihood] if args.key?(:surprise_likelihood)
1169
- @landmarking_confidence = args[:landmarking_confidence] if args.key?(:landmarking_confidence)
1170
- @joy_likelihood = args[:joy_likelihood] if args.key?(:joy_likelihood)
1171
- @under_exposed_likelihood = args[:under_exposed_likelihood] if args.key?(:under_exposed_likelihood)
1172
- @pan_angle = args[:pan_angle] if args.key?(:pan_angle)
1173
- @detection_confidence = args[:detection_confidence] if args.key?(:detection_confidence)
1174
- @blurred_likelihood = args[:blurred_likelihood] if args.key?(:blurred_likelihood)
1175
- @headwear_likelihood = args[:headwear_likelihood] if args.key?(:headwear_likelihood)
1176
- @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
1177
- @roll_angle = args[:roll_angle] if args.key?(:roll_angle)
1178
- @sorrow_likelihood = args[:sorrow_likelihood] if args.key?(:sorrow_likelihood)
1179
- @tilt_angle = args[:tilt_angle] if args.key?(:tilt_angle)
1180
- end
1181
- end
1182
-
1183
- # Multiple image annotation requests are batched into a single service call.
1184
- class BatchAnnotateImagesRequest
1185
- include Google::Apis::Core::Hashable
1186
-
1187
- # Individual image annotation requests for this batch.
1188
- # Corresponds to the JSON property `requests`
1189
- # @return [Array<Google::Apis::VisionV1::AnnotateImageRequest>]
1190
- attr_accessor :requests
1206
+ attr_accessor :violence
1191
1207
 
1192
1208
  def initialize(**args)
1193
1209
  update!(**args)
@@ -1195,30 +1211,21 @@ module Google
1195
1211
 
1196
1212
  # Update properties of this object
1197
1213
  def update!(**args)
1198
- @requests = args[:requests] if args.key?(:requests)
1214
+ @adult = args[:adult] if args.key?(:adult)
1215
+ @spoof = args[:spoof] if args.key?(:spoof)
1216
+ @medical = args[:medical] if args.key?(:medical)
1217
+ @violence = args[:violence] if args.key?(:violence)
1199
1218
  end
1200
1219
  end
1201
1220
 
1202
- # Image context and/or feature-specific parameters.
1203
- class ImageContext
1221
+ # Set of dominant colors and their corresponding scores.
1222
+ class DominantColorsAnnotation
1204
1223
  include Google::Apis::Core::Hashable
1205
1224
 
1206
- # Rectangle determined by min and max `LatLng` pairs.
1207
- # Corresponds to the JSON property `latLongRect`
1208
- # @return [Google::Apis::VisionV1::LatLongRect]
1209
- attr_accessor :lat_long_rect
1210
-
1211
- # List of languages to use for TEXT_DETECTION. In most cases, an empty value
1212
- # yields the best results since it enables automatic language detection. For
1213
- # languages based on the Latin alphabet, setting `language_hints` is not
1214
- # needed. In rare cases, when the language of the text in the image is known,
1215
- # setting a hint will help get better results (although it will be a
1216
- # significant hindrance if the hint is wrong). Text detection returns an
1217
- # error if one or more of the specified languages is not one of the
1218
- # [supported languages](/vision/docs/languages).
1219
- # Corresponds to the JSON property `languageHints`
1220
- # @return [Array<String>]
1221
- attr_accessor :language_hints
1225
+ # RGB color values with their score and pixel fraction.
1226
+ # Corresponds to the JSON property `colors`
1227
+ # @return [Array<Google::Apis::VisionV1::ColorInfo>]
1228
+ attr_accessor :colors
1222
1229
 
1223
1230
  def initialize(**args)
1224
1231
  update!(**args)
@@ -1226,30 +1233,24 @@ module Google
1226
1233
 
1227
1234
  # Update properties of this object
1228
1235
  def update!(**args)
1229
- @lat_long_rect = args[:lat_long_rect] if args.key?(:lat_long_rect)
1230
- @language_hints = args[:language_hints] if args.key?(:language_hints)
1236
+ @colors = args[:colors] if args.key?(:colors)
1231
1237
  end
1232
1238
  end
1233
1239
 
1234
- # Request for performing Google Cloud Vision API tasks over a user-provided
1235
- # image, with user-requested features.
1236
- class AnnotateImageRequest
1240
+ # A vertex represents a 2D point in the image.
1241
+ # NOTE: the vertex coordinates are in the same scale as the original image.
1242
+ class Vertex
1237
1243
  include Google::Apis::Core::Hashable
1238
1244
 
1239
- # Client image to perform Google Cloud Vision API tasks over.
1240
- # Corresponds to the JSON property `image`
1241
- # @return [Google::Apis::VisionV1::Image]
1242
- attr_accessor :image
1243
-
1244
- # Requested features.
1245
- # Corresponds to the JSON property `features`
1246
- # @return [Array<Google::Apis::VisionV1::Feature>]
1247
- attr_accessor :features
1245
+ # X coordinate.
1246
+ # Corresponds to the JSON property `x`
1247
+ # @return [Fixnum]
1248
+ attr_accessor :x
1248
1249
 
1249
- # Image context and/or feature-specific parameters.
1250
- # Corresponds to the JSON property `imageContext`
1251
- # @return [Google::Apis::VisionV1::ImageContext]
1252
- attr_accessor :image_context
1250
+ # Y coordinate.
1251
+ # Corresponds to the JSON property `y`
1252
+ # @return [Fixnum]
1253
+ attr_accessor :y
1253
1254
 
1254
1255
  def initialize(**args)
1255
1256
  update!(**args)
@@ -1257,9 +1258,8 @@ module Google
1257
1258
 
1258
1259
  # Update properties of this object
1259
1260
  def update!(**args)
1260
- @image = args[:image] if args.key?(:image)
1261
- @features = args[:features] if args.key?(:features)
1262
- @image_context = args[:image_context] if args.key?(:image_context)
1261
+ @x = args[:x] if args.key?(:x)
1262
+ @y = args[:y] if args.key?(:y)
1263
1263
  end
1264
1264
  end
1265
1265
  end