Class: Google::Apis::DocumentaiV1beta2::DocumentService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::DocumentaiV1beta2::DocumentService
- Defined in:
- lib/google/apis/documentai_v1beta2/service.rb
Overview
Cloud Document AI API
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.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://documentai.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#batch_project_document_process(parent, google_cloud_documentai_v1beta2_batch_process_documents_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation
LRO endpoint to batch process many documents.
-
#batch_project_location_document_process(parent, google_cloud_documentai_v1beta2_batch_process_documents_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation
LRO endpoint to batch process many documents.
-
#get_project_location_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation
Gets the latest state of a long-running operation.
-
#get_project_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation
Gets the latest state of a long-running operation.
-
#initialize ⇒ DocumentService
constructor
A new instance of DocumentService.
-
#process_project_document(parent, google_cloud_documentai_v1beta2_process_document_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2Document
Processes a single document.
-
#process_project_location_document(parent, google_cloud_documentai_v1beta2_process_document_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2Document
Processes a single document.
Constructor Details
#initialize ⇒ DocumentService
Returns a new instance of DocumentService.
49 50 51 52 53 54 |
# File 'lib/google/apis/documentai_v1beta2/service.rb', line 49 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-documentai_v1beta2', client_version: Google::Apis::DocumentaiV1beta2::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
42 43 44 |
# File 'lib/google/apis/documentai_v1beta2/service.rb', line 42 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
47 48 49 |
# File 'lib/google/apis/documentai_v1beta2/service.rb', line 47 def quota_user @quota_user end |
Instance Method Details
#batch_project_document_process(parent, google_cloud_documentai_v1beta2_batch_process_documents_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/google/apis/documentai_v1beta2/service.rb', line 80 def batch_project_document_process(parent, google_cloud_documentai_v1beta2_batch_process_documents_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta2/{+parent}/documents:batchProcess', ) command.request_representation = Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2BatchProcessDocumentsRequest::Representation command.request_object = google_cloud_documentai_v1beta2_batch_process_documents_request_object command.response_representation = Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#batch_project_location_document_process(parent, google_cloud_documentai_v1beta2_batch_process_documents_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/google/apis/documentai_v1beta2/service.rb', line 152 def batch_project_location_document_process(parent, google_cloud_documentai_v1beta2_batch_process_documents_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta2/{+parent}/documents:batchProcess', ) command.request_representation = Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2BatchProcessDocumentsRequest::Representation command.request_object = google_cloud_documentai_v1beta2_batch_process_documents_request_object command.response_representation = Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_project_location_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
221 222 223 224 225 226 227 228 229 |
# File 'lib/google/apis/documentai_v1beta2/service.rb', line 221 def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1beta2/{+name}', ) command.response_representation = Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_project_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
252 253 254 255 256 257 258 259 260 |
# File 'lib/google/apis/documentai_v1beta2/service.rb', line 252 def get_project_operation(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1beta2/{+name}', ) command.response_representation = Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::DocumentaiV1beta2::GoogleLongrunningOperation command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#process_project_document(parent, google_cloud_documentai_v1beta2_process_document_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2Document
Processes a single document.
116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/google/apis/documentai_v1beta2/service.rb', line 116 def process_project_document(parent, google_cloud_documentai_v1beta2_process_document_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta2/{+parent}/documents:process', ) command.request_representation = Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2ProcessDocumentRequest::Representation command.request_object = google_cloud_documentai_v1beta2_process_document_request_object command.response_representation = Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2Document::Representation command.response_class = Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2Document command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#process_project_location_document(parent, google_cloud_documentai_v1beta2_process_document_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2Document
Processes a single document.
188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/google/apis/documentai_v1beta2/service.rb', line 188 def process_project_location_document(parent, google_cloud_documentai_v1beta2_process_document_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta2/{+parent}/documents:process', ) command.request_representation = Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2ProcessDocumentRequest::Representation command.request_object = google_cloud_documentai_v1beta2_process_document_request_object command.response_representation = Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2Document::Representation command.response_class = Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta2Document command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |