cloudmersive-cdr-api-client 2.0.0 → 2.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0868679e9337fb65030ede1afec445637ca469e0c01d9ee35f5371e0c25ed81
4
- data.tar.gz: 06cf9bf35b7ba79b3800a7181d15c88eb5d4750f360623c45288dc2e5e14bff3
3
+ metadata.gz: 61ebd6933fd0f29a8b8028054d2c816f6344db74122e58eb3b8c934836b2092c
4
+ data.tar.gz: b9d461bf20a5da1e55c7fc86a4e0fec1dc3660b99d449db771f597d4fff20d62
5
5
  SHA512:
6
- metadata.gz: 921362549e0dd9458cfb48c93e1aae213dd8ad46a3ec7151a6ca23c1d934f511f9aafebe42dec3996c85de2a0c8f3cabe3df2d230445078a6c0abc1f7afaedeb
7
- data.tar.gz: f7925a4fe4b3f394f3ca634fafae45c57aad37d1105eac58a2a594baff45584b3c2181bae80c1532c5deb0051a2fd46c26cddade751d8d246b3f9dce25ef0838
6
+ metadata.gz: 5278af6c6ed6912096910f6b5c18c43e896f0d4a971bcfa2abbe7ab4f74b97d2cbeec7f8cedd5e74c1e5d7e8926d3abb5bc4c1699ed1de1484a1ce7ed1353ee9
7
+ data.tar.gz: d3d7f4e505d5c0ceca187505d36ee5e82fd656e93b11ac06bd509ad5ed00934d977dd3e522c84308e3ed13f19990ac943f53fbb50a345e140ffbfe7ce47cc177
data/README.md CHANGED
@@ -7,7 +7,7 @@ Use the Content Disarm and Reconstruction API to remove security risks from docu
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: v1
10
- - Package version: 2.0.0
10
+ - Package version: 2.0.1
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build cloudmersive-cdr-api-client.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./cloudmersive-cdr-api-client-2.0.0.gem
26
+ gem install ./cloudmersive-cdr-api-client-2.0.1.gem
27
27
  ```
28
- (for development, run `gem install --dev ./cloudmersive-cdr-api-client-2.0.0.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./cloudmersive-cdr-api-client-2.0.1.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'cloudmersive-cdr-api-client', '~> 2.0.0'
34
+ gem 'cloudmersive-cdr-api-client', '~> 2.0.1'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -69,8 +69,9 @@ opts = {
69
69
  }
70
70
 
71
71
  begin
72
- #Complete Content Disarm and Reconstruction on an Input File, and output in same file format
73
- api_instance.file(opts)
72
+ #Content Disarm and Reconstruction on a File
73
+ result = api_instance.file(opts)
74
+ p result
74
75
  rescue CloudmersiveCdrApiClient::ApiError => e
75
76
  puts "Exception when calling FileSanitizationApi->file: #{e}"
76
77
  end
@@ -83,12 +84,15 @@ All URIs are relative to *https://api.cloudmersive.com*
83
84
 
84
85
  Class | Method | HTTP request | Description
85
86
  ------------ | ------------- | ------------- | -------------
86
- *CloudmersiveCdrApiClient::FileSanitizationApi* | [**file**](docs/FileSanitizationApi.md#file) | **POST** /cdr/sanitization/file | Complete Content Disarm and Reconstruction on an Input File, and output in same file format
87
- *CloudmersiveCdrApiClient::FileSanitizationApi* | [**file_to_pdf**](docs/FileSanitizationApi.md#file_to_pdf) | **POST** /cdr/sanitization/file/to/pdf | Complete Content Disarm and Reconstruction on an Input File with PDF/A Output
87
+ *CloudmersiveCdrApiClient::FileSanitizationApi* | [**file**](docs/FileSanitizationApi.md#file) | **POST** /cdr/sanitization/file | Content Disarm and Reconstruction on a File
88
+ *CloudmersiveCdrApiClient::FileSanitizationApi* | [**file_advanced**](docs/FileSanitizationApi.md#file_advanced) | **POST** /cdr/sanitization/file/advanced | Advanced Content Disarm and Reconstruction on a File
89
+ *CloudmersiveCdrApiClient::FileSanitizationApi* | [**file_to_pdf**](docs/FileSanitizationApi.md#file_to_pdf) | **POST** /cdr/sanitization/file/to/pdf | Content Disarm and Reconstruction on a File with PDFA Output
90
+ *CloudmersiveCdrApiClient::FileSanitizationApi* | [**file_to_pdf_advanced**](docs/FileSanitizationApi.md#file_to_pdf_advanced) | **POST** /cdr/sanitization/file/to/pdf/advanced | Advanced Content Disarm and Reconstruction on a File with PDFA Output
88
91
 
89
92
 
90
93
  ## Documentation for Models
91
94
 
95
+ - [CloudmersiveCdrApiClient::ProblemDetails](docs/ProblemDetails.md)
92
96
 
93
97
 
94
98
  ## Documentation for Authorization
@@ -4,14 +4,16 @@ All URIs are relative to *https://api.cloudmersive.com*
4
4
 
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
- [**file**](FileSanitizationApi.md#file) | **POST** /cdr/sanitization/file | Complete Content Disarm and Reconstruction on an Input File, and output in same file format
8
- [**file_to_pdf**](FileSanitizationApi.md#file_to_pdf) | **POST** /cdr/sanitization/file/to/pdf | Complete Content Disarm and Reconstruction on an Input File with PDF/A Output
7
+ [**file**](FileSanitizationApi.md#file) | **POST** /cdr/sanitization/file | Content Disarm and Reconstruction on a File
8
+ [**file_advanced**](FileSanitizationApi.md#file_advanced) | **POST** /cdr/sanitization/file/advanced | Advanced Content Disarm and Reconstruction on a File
9
+ [**file_to_pdf**](FileSanitizationApi.md#file_to_pdf) | **POST** /cdr/sanitization/file/to/pdf | Content Disarm and Reconstruction on a File with PDFA Output
10
+ [**file_to_pdf_advanced**](FileSanitizationApi.md#file_to_pdf_advanced) | **POST** /cdr/sanitization/file/to/pdf/advanced | Advanced Content Disarm and Reconstruction on a File with PDFA Output
9
11
 
10
12
 
11
13
  # **file**
12
- > file(opts)
14
+ > String file(opts)
13
15
 
14
- Complete Content Disarm and Reconstruction on an Input File, and output in same file format
16
+ Content Disarm and Reconstruction on a File
15
17
 
16
18
  Processes the input file via CDR to produce a secured output file. Input content is parsed, disarmed, and then reconstructed into a new output file with the same file format as the input.
17
19
 
@@ -34,8 +36,9 @@ opts = {
34
36
  }
35
37
 
36
38
  begin
37
- #Complete Content Disarm and Reconstruction on an Input File, and output in same file format
38
- api_instance.file(opts)
39
+ #Content Disarm and Reconstruction on a File
40
+ result = api_instance.file(opts)
41
+ p result
39
42
  rescue CloudmersiveCdrApiClient::ApiError => e
40
43
  puts "Exception when calling FileSanitizationApi->file: #{e}"
41
44
  end
@@ -49,7 +52,7 @@ Name | Type | Description | Notes
49
52
 
50
53
  ### Return type
51
54
 
52
- nil (empty response body)
55
+ **String**
53
56
 
54
57
  ### Authorization
55
58
 
@@ -58,14 +61,93 @@ nil (empty response body)
58
61
  ### HTTP request headers
59
62
 
60
63
  - **Content-Type**: multipart/form-data
61
- - **Accept**: Not defined
64
+ - **Accept**: application/octet-stream
65
+
66
+
67
+
68
+ # **file_advanced**
69
+ > String file_advanced(opts)
70
+
71
+ Advanced Content Disarm and Reconstruction on a File
72
+
73
+ Processes the input file via CDR to produce a secured output file with advanced scan options and response headers containing scan metadata.
74
+
75
+ ### Example
76
+ ```ruby
77
+ # load the gem
78
+ require 'cloudmersive-cdr-api-client'
79
+ # setup authorization
80
+ CloudmersiveCdrApiClient.configure do |config|
81
+ # Configure API key authorization: Apikey
82
+ config.api_key['Apikey'] = 'YOUR API KEY'
83
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
84
+ #config.api_key_prefix['Apikey'] = 'Bearer'
85
+ end
86
+
87
+ api_instance = CloudmersiveCdrApiClient::FileSanitizationApi.new
88
+
89
+ opts = {
90
+ allow_executables: true, # BOOLEAN | Set to false to block executable files (EXE, DLL, etc.)
91
+ allow_invalid_files: true, # BOOLEAN | Set to false to block files that are not valid for their detected type
92
+ allow_scripts: true, # BOOLEAN | Set to false to block script files. PDF and Office macro sanitization still runs regardless.
93
+ allow_password_protected_files: true, # BOOLEAN | Set to false to block password-protected files
94
+ allow_macros: true, # BOOLEAN | Set to false to block files containing macros. Office macro removal still runs regardless.
95
+ allow_xml_external_entities: true, # BOOLEAN | Set to false to block XML files with external entity references (XXE)
96
+ allow_insecure_deserialization: true, # BOOLEAN | Set to false to block files with insecure deserialization patterns
97
+ allow_html: true, # BOOLEAN | Set to false to block HTML files
98
+ allow_unsafe_archives: true, # BOOLEAN | Set to false to block archive files flagged as unsafe (e.g., zip bombs)
99
+ allow_ole_embedded_object: true, # BOOLEAN | Set to false to block files with embedded OLE objects
100
+ allow_unwanted_action: true, # BOOLEAN | Set to false to block files with unwanted actions
101
+ restrict_file_types: 'restrict_file_types_example', # String | Comma-separated list of allowed file extensions (e.g., \".pdf,.docx,.xlsx\"). Files not matching will be blocked.
102
+ input_file: File.new('/path/to/file.txt') # File | Input document to CDR process
103
+ }
104
+
105
+ begin
106
+ #Advanced Content Disarm and Reconstruction on a File
107
+ result = api_instance.file_advanced(opts)
108
+ p result
109
+ rescue CloudmersiveCdrApiClient::ApiError => e
110
+ puts "Exception when calling FileSanitizationApi->file_advanced: #{e}"
111
+ end
112
+ ```
113
+
114
+ ### Parameters
115
+
116
+ Name | Type | Description | Notes
117
+ ------------- | ------------- | ------------- | -------------
118
+ **allow_executables** | **BOOLEAN**| Set to false to block executable files (EXE, DLL, etc.) | [optional]
119
+ **allow_invalid_files** | **BOOLEAN**| Set to false to block files that are not valid for their detected type | [optional]
120
+ **allow_scripts** | **BOOLEAN**| Set to false to block script files. PDF and Office macro sanitization still runs regardless. | [optional]
121
+ **allow_password_protected_files** | **BOOLEAN**| Set to false to block password-protected files | [optional]
122
+ **allow_macros** | **BOOLEAN**| Set to false to block files containing macros. Office macro removal still runs regardless. | [optional]
123
+ **allow_xml_external_entities** | **BOOLEAN**| Set to false to block XML files with external entity references (XXE) | [optional]
124
+ **allow_insecure_deserialization** | **BOOLEAN**| Set to false to block files with insecure deserialization patterns | [optional]
125
+ **allow_html** | **BOOLEAN**| Set to false to block HTML files | [optional]
126
+ **allow_unsafe_archives** | **BOOLEAN**| Set to false to block archive files flagged as unsafe (e.g., zip bombs) | [optional]
127
+ **allow_ole_embedded_object** | **BOOLEAN**| Set to false to block files with embedded OLE objects | [optional]
128
+ **allow_unwanted_action** | **BOOLEAN**| Set to false to block files with unwanted actions | [optional]
129
+ **restrict_file_types** | **String**| Comma-separated list of allowed file extensions (e.g., \".pdf,.docx,.xlsx\"). Files not matching will be blocked. | [optional]
130
+ **input_file** | **File**| Input document to CDR process | [optional]
131
+
132
+ ### Return type
133
+
134
+ **String**
135
+
136
+ ### Authorization
137
+
138
+ [Apikey](../README.md#Apikey)
139
+
140
+ ### HTTP request headers
141
+
142
+ - **Content-Type**: multipart/form-data
143
+ - **Accept**: application/octet-stream
62
144
 
63
145
 
64
146
 
65
147
  # **file_to_pdf**
66
- > file_to_pdf(opts)
148
+ > String file_to_pdf(opts)
67
149
 
68
- Complete Content Disarm and Reconstruction on an Input File with PDF/A Output
150
+ Content Disarm and Reconstruction on a File with PDFA Output
69
151
 
70
152
  Processes the input file via CDR to produce a secured PDF/A output file. Input content is parsed, disarmed, and then reconstructed into a new PDF/A output file.
71
153
 
@@ -88,8 +170,9 @@ opts = {
88
170
  }
89
171
 
90
172
  begin
91
- #Complete Content Disarm and Reconstruction on an Input File with PDF/A Output
92
- api_instance.file_to_pdf(opts)
173
+ #Content Disarm and Reconstruction on a File with PDFA Output
174
+ result = api_instance.file_to_pdf(opts)
175
+ p result
93
176
  rescue CloudmersiveCdrApiClient::ApiError => e
94
177
  puts "Exception when calling FileSanitizationApi->file_to_pdf: #{e}"
95
178
  end
@@ -103,7 +186,86 @@ Name | Type | Description | Notes
103
186
 
104
187
  ### Return type
105
188
 
106
- nil (empty response body)
189
+ **String**
190
+
191
+ ### Authorization
192
+
193
+ [Apikey](../README.md#Apikey)
194
+
195
+ ### HTTP request headers
196
+
197
+ - **Content-Type**: multipart/form-data
198
+ - **Accept**: application/octet-stream
199
+
200
+
201
+
202
+ # **file_to_pdf_advanced**
203
+ > String file_to_pdf_advanced(opts)
204
+
205
+ Advanced Content Disarm and Reconstruction on a File with PDFA Output
206
+
207
+ Processes the input file via CDR to produce a secured PDF/A output file with advanced scan options and response headers containing scan metadata.
208
+
209
+ ### Example
210
+ ```ruby
211
+ # load the gem
212
+ require 'cloudmersive-cdr-api-client'
213
+ # setup authorization
214
+ CloudmersiveCdrApiClient.configure do |config|
215
+ # Configure API key authorization: Apikey
216
+ config.api_key['Apikey'] = 'YOUR API KEY'
217
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
218
+ #config.api_key_prefix['Apikey'] = 'Bearer'
219
+ end
220
+
221
+ api_instance = CloudmersiveCdrApiClient::FileSanitizationApi.new
222
+
223
+ opts = {
224
+ allow_executables: true, # BOOLEAN | Set to false to block executable files (EXE, DLL, etc.)
225
+ allow_invalid_files: true, # BOOLEAN | Set to false to block files that are not valid for their detected type
226
+ allow_scripts: true, # BOOLEAN | Set to false to block script files. PDF and Office macro sanitization still runs regardless.
227
+ allow_password_protected_files: true, # BOOLEAN | Set to false to block password-protected files
228
+ allow_macros: true, # BOOLEAN | Set to false to block files containing macros. Office macro removal still runs regardless.
229
+ allow_xml_external_entities: true, # BOOLEAN | Set to false to block XML files with external entity references (XXE)
230
+ allow_insecure_deserialization: true, # BOOLEAN | Set to false to block files with insecure deserialization patterns
231
+ allow_html: true, # BOOLEAN | Set to false to block HTML files
232
+ allow_unsafe_archives: true, # BOOLEAN | Set to false to block archive files flagged as unsafe (e.g., zip bombs)
233
+ allow_ole_embedded_object: true, # BOOLEAN | Set to false to block files with embedded OLE objects
234
+ allow_unwanted_action: true, # BOOLEAN | Set to false to block files with unwanted actions
235
+ restrict_file_types: 'restrict_file_types_example', # String | Comma-separated list of allowed file extensions (e.g., \".pdf,.docx,.xlsx\"). Files not matching will be blocked.
236
+ input_file: File.new('/path/to/file.txt') # File | Input document to CDR process
237
+ }
238
+
239
+ begin
240
+ #Advanced Content Disarm and Reconstruction on a File with PDFA Output
241
+ result = api_instance.file_to_pdf_advanced(opts)
242
+ p result
243
+ rescue CloudmersiveCdrApiClient::ApiError => e
244
+ puts "Exception when calling FileSanitizationApi->file_to_pdf_advanced: #{e}"
245
+ end
246
+ ```
247
+
248
+ ### Parameters
249
+
250
+ Name | Type | Description | Notes
251
+ ------------- | ------------- | ------------- | -------------
252
+ **allow_executables** | **BOOLEAN**| Set to false to block executable files (EXE, DLL, etc.) | [optional]
253
+ **allow_invalid_files** | **BOOLEAN**| Set to false to block files that are not valid for their detected type | [optional]
254
+ **allow_scripts** | **BOOLEAN**| Set to false to block script files. PDF and Office macro sanitization still runs regardless. | [optional]
255
+ **allow_password_protected_files** | **BOOLEAN**| Set to false to block password-protected files | [optional]
256
+ **allow_macros** | **BOOLEAN**| Set to false to block files containing macros. Office macro removal still runs regardless. | [optional]
257
+ **allow_xml_external_entities** | **BOOLEAN**| Set to false to block XML files with external entity references (XXE) | [optional]
258
+ **allow_insecure_deserialization** | **BOOLEAN**| Set to false to block files with insecure deserialization patterns | [optional]
259
+ **allow_html** | **BOOLEAN**| Set to false to block HTML files | [optional]
260
+ **allow_unsafe_archives** | **BOOLEAN**| Set to false to block archive files flagged as unsafe (e.g., zip bombs) | [optional]
261
+ **allow_ole_embedded_object** | **BOOLEAN**| Set to false to block files with embedded OLE objects | [optional]
262
+ **allow_unwanted_action** | **BOOLEAN**| Set to false to block files with unwanted actions | [optional]
263
+ **restrict_file_types** | **String**| Comma-separated list of allowed file extensions (e.g., \".pdf,.docx,.xlsx\"). Files not matching will be blocked. | [optional]
264
+ **input_file** | **File**| Input document to CDR process | [optional]
265
+
266
+ ### Return type
267
+
268
+ **String**
107
269
 
108
270
  ### Authorization
109
271
 
@@ -112,7 +274,7 @@ nil (empty response body)
112
274
  ### HTTP request headers
113
275
 
114
276
  - **Content-Type**: multipart/form-data
115
- - **Accept**: Not defined
277
+ - **Accept**: application/octet-stream
116
278
 
117
279
 
118
280
 
@@ -0,0 +1,12 @@
1
+ # CloudmersiveCdrApiClient::ProblemDetails
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **type** | **String** | | [optional]
7
+ **title** | **String** | | [optional]
8
+ **status** | **Integer** | | [optional]
9
+ **detail** | **String** | | [optional]
10
+ **instance** | **String** | | [optional]
11
+
12
+
@@ -19,21 +19,21 @@ module CloudmersiveCdrApiClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Complete Content Disarm and Reconstruction on an Input File, and output in same file format
22
+ # Content Disarm and Reconstruction on a File
23
23
  # Processes the input file via CDR to produce a secured output file. Input content is parsed, disarmed, and then reconstructed into a new output file with the same file format as the input.
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @option opts [File] :input_file Input document, or photos of a document, to extract data from
26
- # @return [nil]
26
+ # @return [String]
27
27
  def file(opts = {})
28
- file_with_http_info(opts)
29
- nil
28
+ data, _status_code, _headers = file_with_http_info(opts)
29
+ data
30
30
  end
31
31
 
32
- # Complete Content Disarm and Reconstruction on an Input File, and output in same file format
32
+ # Content Disarm and Reconstruction on a File
33
33
  # Processes the input file via CDR to produce a secured output file. Input content is parsed, disarmed, and then reconstructed into a new output file with the same file format as the input.
34
34
  # @param [Hash] opts the optional parameters
35
35
  # @option opts [File] :input_file Input document, or photos of a document, to extract data from
36
- # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
36
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
37
37
  def file_with_http_info(opts = {})
38
38
  if @api_client.config.debugging
39
39
  @api_client.config.logger.debug 'Calling API: FileSanitizationApi.file ...'
@@ -46,6 +46,8 @@ module CloudmersiveCdrApiClient
46
46
 
47
47
  # header parameters
48
48
  header_params = {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
49
51
  # HTTP header 'Content-Type'
50
52
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
51
53
 
@@ -61,27 +63,115 @@ module CloudmersiveCdrApiClient
61
63
  :query_params => query_params,
62
64
  :form_params => form_params,
63
65
  :body => post_body,
64
- :auth_names => auth_names)
66
+ :auth_names => auth_names,
67
+ :return_type => 'String')
65
68
  if @api_client.config.debugging
66
69
  @api_client.config.logger.debug "API called: FileSanitizationApi#file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
67
70
  end
68
71
  return data, status_code, headers
69
72
  end
70
- # Complete Content Disarm and Reconstruction on an Input File with PDF/A Output
73
+ # Advanced Content Disarm and Reconstruction on a File
74
+ # Processes the input file via CDR to produce a secured output file with advanced scan options and response headers containing scan metadata.
75
+ # @param [Hash] opts the optional parameters
76
+ # @option opts [BOOLEAN] :allow_executables Set to false to block executable files (EXE, DLL, etc.)
77
+ # @option opts [BOOLEAN] :allow_invalid_files Set to false to block files that are not valid for their detected type
78
+ # @option opts [BOOLEAN] :allow_scripts Set to false to block script files. PDF and Office macro sanitization still runs regardless.
79
+ # @option opts [BOOLEAN] :allow_password_protected_files Set to false to block password-protected files
80
+ # @option opts [BOOLEAN] :allow_macros Set to false to block files containing macros. Office macro removal still runs regardless.
81
+ # @option opts [BOOLEAN] :allow_xml_external_entities Set to false to block XML files with external entity references (XXE)
82
+ # @option opts [BOOLEAN] :allow_insecure_deserialization Set to false to block files with insecure deserialization patterns
83
+ # @option opts [BOOLEAN] :allow_html Set to false to block HTML files
84
+ # @option opts [BOOLEAN] :allow_unsafe_archives Set to false to block archive files flagged as unsafe (e.g., zip bombs)
85
+ # @option opts [BOOLEAN] :allow_ole_embedded_object Set to false to block files with embedded OLE objects
86
+ # @option opts [BOOLEAN] :allow_unwanted_action Set to false to block files with unwanted actions
87
+ # @option opts [String] :restrict_file_types Comma-separated list of allowed file extensions (e.g., \&quot;.pdf,.docx,.xlsx\&quot;). Files not matching will be blocked.
88
+ # @option opts [File] :input_file Input document to CDR process
89
+ # @return [String]
90
+ def file_advanced(opts = {})
91
+ data, _status_code, _headers = file_advanced_with_http_info(opts)
92
+ data
93
+ end
94
+
95
+ # Advanced Content Disarm and Reconstruction on a File
96
+ # Processes the input file via CDR to produce a secured output file with advanced scan options and response headers containing scan metadata.
97
+ # @param [Hash] opts the optional parameters
98
+ # @option opts [BOOLEAN] :allow_executables Set to false to block executable files (EXE, DLL, etc.)
99
+ # @option opts [BOOLEAN] :allow_invalid_files Set to false to block files that are not valid for their detected type
100
+ # @option opts [BOOLEAN] :allow_scripts Set to false to block script files. PDF and Office macro sanitization still runs regardless.
101
+ # @option opts [BOOLEAN] :allow_password_protected_files Set to false to block password-protected files
102
+ # @option opts [BOOLEAN] :allow_macros Set to false to block files containing macros. Office macro removal still runs regardless.
103
+ # @option opts [BOOLEAN] :allow_xml_external_entities Set to false to block XML files with external entity references (XXE)
104
+ # @option opts [BOOLEAN] :allow_insecure_deserialization Set to false to block files with insecure deserialization patterns
105
+ # @option opts [BOOLEAN] :allow_html Set to false to block HTML files
106
+ # @option opts [BOOLEAN] :allow_unsafe_archives Set to false to block archive files flagged as unsafe (e.g., zip bombs)
107
+ # @option opts [BOOLEAN] :allow_ole_embedded_object Set to false to block files with embedded OLE objects
108
+ # @option opts [BOOLEAN] :allow_unwanted_action Set to false to block files with unwanted actions
109
+ # @option opts [String] :restrict_file_types Comma-separated list of allowed file extensions (e.g., \&quot;.pdf,.docx,.xlsx\&quot;). Files not matching will be blocked.
110
+ # @option opts [File] :input_file Input document to CDR process
111
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
112
+ def file_advanced_with_http_info(opts = {})
113
+ if @api_client.config.debugging
114
+ @api_client.config.logger.debug 'Calling API: FileSanitizationApi.file_advanced ...'
115
+ end
116
+ # resource path
117
+ local_var_path = '/cdr/sanitization/file/advanced'
118
+
119
+ # query parameters
120
+ query_params = {}
121
+
122
+ # header parameters
123
+ header_params = {}
124
+ # HTTP header 'Accept' (if needed)
125
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
126
+ # HTTP header 'Content-Type'
127
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
128
+ header_params[:'allowExecutables'] = opts[:'allow_executables'] if !opts[:'allow_executables'].nil?
129
+ header_params[:'allowInvalidFiles'] = opts[:'allow_invalid_files'] if !opts[:'allow_invalid_files'].nil?
130
+ header_params[:'allowScripts'] = opts[:'allow_scripts'] if !opts[:'allow_scripts'].nil?
131
+ header_params[:'allowPasswordProtectedFiles'] = opts[:'allow_password_protected_files'] if !opts[:'allow_password_protected_files'].nil?
132
+ header_params[:'allowMacros'] = opts[:'allow_macros'] if !opts[:'allow_macros'].nil?
133
+ header_params[:'allowXmlExternalEntities'] = opts[:'allow_xml_external_entities'] if !opts[:'allow_xml_external_entities'].nil?
134
+ header_params[:'allowInsecureDeserialization'] = opts[:'allow_insecure_deserialization'] if !opts[:'allow_insecure_deserialization'].nil?
135
+ header_params[:'allowHtml'] = opts[:'allow_html'] if !opts[:'allow_html'].nil?
136
+ header_params[:'allowUnsafeArchives'] = opts[:'allow_unsafe_archives'] if !opts[:'allow_unsafe_archives'].nil?
137
+ header_params[:'allowOleEmbeddedObject'] = opts[:'allow_ole_embedded_object'] if !opts[:'allow_ole_embedded_object'].nil?
138
+ header_params[:'allowUnwantedAction'] = opts[:'allow_unwanted_action'] if !opts[:'allow_unwanted_action'].nil?
139
+ header_params[:'restrictFileTypes'] = opts[:'restrict_file_types'] if !opts[:'restrict_file_types'].nil?
140
+
141
+ # form parameters
142
+ form_params = {}
143
+ form_params['InputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?
144
+
145
+ # http body (model)
146
+ post_body = nil
147
+ auth_names = ['Apikey']
148
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
149
+ :header_params => header_params,
150
+ :query_params => query_params,
151
+ :form_params => form_params,
152
+ :body => post_body,
153
+ :auth_names => auth_names,
154
+ :return_type => 'String')
155
+ if @api_client.config.debugging
156
+ @api_client.config.logger.debug "API called: FileSanitizationApi#file_advanced\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
157
+ end
158
+ return data, status_code, headers
159
+ end
160
+ # Content Disarm and Reconstruction on a File with PDFA Output
71
161
  # Processes the input file via CDR to produce a secured PDF/A output file. Input content is parsed, disarmed, and then reconstructed into a new PDF/A output file.
72
162
  # @param [Hash] opts the optional parameters
73
163
  # @option opts [File] :input_file Input document, or photos of a document, to extract data from
74
- # @return [nil]
164
+ # @return [String]
75
165
  def file_to_pdf(opts = {})
76
- file_to_pdf_with_http_info(opts)
77
- nil
166
+ data, _status_code, _headers = file_to_pdf_with_http_info(opts)
167
+ data
78
168
  end
79
169
 
80
- # Complete Content Disarm and Reconstruction on an Input File with PDF/A Output
170
+ # Content Disarm and Reconstruction on a File with PDFA Output
81
171
  # Processes the input file via CDR to produce a secured PDF/A output file. Input content is parsed, disarmed, and then reconstructed into a new PDF/A output file.
82
172
  # @param [Hash] opts the optional parameters
83
173
  # @option opts [File] :input_file Input document, or photos of a document, to extract data from
84
- # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
174
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
85
175
  def file_to_pdf_with_http_info(opts = {})
86
176
  if @api_client.config.debugging
87
177
  @api_client.config.logger.debug 'Calling API: FileSanitizationApi.file_to_pdf ...'
@@ -94,6 +184,8 @@ module CloudmersiveCdrApiClient
94
184
 
95
185
  # header parameters
96
186
  header_params = {}
187
+ # HTTP header 'Accept' (if needed)
188
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
97
189
  # HTTP header 'Content-Type'
98
190
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
99
191
 
@@ -109,11 +201,99 @@ module CloudmersiveCdrApiClient
109
201
  :query_params => query_params,
110
202
  :form_params => form_params,
111
203
  :body => post_body,
112
- :auth_names => auth_names)
204
+ :auth_names => auth_names,
205
+ :return_type => 'String')
113
206
  if @api_client.config.debugging
114
207
  @api_client.config.logger.debug "API called: FileSanitizationApi#file_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
115
208
  end
116
209
  return data, status_code, headers
117
210
  end
211
+ # Advanced Content Disarm and Reconstruction on a File with PDFA Output
212
+ # Processes the input file via CDR to produce a secured PDF/A output file with advanced scan options and response headers containing scan metadata.
213
+ # @param [Hash] opts the optional parameters
214
+ # @option opts [BOOLEAN] :allow_executables Set to false to block executable files (EXE, DLL, etc.)
215
+ # @option opts [BOOLEAN] :allow_invalid_files Set to false to block files that are not valid for their detected type
216
+ # @option opts [BOOLEAN] :allow_scripts Set to false to block script files. PDF and Office macro sanitization still runs regardless.
217
+ # @option opts [BOOLEAN] :allow_password_protected_files Set to false to block password-protected files
218
+ # @option opts [BOOLEAN] :allow_macros Set to false to block files containing macros. Office macro removal still runs regardless.
219
+ # @option opts [BOOLEAN] :allow_xml_external_entities Set to false to block XML files with external entity references (XXE)
220
+ # @option opts [BOOLEAN] :allow_insecure_deserialization Set to false to block files with insecure deserialization patterns
221
+ # @option opts [BOOLEAN] :allow_html Set to false to block HTML files
222
+ # @option opts [BOOLEAN] :allow_unsafe_archives Set to false to block archive files flagged as unsafe (e.g., zip bombs)
223
+ # @option opts [BOOLEAN] :allow_ole_embedded_object Set to false to block files with embedded OLE objects
224
+ # @option opts [BOOLEAN] :allow_unwanted_action Set to false to block files with unwanted actions
225
+ # @option opts [String] :restrict_file_types Comma-separated list of allowed file extensions (e.g., \&quot;.pdf,.docx,.xlsx\&quot;). Files not matching will be blocked.
226
+ # @option opts [File] :input_file Input document to CDR process
227
+ # @return [String]
228
+ def file_to_pdf_advanced(opts = {})
229
+ data, _status_code, _headers = file_to_pdf_advanced_with_http_info(opts)
230
+ data
231
+ end
232
+
233
+ # Advanced Content Disarm and Reconstruction on a File with PDFA Output
234
+ # Processes the input file via CDR to produce a secured PDF/A output file with advanced scan options and response headers containing scan metadata.
235
+ # @param [Hash] opts the optional parameters
236
+ # @option opts [BOOLEAN] :allow_executables Set to false to block executable files (EXE, DLL, etc.)
237
+ # @option opts [BOOLEAN] :allow_invalid_files Set to false to block files that are not valid for their detected type
238
+ # @option opts [BOOLEAN] :allow_scripts Set to false to block script files. PDF and Office macro sanitization still runs regardless.
239
+ # @option opts [BOOLEAN] :allow_password_protected_files Set to false to block password-protected files
240
+ # @option opts [BOOLEAN] :allow_macros Set to false to block files containing macros. Office macro removal still runs regardless.
241
+ # @option opts [BOOLEAN] :allow_xml_external_entities Set to false to block XML files with external entity references (XXE)
242
+ # @option opts [BOOLEAN] :allow_insecure_deserialization Set to false to block files with insecure deserialization patterns
243
+ # @option opts [BOOLEAN] :allow_html Set to false to block HTML files
244
+ # @option opts [BOOLEAN] :allow_unsafe_archives Set to false to block archive files flagged as unsafe (e.g., zip bombs)
245
+ # @option opts [BOOLEAN] :allow_ole_embedded_object Set to false to block files with embedded OLE objects
246
+ # @option opts [BOOLEAN] :allow_unwanted_action Set to false to block files with unwanted actions
247
+ # @option opts [String] :restrict_file_types Comma-separated list of allowed file extensions (e.g., \&quot;.pdf,.docx,.xlsx\&quot;). Files not matching will be blocked.
248
+ # @option opts [File] :input_file Input document to CDR process
249
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
250
+ def file_to_pdf_advanced_with_http_info(opts = {})
251
+ if @api_client.config.debugging
252
+ @api_client.config.logger.debug 'Calling API: FileSanitizationApi.file_to_pdf_advanced ...'
253
+ end
254
+ # resource path
255
+ local_var_path = '/cdr/sanitization/file/to/pdf/advanced'
256
+
257
+ # query parameters
258
+ query_params = {}
259
+
260
+ # header parameters
261
+ header_params = {}
262
+ # HTTP header 'Accept' (if needed)
263
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
264
+ # HTTP header 'Content-Type'
265
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
266
+ header_params[:'allowExecutables'] = opts[:'allow_executables'] if !opts[:'allow_executables'].nil?
267
+ header_params[:'allowInvalidFiles'] = opts[:'allow_invalid_files'] if !opts[:'allow_invalid_files'].nil?
268
+ header_params[:'allowScripts'] = opts[:'allow_scripts'] if !opts[:'allow_scripts'].nil?
269
+ header_params[:'allowPasswordProtectedFiles'] = opts[:'allow_password_protected_files'] if !opts[:'allow_password_protected_files'].nil?
270
+ header_params[:'allowMacros'] = opts[:'allow_macros'] if !opts[:'allow_macros'].nil?
271
+ header_params[:'allowXmlExternalEntities'] = opts[:'allow_xml_external_entities'] if !opts[:'allow_xml_external_entities'].nil?
272
+ header_params[:'allowInsecureDeserialization'] = opts[:'allow_insecure_deserialization'] if !opts[:'allow_insecure_deserialization'].nil?
273
+ header_params[:'allowHtml'] = opts[:'allow_html'] if !opts[:'allow_html'].nil?
274
+ header_params[:'allowUnsafeArchives'] = opts[:'allow_unsafe_archives'] if !opts[:'allow_unsafe_archives'].nil?
275
+ header_params[:'allowOleEmbeddedObject'] = opts[:'allow_ole_embedded_object'] if !opts[:'allow_ole_embedded_object'].nil?
276
+ header_params[:'allowUnwantedAction'] = opts[:'allow_unwanted_action'] if !opts[:'allow_unwanted_action'].nil?
277
+ header_params[:'restrictFileTypes'] = opts[:'restrict_file_types'] if !opts[:'restrict_file_types'].nil?
278
+
279
+ # form parameters
280
+ form_params = {}
281
+ form_params['InputFile'] = opts[:'input_file'] if !opts[:'input_file'].nil?
282
+
283
+ # http body (model)
284
+ post_body = nil
285
+ auth_names = ['Apikey']
286
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
287
+ :header_params => header_params,
288
+ :query_params => query_params,
289
+ :form_params => form_params,
290
+ :body => post_body,
291
+ :auth_names => auth_names,
292
+ :return_type => 'String')
293
+ if @api_client.config.debugging
294
+ @api_client.config.logger.debug "API called: FileSanitizationApi#file_to_pdf_advanced\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
295
+ end
296
+ return data, status_code, headers
297
+ end
118
298
  end
119
299
  end
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #CDR API
3
+
4
+ #Use the Content Disarm and Reconstruction API to remove security risks from documents by tearing them down, removing unsafe content and rebuilding them.
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 'date'
14
+
15
+ module CloudmersiveCdrApiClient
16
+ class ProblemDetails
17
+ attr_accessor :type
18
+
19
+ attr_accessor :title
20
+
21
+ attr_accessor :status
22
+
23
+ attr_accessor :detail
24
+
25
+ attr_accessor :instance
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'type' => :'type',
31
+ :'title' => :'title',
32
+ :'status' => :'status',
33
+ :'detail' => :'detail',
34
+ :'instance' => :'instance'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'type' => :'String',
42
+ :'title' => :'String',
43
+ :'status' => :'Integer',
44
+ :'detail' => :'String',
45
+ :'instance' => :'String'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'type')
58
+ self.type = attributes[:'type']
59
+ end
60
+
61
+ if attributes.has_key?(:'title')
62
+ self.title = attributes[:'title']
63
+ end
64
+
65
+ if attributes.has_key?(:'status')
66
+ self.status = attributes[:'status']
67
+ end
68
+
69
+ if attributes.has_key?(:'detail')
70
+ self.detail = attributes[:'detail']
71
+ end
72
+
73
+ if attributes.has_key?(:'instance')
74
+ self.instance = attributes[:'instance']
75
+ end
76
+ end
77
+
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properties with the reasons
80
+ def list_invalid_properties
81
+ invalid_properties = Array.new
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ type == o.type &&
97
+ title == o.title &&
98
+ status == o.status &&
99
+ detail == o.detail &&
100
+ instance == o.instance
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Fixnum] Hash code
111
+ def hash
112
+ [type, title, status, detail, instance].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.swagger_types.each_pair do |key, type|
121
+ if type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :DateTime
142
+ DateTime.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :BOOLEAN
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ temp_model = CloudmersiveCdrApiClient.const_get(type).new
173
+ temp_model.build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ next if value.nil?
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.14
11
11
  =end
12
12
 
13
13
  module CloudmersiveCdrApiClient
14
- VERSION = '2.0.0'
14
+ VERSION = '2.0.1'
15
15
  end
@@ -17,6 +17,7 @@ require 'cloudmersive-cdr-api-client/version'
17
17
  require 'cloudmersive-cdr-api-client/configuration'
18
18
 
19
19
  # Models
20
+ require 'cloudmersive-cdr-api-client/models/problem_details'
20
21
 
21
22
  # APIs
22
23
  require 'cloudmersive-cdr-api-client/api/file_sanitization_api'
@@ -33,27 +33,75 @@ describe 'FileSanitizationApi' do
33
33
  end
34
34
 
35
35
  # unit tests for file
36
- # Complete Content Disarm and Reconstruction on an Input File, and output in same file format
36
+ # Content Disarm and Reconstruction on a File
37
37
  # Processes the input file via CDR to produce a secured output file. Input content is parsed, disarmed, and then reconstructed into a new output file with the same file format as the input.
38
38
  # @param [Hash] opts the optional parameters
39
39
  # @option opts [File] :input_file Input document, or photos of a document, to extract data from
40
- # @return [nil]
40
+ # @return [String]
41
41
  describe 'file test' do
42
42
  it 'should work' do
43
43
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
44
  end
45
45
  end
46
46
 
47
+ # unit tests for file_advanced
48
+ # Advanced Content Disarm and Reconstruction on a File
49
+ # Processes the input file via CDR to produce a secured output file with advanced scan options and response headers containing scan metadata.
50
+ # @param [Hash] opts the optional parameters
51
+ # @option opts [BOOLEAN] :allow_executables Set to false to block executable files (EXE, DLL, etc.)
52
+ # @option opts [BOOLEAN] :allow_invalid_files Set to false to block files that are not valid for their detected type
53
+ # @option opts [BOOLEAN] :allow_scripts Set to false to block script files. PDF and Office macro sanitization still runs regardless.
54
+ # @option opts [BOOLEAN] :allow_password_protected_files Set to false to block password-protected files
55
+ # @option opts [BOOLEAN] :allow_macros Set to false to block files containing macros. Office macro removal still runs regardless.
56
+ # @option opts [BOOLEAN] :allow_xml_external_entities Set to false to block XML files with external entity references (XXE)
57
+ # @option opts [BOOLEAN] :allow_insecure_deserialization Set to false to block files with insecure deserialization patterns
58
+ # @option opts [BOOLEAN] :allow_html Set to false to block HTML files
59
+ # @option opts [BOOLEAN] :allow_unsafe_archives Set to false to block archive files flagged as unsafe (e.g., zip bombs)
60
+ # @option opts [BOOLEAN] :allow_ole_embedded_object Set to false to block files with embedded OLE objects
61
+ # @option opts [BOOLEAN] :allow_unwanted_action Set to false to block files with unwanted actions
62
+ # @option opts [String] :restrict_file_types Comma-separated list of allowed file extensions (e.g., \&quot;.pdf,.docx,.xlsx\&quot;). Files not matching will be blocked.
63
+ # @option opts [File] :input_file Input document to CDR process
64
+ # @return [String]
65
+ describe 'file_advanced test' do
66
+ it 'should work' do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
47
71
  # unit tests for file_to_pdf
48
- # Complete Content Disarm and Reconstruction on an Input File with PDF/A Output
72
+ # Content Disarm and Reconstruction on a File with PDFA Output
49
73
  # Processes the input file via CDR to produce a secured PDF/A output file. Input content is parsed, disarmed, and then reconstructed into a new PDF/A output file.
50
74
  # @param [Hash] opts the optional parameters
51
75
  # @option opts [File] :input_file Input document, or photos of a document, to extract data from
52
- # @return [nil]
76
+ # @return [String]
53
77
  describe 'file_to_pdf test' do
54
78
  it 'should work' do
55
79
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
80
  end
57
81
  end
58
82
 
83
+ # unit tests for file_to_pdf_advanced
84
+ # Advanced Content Disarm and Reconstruction on a File with PDFA Output
85
+ # Processes the input file via CDR to produce a secured PDF/A output file with advanced scan options and response headers containing scan metadata.
86
+ # @param [Hash] opts the optional parameters
87
+ # @option opts [BOOLEAN] :allow_executables Set to false to block executable files (EXE, DLL, etc.)
88
+ # @option opts [BOOLEAN] :allow_invalid_files Set to false to block files that are not valid for their detected type
89
+ # @option opts [BOOLEAN] :allow_scripts Set to false to block script files. PDF and Office macro sanitization still runs regardless.
90
+ # @option opts [BOOLEAN] :allow_password_protected_files Set to false to block password-protected files
91
+ # @option opts [BOOLEAN] :allow_macros Set to false to block files containing macros. Office macro removal still runs regardless.
92
+ # @option opts [BOOLEAN] :allow_xml_external_entities Set to false to block XML files with external entity references (XXE)
93
+ # @option opts [BOOLEAN] :allow_insecure_deserialization Set to false to block files with insecure deserialization patterns
94
+ # @option opts [BOOLEAN] :allow_html Set to false to block HTML files
95
+ # @option opts [BOOLEAN] :allow_unsafe_archives Set to false to block archive files flagged as unsafe (e.g., zip bombs)
96
+ # @option opts [BOOLEAN] :allow_ole_embedded_object Set to false to block files with embedded OLE objects
97
+ # @option opts [BOOLEAN] :allow_unwanted_action Set to false to block files with unwanted actions
98
+ # @option opts [String] :restrict_file_types Comma-separated list of allowed file extensions (e.g., \&quot;.pdf,.docx,.xlsx\&quot;). Files not matching will be blocked.
99
+ # @option opts [File] :input_file Input document to CDR process
100
+ # @return [String]
101
+ describe 'file_to_pdf_advanced test' do
102
+ it 'should work' do
103
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
104
+ end
105
+ end
106
+
59
107
  end
@@ -0,0 +1,65 @@
1
+ =begin
2
+ #CDR API
3
+
4
+ #Use the Content Disarm and Reconstruction API to remove security risks from documents by tearing them down, removing unsafe content and rebuilding them.
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveCdrApiClient::ProblemDetails
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'ProblemDetails' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveCdrApiClient::ProblemDetails.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of ProblemDetails' do
31
+ it 'should create an instance of ProblemDetails' do
32
+ expect(@instance).to be_instance_of(CloudmersiveCdrApiClient::ProblemDetails)
33
+ end
34
+ end
35
+ describe 'test attribute "type"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "title"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "status"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "detail"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ describe 'test attribute "instance"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
65
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudmersive-cdr-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudmersive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-29 00:00:00.000000000 Z
11
+ date: 2026-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -202,16 +202,19 @@ files:
202
202
  - "./Rakefile"
203
203
  - "./cloudmersive-cdr-api-client.gemspec"
204
204
  - "./docs/FileSanitizationApi.md"
205
+ - "./docs/ProblemDetails.md"
205
206
  - "./git_push.sh"
206
207
  - "./lib/cloudmersive-cdr-api-client.rb"
207
208
  - "./lib/cloudmersive-cdr-api-client/api/file_sanitization_api.rb"
208
209
  - "./lib/cloudmersive-cdr-api-client/api_client.rb"
209
210
  - "./lib/cloudmersive-cdr-api-client/api_error.rb"
210
211
  - "./lib/cloudmersive-cdr-api-client/configuration.rb"
212
+ - "./lib/cloudmersive-cdr-api-client/models/problem_details.rb"
211
213
  - "./lib/cloudmersive-cdr-api-client/version.rb"
212
214
  - "./spec/api/file_sanitization_api_spec.rb"
213
215
  - "./spec/api_client_spec.rb"
214
216
  - "./spec/configuration_spec.rb"
217
+ - "./spec/models/problem_details_spec.rb"
215
218
  - "./spec/spec_helper.rb"
216
219
  homepage: https://cloudmersive.com/cdr-api
217
220
  licenses: