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