google-apis-documentai_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,604 @@
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 DocumentaiV1
23
+ # Cloud Document AI API
24
+ #
25
+ # Service to parse structured information from unstructured or semi-structured
26
+ # documents using state-of-the-art Google AI such as natural language, computer
27
+ # vision, translation, and AutoML.
28
+ #
29
+ # @example
30
+ # require 'google/apis/documentai_v1'
31
+ #
32
+ # Documentai = Google::Apis::DocumentaiV1 # Alias the module
33
+ # service = Documentai::DocumentService.new
34
+ #
35
+ # @see https://cloud.google.com/document-ai/docs/
36
+ class DocumentService < 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://documentai.googleapis.com/', '',
49
+ client_name: 'google-apis-documentai_v1',
50
+ client_version: Google::Apis::DocumentaiV1::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Starts asynchronous cancellation on a long-running operation. The server makes
55
+ # a best effort to cancel the operation, but success is not guaranteed. If the
56
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
57
+ # Clients can use Operations.GetOperation or other methods to check whether the
58
+ # cancellation succeeded or whether the operation completed despite cancellation.
59
+ # On successful cancellation, the operation is not deleted; instead, it becomes
60
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
61
+ # corresponding to `Code.CANCELLED`.
62
+ # @param [String] name
63
+ # The name of the operation resource to be cancelled.
64
+ # @param [Google::Apis::DocumentaiV1::GoogleLongrunningCancelOperationRequest] google_longrunning_cancel_operation_request_object
65
+ # @param [String] fields
66
+ # Selector specifying which fields to include in a partial response.
67
+ # @param [String] quota_user
68
+ # Available to use for quota purposes for server-side applications. Can be any
69
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
70
+ # @param [Google::Apis::RequestOptions] options
71
+ # Request-specific options
72
+ #
73
+ # @yield [result, err] Result & error if block supplied
74
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleProtobufEmpty] parsed result object
75
+ # @yieldparam err [StandardError] error object if request failed
76
+ #
77
+ # @return [Google::Apis::DocumentaiV1::GoogleProtobufEmpty]
78
+ #
79
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
80
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
81
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
82
+ def cancel_operation(name, google_longrunning_cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
83
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
84
+ command.request_representation = Google::Apis::DocumentaiV1::GoogleLongrunningCancelOperationRequest::Representation
85
+ command.request_object = google_longrunning_cancel_operation_request_object
86
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleProtobufEmpty::Representation
87
+ command.response_class = Google::Apis::DocumentaiV1::GoogleProtobufEmpty
88
+ command.params['name'] = name unless name.nil?
89
+ command.query['fields'] = fields unless fields.nil?
90
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
91
+ execute_or_queue_command(command, &block)
92
+ end
93
+
94
+ # Deletes a long-running operation. This method indicates that the client is no
95
+ # longer interested in the operation result. It does not cancel the operation.
96
+ # If the server doesn't support this method, it returns `google.rpc.Code.
97
+ # UNIMPLEMENTED`.
98
+ # @param [String] name
99
+ # The name of the operation resource to be deleted.
100
+ # @param [String] fields
101
+ # Selector specifying which fields to include in a partial response.
102
+ # @param [String] quota_user
103
+ # Available to use for quota purposes for server-side applications. Can be any
104
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
105
+ # @param [Google::Apis::RequestOptions] options
106
+ # Request-specific options
107
+ #
108
+ # @yield [result, err] Result & error if block supplied
109
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleProtobufEmpty] parsed result object
110
+ # @yieldparam err [StandardError] error object if request failed
111
+ #
112
+ # @return [Google::Apis::DocumentaiV1::GoogleProtobufEmpty]
113
+ #
114
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
115
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
116
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
117
+ def delete_operation(name, fields: nil, quota_user: nil, options: nil, &block)
118
+ command = make_simple_command(:delete, 'v1/{+name}', options)
119
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleProtobufEmpty::Representation
120
+ command.response_class = Google::Apis::DocumentaiV1::GoogleProtobufEmpty
121
+ command.params['name'] = name unless name.nil?
122
+ command.query['fields'] = fields unless fields.nil?
123
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
124
+ execute_or_queue_command(command, &block)
125
+ end
126
+
127
+ # Lists operations that match the specified filter in the request. If the server
128
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
129
+ # binding allows API services to override the binding to use different resource
130
+ # name schemes, such as `users/*/operations`. To override the binding, API
131
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
132
+ # service configuration. For backwards compatibility, the default name includes
133
+ # the operations collection id, however overriding users must ensure the name
134
+ # binding is the parent resource, without the operations collection id.
135
+ # @param [String] name
136
+ # The name of the operation's parent resource.
137
+ # @param [String] filter
138
+ # The standard list filter.
139
+ # @param [Fixnum] page_size
140
+ # The standard list page size.
141
+ # @param [String] page_token
142
+ # The standard list page token.
143
+ # @param [String] fields
144
+ # Selector specifying which fields to include in a partial response.
145
+ # @param [String] quota_user
146
+ # Available to use for quota purposes for server-side applications. Can be any
147
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
148
+ # @param [Google::Apis::RequestOptions] options
149
+ # Request-specific options
150
+ #
151
+ # @yield [result, err] Result & error if block supplied
152
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleLongrunningListOperationsResponse] parsed result object
153
+ # @yieldparam err [StandardError] error object if request failed
154
+ #
155
+ # @return [Google::Apis::DocumentaiV1::GoogleLongrunningListOperationsResponse]
156
+ #
157
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
158
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
159
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
160
+ def list_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
161
+ command = make_simple_command(:get, 'v1/{+name}', options)
162
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningListOperationsResponse::Representation
163
+ command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningListOperationsResponse
164
+ command.params['name'] = name unless name.nil?
165
+ command.query['filter'] = filter unless filter.nil?
166
+ command.query['pageSize'] = page_size unless page_size.nil?
167
+ command.query['pageToken'] = page_token unless page_token.nil?
168
+ command.query['fields'] = fields unless fields.nil?
169
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
170
+ execute_or_queue_command(command, &block)
171
+ end
172
+
173
+ # Gets information about a location.
174
+ # @param [String] name
175
+ # Resource name for the location.
176
+ # @param [String] fields
177
+ # Selector specifying which fields to include in a partial response.
178
+ # @param [String] quota_user
179
+ # Available to use for quota purposes for server-side applications. Can be any
180
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
181
+ # @param [Google::Apis::RequestOptions] options
182
+ # Request-specific options
183
+ #
184
+ # @yield [result, err] Result & error if block supplied
185
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleCloudLocationLocation] parsed result object
186
+ # @yieldparam err [StandardError] error object if request failed
187
+ #
188
+ # @return [Google::Apis::DocumentaiV1::GoogleCloudLocationLocation]
189
+ #
190
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
191
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
192
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
193
+ def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
194
+ command = make_simple_command(:get, 'v1/{+name}', options)
195
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudLocationLocation::Representation
196
+ command.response_class = Google::Apis::DocumentaiV1::GoogleCloudLocationLocation
197
+ command.params['name'] = name unless name.nil?
198
+ command.query['fields'] = fields unless fields.nil?
199
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
200
+ execute_or_queue_command(command, &block)
201
+ end
202
+
203
+ # Lists information about the supported locations for this service.
204
+ # @param [String] name
205
+ # The resource that owns the locations collection, if applicable.
206
+ # @param [String] filter
207
+ # A filter to narrow down results to a preferred subset. The filtering language
208
+ # accepts strings like "displayName=tokyo", and is documented in more detail in [
209
+ # AIP-160](https://google.aip.dev/160).
210
+ # @param [Fixnum] page_size
211
+ # The maximum number of results to return. If not set, the service will select a
212
+ # default.
213
+ # @param [String] page_token
214
+ # A page token received from the `next_page_token` field in the response. Send
215
+ # that page token to receive the subsequent page.
216
+ # @param [String] fields
217
+ # Selector specifying which fields to include in a partial response.
218
+ # @param [String] quota_user
219
+ # Available to use for quota purposes for server-side applications. Can be any
220
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
221
+ # @param [Google::Apis::RequestOptions] options
222
+ # Request-specific options
223
+ #
224
+ # @yield [result, err] Result & error if block supplied
225
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleCloudLocationListLocationsResponse] parsed result object
226
+ # @yieldparam err [StandardError] error object if request failed
227
+ #
228
+ # @return [Google::Apis::DocumentaiV1::GoogleCloudLocationListLocationsResponse]
229
+ #
230
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
231
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
232
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
233
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
234
+ command = make_simple_command(:get, 'v1/{+name}/locations', options)
235
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudLocationListLocationsResponse::Representation
236
+ command.response_class = Google::Apis::DocumentaiV1::GoogleCloudLocationListLocationsResponse
237
+ command.params['name'] = name unless name.nil?
238
+ command.query['filter'] = filter unless filter.nil?
239
+ command.query['pageSize'] = page_size unless page_size.nil?
240
+ command.query['pageToken'] = page_token unless page_token.nil?
241
+ command.query['fields'] = fields unless fields.nil?
242
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
243
+ execute_or_queue_command(command, &block)
244
+ end
245
+
246
+ # Gets the latest state of a long-running operation. Clients can use this method
247
+ # to poll the operation result at intervals as recommended by the API service.
248
+ # @param [String] name
249
+ # The name of the operation resource.
250
+ # @param [String] fields
251
+ # Selector specifying which fields to include in a partial response.
252
+ # @param [String] quota_user
253
+ # Available to use for quota purposes for server-side applications. Can be any
254
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
255
+ # @param [Google::Apis::RequestOptions] options
256
+ # Request-specific options
257
+ #
258
+ # @yield [result, err] Result & error if block supplied
259
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleLongrunningOperation] parsed result object
260
+ # @yieldparam err [StandardError] error object if request failed
261
+ #
262
+ # @return [Google::Apis::DocumentaiV1::GoogleLongrunningOperation]
263
+ #
264
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
265
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
266
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
267
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
268
+ command = make_simple_command(:get, 'v1/{+name}', options)
269
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
270
+ command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
271
+ command.params['name'] = name unless name.nil?
272
+ command.query['fields'] = fields unless fields.nil?
273
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
274
+ execute_or_queue_command(command, &block)
275
+ end
276
+
277
+ # LRO endpoint to batch process many documents. The output is written to Cloud
278
+ # Storage as JSON in the [Document] format.
279
+ # @param [String] name
280
+ # Required. The resource name of Processor or ProcessorVersion. Format: projects/
281
+ # `project`/locations/`location`/processors/`processor`, or projects/`project`/
282
+ # locations/`location`/processors/`processor`/processorVersions/`
283
+ # processorVersion`
284
+ # @param [Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1BatchProcessRequest] google_cloud_documentai_v1_batch_process_request_object
285
+ # @param [String] fields
286
+ # Selector specifying which fields to include in a partial response.
287
+ # @param [String] quota_user
288
+ # Available to use for quota purposes for server-side applications. Can be any
289
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
290
+ # @param [Google::Apis::RequestOptions] options
291
+ # Request-specific options
292
+ #
293
+ # @yield [result, err] Result & error if block supplied
294
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleLongrunningOperation] parsed result object
295
+ # @yieldparam err [StandardError] error object if request failed
296
+ #
297
+ # @return [Google::Apis::DocumentaiV1::GoogleLongrunningOperation]
298
+ #
299
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
300
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
301
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
302
+ def batch_project_location_processor_process(name, google_cloud_documentai_v1_batch_process_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
303
+ command = make_simple_command(:post, 'v1/{+name}:batchProcess', options)
304
+ command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1BatchProcessRequest::Representation
305
+ command.request_object = google_cloud_documentai_v1_batch_process_request_object
306
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
307
+ command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
308
+ command.params['name'] = name unless name.nil?
309
+ command.query['fields'] = fields unless fields.nil?
310
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
311
+ execute_or_queue_command(command, &block)
312
+ end
313
+
314
+ # Processes a single document.
315
+ # @param [String] name
316
+ # Required. The resource name of the Processor or ProcessorVersion to use for
317
+ # processing. If a Processor is specified, the server will use its default
318
+ # version. Format: projects/`project`/locations/`location`/processors/`processor`
319
+ # , or projects/`project`/locations/`location`/processors/`processor`/
320
+ # processorVersions/`processorVersion`
321
+ # @param [Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessRequest] google_cloud_documentai_v1_process_request_object
322
+ # @param [String] fields
323
+ # Selector specifying which fields to include in a partial response.
324
+ # @param [String] quota_user
325
+ # Available to use for quota purposes for server-side applications. Can be any
326
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
327
+ # @param [Google::Apis::RequestOptions] options
328
+ # Request-specific options
329
+ #
330
+ # @yield [result, err] Result & error if block supplied
331
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse] parsed result object
332
+ # @yieldparam err [StandardError] error object if request failed
333
+ #
334
+ # @return [Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse]
335
+ #
336
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
337
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
338
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
339
+ def process_project_location_processor(name, google_cloud_documentai_v1_process_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
340
+ command = make_simple_command(:post, 'v1/{+name}:process', options)
341
+ command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessRequest::Representation
342
+ command.request_object = google_cloud_documentai_v1_process_request_object
343
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse::Representation
344
+ command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse
345
+ command.params['name'] = name unless name.nil?
346
+ command.query['fields'] = fields unless fields.nil?
347
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
348
+ execute_or_queue_command(command, &block)
349
+ end
350
+
351
+ # Send a document for Human Review. The input document should be processed by
352
+ # the specified processor.
353
+ # @param [String] human_review_config
354
+ # Required. The resource name of the HumanReviewConfig that the document will be
355
+ # reviewed with.
356
+ # @param [Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ReviewDocumentRequest] google_cloud_documentai_v1_review_document_request_object
357
+ # @param [String] fields
358
+ # Selector specifying which fields to include in a partial response.
359
+ # @param [String] quota_user
360
+ # Available to use for quota purposes for server-side applications. Can be any
361
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
362
+ # @param [Google::Apis::RequestOptions] options
363
+ # Request-specific options
364
+ #
365
+ # @yield [result, err] Result & error if block supplied
366
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleLongrunningOperation] parsed result object
367
+ # @yieldparam err [StandardError] error object if request failed
368
+ #
369
+ # @return [Google::Apis::DocumentaiV1::GoogleLongrunningOperation]
370
+ #
371
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
372
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
373
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
374
+ def review_project_location_processor_human_review_config_document(human_review_config, google_cloud_documentai_v1_review_document_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
375
+ command = make_simple_command(:post, 'v1/{+humanReviewConfig}:reviewDocument', options)
376
+ command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ReviewDocumentRequest::Representation
377
+ command.request_object = google_cloud_documentai_v1_review_document_request_object
378
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
379
+ command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
380
+ command.params['humanReviewConfig'] = human_review_config unless human_review_config.nil?
381
+ command.query['fields'] = fields unless fields.nil?
382
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
383
+ execute_or_queue_command(command, &block)
384
+ end
385
+
386
+ # LRO endpoint to batch process many documents. The output is written to Cloud
387
+ # Storage as JSON in the [Document] format.
388
+ # @param [String] name
389
+ # Required. The resource name of Processor or ProcessorVersion. Format: projects/
390
+ # `project`/locations/`location`/processors/`processor`, or projects/`project`/
391
+ # locations/`location`/processors/`processor`/processorVersions/`
392
+ # processorVersion`
393
+ # @param [Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1BatchProcessRequest] google_cloud_documentai_v1_batch_process_request_object
394
+ # @param [String] fields
395
+ # Selector specifying which fields to include in a partial response.
396
+ # @param [String] quota_user
397
+ # Available to use for quota purposes for server-side applications. Can be any
398
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
399
+ # @param [Google::Apis::RequestOptions] options
400
+ # Request-specific options
401
+ #
402
+ # @yield [result, err] Result & error if block supplied
403
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleLongrunningOperation] parsed result object
404
+ # @yieldparam err [StandardError] error object if request failed
405
+ #
406
+ # @return [Google::Apis::DocumentaiV1::GoogleLongrunningOperation]
407
+ #
408
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
409
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
410
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
411
+ def batch_project_location_processor_processor_version_process(name, google_cloud_documentai_v1_batch_process_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
412
+ command = make_simple_command(:post, 'v1/{+name}:batchProcess', options)
413
+ command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1BatchProcessRequest::Representation
414
+ command.request_object = google_cloud_documentai_v1_batch_process_request_object
415
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
416
+ command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
417
+ command.params['name'] = name unless name.nil?
418
+ command.query['fields'] = fields unless fields.nil?
419
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
420
+ execute_or_queue_command(command, &block)
421
+ end
422
+
423
+ # Processes a single document.
424
+ # @param [String] name
425
+ # Required. The resource name of the Processor or ProcessorVersion to use for
426
+ # processing. If a Processor is specified, the server will use its default
427
+ # version. Format: projects/`project`/locations/`location`/processors/`processor`
428
+ # , or projects/`project`/locations/`location`/processors/`processor`/
429
+ # processorVersions/`processorVersion`
430
+ # @param [Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessRequest] google_cloud_documentai_v1_process_request_object
431
+ # @param [String] fields
432
+ # Selector specifying which fields to include in a partial response.
433
+ # @param [String] quota_user
434
+ # Available to use for quota purposes for server-side applications. Can be any
435
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
436
+ # @param [Google::Apis::RequestOptions] options
437
+ # Request-specific options
438
+ #
439
+ # @yield [result, err] Result & error if block supplied
440
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse] parsed result object
441
+ # @yieldparam err [StandardError] error object if request failed
442
+ #
443
+ # @return [Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse]
444
+ #
445
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
446
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
447
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
448
+ def process_project_location_processor_processor_version(name, google_cloud_documentai_v1_process_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
449
+ command = make_simple_command(:post, 'v1/{+name}:process', options)
450
+ command.request_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessRequest::Representation
451
+ command.request_object = google_cloud_documentai_v1_process_request_object
452
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse::Representation
453
+ command.response_class = Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1ProcessResponse
454
+ command.params['name'] = name unless name.nil?
455
+ command.query['fields'] = fields unless fields.nil?
456
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
457
+ execute_or_queue_command(command, &block)
458
+ end
459
+
460
+ # Gets the latest state of a long-running operation. Clients can use this method
461
+ # to poll the operation result at intervals as recommended by the API service.
462
+ # @param [String] name
463
+ # The name of the operation resource.
464
+ # @param [String] fields
465
+ # Selector specifying which fields to include in a partial response.
466
+ # @param [String] quota_user
467
+ # Available to use for quota purposes for server-side applications. Can be any
468
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
469
+ # @param [Google::Apis::RequestOptions] options
470
+ # Request-specific options
471
+ #
472
+ # @yield [result, err] Result & error if block supplied
473
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleLongrunningOperation] parsed result object
474
+ # @yieldparam err [StandardError] error object if request failed
475
+ #
476
+ # @return [Google::Apis::DocumentaiV1::GoogleLongrunningOperation]
477
+ #
478
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
479
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
480
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
481
+ def get_project_operation(name, fields: nil, quota_user: nil, options: nil, &block)
482
+ command = make_simple_command(:get, 'v1/{+name}', options)
483
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
484
+ command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
485
+ command.params['name'] = name unless name.nil?
486
+ command.query['fields'] = fields unless fields.nil?
487
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
488
+ execute_or_queue_command(command, &block)
489
+ end
490
+
491
+ # Gets information about a location.
492
+ # @param [String] name
493
+ # Resource name for the location.
494
+ # @param [String] fields
495
+ # Selector specifying which fields to include in a partial response.
496
+ # @param [String] quota_user
497
+ # Available to use for quota purposes for server-side applications. Can be any
498
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
499
+ # @param [Google::Apis::RequestOptions] options
500
+ # Request-specific options
501
+ #
502
+ # @yield [result, err] Result & error if block supplied
503
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleCloudLocationLocation] parsed result object
504
+ # @yieldparam err [StandardError] error object if request failed
505
+ #
506
+ # @return [Google::Apis::DocumentaiV1::GoogleCloudLocationLocation]
507
+ #
508
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
509
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
510
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
511
+ def get_uiv1beta3_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
512
+ command = make_simple_command(:get, 'uiv1beta3/{+name}', options)
513
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudLocationLocation::Representation
514
+ command.response_class = Google::Apis::DocumentaiV1::GoogleCloudLocationLocation
515
+ command.params['name'] = name unless name.nil?
516
+ command.query['fields'] = fields unless fields.nil?
517
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
518
+ execute_or_queue_command(command, &block)
519
+ end
520
+
521
+ # Lists information about the supported locations for this service.
522
+ # @param [String] name
523
+ # The resource that owns the locations collection, if applicable.
524
+ # @param [String] filter
525
+ # A filter to narrow down results to a preferred subset. The filtering language
526
+ # accepts strings like "displayName=tokyo", and is documented in more detail in [
527
+ # AIP-160](https://google.aip.dev/160).
528
+ # @param [Fixnum] page_size
529
+ # The maximum number of results to return. If not set, the service will select a
530
+ # default.
531
+ # @param [String] page_token
532
+ # A page token received from the `next_page_token` field in the response. Send
533
+ # that page token to receive the subsequent page.
534
+ # @param [String] fields
535
+ # Selector specifying which fields to include in a partial response.
536
+ # @param [String] quota_user
537
+ # Available to use for quota purposes for server-side applications. Can be any
538
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
539
+ # @param [Google::Apis::RequestOptions] options
540
+ # Request-specific options
541
+ #
542
+ # @yield [result, err] Result & error if block supplied
543
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleCloudLocationListLocationsResponse] parsed result object
544
+ # @yieldparam err [StandardError] error object if request failed
545
+ #
546
+ # @return [Google::Apis::DocumentaiV1::GoogleCloudLocationListLocationsResponse]
547
+ #
548
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
549
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
550
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
551
+ def list_uiv1beta3_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
552
+ command = make_simple_command(:get, 'uiv1beta3/{+name}/locations', options)
553
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleCloudLocationListLocationsResponse::Representation
554
+ command.response_class = Google::Apis::DocumentaiV1::GoogleCloudLocationListLocationsResponse
555
+ command.params['name'] = name unless name.nil?
556
+ command.query['filter'] = filter unless filter.nil?
557
+ command.query['pageSize'] = page_size unless page_size.nil?
558
+ command.query['pageToken'] = page_token unless page_token.nil?
559
+ command.query['fields'] = fields unless fields.nil?
560
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
561
+ execute_or_queue_command(command, &block)
562
+ end
563
+
564
+ # Gets the latest state of a long-running operation. Clients can use this method
565
+ # to poll the operation result at intervals as recommended by the API service.
566
+ # @param [String] name
567
+ # The name of the operation resource.
568
+ # @param [String] fields
569
+ # Selector specifying which fields to include in a partial response.
570
+ # @param [String] quota_user
571
+ # Available to use for quota purposes for server-side applications. Can be any
572
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
573
+ # @param [Google::Apis::RequestOptions] options
574
+ # Request-specific options
575
+ #
576
+ # @yield [result, err] Result & error if block supplied
577
+ # @yieldparam result [Google::Apis::DocumentaiV1::GoogleLongrunningOperation] parsed result object
578
+ # @yieldparam err [StandardError] error object if request failed
579
+ #
580
+ # @return [Google::Apis::DocumentaiV1::GoogleLongrunningOperation]
581
+ #
582
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
583
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
584
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
585
+ def get_uiv1beta3_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
586
+ command = make_simple_command(:get, 'uiv1beta3/{+name}', options)
587
+ command.response_representation = Google::Apis::DocumentaiV1::GoogleLongrunningOperation::Representation
588
+ command.response_class = Google::Apis::DocumentaiV1::GoogleLongrunningOperation
589
+ command.params['name'] = name unless name.nil?
590
+ command.query['fields'] = fields unless fields.nil?
591
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
592
+ execute_or_queue_command(command, &block)
593
+ end
594
+
595
+ protected
596
+
597
+ def apply_command_defaults(command)
598
+ command.query['key'] = key unless key.nil?
599
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
600
+ end
601
+ end
602
+ end
603
+ end
604
+ end