google-cloud-document_ai-v1beta3 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +75 -0
  6. data/lib/google-cloud-document_ai-v1beta3.rb +21 -0
  7. data/lib/google/cloud/document_ai/v1beta3.rb +35 -0
  8. data/lib/google/cloud/document_ai/v1beta3/document_processor_service.rb +53 -0
  9. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +570 -0
  10. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/credentials.rb +51 -0
  11. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb +570 -0
  12. data/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb +71 -0
  13. data/lib/google/cloud/document_ai/v1beta3/version.rb +28 -0
  14. data/lib/google/cloud/documentai/v1beta3/document_pb.rb +303 -0
  15. data/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb +106 -0
  16. data/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb +54 -0
  17. data/lib/google/cloud/documentai/v1beta3/geometry_pb.rb +34 -0
  18. data/proto_docs/README.md +4 -0
  19. data/proto_docs/google/api/field_behavior.rb +59 -0
  20. data/proto_docs/google/api/resource.rb +283 -0
  21. data/proto_docs/google/cloud/documentai/v1beta3/document.rb +816 -0
  22. data/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb +235 -0
  23. data/proto_docs/google/cloud/documentai/v1beta3/geometry.rb +65 -0
  24. data/proto_docs/google/longrunning/operations.rb +150 -0
  25. data/proto_docs/google/protobuf/any.rb +138 -0
  26. data/proto_docs/google/protobuf/duration.rb +98 -0
  27. data/proto_docs/google/protobuf/empty.rb +36 -0
  28. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  29. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  30. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  31. data/proto_docs/google/rpc/status.rb +46 -0
  32. data/proto_docs/google/type/color.rb +168 -0
  33. data/proto_docs/google/type/date.rb +50 -0
  34. data/proto_docs/google/type/datetime.rb +91 -0
  35. data/proto_docs/google/type/money.rb +43 -0
  36. data/proto_docs/google/type/postal_address.rb +135 -0
  37. metadata +219 -0
@@ -0,0 +1,235 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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
+
20
+ module Google
21
+ module Cloud
22
+ module DocumentAI
23
+ module V1beta3
24
+ # Request message for the process document method.
25
+ # @!attribute [rw] name
26
+ # @return [::String]
27
+ # Required. The processor resource name.
28
+ # @!attribute [rw] document
29
+ # @return [::Google::Cloud::DocumentAI::V1beta3::Document]
30
+ # The document payload, the [content] and [mime_type] fields must be set.
31
+ # @!attribute [rw] skip_human_review
32
+ # @return [::Boolean]
33
+ # Whether Human Review feature should be skipped for this request. Default to
34
+ # false.
35
+ class ProcessRequest
36
+ include ::Google::Protobuf::MessageExts
37
+ extend ::Google::Protobuf::MessageExts::ClassMethods
38
+ end
39
+
40
+ # Response message for the process document method.
41
+ # @!attribute [rw] document
42
+ # @return [::Google::Cloud::DocumentAI::V1beta3::Document]
43
+ # The document payload, will populate fields based on the processor's
44
+ # behavior.
45
+ # @!attribute [rw] human_review_operation
46
+ # @return [::String]
47
+ # The name of the operation triggered by the processed document. If the human
48
+ # review process is not triggered, this field will be empty. It has the same
49
+ # response type and metadata as the long running operation returned by
50
+ # ReviewDocument method.
51
+ class ProcessResponse
52
+ include ::Google::Protobuf::MessageExts
53
+ extend ::Google::Protobuf::MessageExts::ClassMethods
54
+ end
55
+
56
+ # Request message for batch process document method.
57
+ # @!attribute [rw] name
58
+ # @return [::String]
59
+ # Required. The processor resource name.
60
+ # @!attribute [rw] input_configs
61
+ # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig>]
62
+ # The input config for each single document in the batch process.
63
+ # @!attribute [rw] output_config
64
+ # @return [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig]
65
+ # The overall output config for batch process.
66
+ class BatchProcessRequest
67
+ include ::Google::Protobuf::MessageExts
68
+ extend ::Google::Protobuf::MessageExts::ClassMethods
69
+
70
+ # The message for input config in batch process.
71
+ # @!attribute [rw] gcs_source
72
+ # @return [::String]
73
+ # The Cloud Storage location as the source of the document.
74
+ # @!attribute [rw] mime_type
75
+ # @return [::String]
76
+ # Mimetype of the input. If the input is a raw document, the supported
77
+ # mimetypes are application/pdf, image/tiff, and image/gif.
78
+ # If the input is a [Document] proto, the type should be application/json.
79
+ class BatchInputConfig
80
+ include ::Google::Protobuf::MessageExts
81
+ extend ::Google::Protobuf::MessageExts::ClassMethods
82
+ end
83
+
84
+ # The message for output config in batch process.
85
+ # @!attribute [rw] gcs_destination
86
+ # @return [::String]
87
+ # The output Cloud Storage directory to put the processed documents.
88
+ class BatchOutputConfig
89
+ include ::Google::Protobuf::MessageExts
90
+ extend ::Google::Protobuf::MessageExts::ClassMethods
91
+ end
92
+ end
93
+
94
+ # Response message for batch process document method.
95
+ class BatchProcessResponse
96
+ include ::Google::Protobuf::MessageExts
97
+ extend ::Google::Protobuf::MessageExts::ClassMethods
98
+ end
99
+
100
+ # The long running operation metadata for batch process method.
101
+ # @!attribute [rw] state
102
+ # @return [::Google::Cloud::DocumentAI::V1beta3::BatchProcessMetadata::State]
103
+ # The state of the current batch processing.
104
+ # @!attribute [rw] state_message
105
+ # @return [::String]
106
+ # A message providing more details about the current state of processing.
107
+ # For example, the error message if the operation is failed.
108
+ # @!attribute [rw] create_time
109
+ # @return [::Google::Protobuf::Timestamp]
110
+ # The creation time of the operation.
111
+ # @!attribute [rw] update_time
112
+ # @return [::Google::Protobuf::Timestamp]
113
+ # The last update time of the operation.
114
+ # @!attribute [rw] individual_process_statuses
115
+ # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessMetadata::IndividualProcessStatus>]
116
+ # The list of response details of each document.
117
+ class BatchProcessMetadata
118
+ include ::Google::Protobuf::MessageExts
119
+ extend ::Google::Protobuf::MessageExts::ClassMethods
120
+
121
+ # The status of a each individual document in the batch process.
122
+ # @!attribute [rw] input_gcs_source
123
+ # @return [::String]
124
+ # The source of the document, same as the [input_gcs_source] field in the
125
+ # request when the batch process started. The batch process is started by
126
+ # take snapshot of that document, since a user can move or change that
127
+ # document during the process.
128
+ # @!attribute [rw] status
129
+ # @return [::Google::Rpc::Status]
130
+ # The status of the processing of the document.
131
+ # @!attribute [rw] output_gcs_destination
132
+ # @return [::String]
133
+ # The output_gcs_destination (in the request as 'output_gcs_destination')
134
+ # of the processed document if it was successful, otherwise empty.
135
+ # @!attribute [rw] human_review_operation
136
+ # @return [::String]
137
+ # The name of the operation triggered by the processed document. If the
138
+ # human review process is not triggered, this field will be empty. It has
139
+ # the same response type and metadata as the long running operation
140
+ # returned by ReviewDocument method.
141
+ class IndividualProcessStatus
142
+ include ::Google::Protobuf::MessageExts
143
+ extend ::Google::Protobuf::MessageExts::ClassMethods
144
+ end
145
+
146
+ # Possible states of the batch processing operation.
147
+ module State
148
+ # The default value. This value is used if the state is omitted.
149
+ STATE_UNSPECIFIED = 0
150
+
151
+ # Request operation is waiting for scheduling.
152
+ WAITING = 1
153
+
154
+ # Request is being processed.
155
+ RUNNING = 2
156
+
157
+ # The batch processing completed successfully.
158
+ SUCCEEDED = 3
159
+
160
+ # The batch processing was being cancelled.
161
+ CANCELLING = 4
162
+
163
+ # The batch processing was cancelled.
164
+ CANCELLED = 5
165
+
166
+ # The batch processing has failed.
167
+ FAILED = 6
168
+ end
169
+ end
170
+
171
+ # Request message for review document method.
172
+ # @!attribute [rw] human_review_config
173
+ # @return [::String]
174
+ # Required. The resource name of the HumanReviewConfig that the document will be
175
+ # reviewed with.
176
+ # @!attribute [rw] document
177
+ # @return [::Google::Cloud::DocumentAI::V1beta3::Document]
178
+ # The document that needs human review.
179
+ class ReviewDocumentRequest
180
+ include ::Google::Protobuf::MessageExts
181
+ extend ::Google::Protobuf::MessageExts::ClassMethods
182
+ end
183
+
184
+ # Response message for review document method.
185
+ # @!attribute [rw] gcs_destination
186
+ # @return [::String]
187
+ # The Cloud Storage uri for the human reviewed document.
188
+ class ReviewDocumentResponse
189
+ include ::Google::Protobuf::MessageExts
190
+ extend ::Google::Protobuf::MessageExts::ClassMethods
191
+ end
192
+
193
+ # The long running operation metadata for review document method.
194
+ # @!attribute [rw] state
195
+ # @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentOperationMetadata::State]
196
+ # Used only when Operation.done is false.
197
+ # @!attribute [rw] state_message
198
+ # @return [::String]
199
+ # A message providing more details about the current state of processing.
200
+ # For example, the error message if the operation is failed.
201
+ # @!attribute [rw] create_time
202
+ # @return [::Google::Protobuf::Timestamp]
203
+ # The creation time of the operation.
204
+ # @!attribute [rw] update_time
205
+ # @return [::Google::Protobuf::Timestamp]
206
+ # The last update time of the operation.
207
+ class ReviewDocumentOperationMetadata
208
+ include ::Google::Protobuf::MessageExts
209
+ extend ::Google::Protobuf::MessageExts::ClassMethods
210
+
211
+ # State of the longrunning operation.
212
+ module State
213
+ # Unspecified state.
214
+ STATE_UNSPECIFIED = 0
215
+
216
+ # Operation is still running.
217
+ RUNNING = 1
218
+
219
+ # Operation is being cancelled.
220
+ CANCELLING = 2
221
+
222
+ # Operation succeeded.
223
+ SUCCEEDED = 3
224
+
225
+ # Operation failed.
226
+ FAILED = 4
227
+
228
+ # Operation is cancelled.
229
+ CANCELLED = 5
230
+ end
231
+ end
232
+ end
233
+ end
234
+ end
235
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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
+
20
+ module Google
21
+ module Cloud
22
+ module DocumentAI
23
+ module V1beta3
24
+ # A vertex represents a 2D point in the image.
25
+ # NOTE: the vertex coordinates are in the same scale as the original image.
26
+ # @!attribute [rw] x
27
+ # @return [::Integer]
28
+ # X coordinate.
29
+ # @!attribute [rw] y
30
+ # @return [::Integer]
31
+ # Y coordinate.
32
+ class Vertex
33
+ include ::Google::Protobuf::MessageExts
34
+ extend ::Google::Protobuf::MessageExts::ClassMethods
35
+ end
36
+
37
+ # A vertex represents a 2D point in the image.
38
+ # NOTE: the normalized vertex coordinates are relative to the original image
39
+ # and range from 0 to 1.
40
+ # @!attribute [rw] x
41
+ # @return [::Float]
42
+ # X coordinate.
43
+ # @!attribute [rw] y
44
+ # @return [::Float]
45
+ # Y coordinate.
46
+ class NormalizedVertex
47
+ include ::Google::Protobuf::MessageExts
48
+ extend ::Google::Protobuf::MessageExts::ClassMethods
49
+ end
50
+
51
+ # A bounding polygon for the detected image annotation.
52
+ # @!attribute [rw] vertices
53
+ # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Vertex>]
54
+ # The bounding polygon vertices.
55
+ # @!attribute [rw] normalized_vertices
56
+ # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::NormalizedVertex>]
57
+ # The bounding polygon normalized vertices.
58
+ class BoundingPoly
59
+ include ::Google::Protobuf::MessageExts
60
+ extend ::Google::Protobuf::MessageExts::ClassMethods
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,150 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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
+
20
+ module Google
21
+ module Longrunning
22
+ # This resource represents a long-running operation that is the result of a
23
+ # network API call.
24
+ # @!attribute [rw] name
25
+ # @return [::String]
26
+ # The server-assigned name, which is only unique within the same service that
27
+ # originally returns it. If you use the default HTTP mapping, the
28
+ # `name` should have the format of `operations/some/unique/name`.
29
+ # @!attribute [rw] metadata
30
+ # @return [::Google::Protobuf::Any]
31
+ # Service-specific metadata associated with the operation. It typically
32
+ # contains progress information and common metadata such as create time.
33
+ # Some services might not provide such metadata. Any method that returns a
34
+ # long-running operation should document the metadata type, if any.
35
+ # @!attribute [rw] done
36
+ # @return [::Boolean]
37
+ # If the value is `false`, it means the operation is still in progress.
38
+ # If true, the operation is completed, and either `error` or `response` is
39
+ # available.
40
+ # @!attribute [rw] error
41
+ # @return [::Google::Rpc::Status]
42
+ # The error result of the operation in case of failure or cancellation.
43
+ # @!attribute [rw] response
44
+ # @return [::Google::Protobuf::Any]
45
+ # The normal response of the operation in case of success. If the original
46
+ # method returns no data on success, such as `Delete`, the response is
47
+ # `google.protobuf.Empty`. If the original method is standard
48
+ # `Get`/`Create`/`Update`, the response should be the resource. For other
49
+ # methods, the response should have the type `XxxResponse`, where `Xxx`
50
+ # is the original method name. For example, if the original method name
51
+ # is `TakeSnapshot()`, the inferred response type is
52
+ # `TakeSnapshotResponse`.
53
+ class Operation
54
+ include ::Google::Protobuf::MessageExts
55
+ extend ::Google::Protobuf::MessageExts::ClassMethods
56
+ end
57
+
58
+ # The request message for Operations.GetOperation.
59
+ # @!attribute [rw] name
60
+ # @return [::String]
61
+ # The name of the operation resource.
62
+ class GetOperationRequest
63
+ include ::Google::Protobuf::MessageExts
64
+ extend ::Google::Protobuf::MessageExts::ClassMethods
65
+ end
66
+
67
+ # The request message for Operations.ListOperations.
68
+ # @!attribute [rw] name
69
+ # @return [::String]
70
+ # The name of the operation collection.
71
+ # @!attribute [rw] filter
72
+ # @return [::String]
73
+ # The standard list filter.
74
+ # @!attribute [rw] page_size
75
+ # @return [::Integer]
76
+ # The standard list page size.
77
+ # @!attribute [rw] page_token
78
+ # @return [::String]
79
+ # The standard list page token.
80
+ class ListOperationsRequest
81
+ include ::Google::Protobuf::MessageExts
82
+ extend ::Google::Protobuf::MessageExts::ClassMethods
83
+ end
84
+
85
+ # The response message for Operations.ListOperations.
86
+ # @!attribute [rw] operations
87
+ # @return [::Array<::Google::Longrunning::Operation>]
88
+ # A list of operations that matches the specified filter in the request.
89
+ # @!attribute [rw] next_page_token
90
+ # @return [::String]
91
+ # The standard List next-page token.
92
+ class ListOperationsResponse
93
+ include ::Google::Protobuf::MessageExts
94
+ extend ::Google::Protobuf::MessageExts::ClassMethods
95
+ end
96
+
97
+ # The request message for Operations.CancelOperation.
98
+ # @!attribute [rw] name
99
+ # @return [::String]
100
+ # The name of the operation resource to be cancelled.
101
+ class CancelOperationRequest
102
+ include ::Google::Protobuf::MessageExts
103
+ extend ::Google::Protobuf::MessageExts::ClassMethods
104
+ end
105
+
106
+ # The request message for Operations.DeleteOperation.
107
+ # @!attribute [rw] name
108
+ # @return [::String]
109
+ # The name of the operation resource to be deleted.
110
+ class DeleteOperationRequest
111
+ include ::Google::Protobuf::MessageExts
112
+ extend ::Google::Protobuf::MessageExts::ClassMethods
113
+ end
114
+
115
+ # A message representing the message types used by a long-running operation.
116
+ #
117
+ # Example:
118
+ #
119
+ # rpc LongRunningRecognize(LongRunningRecognizeRequest)
120
+ # returns (google.longrunning.Operation) {
121
+ # option (google.longrunning.operation_info) = {
122
+ # response_type: "LongRunningRecognizeResponse"
123
+ # metadata_type: "LongRunningRecognizeMetadata"
124
+ # };
125
+ # }
126
+ # @!attribute [rw] response_type
127
+ # @return [::String]
128
+ # Required. The message name of the primary return type for this
129
+ # long-running operation.
130
+ # This type will be used to deserialize the LRO's response.
131
+ #
132
+ # If the response is in a different package from the rpc, a fully-qualified
133
+ # message name must be used (e.g. `google.protobuf.Struct`).
134
+ #
135
+ # Note: Altering this value constitutes a breaking change.
136
+ # @!attribute [rw] metadata_type
137
+ # @return [::String]
138
+ # Required. The message name of the metadata type for this long-running
139
+ # operation.
140
+ #
141
+ # If the response is in a different package from the rpc, a fully-qualified
142
+ # message name must be used (e.g. `google.protobuf.Struct`).
143
+ #
144
+ # Note: Altering this value constitutes a breaking change.
145
+ class OperationInfo
146
+ include ::Google::Protobuf::MessageExts
147
+ extend ::Google::Protobuf::MessageExts::ClassMethods
148
+ end
149
+ end
150
+ end