cloudmersive-documentai-api-client 2.2.0 → 2.2.1

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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -10
  3. data/cloudmersive-documentai-api-client.gemspec +3 -3
  4. data/docs/AdvancedExtractClassificationRequest.md +3 -0
  5. data/docs/AdvancedExtractFieldsRequest.md +3 -0
  6. data/docs/AnalyzeApi.md +58 -2
  7. data/docs/DocumentAdvancedClassificationResult.md +1 -0
  8. data/docs/DocumentPolicyRequest.md +1 -0
  9. data/docs/DocumentQuestionAnswerItem.md +11 -0
  10. data/docs/DocumentQuestionAnswersResult.md +10 -0
  11. data/docs/DocumentQuestionBoolean.md +9 -0
  12. data/docs/DocumentQuestionChoiceItem.md +9 -0
  13. data/docs/DocumentQuestionFreeResponse.md +9 -0
  14. data/docs/DocumentQuestionMultipleChoice.md +10 -0
  15. data/docs/DocumentQuestionsRequest.md +12 -0
  16. data/docs/ExtractApi.md +76 -14
  17. data/docs/ExtractFieldsAdvancedResponse.md +10 -0
  18. data/docs/FieldAdvancedValue.md +9 -0
  19. data/docs/FieldValue.md +2 -1
  20. data/docs/RunBatchJobApi.md +9 -9
  21. data/docs/SplitDocumentResponse.md +9 -0
  22. data/docs/SubDocument.md +11 -0
  23. data/lib/cloudmersive-documentai-api-client/api/analyze_api.rb +54 -4
  24. data/lib/cloudmersive-documentai-api-client/api/extract_api.rb +85 -25
  25. data/lib/cloudmersive-documentai-api-client/api/run_batch_job_api.rb +14 -14
  26. data/lib/cloudmersive-documentai-api-client/api_client.rb +2 -2
  27. data/lib/cloudmersive-documentai-api-client/api_error.rb +2 -2
  28. data/lib/cloudmersive-documentai-api-client/configuration.rb +3 -3
  29. data/lib/cloudmersive-documentai-api-client/models/advanced_extract_classification_request.rb +36 -6
  30. data/lib/cloudmersive-documentai-api-client/models/advanced_extract_fields_request.rb +36 -6
  31. data/lib/cloudmersive-documentai-api-client/models/document_advanced_classification_result.rb +16 -6
  32. data/lib/cloudmersive-documentai-api-client/models/document_categories.rb +2 -2
  33. data/lib/cloudmersive-documentai-api-client/models/document_classification_result.rb +2 -2
  34. data/lib/cloudmersive-documentai-api-client/models/document_policy_request.rb +16 -6
  35. data/lib/cloudmersive-documentai-api-client/models/document_policy_result.rb +2 -2
  36. data/lib/cloudmersive-documentai-api-client/models/document_question_answer_item.rb +216 -0
  37. data/lib/cloudmersive-documentai-api-client/models/document_question_answers_result.rb +207 -0
  38. data/lib/cloudmersive-documentai-api-client/models/document_question_boolean.rb +196 -0
  39. data/lib/cloudmersive-documentai-api-client/models/document_question_choice_item.rb +196 -0
  40. data/lib/cloudmersive-documentai-api-client/models/document_question_free_response.rb +196 -0
  41. data/lib/cloudmersive-documentai-api-client/models/document_question_multiple_choice.rb +208 -0
  42. data/lib/cloudmersive-documentai-api-client/models/document_questions_request.rb +246 -0
  43. data/lib/cloudmersive-documentai-api-client/models/extract_barcodes_ai_response.rb +2 -2
  44. data/lib/cloudmersive-documentai-api-client/models/extract_document_batch_job_result.rb +2 -2
  45. data/lib/cloudmersive-documentai-api-client/models/extract_document_job_status_result.rb +2 -2
  46. data/lib/cloudmersive-documentai-api-client/models/extract_fields_advanced_response.rb +208 -0
  47. data/lib/cloudmersive-documentai-api-client/models/extract_fields_and_tables_response.rb +2 -2
  48. data/lib/cloudmersive-documentai-api-client/models/extract_fields_response.rb +2 -2
  49. data/lib/cloudmersive-documentai-api-client/models/extract_tables_response.rb +2 -2
  50. data/lib/cloudmersive-documentai-api-client/models/extract_text_response.rb +2 -2
  51. data/lib/cloudmersive-documentai-api-client/models/extracted_barcode_item.rb +2 -2
  52. data/lib/cloudmersive-documentai-api-client/models/extracted_text_page.rb +2 -2
  53. data/lib/cloudmersive-documentai-api-client/models/field_advanced_value.rb +196 -0
  54. data/lib/cloudmersive-documentai-api-client/models/field_to_extract.rb +2 -2
  55. data/lib/cloudmersive-documentai-api-client/models/field_value.rb +19 -7
  56. data/lib/cloudmersive-documentai-api-client/models/policy_rule.rb +2 -2
  57. data/lib/cloudmersive-documentai-api-client/models/policy_rule_violation.rb +2 -2
  58. data/lib/cloudmersive-documentai-api-client/models/split_document_response.rb +198 -0
  59. data/lib/cloudmersive-documentai-api-client/models/sub_document.rb +231 -0
  60. data/lib/cloudmersive-documentai-api-client/models/summarize_document_response.rb +2 -2
  61. data/lib/cloudmersive-documentai-api-client/models/table_result.rb +2 -2
  62. data/lib/cloudmersive-documentai-api-client/models/table_result_cell.rb +2 -2
  63. data/lib/cloudmersive-documentai-api-client/models/table_result_row.rb +2 -2
  64. data/lib/cloudmersive-documentai-api-client/version.rb +3 -3
  65. data/lib/cloudmersive-documentai-api-client.rb +13 -2
  66. data/spec/api/analyze_api_spec.rb +15 -3
  67. data/spec/api/extract_api_spec.rb +28 -13
  68. data/spec/api/run_batch_job_api_spec.rb +8 -8
  69. data/spec/api_client_spec.rb +2 -2
  70. data/spec/configuration_spec.rb +5 -5
  71. data/spec/models/advanced_extract_classification_request_spec.rb +20 -2
  72. data/spec/models/advanced_extract_fields_request_spec.rb +20 -2
  73. data/spec/models/document_advanced_classification_result_spec.rb +8 -2
  74. data/spec/models/document_categories_spec.rb +2 -2
  75. data/spec/models/document_classification_result_spec.rb +2 -2
  76. data/spec/models/document_policy_request_spec.rb +8 -2
  77. data/spec/models/document_policy_result_spec.rb +2 -2
  78. data/spec/models/document_question_answer_item_spec.rb +59 -0
  79. data/spec/models/document_question_answers_result_spec.rb +53 -0
  80. data/spec/models/document_question_boolean_spec.rb +47 -0
  81. data/spec/models/document_question_choice_item_spec.rb +47 -0
  82. data/spec/models/document_question_free_response_spec.rb +47 -0
  83. data/spec/models/document_question_multiple_choice_spec.rb +53 -0
  84. data/spec/models/document_questions_request_spec.rb +65 -0
  85. data/spec/models/extract_barcodes_ai_response_spec.rb +2 -2
  86. data/spec/models/extract_document_batch_job_result_spec.rb +2 -2
  87. data/spec/models/extract_document_job_status_result_spec.rb +2 -2
  88. data/spec/models/extract_fields_advanced_response_spec.rb +53 -0
  89. data/spec/models/extract_fields_and_tables_response_spec.rb +2 -2
  90. data/spec/models/extract_fields_response_spec.rb +2 -2
  91. data/spec/models/extract_tables_response_spec.rb +2 -2
  92. data/spec/models/extract_text_response_spec.rb +2 -2
  93. data/spec/models/extracted_barcode_item_spec.rb +2 -2
  94. data/spec/models/extracted_text_page_spec.rb +2 -2
  95. data/spec/models/field_advanced_value_spec.rb +47 -0
  96. data/spec/models/field_to_extract_spec.rb +2 -2
  97. data/spec/models/field_value_spec.rb +8 -2
  98. data/spec/models/policy_rule_spec.rb +2 -2
  99. data/spec/models/policy_rule_violation_spec.rb +2 -2
  100. data/spec/models/split_document_response_spec.rb +47 -0
  101. data/spec/models/sub_document_spec.rb +59 -0
  102. data/spec/models/summarize_document_response_spec.rb +2 -2
  103. data/spec/models/table_result_cell_spec.rb +2 -2
  104. data/spec/models/table_result_row_spec.rb +2 -2
  105. data/spec/models/table_result_spec.rb +2 -2
  106. data/spec/spec_helper.rb +2 -2
  107. metadata +36 -3
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Document AI API
3
3
 
4
- #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
4
+ #Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
5
5
 
6
6
  OpenAPI spec version: v1
7
-
7
+ Contact: support@cloudmersive.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.14
10
10
 
@@ -129,7 +129,7 @@ module CloudmersiveDocumentaiApiClient
129
129
 
130
130
  def initialize
131
131
  @scheme = 'https'
132
- @host = ''
132
+ @host = 'api.cloudmersive.com'
133
133
  @base_path = ''
134
134
  @api_key = {}
135
135
  @api_key_prefix = {}
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Document AI API
3
3
 
4
- #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
4
+ #Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
5
5
 
6
6
  OpenAPI spec version: v1
7
-
7
+ Contact: support@cloudmersive.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.14
10
10
 
@@ -21,15 +21,27 @@ module CloudmersiveDocumentaiApiClient
21
21
  # Possible categories for the document
22
22
  attr_accessor :categories
23
23
 
24
+ # Optional: Set the level of image pre-processing to enhance accuracy. Possible values are 'Auto', 'SmoothEdges', 'SmoothEdgesPlus', 'Compatability' and 'None'. Default is Auto. Set to SmoothEdges to smooth harsh edges in the input image to enhance recognition accuracy. Set to SmoothEdgesPlus to smooth harsh edges to a higher degree. Set to Compatability for maximum PDF feature compatability.
25
+ attr_accessor :preprocessing
26
+
27
+ # Optional: Set the level of output accuracy cross-checking to perform on the input. Possible values are 'None', 'Advanced', 'Ultra' and 'Hyper'. Default is None. Ultra and Hyper will produce the highest accuracy but at the cost of longer processing times.
28
+ attr_accessor :result_cross_check
29
+
24
30
  # Optional: Limit the number of pages processed
25
31
  attr_accessor :maximum_pages_processed
26
32
 
33
+ # Optional: Rotate the input image before recognition by the specified number of degrees; valid values range from -360 to +360.
34
+ attr_accessor :rotate_image_degrees
35
+
27
36
  # Attribute mapping from ruby-style variable name to JSON key.
28
37
  def self.attribute_map
29
38
  {
30
39
  :'input_file' => :'InputFile',
31
40
  :'categories' => :'Categories',
32
- :'maximum_pages_processed' => :'MaximumPagesProcessed'
41
+ :'preprocessing' => :'Preprocessing',
42
+ :'result_cross_check' => :'ResultCrossCheck',
43
+ :'maximum_pages_processed' => :'MaximumPagesProcessed',
44
+ :'rotate_image_degrees' => :'RotateImageDegrees'
33
45
  }
34
46
  end
35
47
 
@@ -38,7 +50,10 @@ module CloudmersiveDocumentaiApiClient
38
50
  {
39
51
  :'input_file' => :'String',
40
52
  :'categories' => :'Array<DocumentCategories>',
41
- :'maximum_pages_processed' => :'Integer'
53
+ :'preprocessing' => :'String',
54
+ :'result_cross_check' => :'String',
55
+ :'maximum_pages_processed' => :'Integer',
56
+ :'rotate_image_degrees' => :'Float'
42
57
  }
43
58
  end
44
59
 
@@ -60,9 +75,21 @@ module CloudmersiveDocumentaiApiClient
60
75
  end
61
76
  end
62
77
 
78
+ if attributes.has_key?(:'Preprocessing')
79
+ self.preprocessing = attributes[:'Preprocessing']
80
+ end
81
+
82
+ if attributes.has_key?(:'ResultCrossCheck')
83
+ self.result_cross_check = attributes[:'ResultCrossCheck']
84
+ end
85
+
63
86
  if attributes.has_key?(:'MaximumPagesProcessed')
64
87
  self.maximum_pages_processed = attributes[:'MaximumPagesProcessed']
65
88
  end
89
+
90
+ if attributes.has_key?(:'RotateImageDegrees')
91
+ self.rotate_image_degrees = attributes[:'RotateImageDegrees']
92
+ end
66
93
  end
67
94
 
68
95
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -100,7 +127,10 @@ module CloudmersiveDocumentaiApiClient
100
127
  self.class == o.class &&
101
128
  input_file == o.input_file &&
102
129
  categories == o.categories &&
103
- maximum_pages_processed == o.maximum_pages_processed
130
+ preprocessing == o.preprocessing &&
131
+ result_cross_check == o.result_cross_check &&
132
+ maximum_pages_processed == o.maximum_pages_processed &&
133
+ rotate_image_degrees == o.rotate_image_degrees
104
134
  end
105
135
 
106
136
  # @see the `==` method
@@ -112,7 +142,7 @@ module CloudmersiveDocumentaiApiClient
112
142
  # Calculates hash code according to all attributes.
113
143
  # @return [Fixnum] Hash code
114
144
  def hash
115
- [input_file, categories, maximum_pages_processed].hash
145
+ [input_file, categories, preprocessing, result_cross_check, maximum_pages_processed, rotate_image_degrees].hash
116
146
  end
117
147
 
118
148
  # Builds the object from hash
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Document AI API
3
3
 
4
- #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
4
+ #Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
5
5
 
6
6
  OpenAPI spec version: v1
7
-
7
+ Contact: support@cloudmersive.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.14
10
10
 
@@ -24,12 +24,24 @@ module CloudmersiveDocumentaiApiClient
24
24
  # Optional: Limit the number of pages processed
25
25
  attr_accessor :maximum_pages_processed
26
26
 
27
+ # Optional: Set the level of image pre-processing to enhance accuracy. Possible values are 'Auto', 'SmoothEdges', 'SmoothEdgesPlus', 'ContrastEdges', 'ContrastEdgesPlus', 'Invert', 'Binarize', 'Compatability' and 'None'. Default is Auto. Set to SmoothEdges to smooth harsh edges in the input image to enhance recognition accuracy. Set to SmoothEdgesPlus to smooth harsh edges to a higher degree. Set to ContrastEdges and ContrastEdgesPlus to enhance contrast and readability for low quality black and white or grayscale images. Set to Invert to invert the input image. Set to Binarize to binarize the input image. Set to Compatability for maximum PDF feature compatability.
28
+ attr_accessor :preprocessing
29
+
30
+ # Optional: Set the level of output accuracy cross-checking to perform on the input. Possible values are 'None', 'Advanced' and 'Ultra'. Default is None. Ultra will produce the highest accuracy but at the cost of longer processing times.
31
+ attr_accessor :result_cross_check
32
+
33
+ # Optional: Rotate the input image before recognition by the specified number of degrees; valid values range from -360 to +360.
34
+ attr_accessor :rotate_image_degrees
35
+
27
36
  # Attribute mapping from ruby-style variable name to JSON key.
28
37
  def self.attribute_map
29
38
  {
30
39
  :'input_file' => :'InputFile',
31
40
  :'fields_to_extract' => :'FieldsToExtract',
32
- :'maximum_pages_processed' => :'MaximumPagesProcessed'
41
+ :'maximum_pages_processed' => :'MaximumPagesProcessed',
42
+ :'preprocessing' => :'Preprocessing',
43
+ :'result_cross_check' => :'ResultCrossCheck',
44
+ :'rotate_image_degrees' => :'RotateImageDegrees'
33
45
  }
34
46
  end
35
47
 
@@ -38,7 +50,10 @@ module CloudmersiveDocumentaiApiClient
38
50
  {
39
51
  :'input_file' => :'String',
40
52
  :'fields_to_extract' => :'Array<FieldToExtract>',
41
- :'maximum_pages_processed' => :'Integer'
53
+ :'maximum_pages_processed' => :'Integer',
54
+ :'preprocessing' => :'String',
55
+ :'result_cross_check' => :'String',
56
+ :'rotate_image_degrees' => :'Float'
42
57
  }
43
58
  end
44
59
 
@@ -63,6 +78,18 @@ module CloudmersiveDocumentaiApiClient
63
78
  if attributes.has_key?(:'MaximumPagesProcessed')
64
79
  self.maximum_pages_processed = attributes[:'MaximumPagesProcessed']
65
80
  end
81
+
82
+ if attributes.has_key?(:'Preprocessing')
83
+ self.preprocessing = attributes[:'Preprocessing']
84
+ end
85
+
86
+ if attributes.has_key?(:'ResultCrossCheck')
87
+ self.result_cross_check = attributes[:'ResultCrossCheck']
88
+ end
89
+
90
+ if attributes.has_key?(:'RotateImageDegrees')
91
+ self.rotate_image_degrees = attributes[:'RotateImageDegrees']
92
+ end
66
93
  end
67
94
 
68
95
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -100,7 +127,10 @@ module CloudmersiveDocumentaiApiClient
100
127
  self.class == o.class &&
101
128
  input_file == o.input_file &&
102
129
  fields_to_extract == o.fields_to_extract &&
103
- maximum_pages_processed == o.maximum_pages_processed
130
+ maximum_pages_processed == o.maximum_pages_processed &&
131
+ preprocessing == o.preprocessing &&
132
+ result_cross_check == o.result_cross_check &&
133
+ rotate_image_degrees == o.rotate_image_degrees
104
134
  end
105
135
 
106
136
  # @see the `==` method
@@ -112,7 +142,7 @@ module CloudmersiveDocumentaiApiClient
112
142
  # Calculates hash code according to all attributes.
113
143
  # @return [Fixnum] Hash code
114
144
  def hash
115
- [input_file, fields_to_extract, maximum_pages_processed].hash
145
+ [input_file, fields_to_extract, maximum_pages_processed, preprocessing, result_cross_check, rotate_image_degrees].hash
116
146
  end
117
147
 
118
148
  # Builds the object from hash
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Document AI API
3
3
 
4
- #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
4
+ #Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
5
5
 
6
6
  OpenAPI spec version: v1
7
-
7
+ Contact: support@cloudmersive.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.14
10
10
 
@@ -21,11 +21,15 @@ module CloudmersiveDocumentaiApiClient
21
21
  # Category applied to the document; if a category could not be identified then \"other\" will be used. Spaces are replaced with underscores.
22
22
  attr_accessor :document_category_result
23
23
 
24
+ # Confidence score between 0.0 and 1.0, where values > 0.8 indicate high confidence
25
+ attr_accessor :confidence_score
26
+
24
27
  # Attribute mapping from ruby-style variable name to JSON key.
25
28
  def self.attribute_map
26
29
  {
27
30
  :'successful' => :'Successful',
28
- :'document_category_result' => :'DocumentCategoryResult'
31
+ :'document_category_result' => :'DocumentCategoryResult',
32
+ :'confidence_score' => :'ConfidenceScore'
29
33
  }
30
34
  end
31
35
 
@@ -33,7 +37,8 @@ module CloudmersiveDocumentaiApiClient
33
37
  def self.swagger_types
34
38
  {
35
39
  :'successful' => :'BOOLEAN',
36
- :'document_category_result' => :'String'
40
+ :'document_category_result' => :'String',
41
+ :'confidence_score' => :'Float'
37
42
  }
38
43
  end
39
44
 
@@ -52,6 +57,10 @@ module CloudmersiveDocumentaiApiClient
52
57
  if attributes.has_key?(:'DocumentCategoryResult')
53
58
  self.document_category_result = attributes[:'DocumentCategoryResult']
54
59
  end
60
+
61
+ if attributes.has_key?(:'ConfidenceScore')
62
+ self.confidence_score = attributes[:'ConfidenceScore']
63
+ end
55
64
  end
56
65
 
57
66
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -73,7 +82,8 @@ module CloudmersiveDocumentaiApiClient
73
82
  return true if self.equal?(o)
74
83
  self.class == o.class &&
75
84
  successful == o.successful &&
76
- document_category_result == o.document_category_result
85
+ document_category_result == o.document_category_result &&
86
+ confidence_score == o.confidence_score
77
87
  end
78
88
 
79
89
  # @see the `==` method
@@ -85,7 +95,7 @@ module CloudmersiveDocumentaiApiClient
85
95
  # Calculates hash code according to all attributes.
86
96
  # @return [Fixnum] Hash code
87
97
  def hash
88
- [successful, document_category_result].hash
98
+ [successful, document_category_result, confidence_score].hash
89
99
  end
90
100
 
91
101
  # Builds the object from hash
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Document AI API
3
3
 
4
- #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
4
+ #Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
5
5
 
6
6
  OpenAPI spec version: v1
7
-
7
+ Contact: support@cloudmersive.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.14
10
10
 
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Document AI API
3
3
 
4
- #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
4
+ #Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
5
5
 
6
6
  OpenAPI spec version: v1
7
-
7
+ Contact: support@cloudmersive.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.14
10
10
 
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Document AI API
3
3
 
4
- #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
4
+ #Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
5
5
 
6
6
  OpenAPI spec version: v1
7
-
7
+ Contact: support@cloudmersive.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.14
10
10
 
@@ -21,11 +21,15 @@ module CloudmersiveDocumentaiApiClient
21
21
  # Rules to apply to the document
22
22
  attr_accessor :rules
23
23
 
24
+ # Optional; Recognition mode - Normal (default) provides the highest accuracy but slower speed, while Normal provides faster response but lower accuracy for low quality images
25
+ attr_accessor :recognition_mode
26
+
24
27
  # Attribute mapping from ruby-style variable name to JSON key.
25
28
  def self.attribute_map
26
29
  {
27
30
  :'input_file' => :'InputFile',
28
- :'rules' => :'Rules'
31
+ :'rules' => :'Rules',
32
+ :'recognition_mode' => :'RecognitionMode'
29
33
  }
30
34
  end
31
35
 
@@ -33,7 +37,8 @@ module CloudmersiveDocumentaiApiClient
33
37
  def self.swagger_types
34
38
  {
35
39
  :'input_file' => :'String',
36
- :'rules' => :'Array<PolicyRule>'
40
+ :'rules' => :'Array<PolicyRule>',
41
+ :'recognition_mode' => :'String'
37
42
  }
38
43
  end
39
44
 
@@ -54,6 +59,10 @@ module CloudmersiveDocumentaiApiClient
54
59
  self.rules = value
55
60
  end
56
61
  end
62
+
63
+ if attributes.has_key?(:'RecognitionMode')
64
+ self.recognition_mode = attributes[:'RecognitionMode']
65
+ end
57
66
  end
58
67
 
59
68
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -90,7 +99,8 @@ module CloudmersiveDocumentaiApiClient
90
99
  return true if self.equal?(o)
91
100
  self.class == o.class &&
92
101
  input_file == o.input_file &&
93
- rules == o.rules
102
+ rules == o.rules &&
103
+ recognition_mode == o.recognition_mode
94
104
  end
95
105
 
96
106
  # @see the `==` method
@@ -102,7 +112,7 @@ module CloudmersiveDocumentaiApiClient
102
112
  # Calculates hash code according to all attributes.
103
113
  # @return [Fixnum] Hash code
104
114
  def hash
105
- [input_file, rules].hash
115
+ [input_file, rules, recognition_mode].hash
106
116
  end
107
117
 
108
118
  # Builds the object from hash
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Document AI API
3
3
 
4
- #Use next-generation AI to extract data, fields, insights and text from documents. Instantly.
4
+ #Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
5
5
 
6
6
  OpenAPI spec version: v1
7
-
7
+ Contact: support@cloudmersive.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.14
10
10
 
@@ -0,0 +1,216 @@
1
+ =begin
2
+ #Document AI API
3
+
4
+ #Extract structured data including named fields, tables, barcodes, classifications, and summaries from common document formats, scanned documents, and photos of documents using AI. Also supports handwriting and low quality photos and scans, as well as digital document input. Supports a wide range of languages, and is able to analyze and infer semantic structure from the visual layout for documents.
5
+
6
+ OpenAPI spec version: v1
7
+ Contact: support@cloudmersive.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveDocumentaiApiClient
16
+ # Answer to an input question
17
+ class DocumentQuestionAnswerItem
18
+ # ID of the input question
19
+ attr_accessor :question_id
20
+
21
+ # Answer response value, formatted as a string, for this question. Boolean questions will return YES or NO.
22
+ attr_accessor :answer_value
23
+
24
+ # Rationale explaining why this answer was given
25
+ attr_accessor :answer_rationale
26
+
27
+ # Confidence score between 0.0 and 1.0 where values above 0.8 indicate high confidence
28
+ attr_accessor :confidence_score
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'question_id' => :'QuestionId',
34
+ :'answer_value' => :'AnswerValue',
35
+ :'answer_rationale' => :'AnswerRationale',
36
+ :'confidence_score' => :'ConfidenceScore'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'question_id' => :'String',
44
+ :'answer_value' => :'String',
45
+ :'answer_rationale' => :'String',
46
+ :'confidence_score' => :'Float'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'QuestionId')
59
+ self.question_id = attributes[:'QuestionId']
60
+ end
61
+
62
+ if attributes.has_key?(:'AnswerValue')
63
+ self.answer_value = attributes[:'AnswerValue']
64
+ end
65
+
66
+ if attributes.has_key?(:'AnswerRationale')
67
+ self.answer_rationale = attributes[:'AnswerRationale']
68
+ end
69
+
70
+ if attributes.has_key?(:'ConfidenceScore')
71
+ self.confidence_score = attributes[:'ConfidenceScore']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ question_id == o.question_id &&
94
+ answer_value == o.answer_value &&
95
+ answer_rationale == o.answer_rationale &&
96
+ confidence_score == o.confidence_score
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Fixnum] Hash code
107
+ def hash
108
+ [question_id, answer_value, answer_rationale, confidence_score].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :DateTime
138
+ DateTime.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :BOOLEAN
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ temp_model = CloudmersiveDocumentaiApiClient.const_get(type).new
169
+ temp_model.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ next if value.nil?
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+
215
+ end
216
+ end