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