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.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +140 -0
  4. data/Rakefile +8 -0
  5. data/cloudmersive-documentai-api-client.gemspec +45 -0
  6. data/docs/AdvancedExtractClassificationRequest.md +10 -0
  7. data/docs/AdvancedExtractFieldsRequest.md +10 -0
  8. data/docs/AnalyzeApi.md +64 -0
  9. data/docs/DocumentAdvancedClassificationResult.md +9 -0
  10. data/docs/DocumentCategories.md +9 -0
  11. data/docs/DocumentClassificationResult.md +9 -0
  12. data/docs/DocumentPolicyRequest.md +9 -0
  13. data/docs/DocumentPolicyResult.md +10 -0
  14. data/docs/ExtractApi.md +534 -0
  15. data/docs/ExtractBarcodesAiResponse.md +9 -0
  16. data/docs/ExtractDocumentBatchJobResult.md +9 -0
  17. data/docs/ExtractDocumentJobStatusResult.md +15 -0
  18. data/docs/ExtractFieldsAndTablesResponse.md +10 -0
  19. data/docs/ExtractFieldsResponse.md +9 -0
  20. data/docs/ExtractTablesResponse.md +9 -0
  21. data/docs/ExtractTextResponse.md +9 -0
  22. data/docs/ExtractedBarcodeItem.md +9 -0
  23. data/docs/ExtractedTextPage.md +9 -0
  24. data/docs/FieldToExtract.md +11 -0
  25. data/docs/FieldValue.md +9 -0
  26. data/docs/PolicyRule.md +10 -0
  27. data/docs/PolicyRuleViolation.md +10 -0
  28. data/docs/RunBatchJobApi.md +298 -0
  29. data/docs/SummarizeDocumentResponse.md +9 -0
  30. data/docs/TableResult.md +9 -0
  31. data/docs/TableResultCell.md +9 -0
  32. data/docs/TableResultRow.md +8 -0
  33. data/git_push.sh +55 -0
  34. data/lib/cloudmersive-documentai-api-client/api/analyze_api.rb +73 -0
  35. data/lib/cloudmersive-documentai-api-client/api/extract_api.rb +513 -0
  36. data/lib/cloudmersive-documentai-api-client/api/run_batch_job_api.rb +290 -0
  37. data/lib/cloudmersive-documentai-api-client/api_client.rb +391 -0
  38. data/lib/cloudmersive-documentai-api-client/api_error.rb +38 -0
  39. data/lib/cloudmersive-documentai-api-client/configuration.rb +209 -0
  40. data/lib/cloudmersive-documentai-api-client/models/advanced_extract_classification_request.rb +223 -0
  41. data/lib/cloudmersive-documentai-api-client/models/advanced_extract_fields_request.rb +223 -0
  42. data/lib/cloudmersive-documentai-api-client/models/document_advanced_classification_result.rb +196 -0
  43. data/lib/cloudmersive-documentai-api-client/models/document_categories.rb +196 -0
  44. data/lib/cloudmersive-documentai-api-client/models/document_classification_result.rb +196 -0
  45. data/lib/cloudmersive-documentai-api-client/models/document_policy_request.rb +213 -0
  46. data/lib/cloudmersive-documentai-api-client/models/document_policy_result.rb +208 -0
  47. data/lib/cloudmersive-documentai-api-client/models/extract_barcodes_ai_response.rb +198 -0
  48. data/lib/cloudmersive-documentai-api-client/models/extract_document_batch_job_result.rb +196 -0
  49. data/lib/cloudmersive-documentai-api-client/models/extract_document_job_status_result.rb +252 -0
  50. data/lib/cloudmersive-documentai-api-client/models/extract_fields_and_tables_response.rb +210 -0
  51. data/lib/cloudmersive-documentai-api-client/models/extract_fields_response.rb +198 -0
  52. data/lib/cloudmersive-documentai-api-client/models/extract_tables_response.rb +198 -0
  53. data/lib/cloudmersive-documentai-api-client/models/extract_text_response.rb +198 -0
  54. data/lib/cloudmersive-documentai-api-client/models/extracted_barcode_item.rb +196 -0
  55. data/lib/cloudmersive-documentai-api-client/models/extracted_text_page.rb +196 -0
  56. data/lib/cloudmersive-documentai-api-client/models/field_to_extract.rb +216 -0
  57. data/lib/cloudmersive-documentai-api-client/models/field_value.rb +196 -0
  58. data/lib/cloudmersive-documentai-api-client/models/policy_rule.rb +205 -0
  59. data/lib/cloudmersive-documentai-api-client/models/policy_rule_violation.rb +206 -0
  60. data/lib/cloudmersive-documentai-api-client/models/summarize_document_response.rb +196 -0
  61. data/lib/cloudmersive-documentai-api-client/models/table_result.rb +198 -0
  62. data/lib/cloudmersive-documentai-api-client/models/table_result_cell.rb +196 -0
  63. data/lib/cloudmersive-documentai-api-client/models/table_result_row.rb +188 -0
  64. data/lib/cloudmersive-documentai-api-client/version.rb +15 -0
  65. data/lib/cloudmersive-documentai-api-client.rb +66 -0
  66. data/spec/api/analyze_api_spec.rb +47 -0
  67. data/spec/api/extract_api_spec.rb +154 -0
  68. data/spec/api/run_batch_job_api_spec.rb +100 -0
  69. data/spec/api_client_spec.rb +243 -0
  70. data/spec/configuration_spec.rb +42 -0
  71. data/spec/models/advanced_extract_classification_request_spec.rb +53 -0
  72. data/spec/models/advanced_extract_fields_request_spec.rb +53 -0
  73. data/spec/models/document_advanced_classification_result_spec.rb +47 -0
  74. data/spec/models/document_categories_spec.rb +47 -0
  75. data/spec/models/document_classification_result_spec.rb +47 -0
  76. data/spec/models/document_policy_request_spec.rb +47 -0
  77. data/spec/models/document_policy_result_spec.rb +53 -0
  78. data/spec/models/extract_barcodes_ai_response_spec.rb +47 -0
  79. data/spec/models/extract_document_batch_job_result_spec.rb +47 -0
  80. data/spec/models/extract_document_job_status_result_spec.rb +83 -0
  81. data/spec/models/extract_fields_and_tables_response_spec.rb +53 -0
  82. data/spec/models/extract_fields_response_spec.rb +47 -0
  83. data/spec/models/extract_tables_response_spec.rb +47 -0
  84. data/spec/models/extract_text_response_spec.rb +47 -0
  85. data/spec/models/extracted_barcode_item_spec.rb +47 -0
  86. data/spec/models/extracted_text_page_spec.rb +47 -0
  87. data/spec/models/field_to_extract_spec.rb +59 -0
  88. data/spec/models/field_value_spec.rb +47 -0
  89. data/spec/models/policy_rule_spec.rb +53 -0
  90. data/spec/models/policy_rule_violation_spec.rb +53 -0
  91. data/spec/models/summarize_document_response_spec.rb +47 -0
  92. data/spec/models/table_result_cell_spec.rb +47 -0
  93. data/spec/models/table_result_row_spec.rb +41 -0
  94. data/spec/models/table_result_spec.rb +47 -0
  95. data/spec/spec_helper.rb +111 -0
  96. metadata +319 -0
@@ -0,0 +1,298 @@
1
+ # CloudmersiveDocumentaiApiClient::RunBatchJobApi
2
+
3
+ All URIs are relative to *https://localhost*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**extract_all_fields_and_tables_from_document_batch_job**](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
8
+ [**extract_classification_from_document_batch_job**](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
9
+ [**extract_fields_from_document_advanced_batch_job**](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
10
+ [**extract_text_from_document_batch_job**](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
11
+ [**get_async_job_status**](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
12
+
13
+
14
+ # **extract_all_fields_and_tables_from_document_batch_job**
15
+ > ExtractDocumentBatchJobResult extract_all_fields_and_tables_from_document_batch_job(opts)
16
+
17
+ Extract All Fields and Tables of Data from a Document using AI as a Batch Job
18
+
19
+ Creates an async batch job for processing a large document as an AI batch job. Extract all Fields and Tables, comprised of rows and columns of data, from a document using AI. Input document formats supported include DOCX, PDF, PNG and JPG.
20
+
21
+ ### Example
22
+ ```ruby
23
+ # load the gem
24
+ require 'cloudmersive-documentai-api-client'
25
+ # setup authorization
26
+ CloudmersiveDocumentaiApiClient.configure do |config|
27
+ # Configure API key authorization: Apikey
28
+ config.api_key['Apikey'] = 'YOUR API KEY'
29
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
30
+ #config.api_key_prefix['Apikey'] = 'Bearer'
31
+ end
32
+
33
+ api_instance = CloudmersiveDocumentaiApiClient::RunBatchJobApi.new
34
+
35
+ opts = {
36
+ recognition_mode: 'recognition_mode_example', # String | Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
37
+ input_file: File.new('/path/to/file.txt') # File | Input document, or photos of a document, to extract data from
38
+ }
39
+
40
+ begin
41
+ #Extract All Fields and Tables of Data from a Document using AI as a Batch Job
42
+ result = api_instance.extract_all_fields_and_tables_from_document_batch_job(opts)
43
+ p result
44
+ rescue CloudmersiveDocumentaiApiClient::ApiError => e
45
+ puts "Exception when calling RunBatchJobApi->extract_all_fields_and_tables_from_document_batch_job: #{e}"
46
+ end
47
+ ```
48
+
49
+ ### Parameters
50
+
51
+ Name | Type | Description | Notes
52
+ ------------- | ------------- | ------------- | -------------
53
+ **recognition_mode** | **String**| Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images | [optional]
54
+ **input_file** | **File**| Input document, or photos of a document, to extract data from | [optional]
55
+
56
+ ### Return type
57
+
58
+ [**ExtractDocumentBatchJobResult**](ExtractDocumentBatchJobResult.md)
59
+
60
+ ### Authorization
61
+
62
+ [Apikey](../README.md#Apikey)
63
+
64
+ ### HTTP request headers
65
+
66
+ - **Content-Type**: multipart/form-data
67
+ - **Accept**: text/plain, application/json, text/json
68
+
69
+
70
+
71
+ # **extract_classification_from_document_batch_job**
72
+ > ExtractDocumentBatchJobResult extract_classification_from_document_batch_job(opts)
73
+
74
+ Extract Classification or Category from a Document using AI as a Batch Job
75
+
76
+ Creates an async batch job for processing a large document as an AI batch job. Extract Classification or Category (e.g. Invoice, Receipt, Tax Form, or Form 1040, Form 1040 EZ, etc.) from a document using AI. Input document formats supported include DOCX, PDF, PNG and JPG.
77
+
78
+ ### Example
79
+ ```ruby
80
+ # load the gem
81
+ require 'cloudmersive-documentai-api-client'
82
+ # setup authorization
83
+ CloudmersiveDocumentaiApiClient.configure do |config|
84
+ # Configure API key authorization: Apikey
85
+ config.api_key['Apikey'] = 'YOUR API KEY'
86
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
87
+ #config.api_key_prefix['Apikey'] = 'Bearer'
88
+ end
89
+
90
+ api_instance = CloudmersiveDocumentaiApiClient::RunBatchJobApi.new
91
+
92
+ opts = {
93
+ categories: 'categories_example', # String | Desired classification to extract
94
+ recognition_mode: 'recognition_mode_example', # String | Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
95
+ input_file: File.new('/path/to/file.txt') # File | Input document, or photos of a document, to extract data from
96
+ }
97
+
98
+ begin
99
+ #Extract Classification or Category from a Document using AI as a Batch Job
100
+ result = api_instance.extract_classification_from_document_batch_job(opts)
101
+ p result
102
+ rescue CloudmersiveDocumentaiApiClient::ApiError => e
103
+ puts "Exception when calling RunBatchJobApi->extract_classification_from_document_batch_job: #{e}"
104
+ end
105
+ ```
106
+
107
+ ### Parameters
108
+
109
+ Name | Type | Description | Notes
110
+ ------------- | ------------- | ------------- | -------------
111
+ **categories** | **String**| Desired classification to extract | [optional]
112
+ **recognition_mode** | **String**| Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images | [optional]
113
+ **input_file** | **File**| Input document, or photos of a document, to extract data from | [optional]
114
+
115
+ ### Return type
116
+
117
+ [**ExtractDocumentBatchJobResult**](ExtractDocumentBatchJobResult.md)
118
+
119
+ ### Authorization
120
+
121
+ [Apikey](../README.md#Apikey)
122
+
123
+ ### HTTP request headers
124
+
125
+ - **Content-Type**: multipart/form-data
126
+ - **Accept**: text/plain, application/json, text/json
127
+
128
+
129
+
130
+ # **extract_fields_from_document_advanced_batch_job**
131
+ > ExtractDocumentBatchJobResult extract_fields_from_document_advanced_batch_job(opts)
132
+
133
+ Extract Field Values from a Document using Advanced AI as a Batch Job
134
+
135
+ Creates an async batch job for processing a large document as an AI batch job. Extract Field Values (e.g. Invoice Number, Invoice Date, Business Card Phone Number, etc.) from a document using Advanced AI. Input document formats supported include DOCX, PDF, PNG and JPG.
136
+
137
+ ### Example
138
+ ```ruby
139
+ # load the gem
140
+ require 'cloudmersive-documentai-api-client'
141
+ # setup authorization
142
+ CloudmersiveDocumentaiApiClient.configure do |config|
143
+ # Configure API key authorization: Apikey
144
+ config.api_key['Apikey'] = 'YOUR API KEY'
145
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
146
+ #config.api_key_prefix['Apikey'] = 'Bearer'
147
+ end
148
+
149
+ api_instance = CloudmersiveDocumentaiApiClient::RunBatchJobApi.new
150
+
151
+ opts = {
152
+ recognition_mode: 'recognition_mode_example', # String | Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
153
+ body: CloudmersiveDocumentaiApiClient::AdvancedExtractFieldsRequest.new # AdvancedExtractFieldsRequest |
154
+ }
155
+
156
+ begin
157
+ #Extract Field Values from a Document using Advanced AI as a Batch Job
158
+ result = api_instance.extract_fields_from_document_advanced_batch_job(opts)
159
+ p result
160
+ rescue CloudmersiveDocumentaiApiClient::ApiError => e
161
+ puts "Exception when calling RunBatchJobApi->extract_fields_from_document_advanced_batch_job: #{e}"
162
+ end
163
+ ```
164
+
165
+ ### Parameters
166
+
167
+ Name | Type | Description | Notes
168
+ ------------- | ------------- | ------------- | -------------
169
+ **recognition_mode** | **String**| Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images | [optional]
170
+ **body** | [**AdvancedExtractFieldsRequest**](AdvancedExtractFieldsRequest.md)| | [optional]
171
+
172
+ ### Return type
173
+
174
+ [**ExtractDocumentBatchJobResult**](ExtractDocumentBatchJobResult.md)
175
+
176
+ ### Authorization
177
+
178
+ [Apikey](../README.md#Apikey)
179
+
180
+ ### HTTP request headers
181
+
182
+ - **Content-Type**: application/json, text/json, application/*+json
183
+ - **Accept**: text/plain, application/json, text/json
184
+
185
+
186
+
187
+ # **extract_text_from_document_batch_job**
188
+ > ExtractDocumentBatchJobResult extract_text_from_document_batch_job(opts)
189
+
190
+ Extract Text from a Document using AI as a Batch Job
191
+
192
+ Creates an async batch job for processing a large document as an AI batch job. Input document formats supported include DOCX, PDF, PNG and JPG. Supports a wide range of languages.
193
+
194
+ ### Example
195
+ ```ruby
196
+ # load the gem
197
+ require 'cloudmersive-documentai-api-client'
198
+ # setup authorization
199
+ CloudmersiveDocumentaiApiClient.configure do |config|
200
+ # Configure API key authorization: Apikey
201
+ config.api_key['Apikey'] = 'YOUR API KEY'
202
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
203
+ #config.api_key_prefix['Apikey'] = 'Bearer'
204
+ end
205
+
206
+ api_instance = CloudmersiveDocumentaiApiClient::RunBatchJobApi.new
207
+
208
+ opts = {
209
+ recognition_mode: 'recognition_mode_example', # String | Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
210
+ input_file: File.new('/path/to/file.txt') # File | Input document, or photos of a document, to extract data from
211
+ }
212
+
213
+ begin
214
+ #Extract Text from a Document using AI as a Batch Job
215
+ result = api_instance.extract_text_from_document_batch_job(opts)
216
+ p result
217
+ rescue CloudmersiveDocumentaiApiClient::ApiError => e
218
+ puts "Exception when calling RunBatchJobApi->extract_text_from_document_batch_job: #{e}"
219
+ end
220
+ ```
221
+
222
+ ### Parameters
223
+
224
+ Name | Type | Description | Notes
225
+ ------------- | ------------- | ------------- | -------------
226
+ **recognition_mode** | **String**| Optional; Recognition mode - Advanced (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images | [optional]
227
+ **input_file** | **File**| Input document, or photos of a document, to extract data from | [optional]
228
+
229
+ ### Return type
230
+
231
+ [**ExtractDocumentBatchJobResult**](ExtractDocumentBatchJobResult.md)
232
+
233
+ ### Authorization
234
+
235
+ [Apikey](../README.md#Apikey)
236
+
237
+ ### HTTP request headers
238
+
239
+ - **Content-Type**: multipart/form-data
240
+ - **Accept**: text/plain, application/json, text/json
241
+
242
+
243
+
244
+ # **get_async_job_status**
245
+ > ExtractDocumentJobStatusResult get_async_job_status(opts)
246
+
247
+ Get the status and result of an Extract Document Batch Job
248
+
249
+ Returns the result of the Async Job - possible states can be STARTED or COMPLETED. This API is only available for Cloudmersive Managed Instance and Private Cloud deployments.
250
+
251
+ ### Example
252
+ ```ruby
253
+ # load the gem
254
+ require 'cloudmersive-documentai-api-client'
255
+ # setup authorization
256
+ CloudmersiveDocumentaiApiClient.configure do |config|
257
+ # Configure API key authorization: Apikey
258
+ config.api_key['Apikey'] = 'YOUR API KEY'
259
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
260
+ #config.api_key_prefix['Apikey'] = 'Bearer'
261
+ end
262
+
263
+ api_instance = CloudmersiveDocumentaiApiClient::RunBatchJobApi.new
264
+
265
+ opts = {
266
+ async_job_id: 'async_job_id_example' # String |
267
+ }
268
+
269
+ begin
270
+ #Get the status and result of an Extract Document Batch Job
271
+ result = api_instance.get_async_job_status(opts)
272
+ p result
273
+ rescue CloudmersiveDocumentaiApiClient::ApiError => e
274
+ puts "Exception when calling RunBatchJobApi->get_async_job_status: #{e}"
275
+ end
276
+ ```
277
+
278
+ ### Parameters
279
+
280
+ Name | Type | Description | Notes
281
+ ------------- | ------------- | ------------- | -------------
282
+ **async_job_id** | **String**| | [optional]
283
+
284
+ ### Return type
285
+
286
+ [**ExtractDocumentJobStatusResult**](ExtractDocumentJobStatusResult.md)
287
+
288
+ ### Authorization
289
+
290
+ [Apikey](../README.md#Apikey)
291
+
292
+ ### HTTP request headers
293
+
294
+ - **Content-Type**: Not defined
295
+ - **Accept**: text/plain, application/json, text/json
296
+
297
+
298
+
@@ -0,0 +1,9 @@
1
+ # CloudmersiveDocumentaiApiClient::SummarizeDocumentResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **successful** | **BOOLEAN** | True if successful, false otherwise | [optional]
7
+ **document_summary_text** | **String** | Summary of the document | [optional]
8
+
9
+
@@ -0,0 +1,9 @@
1
+ # CloudmersiveDocumentaiApiClient::TableResult
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **title** | **String** | Title of the table (optional) | [optional]
7
+ **rows** | [**Array<TableResultRow>**](TableResultRow.md) | Rows of the table | [optional]
8
+
9
+
@@ -0,0 +1,9 @@
1
+ # CloudmersiveDocumentaiApiClient::TableResultCell
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **cell_header** | **String** | Cell column header | [optional]
7
+ **cell_value** | **String** | Cell value as a string | [optional]
8
+
9
+
@@ -0,0 +1,8 @@
1
+ # CloudmersiveDocumentaiApiClient::TableResultRow
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **cells** | [**Array<TableResultCell>**](TableResultCell.md) | Cells in the row | [optional]
7
+
8
+
data/git_push.sh ADDED
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+ #
3
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
4
+ #
5
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
6
+ #
7
+ # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
8
+
9
+ git_user_id=$1
10
+ git_repo_id=$2
11
+ release_note=$3
12
+
13
+ if [ "$git_user_id" = "" ]; then
14
+ git_user_id="GIT_USER_ID"
15
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
16
+ fi
17
+
18
+ if [ "$git_repo_id" = "" ]; then
19
+ git_repo_id="GIT_REPO_ID"
20
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
21
+ fi
22
+
23
+ if [ "$release_note" = "" ]; then
24
+ release_note="Minor update"
25
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
26
+ fi
27
+
28
+ # Initialize the local directory as a Git repository
29
+ git init
30
+
31
+ # Adds the files in the local repository and stages them for commit.
32
+ git add .
33
+
34
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
35
+ git commit -m "$release_note"
36
+
37
+ # Sets the new remote
38
+ git_remote=`git remote`
39
+ if [ "$git_remote" = "" ]; then # git remote not defined
40
+
41
+ if [ "$GIT_TOKEN" = "" ]; then
42
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
43
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
44
+ else
45
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
46
+ fi
47
+
48
+ fi
49
+
50
+ git pull origin master
51
+
52
+ # Pushes (Forces) the changes in the local repository up to the remote repository
53
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
54
+ git push origin master 2>&1 | grep -v 'To https'
55
+
@@ -0,0 +1,73 @@
1
+ =begin
2
+ #Document AI API
3
+
4
+ #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module CloudmersiveDocumentaiApiClient
16
+ class AnalyzeApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Enforce Policies to a Document to allow or block it using Advanced AI
23
+ # Enforce Policies to a Document to allow or block it using Advanced AI. Input document formats supported include DOCX, PDF, PNG and JPG.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [DocumentPolicyRequest] :body Input request, including document and policy rules
26
+ # @return [DocumentPolicyResult]
27
+ def apply_rules(opts = {})
28
+ data, _status_code, _headers = apply_rules_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # Enforce Policies to a Document to allow or block it using Advanced AI
33
+ # Enforce Policies to a Document to allow or block it using Advanced AI. Input document formats supported include DOCX, PDF, PNG and JPG.
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [DocumentPolicyRequest] :body Input request, including document and policy rules
36
+ # @return [Array<(DocumentPolicyResult, Fixnum, Hash)>] DocumentPolicyResult data, response status code and response headers
37
+ def apply_rules_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: AnalyzeApi.apply_rules ...'
40
+ end
41
+ # resource path
42
+ local_var_path = '/document-ai/document/analyze/enforce-policy'
43
+
44
+ # query parameters
45
+ query_params = {}
46
+
47
+ # header parameters
48
+ header_params = {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
51
+ # HTTP header 'Content-Type'
52
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
53
+
54
+ # form parameters
55
+ form_params = {}
56
+
57
+ # http body (model)
58
+ post_body = @api_client.object_to_http_body(opts[:'body'])
59
+ auth_names = ['Apikey']
60
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
61
+ :header_params => header_params,
62
+ :query_params => query_params,
63
+ :form_params => form_params,
64
+ :body => post_body,
65
+ :auth_names => auth_names,
66
+ :return_type => 'DocumentPolicyResult')
67
+ if @api_client.config.debugging
68
+ @api_client.config.logger.debug "API called: AnalyzeApi#apply_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
69
+ end
70
+ return data, status_code, headers
71
+ end
72
+ end
73
+ end