google-api-client 0.9.2 → 0.9.3

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 (182) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGELOG.md +9 -0
  4. data/Gemfile +1 -0
  5. data/README.md +2 -2
  6. data/api_names.yaml +19 -0
  7. data/api_names_out.yaml +843 -269
  8. data/bin/generate-api +18 -4
  9. data/generated/google/apis/adexchangebuyer_v1_4.rb +1 -1
  10. data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +249 -9
  11. data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +208 -1
  12. data/generated/google/apis/adexchangebuyer_v1_4/service.rb +68 -0
  13. data/generated/google/apis/adexchangeseller_v2_0/representations.rb +38 -0
  14. data/generated/google/apis/admin_datatransfer_v1.rb +2 -2
  15. data/generated/google/apis/admin_datatransfer_v1/representations.rb +12 -0
  16. data/generated/google/apis/admin_datatransfer_v1/service.rb +1 -1
  17. data/generated/google/apis/admin_directory_v1/representations.rb +118 -0
  18. data/generated/google/apis/admin_reports_v1/representations.rb +26 -0
  19. data/generated/google/apis/adsense_v1_4.rb +1 -1
  20. data/generated/google/apis/adsense_v1_4/classes.rb +0 -7
  21. data/generated/google/apis/adsense_v1_4/representations.rb +62 -1
  22. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  23. data/generated/google/apis/adsensehost_v4_1/representations.rb +40 -0
  24. data/generated/google/apis/analytics_v3.rb +1 -1
  25. data/generated/google/apis/analytics_v3/representations.rb +188 -0
  26. data/generated/google/apis/analytics_v3/service.rb +3 -3
  27. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  28. data/generated/google/apis/androidenterprise_v1/representations.rb +76 -0
  29. data/generated/google/apis/androidenterprise_v1/service.rb +6 -2
  30. data/generated/google/apis/androidpublisher_v2.rb +1 -1
  31. data/generated/google/apis/androidpublisher_v2/representations.rb +92 -0
  32. data/generated/google/apis/appengine_v1beta5.rb +1 -1
  33. data/generated/google/apis/appengine_v1beta5/classes.rb +22 -1
  34. data/generated/google/apis/appengine_v1beta5/representations.rb +69 -0
  35. data/generated/google/apis/appengine_v1beta5/service.rb +43 -0
  36. data/generated/google/apis/appsactivity_v1/representations.rb +22 -0
  37. data/generated/google/apis/appstate_v1.rb +1 -1
  38. data/generated/google/apis/appstate_v1/representations.rb +8 -0
  39. data/generated/google/apis/autoscaler_v1beta2/representations.rb +32 -0
  40. data/generated/google/apis/bigquery_v2.rb +1 -1
  41. data/generated/google/apis/bigquery_v2/classes.rb +31 -0
  42. data/generated/google/apis/bigquery_v2/representations.rb +98 -0
  43. data/generated/google/apis/blogger_v3/representations.rb +70 -0
  44. data/generated/google/apis/books_v1/representations.rb +196 -0
  45. data/generated/google/apis/calendar_v3.rb +1 -1
  46. data/generated/google/apis/calendar_v3/representations.rb +64 -0
  47. data/generated/google/apis/civicinfo_v2/representations.rb +40 -0
  48. data/generated/google/apis/classroom_v1/representations.rb +28 -0
  49. data/generated/google/apis/cloudbilling_v1/representations.rb +8 -0
  50. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  51. data/generated/google/apis/cloudbuild_v1/classes.rb +1 -1
  52. data/generated/google/apis/cloudbuild_v1/representations.rb +24 -0
  53. data/generated/google/apis/cloudbuild_v1/service.rb +2 -2
  54. data/generated/google/apis/clouddebugger_v2/representations.rb +54 -0
  55. data/generated/google/apis/cloudlatencytest_v2/representations.rb +14 -0
  56. data/generated/google/apis/cloudmonitoring_v2beta2.rb +1 -1
  57. data/generated/google/apis/cloudmonitoring_v2beta2/representations.rb +42 -0
  58. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
  59. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +15 -2
  60. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +38 -0
  61. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +4 -1
  62. data/generated/google/apis/cloudtrace_v1/representations.rb +10 -0
  63. data/generated/google/apis/clouduseraccounts_beta/representations.rb +38 -0
  64. data/generated/google/apis/compute_beta.rb +1 -1
  65. data/generated/google/apis/compute_beta/classes.rb +512 -0
  66. data/generated/google/apis/compute_beta/representations.rb +599 -0
  67. data/generated/google/apis/compute_beta/service.rb +415 -0
  68. data/generated/google/apis/compute_v1.rb +1 -1
  69. data/generated/google/apis/compute_v1/representations.rb +386 -0
  70. data/generated/google/apis/container_v1/representations.rb +20 -0
  71. data/generated/google/apis/content_v2/representations.rb +296 -0
  72. data/generated/google/apis/coordinate_v1/representations.rb +36 -0
  73. data/generated/google/apis/customsearch_v1/representations.rb +26 -0
  74. data/generated/google/apis/dataproc_v1.rb +1 -1
  75. data/generated/google/apis/dataproc_v1/classes.rb +1415 -0
  76. data/generated/google/apis/dataproc_v1/representations.rb +569 -0
  77. data/generated/google/apis/dataproc_v1/service.rb +581 -4
  78. data/generated/google/apis/datastore_v1beta2/representations.rb +68 -0
  79. data/generated/google/apis/deploymentmanager_v2/representations.rb +58 -0
  80. data/generated/google/apis/dfareporting_v2_3/representations.rb +386 -0
  81. data/generated/google/apis/discovery_v1/representations.rb +40 -0
  82. data/generated/google/apis/dns_v1.rb +1 -1
  83. data/generated/google/apis/dns_v1/classes.rb +2 -2
  84. data/generated/google/apis/dns_v1/representations.rb +16 -0
  85. data/generated/google/apis/doubleclickbidmanager_v1/representations.rb +42 -0
  86. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  87. data/generated/google/apis/doubleclicksearch_v2/representations.rb +34 -0
  88. data/generated/google/apis/drive_v2.rb +1 -1
  89. data/generated/google/apis/drive_v2/classes.rb +7 -0
  90. data/generated/google/apis/drive_v2/representations.rb +83 -0
  91. data/generated/google/apis/drive_v3.rb +1 -1
  92. data/generated/google/apis/drive_v3/classes.rb +7 -0
  93. data/generated/google/apis/drive_v3/representations.rb +51 -0
  94. data/generated/google/apis/fitness_v1/representations.rb +40 -0
  95. data/generated/google/apis/fusiontables_v2.rb +1 -1
  96. data/generated/google/apis/fusiontables_v2/representations.rb +48 -0
  97. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  98. data/generated/google/apis/games_configuration_v1configuration/representations.rb +22 -0
  99. data/generated/google/apis/games_management_v1management.rb +1 -1
  100. data/generated/google/apis/games_management_v1management/representations.rb +30 -0
  101. data/generated/google/apis/games_v1.rb +1 -1
  102. data/generated/google/apis/games_v1/representations.rb +198 -0
  103. data/generated/google/apis/gan_v1beta1/representations.rb +34 -0
  104. data/generated/google/apis/genomics_v1.rb +1 -1
  105. data/generated/google/apis/genomics_v1/classes.rb +2 -211
  106. data/generated/google/apis/genomics_v1/representations.rb +119 -84
  107. data/generated/google/apis/gmail_v1/representations.rb +44 -0
  108. data/generated/google/apis/groupsmigration_v1/representations.rb +2 -0
  109. data/generated/google/apis/groupssettings_v1/representations.rb +2 -0
  110. data/generated/google/apis/identitytoolkit_v3.rb +1 -1
  111. data/generated/google/apis/identitytoolkit_v3/classes.rb +105 -0
  112. data/generated/google/apis/identitytoolkit_v3/representations.rb +99 -0
  113. data/generated/google/apis/identitytoolkit_v3/service.rb +36 -1
  114. data/generated/google/apis/kgsearch_v1/representations.rb +2 -0
  115. data/generated/google/apis/licensing_v1/representations.rb +6 -0
  116. data/generated/google/apis/logging_v2beta1/representations.rb +40 -0
  117. data/generated/google/apis/manager_v1beta2/representations.rb +70 -0
  118. data/generated/google/apis/mirror_v1/representations.rb +40 -0
  119. data/generated/google/apis/oauth2_v2.rb +1 -1
  120. data/generated/google/apis/oauth2_v2/representations.rb +8 -0
  121. data/generated/google/apis/pagespeedonline_v2/representations.rb +28 -0
  122. data/generated/google/apis/partners_v2/representations.rb +52 -0
  123. data/generated/google/apis/people_v1.rb +11 -11
  124. data/generated/google/apis/people_v1/classes.rb +888 -961
  125. data/generated/google/apis/people_v1/representations.rb +295 -225
  126. data/generated/google/apis/people_v1/service.rb +61 -65
  127. data/generated/google/apis/plus_domains_v1.rb +1 -1
  128. data/generated/google/apis/plus_domains_v1/representations.rb +124 -0
  129. data/generated/google/apis/plus_v1.rb +1 -1
  130. data/generated/google/apis/plus_v1/representations.rb +102 -0
  131. data/generated/google/apis/prediction_v1_6/classes.rb +1 -1
  132. data/generated/google/apis/prediction_v1_6/representations.rb +42 -0
  133. data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +38 -0
  134. data/generated/google/apis/pubsub_v1/representations.rb +42 -0
  135. data/generated/google/apis/qpx_express_v1/representations.rb +48 -0
  136. data/generated/google/apis/replicapool_v1beta2/representations.rb +28 -0
  137. data/generated/google/apis/replicapoolupdater_v1beta1/representations.rb +30 -0
  138. data/generated/google/apis/reseller_v1.rb +1 -1
  139. data/generated/google/apis/reseller_v1/classes.rb +6 -0
  140. data/generated/google/apis/reseller_v1/representations.rb +23 -0
  141. data/generated/google/apis/resourceviews_v1beta2/representations.rb +32 -0
  142. data/generated/google/apis/script_v1/representations.rb +12 -0
  143. data/generated/google/apis/site_verification_v1/representations.rb +12 -0
  144. data/generated/google/apis/sqladmin_v1beta4.rb +1 -1
  145. data/generated/google/apis/sqladmin_v1beta4/classes.rb +50 -21
  146. data/generated/google/apis/sqladmin_v1beta4/representations.rb +98 -0
  147. data/generated/google/apis/sqladmin_v1beta4/service.rb +3 -3
  148. data/generated/google/apis/storage_v1.rb +1 -1
  149. data/generated/google/apis/storage_v1/representations.rb +52 -0
  150. data/generated/google/apis/storagetransfer_v1/representations.rb +48 -0
  151. data/generated/google/apis/tagmanager_v1.rb +1 -1
  152. data/generated/google/apis/tagmanager_v1/classes.rb +110 -0
  153. data/generated/google/apis/tagmanager_v1/representations.rb +96 -0
  154. data/generated/google/apis/tagmanager_v1/service.rb +303 -1
  155. data/generated/google/apis/taskqueue_v1beta2/representations.rb +12 -0
  156. data/generated/google/apis/tasks_v1/representations.rb +10 -0
  157. data/generated/google/apis/translate_v2.rb +1 -1
  158. data/generated/google/apis/translate_v2/representations.rb +12 -0
  159. data/generated/google/apis/urlshortener_v1/representations.rb +10 -0
  160. data/generated/google/apis/vision_v1.rb +37 -0
  161. data/generated/google/apis/vision_v1/classes.rb +1259 -0
  162. data/generated/google/apis/vision_v1/representations.rb +418 -0
  163. data/generated/google/apis/vision_v1/service.rb +91 -0
  164. data/generated/google/apis/webmasters_v3/representations.rb +32 -0
  165. data/generated/google/apis/youtube_analytics_v1/representations.rb +30 -0
  166. data/generated/google/apis/youtube_v3/representations.rb +332 -0
  167. data/generated/google/apis/youtubereporting_v1/representations.rb +16 -0
  168. data/google-api-client.gemspec +0 -2
  169. data/lib/google/api_client/client_secrets.rb +3 -4
  170. data/lib/google/apis/core/api_command.rb +5 -4
  171. data/lib/google/apis/core/http_command.rb +20 -4
  172. data/lib/google/apis/core/json_representation.rb +20 -2
  173. data/lib/google/apis/generator/annotator.rb +1 -1
  174. data/lib/google/apis/generator/templates/_representation_stub.tmpl +2 -0
  175. data/lib/google/apis/version.rb +1 -1
  176. data/script/generate +2 -1
  177. data/spec/google/api_client/client_secrets_spec.rb +2 -2
  178. data/spec/google/apis/core/api_command_spec.rb +2 -2
  179. data/spec/google/apis/core/http_command_spec.rb +19 -0
  180. data/spec/google/apis/core/json_representation_spec.rb +14 -7
  181. data/spec/google/apis/generator/generator_spec.rb +52 -0
  182. metadata +6 -30
@@ -0,0 +1,418 @@
1
+ # Copyright 2015 Google Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module VisionV1
24
+
25
+ class ImageSource
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class AnnotateImageRequest
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class AnnotateImageResponse
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class LatLongRect
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class Status
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class FaceAnnotation
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class Vertex
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class ColorInfo
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class BoundingPoly
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class Landmark
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class ImageContext
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class BatchAnnotateImagesRequest
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class EntityAnnotation
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class Property
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class Color
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class LocationInfo
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class SafeSearchAnnotation
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class Image
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class DominantColorsAnnotation
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class Feature
140
+ class Representation < Google::Apis::Core::JsonRepresentation; end
141
+
142
+ include Google::Apis::Core::JsonObjectSupport
143
+ end
144
+
145
+ class BatchAnnotateImagesResponse
146
+ class Representation < Google::Apis::Core::JsonRepresentation; end
147
+
148
+ include Google::Apis::Core::JsonObjectSupport
149
+ end
150
+
151
+ class ImageProperties
152
+ class Representation < Google::Apis::Core::JsonRepresentation; end
153
+
154
+ include Google::Apis::Core::JsonObjectSupport
155
+ end
156
+
157
+ class Position
158
+ class Representation < Google::Apis::Core::JsonRepresentation; end
159
+
160
+ include Google::Apis::Core::JsonObjectSupport
161
+ end
162
+
163
+ class LatLng
164
+ class Representation < Google::Apis::Core::JsonRepresentation; end
165
+
166
+ include Google::Apis::Core::JsonObjectSupport
167
+ end
168
+
169
+ class ImageSource
170
+ # @private
171
+ class Representation < Google::Apis::Core::JsonRepresentation
172
+ property :gcs_image_uri, as: 'gcsImageUri'
173
+ end
174
+ end
175
+
176
+ class AnnotateImageRequest
177
+ # @private
178
+ class Representation < Google::Apis::Core::JsonRepresentation
179
+ property :image, as: 'image', class: Google::Apis::VisionV1::Image, decorator: Google::Apis::VisionV1::Image::Representation
180
+
181
+ property :image_context, as: 'imageContext', class: Google::Apis::VisionV1::ImageContext, decorator: Google::Apis::VisionV1::ImageContext::Representation
182
+
183
+ collection :features, as: 'features', class: Google::Apis::VisionV1::Feature, decorator: Google::Apis::VisionV1::Feature::Representation
184
+
185
+ end
186
+ end
187
+
188
+ class AnnotateImageResponse
189
+ # @private
190
+ class Representation < Google::Apis::Core::JsonRepresentation
191
+ collection :label_annotations, as: 'labelAnnotations', class: Google::Apis::VisionV1::EntityAnnotation, decorator: Google::Apis::VisionV1::EntityAnnotation::Representation
192
+
193
+ collection :landmark_annotations, as: 'landmarkAnnotations', class: Google::Apis::VisionV1::EntityAnnotation, decorator: Google::Apis::VisionV1::EntityAnnotation::Representation
194
+
195
+ property :safe_search_annotation, as: 'safeSearchAnnotation', class: Google::Apis::VisionV1::SafeSearchAnnotation, decorator: Google::Apis::VisionV1::SafeSearchAnnotation::Representation
196
+
197
+ property :image_properties_annotation, as: 'imagePropertiesAnnotation', class: Google::Apis::VisionV1::ImageProperties, decorator: Google::Apis::VisionV1::ImageProperties::Representation
198
+
199
+ collection :text_annotations, as: 'textAnnotations', class: Google::Apis::VisionV1::EntityAnnotation, decorator: Google::Apis::VisionV1::EntityAnnotation::Representation
200
+
201
+ collection :logo_annotations, as: 'logoAnnotations', class: Google::Apis::VisionV1::EntityAnnotation, decorator: Google::Apis::VisionV1::EntityAnnotation::Representation
202
+
203
+ collection :face_annotations, as: 'faceAnnotations', class: Google::Apis::VisionV1::FaceAnnotation, decorator: Google::Apis::VisionV1::FaceAnnotation::Representation
204
+
205
+ property :error, as: 'error', class: Google::Apis::VisionV1::Status, decorator: Google::Apis::VisionV1::Status::Representation
206
+
207
+ end
208
+ end
209
+
210
+ class LatLongRect
211
+ # @private
212
+ class Representation < Google::Apis::Core::JsonRepresentation
213
+ property :max_lat_lng, as: 'maxLatLng', class: Google::Apis::VisionV1::LatLng, decorator: Google::Apis::VisionV1::LatLng::Representation
214
+
215
+ property :min_lat_lng, as: 'minLatLng', class: Google::Apis::VisionV1::LatLng, decorator: Google::Apis::VisionV1::LatLng::Representation
216
+
217
+ end
218
+ end
219
+
220
+ class Status
221
+ # @private
222
+ class Representation < Google::Apis::Core::JsonRepresentation
223
+ property :code, as: 'code'
224
+ collection :details, as: 'details'
225
+ property :message, as: 'message'
226
+ end
227
+ end
228
+
229
+ class FaceAnnotation
230
+ # @private
231
+ class Representation < Google::Apis::Core::JsonRepresentation
232
+ property :tilt_angle, as: 'tiltAngle'
233
+ property :under_exposed_likelihood, as: 'underExposedLikelihood'
234
+ property :fd_bounding_poly, as: 'fdBoundingPoly', class: Google::Apis::VisionV1::BoundingPoly, decorator: Google::Apis::VisionV1::BoundingPoly::Representation
235
+
236
+ property :landmarking_confidence, as: 'landmarkingConfidence'
237
+ property :joy_likelihood, as: 'joyLikelihood'
238
+ property :detection_confidence, as: 'detectionConfidence'
239
+ property :surprise_likelihood, as: 'surpriseLikelihood'
240
+ property :anger_likelihood, as: 'angerLikelihood'
241
+ property :headwear_likelihood, as: 'headwearLikelihood'
242
+ property :bounding_poly, as: 'boundingPoly', class: Google::Apis::VisionV1::BoundingPoly, decorator: Google::Apis::VisionV1::BoundingPoly::Representation
243
+
244
+ property :pan_angle, as: 'panAngle'
245
+ collection :landmarks, as: 'landmarks', class: Google::Apis::VisionV1::Landmark, decorator: Google::Apis::VisionV1::Landmark::Representation
246
+
247
+ property :blurred_likelihood, as: 'blurredLikelihood'
248
+ property :roll_angle, as: 'rollAngle'
249
+ property :sorrow_likelihood, as: 'sorrowLikelihood'
250
+ end
251
+ end
252
+
253
+ class Vertex
254
+ # @private
255
+ class Representation < Google::Apis::Core::JsonRepresentation
256
+ property :y, as: 'y'
257
+ property :x, as: 'x'
258
+ end
259
+ end
260
+
261
+ class ColorInfo
262
+ # @private
263
+ class Representation < Google::Apis::Core::JsonRepresentation
264
+ property :pixel_fraction, as: 'pixelFraction'
265
+ property :color, as: 'color', class: Google::Apis::VisionV1::Color, decorator: Google::Apis::VisionV1::Color::Representation
266
+
267
+ property :score, as: 'score'
268
+ end
269
+ end
270
+
271
+ class BoundingPoly
272
+ # @private
273
+ class Representation < Google::Apis::Core::JsonRepresentation
274
+ collection :vertices, as: 'vertices', class: Google::Apis::VisionV1::Vertex, decorator: Google::Apis::VisionV1::Vertex::Representation
275
+
276
+ end
277
+ end
278
+
279
+ class Landmark
280
+ # @private
281
+ class Representation < Google::Apis::Core::JsonRepresentation
282
+ property :position, as: 'position', class: Google::Apis::VisionV1::Position, decorator: Google::Apis::VisionV1::Position::Representation
283
+
284
+ property :type, as: 'type'
285
+ end
286
+ end
287
+
288
+ class ImageContext
289
+ # @private
290
+ class Representation < Google::Apis::Core::JsonRepresentation
291
+ collection :language_hints, as: 'languageHints'
292
+ property :lat_long_rect, as: 'latLongRect', class: Google::Apis::VisionV1::LatLongRect, decorator: Google::Apis::VisionV1::LatLongRect::Representation
293
+
294
+ end
295
+ end
296
+
297
+ class BatchAnnotateImagesRequest
298
+ # @private
299
+ class Representation < Google::Apis::Core::JsonRepresentation
300
+ collection :requests, as: 'requests', class: Google::Apis::VisionV1::AnnotateImageRequest, decorator: Google::Apis::VisionV1::AnnotateImageRequest::Representation
301
+
302
+ end
303
+ end
304
+
305
+ class EntityAnnotation
306
+ # @private
307
+ class Representation < Google::Apis::Core::JsonRepresentation
308
+ property :mid, as: 'mid'
309
+ property :description, as: 'description'
310
+ property :topicality, as: 'topicality'
311
+ property :locale, as: 'locale'
312
+ collection :properties, as: 'properties', class: Google::Apis::VisionV1::Property, decorator: Google::Apis::VisionV1::Property::Representation
313
+
314
+ property :score, as: 'score'
315
+ property :bounding_poly, as: 'boundingPoly', class: Google::Apis::VisionV1::BoundingPoly, decorator: Google::Apis::VisionV1::BoundingPoly::Representation
316
+
317
+ collection :locations, as: 'locations', class: Google::Apis::VisionV1::LocationInfo, decorator: Google::Apis::VisionV1::LocationInfo::Representation
318
+
319
+ property :confidence, as: 'confidence'
320
+ end
321
+ end
322
+
323
+ class Property
324
+ # @private
325
+ class Representation < Google::Apis::Core::JsonRepresentation
326
+ property :value, as: 'value'
327
+ property :name, as: 'name'
328
+ end
329
+ end
330
+
331
+ class Color
332
+ # @private
333
+ class Representation < Google::Apis::Core::JsonRepresentation
334
+ property :green, as: 'green'
335
+ property :blue, as: 'blue'
336
+ property :red, as: 'red'
337
+ property :alpha, as: 'alpha'
338
+ end
339
+ end
340
+
341
+ class LocationInfo
342
+ # @private
343
+ class Representation < Google::Apis::Core::JsonRepresentation
344
+ property :lat_lng, as: 'latLng', class: Google::Apis::VisionV1::LatLng, decorator: Google::Apis::VisionV1::LatLng::Representation
345
+
346
+ end
347
+ end
348
+
349
+ class SafeSearchAnnotation
350
+ # @private
351
+ class Representation < Google::Apis::Core::JsonRepresentation
352
+ property :medical, as: 'medical'
353
+ property :violence, as: 'violence'
354
+ property :spoof, as: 'spoof'
355
+ property :adult, as: 'adult'
356
+ end
357
+ end
358
+
359
+ class Image
360
+ # @private
361
+ class Representation < Google::Apis::Core::JsonRepresentation
362
+ property :source, as: 'source', class: Google::Apis::VisionV1::ImageSource, decorator: Google::Apis::VisionV1::ImageSource::Representation
363
+
364
+ property :content, :base64 => true, as: 'content'
365
+ end
366
+ end
367
+
368
+ class DominantColorsAnnotation
369
+ # @private
370
+ class Representation < Google::Apis::Core::JsonRepresentation
371
+ collection :colors, as: 'colors', class: Google::Apis::VisionV1::ColorInfo, decorator: Google::Apis::VisionV1::ColorInfo::Representation
372
+
373
+ end
374
+ end
375
+
376
+ class Feature
377
+ # @private
378
+ class Representation < Google::Apis::Core::JsonRepresentation
379
+ property :max_results, as: 'maxResults'
380
+ property :type, as: 'type'
381
+ end
382
+ end
383
+
384
+ class BatchAnnotateImagesResponse
385
+ # @private
386
+ class Representation < Google::Apis::Core::JsonRepresentation
387
+ collection :responses, as: 'responses', class: Google::Apis::VisionV1::AnnotateImageResponse, decorator: Google::Apis::VisionV1::AnnotateImageResponse::Representation
388
+
389
+ end
390
+ end
391
+
392
+ class ImageProperties
393
+ # @private
394
+ class Representation < Google::Apis::Core::JsonRepresentation
395
+ property :dominant_colors, as: 'dominantColors', class: Google::Apis::VisionV1::DominantColorsAnnotation, decorator: Google::Apis::VisionV1::DominantColorsAnnotation::Representation
396
+
397
+ end
398
+ end
399
+
400
+ class Position
401
+ # @private
402
+ class Representation < Google::Apis::Core::JsonRepresentation
403
+ property :y, as: 'y'
404
+ property :z, as: 'z'
405
+ property :x, as: 'x'
406
+ end
407
+ end
408
+
409
+ class LatLng
410
+ # @private
411
+ class Representation < Google::Apis::Core::JsonRepresentation
412
+ property :longitude, as: 'longitude'
413
+ property :latitude, as: 'latitude'
414
+ end
415
+ end
416
+ end
417
+ end
418
+ end
@@ -0,0 +1,91 @@
1
+ # Copyright 2015 Google Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module VisionV1
23
+ # Cloud Vision API
24
+ #
25
+ # The Google Cloud Vision API allows developers to easily integrate Google
26
+ # vision features, including image labeling, face, logo, and landmark detection,
27
+ # optical character recognition (OCR), and detection of explicit content, into
28
+ # applications.
29
+ #
30
+ # @example
31
+ # require 'google/apis/vision_v1'
32
+ #
33
+ # Vision = Google::Apis::VisionV1 # Alias the module
34
+ # service = Vision::VisionService.new
35
+ #
36
+ # @see https://cloud.google.com/vision/
37
+ class VisionService < Google::Apis::Core::BaseService
38
+ # @return [String]
39
+ # API key. Your API key identifies your project and provides you with API access,
40
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
41
+ attr_accessor :key
42
+
43
+ # @return [String]
44
+ # Available to use for quota purposes for server-side applications. Can be any
45
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
46
+ attr_accessor :quota_user
47
+
48
+ def initialize
49
+ super('https://vision.googleapis.com/', '')
50
+ end
51
+
52
+ # Run image detection and annotation for a batch of images.
53
+ # @param [Google::Apis::VisionV1::BatchAnnotateImagesRequest] batch_annotate_images_request_object
54
+ # @param [String] quota_user
55
+ # Available to use for quota purposes for server-side applications. Can be any
56
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
57
+ # @param [String] fields
58
+ # Selector specifying which fields to include in a partial response.
59
+ # @param [Google::Apis::RequestOptions] options
60
+ # Request-specific options
61
+ #
62
+ # @yield [result, err] Result & error if block supplied
63
+ # @yieldparam result [Google::Apis::VisionV1::BatchAnnotateImagesResponse] parsed result object
64
+ # @yieldparam err [StandardError] error object if request failed
65
+ #
66
+ # @return [Google::Apis::VisionV1::BatchAnnotateImagesResponse]
67
+ #
68
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
69
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
70
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
71
+ def annotate_image(batch_annotate_images_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
72
+ command = make_simple_command(:post, 'v1/images:annotate', options)
73
+ command.request_representation = Google::Apis::VisionV1::BatchAnnotateImagesRequest::Representation
74
+ command.request_object = batch_annotate_images_request_object
75
+ command.response_representation = Google::Apis::VisionV1::BatchAnnotateImagesResponse::Representation
76
+ command.response_class = Google::Apis::VisionV1::BatchAnnotateImagesResponse
77
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
78
+ command.query['fields'] = fields unless fields.nil?
79
+ execute_or_queue_command(command, &block)
80
+ end
81
+
82
+ protected
83
+
84
+ def apply_command_defaults(command)
85
+ command.query['key'] = key unless key.nil?
86
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end