cloudmersive-documentai-api-client 2.2.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 +7 -0
- data/Gemfile +7 -0
- data/README.md +140 -0
- data/Rakefile +8 -0
- data/cloudmersive-documentai-api-client.gemspec +45 -0
- data/docs/AdvancedExtractClassificationRequest.md +10 -0
- data/docs/AdvancedExtractFieldsRequest.md +10 -0
- data/docs/AnalyzeApi.md +64 -0
- data/docs/DocumentAdvancedClassificationResult.md +9 -0
- data/docs/DocumentCategories.md +9 -0
- data/docs/DocumentClassificationResult.md +9 -0
- data/docs/DocumentPolicyRequest.md +9 -0
- data/docs/DocumentPolicyResult.md +10 -0
- data/docs/ExtractApi.md +534 -0
- data/docs/ExtractBarcodesAiResponse.md +9 -0
- data/docs/ExtractDocumentBatchJobResult.md +9 -0
- data/docs/ExtractDocumentJobStatusResult.md +15 -0
- data/docs/ExtractFieldsAndTablesResponse.md +10 -0
- data/docs/ExtractFieldsResponse.md +9 -0
- data/docs/ExtractTablesResponse.md +9 -0
- data/docs/ExtractTextResponse.md +9 -0
- data/docs/ExtractedBarcodeItem.md +9 -0
- data/docs/ExtractedTextPage.md +9 -0
- data/docs/FieldToExtract.md +11 -0
- data/docs/FieldValue.md +9 -0
- data/docs/PolicyRule.md +10 -0
- data/docs/PolicyRuleViolation.md +10 -0
- data/docs/RunBatchJobApi.md +298 -0
- data/docs/SummarizeDocumentResponse.md +9 -0
- data/docs/TableResult.md +9 -0
- data/docs/TableResultCell.md +9 -0
- data/docs/TableResultRow.md +8 -0
- data/git_push.sh +55 -0
- data/lib/cloudmersive-documentai-api-client/api/analyze_api.rb +73 -0
- data/lib/cloudmersive-documentai-api-client/api/extract_api.rb +513 -0
- data/lib/cloudmersive-documentai-api-client/api/run_batch_job_api.rb +290 -0
- data/lib/cloudmersive-documentai-api-client/api_client.rb +391 -0
- data/lib/cloudmersive-documentai-api-client/api_error.rb +38 -0
- data/lib/cloudmersive-documentai-api-client/configuration.rb +209 -0
- data/lib/cloudmersive-documentai-api-client/models/advanced_extract_classification_request.rb +223 -0
- data/lib/cloudmersive-documentai-api-client/models/advanced_extract_fields_request.rb +223 -0
- data/lib/cloudmersive-documentai-api-client/models/document_advanced_classification_result.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/document_categories.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/document_classification_result.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/document_policy_request.rb +213 -0
- data/lib/cloudmersive-documentai-api-client/models/document_policy_result.rb +208 -0
- data/lib/cloudmersive-documentai-api-client/models/extract_barcodes_ai_response.rb +198 -0
- data/lib/cloudmersive-documentai-api-client/models/extract_document_batch_job_result.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/extract_document_job_status_result.rb +252 -0
- data/lib/cloudmersive-documentai-api-client/models/extract_fields_and_tables_response.rb +210 -0
- data/lib/cloudmersive-documentai-api-client/models/extract_fields_response.rb +198 -0
- data/lib/cloudmersive-documentai-api-client/models/extract_tables_response.rb +198 -0
- data/lib/cloudmersive-documentai-api-client/models/extract_text_response.rb +198 -0
- data/lib/cloudmersive-documentai-api-client/models/extracted_barcode_item.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/extracted_text_page.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/field_to_extract.rb +216 -0
- data/lib/cloudmersive-documentai-api-client/models/field_value.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/policy_rule.rb +205 -0
- data/lib/cloudmersive-documentai-api-client/models/policy_rule_violation.rb +206 -0
- data/lib/cloudmersive-documentai-api-client/models/summarize_document_response.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/table_result.rb +198 -0
- data/lib/cloudmersive-documentai-api-client/models/table_result_cell.rb +196 -0
- data/lib/cloudmersive-documentai-api-client/models/table_result_row.rb +188 -0
- data/lib/cloudmersive-documentai-api-client/version.rb +15 -0
- data/lib/cloudmersive-documentai-api-client.rb +66 -0
- data/spec/api/analyze_api_spec.rb +47 -0
- data/spec/api/extract_api_spec.rb +154 -0
- data/spec/api/run_batch_job_api_spec.rb +100 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/advanced_extract_classification_request_spec.rb +53 -0
- data/spec/models/advanced_extract_fields_request_spec.rb +53 -0
- data/spec/models/document_advanced_classification_result_spec.rb +47 -0
- data/spec/models/document_categories_spec.rb +47 -0
- data/spec/models/document_classification_result_spec.rb +47 -0
- data/spec/models/document_policy_request_spec.rb +47 -0
- data/spec/models/document_policy_result_spec.rb +53 -0
- data/spec/models/extract_barcodes_ai_response_spec.rb +47 -0
- data/spec/models/extract_document_batch_job_result_spec.rb +47 -0
- data/spec/models/extract_document_job_status_result_spec.rb +83 -0
- data/spec/models/extract_fields_and_tables_response_spec.rb +53 -0
- data/spec/models/extract_fields_response_spec.rb +47 -0
- data/spec/models/extract_tables_response_spec.rb +47 -0
- data/spec/models/extract_text_response_spec.rb +47 -0
- data/spec/models/extracted_barcode_item_spec.rb +47 -0
- data/spec/models/extracted_text_page_spec.rb +47 -0
- data/spec/models/field_to_extract_spec.rb +59 -0
- data/spec/models/field_value_spec.rb +47 -0
- data/spec/models/policy_rule_spec.rb +53 -0
- data/spec/models/policy_rule_violation_spec.rb +53 -0
- data/spec/models/summarize_document_response_spec.rb +47 -0
- data/spec/models/table_result_cell_spec.rb +47 -0
- data/spec/models/table_result_row_spec.rb +41 -0
- data/spec/models/table_result_spec.rb +47 -0
- data/spec/spec_helper.rb +111 -0
- metadata +319 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: f396a4b31059a378e018961b2681b03f16701b80ecbb435d31139e57a218daf7
|
|
4
|
+
data.tar.gz: 6ca03d63a92d772dae91392dd94059822b6b9ae8177a9a9e7dc3cacbbcb57af8
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 5dfebaf16d563952a730d65f962eb0d93504475561707b720fa12b6d01816400424859f051fa43bd1f287ec76691aee4e1d03a0b92285070aefe8a5da886c0e8
|
|
7
|
+
data.tar.gz: 0211efc337baf968845383aba65bbe987f3d67ef5afe6e7001b1fa97124e68d503be097de00cd18b060405196200f53a8892f4bb7191eaa98c459b20b13db1ce
|
data/Gemfile
ADDED
data/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# cloudmersive-documentai-api-client
|
|
2
|
+
|
|
3
|
+
CloudmersiveDocumentaiApiClient - the Ruby gem for the Document AI API
|
|
4
|
+
|
|
5
|
+
Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
|
|
6
|
+
|
|
7
|
+
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
|
8
|
+
|
|
9
|
+
- API version: v1
|
|
10
|
+
- Package version: 2.2.0
|
|
11
|
+
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
### Build a gem
|
|
16
|
+
|
|
17
|
+
To build the Ruby code into a gem:
|
|
18
|
+
|
|
19
|
+
```shell
|
|
20
|
+
gem build cloudmersive-documentai-api-client.gemspec
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then either install the gem locally:
|
|
24
|
+
|
|
25
|
+
```shell
|
|
26
|
+
gem install ./cloudmersive-documentai-api-client-2.2.0.gem
|
|
27
|
+
```
|
|
28
|
+
(for development, run `gem install --dev ./cloudmersive-documentai-api-client-2.2.0.gem` to install the development dependencies)
|
|
29
|
+
|
|
30
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
|
31
|
+
|
|
32
|
+
Finally add this to the Gemfile:
|
|
33
|
+
|
|
34
|
+
gem 'cloudmersive-documentai-api-client', '~> 2.2.0'
|
|
35
|
+
|
|
36
|
+
### Install from Git
|
|
37
|
+
|
|
38
|
+
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
|
|
39
|
+
|
|
40
|
+
gem 'cloudmersive-documentai-api-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
|
41
|
+
|
|
42
|
+
### Include the Ruby code directly
|
|
43
|
+
|
|
44
|
+
Include the Ruby code directly using `-I` as follows:
|
|
45
|
+
|
|
46
|
+
```shell
|
|
47
|
+
ruby -Ilib script.rb
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Getting Started
|
|
51
|
+
|
|
52
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
|
53
|
+
```ruby
|
|
54
|
+
# Load the gem
|
|
55
|
+
require 'cloudmersive-documentai-api-client'
|
|
56
|
+
|
|
57
|
+
# Setup authorization
|
|
58
|
+
CloudmersiveDocumentaiApiClient.configure do |config|
|
|
59
|
+
# Configure API key authorization: Apikey
|
|
60
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
|
61
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
62
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
api_instance = CloudmersiveDocumentaiApiClient::AnalyzeApi.new
|
|
66
|
+
|
|
67
|
+
opts = {
|
|
68
|
+
body: CloudmersiveDocumentaiApiClient::DocumentPolicyRequest.new # DocumentPolicyRequest | Input request, including document and policy rules
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
begin
|
|
72
|
+
#Enforce Policies to a Document to allow or block it using Advanced AI
|
|
73
|
+
result = api_instance.apply_rules(opts)
|
|
74
|
+
p result
|
|
75
|
+
rescue CloudmersiveDocumentaiApiClient::ApiError => e
|
|
76
|
+
puts "Exception when calling AnalyzeApi->apply_rules: #{e}"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Documentation for API Endpoints
|
|
82
|
+
|
|
83
|
+
All URIs are relative to *https://localhost*
|
|
84
|
+
|
|
85
|
+
Class | Method | HTTP request | Description
|
|
86
|
+
------------ | ------------- | ------------- | -------------
|
|
87
|
+
*CloudmersiveDocumentaiApiClient::AnalyzeApi* | [**apply_rules**](docs/AnalyzeApi.md#apply_rules) | **POST** /document-ai/document/analyze/enforce-policy | Enforce Policies to a Document to allow or block it using Advanced AI
|
|
88
|
+
*CloudmersiveDocumentaiApiClient::ExtractApi* | [**extract_all_fields_and_tables**](docs/ExtractApi.md#extract_all_fields_and_tables) | **POST** /document-ai/document/extract/all | Extract All Fields and Tables of Data from a Document using AI
|
|
89
|
+
*CloudmersiveDocumentaiApiClient::ExtractApi* | [**extract_barcodes**](docs/ExtractApi.md#extract_barcodes) | **POST** /document-ai/document/extract/barcodes | Extract Barcodes of from a Document using AI
|
|
90
|
+
*CloudmersiveDocumentaiApiClient::ExtractApi* | [**extract_classification**](docs/ExtractApi.md#extract_classification) | **POST** /document-ai/document/extract/classify | Extract Classification or Category from a Document using AI
|
|
91
|
+
*CloudmersiveDocumentaiApiClient::ExtractApi* | [**extract_classification_advanced**](docs/ExtractApi.md#extract_classification_advanced) | **POST** /document-ai/document/extract/classify/advanced | Extract Classification or Category from a Document using Advanced AI
|
|
92
|
+
*CloudmersiveDocumentaiApiClient::ExtractApi* | [**extract_fields**](docs/ExtractApi.md#extract_fields) | **POST** /document-ai/document/extract/fields | Extract Field Values from a Document using AI
|
|
93
|
+
*CloudmersiveDocumentaiApiClient::ExtractApi* | [**extract_fields_advanced**](docs/ExtractApi.md#extract_fields_advanced) | **POST** /document-ai/document/extract/fields/advanced | Extract Field Values from a Document using Advanced AI
|
|
94
|
+
*CloudmersiveDocumentaiApiClient::ExtractApi* | [**extract_summary**](docs/ExtractApi.md#extract_summary) | **POST** /document-ai/document/extract/summary | Extract Summary from a Document using AI
|
|
95
|
+
*CloudmersiveDocumentaiApiClient::ExtractApi* | [**extract_tables**](docs/ExtractApi.md#extract_tables) | **POST** /document-ai/document/extract/tables | Extract Tables of Data from a Document using AI
|
|
96
|
+
*CloudmersiveDocumentaiApiClient::ExtractApi* | [**extract_text**](docs/ExtractApi.md#extract_text) | **POST** /document-ai/document/extract/text | Extract Text from a Document using AI
|
|
97
|
+
*CloudmersiveDocumentaiApiClient::RunBatchJobApi* | [**extract_all_fields_and_tables_from_document_batch_job**](docs/RunBatchJobApi.md#extract_all_fields_and_tables_from_document_batch_job) | **POST** /document-ai/document/batch-job/extract/all | Extract All Fields and Tables of Data from a Document using AI as a Batch Job
|
|
98
|
+
*CloudmersiveDocumentaiApiClient::RunBatchJobApi* | [**extract_classification_from_document_batch_job**](docs/RunBatchJobApi.md#extract_classification_from_document_batch_job) | **POST** /document-ai/document/batch-job/extract/classify | Extract Classification or Category from a Document using AI as a Batch Job
|
|
99
|
+
*CloudmersiveDocumentaiApiClient::RunBatchJobApi* | [**extract_fields_from_document_advanced_batch_job**](docs/RunBatchJobApi.md#extract_fields_from_document_advanced_batch_job) | **POST** /document-ai/document/batch-job/extract/fields/advanced | Extract Field Values from a Document using Advanced AI as a Batch Job
|
|
100
|
+
*CloudmersiveDocumentaiApiClient::RunBatchJobApi* | [**extract_text_from_document_batch_job**](docs/RunBatchJobApi.md#extract_text_from_document_batch_job) | **POST** /document-ai/document/batch-job/extract/text | Extract Text from a Document using AI as a Batch Job
|
|
101
|
+
*CloudmersiveDocumentaiApiClient::RunBatchJobApi* | [**get_async_job_status**](docs/RunBatchJobApi.md#get_async_job_status) | **GET** /document-ai/document/batch-job/batch-job/status | Get the status and result of an Extract Document Batch Job
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
## Documentation for Models
|
|
105
|
+
|
|
106
|
+
- [CloudmersiveDocumentaiApiClient::AdvancedExtractClassificationRequest](docs/AdvancedExtractClassificationRequest.md)
|
|
107
|
+
- [CloudmersiveDocumentaiApiClient::AdvancedExtractFieldsRequest](docs/AdvancedExtractFieldsRequest.md)
|
|
108
|
+
- [CloudmersiveDocumentaiApiClient::DocumentAdvancedClassificationResult](docs/DocumentAdvancedClassificationResult.md)
|
|
109
|
+
- [CloudmersiveDocumentaiApiClient::DocumentCategories](docs/DocumentCategories.md)
|
|
110
|
+
- [CloudmersiveDocumentaiApiClient::DocumentClassificationResult](docs/DocumentClassificationResult.md)
|
|
111
|
+
- [CloudmersiveDocumentaiApiClient::DocumentPolicyRequest](docs/DocumentPolicyRequest.md)
|
|
112
|
+
- [CloudmersiveDocumentaiApiClient::DocumentPolicyResult](docs/DocumentPolicyResult.md)
|
|
113
|
+
- [CloudmersiveDocumentaiApiClient::ExtractBarcodesAiResponse](docs/ExtractBarcodesAiResponse.md)
|
|
114
|
+
- [CloudmersiveDocumentaiApiClient::ExtractDocumentBatchJobResult](docs/ExtractDocumentBatchJobResult.md)
|
|
115
|
+
- [CloudmersiveDocumentaiApiClient::ExtractDocumentJobStatusResult](docs/ExtractDocumentJobStatusResult.md)
|
|
116
|
+
- [CloudmersiveDocumentaiApiClient::ExtractFieldsAndTablesResponse](docs/ExtractFieldsAndTablesResponse.md)
|
|
117
|
+
- [CloudmersiveDocumentaiApiClient::ExtractFieldsResponse](docs/ExtractFieldsResponse.md)
|
|
118
|
+
- [CloudmersiveDocumentaiApiClient::ExtractTablesResponse](docs/ExtractTablesResponse.md)
|
|
119
|
+
- [CloudmersiveDocumentaiApiClient::ExtractTextResponse](docs/ExtractTextResponse.md)
|
|
120
|
+
- [CloudmersiveDocumentaiApiClient::ExtractedBarcodeItem](docs/ExtractedBarcodeItem.md)
|
|
121
|
+
- [CloudmersiveDocumentaiApiClient::ExtractedTextPage](docs/ExtractedTextPage.md)
|
|
122
|
+
- [CloudmersiveDocumentaiApiClient::FieldToExtract](docs/FieldToExtract.md)
|
|
123
|
+
- [CloudmersiveDocumentaiApiClient::FieldValue](docs/FieldValue.md)
|
|
124
|
+
- [CloudmersiveDocumentaiApiClient::PolicyRule](docs/PolicyRule.md)
|
|
125
|
+
- [CloudmersiveDocumentaiApiClient::PolicyRuleViolation](docs/PolicyRuleViolation.md)
|
|
126
|
+
- [CloudmersiveDocumentaiApiClient::SummarizeDocumentResponse](docs/SummarizeDocumentResponse.md)
|
|
127
|
+
- [CloudmersiveDocumentaiApiClient::TableResult](docs/TableResult.md)
|
|
128
|
+
- [CloudmersiveDocumentaiApiClient::TableResultCell](docs/TableResultCell.md)
|
|
129
|
+
- [CloudmersiveDocumentaiApiClient::TableResultRow](docs/TableResultRow.md)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
## Documentation for Authorization
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### Apikey
|
|
136
|
+
|
|
137
|
+
- **Type**: API key
|
|
138
|
+
- **API key parameter name**: Apikey
|
|
139
|
+
- **Location**: HTTP header
|
|
140
|
+
|
data/Rakefile
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
=begin
|
|
4
|
+
#Document AI API
|
|
5
|
+
|
|
6
|
+
#Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
|
|
7
|
+
|
|
8
|
+
OpenAPI spec version: v1
|
|
9
|
+
|
|
10
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
11
|
+
Swagger Codegen version: 2.4.14
|
|
12
|
+
|
|
13
|
+
=end
|
|
14
|
+
|
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
16
|
+
require "cloudmersive-documentai-api-client/version"
|
|
17
|
+
|
|
18
|
+
Gem::Specification.new do |s|
|
|
19
|
+
s.name = "cloudmersive-documentai-api-client"
|
|
20
|
+
s.version = CloudmersiveDocumentaiApiClient::VERSION
|
|
21
|
+
s.platform = Gem::Platform::RUBY
|
|
22
|
+
s.authors = ["Cloudmersive"]
|
|
23
|
+
s.email = [""]
|
|
24
|
+
s.homepage = "https://cloudmersive.com/document-ai-api"
|
|
25
|
+
s.summary = "Use next-generation AI to extract data, fields, insights and text from documents. Instantly."
|
|
26
|
+
s.description = "Use next-generation AI to extract data, fields, insights and text from documents. Instantly."
|
|
27
|
+
s.license = 'Apache 2.0'
|
|
28
|
+
s.required_ruby_version = ">= 1.9"
|
|
29
|
+
|
|
30
|
+
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
|
31
|
+
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
|
32
|
+
|
|
33
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
|
34
|
+
s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
|
|
35
|
+
s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
|
|
36
|
+
s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
|
|
37
|
+
s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
|
|
38
|
+
s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
|
|
39
|
+
s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
|
|
40
|
+
|
|
41
|
+
s.files = Dir['./**/*']
|
|
42
|
+
s.test_files = `find spec/*`.split("\n")
|
|
43
|
+
s.executables = []
|
|
44
|
+
s.require_paths = ["lib"]
|
|
45
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# CloudmersiveDocumentaiApiClient::AdvancedExtractClassificationRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**input_file** | **String** | Input document file to perform the operation on as a byte array | [optional]
|
|
7
|
+
**categories** | [**Array<DocumentCategories>**](DocumentCategories.md) | Possible categories for the document | [optional]
|
|
8
|
+
**maximum_pages_processed** | **Integer** | Optional: Limit the number of pages processed | [optional]
|
|
9
|
+
|
|
10
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# CloudmersiveDocumentaiApiClient::AdvancedExtractFieldsRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**input_file** | **String** | Input document file to perform the operation on as a byte array | [optional]
|
|
7
|
+
**fields_to_extract** | [**Array<FieldToExtract>**](FieldToExtract.md) | Fields to extract from the document | [optional]
|
|
8
|
+
**maximum_pages_processed** | **Integer** | Optional: Limit the number of pages processed | [optional]
|
|
9
|
+
|
|
10
|
+
|
data/docs/AnalyzeApi.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# CloudmersiveDocumentaiApiClient::AnalyzeApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://localhost*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**apply_rules**](AnalyzeApi.md#apply_rules) | **POST** /document-ai/document/analyze/enforce-policy | Enforce Policies to a Document to allow or block it using Advanced AI
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# **apply_rules**
|
|
11
|
+
> DocumentPolicyResult apply_rules(opts)
|
|
12
|
+
|
|
13
|
+
Enforce Policies to a Document to allow or block it using Advanced AI
|
|
14
|
+
|
|
15
|
+
Enforce Policies to a Document to allow or block it using Advanced AI. Input document formats supported include DOCX, PDF, PNG and JPG.
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
```ruby
|
|
19
|
+
# load the gem
|
|
20
|
+
require 'cloudmersive-documentai-api-client'
|
|
21
|
+
# setup authorization
|
|
22
|
+
CloudmersiveDocumentaiApiClient.configure do |config|
|
|
23
|
+
# Configure API key authorization: Apikey
|
|
24
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
|
25
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
26
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
api_instance = CloudmersiveDocumentaiApiClient::AnalyzeApi.new
|
|
30
|
+
|
|
31
|
+
opts = {
|
|
32
|
+
body: CloudmersiveDocumentaiApiClient::DocumentPolicyRequest.new # DocumentPolicyRequest | Input request, including document and policy rules
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
begin
|
|
36
|
+
#Enforce Policies to a Document to allow or block it using Advanced AI
|
|
37
|
+
result = api_instance.apply_rules(opts)
|
|
38
|
+
p result
|
|
39
|
+
rescue CloudmersiveDocumentaiApiClient::ApiError => e
|
|
40
|
+
puts "Exception when calling AnalyzeApi->apply_rules: #{e}"
|
|
41
|
+
end
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Parameters
|
|
45
|
+
|
|
46
|
+
Name | Type | Description | Notes
|
|
47
|
+
------------- | ------------- | ------------- | -------------
|
|
48
|
+
**body** | [**DocumentPolicyRequest**](DocumentPolicyRequest.md)| Input request, including document and policy rules | [optional]
|
|
49
|
+
|
|
50
|
+
### Return type
|
|
51
|
+
|
|
52
|
+
[**DocumentPolicyResult**](DocumentPolicyResult.md)
|
|
53
|
+
|
|
54
|
+
### Authorization
|
|
55
|
+
|
|
56
|
+
[Apikey](../README.md#Apikey)
|
|
57
|
+
|
|
58
|
+
### HTTP request headers
|
|
59
|
+
|
|
60
|
+
- **Content-Type**: application/json, text/json, application/*+json
|
|
61
|
+
- **Accept**: text/plain, application/json, text/json
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# CloudmersiveDocumentaiApiClient::DocumentAdvancedClassificationResult
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**successful** | **BOOLEAN** | True if successful, false otherwise | [optional]
|
|
7
|
+
**document_category_result** | **String** | Category applied to the document; if a category could not be identified then \"other\" will be used. Spaces are replaced with underscores. | [optional]
|
|
8
|
+
|
|
9
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# CloudmersiveDocumentaiApiClient::DocumentCategories
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**category_name** | **String** | Name of the classification | [optional]
|
|
7
|
+
**category_description** | **String** | Optional but recommended: Description of the classification in natural langugage | [optional]
|
|
8
|
+
|
|
9
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# CloudmersiveDocumentaiApiClient::DocumentClassificationResult
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**successful** | **BOOLEAN** | True if successful, false otherwise | [optional]
|
|
7
|
+
**document_category_result** | **String** | Category applied to the document; if a category could not be identified then \"other\" will be used. Spaces are replaced with underscores. | [optional]
|
|
8
|
+
|
|
9
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# CloudmersiveDocumentaiApiClient::DocumentPolicyRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**input_file** | **String** | Input file as a byte array | [optional]
|
|
7
|
+
**rules** | [**Array<PolicyRule>**](PolicyRule.md) | Rules to apply to the document | [optional]
|
|
8
|
+
|
|
9
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# CloudmersiveDocumentaiApiClient::DocumentPolicyResult
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**clean_result** | **BOOLEAN** | True if the document complies with all of the policies, and false if it does not | [optional]
|
|
7
|
+
**risk_score** | **Float** | Risk score between 0.0 and 1.0 where values above 0.5 are increasing levels of risk | [optional]
|
|
8
|
+
**rule_violations** | [**Array<PolicyRuleViolation>**](PolicyRuleViolation.md) | Policy violations | [optional]
|
|
9
|
+
|
|
10
|
+
|