google-api-client 0.17.0 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -0
- data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
- data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +0 -8
- data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +0 -1
- data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +28 -184
- data/generated/google/apis/analyticsreporting_v4.rb +1 -1
- data/generated/google/apis/analyticsreporting_v4/classes.rb +56 -0
- data/generated/google/apis/analyticsreporting_v4/representations.rb +18 -0
- data/generated/google/apis/androidmanagement_v1.rb +1 -1
- data/generated/google/apis/bigquerydatatransfer_v1.rb +1 -1
- data/generated/google/apis/bigquerydatatransfer_v1/classes.rb +116 -0
- data/generated/google/apis/bigquerydatatransfer_v1/representations.rb +17 -0
- data/generated/google/apis/cloudtasks_v2beta2.rb +1 -1
- data/generated/google/apis/cloudtasks_v2beta2/service.rb +2 -0
- data/generated/google/apis/cloudtrace_v1.rb +4 -5
- data/generated/google/apis/cloudtrace_v1/service.rb +3 -4
- data/generated/google/apis/cloudtrace_v2.rb +4 -5
- data/generated/google/apis/cloudtrace_v2/classes.rb +18 -16
- data/generated/google/apis/cloudtrace_v2/service.rb +13 -16
- data/generated/google/apis/container_v1.rb +1 -1
- data/generated/google/apis/container_v1/classes.rb +1 -1
- data/generated/google/apis/container_v1beta1.rb +1 -1
- data/generated/google/apis/container_v1beta1/classes.rb +335 -1
- data/generated/google/apis/container_v1beta1/representations.rb +107 -0
- data/generated/google/apis/container_v1beta1/service.rb +482 -0
- data/generated/google/apis/deploymentmanager_alpha.rb +1 -1
- data/generated/google/apis/deploymentmanager_alpha/classes.rb +2 -1
- data/generated/google/apis/deploymentmanager_v2beta.rb +1 -1
- data/generated/google/apis/deploymentmanager_v2beta/classes.rb +2 -1
- data/generated/google/apis/dfareporting_v2_7.rb +1 -1
- data/generated/google/apis/dfareporting_v2_7/classes.rb +6 -3
- data/generated/google/apis/dfareporting_v2_8.rb +1 -1
- data/generated/google/apis/dfareporting_v2_8/classes.rb +8 -5
- data/generated/google/apis/dfareporting_v3_0.rb +40 -0
- data/generated/google/apis/dfareporting_v3_0/classes.rb +12117 -0
- data/generated/google/apis/dfareporting_v3_0/representations.rb +4336 -0
- data/generated/google/apis/dfareporting_v3_0/service.rb +9108 -0
- data/generated/google/apis/firebasedynamiclinks_v1.rb +1 -1
- data/generated/google/apis/firebasedynamiclinks_v1/classes.rb +9 -0
- data/generated/google/apis/firebasedynamiclinks_v1/representations.rb +1 -0
- data/generated/google/apis/firestore_v1beta1.rb +1 -1
- data/generated/google/apis/firestore_v1beta1/classes.rb +1 -0
- data/generated/google/apis/ml_v1.rb +1 -1
- data/generated/google/apis/ml_v1/classes.rb +76 -3
- data/generated/google/apis/ml_v1/representations.rb +7 -0
- data/generated/google/apis/ml_v1/service.rb +53 -0
- data/generated/google/apis/monitoring_v3.rb +1 -1
- data/generated/google/apis/monitoring_v3/service.rb +1 -5
- data/generated/google/apis/oslogin_v1alpha.rb +2 -2
- data/generated/google/apis/oslogin_v1alpha/service.rb +1 -1
- data/generated/google/apis/oslogin_v1beta.rb +2 -2
- data/generated/google/apis/oslogin_v1beta/service.rb +1 -1
- data/generated/google/apis/people_v1.rb +1 -1
- data/generated/google/apis/people_v1/classes.rb +2 -0
- data/generated/google/apis/people_v1/service.rb +0 -4
- data/generated/google/apis/script_v1.rb +1 -1
- data/generated/google/apis/script_v1/classes.rb +5 -6
- data/generated/google/apis/servicemanagement_v1.rb +1 -1
- data/generated/google/apis/servicemanagement_v1/classes.rb +0 -8
- data/generated/google/apis/servicemanagement_v1/representations.rb +0 -1
- data/generated/google/apis/serviceuser_v1.rb +1 -1
- data/generated/google/apis/serviceuser_v1/classes.rb +0 -8
- data/generated/google/apis/serviceuser_v1/representations.rb +0 -1
- data/generated/google/apis/spanner_v1.rb +1 -1
- data/generated/google/apis/spanner_v1/classes.rb +13 -14
- data/generated/google/apis/spanner_v1/service.rb +13 -13
- data/generated/google/apis/tagmanager_v1.rb +1 -1
- data/generated/google/apis/tagmanager_v1/classes.rb +70 -9
- data/generated/google/apis/tagmanager_v1/representations.rb +22 -3
- data/generated/google/apis/tagmanager_v2.rb +1 -1
- data/generated/google/apis/tagmanager_v2/classes.rb +7 -0
- data/generated/google/apis/tagmanager_v2/representations.rb +1 -0
- data/generated/google/apis/vision_v1.rb +1 -1
- data/generated/google/apis/vision_v1/classes.rb +434 -434
- data/generated/google/apis/vision_v1/representations.rb +178 -178
- data/generated/google/apis/vision_v1/service.rb +8 -8
- data/generated/google/apis/vision_v1p1beta1.rb +39 -0
- data/generated/google/apis/vision_v1p1beta1/classes.rb +1800 -0
- data/generated/google/apis/vision_v1p1beta1/representations.rb +728 -0
- data/generated/google/apis/vision_v1p1beta1/service.rb +91 -0
- data/generated/google/apis/youtube_partner_v1.rb +1 -1
- data/lib/google/apis/version.rb +1 -1
- metadata +10 -2
@@ -25,7 +25,7 @@ module Google
|
|
25
25
|
# @see https://developers.google.com/tag-manager/api/v2/
|
26
26
|
module TagmanagerV2
|
27
27
|
VERSION = 'V2'
|
28
|
-
REVISION = '
|
28
|
+
REVISION = '20171108'
|
29
29
|
|
30
30
|
# Delete your Google Tag Manager containers
|
31
31
|
AUTH_TAGMANAGER_DELETE_CONTAINERS = 'https://www.googleapis.com/auth/tagmanager.delete.containers'
|
@@ -1587,6 +1587,12 @@ module Google
|
|
1587
1587
|
# @return [String]
|
1588
1588
|
attr_accessor :path
|
1589
1589
|
|
1590
|
+
# Indicates whether the tag is paused, which prevents the tag from firing.
|
1591
|
+
# Corresponds to the JSON property `paused`
|
1592
|
+
# @return [Boolean]
|
1593
|
+
attr_accessor :paused
|
1594
|
+
alias_method :paused?, :paused
|
1595
|
+
|
1590
1596
|
# Represents a Google Tag Manager Parameter.
|
1591
1597
|
# Corresponds to the JSON property `priority`
|
1592
1598
|
# @return [Google::Apis::TagmanagerV2::Parameter]
|
@@ -1656,6 +1662,7 @@ module Google
|
|
1656
1662
|
@parameter = args[:parameter] if args.key?(:parameter)
|
1657
1663
|
@parent_folder_id = args[:parent_folder_id] if args.key?(:parent_folder_id)
|
1658
1664
|
@path = args[:path] if args.key?(:path)
|
1665
|
+
@paused = args[:paused] if args.key?(:paused)
|
1659
1666
|
@priority = args[:priority] if args.key?(:priority)
|
1660
1667
|
@schedule_end_ms = args[:schedule_end_ms] if args.key?(:schedule_end_ms)
|
1661
1668
|
@schedule_start_ms = args[:schedule_start_ms] if args.key?(:schedule_start_ms)
|
@@ -812,6 +812,7 @@ module Google
|
|
812
812
|
|
813
813
|
property :parent_folder_id, as: 'parentFolderId'
|
814
814
|
property :path, as: 'path'
|
815
|
+
property :paused, as: 'paused'
|
815
816
|
property :priority, as: 'priority', class: Google::Apis::TagmanagerV2::Parameter, decorator: Google::Apis::TagmanagerV2::Parameter::Representation
|
816
817
|
|
817
818
|
property :schedule_end_ms, :numeric_string => true, as: 'scheduleEndMs'
|
@@ -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 = '20171107'
|
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'
|
@@ -24,22 +24,22 @@ module Google
|
|
24
24
|
|
25
25
|
# Request for performing Google Cloud Vision API tasks over a user-provided
|
26
26
|
# image, with user-requested features.
|
27
|
-
class
|
27
|
+
class AnnotateImageRequest
|
28
28
|
include Google::Apis::Core::Hashable
|
29
29
|
|
30
30
|
# Requested features.
|
31
31
|
# Corresponds to the JSON property `features`
|
32
|
-
# @return [Array<Google::Apis::VisionV1::
|
32
|
+
# @return [Array<Google::Apis::VisionV1::Feature>]
|
33
33
|
attr_accessor :features
|
34
34
|
|
35
35
|
# Client image to perform Google Cloud Vision API tasks over.
|
36
36
|
# Corresponds to the JSON property `image`
|
37
|
-
# @return [Google::Apis::VisionV1::
|
37
|
+
# @return [Google::Apis::VisionV1::Image]
|
38
38
|
attr_accessor :image
|
39
39
|
|
40
40
|
# Image context and/or feature-specific parameters.
|
41
41
|
# Corresponds to the JSON property `imageContext`
|
42
|
-
# @return [Google::Apis::VisionV1::
|
42
|
+
# @return [Google::Apis::VisionV1::ImageContext]
|
43
43
|
attr_accessor :image_context
|
44
44
|
|
45
45
|
def initialize(**args)
|
@@ -55,12 +55,12 @@ module Google
|
|
55
55
|
end
|
56
56
|
|
57
57
|
# Response to an image annotation request.
|
58
|
-
class
|
58
|
+
class AnnotateImageResponse
|
59
59
|
include Google::Apis::Core::Hashable
|
60
60
|
|
61
61
|
# Set of crop hints that are used to generate new crops when serving images.
|
62
62
|
# Corresponds to the JSON property `cropHintsAnnotation`
|
63
|
-
# @return [Google::Apis::VisionV1::
|
63
|
+
# @return [Google::Apis::VisionV1::CropHintsAnnotation]
|
64
64
|
attr_accessor :crop_hints_annotation
|
65
65
|
|
66
66
|
# The `Status` type defines a logical error model that is suitable for different
|
@@ -103,12 +103,12 @@ module Google
|
|
103
103
|
# - Logging. If some API errors are stored in logs, the message `Status` could
|
104
104
|
# be used directly after any stripping needed for security/privacy reasons.
|
105
105
|
# Corresponds to the JSON property `error`
|
106
|
-
# @return [Google::Apis::VisionV1::
|
106
|
+
# @return [Google::Apis::VisionV1::Status]
|
107
107
|
attr_accessor :error
|
108
108
|
|
109
109
|
# If present, face detection has completed successfully.
|
110
110
|
# Corresponds to the JSON property `faceAnnotations`
|
111
|
-
# @return [Array<Google::Apis::VisionV1::
|
111
|
+
# @return [Array<Google::Apis::VisionV1::FaceAnnotation>]
|
112
112
|
attr_accessor :face_annotations
|
113
113
|
|
114
114
|
# TextAnnotation contains a structured representation of OCR extracted text.
|
@@ -119,44 +119,44 @@ module Google
|
|
119
119
|
# to the TextAnnotation.TextProperty message definition below for more
|
120
120
|
# detail.
|
121
121
|
# Corresponds to the JSON property `fullTextAnnotation`
|
122
|
-
# @return [Google::Apis::VisionV1::
|
122
|
+
# @return [Google::Apis::VisionV1::TextAnnotation]
|
123
123
|
attr_accessor :full_text_annotation
|
124
124
|
|
125
125
|
# Stores image properties, such as dominant colors.
|
126
126
|
# Corresponds to the JSON property `imagePropertiesAnnotation`
|
127
|
-
# @return [Google::Apis::VisionV1::
|
127
|
+
# @return [Google::Apis::VisionV1::ImageProperties]
|
128
128
|
attr_accessor :image_properties_annotation
|
129
129
|
|
130
130
|
# If present, label detection has completed successfully.
|
131
131
|
# Corresponds to the JSON property `labelAnnotations`
|
132
|
-
# @return [Array<Google::Apis::VisionV1::
|
132
|
+
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
133
133
|
attr_accessor :label_annotations
|
134
134
|
|
135
135
|
# If present, landmark detection has completed successfully.
|
136
136
|
# Corresponds to the JSON property `landmarkAnnotations`
|
137
|
-
# @return [Array<Google::Apis::VisionV1::
|
137
|
+
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
138
138
|
attr_accessor :landmark_annotations
|
139
139
|
|
140
140
|
# If present, logo detection has completed successfully.
|
141
141
|
# Corresponds to the JSON property `logoAnnotations`
|
142
|
-
# @return [Array<Google::Apis::VisionV1::
|
142
|
+
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
143
143
|
attr_accessor :logo_annotations
|
144
144
|
|
145
145
|
# Set of features pertaining to the image, computed by computer vision
|
146
146
|
# methods over safe-search verticals (for example, adult, spoof, medical,
|
147
147
|
# violence).
|
148
148
|
# Corresponds to the JSON property `safeSearchAnnotation`
|
149
|
-
# @return [Google::Apis::VisionV1::
|
149
|
+
# @return [Google::Apis::VisionV1::SafeSearchAnnotation]
|
150
150
|
attr_accessor :safe_search_annotation
|
151
151
|
|
152
152
|
# If present, text (OCR) detection has completed successfully.
|
153
153
|
# Corresponds to the JSON property `textAnnotations`
|
154
|
-
# @return [Array<Google::Apis::VisionV1::
|
154
|
+
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
155
155
|
attr_accessor :text_annotations
|
156
156
|
|
157
157
|
# Relevant information for the image from the Internet.
|
158
158
|
# Corresponds to the JSON property `webDetection`
|
159
|
-
# @return [Google::Apis::VisionV1::
|
159
|
+
# @return [Google::Apis::VisionV1::WebDetection]
|
160
160
|
attr_accessor :web_detection
|
161
161
|
|
162
162
|
def initialize(**args)
|
@@ -180,12 +180,12 @@ module Google
|
|
180
180
|
end
|
181
181
|
|
182
182
|
# Multiple image annotation requests are batched into a single service call.
|
183
|
-
class
|
183
|
+
class BatchAnnotateImagesRequest
|
184
184
|
include Google::Apis::Core::Hashable
|
185
185
|
|
186
186
|
# Individual image annotation requests for this batch.
|
187
187
|
# Corresponds to the JSON property `requests`
|
188
|
-
# @return [Array<Google::Apis::VisionV1::
|
188
|
+
# @return [Array<Google::Apis::VisionV1::AnnotateImageRequest>]
|
189
189
|
attr_accessor :requests
|
190
190
|
|
191
191
|
def initialize(**args)
|
@@ -199,12 +199,12 @@ module Google
|
|
199
199
|
end
|
200
200
|
|
201
201
|
# Response to a batch image annotation request.
|
202
|
-
class
|
202
|
+
class BatchAnnotateImagesResponse
|
203
203
|
include Google::Apis::Core::Hashable
|
204
204
|
|
205
205
|
# Individual responses to image annotation requests within the batch.
|
206
206
|
# Corresponds to the JSON property `responses`
|
207
|
-
# @return [Array<Google::Apis::VisionV1::
|
207
|
+
# @return [Array<Google::Apis::VisionV1::AnnotateImageResponse>]
|
208
208
|
attr_accessor :responses
|
209
209
|
|
210
210
|
def initialize(**args)
|
@@ -218,7 +218,7 @@ module Google
|
|
218
218
|
end
|
219
219
|
|
220
220
|
# Logical element on the page.
|
221
|
-
class
|
221
|
+
class Block
|
222
222
|
include Google::Apis::Core::Hashable
|
223
223
|
|
224
224
|
# Detected block type (text, image etc) for this block.
|
@@ -228,17 +228,17 @@ module Google
|
|
228
228
|
|
229
229
|
# A bounding polygon for the detected image annotation.
|
230
230
|
# Corresponds to the JSON property `boundingBox`
|
231
|
-
# @return [Google::Apis::VisionV1::
|
231
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
232
232
|
attr_accessor :bounding_box
|
233
233
|
|
234
234
|
# List of paragraphs in this block (if this blocks is of type text).
|
235
235
|
# Corresponds to the JSON property `paragraphs`
|
236
|
-
# @return [Array<Google::Apis::VisionV1::
|
236
|
+
# @return [Array<Google::Apis::VisionV1::Paragraph>]
|
237
237
|
attr_accessor :paragraphs
|
238
238
|
|
239
239
|
# Additional information detected on the structural component.
|
240
240
|
# Corresponds to the JSON property `property`
|
241
|
-
# @return [Google::Apis::VisionV1::
|
241
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
242
242
|
attr_accessor :property
|
243
243
|
|
244
244
|
def initialize(**args)
|
@@ -255,12 +255,12 @@ module Google
|
|
255
255
|
end
|
256
256
|
|
257
257
|
# A bounding polygon for the detected image annotation.
|
258
|
-
class
|
258
|
+
class BoundingPoly
|
259
259
|
include Google::Apis::Core::Hashable
|
260
260
|
|
261
261
|
# The bounding polygon vertices.
|
262
262
|
# Corresponds to the JSON property `vertices`
|
263
|
-
# @return [Array<Google::Apis::VisionV1::
|
263
|
+
# @return [Array<Google::Apis::VisionV1::Vertex>]
|
264
264
|
attr_accessor :vertices
|
265
265
|
|
266
266
|
def initialize(**args)
|
@@ -273,9 +273,152 @@ module Google
|
|
273
273
|
end
|
274
274
|
end
|
275
275
|
|
276
|
+
# Represents a color in the RGBA color space. This representation is designed
|
277
|
+
# for simplicity of conversion to/from color representations in various
|
278
|
+
# languages over compactness; for example, the fields of this representation
|
279
|
+
# can be trivially provided to the constructor of "java.awt.Color" in Java; it
|
280
|
+
# can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
|
281
|
+
# method in iOS; and, with just a little work, it can be easily formatted into
|
282
|
+
# a CSS "rgba()" string in JavaScript, as well. Here are some examples:
|
283
|
+
# Example (Java):
|
284
|
+
# import com.google.type.Color;
|
285
|
+
# // ...
|
286
|
+
# public static java.awt.Color fromProto(Color protocolor) `
|
287
|
+
# float alpha = protocolor.hasAlpha()
|
288
|
+
# ? protocolor.getAlpha().getValue()
|
289
|
+
# : 1.0;
|
290
|
+
# return new java.awt.Color(
|
291
|
+
# protocolor.getRed(),
|
292
|
+
# protocolor.getGreen(),
|
293
|
+
# protocolor.getBlue(),
|
294
|
+
# alpha);
|
295
|
+
# `
|
296
|
+
# public static Color toProto(java.awt.Color color) `
|
297
|
+
# float red = (float) color.getRed();
|
298
|
+
# float green = (float) color.getGreen();
|
299
|
+
# float blue = (float) color.getBlue();
|
300
|
+
# float denominator = 255.0;
|
301
|
+
# Color.Builder resultBuilder =
|
302
|
+
# Color
|
303
|
+
# .newBuilder()
|
304
|
+
# .setRed(red / denominator)
|
305
|
+
# .setGreen(green / denominator)
|
306
|
+
# .setBlue(blue / denominator);
|
307
|
+
# int alpha = color.getAlpha();
|
308
|
+
# if (alpha != 255) `
|
309
|
+
# result.setAlpha(
|
310
|
+
# FloatValue
|
311
|
+
# .newBuilder()
|
312
|
+
# .setValue(((float) alpha) / denominator)
|
313
|
+
# .build());
|
314
|
+
# `
|
315
|
+
# return resultBuilder.build();
|
316
|
+
# `
|
317
|
+
# // ...
|
318
|
+
# Example (iOS / Obj-C):
|
319
|
+
# // ...
|
320
|
+
# static UIColor* fromProto(Color* protocolor) `
|
321
|
+
# float red = [protocolor red];
|
322
|
+
# float green = [protocolor green];
|
323
|
+
# float blue = [protocolor blue];
|
324
|
+
# FloatValue* alpha_wrapper = [protocolor alpha];
|
325
|
+
# float alpha = 1.0;
|
326
|
+
# if (alpha_wrapper != nil) `
|
327
|
+
# alpha = [alpha_wrapper value];
|
328
|
+
# `
|
329
|
+
# return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
|
330
|
+
# `
|
331
|
+
# static Color* toProto(UIColor* color) `
|
332
|
+
# CGFloat red, green, blue, alpha;
|
333
|
+
# if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
|
334
|
+
# return nil;
|
335
|
+
# `
|
336
|
+
# Color* result = [Color alloc] init];
|
337
|
+
# [result setRed:red];
|
338
|
+
# [result setGreen:green];
|
339
|
+
# [result setBlue:blue];
|
340
|
+
# if (alpha <= 0.9999) `
|
341
|
+
# [result setAlpha:floatWrapperWithValue(alpha)];
|
342
|
+
# `
|
343
|
+
# [result autorelease];
|
344
|
+
# return result;
|
345
|
+
# `
|
346
|
+
# // ...
|
347
|
+
# Example (JavaScript):
|
348
|
+
# // ...
|
349
|
+
# var protoToCssColor = function(rgb_color) `
|
350
|
+
# var redFrac = rgb_color.red || 0.0;
|
351
|
+
# var greenFrac = rgb_color.green || 0.0;
|
352
|
+
# var blueFrac = rgb_color.blue || 0.0;
|
353
|
+
# var red = Math.floor(redFrac * 255);
|
354
|
+
# var green = Math.floor(greenFrac * 255);
|
355
|
+
# var blue = Math.floor(blueFrac * 255);
|
356
|
+
# if (!('alpha' in rgb_color)) `
|
357
|
+
# return rgbToCssColor_(red, green, blue);
|
358
|
+
# `
|
359
|
+
# var alphaFrac = rgb_color.alpha.value || 0.0;
|
360
|
+
# var rgbParams = [red, green, blue].join(',');
|
361
|
+
# return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
|
362
|
+
# `;
|
363
|
+
# var rgbToCssColor_ = function(red, green, blue) `
|
364
|
+
# var rgbNumber = new Number((red << 16) | (green << 8) | blue);
|
365
|
+
# var hexString = rgbNumber.toString(16);
|
366
|
+
# var missingZeros = 6 - hexString.length;
|
367
|
+
# var resultBuilder = ['#'];
|
368
|
+
# for (var i = 0; i < missingZeros; i++) `
|
369
|
+
# resultBuilder.push('0');
|
370
|
+
# `
|
371
|
+
# resultBuilder.push(hexString);
|
372
|
+
# return resultBuilder.join('');
|
373
|
+
# `;
|
374
|
+
# // ...
|
375
|
+
class Color
|
376
|
+
include Google::Apis::Core::Hashable
|
377
|
+
|
378
|
+
# The fraction of this color that should be applied to the pixel. That is,
|
379
|
+
# the final pixel color is defined by the equation:
|
380
|
+
# pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
|
381
|
+
# This means that a value of 1.0 corresponds to a solid color, whereas
|
382
|
+
# a value of 0.0 corresponds to a completely transparent color. This
|
383
|
+
# uses a wrapper message rather than a simple float scalar so that it is
|
384
|
+
# possible to distinguish between a default value and the value being unset.
|
385
|
+
# If omitted, this color object is to be rendered as a solid color
|
386
|
+
# (as if the alpha value had been explicitly given with a value of 1.0).
|
387
|
+
# Corresponds to the JSON property `alpha`
|
388
|
+
# @return [Float]
|
389
|
+
attr_accessor :alpha
|
390
|
+
|
391
|
+
# The amount of blue in the color as a value in the interval [0, 1].
|
392
|
+
# Corresponds to the JSON property `blue`
|
393
|
+
# @return [Float]
|
394
|
+
attr_accessor :blue
|
395
|
+
|
396
|
+
# The amount of green in the color as a value in the interval [0, 1].
|
397
|
+
# Corresponds to the JSON property `green`
|
398
|
+
# @return [Float]
|
399
|
+
attr_accessor :green
|
400
|
+
|
401
|
+
# The amount of red in the color as a value in the interval [0, 1].
|
402
|
+
# Corresponds to the JSON property `red`
|
403
|
+
# @return [Float]
|
404
|
+
attr_accessor :red
|
405
|
+
|
406
|
+
def initialize(**args)
|
407
|
+
update!(**args)
|
408
|
+
end
|
409
|
+
|
410
|
+
# Update properties of this object
|
411
|
+
def update!(**args)
|
412
|
+
@alpha = args[:alpha] if args.key?(:alpha)
|
413
|
+
@blue = args[:blue] if args.key?(:blue)
|
414
|
+
@green = args[:green] if args.key?(:green)
|
415
|
+
@red = args[:red] if args.key?(:red)
|
416
|
+
end
|
417
|
+
end
|
418
|
+
|
276
419
|
# Color information consists of RGB channels, score, and the fraction of
|
277
420
|
# the image that the color occupies in the image.
|
278
|
-
class
|
421
|
+
class ColorInfo
|
279
422
|
include Google::Apis::Core::Hashable
|
280
423
|
|
281
424
|
# Represents a color in the RGBA color space. This representation is designed
|
@@ -378,7 +521,7 @@ module Google
|
|
378
521
|
# `;
|
379
522
|
# // ...
|
380
523
|
# Corresponds to the JSON property `color`
|
381
|
-
# @return [Google::Apis::VisionV1::
|
524
|
+
# @return [Google::Apis::VisionV1::Color]
|
382
525
|
attr_accessor :color
|
383
526
|
|
384
527
|
# The fraction of pixels the color occupies in the image.
|
@@ -405,12 +548,12 @@ module Google
|
|
405
548
|
end
|
406
549
|
|
407
550
|
# Single crop hint that is used to generate a new crop when serving an image.
|
408
|
-
class
|
551
|
+
class CropHint
|
409
552
|
include Google::Apis::Core::Hashable
|
410
553
|
|
411
554
|
# A bounding polygon for the detected image annotation.
|
412
555
|
# Corresponds to the JSON property `boundingPoly`
|
413
|
-
# @return [Google::Apis::VisionV1::
|
556
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
414
557
|
attr_accessor :bounding_poly
|
415
558
|
|
416
559
|
# Confidence of this being a salient region. Range [0, 1].
|
@@ -437,12 +580,12 @@ module Google
|
|
437
580
|
end
|
438
581
|
|
439
582
|
# Set of crop hints that are used to generate new crops when serving images.
|
440
|
-
class
|
583
|
+
class CropHintsAnnotation
|
441
584
|
include Google::Apis::Core::Hashable
|
442
585
|
|
443
586
|
# Crop hint results.
|
444
587
|
# Corresponds to the JSON property `cropHints`
|
445
|
-
# @return [Array<Google::Apis::VisionV1::
|
588
|
+
# @return [Array<Google::Apis::VisionV1::CropHint>]
|
446
589
|
attr_accessor :crop_hints
|
447
590
|
|
448
591
|
def initialize(**args)
|
@@ -456,7 +599,7 @@ module Google
|
|
456
599
|
end
|
457
600
|
|
458
601
|
# Parameters for crop hints annotation request.
|
459
|
-
class
|
602
|
+
class CropHintsParams
|
460
603
|
include Google::Apis::Core::Hashable
|
461
604
|
|
462
605
|
# Aspect ratios in floats, representing the ratio of the width to the height
|
@@ -479,13 +622,66 @@ module Google
|
|
479
622
|
end
|
480
623
|
end
|
481
624
|
|
625
|
+
# Detected start or end of a structural component.
|
626
|
+
class DetectedBreak
|
627
|
+
include Google::Apis::Core::Hashable
|
628
|
+
|
629
|
+
# True if break prepends the element.
|
630
|
+
# Corresponds to the JSON property `isPrefix`
|
631
|
+
# @return [Boolean]
|
632
|
+
attr_accessor :is_prefix
|
633
|
+
alias_method :is_prefix?, :is_prefix
|
634
|
+
|
635
|
+
# Detected break type.
|
636
|
+
# Corresponds to the JSON property `type`
|
637
|
+
# @return [String]
|
638
|
+
attr_accessor :type
|
639
|
+
|
640
|
+
def initialize(**args)
|
641
|
+
update!(**args)
|
642
|
+
end
|
643
|
+
|
644
|
+
# Update properties of this object
|
645
|
+
def update!(**args)
|
646
|
+
@is_prefix = args[:is_prefix] if args.key?(:is_prefix)
|
647
|
+
@type = args[:type] if args.key?(:type)
|
648
|
+
end
|
649
|
+
end
|
650
|
+
|
651
|
+
# Detected language for a structural component.
|
652
|
+
class DetectedLanguage
|
653
|
+
include Google::Apis::Core::Hashable
|
654
|
+
|
655
|
+
# Confidence of detected language. Range [0, 1].
|
656
|
+
# Corresponds to the JSON property `confidence`
|
657
|
+
# @return [Float]
|
658
|
+
attr_accessor :confidence
|
659
|
+
|
660
|
+
# The BCP-47 language code, such as "en-US" or "sr-Latn". For more
|
661
|
+
# information, see
|
662
|
+
# http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
|
663
|
+
# Corresponds to the JSON property `languageCode`
|
664
|
+
# @return [String]
|
665
|
+
attr_accessor :language_code
|
666
|
+
|
667
|
+
def initialize(**args)
|
668
|
+
update!(**args)
|
669
|
+
end
|
670
|
+
|
671
|
+
# Update properties of this object
|
672
|
+
def update!(**args)
|
673
|
+
@confidence = args[:confidence] if args.key?(:confidence)
|
674
|
+
@language_code = args[:language_code] if args.key?(:language_code)
|
675
|
+
end
|
676
|
+
end
|
677
|
+
|
482
678
|
# Set of dominant colors and their corresponding scores.
|
483
|
-
class
|
679
|
+
class DominantColorsAnnotation
|
484
680
|
include Google::Apis::Core::Hashable
|
485
681
|
|
486
682
|
# RGB color values with their score and pixel fraction.
|
487
683
|
# Corresponds to the JSON property `colors`
|
488
|
-
# @return [Array<Google::Apis::VisionV1::
|
684
|
+
# @return [Array<Google::Apis::VisionV1::ColorInfo>]
|
489
685
|
attr_accessor :colors
|
490
686
|
|
491
687
|
def initialize(**args)
|
@@ -499,12 +695,12 @@ module Google
|
|
499
695
|
end
|
500
696
|
|
501
697
|
# Set of detected entity features.
|
502
|
-
class
|
698
|
+
class EntityAnnotation
|
503
699
|
include Google::Apis::Core::Hashable
|
504
700
|
|
505
701
|
# A bounding polygon for the detected image annotation.
|
506
702
|
# Corresponds to the JSON property `boundingPoly`
|
507
|
-
# @return [Google::Apis::VisionV1::
|
703
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
508
704
|
attr_accessor :bounding_poly
|
509
705
|
|
510
706
|
# The accuracy of the entity detection in an image.
|
@@ -532,7 +728,7 @@ module Google
|
|
532
728
|
# may indicate the location of the place where the image was taken.
|
533
729
|
# Location information is usually present for landmarks.
|
534
730
|
# Corresponds to the JSON property `locations`
|
535
|
-
# @return [Array<Google::Apis::VisionV1::
|
731
|
+
# @return [Array<Google::Apis::VisionV1::LocationInfo>]
|
536
732
|
attr_accessor :locations
|
537
733
|
|
538
734
|
# Opaque entity ID. Some IDs may be available in
|
@@ -545,7 +741,7 @@ module Google
|
|
545
741
|
# Some entities may have optional user-supplied `Property` (name/value)
|
546
742
|
# fields, such a score or string that qualifies the entity.
|
547
743
|
# Corresponds to the JSON property `properties`
|
548
|
-
# @return [Array<Google::Apis::VisionV1::
|
744
|
+
# @return [Array<Google::Apis::VisionV1::Property>]
|
549
745
|
attr_accessor :properties
|
550
746
|
|
551
747
|
# Overall score of the result. Range [0, 1].
|
@@ -581,7 +777,7 @@ module Google
|
|
581
777
|
end
|
582
778
|
|
583
779
|
# A face annotation object contains the results of face detection.
|
584
|
-
class
|
780
|
+
class FaceAnnotation
|
585
781
|
include Google::Apis::Core::Hashable
|
586
782
|
|
587
783
|
# Anger likelihood.
|
@@ -596,7 +792,7 @@ module Google
|
|
596
792
|
|
597
793
|
# A bounding polygon for the detected image annotation.
|
598
794
|
# Corresponds to the JSON property `boundingPoly`
|
599
|
-
# @return [Google::Apis::VisionV1::
|
795
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
600
796
|
attr_accessor :bounding_poly
|
601
797
|
|
602
798
|
# Detection confidence. Range [0, 1].
|
@@ -606,7 +802,7 @@ module Google
|
|
606
802
|
|
607
803
|
# A bounding polygon for the detected image annotation.
|
608
804
|
# Corresponds to the JSON property `fdBoundingPoly`
|
609
|
-
# @return [Google::Apis::VisionV1::
|
805
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
610
806
|
attr_accessor :fd_bounding_poly
|
611
807
|
|
612
808
|
# Headwear likelihood.
|
@@ -626,7 +822,7 @@ module Google
|
|
626
822
|
|
627
823
|
# Detected face landmarks.
|
628
824
|
# Corresponds to the JSON property `landmarks`
|
629
|
-
# @return [Array<Google::Apis::VisionV1::
|
825
|
+
# @return [Array<Google::Apis::VisionV1::Landmark>]
|
630
826
|
attr_accessor :landmarks
|
631
827
|
|
632
828
|
# Yaw angle, which indicates the leftward/rightward angle that the face is
|
@@ -688,38 +884,11 @@ module Google
|
|
688
884
|
end
|
689
885
|
end
|
690
886
|
|
691
|
-
# A face-specific landmark (for example, a face feature).
|
692
|
-
class GoogleCloudVisionV1FaceAnnotationLandmark
|
693
|
-
include Google::Apis::Core::Hashable
|
694
|
-
|
695
|
-
# A 3D position in the image, used primarily for Face detection landmarks.
|
696
|
-
# A valid Position must have both x and y coordinates.
|
697
|
-
# The position coordinates are in the same scale as the original image.
|
698
|
-
# Corresponds to the JSON property `position`
|
699
|
-
# @return [Google::Apis::VisionV1::GoogleCloudVisionV1Position]
|
700
|
-
attr_accessor :position
|
701
|
-
|
702
|
-
# Face landmark type.
|
703
|
-
# Corresponds to the JSON property `type`
|
704
|
-
# @return [String]
|
705
|
-
attr_accessor :type
|
706
|
-
|
707
|
-
def initialize(**args)
|
708
|
-
update!(**args)
|
709
|
-
end
|
710
|
-
|
711
|
-
# Update properties of this object
|
712
|
-
def update!(**args)
|
713
|
-
@position = args[:position] if args.key?(:position)
|
714
|
-
@type = args[:type] if args.key?(:type)
|
715
|
-
end
|
716
|
-
end
|
717
|
-
|
718
887
|
# Users describe the type of Google Cloud Vision API tasks to perform over
|
719
888
|
# images by using *Feature*s. Each Feature indicates a type of image
|
720
889
|
# detection task to perform. Features encode the Cloud Vision API
|
721
890
|
# vertical to operate on and the number of top-scoring results to return.
|
722
|
-
class
|
891
|
+
class Feature
|
723
892
|
include Google::Apis::Core::Hashable
|
724
893
|
|
725
894
|
# Maximum number of results of this type.
|
@@ -744,7 +913,7 @@ module Google
|
|
744
913
|
end
|
745
914
|
|
746
915
|
# Client image to perform Google Cloud Vision API tasks over.
|
747
|
-
class
|
916
|
+
class Image
|
748
917
|
include Google::Apis::Core::Hashable
|
749
918
|
|
750
919
|
# Image content, represented as a stream of bytes.
|
@@ -757,7 +926,7 @@ module Google
|
|
757
926
|
|
758
927
|
# External image source (Google Cloud Storage image location).
|
759
928
|
# Corresponds to the JSON property `source`
|
760
|
-
# @return [Google::Apis::VisionV1::
|
929
|
+
# @return [Google::Apis::VisionV1::ImageSource]
|
761
930
|
attr_accessor :source
|
762
931
|
|
763
932
|
def initialize(**args)
|
@@ -772,12 +941,12 @@ module Google
|
|
772
941
|
end
|
773
942
|
|
774
943
|
# Image context and/or feature-specific parameters.
|
775
|
-
class
|
944
|
+
class ImageContext
|
776
945
|
include Google::Apis::Core::Hashable
|
777
946
|
|
778
947
|
# Parameters for crop hints annotation request.
|
779
948
|
# Corresponds to the JSON property `cropHintsParams`
|
780
|
-
# @return [Google::Apis::VisionV1::
|
949
|
+
# @return [Google::Apis::VisionV1::CropHintsParams]
|
781
950
|
attr_accessor :crop_hints_params
|
782
951
|
|
783
952
|
# List of languages to use for TEXT_DETECTION. In most cases, an empty value
|
@@ -794,7 +963,7 @@ module Google
|
|
794
963
|
|
795
964
|
# Rectangle determined by min and max `LatLng` pairs.
|
796
965
|
# Corresponds to the JSON property `latLongRect`
|
797
|
-
# @return [Google::Apis::VisionV1::
|
966
|
+
# @return [Google::Apis::VisionV1::LatLongRect]
|
798
967
|
attr_accessor :lat_long_rect
|
799
968
|
|
800
969
|
def initialize(**args)
|
@@ -810,12 +979,12 @@ module Google
|
|
810
979
|
end
|
811
980
|
|
812
981
|
# Stores image properties, such as dominant colors.
|
813
|
-
class
|
982
|
+
class ImageProperties
|
814
983
|
include Google::Apis::Core::Hashable
|
815
984
|
|
816
985
|
# Set of dominant colors and their corresponding scores.
|
817
986
|
# Corresponds to the JSON property `dominantColors`
|
818
|
-
# @return [Google::Apis::VisionV1::
|
987
|
+
# @return [Google::Apis::VisionV1::DominantColorsAnnotation]
|
819
988
|
attr_accessor :dominant_colors
|
820
989
|
|
821
990
|
def initialize(**args)
|
@@ -829,7 +998,7 @@ module Google
|
|
829
998
|
end
|
830
999
|
|
831
1000
|
# External image source (Google Cloud Storage image location).
|
832
|
-
class
|
1001
|
+
class ImageSource
|
833
1002
|
include Google::Apis::Core::Hashable
|
834
1003
|
|
835
1004
|
# NOTE: For new code `image_uri` below is preferred.
|
@@ -867,27 +1036,21 @@ module Google
|
|
867
1036
|
end
|
868
1037
|
end
|
869
1038
|
|
870
|
-
#
|
871
|
-
class
|
1039
|
+
# A face-specific landmark (for example, a face feature).
|
1040
|
+
class Landmark
|
872
1041
|
include Google::Apis::Core::Hashable
|
873
1042
|
|
874
|
-
#
|
875
|
-
#
|
876
|
-
#
|
877
|
-
#
|
878
|
-
#
|
879
|
-
|
880
|
-
# @return [Google::Apis::VisionV1::GoogleTypeLatLng]
|
881
|
-
attr_accessor :max_lat_lng
|
1043
|
+
# A 3D position in the image, used primarily for Face detection landmarks.
|
1044
|
+
# A valid Position must have both x and y coordinates.
|
1045
|
+
# The position coordinates are in the same scale as the original image.
|
1046
|
+
# Corresponds to the JSON property `position`
|
1047
|
+
# @return [Google::Apis::VisionV1::Position]
|
1048
|
+
attr_accessor :position
|
882
1049
|
|
883
|
-
#
|
884
|
-
#
|
885
|
-
#
|
886
|
-
|
887
|
-
# standard</a>. Values must be within normalized ranges.
|
888
|
-
# Corresponds to the JSON property `minLatLng`
|
889
|
-
# @return [Google::Apis::VisionV1::GoogleTypeLatLng]
|
890
|
-
attr_accessor :min_lat_lng
|
1050
|
+
# Face landmark type.
|
1051
|
+
# Corresponds to the JSON property `type`
|
1052
|
+
# @return [String]
|
1053
|
+
attr_accessor :type
|
891
1054
|
|
892
1055
|
def initialize(**args)
|
893
1056
|
update!(**args)
|
@@ -895,22 +1058,84 @@ module Google
|
|
895
1058
|
|
896
1059
|
# Update properties of this object
|
897
1060
|
def update!(**args)
|
898
|
-
@
|
899
|
-
@
|
1061
|
+
@position = args[:position] if args.key?(:position)
|
1062
|
+
@type = args[:type] if args.key?(:type)
|
900
1063
|
end
|
901
1064
|
end
|
902
1065
|
|
903
|
-
#
|
904
|
-
|
1066
|
+
# An object representing a latitude/longitude pair. This is expressed as a pair
|
1067
|
+
# of doubles representing degrees latitude and degrees longitude. Unless
|
1068
|
+
# specified otherwise, this must conform to the
|
1069
|
+
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
1070
|
+
# standard</a>. Values must be within normalized ranges.
|
1071
|
+
class LatLng
|
905
1072
|
include Google::Apis::Core::Hashable
|
906
1073
|
|
907
|
-
#
|
908
|
-
#
|
909
|
-
#
|
1074
|
+
# The latitude in degrees. It must be in the range [-90.0, +90.0].
|
1075
|
+
# Corresponds to the JSON property `latitude`
|
1076
|
+
# @return [Float]
|
1077
|
+
attr_accessor :latitude
|
1078
|
+
|
1079
|
+
# The longitude in degrees. It must be in the range [-180.0, +180.0].
|
1080
|
+
# Corresponds to the JSON property `longitude`
|
1081
|
+
# @return [Float]
|
1082
|
+
attr_accessor :longitude
|
1083
|
+
|
1084
|
+
def initialize(**args)
|
1085
|
+
update!(**args)
|
1086
|
+
end
|
1087
|
+
|
1088
|
+
# Update properties of this object
|
1089
|
+
def update!(**args)
|
1090
|
+
@latitude = args[:latitude] if args.key?(:latitude)
|
1091
|
+
@longitude = args[:longitude] if args.key?(:longitude)
|
1092
|
+
end
|
1093
|
+
end
|
1094
|
+
|
1095
|
+
# Rectangle determined by min and max `LatLng` pairs.
|
1096
|
+
class LatLongRect
|
1097
|
+
include Google::Apis::Core::Hashable
|
1098
|
+
|
1099
|
+
# An object representing a latitude/longitude pair. This is expressed as a pair
|
1100
|
+
# of doubles representing degrees latitude and degrees longitude. Unless
|
1101
|
+
# specified otherwise, this must conform to the
|
1102
|
+
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
1103
|
+
# standard</a>. Values must be within normalized ranges.
|
1104
|
+
# Corresponds to the JSON property `maxLatLng`
|
1105
|
+
# @return [Google::Apis::VisionV1::LatLng]
|
1106
|
+
attr_accessor :max_lat_lng
|
1107
|
+
|
1108
|
+
# An object representing a latitude/longitude pair. This is expressed as a pair
|
1109
|
+
# of doubles representing degrees latitude and degrees longitude. Unless
|
1110
|
+
# specified otherwise, this must conform to the
|
1111
|
+
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
1112
|
+
# standard</a>. Values must be within normalized ranges.
|
1113
|
+
# Corresponds to the JSON property `minLatLng`
|
1114
|
+
# @return [Google::Apis::VisionV1::LatLng]
|
1115
|
+
attr_accessor :min_lat_lng
|
1116
|
+
|
1117
|
+
def initialize(**args)
|
1118
|
+
update!(**args)
|
1119
|
+
end
|
1120
|
+
|
1121
|
+
# Update properties of this object
|
1122
|
+
def update!(**args)
|
1123
|
+
@max_lat_lng = args[:max_lat_lng] if args.key?(:max_lat_lng)
|
1124
|
+
@min_lat_lng = args[:min_lat_lng] if args.key?(:min_lat_lng)
|
1125
|
+
end
|
1126
|
+
end
|
1127
|
+
|
1128
|
+
# Detected entity location information.
|
1129
|
+
class LocationInfo
|
1130
|
+
include Google::Apis::Core::Hashable
|
1131
|
+
|
1132
|
+
# An object representing a latitude/longitude pair. This is expressed as a pair
|
1133
|
+
# of doubles representing degrees latitude and degrees longitude. Unless
|
1134
|
+
# specified otherwise, this must conform to the
|
910
1135
|
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
911
1136
|
# standard</a>. Values must be within normalized ranges.
|
912
1137
|
# Corresponds to the JSON property `latLng`
|
913
|
-
# @return [Google::Apis::VisionV1::
|
1138
|
+
# @return [Google::Apis::VisionV1::LatLng]
|
914
1139
|
attr_accessor :lat_lng
|
915
1140
|
|
916
1141
|
def initialize(**args)
|
@@ -924,12 +1149,12 @@ module Google
|
|
924
1149
|
end
|
925
1150
|
|
926
1151
|
# Detected page from OCR.
|
927
|
-
class
|
1152
|
+
class Page
|
928
1153
|
include Google::Apis::Core::Hashable
|
929
1154
|
|
930
1155
|
# List of blocks of text, images etc on this page.
|
931
1156
|
# Corresponds to the JSON property `blocks`
|
932
|
-
# @return [Array<Google::Apis::VisionV1::
|
1157
|
+
# @return [Array<Google::Apis::VisionV1::Block>]
|
933
1158
|
attr_accessor :blocks
|
934
1159
|
|
935
1160
|
# Page height in pixels.
|
@@ -939,7 +1164,7 @@ module Google
|
|
939
1164
|
|
940
1165
|
# Additional information detected on the structural component.
|
941
1166
|
# Corresponds to the JSON property `property`
|
942
|
-
# @return [Google::Apis::VisionV1::
|
1167
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
943
1168
|
attr_accessor :property
|
944
1169
|
|
945
1170
|
# Page width in pixels.
|
@@ -961,22 +1186,22 @@ module Google
|
|
961
1186
|
end
|
962
1187
|
|
963
1188
|
# Structural unit of text representing a number of words in certain order.
|
964
|
-
class
|
1189
|
+
class Paragraph
|
965
1190
|
include Google::Apis::Core::Hashable
|
966
1191
|
|
967
1192
|
# A bounding polygon for the detected image annotation.
|
968
1193
|
# Corresponds to the JSON property `boundingBox`
|
969
|
-
# @return [Google::Apis::VisionV1::
|
1194
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
970
1195
|
attr_accessor :bounding_box
|
971
1196
|
|
972
1197
|
# Additional information detected on the structural component.
|
973
1198
|
# Corresponds to the JSON property `property`
|
974
|
-
# @return [Google::Apis::VisionV1::
|
1199
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
975
1200
|
attr_accessor :property
|
976
1201
|
|
977
1202
|
# List of words in this paragraph.
|
978
1203
|
# Corresponds to the JSON property `words`
|
979
|
-
# @return [Array<Google::Apis::VisionV1::
|
1204
|
+
# @return [Array<Google::Apis::VisionV1::Word>]
|
980
1205
|
attr_accessor :words
|
981
1206
|
|
982
1207
|
def initialize(**args)
|
@@ -994,7 +1219,7 @@ module Google
|
|
994
1219
|
# A 3D position in the image, used primarily for Face detection landmarks.
|
995
1220
|
# A valid Position must have both x and y coordinates.
|
996
1221
|
# The position coordinates are in the same scale as the original image.
|
997
|
-
class
|
1222
|
+
class Position
|
998
1223
|
include Google::Apis::Core::Hashable
|
999
1224
|
|
1000
1225
|
# X coordinate.
|
@@ -1025,7 +1250,7 @@ module Google
|
|
1025
1250
|
end
|
1026
1251
|
|
1027
1252
|
# A `Property` consists of a user-supplied name/value pair.
|
1028
|
-
class
|
1253
|
+
class Property
|
1029
1254
|
include Google::Apis::Core::Hashable
|
1030
1255
|
|
1031
1256
|
# Name of the property.
|
@@ -1058,7 +1283,7 @@ module Google
|
|
1058
1283
|
# Set of features pertaining to the image, computed by computer vision
|
1059
1284
|
# methods over safe-search verticals (for example, adult, spoof, medical,
|
1060
1285
|
# violence).
|
1061
|
-
class
|
1286
|
+
class SafeSearchAnnotation
|
1062
1287
|
include Google::Apis::Core::Hashable
|
1063
1288
|
|
1064
1289
|
# Represents the adult content likelihood for the image. Adult content may
|
@@ -1098,18 +1323,90 @@ module Google
|
|
1098
1323
|
end
|
1099
1324
|
end
|
1100
1325
|
|
1326
|
+
# The `Status` type defines a logical error model that is suitable for different
|
1327
|
+
# programming environments, including REST APIs and RPC APIs. It is used by
|
1328
|
+
# [gRPC](https://github.com/grpc). The error model is designed to be:
|
1329
|
+
# - Simple to use and understand for most users
|
1330
|
+
# - Flexible enough to meet unexpected needs
|
1331
|
+
# # Overview
|
1332
|
+
# The `Status` message contains three pieces of data: error code, error message,
|
1333
|
+
# and error details. The error code should be an enum value of
|
1334
|
+
# google.rpc.Code, but it may accept additional error codes if needed. The
|
1335
|
+
# error message should be a developer-facing English message that helps
|
1336
|
+
# developers *understand* and *resolve* the error. If a localized user-facing
|
1337
|
+
# error message is needed, put the localized message in the error details or
|
1338
|
+
# localize it in the client. The optional error details may contain arbitrary
|
1339
|
+
# information about the error. There is a predefined set of error detail types
|
1340
|
+
# in the package `google.rpc` that can be used for common error conditions.
|
1341
|
+
# # Language mapping
|
1342
|
+
# The `Status` message is the logical representation of the error model, but it
|
1343
|
+
# is not necessarily the actual wire format. When the `Status` message is
|
1344
|
+
# exposed in different client libraries and different wire protocols, it can be
|
1345
|
+
# mapped differently. For example, it will likely be mapped to some exceptions
|
1346
|
+
# in Java, but more likely mapped to some error codes in C.
|
1347
|
+
# # Other uses
|
1348
|
+
# The error model and the `Status` message can be used in a variety of
|
1349
|
+
# environments, either with or without APIs, to provide a
|
1350
|
+
# consistent developer experience across different environments.
|
1351
|
+
# Example uses of this error model include:
|
1352
|
+
# - Partial errors. If a service needs to return partial errors to the client,
|
1353
|
+
# it may embed the `Status` in the normal response to indicate the partial
|
1354
|
+
# errors.
|
1355
|
+
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
1356
|
+
# have a `Status` message for error reporting.
|
1357
|
+
# - Batch operations. If a client uses batch request and batch response, the
|
1358
|
+
# `Status` message should be used directly inside batch response, one for
|
1359
|
+
# each error sub-response.
|
1360
|
+
# - Asynchronous operations. If an API call embeds asynchronous operation
|
1361
|
+
# results in its response, the status of those operations should be
|
1362
|
+
# represented directly using the `Status` message.
|
1363
|
+
# - Logging. If some API errors are stored in logs, the message `Status` could
|
1364
|
+
# be used directly after any stripping needed for security/privacy reasons.
|
1365
|
+
class Status
|
1366
|
+
include Google::Apis::Core::Hashable
|
1367
|
+
|
1368
|
+
# The status code, which should be an enum value of google.rpc.Code.
|
1369
|
+
# Corresponds to the JSON property `code`
|
1370
|
+
# @return [Fixnum]
|
1371
|
+
attr_accessor :code
|
1372
|
+
|
1373
|
+
# A list of messages that carry the error details. There is a common set of
|
1374
|
+
# message types for APIs to use.
|
1375
|
+
# Corresponds to the JSON property `details`
|
1376
|
+
# @return [Array<Hash<String,Object>>]
|
1377
|
+
attr_accessor :details
|
1378
|
+
|
1379
|
+
# A developer-facing error message, which should be in English. Any
|
1380
|
+
# user-facing error message should be localized and sent in the
|
1381
|
+
# google.rpc.Status.details field, or localized by the client.
|
1382
|
+
# Corresponds to the JSON property `message`
|
1383
|
+
# @return [String]
|
1384
|
+
attr_accessor :message
|
1385
|
+
|
1386
|
+
def initialize(**args)
|
1387
|
+
update!(**args)
|
1388
|
+
end
|
1389
|
+
|
1390
|
+
# Update properties of this object
|
1391
|
+
def update!(**args)
|
1392
|
+
@code = args[:code] if args.key?(:code)
|
1393
|
+
@details = args[:details] if args.key?(:details)
|
1394
|
+
@message = args[:message] if args.key?(:message)
|
1395
|
+
end
|
1396
|
+
end
|
1397
|
+
|
1101
1398
|
# A single symbol representation.
|
1102
|
-
class
|
1399
|
+
class Symbol
|
1103
1400
|
include Google::Apis::Core::Hashable
|
1104
1401
|
|
1105
1402
|
# A bounding polygon for the detected image annotation.
|
1106
1403
|
# Corresponds to the JSON property `boundingBox`
|
1107
|
-
# @return [Google::Apis::VisionV1::
|
1404
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
1108
1405
|
attr_accessor :bounding_box
|
1109
1406
|
|
1110
1407
|
# Additional information detected on the structural component.
|
1111
1408
|
# Corresponds to the JSON property `property`
|
1112
|
-
# @return [Google::Apis::VisionV1::
|
1409
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
1113
1410
|
attr_accessor :property
|
1114
1411
|
|
1115
1412
|
# The actual UTF-8 representation of the symbol.
|
@@ -1136,12 +1433,12 @@ module Google
|
|
1136
1433
|
# properties. Properties describe detected languages, breaks etc.. Please refer
|
1137
1434
|
# to the TextAnnotation.TextProperty message definition below for more
|
1138
1435
|
# detail.
|
1139
|
-
class
|
1436
|
+
class TextAnnotation
|
1140
1437
|
include Google::Apis::Core::Hashable
|
1141
1438
|
|
1142
1439
|
# List of pages detected by OCR.
|
1143
1440
|
# Corresponds to the JSON property `pages`
|
1144
|
-
# @return [Array<Google::Apis::VisionV1::
|
1441
|
+
# @return [Array<Google::Apis::VisionV1::Page>]
|
1145
1442
|
attr_accessor :pages
|
1146
1443
|
|
1147
1444
|
# UTF-8 text detected on the pages.
|
@@ -1160,71 +1457,18 @@ module Google
|
|
1160
1457
|
end
|
1161
1458
|
end
|
1162
1459
|
|
1163
|
-
# Detected start or end of a structural component.
|
1164
|
-
class GoogleCloudVisionV1TextAnnotationDetectedBreak
|
1165
|
-
include Google::Apis::Core::Hashable
|
1166
|
-
|
1167
|
-
# True if break prepends the element.
|
1168
|
-
# Corresponds to the JSON property `isPrefix`
|
1169
|
-
# @return [Boolean]
|
1170
|
-
attr_accessor :is_prefix
|
1171
|
-
alias_method :is_prefix?, :is_prefix
|
1172
|
-
|
1173
|
-
# Detected break type.
|
1174
|
-
# Corresponds to the JSON property `type`
|
1175
|
-
# @return [String]
|
1176
|
-
attr_accessor :type
|
1177
|
-
|
1178
|
-
def initialize(**args)
|
1179
|
-
update!(**args)
|
1180
|
-
end
|
1181
|
-
|
1182
|
-
# Update properties of this object
|
1183
|
-
def update!(**args)
|
1184
|
-
@is_prefix = args[:is_prefix] if args.key?(:is_prefix)
|
1185
|
-
@type = args[:type] if args.key?(:type)
|
1186
|
-
end
|
1187
|
-
end
|
1188
|
-
|
1189
|
-
# Detected language for a structural component.
|
1190
|
-
class GoogleCloudVisionV1TextAnnotationDetectedLanguage
|
1191
|
-
include Google::Apis::Core::Hashable
|
1192
|
-
|
1193
|
-
# Confidence of detected language. Range [0, 1].
|
1194
|
-
# Corresponds to the JSON property `confidence`
|
1195
|
-
# @return [Float]
|
1196
|
-
attr_accessor :confidence
|
1197
|
-
|
1198
|
-
# The BCP-47 language code, such as "en-US" or "sr-Latn". For more
|
1199
|
-
# information, see
|
1200
|
-
# http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
|
1201
|
-
# Corresponds to the JSON property `languageCode`
|
1202
|
-
# @return [String]
|
1203
|
-
attr_accessor :language_code
|
1204
|
-
|
1205
|
-
def initialize(**args)
|
1206
|
-
update!(**args)
|
1207
|
-
end
|
1208
|
-
|
1209
|
-
# Update properties of this object
|
1210
|
-
def update!(**args)
|
1211
|
-
@confidence = args[:confidence] if args.key?(:confidence)
|
1212
|
-
@language_code = args[:language_code] if args.key?(:language_code)
|
1213
|
-
end
|
1214
|
-
end
|
1215
|
-
|
1216
1460
|
# Additional information detected on the structural component.
|
1217
|
-
class
|
1461
|
+
class TextProperty
|
1218
1462
|
include Google::Apis::Core::Hashable
|
1219
1463
|
|
1220
1464
|
# Detected start or end of a structural component.
|
1221
1465
|
# Corresponds to the JSON property `detectedBreak`
|
1222
|
-
# @return [Google::Apis::VisionV1::
|
1466
|
+
# @return [Google::Apis::VisionV1::DetectedBreak]
|
1223
1467
|
attr_accessor :detected_break
|
1224
1468
|
|
1225
1469
|
# A list of detected languages together with confidence.
|
1226
1470
|
# Corresponds to the JSON property `detectedLanguages`
|
1227
|
-
# @return [Array<Google::Apis::VisionV1::
|
1471
|
+
# @return [Array<Google::Apis::VisionV1::DetectedLanguage>]
|
1228
1472
|
attr_accessor :detected_languages
|
1229
1473
|
|
1230
1474
|
def initialize(**args)
|
@@ -1240,7 +1484,7 @@ module Google
|
|
1240
1484
|
|
1241
1485
|
# A vertex represents a 2D point in the image.
|
1242
1486
|
# NOTE: the vertex coordinates are in the same scale as the original image.
|
1243
|
-
class
|
1487
|
+
class Vertex
|
1244
1488
|
include Google::Apis::Core::Hashable
|
1245
1489
|
|
1246
1490
|
# X coordinate.
|
@@ -1265,35 +1509,35 @@ module Google
|
|
1265
1509
|
end
|
1266
1510
|
|
1267
1511
|
# Relevant information for the image from the Internet.
|
1268
|
-
class
|
1512
|
+
class WebDetection
|
1269
1513
|
include Google::Apis::Core::Hashable
|
1270
1514
|
|
1271
1515
|
# Fully matching images from the Internet.
|
1272
1516
|
# Can include resized copies of the query image.
|
1273
1517
|
# Corresponds to the JSON property `fullMatchingImages`
|
1274
|
-
# @return [Array<Google::Apis::VisionV1::
|
1518
|
+
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
1275
1519
|
attr_accessor :full_matching_images
|
1276
1520
|
|
1277
1521
|
# Web pages containing the matching images from the Internet.
|
1278
1522
|
# Corresponds to the JSON property `pagesWithMatchingImages`
|
1279
|
-
# @return [Array<Google::Apis::VisionV1::
|
1523
|
+
# @return [Array<Google::Apis::VisionV1::WebPage>]
|
1280
1524
|
attr_accessor :pages_with_matching_images
|
1281
1525
|
|
1282
1526
|
# Partial matching images from the Internet.
|
1283
1527
|
# Those images are similar enough to share some key-point features. For
|
1284
1528
|
# example an original image will likely have partial matching for its crops.
|
1285
1529
|
# Corresponds to the JSON property `partialMatchingImages`
|
1286
|
-
# @return [Array<Google::Apis::VisionV1::
|
1530
|
+
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
1287
1531
|
attr_accessor :partial_matching_images
|
1288
1532
|
|
1289
1533
|
# The visually similar image results.
|
1290
1534
|
# Corresponds to the JSON property `visuallySimilarImages`
|
1291
|
-
# @return [Array<Google::Apis::VisionV1::
|
1535
|
+
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
1292
1536
|
attr_accessor :visually_similar_images
|
1293
1537
|
|
1294
1538
|
# Deduced entities from similar images on the Internet.
|
1295
1539
|
# Corresponds to the JSON property `webEntities`
|
1296
|
-
# @return [Array<Google::Apis::VisionV1::
|
1540
|
+
# @return [Array<Google::Apis::VisionV1::WebEntity>]
|
1297
1541
|
attr_accessor :web_entities
|
1298
1542
|
|
1299
1543
|
def initialize(**args)
|
@@ -1311,7 +1555,7 @@ module Google
|
|
1311
1555
|
end
|
1312
1556
|
|
1313
1557
|
# Entity deduced from similar images on the Internet.
|
1314
|
-
class
|
1558
|
+
class WebEntity
|
1315
1559
|
include Google::Apis::Core::Hashable
|
1316
1560
|
|
1317
1561
|
# Canonical description of the entity, in English.
|
@@ -1343,7 +1587,7 @@ module Google
|
|
1343
1587
|
end
|
1344
1588
|
|
1345
1589
|
# Metadata for online images.
|
1346
|
-
class
|
1590
|
+
class WebImage
|
1347
1591
|
include Google::Apis::Core::Hashable
|
1348
1592
|
|
1349
1593
|
# (Deprecated) Overall relevancy score for the image.
|
@@ -1368,7 +1612,7 @@ module Google
|
|
1368
1612
|
end
|
1369
1613
|
|
1370
1614
|
# Metadata for web pages.
|
1371
|
-
class
|
1615
|
+
class WebPage
|
1372
1616
|
include Google::Apis::Core::Hashable
|
1373
1617
|
|
1374
1618
|
# (Deprecated) Overall relevancy score for the web page.
|
@@ -1393,23 +1637,23 @@ module Google
|
|
1393
1637
|
end
|
1394
1638
|
|
1395
1639
|
# A word representation.
|
1396
|
-
class
|
1640
|
+
class Word
|
1397
1641
|
include Google::Apis::Core::Hashable
|
1398
1642
|
|
1399
1643
|
# A bounding polygon for the detected image annotation.
|
1400
1644
|
# Corresponds to the JSON property `boundingBox`
|
1401
|
-
# @return [Google::Apis::VisionV1::
|
1645
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
1402
1646
|
attr_accessor :bounding_box
|
1403
1647
|
|
1404
1648
|
# Additional information detected on the structural component.
|
1405
1649
|
# Corresponds to the JSON property `property`
|
1406
|
-
# @return [Google::Apis::VisionV1::
|
1650
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
1407
1651
|
attr_accessor :property
|
1408
1652
|
|
1409
1653
|
# List of symbols in the word.
|
1410
1654
|
# The order of the symbols follows the natural reading order.
|
1411
1655
|
# Corresponds to the JSON property `symbols`
|
1412
|
-
# @return [Array<Google::Apis::VisionV1::
|
1656
|
+
# @return [Array<Google::Apis::VisionV1::Symbol>]
|
1413
1657
|
attr_accessor :symbols
|
1414
1658
|
|
1415
1659
|
def initialize(**args)
|
@@ -1423,250 +1667,6 @@ module Google
|
|
1423
1667
|
@symbols = args[:symbols] if args.key?(:symbols)
|
1424
1668
|
end
|
1425
1669
|
end
|
1426
|
-
|
1427
|
-
# The `Status` type defines a logical error model that is suitable for different
|
1428
|
-
# programming environments, including REST APIs and RPC APIs. It is used by
|
1429
|
-
# [gRPC](https://github.com/grpc). The error model is designed to be:
|
1430
|
-
# - Simple to use and understand for most users
|
1431
|
-
# - Flexible enough to meet unexpected needs
|
1432
|
-
# # Overview
|
1433
|
-
# The `Status` message contains three pieces of data: error code, error message,
|
1434
|
-
# and error details. The error code should be an enum value of
|
1435
|
-
# google.rpc.Code, but it may accept additional error codes if needed. The
|
1436
|
-
# error message should be a developer-facing English message that helps
|
1437
|
-
# developers *understand* and *resolve* the error. If a localized user-facing
|
1438
|
-
# error message is needed, put the localized message in the error details or
|
1439
|
-
# localize it in the client. The optional error details may contain arbitrary
|
1440
|
-
# information about the error. There is a predefined set of error detail types
|
1441
|
-
# in the package `google.rpc` that can be used for common error conditions.
|
1442
|
-
# # Language mapping
|
1443
|
-
# The `Status` message is the logical representation of the error model, but it
|
1444
|
-
# is not necessarily the actual wire format. When the `Status` message is
|
1445
|
-
# exposed in different client libraries and different wire protocols, it can be
|
1446
|
-
# mapped differently. For example, it will likely be mapped to some exceptions
|
1447
|
-
# in Java, but more likely mapped to some error codes in C.
|
1448
|
-
# # Other uses
|
1449
|
-
# The error model and the `Status` message can be used in a variety of
|
1450
|
-
# environments, either with or without APIs, to provide a
|
1451
|
-
# consistent developer experience across different environments.
|
1452
|
-
# Example uses of this error model include:
|
1453
|
-
# - Partial errors. If a service needs to return partial errors to the client,
|
1454
|
-
# it may embed the `Status` in the normal response to indicate the partial
|
1455
|
-
# errors.
|
1456
|
-
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
1457
|
-
# have a `Status` message for error reporting.
|
1458
|
-
# - Batch operations. If a client uses batch request and batch response, the
|
1459
|
-
# `Status` message should be used directly inside batch response, one for
|
1460
|
-
# each error sub-response.
|
1461
|
-
# - Asynchronous operations. If an API call embeds asynchronous operation
|
1462
|
-
# results in its response, the status of those operations should be
|
1463
|
-
# represented directly using the `Status` message.
|
1464
|
-
# - Logging. If some API errors are stored in logs, the message `Status` could
|
1465
|
-
# be used directly after any stripping needed for security/privacy reasons.
|
1466
|
-
class GoogleRpcStatus
|
1467
|
-
include Google::Apis::Core::Hashable
|
1468
|
-
|
1469
|
-
# The status code, which should be an enum value of google.rpc.Code.
|
1470
|
-
# Corresponds to the JSON property `code`
|
1471
|
-
# @return [Fixnum]
|
1472
|
-
attr_accessor :code
|
1473
|
-
|
1474
|
-
# A list of messages that carry the error details. There is a common set of
|
1475
|
-
# message types for APIs to use.
|
1476
|
-
# Corresponds to the JSON property `details`
|
1477
|
-
# @return [Array<Hash<String,Object>>]
|
1478
|
-
attr_accessor :details
|
1479
|
-
|
1480
|
-
# A developer-facing error message, which should be in English. Any
|
1481
|
-
# user-facing error message should be localized and sent in the
|
1482
|
-
# google.rpc.Status.details field, or localized by the client.
|
1483
|
-
# Corresponds to the JSON property `message`
|
1484
|
-
# @return [String]
|
1485
|
-
attr_accessor :message
|
1486
|
-
|
1487
|
-
def initialize(**args)
|
1488
|
-
update!(**args)
|
1489
|
-
end
|
1490
|
-
|
1491
|
-
# Update properties of this object
|
1492
|
-
def update!(**args)
|
1493
|
-
@code = args[:code] if args.key?(:code)
|
1494
|
-
@details = args[:details] if args.key?(:details)
|
1495
|
-
@message = args[:message] if args.key?(:message)
|
1496
|
-
end
|
1497
|
-
end
|
1498
|
-
|
1499
|
-
# Represents a color in the RGBA color space. This representation is designed
|
1500
|
-
# for simplicity of conversion to/from color representations in various
|
1501
|
-
# languages over compactness; for example, the fields of this representation
|
1502
|
-
# can be trivially provided to the constructor of "java.awt.Color" in Java; it
|
1503
|
-
# can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
|
1504
|
-
# method in iOS; and, with just a little work, it can be easily formatted into
|
1505
|
-
# a CSS "rgba()" string in JavaScript, as well. Here are some examples:
|
1506
|
-
# Example (Java):
|
1507
|
-
# import com.google.type.Color;
|
1508
|
-
# // ...
|
1509
|
-
# public static java.awt.Color fromProto(Color protocolor) `
|
1510
|
-
# float alpha = protocolor.hasAlpha()
|
1511
|
-
# ? protocolor.getAlpha().getValue()
|
1512
|
-
# : 1.0;
|
1513
|
-
# return new java.awt.Color(
|
1514
|
-
# protocolor.getRed(),
|
1515
|
-
# protocolor.getGreen(),
|
1516
|
-
# protocolor.getBlue(),
|
1517
|
-
# alpha);
|
1518
|
-
# `
|
1519
|
-
# public static Color toProto(java.awt.Color color) `
|
1520
|
-
# float red = (float) color.getRed();
|
1521
|
-
# float green = (float) color.getGreen();
|
1522
|
-
# float blue = (float) color.getBlue();
|
1523
|
-
# float denominator = 255.0;
|
1524
|
-
# Color.Builder resultBuilder =
|
1525
|
-
# Color
|
1526
|
-
# .newBuilder()
|
1527
|
-
# .setRed(red / denominator)
|
1528
|
-
# .setGreen(green / denominator)
|
1529
|
-
# .setBlue(blue / denominator);
|
1530
|
-
# int alpha = color.getAlpha();
|
1531
|
-
# if (alpha != 255) `
|
1532
|
-
# result.setAlpha(
|
1533
|
-
# FloatValue
|
1534
|
-
# .newBuilder()
|
1535
|
-
# .setValue(((float) alpha) / denominator)
|
1536
|
-
# .build());
|
1537
|
-
# `
|
1538
|
-
# return resultBuilder.build();
|
1539
|
-
# `
|
1540
|
-
# // ...
|
1541
|
-
# Example (iOS / Obj-C):
|
1542
|
-
# // ...
|
1543
|
-
# static UIColor* fromProto(Color* protocolor) `
|
1544
|
-
# float red = [protocolor red];
|
1545
|
-
# float green = [protocolor green];
|
1546
|
-
# float blue = [protocolor blue];
|
1547
|
-
# FloatValue* alpha_wrapper = [protocolor alpha];
|
1548
|
-
# float alpha = 1.0;
|
1549
|
-
# if (alpha_wrapper != nil) `
|
1550
|
-
# alpha = [alpha_wrapper value];
|
1551
|
-
# `
|
1552
|
-
# return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
|
1553
|
-
# `
|
1554
|
-
# static Color* toProto(UIColor* color) `
|
1555
|
-
# CGFloat red, green, blue, alpha;
|
1556
|
-
# if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
|
1557
|
-
# return nil;
|
1558
|
-
# `
|
1559
|
-
# Color* result = [Color alloc] init];
|
1560
|
-
# [result setRed:red];
|
1561
|
-
# [result setGreen:green];
|
1562
|
-
# [result setBlue:blue];
|
1563
|
-
# if (alpha <= 0.9999) `
|
1564
|
-
# [result setAlpha:floatWrapperWithValue(alpha)];
|
1565
|
-
# `
|
1566
|
-
# [result autorelease];
|
1567
|
-
# return result;
|
1568
|
-
# `
|
1569
|
-
# // ...
|
1570
|
-
# Example (JavaScript):
|
1571
|
-
# // ...
|
1572
|
-
# var protoToCssColor = function(rgb_color) `
|
1573
|
-
# var redFrac = rgb_color.red || 0.0;
|
1574
|
-
# var greenFrac = rgb_color.green || 0.0;
|
1575
|
-
# var blueFrac = rgb_color.blue || 0.0;
|
1576
|
-
# var red = Math.floor(redFrac * 255);
|
1577
|
-
# var green = Math.floor(greenFrac * 255);
|
1578
|
-
# var blue = Math.floor(blueFrac * 255);
|
1579
|
-
# if (!('alpha' in rgb_color)) `
|
1580
|
-
# return rgbToCssColor_(red, green, blue);
|
1581
|
-
# `
|
1582
|
-
# var alphaFrac = rgb_color.alpha.value || 0.0;
|
1583
|
-
# var rgbParams = [red, green, blue].join(',');
|
1584
|
-
# return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
|
1585
|
-
# `;
|
1586
|
-
# var rgbToCssColor_ = function(red, green, blue) `
|
1587
|
-
# var rgbNumber = new Number((red << 16) | (green << 8) | blue);
|
1588
|
-
# var hexString = rgbNumber.toString(16);
|
1589
|
-
# var missingZeros = 6 - hexString.length;
|
1590
|
-
# var resultBuilder = ['#'];
|
1591
|
-
# for (var i = 0; i < missingZeros; i++) `
|
1592
|
-
# resultBuilder.push('0');
|
1593
|
-
# `
|
1594
|
-
# resultBuilder.push(hexString);
|
1595
|
-
# return resultBuilder.join('');
|
1596
|
-
# `;
|
1597
|
-
# // ...
|
1598
|
-
class GoogleTypeColor
|
1599
|
-
include Google::Apis::Core::Hashable
|
1600
|
-
|
1601
|
-
# The fraction of this color that should be applied to the pixel. That is,
|
1602
|
-
# the final pixel color is defined by the equation:
|
1603
|
-
# pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
|
1604
|
-
# This means that a value of 1.0 corresponds to a solid color, whereas
|
1605
|
-
# a value of 0.0 corresponds to a completely transparent color. This
|
1606
|
-
# uses a wrapper message rather than a simple float scalar so that it is
|
1607
|
-
# possible to distinguish between a default value and the value being unset.
|
1608
|
-
# If omitted, this color object is to be rendered as a solid color
|
1609
|
-
# (as if the alpha value had been explicitly given with a value of 1.0).
|
1610
|
-
# Corresponds to the JSON property `alpha`
|
1611
|
-
# @return [Float]
|
1612
|
-
attr_accessor :alpha
|
1613
|
-
|
1614
|
-
# The amount of blue in the color as a value in the interval [0, 1].
|
1615
|
-
# Corresponds to the JSON property `blue`
|
1616
|
-
# @return [Float]
|
1617
|
-
attr_accessor :blue
|
1618
|
-
|
1619
|
-
# The amount of green in the color as a value in the interval [0, 1].
|
1620
|
-
# Corresponds to the JSON property `green`
|
1621
|
-
# @return [Float]
|
1622
|
-
attr_accessor :green
|
1623
|
-
|
1624
|
-
# The amount of red in the color as a value in the interval [0, 1].
|
1625
|
-
# Corresponds to the JSON property `red`
|
1626
|
-
# @return [Float]
|
1627
|
-
attr_accessor :red
|
1628
|
-
|
1629
|
-
def initialize(**args)
|
1630
|
-
update!(**args)
|
1631
|
-
end
|
1632
|
-
|
1633
|
-
# Update properties of this object
|
1634
|
-
def update!(**args)
|
1635
|
-
@alpha = args[:alpha] if args.key?(:alpha)
|
1636
|
-
@blue = args[:blue] if args.key?(:blue)
|
1637
|
-
@green = args[:green] if args.key?(:green)
|
1638
|
-
@red = args[:red] if args.key?(:red)
|
1639
|
-
end
|
1640
|
-
end
|
1641
|
-
|
1642
|
-
# An object representing a latitude/longitude pair. This is expressed as a pair
|
1643
|
-
# of doubles representing degrees latitude and degrees longitude. Unless
|
1644
|
-
# specified otherwise, this must conform to the
|
1645
|
-
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
1646
|
-
# standard</a>. Values must be within normalized ranges.
|
1647
|
-
class GoogleTypeLatLng
|
1648
|
-
include Google::Apis::Core::Hashable
|
1649
|
-
|
1650
|
-
# The latitude in degrees. It must be in the range [-90.0, +90.0].
|
1651
|
-
# Corresponds to the JSON property `latitude`
|
1652
|
-
# @return [Float]
|
1653
|
-
attr_accessor :latitude
|
1654
|
-
|
1655
|
-
# The longitude in degrees. It must be in the range [-180.0, +180.0].
|
1656
|
-
# Corresponds to the JSON property `longitude`
|
1657
|
-
# @return [Float]
|
1658
|
-
attr_accessor :longitude
|
1659
|
-
|
1660
|
-
def initialize(**args)
|
1661
|
-
update!(**args)
|
1662
|
-
end
|
1663
|
-
|
1664
|
-
# Update properties of this object
|
1665
|
-
def update!(**args)
|
1666
|
-
@latitude = args[:latitude] if args.key?(:latitude)
|
1667
|
-
@longitude = args[:longitude] if args.key?(:longitude)
|
1668
|
-
end
|
1669
|
-
end
|
1670
1670
|
end
|
1671
1671
|
end
|
1672
1672
|
end
|