google-cloud-document_ai-v1beta3 0.19.0 → 0.20.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 66c468df9db12ad0d32f31243c0c581cc41d2caaeb6400c97481af10bbe8e33c
4
- data.tar.gz: eee073b86cbfaeec30f69b2492169e7a38acb327322636f623ea4a85f36c71d6
3
+ metadata.gz: e0c9d575f9c01541fe46b985d6386ea3f38ef540dc7a77b497df3e683ce8afc4
4
+ data.tar.gz: fa25f03cb9ac13c8b3ecf738da03665ad6ec187dc3b6352087a6cd7582bef9d6
5
5
  SHA512:
6
- metadata.gz: 73ce56b1b088efe13921b21767f5b702e5e0383de2047231dfa095f94b74edd6132b12fb01765666fad16433f41c16df97cf5c947d2fdee40b3dbe5a014fb769
7
- data.tar.gz: 611dc1bc7f7f89150374091cae56f1afb23f6849c9a0d5d2e02a25368aa43cec0e4cdf64c83fffcb9fbc0626031c0e699322103b8bf403dde8386612a4f60cf9
6
+ metadata.gz: 398b11a2c1f5585a1cf036dfdadf8d26eedf30fd464a559221d09a31652f63ae8abf78082ab5b722ce5af5d472c3cf0e3488cdbbbffc60ffb315cf40627087f7
7
+ data.tar.gz: 5f02e1764e8e984892a1989605ea77d3f9c72c43e95056fe8f2388141ecab4fd8ef62da85643063b874ae8a27642436d7b690b2eb48ee55d22dd7690f4fd77e1
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the Document AI V1beta3 API
2
2
 
3
- API Client library for the Document AI V1beta3 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
 
@@ -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/v1beta3/rest"
28
+ # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new
29
+ #
30
+ module V1beta3
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: "/v1beta3/{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: "/v1beta3/{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.v1beta3 package.
92
+ #
93
+ # This class contains common configuration for all services
94
+ # of the google.cloud.documentai.v1beta3 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
@@ -358,14 +358,14 @@ module Google
358
358
  # # Call the batch_process_documents method.
359
359
  # result = client.batch_process_documents request
360
360
  #
361
- # # The returned object is of type Gapic::Operation. You can use this
362
- # # object to check the status of an operation, cancel it, or wait
363
- # # for results. Here is how to block until completion:
361
+ # # The returned object is of type Gapic::Operation. You can use it to
362
+ # # check the status of an operation, cancel it, or wait for results.
363
+ # # Here is how to wait for a response.
364
364
  # result.wait_until_done! timeout: 60
365
365
  # if result.response?
366
366
  # p result.response
367
367
  # else
368
- # puts "Error!"
368
+ # puts "No response received."
369
369
  # end
370
370
  #
371
371
  def batch_process_documents request, options = nil
@@ -547,13 +547,11 @@ module Google
547
547
  # # Call the list_processor_types method.
548
548
  # result = client.list_processor_types request
549
549
  #
550
- # # The returned object is of type Gapic::PagedEnumerable. You can
551
- # # iterate over all elements by calling #each, and the enumerable
552
- # # will lazily make API calls to fetch subsequent pages. Other
553
- # # methods are also available for managing paging directly.
554
- # result.each do |response|
550
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
551
+ # # over elements, and API calls will be issued to fetch pages as needed.
552
+ # result.each do |item|
555
553
  # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType.
556
- # p response
554
+ # p item
557
555
  # end
558
556
  #
559
557
  def list_processor_types request, options = nil
@@ -732,13 +730,11 @@ module Google
732
730
  # # Call the list_processors method.
733
731
  # result = client.list_processors request
734
732
  #
735
- # # The returned object is of type Gapic::PagedEnumerable. You can
736
- # # iterate over all elements by calling #each, and the enumerable
737
- # # will lazily make API calls to fetch subsequent pages. Other
738
- # # methods are also available for managing paging directly.
739
- # result.each do |response|
733
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
734
+ # # over elements, and API calls will be issued to fetch pages as needed.
735
+ # result.each do |item|
740
736
  # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor.
741
- # p response
737
+ # p item
742
738
  # end
743
739
  #
744
740
  def list_processors request, options = nil
@@ -923,14 +919,14 @@ module Google
923
919
  # # Call the train_processor_version method.
924
920
  # result = client.train_processor_version request
925
921
  #
926
- # # The returned object is of type Gapic::Operation. You can use this
927
- # # object to check the status of an operation, cancel it, or wait
928
- # # for results. Here is how to block until completion:
922
+ # # The returned object is of type Gapic::Operation. You can use it to
923
+ # # check the status of an operation, cancel it, or wait for results.
924
+ # # Here is how to wait for a response.
929
925
  # result.wait_until_done! timeout: 60
930
926
  # if result.response?
931
927
  # p result.response
932
928
  # else
933
- # puts "Error!"
929
+ # puts "No response received."
934
930
  # end
935
931
  #
936
932
  def train_processor_version request, options = nil
@@ -1110,13 +1106,11 @@ module Google
1110
1106
  # # Call the list_processor_versions method.
1111
1107
  # result = client.list_processor_versions request
1112
1108
  #
1113
- # # The returned object is of type Gapic::PagedEnumerable. You can
1114
- # # iterate over all elements by calling #each, and the enumerable
1115
- # # will lazily make API calls to fetch subsequent pages. Other
1116
- # # methods are also available for managing paging directly.
1117
- # result.each do |response|
1109
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1110
+ # # over elements, and API calls will be issued to fetch pages as needed.
1111
+ # result.each do |item|
1118
1112
  # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion.
1119
- # p response
1113
+ # p item
1120
1114
  # end
1121
1115
  #
1122
1116
  def list_processor_versions request, options = nil
@@ -1203,14 +1197,14 @@ module Google
1203
1197
  # # Call the delete_processor_version method.
1204
1198
  # result = client.delete_processor_version request
1205
1199
  #
1206
- # # The returned object is of type Gapic::Operation. You can use this
1207
- # # object to check the status of an operation, cancel it, or wait
1208
- # # for results. Here is how to block until completion:
1200
+ # # The returned object is of type Gapic::Operation. You can use it to
1201
+ # # check the status of an operation, cancel it, or wait for results.
1202
+ # # Here is how to wait for a response.
1209
1203
  # result.wait_until_done! timeout: 60
1210
1204
  # if result.response?
1211
1205
  # p result.response
1212
1206
  # else
1213
- # puts "Error!"
1207
+ # puts "No response received."
1214
1208
  # end
1215
1209
  #
1216
1210
  def delete_processor_version request, options = nil
@@ -1296,14 +1290,14 @@ module Google
1296
1290
  # # Call the deploy_processor_version method.
1297
1291
  # result = client.deploy_processor_version request
1298
1292
  #
1299
- # # The returned object is of type Gapic::Operation. You can use this
1300
- # # object to check the status of an operation, cancel it, or wait
1301
- # # for results. Here is how to block until completion:
1293
+ # # The returned object is of type Gapic::Operation. You can use it to
1294
+ # # check the status of an operation, cancel it, or wait for results.
1295
+ # # Here is how to wait for a response.
1302
1296
  # result.wait_until_done! timeout: 60
1303
1297
  # if result.response?
1304
1298
  # p result.response
1305
1299
  # else
1306
- # puts "Error!"
1300
+ # puts "No response received."
1307
1301
  # end
1308
1302
  #
1309
1303
  def deploy_processor_version request, options = nil
@@ -1389,14 +1383,14 @@ module Google
1389
1383
  # # Call the undeploy_processor_version method.
1390
1384
  # result = client.undeploy_processor_version request
1391
1385
  #
1392
- # # The returned object is of type Gapic::Operation. You can use this
1393
- # # object to check the status of an operation, cancel it, or wait
1394
- # # for results. Here is how to block until completion:
1386
+ # # The returned object is of type Gapic::Operation. You can use it to
1387
+ # # check the status of an operation, cancel it, or wait for results.
1388
+ # # Here is how to wait for a response.
1395
1389
  # result.wait_until_done! timeout: 60
1396
1390
  # if result.response?
1397
1391
  # p result.response
1398
1392
  # else
1399
- # puts "Error!"
1393
+ # puts "No response received."
1400
1394
  # end
1401
1395
  #
1402
1396
  def undeploy_processor_version request, options = nil
@@ -1574,14 +1568,14 @@ module Google
1574
1568
  # # Call the delete_processor method.
1575
1569
  # result = client.delete_processor request
1576
1570
  #
1577
- # # The returned object is of type Gapic::Operation. You can use this
1578
- # # object to check the status of an operation, cancel it, or wait
1579
- # # for results. Here is how to block until completion:
1571
+ # # The returned object is of type Gapic::Operation. You can use it to
1572
+ # # check the status of an operation, cancel it, or wait for results.
1573
+ # # Here is how to wait for a response.
1580
1574
  # result.wait_until_done! timeout: 60
1581
1575
  # if result.response?
1582
1576
  # p result.response
1583
1577
  # else
1584
- # puts "Error!"
1578
+ # puts "No response received."
1585
1579
  # end
1586
1580
  #
1587
1581
  def delete_processor request, options = nil
@@ -1667,14 +1661,14 @@ module Google
1667
1661
  # # Call the enable_processor method.
1668
1662
  # result = client.enable_processor request
1669
1663
  #
1670
- # # The returned object is of type Gapic::Operation. You can use this
1671
- # # object to check the status of an operation, cancel it, or wait
1672
- # # for results. Here is how to block until completion:
1664
+ # # The returned object is of type Gapic::Operation. You can use it to
1665
+ # # check the status of an operation, cancel it, or wait for results.
1666
+ # # Here is how to wait for a response.
1673
1667
  # result.wait_until_done! timeout: 60
1674
1668
  # if result.response?
1675
1669
  # p result.response
1676
1670
  # else
1677
- # puts "Error!"
1671
+ # puts "No response received."
1678
1672
  # end
1679
1673
  #
1680
1674
  def enable_processor request, options = nil
@@ -1760,14 +1754,14 @@ module Google
1760
1754
  # # Call the disable_processor method.
1761
1755
  # result = client.disable_processor request
1762
1756
  #
1763
- # # The returned object is of type Gapic::Operation. You can use this
1764
- # # object to check the status of an operation, cancel it, or wait
1765
- # # for results. Here is how to block until completion:
1757
+ # # The returned object is of type Gapic::Operation. You can use it to
1758
+ # # check the status of an operation, cancel it, or wait for results.
1759
+ # # Here is how to wait for a response.
1766
1760
  # result.wait_until_done! timeout: 60
1767
1761
  # if result.response?
1768
1762
  # p result.response
1769
1763
  # else
1770
- # puts "Error!"
1764
+ # puts "No response received."
1771
1765
  # end
1772
1766
  #
1773
1767
  def disable_processor request, options = nil
@@ -1864,14 +1858,14 @@ module Google
1864
1858
  # # Call the set_default_processor_version method.
1865
1859
  # result = client.set_default_processor_version request
1866
1860
  #
1867
- # # The returned object is of type Gapic::Operation. You can use this
1868
- # # object to check the status of an operation, cancel it, or wait
1869
- # # for results. Here is how to block until completion:
1861
+ # # The returned object is of type Gapic::Operation. You can use it to
1862
+ # # check the status of an operation, cancel it, or wait for results.
1863
+ # # Here is how to wait for a response.
1870
1864
  # result.wait_until_done! timeout: 60
1871
1865
  # if result.response?
1872
1866
  # p result.response
1873
1867
  # else
1874
- # puts "Error!"
1868
+ # puts "No response received."
1875
1869
  # end
1876
1870
  #
1877
1871
  def set_default_processor_version request, options = nil
@@ -1969,14 +1963,14 @@ module Google
1969
1963
  # # Call the review_document method.
1970
1964
  # result = client.review_document request
1971
1965
  #
1972
- # # The returned object is of type Gapic::Operation. You can use this
1973
- # # object to check the status of an operation, cancel it, or wait
1974
- # # for results. Here is how to block until completion:
1966
+ # # The returned object is of type Gapic::Operation. You can use it to
1967
+ # # check the status of an operation, cancel it, or wait for results.
1968
+ # # Here is how to wait for a response.
1975
1969
  # result.wait_until_done! timeout: 60
1976
1970
  # if result.response?
1977
1971
  # p result.response
1978
1972
  # else
1979
- # puts "Error!"
1973
+ # puts "No response received."
1980
1974
  # end
1981
1975
  #
1982
1976
  def review_document request, options = nil
@@ -2069,14 +2063,14 @@ module Google
2069
2063
  # # Call the evaluate_processor_version method.
2070
2064
  # result = client.evaluate_processor_version request
2071
2065
  #
2072
- # # The returned object is of type Gapic::Operation. You can use this
2073
- # # object to check the status of an operation, cancel it, or wait
2074
- # # for results. Here is how to block until completion:
2066
+ # # The returned object is of type Gapic::Operation. You can use it to
2067
+ # # check the status of an operation, cancel it, or wait for results.
2068
+ # # Here is how to wait for a response.
2075
2069
  # result.wait_until_done! timeout: 60
2076
2070
  # if result.response?
2077
2071
  # p result.response
2078
2072
  # else
2079
- # puts "Error!"
2073
+ # puts "No response received."
2080
2074
  # end
2081
2075
  #
2082
2076
  def evaluate_processor_version request, options = nil
@@ -2259,13 +2253,11 @@ module Google
2259
2253
  # # Call the list_evaluations method.
2260
2254
  # result = client.list_evaluations request
2261
2255
  #
2262
- # # The returned object is of type Gapic::PagedEnumerable. You can
2263
- # # iterate over all elements by calling #each, and the enumerable
2264
- # # will lazily make API calls to fetch subsequent pages. Other
2265
- # # methods are also available for managing paging directly.
2266
- # result.each do |response|
2256
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2257
+ # # over elements, and API calls will be issued to fetch pages as needed.
2258
+ # result.each do |item|
2267
2259
  # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation.
2268
- # p response
2260
+ # p item
2269
2261
  # end
2270
2262
  #
2271
2263
  def list_evaluations request, options = nil
@@ -158,13 +158,11 @@ module Google
158
158
  # # Call the list_operations method.
159
159
  # result = client.list_operations request
160
160
  #
161
- # # The returned object is of type Gapic::PagedEnumerable. You can
162
- # # iterate over all elements by calling #each, and the enumerable
163
- # # will lazily make API calls to fetch subsequent pages. Other
164
- # # methods are also available for managing paging directly.
165
- # result.each do |response|
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
162
+ # # over elements, and API calls will be issued to fetch pages as needed.
163
+ # result.each do |item|
166
164
  # # Each element is of type ::Google::Longrunning::Operation.
167
- # p response
165
+ # p item
168
166
  # end
169
167
  #
170
168
  def list_operations request, options = nil
@@ -253,14 +251,14 @@ module Google
253
251
  # # Call the get_operation method.
254
252
  # result = client.get_operation request
255
253
  #
256
- # # The returned object is of type Gapic::Operation. You can use this
257
- # # object to check the status of an operation, cancel it, or wait
258
- # # for results. Here is how to block until completion:
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
259
257
  # result.wait_until_done! timeout: 60
260
258
  # if result.response?
261
259
  # p result.response
262
260
  # else
263
- # puts "Error!"
261
+ # puts "No response received."
264
262
  # end
265
263
  #
266
264
  def get_operation request, options = nil
@@ -540,14 +538,14 @@ module Google
540
538
  # # Call the wait_operation method.
541
539
  # result = client.wait_operation request
542
540
  #
543
- # # The returned object is of type Gapic::Operation. You can use this
544
- # # object to check the status of an operation, cancel it, or wait
545
- # # for results. Here is how to block until completion:
541
+ # # The returned object is of type Gapic::Operation. You can use it to
542
+ # # check the status of an operation, cancel it, or wait for results.
543
+ # # Here is how to wait for a response.
546
544
  # result.wait_until_done! timeout: 60
547
545
  # if result.response?
548
546
  # p result.response
549
547
  # else
550
- # puts "Error!"
548
+ # puts "No response received."
551
549
  # end
552
550
  #
553
551
  def wait_operation request, options = nil