google-cloud-document_ai-v1beta3 0.24.0 → 0.26.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 874c654f8cfe406c08fae1cb6b257e899672238d977cfa5f174ffcef633394b3
4
- data.tar.gz: ea4546e6df5ddbc579da1f9658fe3a6b680e6d6d1b56c5fc212fda0135973555
3
+ metadata.gz: 862dff0c398d9cde485ea687836cc8f545419df08ca1a7244c456fd6ed80b949
4
+ data.tar.gz: a86ffaa639b4446d477f30628f9f9cfc01c14251b7afa3b201b11bf0e9f0fb9f
5
5
  SHA512:
6
- metadata.gz: f5b707d9a7d247a2805a65420dbd938f5c51d010a152ef9104ca8510900d93d419b6975eabbeb700f9d5ec292d2edacc5665d86bf39bc27d9e82ba3c7131790a
7
- data.tar.gz: 8184c01a1597bda5985cc3389f73612890ebc661dde4d527c8c00a76bc0d97bfe31331c04c77856f36cff631a0ffcadc27f0554993046be67cc988ade211d52e
6
+ metadata.gz: c1fd5961a5360be321993039116e5203594d2e85c734a9e8a88ac926921aaf5876dce78a277275fe5f6b5ebda5907297567df86bc9975e0582f51d14cd6c1674
7
+ data.tar.gz: 6b9a7c0d3748f70a3fa07692e409fd334edbcd7e0455110db52e03f6e81676f875b92e9e99261add25427a95d8d1b631208991ed6af527244c84afa0d033c286
@@ -202,7 +202,7 @@ module Google
202
202
  # @param options [::Gapic::CallOptions, ::Hash]
203
203
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
204
204
  #
205
- # @overload process_document(inline_document: nil, raw_document: nil, name: nil, document: nil, skip_human_review: nil, field_mask: nil, process_options: nil)
205
+ # @overload process_document(inline_document: nil, raw_document: nil, gcs_document: nil, name: nil, document: nil, skip_human_review: nil, field_mask: nil, process_options: nil)
206
206
  # Pass arguments to `process_document` via keyword arguments. Note that at
207
207
  # least one keyword argument is required. To specify no parameters, or to keep all
208
208
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -211,6 +211,8 @@ module Google
211
211
  # An inline document proto.
212
212
  # @param raw_document [::Google::Cloud::DocumentAI::V1beta3::RawDocument, ::Hash]
213
213
  # A raw document content (bytes).
214
+ # @param gcs_document [::Google::Cloud::DocumentAI::V1beta3::GcsDocument, ::Hash]
215
+ # A raw document on Google Cloud Storage.
214
216
  # @param name [::String]
215
217
  # Required. The resource name of the
216
218
  # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or
@@ -2329,7 +2331,7 @@ module Google
2329
2331
  # @param options [::Gapic::CallOptions, ::Hash]
2330
2332
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2331
2333
  #
2332
- # @overload import_processor_version(processor_version_source: nil, parent: nil)
2334
+ # @overload import_processor_version(processor_version_source: nil, external_processor_version_source: nil, parent: nil)
2333
2335
  # Pass arguments to `import_processor_version` via keyword arguments. Note that at
2334
2336
  # least one keyword argument is required. To specify no parameters, or to keep all
2335
2337
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -2337,6 +2339,9 @@ module Google
2337
2339
  # @param processor_version_source [::String]
2338
2340
  # The source processor version to import from. The source processor version
2339
2341
  # and destination processor need to be in the same environment and region.
2342
+ # @param external_processor_version_source [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest::ExternalProcessorVersionSource, ::Hash]
2343
+ # The source processor version to import from, and can be from different
2344
+ # environment and region than the destination processor.
2340
2345
  # @param parent [::String]
2341
2346
  # Required. The destination processor name to create the processor version
2342
2347
  # in. Format:
@@ -194,7 +194,7 @@ module Google
194
194
  # @param options [::Gapic::CallOptions, ::Hash]
195
195
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
196
196
  #
197
- # @overload process_document(inline_document: nil, raw_document: nil, name: nil, document: nil, skip_human_review: nil, field_mask: nil, process_options: nil)
197
+ # @overload process_document(inline_document: nil, raw_document: nil, gcs_document: nil, name: nil, document: nil, skip_human_review: nil, field_mask: nil, process_options: nil)
198
198
  # Pass arguments to `process_document` via keyword arguments. Note that at
199
199
  # least one keyword argument is required. To specify no parameters, or to keep all
200
200
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -203,6 +203,8 @@ module Google
203
203
  # An inline document proto.
204
204
  # @param raw_document [::Google::Cloud::DocumentAI::V1beta3::RawDocument, ::Hash]
205
205
  # A raw document content (bytes).
206
+ # @param gcs_document [::Google::Cloud::DocumentAI::V1beta3::GcsDocument, ::Hash]
207
+ # A raw document on Google Cloud Storage.
206
208
  # @param name [::String]
207
209
  # Required. The resource name of the
208
210
  # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or
@@ -1722,7 +1724,7 @@ module Google
1722
1724
  # @param options [::Gapic::CallOptions, ::Hash]
1723
1725
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1724
1726
  #
1725
- # @overload import_processor_version(processor_version_source: nil, parent: nil)
1727
+ # @overload import_processor_version(processor_version_source: nil, external_processor_version_source: nil, parent: nil)
1726
1728
  # Pass arguments to `import_processor_version` via keyword arguments. Note that at
1727
1729
  # least one keyword argument is required. To specify no parameters, or to keep all
1728
1730
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1730,6 +1732,9 @@ module Google
1730
1732
  # @param processor_version_source [::String]
1731
1733
  # The source processor version to import from. The source processor version
1732
1734
  # and destination processor need to be in the same environment and region.
1735
+ # @param external_processor_version_source [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest::ExternalProcessorVersionSource, ::Hash]
1736
+ # The source processor version to import from, and can be from different
1737
+ # environment and region than the destination processor.
1733
1738
  # @param parent [::String]
1734
1739
  # Required. The destination processor name to create the processor version
1735
1740
  # in. Format:
@@ -267,6 +267,299 @@ module Google
267
267
  raise ::Google::Cloud::Error.from_error(e)
268
268
  end
269
269
 
270
+ ##
271
+ # Import documents into a dataset.
272
+ #
273
+ # @overload import_documents(request, options = nil)
274
+ # Pass arguments to `import_documents` via a request object, either of type
275
+ # {::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest} or an equivalent Hash.
276
+ #
277
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest, ::Hash]
278
+ # A request object representing the call parameters. Required. To specify no
279
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
280
+ # @param options [::Gapic::CallOptions, ::Hash]
281
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
282
+ #
283
+ # @overload import_documents(dataset: nil, batch_documents_import_configs: nil)
284
+ # Pass arguments to `import_documents` via keyword arguments. Note that at
285
+ # least one keyword argument is required. To specify no parameters, or to keep all
286
+ # the default parameter values, pass an empty Hash as a request object (see above).
287
+ #
288
+ # @param dataset [::String]
289
+ # Required. The dataset resource name.
290
+ # Format:
291
+ # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset
292
+ # @param batch_documents_import_configs [::Array<::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest::BatchDocumentsImportConfig, ::Hash>]
293
+ # Required. The Cloud Storage uri containing raw documents that must be
294
+ # imported.
295
+ #
296
+ # @yield [response, operation] Access the result along with the RPC operation
297
+ # @yieldparam response [::Gapic::Operation]
298
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
299
+ #
300
+ # @return [::Gapic::Operation]
301
+ #
302
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
303
+ #
304
+ # @example Basic example
305
+ # require "google/cloud/document_ai/v1beta3"
306
+ #
307
+ # # Create a client object. The client can be reused for multiple calls.
308
+ # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new
309
+ #
310
+ # # Create a request. To set request fields, pass in keyword arguments.
311
+ # request = Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new
312
+ #
313
+ # # Call the import_documents method.
314
+ # result = client.import_documents request
315
+ #
316
+ # # The returned object is of type Gapic::Operation. You can use it to
317
+ # # check the status of an operation, cancel it, or wait for results.
318
+ # # Here is how to wait for a response.
319
+ # result.wait_until_done! timeout: 60
320
+ # if result.response?
321
+ # p result.response
322
+ # else
323
+ # puts "No response received."
324
+ # end
325
+ #
326
+ def import_documents request, options = nil
327
+ raise ::ArgumentError, "request must be provided" if request.nil?
328
+
329
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest
330
+
331
+ # Converts hash and nil to an options object
332
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
333
+
334
+ # Customize the options with defaults
335
+ metadata = @config.rpcs.import_documents.metadata.to_h
336
+
337
+ # Set x-goog-api-client and x-goog-user-project headers
338
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
339
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
340
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
341
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
342
+
343
+ header_params = {}
344
+ if request.dataset
345
+ header_params["dataset"] = request.dataset
346
+ end
347
+
348
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
349
+ metadata[:"x-goog-request-params"] ||= request_params_header
350
+
351
+ options.apply_defaults timeout: @config.rpcs.import_documents.timeout,
352
+ metadata: metadata,
353
+ retry_policy: @config.rpcs.import_documents.retry_policy
354
+
355
+ options.apply_defaults timeout: @config.timeout,
356
+ metadata: @config.metadata,
357
+ retry_policy: @config.retry_policy
358
+
359
+ @document_service_stub.call_rpc :import_documents, request, options: options do |response, operation|
360
+ response = ::Gapic::Operation.new response, @operations_client, options: options
361
+ yield response, operation if block_given?
362
+ return response
363
+ end
364
+ rescue ::GRPC::BadStatus => e
365
+ raise ::Google::Cloud::Error.from_error(e)
366
+ end
367
+
368
+ ##
369
+ # Returns relevant fields present in the requested document.
370
+ #
371
+ # @overload get_document(request, options = nil)
372
+ # Pass arguments to `get_document` via a request object, either of type
373
+ # {::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest} or an equivalent Hash.
374
+ #
375
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest, ::Hash]
376
+ # A request object representing the call parameters. Required. To specify no
377
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
378
+ # @param options [::Gapic::CallOptions, ::Hash]
379
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
380
+ #
381
+ # @overload get_document(dataset: nil, document_id: nil, read_mask: nil, page_range: nil)
382
+ # Pass arguments to `get_document` via keyword arguments. Note that at
383
+ # least one keyword argument is required. To specify no parameters, or to keep all
384
+ # the default parameter values, pass an empty Hash as a request object (see above).
385
+ #
386
+ # @param dataset [::String]
387
+ # Required. The resource name of the dataset that the document belongs to .
388
+ # Format:
389
+ # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset
390
+ # @param document_id [::Google::Cloud::DocumentAI::V1beta3::DocumentId, ::Hash]
391
+ # Required. Document identifier.
392
+ # @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
393
+ # If set, only fields listed here will be returned. Otherwise, all fields
394
+ # will be returned by default.
395
+ # @param page_range [::Google::Cloud::DocumentAI::V1beta3::DocumentPageRange, ::Hash]
396
+ # List of pages for which the fields specified in the `read_mask` must
397
+ # be served.
398
+ #
399
+ # @yield [response, operation] Access the result along with the RPC operation
400
+ # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse]
401
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
402
+ #
403
+ # @return [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse]
404
+ #
405
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
406
+ #
407
+ # @example Basic example
408
+ # require "google/cloud/document_ai/v1beta3"
409
+ #
410
+ # # Create a client object. The client can be reused for multiple calls.
411
+ # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new
412
+ #
413
+ # # Create a request. To set request fields, pass in keyword arguments.
414
+ # request = Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new
415
+ #
416
+ # # Call the get_document method.
417
+ # result = client.get_document request
418
+ #
419
+ # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse.
420
+ # p result
421
+ #
422
+ def get_document request, options = nil
423
+ raise ::ArgumentError, "request must be provided" if request.nil?
424
+
425
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest
426
+
427
+ # Converts hash and nil to an options object
428
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
429
+
430
+ # Customize the options with defaults
431
+ metadata = @config.rpcs.get_document.metadata.to_h
432
+
433
+ # Set x-goog-api-client and x-goog-user-project headers
434
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
435
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
436
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
437
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
438
+
439
+ header_params = {}
440
+ if request.dataset
441
+ header_params["dataset"] = request.dataset
442
+ end
443
+
444
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
445
+ metadata[:"x-goog-request-params"] ||= request_params_header
446
+
447
+ options.apply_defaults timeout: @config.rpcs.get_document.timeout,
448
+ metadata: metadata,
449
+ retry_policy: @config.rpcs.get_document.retry_policy
450
+
451
+ options.apply_defaults timeout: @config.timeout,
452
+ metadata: @config.metadata,
453
+ retry_policy: @config.retry_policy
454
+
455
+ @document_service_stub.call_rpc :get_document, request, options: options do |response, operation|
456
+ yield response, operation if block_given?
457
+ return response
458
+ end
459
+ rescue ::GRPC::BadStatus => e
460
+ raise ::Google::Cloud::Error.from_error(e)
461
+ end
462
+
463
+ ##
464
+ # Deletes a set of documents.
465
+ #
466
+ # @overload batch_delete_documents(request, options = nil)
467
+ # Pass arguments to `batch_delete_documents` via a request object, either of type
468
+ # {::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest} or an equivalent Hash.
469
+ #
470
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest, ::Hash]
471
+ # A request object representing the call parameters. Required. To specify no
472
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
473
+ # @param options [::Gapic::CallOptions, ::Hash]
474
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
475
+ #
476
+ # @overload batch_delete_documents(dataset: nil, dataset_documents: nil)
477
+ # Pass arguments to `batch_delete_documents` via keyword arguments. Note that at
478
+ # least one keyword argument is required. To specify no parameters, or to keep all
479
+ # the default parameter values, pass an empty Hash as a request object (see above).
480
+ #
481
+ # @param dataset [::String]
482
+ # Required. The dataset resource name.
483
+ # Format:
484
+ # projects/\\{project}/locations/\\{location}/processors/\\{processor}/dataset
485
+ # @param dataset_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDatasetDocuments, ::Hash]
486
+ # Required. Dataset documents input. If given `filter`, all documents
487
+ # satisfying the filter will be deleted. If given documentIds, a maximum of
488
+ # 50 documents can be deleted in a batch. The request will be rejected if
489
+ # more than 50 document_ids are provided.
490
+ #
491
+ # @yield [response, operation] Access the result along with the RPC operation
492
+ # @yieldparam response [::Gapic::Operation]
493
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
494
+ #
495
+ # @return [::Gapic::Operation]
496
+ #
497
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
498
+ #
499
+ # @example Basic example
500
+ # require "google/cloud/document_ai/v1beta3"
501
+ #
502
+ # # Create a client object. The client can be reused for multiple calls.
503
+ # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new
504
+ #
505
+ # # Create a request. To set request fields, pass in keyword arguments.
506
+ # request = Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new
507
+ #
508
+ # # Call the batch_delete_documents method.
509
+ # result = client.batch_delete_documents request
510
+ #
511
+ # # The returned object is of type Gapic::Operation. You can use it to
512
+ # # check the status of an operation, cancel it, or wait for results.
513
+ # # Here is how to wait for a response.
514
+ # result.wait_until_done! timeout: 60
515
+ # if result.response?
516
+ # p result.response
517
+ # else
518
+ # puts "No response received."
519
+ # end
520
+ #
521
+ def batch_delete_documents request, options = nil
522
+ raise ::ArgumentError, "request must be provided" if request.nil?
523
+
524
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest
525
+
526
+ # Converts hash and nil to an options object
527
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
528
+
529
+ # Customize the options with defaults
530
+ metadata = @config.rpcs.batch_delete_documents.metadata.to_h
531
+
532
+ # Set x-goog-api-client and x-goog-user-project headers
533
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
534
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
535
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
536
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
537
+
538
+ header_params = {}
539
+ if request.dataset
540
+ header_params["dataset"] = request.dataset
541
+ end
542
+
543
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
544
+ metadata[:"x-goog-request-params"] ||= request_params_header
545
+
546
+ options.apply_defaults timeout: @config.rpcs.batch_delete_documents.timeout,
547
+ metadata: metadata,
548
+ retry_policy: @config.rpcs.batch_delete_documents.retry_policy
549
+
550
+ options.apply_defaults timeout: @config.timeout,
551
+ metadata: @config.metadata,
552
+ retry_policy: @config.retry_policy
553
+
554
+ @document_service_stub.call_rpc :batch_delete_documents, request, options: options do |response, operation|
555
+ response = ::Gapic::Operation.new response, @operations_client, options: options
556
+ yield response, operation if block_given?
557
+ return response
558
+ end
559
+ rescue ::GRPC::BadStatus => e
560
+ raise ::Google::Cloud::Error.from_error(e)
561
+ end
562
+
270
563
  ##
271
564
  # Gets the `DatasetSchema` of a `Dataset`.
272
565
  #
@@ -587,6 +880,21 @@ module Google
587
880
  #
588
881
  attr_reader :update_dataset
589
882
  ##
883
+ # RPC-specific configuration for `import_documents`
884
+ # @return [::Gapic::Config::Method]
885
+ #
886
+ attr_reader :import_documents
887
+ ##
888
+ # RPC-specific configuration for `get_document`
889
+ # @return [::Gapic::Config::Method]
890
+ #
891
+ attr_reader :get_document
892
+ ##
893
+ # RPC-specific configuration for `batch_delete_documents`
894
+ # @return [::Gapic::Config::Method]
895
+ #
896
+ attr_reader :batch_delete_documents
897
+ ##
590
898
  # RPC-specific configuration for `get_dataset_schema`
591
899
  # @return [::Gapic::Config::Method]
592
900
  #
@@ -601,6 +909,12 @@ module Google
601
909
  def initialize parent_rpcs = nil
602
910
  update_dataset_config = parent_rpcs.update_dataset if parent_rpcs.respond_to? :update_dataset
603
911
  @update_dataset = ::Gapic::Config::Method.new update_dataset_config
912
+ import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents
913
+ @import_documents = ::Gapic::Config::Method.new import_documents_config
914
+ get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document
915
+ @get_document = ::Gapic::Config::Method.new get_document_config
916
+ batch_delete_documents_config = parent_rpcs.batch_delete_documents if parent_rpcs.respond_to? :batch_delete_documents
917
+ @batch_delete_documents = ::Gapic::Config::Method.new batch_delete_documents_config
604
918
  get_dataset_schema_config = parent_rpcs.get_dataset_schema if parent_rpcs.respond_to? :get_dataset_schema
605
919
  @get_dataset_schema = ::Gapic::Config::Method.new get_dataset_schema_config
606
920
  update_dataset_schema_config = parent_rpcs.update_dataset_schema if parent_rpcs.respond_to? :update_dataset_schema