google-apis-vision_v1p2beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,521 @@
1
+ # Copyright 2020 Google LLC
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 VisionV1p2beta1
23
+ # Cloud Vision API
24
+ #
25
+ # Integrates Google Vision features, including image labeling, face, logo, and
26
+ # landmark detection, optical character recognition (OCR), and detection of
27
+ # explicit content, into applications.
28
+ #
29
+ # @example
30
+ # require 'google/apis/vision_v1p2beta1'
31
+ #
32
+ # Vision = Google::Apis::VisionV1p2beta1 # Alias the module
33
+ # service = Vision::VisionService.new
34
+ #
35
+ # @see https://cloud.google.com/vision/
36
+ class VisionService < Google::Apis::Core::BaseService
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super('https://vision.googleapis.com/', '',
49
+ client_name: 'google-apis-vision_v1p2beta1',
50
+ client_version: Google::Apis::VisionV1p2beta1::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Service that performs image detection and annotation for a batch of files. Now
55
+ # only "application/pdf", "image/tiff" and "image/gif" are supported. This
56
+ # service will extract at most 5 (customers can specify which 5 in
57
+ # AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file
58
+ # provided and perform detection and annotation for each image extracted.
59
+ # @param [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesRequest] google_cloud_vision_v1p2beta1_batch_annotate_files_request_object
60
+ # @param [String] fields
61
+ # Selector specifying which fields to include in a partial response.
62
+ # @param [String] quota_user
63
+ # Available to use for quota purposes for server-side applications. Can be any
64
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
65
+ # @param [Google::Apis::RequestOptions] options
66
+ # Request-specific options
67
+ #
68
+ # @yield [result, err] Result & error if block supplied
69
+ # @yieldparam result [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse] parsed result object
70
+ # @yieldparam err [StandardError] error object if request failed
71
+ #
72
+ # @return [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse]
73
+ #
74
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
75
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
76
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
77
+ def annotate_file(google_cloud_vision_v1p2beta1_batch_annotate_files_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
78
+ command = make_simple_command(:post, 'v1p2beta1/files:annotate', options)
79
+ command.request_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesRequest::Representation
80
+ command.request_object = google_cloud_vision_v1p2beta1_batch_annotate_files_request_object
81
+ command.response_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse::Representation
82
+ command.response_class = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse
83
+ command.query['fields'] = fields unless fields.nil?
84
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
85
+ execute_or_queue_command(command, &block)
86
+ end
87
+
88
+ # Run asynchronous image detection and annotation for a list of generic files,
89
+ # such as PDF files, which may contain multiple pages and multiple images per
90
+ # page. Progress and results can be retrieved through the `google.longrunning.
91
+ # Operations` interface. `Operation.metadata` contains `OperationMetadata` (
92
+ # metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (
93
+ # results).
94
+ # @param [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest] google_cloud_vision_v1p2beta1_async_batch_annotate_files_request_object
95
+ # @param [String] fields
96
+ # Selector specifying which fields to include in a partial response.
97
+ # @param [String] quota_user
98
+ # Available to use for quota purposes for server-side applications. Can be any
99
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
100
+ # @param [Google::Apis::RequestOptions] options
101
+ # Request-specific options
102
+ #
103
+ # @yield [result, err] Result & error if block supplied
104
+ # @yieldparam result [Google::Apis::VisionV1p2beta1::Operation] parsed result object
105
+ # @yieldparam err [StandardError] error object if request failed
106
+ #
107
+ # @return [Google::Apis::VisionV1p2beta1::Operation]
108
+ #
109
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
110
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
111
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
112
+ def async_file_batch_annotate(google_cloud_vision_v1p2beta1_async_batch_annotate_files_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
113
+ command = make_simple_command(:post, 'v1p2beta1/files:asyncBatchAnnotate', options)
114
+ command.request_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest::Representation
115
+ command.request_object = google_cloud_vision_v1p2beta1_async_batch_annotate_files_request_object
116
+ command.response_representation = Google::Apis::VisionV1p2beta1::Operation::Representation
117
+ command.response_class = Google::Apis::VisionV1p2beta1::Operation
118
+ command.query['fields'] = fields unless fields.nil?
119
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
120
+ execute_or_queue_command(command, &block)
121
+ end
122
+
123
+ # Run image detection and annotation for a batch of images.
124
+ # @param [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest] google_cloud_vision_v1p2beta1_batch_annotate_images_request_object
125
+ # @param [String] fields
126
+ # Selector specifying which fields to include in a partial response.
127
+ # @param [String] quota_user
128
+ # Available to use for quota purposes for server-side applications. Can be any
129
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
130
+ # @param [Google::Apis::RequestOptions] options
131
+ # Request-specific options
132
+ #
133
+ # @yield [result, err] Result & error if block supplied
134
+ # @yieldparam result [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse] parsed result object
135
+ # @yieldparam err [StandardError] error object if request failed
136
+ #
137
+ # @return [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse]
138
+ #
139
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
140
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
141
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
142
+ def annotate_image(google_cloud_vision_v1p2beta1_batch_annotate_images_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
143
+ command = make_simple_command(:post, 'v1p2beta1/images:annotate', options)
144
+ command.request_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest::Representation
145
+ command.request_object = google_cloud_vision_v1p2beta1_batch_annotate_images_request_object
146
+ command.response_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse::Representation
147
+ command.response_class = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse
148
+ command.query['fields'] = fields unless fields.nil?
149
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
150
+ execute_or_queue_command(command, &block)
151
+ end
152
+
153
+ # Run asynchronous image detection and annotation for a list of images. Progress
154
+ # and results can be retrieved through the `google.longrunning.Operations`
155
+ # interface. `Operation.metadata` contains `OperationMetadata` (metadata). `
156
+ # Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results).
157
+ # This service will write image annotation outputs to json files in customer GCS
158
+ # bucket, each json file containing BatchAnnotateImagesResponse proto.
159
+ # @param [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1AsyncBatchAnnotateImagesRequest] google_cloud_vision_v1p2beta1_async_batch_annotate_images_request_object
160
+ # @param [String] fields
161
+ # Selector specifying which fields to include in a partial response.
162
+ # @param [String] quota_user
163
+ # Available to use for quota purposes for server-side applications. Can be any
164
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
165
+ # @param [Google::Apis::RequestOptions] options
166
+ # Request-specific options
167
+ #
168
+ # @yield [result, err] Result & error if block supplied
169
+ # @yieldparam result [Google::Apis::VisionV1p2beta1::Operation] parsed result object
170
+ # @yieldparam err [StandardError] error object if request failed
171
+ #
172
+ # @return [Google::Apis::VisionV1p2beta1::Operation]
173
+ #
174
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
175
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
176
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
177
+ def async_image_batch_annotate(google_cloud_vision_v1p2beta1_async_batch_annotate_images_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
178
+ command = make_simple_command(:post, 'v1p2beta1/images:asyncBatchAnnotate', options)
179
+ command.request_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1AsyncBatchAnnotateImagesRequest::Representation
180
+ command.request_object = google_cloud_vision_v1p2beta1_async_batch_annotate_images_request_object
181
+ command.response_representation = Google::Apis::VisionV1p2beta1::Operation::Representation
182
+ command.response_class = Google::Apis::VisionV1p2beta1::Operation
183
+ command.query['fields'] = fields unless fields.nil?
184
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
185
+ execute_or_queue_command(command, &block)
186
+ end
187
+
188
+ # Service that performs image detection and annotation for a batch of files. Now
189
+ # only "application/pdf", "image/tiff" and "image/gif" are supported. This
190
+ # service will extract at most 5 (customers can specify which 5 in
191
+ # AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file
192
+ # provided and perform detection and annotation for each image extracted.
193
+ # @param [String] parent
194
+ # Optional. Target project and location to make a call. Format: `projects/`
195
+ # project-id`/locations/`location-id``. If no parent is specified, a region will
196
+ # be chosen automatically. Supported location-ids: `us`: USA country only, `asia`
197
+ # : East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `
198
+ # projects/project-A/locations/eu`.
199
+ # @param [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesRequest] google_cloud_vision_v1p2beta1_batch_annotate_files_request_object
200
+ # @param [String] fields
201
+ # Selector specifying which fields to include in a partial response.
202
+ # @param [String] quota_user
203
+ # Available to use for quota purposes for server-side applications. Can be any
204
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
205
+ # @param [Google::Apis::RequestOptions] options
206
+ # Request-specific options
207
+ #
208
+ # @yield [result, err] Result & error if block supplied
209
+ # @yieldparam result [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse] parsed result object
210
+ # @yieldparam err [StandardError] error object if request failed
211
+ #
212
+ # @return [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse]
213
+ #
214
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
215
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
216
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
217
+ def annotate_project_file(parent, google_cloud_vision_v1p2beta1_batch_annotate_files_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
218
+ command = make_simple_command(:post, 'v1p2beta1/{+parent}/files:annotate', options)
219
+ command.request_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesRequest::Representation
220
+ command.request_object = google_cloud_vision_v1p2beta1_batch_annotate_files_request_object
221
+ command.response_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse::Representation
222
+ command.response_class = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse
223
+ command.params['parent'] = parent unless parent.nil?
224
+ command.query['fields'] = fields unless fields.nil?
225
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
226
+ execute_or_queue_command(command, &block)
227
+ end
228
+
229
+ # Run asynchronous image detection and annotation for a list of generic files,
230
+ # such as PDF files, which may contain multiple pages and multiple images per
231
+ # page. Progress and results can be retrieved through the `google.longrunning.
232
+ # Operations` interface. `Operation.metadata` contains `OperationMetadata` (
233
+ # metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (
234
+ # results).
235
+ # @param [String] parent
236
+ # Optional. Target project and location to make a call. Format: `projects/`
237
+ # project-id`/locations/`location-id``. If no parent is specified, a region will
238
+ # be chosen automatically. Supported location-ids: `us`: USA country only, `asia`
239
+ # : East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `
240
+ # projects/project-A/locations/eu`.
241
+ # @param [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest] google_cloud_vision_v1p2beta1_async_batch_annotate_files_request_object
242
+ # @param [String] fields
243
+ # Selector specifying which fields to include in a partial response.
244
+ # @param [String] quota_user
245
+ # Available to use for quota purposes for server-side applications. Can be any
246
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
247
+ # @param [Google::Apis::RequestOptions] options
248
+ # Request-specific options
249
+ #
250
+ # @yield [result, err] Result & error if block supplied
251
+ # @yieldparam result [Google::Apis::VisionV1p2beta1::Operation] parsed result object
252
+ # @yieldparam err [StandardError] error object if request failed
253
+ #
254
+ # @return [Google::Apis::VisionV1p2beta1::Operation]
255
+ #
256
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
257
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
258
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
259
+ def async_project_file_batch_annotate(parent, google_cloud_vision_v1p2beta1_async_batch_annotate_files_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
260
+ command = make_simple_command(:post, 'v1p2beta1/{+parent}/files:asyncBatchAnnotate', options)
261
+ command.request_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest::Representation
262
+ command.request_object = google_cloud_vision_v1p2beta1_async_batch_annotate_files_request_object
263
+ command.response_representation = Google::Apis::VisionV1p2beta1::Operation::Representation
264
+ command.response_class = Google::Apis::VisionV1p2beta1::Operation
265
+ command.params['parent'] = parent unless parent.nil?
266
+ command.query['fields'] = fields unless fields.nil?
267
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
268
+ execute_or_queue_command(command, &block)
269
+ end
270
+
271
+ # Run image detection and annotation for a batch of images.
272
+ # @param [String] parent
273
+ # Optional. Target project and location to make a call. Format: `projects/`
274
+ # project-id`/locations/`location-id``. If no parent is specified, a region will
275
+ # be chosen automatically. Supported location-ids: `us`: USA country only, `asia`
276
+ # : East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `
277
+ # projects/project-A/locations/eu`.
278
+ # @param [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest] google_cloud_vision_v1p2beta1_batch_annotate_images_request_object
279
+ # @param [String] fields
280
+ # Selector specifying which fields to include in a partial response.
281
+ # @param [String] quota_user
282
+ # Available to use for quota purposes for server-side applications. Can be any
283
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
284
+ # @param [Google::Apis::RequestOptions] options
285
+ # Request-specific options
286
+ #
287
+ # @yield [result, err] Result & error if block supplied
288
+ # @yieldparam result [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse] parsed result object
289
+ # @yieldparam err [StandardError] error object if request failed
290
+ #
291
+ # @return [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse]
292
+ #
293
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
294
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
295
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
296
+ def annotate_project_image(parent, google_cloud_vision_v1p2beta1_batch_annotate_images_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
297
+ command = make_simple_command(:post, 'v1p2beta1/{+parent}/images:annotate', options)
298
+ command.request_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest::Representation
299
+ command.request_object = google_cloud_vision_v1p2beta1_batch_annotate_images_request_object
300
+ command.response_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse::Representation
301
+ command.response_class = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse
302
+ command.params['parent'] = parent unless parent.nil?
303
+ command.query['fields'] = fields unless fields.nil?
304
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
305
+ execute_or_queue_command(command, &block)
306
+ end
307
+
308
+ # Run asynchronous image detection and annotation for a list of images. Progress
309
+ # and results can be retrieved through the `google.longrunning.Operations`
310
+ # interface. `Operation.metadata` contains `OperationMetadata` (metadata). `
311
+ # Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results).
312
+ # This service will write image annotation outputs to json files in customer GCS
313
+ # bucket, each json file containing BatchAnnotateImagesResponse proto.
314
+ # @param [String] parent
315
+ # Optional. Target project and location to make a call. Format: `projects/`
316
+ # project-id`/locations/`location-id``. If no parent is specified, a region will
317
+ # be chosen automatically. Supported location-ids: `us`: USA country only, `asia`
318
+ # : East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `
319
+ # projects/project-A/locations/eu`.
320
+ # @param [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1AsyncBatchAnnotateImagesRequest] google_cloud_vision_v1p2beta1_async_batch_annotate_images_request_object
321
+ # @param [String] fields
322
+ # Selector specifying which fields to include in a partial response.
323
+ # @param [String] quota_user
324
+ # Available to use for quota purposes for server-side applications. Can be any
325
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
326
+ # @param [Google::Apis::RequestOptions] options
327
+ # Request-specific options
328
+ #
329
+ # @yield [result, err] Result & error if block supplied
330
+ # @yieldparam result [Google::Apis::VisionV1p2beta1::Operation] parsed result object
331
+ # @yieldparam err [StandardError] error object if request failed
332
+ #
333
+ # @return [Google::Apis::VisionV1p2beta1::Operation]
334
+ #
335
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
336
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
337
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
338
+ def async_project_image_batch_annotate(parent, google_cloud_vision_v1p2beta1_async_batch_annotate_images_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
339
+ command = make_simple_command(:post, 'v1p2beta1/{+parent}/images:asyncBatchAnnotate', options)
340
+ command.request_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1AsyncBatchAnnotateImagesRequest::Representation
341
+ command.request_object = google_cloud_vision_v1p2beta1_async_batch_annotate_images_request_object
342
+ command.response_representation = Google::Apis::VisionV1p2beta1::Operation::Representation
343
+ command.response_class = Google::Apis::VisionV1p2beta1::Operation
344
+ command.params['parent'] = parent unless parent.nil?
345
+ command.query['fields'] = fields unless fields.nil?
346
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
347
+ execute_or_queue_command(command, &block)
348
+ end
349
+
350
+ # Service that performs image detection and annotation for a batch of files. Now
351
+ # only "application/pdf", "image/tiff" and "image/gif" are supported. This
352
+ # service will extract at most 5 (customers can specify which 5 in
353
+ # AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file
354
+ # provided and perform detection and annotation for each image extracted.
355
+ # @param [String] parent
356
+ # Optional. Target project and location to make a call. Format: `projects/`
357
+ # project-id`/locations/`location-id``. If no parent is specified, a region will
358
+ # be chosen automatically. Supported location-ids: `us`: USA country only, `asia`
359
+ # : East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `
360
+ # projects/project-A/locations/eu`.
361
+ # @param [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesRequest] google_cloud_vision_v1p2beta1_batch_annotate_files_request_object
362
+ # @param [String] fields
363
+ # Selector specifying which fields to include in a partial response.
364
+ # @param [String] quota_user
365
+ # Available to use for quota purposes for server-side applications. Can be any
366
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
367
+ # @param [Google::Apis::RequestOptions] options
368
+ # Request-specific options
369
+ #
370
+ # @yield [result, err] Result & error if block supplied
371
+ # @yieldparam result [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse] parsed result object
372
+ # @yieldparam err [StandardError] error object if request failed
373
+ #
374
+ # @return [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse]
375
+ #
376
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
377
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
378
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
379
+ def annotate_project_location_file(parent, google_cloud_vision_v1p2beta1_batch_annotate_files_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
380
+ command = make_simple_command(:post, 'v1p2beta1/{+parent}/files:annotate', options)
381
+ command.request_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesRequest::Representation
382
+ command.request_object = google_cloud_vision_v1p2beta1_batch_annotate_files_request_object
383
+ command.response_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse::Representation
384
+ command.response_class = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateFilesResponse
385
+ command.params['parent'] = parent unless parent.nil?
386
+ command.query['fields'] = fields unless fields.nil?
387
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
388
+ execute_or_queue_command(command, &block)
389
+ end
390
+
391
+ # Run asynchronous image detection and annotation for a list of generic files,
392
+ # such as PDF files, which may contain multiple pages and multiple images per
393
+ # page. Progress and results can be retrieved through the `google.longrunning.
394
+ # Operations` interface. `Operation.metadata` contains `OperationMetadata` (
395
+ # metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (
396
+ # results).
397
+ # @param [String] parent
398
+ # Optional. Target project and location to make a call. Format: `projects/`
399
+ # project-id`/locations/`location-id``. If no parent is specified, a region will
400
+ # be chosen automatically. Supported location-ids: `us`: USA country only, `asia`
401
+ # : East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `
402
+ # projects/project-A/locations/eu`.
403
+ # @param [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest] google_cloud_vision_v1p2beta1_async_batch_annotate_files_request_object
404
+ # @param [String] fields
405
+ # Selector specifying which fields to include in a partial response.
406
+ # @param [String] quota_user
407
+ # Available to use for quota purposes for server-side applications. Can be any
408
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
409
+ # @param [Google::Apis::RequestOptions] options
410
+ # Request-specific options
411
+ #
412
+ # @yield [result, err] Result & error if block supplied
413
+ # @yieldparam result [Google::Apis::VisionV1p2beta1::Operation] parsed result object
414
+ # @yieldparam err [StandardError] error object if request failed
415
+ #
416
+ # @return [Google::Apis::VisionV1p2beta1::Operation]
417
+ #
418
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
419
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
420
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
421
+ def async_project_location_file_batch_annotate(parent, google_cloud_vision_v1p2beta1_async_batch_annotate_files_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
422
+ command = make_simple_command(:post, 'v1p2beta1/{+parent}/files:asyncBatchAnnotate', options)
423
+ command.request_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest::Representation
424
+ command.request_object = google_cloud_vision_v1p2beta1_async_batch_annotate_files_request_object
425
+ command.response_representation = Google::Apis::VisionV1p2beta1::Operation::Representation
426
+ command.response_class = Google::Apis::VisionV1p2beta1::Operation
427
+ command.params['parent'] = parent unless parent.nil?
428
+ command.query['fields'] = fields unless fields.nil?
429
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
430
+ execute_or_queue_command(command, &block)
431
+ end
432
+
433
+ # Run image detection and annotation for a batch of images.
434
+ # @param [String] parent
435
+ # Optional. Target project and location to make a call. Format: `projects/`
436
+ # project-id`/locations/`location-id``. If no parent is specified, a region will
437
+ # be chosen automatically. Supported location-ids: `us`: USA country only, `asia`
438
+ # : East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `
439
+ # projects/project-A/locations/eu`.
440
+ # @param [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest] google_cloud_vision_v1p2beta1_batch_annotate_images_request_object
441
+ # @param [String] fields
442
+ # Selector specifying which fields to include in a partial response.
443
+ # @param [String] quota_user
444
+ # Available to use for quota purposes for server-side applications. Can be any
445
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
446
+ # @param [Google::Apis::RequestOptions] options
447
+ # Request-specific options
448
+ #
449
+ # @yield [result, err] Result & error if block supplied
450
+ # @yieldparam result [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse] parsed result object
451
+ # @yieldparam err [StandardError] error object if request failed
452
+ #
453
+ # @return [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse]
454
+ #
455
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
456
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
457
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
458
+ def annotate_project_location_image(parent, google_cloud_vision_v1p2beta1_batch_annotate_images_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
459
+ command = make_simple_command(:post, 'v1p2beta1/{+parent}/images:annotate', options)
460
+ command.request_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest::Representation
461
+ command.request_object = google_cloud_vision_v1p2beta1_batch_annotate_images_request_object
462
+ command.response_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse::Representation
463
+ command.response_class = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse
464
+ command.params['parent'] = parent unless parent.nil?
465
+ command.query['fields'] = fields unless fields.nil?
466
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
467
+ execute_or_queue_command(command, &block)
468
+ end
469
+
470
+ # Run asynchronous image detection and annotation for a list of images. Progress
471
+ # and results can be retrieved through the `google.longrunning.Operations`
472
+ # interface. `Operation.metadata` contains `OperationMetadata` (metadata). `
473
+ # Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results).
474
+ # This service will write image annotation outputs to json files in customer GCS
475
+ # bucket, each json file containing BatchAnnotateImagesResponse proto.
476
+ # @param [String] parent
477
+ # Optional. Target project and location to make a call. Format: `projects/`
478
+ # project-id`/locations/`location-id``. If no parent is specified, a region will
479
+ # be chosen automatically. Supported location-ids: `us`: USA country only, `asia`
480
+ # : East asia areas, like Japan, Taiwan, `eu`: The European Union. Example: `
481
+ # projects/project-A/locations/eu`.
482
+ # @param [Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1AsyncBatchAnnotateImagesRequest] google_cloud_vision_v1p2beta1_async_batch_annotate_images_request_object
483
+ # @param [String] fields
484
+ # Selector specifying which fields to include in a partial response.
485
+ # @param [String] quota_user
486
+ # Available to use for quota purposes for server-side applications. Can be any
487
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
488
+ # @param [Google::Apis::RequestOptions] options
489
+ # Request-specific options
490
+ #
491
+ # @yield [result, err] Result & error if block supplied
492
+ # @yieldparam result [Google::Apis::VisionV1p2beta1::Operation] parsed result object
493
+ # @yieldparam err [StandardError] error object if request failed
494
+ #
495
+ # @return [Google::Apis::VisionV1p2beta1::Operation]
496
+ #
497
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
498
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
499
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
500
+ def async_project_location_image_batch_annotate(parent, google_cloud_vision_v1p2beta1_async_batch_annotate_images_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
501
+ command = make_simple_command(:post, 'v1p2beta1/{+parent}/images:asyncBatchAnnotate', options)
502
+ command.request_representation = Google::Apis::VisionV1p2beta1::GoogleCloudVisionV1p2beta1AsyncBatchAnnotateImagesRequest::Representation
503
+ command.request_object = google_cloud_vision_v1p2beta1_async_batch_annotate_images_request_object
504
+ command.response_representation = Google::Apis::VisionV1p2beta1::Operation::Representation
505
+ command.response_class = Google::Apis::VisionV1p2beta1::Operation
506
+ command.params['parent'] = parent unless parent.nil?
507
+ command.query['fields'] = fields unless fields.nil?
508
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
509
+ execute_or_queue_command(command, &block)
510
+ end
511
+
512
+ protected
513
+
514
+ def apply_command_defaults(command)
515
+ command.query['key'] = key unless key.nil?
516
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
517
+ end
518
+ end
519
+ end
520
+ end
521
+ end