google-api-client 0.10.0 → 0.10.1

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