google-cloud-document_ai-v1 0.10.0 → 0.12.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 (27) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/google/cloud/document_ai/v1/bindings_override.rb +118 -0
  4. data/lib/google/cloud/document_ai/v1/document_processor_service/client.rb +6 -4
  5. data/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb +5 -3
  6. data/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb +1986 -0
  7. data/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb +822 -0
  8. data/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb +1373 -0
  9. data/lib/google/cloud/document_ai/v1/document_processor_service/rest.rb +57 -0
  10. data/lib/google/cloud/document_ai/v1/document_processor_service.rb +6 -0
  11. data/lib/google/cloud/document_ai/v1/rest.rb +38 -0
  12. data/lib/google/cloud/document_ai/v1/version.rb +1 -1
  13. data/lib/google/cloud/document_ai/v1.rb +5 -0
  14. data/lib/google/cloud/documentai/v1/barcode_pb.rb +24 -6
  15. data/lib/google/cloud/documentai/v1/document_io_pb.rb +25 -35
  16. data/lib/google/cloud/documentai/v1/document_pb.rb +33 -265
  17. data/lib/google/cloud/documentai/v1/document_processor_service_pb.rb +34 -229
  18. data/lib/google/cloud/documentai/v1/document_schema_pb.rb +24 -37
  19. data/lib/google/cloud/documentai/v1/evaluation_pb.rb +25 -52
  20. data/lib/google/cloud/documentai/v1/geometry_pb.rb +24 -13
  21. data/lib/google/cloud/documentai/v1/operation_metadata_pb.rb +25 -16
  22. data/lib/google/cloud/documentai/v1/processor_pb.rb +27 -47
  23. data/lib/google/cloud/documentai/v1/processor_type_pb.rb +24 -13
  24. data/proto_docs/google/api/client.rb +67 -4
  25. data/proto_docs/google/protobuf/any.rb +7 -4
  26. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  27. metadata +13 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6d803f8fc65c2e2ae2b427eb66ac2b119766f54bfc0bbb0fb24a577ddddbe73
4
- data.tar.gz: 571dea36cf28d425b716c874594143c02f7b6b7d11e37561b5655a2f6af3229f
3
+ metadata.gz: f71dc8e586257fef847d5bf87318e19f2c03f0d44b751c3417225a6e48798abe
4
+ data.tar.gz: 271d8d1c30e6e1aacd4613491f1b4e687cb74eadd456762677673c7e53d2a10e
5
5
  SHA512:
6
- metadata.gz: 2197249ce83f49ed3e84451d6802483f744a2b12a90096179530f96f456caf503c69c22284f08dd3e5d2cbbe6452dcec7558510e90761a1c2ee2c992d54b44ff
7
- data.tar.gz: db310e7a37b60564d7946b04859a5de60eb88ce558dd646c3247b2ea8a53812a0af3dbc1f80168efdd21e22bb6e0e54bf6a9b3e142a7f141c06944dc9ca82104
6
+ metadata.gz: 4faa7fafc3252a8d8af6e8b419f284b471217f832b11aba45e8cced7d745559d18c0b1e2fbf4ba35d88cd516835c58a52c55f2e652d3c39359c09a3f62f9abad
7
+ data.tar.gz: 9d9d3cdf093d0e0c2daebf7383b27c421f92de17c9de510a40aeb8ef88adb2818cb3059ec6c4be1eb90f603818daa3549168fbe1f6eb4f696f6aaff55505cc91
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the Document AI V1 API
2
2
 
3
- API Client library for the Document AI V1 API
3
+ Service to parse structured information from unstructured or semi-structured documents using state-of-the-art Google AI such as natural language, computer vision, translation, and AutoML.
4
4
 
5
5
  Document AI uses machine learning on a single cloud-based platform to automatically classify, extract, and enrich data within your documents to unlock insights.
6
6
 
@@ -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
 
@@ -0,0 +1,118 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/config"
20
+
21
+ module Google
22
+ module Cloud
23
+ module DocumentAI
24
+ ##
25
+ # @example Loading just the REST part of this package, including all its services, and instantiating a REST client
26
+ #
27
+ # require "google/cloud/document_ai/v1/rest"
28
+ # client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
29
+ #
30
+ module V1
31
+ ##
32
+ # @private
33
+ # Initialize the mixin bindings configuration
34
+ #
35
+ def self.configure
36
+ @configure ||= begin
37
+ namespace = ["Google", "Cloud", "DocumentAI"]
38
+ parent_config = while namespace.any?
39
+ parent_name = namespace.join "::"
40
+ parent_const = const_get parent_name
41
+ break parent_const.configure if parent_const.respond_to? :configure
42
+ namespace.pop
43
+ end
44
+
45
+ default_config = Configuration.new parent_config
46
+ default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [
47
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
48
+ uri_method: :get,
49
+ uri_template: "/v1/{name}",
50
+ matches: [
51
+ ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
52
+ ],
53
+ body: nil
54
+ ),
55
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
56
+ uri_method: :get,
57
+ uri_template: "/uiv1beta3/{name}",
58
+ matches: [
59
+ ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
60
+ ],
61
+ body: nil
62
+ )
63
+ ]
64
+ default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [
65
+
66
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
67
+ uri_method: :get,
68
+ uri_template: "/v1/{name}/locations",
69
+ matches: [
70
+ ["name", %r{^projects/[^/]+/?$}, false]
71
+ ],
72
+ body: nil
73
+ ),
74
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
75
+ uri_method: :get,
76
+ uri_template: "/uiv1beta3/{name}/locations",
77
+ matches: [
78
+ ["name", %r{^projects/[^/]+/?$}, false]
79
+ ],
80
+ body: nil
81
+ )
82
+ ]
83
+ default_config
84
+ end
85
+ yield @configure if block_given?
86
+ @configure
87
+ end
88
+
89
+ ##
90
+ # @private
91
+ # Configuration class for the google.cloud.documentai.v1 package.
92
+ #
93
+ # This class contains common configuration for all services
94
+ # of the google.cloud.documentai.v1 package.
95
+ #
96
+ # This configuration is for internal use of the client library classes,
97
+ # and it is not intended that the end-users will read or change it.
98
+ #
99
+ class Configuration
100
+ extend ::Gapic::Config
101
+
102
+ # @private
103
+ # Overrides for http bindings for the RPC of the mixins for this package.
104
+ # Services in this package should use these when creating clients for the mixin services.
105
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
106
+ config_attr :bindings_override, {}, ::Hash, nil
107
+
108
+ # @private
109
+ def initialize parent_config = nil
110
+ @parent_config = parent_config unless parent_config.nil?
111
+
112
+ yield self if block_given?
113
+ end
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
@@ -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
@@ -2328,9 +2328,9 @@ module Google
2328
2328
  # * (`String`) The path to a service account key file in JSON format
2329
2329
  # * (`Hash`) A service account key as a Hash
2330
2330
  # * (`Google::Auth::Credentials`) A googleauth credentials object
2331
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2331
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2332
2332
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2333
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2333
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2334
2334
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2335
2335
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2336
2336
  # * (`nil`) indicating no credentials
@@ -2372,7 +2372,9 @@ module Google
2372
2372
  class Configuration
2373
2373
  extend ::Gapic::Config
2374
2374
 
2375
- config_attr :endpoint, "documentai.googleapis.com", ::String
2375
+ DEFAULT_ENDPOINT = "documentai.googleapis.com"
2376
+
2377
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
2376
2378
  config_attr :credentials, nil do |value|
2377
2379
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2378
2380
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -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