google-cloud-document_ai-v1beta3 0.21.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +110 -4
  4. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb +5 -3
  5. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb +80 -4
  6. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb +9 -7
  7. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb +82 -22
  8. data/lib/google/cloud/document_ai/v1beta3/version.rb +1 -1
  9. data/lib/google/cloud/documentai/v1beta3/barcode_pb.rb +24 -6
  10. data/lib/google/cloud/documentai/v1beta3/document_io_pb.rb +25 -45
  11. data/lib/google/cloud/documentai/v1beta3/document_pb.rb +33 -265
  12. data/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb +37 -259
  13. data/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb +2 -0
  14. data/lib/google/cloud/documentai/v1beta3/document_schema_pb.rb +24 -37
  15. data/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb +25 -52
  16. data/lib/google/cloud/documentai/v1beta3/geometry_pb.rb +24 -13
  17. data/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb +25 -16
  18. data/lib/google/cloud/documentai/v1beta3/processor_pb.rb +27 -47
  19. data/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb +24 -13
  20. data/proto_docs/google/api/client.rb +67 -4
  21. data/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb +42 -0
  22. data/proto_docs/google/protobuf/any.rb +7 -4
  23. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  24. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f96e06f5993662b4d9d77466576f9f7f6d65ae47f546bf70e4ec5694de7760aa
4
- data.tar.gz: ed4cd004c4dfaf3ecfc7c188d5bc7e2130063126e753d8115c7d7cf0232012ce
3
+ metadata.gz: 60d67b5bc0dc4a9e2a194fffeec7f521f254b2b3e807241b859b4f63722e3afa
4
+ data.tar.gz: 48e6d0622a02f4268d6ca4b588eb505605c2fbbd851aae11e5a5e5b5af0e8386
5
5
  SHA512:
6
- metadata.gz: cbcefbb8b3de4db4ec03976deaf9b755a84df1f30c69eb8d34f6f6b09a49d8b5b413f02c60d731c91b153ecee88d3b64734f898ab4459f008ebda7d25faed065
7
- data.tar.gz: 2121af5cbe6c114fb5ce14d0faf79e351f476fa82b6308bfbe32bd6031071f074192e988ffef2e440d6e9d5f351d88abdf537b15c2d7de552713024d2e37bf9b
6
+ metadata.gz: '08699863619993f0864b4d3669e957c5780d7a457f4aa3db237c7192f5f50068ae4ed8505837f6193b471146324e4a5a81d7055849e2a643a09dbac1b15f9c88'
7
+ data.tar.gz: 3df39d6e1ca108dc843f2ea4e241f6258382a28f5efe79013c37de849bfdbb31de753bca5b79072ecb7d387976faa243609a5e9754adc3ada54bfd012e755c94
data/README.md CHANGED
@@ -47,7 +47,7 @@ for general usage information.
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
49
  The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
50
+ or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
53
 
@@ -142,7 +142,7 @@ module Google
142
142
  credentials = @config.credentials
143
143
  # Use self-signed JWT if the endpoint is unchanged from default,
144
144
  # but only if the default endpoint does not have a region prefix.
145
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
145
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
146
146
  !@config.endpoint.split(".").first.include?("-")
147
147
  credentials ||= Credentials.default scope: @config.scope,
148
148
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -2302,6 +2302,103 @@ module Google
2302
2302
  raise ::Google::Cloud::Error.from_error(e)
2303
2303
  end
2304
2304
 
2305
+ ##
2306
+ # Imports a processor version from source processor version.
2307
+ #
2308
+ # @overload import_processor_version(request, options = nil)
2309
+ # Pass arguments to `import_processor_version` via a request object, either of type
2310
+ # {::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest} or an equivalent Hash.
2311
+ #
2312
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest, ::Hash]
2313
+ # A request object representing the call parameters. Required. To specify no
2314
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2315
+ # @param options [::Gapic::CallOptions, ::Hash]
2316
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2317
+ #
2318
+ # @overload import_processor_version(processor_version_source: nil, parent: nil)
2319
+ # Pass arguments to `import_processor_version` via keyword arguments. Note that at
2320
+ # least one keyword argument is required. To specify no parameters, or to keep all
2321
+ # the default parameter values, pass an empty Hash as a request object (see above).
2322
+ #
2323
+ # @param processor_version_source [::String]
2324
+ # The source processor version to import from.
2325
+ # @param parent [::String]
2326
+ # Required. The destination processor name to create the processor version
2327
+ # in. Format:
2328
+ # `projects/{project}/locations/{location}/processors/{processor}`
2329
+ #
2330
+ # @yield [response, operation] Access the result along with the RPC operation
2331
+ # @yieldparam response [::Gapic::Operation]
2332
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2333
+ #
2334
+ # @return [::Gapic::Operation]
2335
+ #
2336
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2337
+ #
2338
+ # @example Basic example
2339
+ # require "google/cloud/document_ai/v1beta3"
2340
+ #
2341
+ # # Create a client object. The client can be reused for multiple calls.
2342
+ # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
2343
+ #
2344
+ # # Create a request. To set request fields, pass in keyword arguments.
2345
+ # request = Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new
2346
+ #
2347
+ # # Call the import_processor_version method.
2348
+ # result = client.import_processor_version request
2349
+ #
2350
+ # # The returned object is of type Gapic::Operation. You can use it to
2351
+ # # check the status of an operation, cancel it, or wait for results.
2352
+ # # Here is how to wait for a response.
2353
+ # result.wait_until_done! timeout: 60
2354
+ # if result.response?
2355
+ # p result.response
2356
+ # else
2357
+ # puts "No response received."
2358
+ # end
2359
+ #
2360
+ def import_processor_version request, options = nil
2361
+ raise ::ArgumentError, "request must be provided" if request.nil?
2362
+
2363
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest
2364
+
2365
+ # Converts hash and nil to an options object
2366
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2367
+
2368
+ # Customize the options with defaults
2369
+ metadata = @config.rpcs.import_processor_version.metadata.to_h
2370
+
2371
+ # Set x-goog-api-client and x-goog-user-project headers
2372
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2373
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2374
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
2375
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2376
+
2377
+ header_params = {}
2378
+ if request.parent
2379
+ header_params["parent"] = request.parent
2380
+ end
2381
+
2382
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2383
+ metadata[:"x-goog-request-params"] ||= request_params_header
2384
+
2385
+ options.apply_defaults timeout: @config.rpcs.import_processor_version.timeout,
2386
+ metadata: metadata,
2387
+ retry_policy: @config.rpcs.import_processor_version.retry_policy
2388
+
2389
+ options.apply_defaults timeout: @config.timeout,
2390
+ metadata: @config.metadata,
2391
+ retry_policy: @config.retry_policy
2392
+
2393
+ @document_processor_service_stub.call_rpc :import_processor_version, request, options: options do |response, operation|
2394
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2395
+ yield response, operation if block_given?
2396
+ return response
2397
+ end
2398
+ rescue ::GRPC::BadStatus => e
2399
+ raise ::Google::Cloud::Error.from_error(e)
2400
+ end
2401
+
2305
2402
  ##
2306
2403
  # Configuration class for the DocumentProcessorService API.
2307
2404
  #
@@ -2340,9 +2437,9 @@ module Google
2340
2437
  # * (`String`) The path to a service account key file in JSON format
2341
2438
  # * (`Hash`) A service account key as a Hash
2342
2439
  # * (`Google::Auth::Credentials`) A googleauth credentials object
2343
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2440
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2344
2441
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2345
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2442
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2346
2443
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2347
2444
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2348
2445
  # * (`nil`) indicating no credentials
@@ -2384,7 +2481,9 @@ module Google
2384
2481
  class Configuration
2385
2482
  extend ::Gapic::Config
2386
2483
 
2387
- config_attr :endpoint, "documentai.googleapis.com", ::String
2484
+ DEFAULT_ENDPOINT = "documentai.googleapis.com"
2485
+
2486
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
2388
2487
  config_attr :credentials, nil do |value|
2389
2488
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2390
2489
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -2547,6 +2646,11 @@ module Google
2547
2646
  # @return [::Gapic::Config::Method]
2548
2647
  #
2549
2648
  attr_reader :list_evaluations
2649
+ ##
2650
+ # RPC-specific configuration for `import_processor_version`
2651
+ # @return [::Gapic::Config::Method]
2652
+ #
2653
+ attr_reader :import_processor_version
2550
2654
 
2551
2655
  # @private
2552
2656
  def initialize parent_rpcs = nil
@@ -2594,6 +2698,8 @@ module Google
2594
2698
  @get_evaluation = ::Gapic::Config::Method.new get_evaluation_config
2595
2699
  list_evaluations_config = parent_rpcs.list_evaluations if parent_rpcs.respond_to? :list_evaluations
2596
2700
  @list_evaluations = ::Gapic::Config::Method.new list_evaluations_config
2701
+ import_processor_version_config = parent_rpcs.import_processor_version if parent_rpcs.respond_to? :import_processor_version
2702
+ @import_processor_version = ::Gapic::Config::Method.new import_processor_version_config
2597
2703
 
2598
2704
  yield self if block_given?
2599
2705
  end
@@ -620,9 +620,9 @@ module Google
620
620
  # * (`String`) The path to a service account key file in JSON format
621
621
  # * (`Hash`) A service account key as a Hash
622
622
  # * (`Google::Auth::Credentials`) A googleauth credentials object
623
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
623
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
624
624
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
625
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
625
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
626
626
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
627
627
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
628
628
  # * (`nil`) indicating no credentials
@@ -664,7 +664,9 @@ module Google
664
664
  class Configuration
665
665
  extend ::Gapic::Config
666
666
 
667
- config_attr :endpoint, "documentai.googleapis.com", ::String
667
+ DEFAULT_ENDPOINT = "documentai.googleapis.com"
668
+
669
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
668
670
  config_attr :credentials, nil do |value|
669
671
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
670
672
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -138,7 +138,7 @@ module Google
138
138
  credentials = @config.credentials
139
139
  # Use self-signed JWT if the endpoint is unchanged from default,
140
140
  # but only if the default endpoint does not have a region prefix.
141
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
141
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
142
  !@config.endpoint.split(".").first.include?("-")
143
143
  credentials ||= Credentials.default scope: @config.scope,
144
144
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -1695,6 +1695,73 @@ module Google
1695
1695
  raise ::Google::Cloud::Error.from_error(e)
1696
1696
  end
1697
1697
 
1698
+ ##
1699
+ # Imports a processor version from source processor version.
1700
+ #
1701
+ # @overload import_processor_version(request, options = nil)
1702
+ # Pass arguments to `import_processor_version` via a request object, either of type
1703
+ # {::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest} or an equivalent Hash.
1704
+ #
1705
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest, ::Hash]
1706
+ # A request object representing the call parameters. Required. To specify no
1707
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1708
+ # @param options [::Gapic::CallOptions, ::Hash]
1709
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1710
+ #
1711
+ # @overload import_processor_version(processor_version_source: nil, parent: nil)
1712
+ # Pass arguments to `import_processor_version` via keyword arguments. Note that at
1713
+ # least one keyword argument is required. To specify no parameters, or to keep all
1714
+ # the default parameter values, pass an empty Hash as a request object (see above).
1715
+ #
1716
+ # @param processor_version_source [::String]
1717
+ # The source processor version to import from.
1718
+ # @param parent [::String]
1719
+ # Required. The destination processor name to create the processor version
1720
+ # in. Format:
1721
+ # `projects/{project}/locations/{location}/processors/{processor}`
1722
+ # @yield [result, operation] Access the result along with the TransportOperation object
1723
+ # @yieldparam result [::Gapic::Operation]
1724
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1725
+ #
1726
+ # @return [::Gapic::Operation]
1727
+ #
1728
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1729
+ def import_processor_version request, options = nil
1730
+ raise ::ArgumentError, "request must be provided" if request.nil?
1731
+
1732
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest
1733
+
1734
+ # Converts hash and nil to an options object
1735
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1736
+
1737
+ # Customize the options with defaults
1738
+ call_metadata = @config.rpcs.import_processor_version.metadata.to_h
1739
+
1740
+ # Set x-goog-api-client and x-goog-user-project headers
1741
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1742
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1743
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
1744
+ transports_version_send: [:rest]
1745
+
1746
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1747
+
1748
+ options.apply_defaults timeout: @config.rpcs.import_processor_version.timeout,
1749
+ metadata: call_metadata,
1750
+ retry_policy: @config.rpcs.import_processor_version.retry_policy
1751
+
1752
+ options.apply_defaults timeout: @config.timeout,
1753
+ metadata: @config.metadata,
1754
+ retry_policy: @config.retry_policy
1755
+
1756
+ @document_processor_service_stub.import_processor_version request, options do |result, operation|
1757
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1758
+ yield result, operation if block_given?
1759
+ return result
1760
+ end
1761
+ rescue ::Gapic::Rest::Error => e
1762
+ raise ::Google::Cloud::Error.from_error(e)
1763
+ end
1764
+
1698
1765
  ##
1699
1766
  # Configuration class for the DocumentProcessorService REST API.
1700
1767
  #
@@ -1733,9 +1800,9 @@ module Google
1733
1800
  # * (`String`) The path to a service account key file in JSON format
1734
1801
  # * (`Hash`) A service account key as a Hash
1735
1802
  # * (`Google::Auth::Credentials`) A googleauth credentials object
1736
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1803
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1737
1804
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1738
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1805
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1739
1806
  # * (`nil`) indicating no credentials
1740
1807
  # @return [::Object]
1741
1808
  # @!attribute [rw] scope
@@ -1768,7 +1835,9 @@ module Google
1768
1835
  class Configuration
1769
1836
  extend ::Gapic::Config
1770
1837
 
1771
- config_attr :endpoint, "documentai.googleapis.com", ::String
1838
+ DEFAULT_ENDPOINT = "documentai.googleapis.com"
1839
+
1840
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1772
1841
  config_attr :credentials, nil do |value|
1773
1842
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1774
1843
  allowed.any? { |klass| klass === value }
@@ -1935,6 +2004,11 @@ module Google
1935
2004
  # @return [::Gapic::Config::Method]
1936
2005
  #
1937
2006
  attr_reader :list_evaluations
2007
+ ##
2008
+ # RPC-specific configuration for `import_processor_version`
2009
+ # @return [::Gapic::Config::Method]
2010
+ #
2011
+ attr_reader :import_processor_version
1938
2012
 
1939
2013
  # @private
1940
2014
  def initialize parent_rpcs = nil
@@ -1982,6 +2056,8 @@ module Google
1982
2056
  @get_evaluation = ::Gapic::Config::Method.new get_evaluation_config
1983
2057
  list_evaluations_config = parent_rpcs.list_evaluations if parent_rpcs.respond_to? :list_evaluations
1984
2058
  @list_evaluations = ::Gapic::Config::Method.new list_evaluations_config
2059
+ import_processor_version_config = parent_rpcs.import_processor_version if parent_rpcs.respond_to? :import_processor_version
2060
+ @import_processor_version = ::Gapic::Config::Method.new import_processor_version_config
1985
2061
 
1986
2062
  yield self if block_given?
1987
2063
  end
@@ -411,9 +411,9 @@ module Google
411
411
  # * (`String`) The path to a service account key file in JSON format
412
412
  # * (`Hash`) A service account key as a Hash
413
413
  # * (`Google::Auth::Credentials`) A googleauth credentials object
414
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
414
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
415
415
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
416
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
416
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
417
417
  # * (`nil`) indicating no credentials
418
418
  # @return [::Object]
419
419
  # @!attribute [rw] scope
@@ -446,7 +446,9 @@ module Google
446
446
  class Configuration
447
447
  extend ::Gapic::Config
448
448
 
449
- config_attr :endpoint, "documentai.googleapis.com", ::String
449
+ DEFAULT_ENDPOINT = "documentai.googleapis.com"
450
+
451
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
450
452
  config_attr :credentials, nil do |value|
451
453
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
452
454
  allowed.any? { |klass| klass === value }
@@ -567,7 +569,7 @@ module Google
567
569
 
568
570
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb
569
571
  query_string_params = if query_string_params.any?
570
- query_string_params.to_h { |p| p.split("=", 2) }
572
+ query_string_params.to_h { |p| p.split "=", 2 }
571
573
  else
572
574
  {}
573
575
  end
@@ -605,7 +607,7 @@ module Google
605
607
 
606
608
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb
607
609
  query_string_params = if query_string_params.any?
608
- query_string_params.to_h { |p| p.split("=", 2) }
610
+ query_string_params.to_h { |p| p.split "=", 2 }
609
611
  else
610
612
  {}
611
613
  end
@@ -643,7 +645,7 @@ module Google
643
645
 
644
646
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb
645
647
  query_string_params = if query_string_params.any?
646
- query_string_params.to_h { |p| p.split("=", 2) }
648
+ query_string_params.to_h { |p| p.split "=", 2 }
647
649
  else
648
650
  {}
649
651
  end
@@ -681,7 +683,7 @@ module Google
681
683
 
682
684
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb
683
685
  query_string_params = if query_string_params.any?
684
- query_string_params.to_h { |p| p.split("=", 2) }
686
+ query_string_params.to_h { |p| p.split "=", 2 }
685
687
  else
686
688
  {}
687
689
  end
@@ -59,7 +59,7 @@ module Google
59
59
 
60
60
  verb, uri, query_string_params, body = ServiceStub.transcode_process_document_request request_pb
61
61
  query_string_params = if query_string_params.any?
62
- query_string_params.to_h { |p| p.split("=", 2) }
62
+ query_string_params.to_h { |p| p.split "=", 2 }
63
63
  else
64
64
  {}
65
65
  end
@@ -97,7 +97,7 @@ module Google
97
97
 
98
98
  verb, uri, query_string_params, body = ServiceStub.transcode_batch_process_documents_request request_pb
99
99
  query_string_params = if query_string_params.any?
100
- query_string_params.to_h { |p| p.split("=", 2) }
100
+ query_string_params.to_h { |p| p.split "=", 2 }
101
101
  else
102
102
  {}
103
103
  end
@@ -135,7 +135,7 @@ module Google
135
135
 
136
136
  verb, uri, query_string_params, body = ServiceStub.transcode_fetch_processor_types_request request_pb
137
137
  query_string_params = if query_string_params.any?
138
- query_string_params.to_h { |p| p.split("=", 2) }
138
+ query_string_params.to_h { |p| p.split "=", 2 }
139
139
  else
140
140
  {}
141
141
  end
@@ -173,7 +173,7 @@ module Google
173
173
 
174
174
  verb, uri, query_string_params, body = ServiceStub.transcode_list_processor_types_request request_pb
175
175
  query_string_params = if query_string_params.any?
176
- query_string_params.to_h { |p| p.split("=", 2) }
176
+ query_string_params.to_h { |p| p.split "=", 2 }
177
177
  else
178
178
  {}
179
179
  end
@@ -211,7 +211,7 @@ module Google
211
211
 
212
212
  verb, uri, query_string_params, body = ServiceStub.transcode_get_processor_type_request request_pb
213
213
  query_string_params = if query_string_params.any?
214
- query_string_params.to_h { |p| p.split("=", 2) }
214
+ query_string_params.to_h { |p| p.split "=", 2 }
215
215
  else
216
216
  {}
217
217
  end
@@ -249,7 +249,7 @@ module Google
249
249
 
250
250
  verb, uri, query_string_params, body = ServiceStub.transcode_list_processors_request request_pb
251
251
  query_string_params = if query_string_params.any?
252
- query_string_params.to_h { |p| p.split("=", 2) }
252
+ query_string_params.to_h { |p| p.split "=", 2 }
253
253
  else
254
254
  {}
255
255
  end
@@ -287,7 +287,7 @@ module Google
287
287
 
288
288
  verb, uri, query_string_params, body = ServiceStub.transcode_get_processor_request request_pb
289
289
  query_string_params = if query_string_params.any?
290
- query_string_params.to_h { |p| p.split("=", 2) }
290
+ query_string_params.to_h { |p| p.split "=", 2 }
291
291
  else
292
292
  {}
293
293
  end
@@ -325,7 +325,7 @@ module Google
325
325
 
326
326
  verb, uri, query_string_params, body = ServiceStub.transcode_train_processor_version_request request_pb
327
327
  query_string_params = if query_string_params.any?
328
- query_string_params.to_h { |p| p.split("=", 2) }
328
+ query_string_params.to_h { |p| p.split "=", 2 }
329
329
  else
330
330
  {}
331
331
  end
@@ -363,7 +363,7 @@ module Google
363
363
 
364
364
  verb, uri, query_string_params, body = ServiceStub.transcode_get_processor_version_request request_pb
365
365
  query_string_params = if query_string_params.any?
366
- query_string_params.to_h { |p| p.split("=", 2) }
366
+ query_string_params.to_h { |p| p.split "=", 2 }
367
367
  else
368
368
  {}
369
369
  end
@@ -401,7 +401,7 @@ module Google
401
401
 
402
402
  verb, uri, query_string_params, body = ServiceStub.transcode_list_processor_versions_request request_pb
403
403
  query_string_params = if query_string_params.any?
404
- query_string_params.to_h { |p| p.split("=", 2) }
404
+ query_string_params.to_h { |p| p.split "=", 2 }
405
405
  else
406
406
  {}
407
407
  end
@@ -439,7 +439,7 @@ module Google
439
439
 
440
440
  verb, uri, query_string_params, body = ServiceStub.transcode_delete_processor_version_request request_pb
441
441
  query_string_params = if query_string_params.any?
442
- query_string_params.to_h { |p| p.split("=", 2) }
442
+ query_string_params.to_h { |p| p.split "=", 2 }
443
443
  else
444
444
  {}
445
445
  end
@@ -477,7 +477,7 @@ module Google
477
477
 
478
478
  verb, uri, query_string_params, body = ServiceStub.transcode_deploy_processor_version_request request_pb
479
479
  query_string_params = if query_string_params.any?
480
- query_string_params.to_h { |p| p.split("=", 2) }
480
+ query_string_params.to_h { |p| p.split "=", 2 }
481
481
  else
482
482
  {}
483
483
  end
@@ -515,7 +515,7 @@ module Google
515
515
 
516
516
  verb, uri, query_string_params, body = ServiceStub.transcode_undeploy_processor_version_request request_pb
517
517
  query_string_params = if query_string_params.any?
518
- query_string_params.to_h { |p| p.split("=", 2) }
518
+ query_string_params.to_h { |p| p.split "=", 2 }
519
519
  else
520
520
  {}
521
521
  end
@@ -553,7 +553,7 @@ module Google
553
553
 
554
554
  verb, uri, query_string_params, body = ServiceStub.transcode_create_processor_request request_pb
555
555
  query_string_params = if query_string_params.any?
556
- query_string_params.to_h { |p| p.split("=", 2) }
556
+ query_string_params.to_h { |p| p.split "=", 2 }
557
557
  else
558
558
  {}
559
559
  end
@@ -591,7 +591,7 @@ module Google
591
591
 
592
592
  verb, uri, query_string_params, body = ServiceStub.transcode_delete_processor_request request_pb
593
593
  query_string_params = if query_string_params.any?
594
- query_string_params.to_h { |p| p.split("=", 2) }
594
+ query_string_params.to_h { |p| p.split "=", 2 }
595
595
  else
596
596
  {}
597
597
  end
@@ -629,7 +629,7 @@ module Google
629
629
 
630
630
  verb, uri, query_string_params, body = ServiceStub.transcode_enable_processor_request request_pb
631
631
  query_string_params = if query_string_params.any?
632
- query_string_params.to_h { |p| p.split("=", 2) }
632
+ query_string_params.to_h { |p| p.split "=", 2 }
633
633
  else
634
634
  {}
635
635
  end
@@ -667,7 +667,7 @@ module Google
667
667
 
668
668
  verb, uri, query_string_params, body = ServiceStub.transcode_disable_processor_request request_pb
669
669
  query_string_params = if query_string_params.any?
670
- query_string_params.to_h { |p| p.split("=", 2) }
670
+ query_string_params.to_h { |p| p.split "=", 2 }
671
671
  else
672
672
  {}
673
673
  end
@@ -705,7 +705,7 @@ module Google
705
705
 
706
706
  verb, uri, query_string_params, body = ServiceStub.transcode_set_default_processor_version_request request_pb
707
707
  query_string_params = if query_string_params.any?
708
- query_string_params.to_h { |p| p.split("=", 2) }
708
+ query_string_params.to_h { |p| p.split "=", 2 }
709
709
  else
710
710
  {}
711
711
  end
@@ -743,7 +743,7 @@ module Google
743
743
 
744
744
  verb, uri, query_string_params, body = ServiceStub.transcode_review_document_request request_pb
745
745
  query_string_params = if query_string_params.any?
746
- query_string_params.to_h { |p| p.split("=", 2) }
746
+ query_string_params.to_h { |p| p.split "=", 2 }
747
747
  else
748
748
  {}
749
749
  end
@@ -781,7 +781,7 @@ module Google
781
781
 
782
782
  verb, uri, query_string_params, body = ServiceStub.transcode_evaluate_processor_version_request request_pb
783
783
  query_string_params = if query_string_params.any?
784
- query_string_params.to_h { |p| p.split("=", 2) }
784
+ query_string_params.to_h { |p| p.split "=", 2 }
785
785
  else
786
786
  {}
787
787
  end
@@ -819,7 +819,7 @@ module Google
819
819
 
820
820
  verb, uri, query_string_params, body = ServiceStub.transcode_get_evaluation_request request_pb
821
821
  query_string_params = if query_string_params.any?
822
- query_string_params.to_h { |p| p.split("=", 2) }
822
+ query_string_params.to_h { |p| p.split "=", 2 }
823
823
  else
824
824
  {}
825
825
  end
@@ -857,7 +857,7 @@ module Google
857
857
 
858
858
  verb, uri, query_string_params, body = ServiceStub.transcode_list_evaluations_request request_pb
859
859
  query_string_params = if query_string_params.any?
860
- query_string_params.to_h { |p| p.split("=", 2) }
860
+ query_string_params.to_h { |p| p.split "=", 2 }
861
861
  else
862
862
  {}
863
863
  end
@@ -876,6 +876,44 @@ module Google
876
876
  result
877
877
  end
878
878
 
879
+ ##
880
+ # Baseline implementation for the import_processor_version REST call
881
+ #
882
+ # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest]
883
+ # A request object representing the call parameters. Required.
884
+ # @param options [::Gapic::CallOptions]
885
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
886
+ #
887
+ # @yield [result, operation] Access the result along with the TransportOperation object
888
+ # @yieldparam result [::Google::Longrunning::Operation]
889
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
890
+ #
891
+ # @return [::Google::Longrunning::Operation]
892
+ # A result object deserialized from the server's reply
893
+ def import_processor_version request_pb, options = nil
894
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
895
+
896
+ verb, uri, query_string_params, body = ServiceStub.transcode_import_processor_version_request request_pb
897
+ query_string_params = if query_string_params.any?
898
+ query_string_params.to_h { |p| p.split "=", 2 }
899
+ else
900
+ {}
901
+ end
902
+
903
+ response = @client_stub.make_http_request(
904
+ verb,
905
+ uri: uri,
906
+ body: body || "",
907
+ params: query_string_params,
908
+ options: options
909
+ )
910
+ operation = ::Gapic::Rest::TransportOperation.new response
911
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
912
+
913
+ yield result, operation if block_given?
914
+ result
915
+ end
916
+
879
917
  ##
880
918
  # @private
881
919
  #
@@ -1364,6 +1402,28 @@ module Google
1364
1402
  )
1365
1403
  transcoder.transcode request_pb
1366
1404
  end
1405
+
1406
+ ##
1407
+ # @private
1408
+ #
1409
+ # GRPC transcoding helper method for the import_processor_version REST call
1410
+ #
1411
+ # @param request_pb [::Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest]
1412
+ # A request object representing the call parameters. Required.
1413
+ # @return [Array(String, [String, nil], Hash{String => String})]
1414
+ # Uri, Body, Query string parameters
1415
+ def self.transcode_import_processor_version_request request_pb
1416
+ transcoder = Gapic::Rest::GrpcTranscoder.new
1417
+ .with_bindings(
1418
+ uri_method: :post,
1419
+ uri_template: "/v1beta3/{parent}/processorVersions:importProcessorVersion",
1420
+ body: "*",
1421
+ matches: [
1422
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false]
1423
+ ]
1424
+ )
1425
+ transcoder.transcode request_pb
1426
+ end
1367
1427
  end
1368
1428
  end
1369
1429
  end