cloudmersive-convert-api-client 1.4.6 → 1.4.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 233e4225e3af6e5aaa826509f21d4ae2e58fcf695ae8641449cd8fb71c12697c
4
- data.tar.gz: b68efacc9f4eb4867092e06c9cc1f72a1435d48093942557225d432ea6359fe5
3
+ metadata.gz: 4540559de6df3c715fb44ebe470abe128c552b939b0c84483424f1d4f5ffbb79
4
+ data.tar.gz: e98c94b14d1650e6adfd3a6d1551d9927e9923035770be97f2e1e9f0bf212b1e
5
5
  SHA512:
6
- metadata.gz: f0ba46e56b989387acf8502dd63b1b6f671aefc37aed40cf6ff648e99f9a1432a0562c830cd573a3561714ae286114e2e28a5a136d77b1880d4b0a7326c0b599
7
- data.tar.gz: 3085405b610bd132ad4489b0f16a8f15989bd34a2b1be717f89d08f2a9043b43b21900829cab6fd733097fd0d19100c0959cc7a2e1f9876f25ab0206860b3c33
6
+ metadata.gz: d51c4e375e0d7b8a4a8ed79bfe6d555106f081a01966fe8f656c01666da2124405cc09cc76452fb205f0548a93eef0bb2da7f7a9c92c859855f468efdbb2c04e
7
+ data.tar.gz: 3b7c81db458959781718ce10b235ada1c2fe8d03004364d707e21a5cae000b271447bf7b7499bab2f2303f76c0195337b37216a2242754376aea4d55f4ed145e
data/README.md CHANGED
@@ -7,7 +7,7 @@ Convert API lets you effortlessly convert file formats and types.
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: 1.4.6
10
+ - Package version: 1.4.7
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build cloudmersive-convert-api-client.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./cloudmersive-convert-api-client-1.4.6.gem
26
+ gem install ./cloudmersive-convert-api-client-1.4.7.gem
27
27
  ```
28
- (for development, run `gem install --dev ./cloudmersive-convert-api-client-1.4.6.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./cloudmersive-convert-api-client-1.4.7.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-convert-api-client', '~> 1.4.6'
34
+ gem 'cloudmersive-convert-api-client', '~> 1.4.7'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -160,7 +160,9 @@ Class | Method | HTTP request | Description
160
160
  *CloudmersiveConvertApiClient::MergeDocumentApi* | [**merge_document_pptx**](docs/MergeDocumentApi.md#merge_document_pptx) | **POST** /convert/merge/pptx | Merge Multple PowerPoint PPTX Together
161
161
  *CloudmersiveConvertApiClient::MergeDocumentApi* | [**merge_document_xlsx**](docs/MergeDocumentApi.md#merge_document_xlsx) | **POST** /convert/merge/xlsx | Merge Multple Excel XLSX Together
162
162
  *CloudmersiveConvertApiClient::SplitDocumentApi* | [**split_document_xlsx**](docs/SplitDocumentApi.md#split_document_xlsx) | **POST** /convert/split/xlsx | Split a single Excel XLSX into Separate Worksheets
163
+ *CloudmersiveConvertApiClient::ValidateDocumentApi* | [**validate_document_autodetect_validation**](docs/ValidateDocumentApi.md#validate_document_autodetect_validation) | **POST** /convert/validate/autodetect | Autodetect content type and validate
163
164
  *CloudmersiveConvertApiClient::ValidateDocumentApi* | [**validate_document_docx_validation**](docs/ValidateDocumentApi.md#validate_document_docx_validation) | **POST** /convert/validate/docx | Validate a Word document (DOCX)
165
+ *CloudmersiveConvertApiClient::ValidateDocumentApi* | [**validate_document_executable_validation**](docs/ValidateDocumentApi.md#validate_document_executable_validation) | **POST** /convert/validate/executable | Validate if a file is executable
164
166
  *CloudmersiveConvertApiClient::ValidateDocumentApi* | [**validate_document_json_validation**](docs/ValidateDocumentApi.md#validate_document_json_validation) | **POST** /convert/validate/json | Validate a JSON file
165
167
  *CloudmersiveConvertApiClient::ValidateDocumentApi* | [**validate_document_pdf_validation**](docs/ValidateDocumentApi.md#validate_document_pdf_validation) | **POST** /convert/validate/pdf | Validate a PDF document file
166
168
  *CloudmersiveConvertApiClient::ValidateDocumentApi* | [**validate_document_pptx_validation**](docs/ValidateDocumentApi.md#validate_document_pptx_validation) | **POST** /convert/validate/pptx | Validate a PowerPoint presentation (PPTX)
@@ -172,6 +174,7 @@ Class | Method | HTTP request | Description
172
174
  ## Documentation for Models
173
175
 
174
176
  - [CloudmersiveConvertApiClient::AlternateFileFormatCandidate](docs/AlternateFileFormatCandidate.md)
177
+ - [CloudmersiveConvertApiClient::AutodetectDocumentValidationResult](docs/AutodetectDocumentValidationResult.md)
175
178
  - [CloudmersiveConvertApiClient::AutodetectGetInfoResult](docs/AutodetectGetInfoResult.md)
176
179
  - [CloudmersiveConvertApiClient::AutodetectToPngResult](docs/AutodetectToPngResult.md)
177
180
  - [CloudmersiveConvertApiClient::ConvertedPngPage](docs/ConvertedPngPage.md)
@@ -0,0 +1,12 @@
1
+ # CloudmersiveConvertApiClient::AutodetectDocumentValidationResult
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **file_format_extension** | **String** | | [optional]
7
+ **document_is_valid** | **BOOLEAN** | True if the document is valid and has no errors, false otherwise | [optional]
8
+ **error_count** | **Integer** | Number of validation errors found in the document | [optional]
9
+ **warning_count** | **Integer** | Number of validation warnings found in the document | [optional]
10
+ **errors_and_warnings** | [**Array<DocumentValidationError>**](DocumentValidationError.md) | Details of errors and warnings found | [optional]
11
+
12
+
@@ -4,7 +4,9 @@ All URIs are relative to *https://api.cloudmersive.com*
4
4
 
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
+ [**validate_document_autodetect_validation**](ValidateDocumentApi.md#validate_document_autodetect_validation) | **POST** /convert/validate/autodetect | Autodetect content type and validate
7
8
  [**validate_document_docx_validation**](ValidateDocumentApi.md#validate_document_docx_validation) | **POST** /convert/validate/docx | Validate a Word document (DOCX)
9
+ [**validate_document_executable_validation**](ValidateDocumentApi.md#validate_document_executable_validation) | **POST** /convert/validate/executable | Validate if a file is executable
8
10
  [**validate_document_json_validation**](ValidateDocumentApi.md#validate_document_json_validation) | **POST** /convert/validate/json | Validate a JSON file
9
11
  [**validate_document_pdf_validation**](ValidateDocumentApi.md#validate_document_pdf_validation) | **POST** /convert/validate/pdf | Validate a PDF document file
10
12
  [**validate_document_pptx_validation**](ValidateDocumentApi.md#validate_document_pptx_validation) | **POST** /convert/validate/pptx | Validate a PowerPoint presentation (PPTX)
@@ -12,6 +14,60 @@ Method | HTTP request | Description
12
14
  [**validate_document_xml_validation**](ValidateDocumentApi.md#validate_document_xml_validation) | **POST** /convert/validate/xml | Validate an XML file
13
15
 
14
16
 
17
+ # **validate_document_autodetect_validation**
18
+ > AutodetectDocumentValidationResult validate_document_autodetect_validation(input_file)
19
+
20
+ Autodetect content type and validate
21
+
22
+ Automatically detect the type of content, verify and validate that the content is indeed fully valid at depth, and then report the validation result.
23
+
24
+ ### Example
25
+ ```ruby
26
+ # load the gem
27
+ require 'cloudmersive-convert-api-client'
28
+ # setup authorization
29
+ CloudmersiveConvertApiClient.configure do |config|
30
+ # Configure API key authorization: Apikey
31
+ config.api_key['Apikey'] = 'YOUR API KEY'
32
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
33
+ #config.api_key_prefix['Apikey'] = 'Bearer'
34
+ end
35
+
36
+ api_instance = CloudmersiveConvertApiClient::ValidateDocumentApi.new
37
+
38
+ input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
39
+
40
+
41
+ begin
42
+ #Autodetect content type and validate
43
+ result = api_instance.validate_document_autodetect_validation(input_file)
44
+ p result
45
+ rescue CloudmersiveConvertApiClient::ApiError => e
46
+ puts "Exception when calling ValidateDocumentApi->validate_document_autodetect_validation: #{e}"
47
+ end
48
+ ```
49
+
50
+ ### Parameters
51
+
52
+ Name | Type | Description | Notes
53
+ ------------- | ------------- | ------------- | -------------
54
+ **input_file** | **File**| Input file to perform the operation on. |
55
+
56
+ ### Return type
57
+
58
+ [**AutodetectDocumentValidationResult**](AutodetectDocumentValidationResult.md)
59
+
60
+ ### Authorization
61
+
62
+ [Apikey](../README.md#Apikey)
63
+
64
+ ### HTTP request headers
65
+
66
+ - **Content-Type**: multipart/form-data
67
+ - **Accept**: application/json, text/json, application/xml, text/xml
68
+
69
+
70
+
15
71
  # **validate_document_docx_validation**
16
72
  > DocumentValidationResult validate_document_docx_validation(input_file)
17
73
 
@@ -62,7 +118,61 @@ Name | Type | Description | Notes
62
118
  ### HTTP request headers
63
119
 
64
120
  - **Content-Type**: multipart/form-data
65
- - **Accept**: application/octet-stream
121
+ - **Accept**: application/json, text/json, application/xml, text/xml
122
+
123
+
124
+
125
+ # **validate_document_executable_validation**
126
+ > DocumentValidationResult validate_document_executable_validation(input_file)
127
+
128
+ Validate if a file is executable
129
+
130
+ Validate if an input file is a binary executable file; if the document is not valid
131
+
132
+ ### Example
133
+ ```ruby
134
+ # load the gem
135
+ require 'cloudmersive-convert-api-client'
136
+ # setup authorization
137
+ CloudmersiveConvertApiClient.configure do |config|
138
+ # Configure API key authorization: Apikey
139
+ config.api_key['Apikey'] = 'YOUR API KEY'
140
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
141
+ #config.api_key_prefix['Apikey'] = 'Bearer'
142
+ end
143
+
144
+ api_instance = CloudmersiveConvertApiClient::ValidateDocumentApi.new
145
+
146
+ input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
147
+
148
+
149
+ begin
150
+ #Validate if a file is executable
151
+ result = api_instance.validate_document_executable_validation(input_file)
152
+ p result
153
+ rescue CloudmersiveConvertApiClient::ApiError => e
154
+ puts "Exception when calling ValidateDocumentApi->validate_document_executable_validation: #{e}"
155
+ end
156
+ ```
157
+
158
+ ### Parameters
159
+
160
+ Name | Type | Description | Notes
161
+ ------------- | ------------- | ------------- | -------------
162
+ **input_file** | **File**| Input file to perform the operation on. |
163
+
164
+ ### Return type
165
+
166
+ [**DocumentValidationResult**](DocumentValidationResult.md)
167
+
168
+ ### Authorization
169
+
170
+ [Apikey](../README.md#Apikey)
171
+
172
+ ### HTTP request headers
173
+
174
+ - **Content-Type**: multipart/form-data
175
+ - **Accept**: application/json, text/json, application/xml, text/xml
66
176
 
67
177
 
68
178
 
@@ -116,7 +226,7 @@ Name | Type | Description | Notes
116
226
  ### HTTP request headers
117
227
 
118
228
  - **Content-Type**: multipart/form-data
119
- - **Accept**: application/octet-stream
229
+ - **Accept**: application/json, text/json, application/xml, text/xml
120
230
 
121
231
 
122
232
 
@@ -170,7 +280,7 @@ Name | Type | Description | Notes
170
280
  ### HTTP request headers
171
281
 
172
282
  - **Content-Type**: multipart/form-data
173
- - **Accept**: application/octet-stream
283
+ - **Accept**: application/json, text/json, application/xml, text/xml
174
284
 
175
285
 
176
286
 
@@ -224,7 +334,7 @@ Name | Type | Description | Notes
224
334
  ### HTTP request headers
225
335
 
226
336
  - **Content-Type**: multipart/form-data
227
- - **Accept**: application/octet-stream
337
+ - **Accept**: application/json, text/json, application/xml, text/xml
228
338
 
229
339
 
230
340
 
@@ -278,7 +388,7 @@ Name | Type | Description | Notes
278
388
  ### HTTP request headers
279
389
 
280
390
  - **Content-Type**: multipart/form-data
281
- - **Accept**: application/octet-stream
391
+ - **Accept**: application/json, text/json, application/xml, text/xml
282
392
 
283
393
 
284
394
 
@@ -332,7 +442,7 @@ Name | Type | Description | Notes
332
442
  ### HTTP request headers
333
443
 
334
444
  - **Content-Type**: multipart/form-data
335
- - **Accept**: application/octet-stream
445
+ - **Accept**: application/json, text/json, application/xml, text/xml
336
446
 
337
447
 
338
448
 
@@ -18,6 +18,7 @@ require 'cloudmersive-convert-api-client/configuration'
18
18
 
19
19
  # Models
20
20
  require 'cloudmersive-convert-api-client/models/alternate_file_format_candidate'
21
+ require 'cloudmersive-convert-api-client/models/autodetect_document_validation_result'
21
22
  require 'cloudmersive-convert-api-client/models/autodetect_get_info_result'
22
23
  require 'cloudmersive-convert-api-client/models/autodetect_to_png_result'
23
24
  require 'cloudmersive-convert-api-client/models/converted_png_page'
@@ -20,6 +20,62 @@ module CloudmersiveConvertApiClient
20
20
  @api_client = api_client
21
21
  end
22
22
 
23
+ # Autodetect content type and validate
24
+ # Automatically detect the type of content, verify and validate that the content is indeed fully valid at depth, and then report the validation result.
25
+ # @param input_file Input file to perform the operation on.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [AutodetectDocumentValidationResult]
28
+ def validate_document_autodetect_validation(input_file, opts = {})
29
+ data, _status_code, _headers = validate_document_autodetect_validation_with_http_info(input_file, opts)
30
+ return data
31
+ end
32
+
33
+ # Autodetect content type and validate
34
+ # Automatically detect the type of content, verify and validate that the content is indeed fully valid at depth, and then report the validation result.
35
+ # @param input_file Input file to perform the operation on.
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<(AutodetectDocumentValidationResult, Fixnum, Hash)>] AutodetectDocumentValidationResult data, response status code and response headers
38
+ def validate_document_autodetect_validation_with_http_info(input_file, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug "Calling API: ValidateDocumentApi.validate_document_autodetect_validation ..."
41
+ end
42
+ # verify the required parameter 'input_file' is set
43
+ if @api_client.config.client_side_validation && input_file.nil?
44
+ fail ArgumentError, "Missing the required parameter 'input_file' when calling ValidateDocumentApi.validate_document_autodetect_validation"
45
+ end
46
+ # resource path
47
+ local_var_path = "/convert/validate/autodetect"
48
+
49
+ # query parameters
50
+ query_params = {}
51
+
52
+ # header parameters
53
+ header_params = {}
54
+ # HTTP header 'Accept' (if needed)
55
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
56
+ # HTTP header 'Content-Type'
57
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
58
+
59
+ # form parameters
60
+ form_params = {}
61
+ form_params["inputFile"] = input_file
62
+
63
+ # http body (model)
64
+ post_body = nil
65
+ auth_names = ['Apikey']
66
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => 'AutodetectDocumentValidationResult')
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: ValidateDocumentApi#validate_document_autodetect_validation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
23
79
  # Validate a Word document (DOCX)
24
80
  # Validate a Word document (DOCX); if the document is not valid, identifies the errors in the document
25
81
  # @param input_file Input file to perform the operation on.
@@ -52,7 +108,7 @@ module CloudmersiveConvertApiClient
52
108
  # header parameters
53
109
  header_params = {}
54
110
  # HTTP header 'Accept' (if needed)
55
- header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
111
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
56
112
  # HTTP header 'Content-Type'
57
113
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
58
114
 
@@ -76,6 +132,62 @@ module CloudmersiveConvertApiClient
76
132
  return data, status_code, headers
77
133
  end
78
134
 
135
+ # Validate if a file is executable
136
+ # Validate if an input file is a binary executable file; if the document is not valid
137
+ # @param input_file Input file to perform the operation on.
138
+ # @param [Hash] opts the optional parameters
139
+ # @return [DocumentValidationResult]
140
+ def validate_document_executable_validation(input_file, opts = {})
141
+ data, _status_code, _headers = validate_document_executable_validation_with_http_info(input_file, opts)
142
+ return data
143
+ end
144
+
145
+ # Validate if a file is executable
146
+ # Validate if an input file is a binary executable file; if the document is not valid
147
+ # @param input_file Input file to perform the operation on.
148
+ # @param [Hash] opts the optional parameters
149
+ # @return [Array<(DocumentValidationResult, Fixnum, Hash)>] DocumentValidationResult data, response status code and response headers
150
+ def validate_document_executable_validation_with_http_info(input_file, opts = {})
151
+ if @api_client.config.debugging
152
+ @api_client.config.logger.debug "Calling API: ValidateDocumentApi.validate_document_executable_validation ..."
153
+ end
154
+ # verify the required parameter 'input_file' is set
155
+ if @api_client.config.client_side_validation && input_file.nil?
156
+ fail ArgumentError, "Missing the required parameter 'input_file' when calling ValidateDocumentApi.validate_document_executable_validation"
157
+ end
158
+ # resource path
159
+ local_var_path = "/convert/validate/executable"
160
+
161
+ # query parameters
162
+ query_params = {}
163
+
164
+ # header parameters
165
+ header_params = {}
166
+ # HTTP header 'Accept' (if needed)
167
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
168
+ # HTTP header 'Content-Type'
169
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
170
+
171
+ # form parameters
172
+ form_params = {}
173
+ form_params["inputFile"] = input_file
174
+
175
+ # http body (model)
176
+ post_body = nil
177
+ auth_names = ['Apikey']
178
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
179
+ :header_params => header_params,
180
+ :query_params => query_params,
181
+ :form_params => form_params,
182
+ :body => post_body,
183
+ :auth_names => auth_names,
184
+ :return_type => 'DocumentValidationResult')
185
+ if @api_client.config.debugging
186
+ @api_client.config.logger.debug "API called: ValidateDocumentApi#validate_document_executable_validation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
187
+ end
188
+ return data, status_code, headers
189
+ end
190
+
79
191
  # Validate a JSON file
80
192
  # Validate a JSON (JavaScript Object Notation) document file; if the document is not valid, identifies the errors in the document
81
193
  # @param input_file Input file to perform the operation on.
@@ -108,7 +220,7 @@ module CloudmersiveConvertApiClient
108
220
  # header parameters
109
221
  header_params = {}
110
222
  # HTTP header 'Accept' (if needed)
111
- header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
223
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
112
224
  # HTTP header 'Content-Type'
113
225
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
114
226
 
@@ -164,7 +276,7 @@ module CloudmersiveConvertApiClient
164
276
  # header parameters
165
277
  header_params = {}
166
278
  # HTTP header 'Accept' (if needed)
167
- header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
279
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
168
280
  # HTTP header 'Content-Type'
169
281
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
170
282
 
@@ -220,7 +332,7 @@ module CloudmersiveConvertApiClient
220
332
  # header parameters
221
333
  header_params = {}
222
334
  # HTTP header 'Accept' (if needed)
223
- header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
335
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
224
336
  # HTTP header 'Content-Type'
225
337
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
226
338
 
@@ -276,7 +388,7 @@ module CloudmersiveConvertApiClient
276
388
  # header parameters
277
389
  header_params = {}
278
390
  # HTTP header 'Accept' (if needed)
279
- header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
391
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
280
392
  # HTTP header 'Content-Type'
281
393
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
282
394
 
@@ -332,7 +444,7 @@ module CloudmersiveConvertApiClient
332
444
  # header parameters
333
445
  header_params = {}
334
446
  # HTTP header 'Accept' (if needed)
335
- header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
447
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
336
448
  # HTTP header 'Content-Type'
337
449
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
338
450
 
@@ -0,0 +1,230 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # Document validation result
17
+ class AutodetectDocumentValidationResult
18
+ attr_accessor :file_format_extension
19
+
20
+ # True if the document is valid and has no errors, false otherwise
21
+ attr_accessor :document_is_valid
22
+
23
+ # Number of validation errors found in the document
24
+ attr_accessor :error_count
25
+
26
+ # Number of validation warnings found in the document
27
+ attr_accessor :warning_count
28
+
29
+ # Details of errors and warnings found
30
+ attr_accessor :errors_and_warnings
31
+
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'file_format_extension' => :'FileFormatExtension',
37
+ :'document_is_valid' => :'DocumentIsValid',
38
+ :'error_count' => :'ErrorCount',
39
+ :'warning_count' => :'WarningCount',
40
+ :'errors_and_warnings' => :'ErrorsAndWarnings'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'file_format_extension' => :'String',
48
+ :'document_is_valid' => :'BOOLEAN',
49
+ :'error_count' => :'Integer',
50
+ :'warning_count' => :'Integer',
51
+ :'errors_and_warnings' => :'Array<DocumentValidationError>'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ return unless attributes.is_a?(Hash)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
62
+
63
+ if attributes.has_key?(:'FileFormatExtension')
64
+ self.file_format_extension = attributes[:'FileFormatExtension']
65
+ end
66
+
67
+ if attributes.has_key?(:'DocumentIsValid')
68
+ self.document_is_valid = attributes[:'DocumentIsValid']
69
+ end
70
+
71
+ if attributes.has_key?(:'ErrorCount')
72
+ self.error_count = attributes[:'ErrorCount']
73
+ end
74
+
75
+ if attributes.has_key?(:'WarningCount')
76
+ self.warning_count = attributes[:'WarningCount']
77
+ end
78
+
79
+ if attributes.has_key?(:'ErrorsAndWarnings')
80
+ if (value = attributes[:'ErrorsAndWarnings']).is_a?(Array)
81
+ self.errors_and_warnings = value
82
+ end
83
+ end
84
+
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ return invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return true
98
+ end
99
+
100
+ # Checks equality by comparing each attribute.
101
+ # @param [Object] Object to be compared
102
+ def ==(o)
103
+ return true if self.equal?(o)
104
+ self.class == o.class &&
105
+ file_format_extension == o.file_format_extension &&
106
+ document_is_valid == o.document_is_valid &&
107
+ error_count == o.error_count &&
108
+ warning_count == o.warning_count &&
109
+ errors_and_warnings == o.errors_and_warnings
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Fixnum] Hash code
120
+ def hash
121
+ [file_format_extension, document_is_valid, error_count, warning_count, errors_and_warnings].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.swagger_types.each_pair do |key, type|
130
+ if type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
139
+ end
140
+
141
+ self
142
+ end
143
+
144
+ # Deserializes the data based on type
145
+ # @param string type Data type
146
+ # @param string value Value to be deserialized
147
+ # @return [Object] Deserialized data
148
+ def _deserialize(type, value)
149
+ case type.to_sym
150
+ when :DateTime
151
+ DateTime.parse(value)
152
+ when :Date
153
+ Date.parse(value)
154
+ when :String
155
+ value.to_s
156
+ when :Integer
157
+ value.to_i
158
+ when :Float
159
+ value.to_f
160
+ when :BOOLEAN
161
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
162
+ true
163
+ else
164
+ false
165
+ end
166
+ when :Object
167
+ # generic object (usually a Hash), return directly
168
+ value
169
+ when /\AArray<(?<inner_type>.+)>\z/
170
+ inner_type = Regexp.last_match[:inner_type]
171
+ value.map { |v| _deserialize(inner_type, v) }
172
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
173
+ k_type = Regexp.last_match[:k_type]
174
+ v_type = Regexp.last_match[:v_type]
175
+ {}.tap do |hash|
176
+ value.each do |k, v|
177
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
178
+ end
179
+ end
180
+ else # model
181
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
182
+ temp_model.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ next if value.nil?
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map{ |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+
228
+ end
229
+
230
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.3.1
11
11
  =end
12
12
 
13
13
  module CloudmersiveConvertApiClient
14
- VERSION = "1.4.6"
14
+ VERSION = "1.4.7"
15
15
  end
@@ -32,6 +32,18 @@ describe 'ValidateDocumentApi' do
32
32
  end
33
33
  end
34
34
 
35
+ # unit tests for validate_document_autodetect_validation
36
+ # Autodetect content type and validate
37
+ # Automatically detect the type of content, verify and validate that the content is indeed fully valid at depth, and then report the validation result.
38
+ # @param input_file Input file to perform the operation on.
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [AutodetectDocumentValidationResult]
41
+ describe 'validate_document_autodetect_validation test' 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
+
35
47
  # unit tests for validate_document_docx_validation
36
48
  # Validate a Word document (DOCX)
37
49
  # Validate a Word document (DOCX); if the document is not valid, identifies the errors in the document
@@ -44,6 +56,18 @@ describe 'ValidateDocumentApi' do
44
56
  end
45
57
  end
46
58
 
59
+ # unit tests for validate_document_executable_validation
60
+ # Validate if a file is executable
61
+ # Validate if an input file is a binary executable file; if the document is not valid
62
+ # @param input_file Input file to perform the operation on.
63
+ # @param [Hash] opts the optional parameters
64
+ # @return [DocumentValidationResult]
65
+ describe 'validate_document_executable_validation 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 validate_document_json_validation
48
72
  # Validate a JSON file
49
73
  # Validate a JSON (JavaScript Object Notation) document file; if the document is not valid, identifies the errors in the document
@@ -0,0 +1,66 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveConvertApiClient::AutodetectDocumentValidationResult
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'AutodetectDocumentValidationResult' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveConvertApiClient::AutodetectDocumentValidationResult.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of AutodetectDocumentValidationResult' do
31
+ it 'should create an instance of AutodetectDocumentValidationResult' do
32
+ expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::AutodetectDocumentValidationResult)
33
+ end
34
+ end
35
+ describe 'test attribute "file_format_extension"' 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 "document_is_valid"' 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 "error_count"' 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 "warning_count"' 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 "errors_and_warnings"' 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
66
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudmersive-convert-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.6
4
+ version: 1.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudmersive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-03 00:00:00.000000000 Z
11
+ date: 2019-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -203,6 +203,7 @@ files:
203
203
  - "./Rakefile"
204
204
  - "./cloudmersive-convert-api-client.gemspec"
205
205
  - "./docs/AlternateFileFormatCandidate.md"
206
+ - "./docs/AutodetectDocumentValidationResult.md"
206
207
  - "./docs/AutodetectGetInfoResult.md"
207
208
  - "./docs/AutodetectToPngResult.md"
208
209
  - "./docs/CompareDocumentApi.md"
@@ -315,6 +316,7 @@ files:
315
316
  - "./lib/cloudmersive-convert-api-client/api_error.rb"
316
317
  - "./lib/cloudmersive-convert-api-client/configuration.rb"
317
318
  - "./lib/cloudmersive-convert-api-client/models/alternate_file_format_candidate.rb"
319
+ - "./lib/cloudmersive-convert-api-client/models/autodetect_document_validation_result.rb"
318
320
  - "./lib/cloudmersive-convert-api-client/models/autodetect_get_info_result.rb"
319
321
  - "./lib/cloudmersive-convert-api-client/models/autodetect_to_png_result.rb"
320
322
  - "./lib/cloudmersive-convert-api-client/models/converted_png_page.rb"
@@ -413,6 +415,7 @@ files:
413
415
  - "./spec/api_client_spec.rb"
414
416
  - "./spec/configuration_spec.rb"
415
417
  - "./spec/models/alternate_file_format_candidate_spec.rb"
418
+ - "./spec/models/autodetect_document_validation_result_spec.rb"
416
419
  - "./spec/models/autodetect_get_info_result_spec.rb"
417
420
  - "./spec/models/autodetect_to_png_result_spec.rb"
418
421
  - "./spec/models/converted_png_page_spec.rb"