cloudmersive-convert-api-client 2.1.3 → 2.1.8

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -4
  3. data/docs/EditDocumentApi.md +165 -0
  4. data/docs/EditHtmlApi.md +60 -0
  5. data/docs/GetMacrosResponse.md +9 -0
  6. data/docs/HtmlGetLinksResponse.md +9 -0
  7. data/docs/HtmlHyperlink.md +9 -0
  8. data/docs/HtmlSsrfThreatCheckResult.md +10 -0
  9. data/docs/HtmlThreatLink.md +9 -0
  10. data/docs/MergeDocumentApi.md +134 -0
  11. data/docs/ValidateDocumentApi.md +220 -0
  12. data/docs/XxeThreatDetectionResult.md +9 -0
  13. data/docs/ZipArchiveApi.md +62 -0
  14. data/lib/cloudmersive-convert-api-client.rb +6 -0
  15. data/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +165 -0
  16. data/lib/cloudmersive-convert-api-client/api/edit_html_api.rb +55 -0
  17. data/lib/cloudmersive-convert-api-client/api/merge_document_api.rb +148 -0
  18. data/lib/cloudmersive-convert-api-client/api/validate_document_api.rb +220 -0
  19. data/lib/cloudmersive-convert-api-client/api/zip_archive_api.rb +63 -0
  20. data/lib/cloudmersive-convert-api-client/models/get_macros_response.rb +196 -0
  21. data/lib/cloudmersive-convert-api-client/models/html_get_links_response.rb +198 -0
  22. data/lib/cloudmersive-convert-api-client/models/html_hyperlink.rb +196 -0
  23. data/lib/cloudmersive-convert-api-client/models/html_ssrf_threat_check_result.rb +208 -0
  24. data/lib/cloudmersive-convert-api-client/models/html_threat_link.rb +196 -0
  25. data/lib/cloudmersive-convert-api-client/models/xxe_threat_detection_result.rb +196 -0
  26. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  27. data/spec/api/edit_document_api_spec.rb +36 -0
  28. data/spec/api/edit_html_api_spec.rb +14 -0
  29. data/spec/api/merge_document_api_spec.rb +34 -0
  30. data/spec/api/validate_document_api_spec.rb +48 -0
  31. data/spec/api/zip_archive_api_spec.rb +14 -0
  32. data/spec/models/get_macros_response_spec.rb +47 -0
  33. data/spec/models/html_get_links_response_spec.rb +47 -0
  34. data/spec/models/html_hyperlink_spec.rb +47 -0
  35. data/spec/models/html_ssrf_threat_check_result_spec.rb +53 -0
  36. data/spec/models/html_threat_link_spec.rb +47 -0
  37. data/spec/models/xxe_threat_detection_result_spec.rb +47 -0
  38. metadata +20 -2
@@ -0,0 +1,196 @@
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.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # Result of performing an XXE threat detection operation
17
+ class XxeThreatDetectionResult
18
+ # True if the operation was successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # True if the XML input contains XXE threats, false otherwise
22
+ attr_accessor :contains_xxe_threat
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'successful' => :'Successful',
28
+ :'contains_xxe_threat' => :'ContainsXxeThreat'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'successful' => :'BOOLEAN',
36
+ :'contains_xxe_threat' => :'BOOLEAN'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'Successful')
49
+ self.successful = attributes[:'Successful']
50
+ end
51
+
52
+ if attributes.has_key?(:'ContainsXxeThreat')
53
+ self.contains_xxe_threat = attributes[:'ContainsXxeThreat']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ invalid_properties
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ def valid?
67
+ true
68
+ end
69
+
70
+ # Checks equality by comparing each attribute.
71
+ # @param [Object] Object to be compared
72
+ def ==(o)
73
+ return true if self.equal?(o)
74
+ self.class == o.class &&
75
+ successful == o.successful &&
76
+ contains_xxe_threat == o.contains_xxe_threat
77
+ end
78
+
79
+ # @see the `==` method
80
+ # @param [Object] Object to be compared
81
+ def eql?(o)
82
+ self == o
83
+ end
84
+
85
+ # Calculates hash code according to all attributes.
86
+ # @return [Fixnum] Hash code
87
+ def hash
88
+ [successful, contains_xxe_threat].hash
89
+ end
90
+
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+ self.class.swagger_types.each_pair do |key, type|
97
+ if type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
101
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :BOOLEAN
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
149
+ temp_model.build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ next if value.nil?
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ hash
175
+ end
176
+
177
+ # Outputs non-array value in the form of hash
178
+ # For object, use to_hash. Otherwise, just return the value
179
+ # @param [Object] value Any valid value
180
+ # @return [Hash] Returns the value in the form of hash
181
+ def _to_hash(value)
182
+ if value.is_a?(Array)
183
+ value.compact.map { |v| _to_hash(v) }
184
+ elsif value.is_a?(Hash)
185
+ {}.tap do |hash|
186
+ value.each { |k, v| hash[k] = _to_hash(v) }
187
+ end
188
+ elsif value.respond_to? :to_hash
189
+ value.to_hash
190
+ else
191
+ value
192
+ end
193
+ end
194
+
195
+ end
196
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.14
11
11
  =end
12
12
 
13
13
  module CloudmersiveConvertApiClient
14
- VERSION = '2.1.3'
14
+ VERSION = '2.1.8'
15
15
  end
@@ -200,6 +200,18 @@ describe 'EditDocumentApi' do
200
200
  end
201
201
  end
202
202
 
203
+ # unit tests for edit_document_docx_get_macro_information
204
+ # Get macro information from a Word DOCX/DOCM document
205
+ # Returns information about the Macros (e.g. VBA) defined in the Word Document
206
+ # @param input_file Input file to perform the operation on.
207
+ # @param [Hash] opts the optional parameters
208
+ # @return [GetMacrosResponse]
209
+ describe 'edit_document_docx_get_macro_information test' do
210
+ it 'should work' do
211
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
212
+ end
213
+ end
214
+
203
215
  # unit tests for edit_document_docx_get_metadata_properties
204
216
  # Get all metadata properties in Word DOCX document
205
217
  # Returns all the metadata properties in an Office Word Document (docx)
@@ -512,6 +524,18 @@ describe 'EditDocumentApi' do
512
524
  end
513
525
  end
514
526
 
527
+ # unit tests for edit_document_pptx_get_macro_information
528
+ # Get macro information from a PowerPoint PPTX/PPTM presentation document
529
+ # Returns information about the Macros (e.g. VBA) defined in the PowerPoint Document
530
+ # @param input_file Input file to perform the operation on.
531
+ # @param [Hash] opts the optional parameters
532
+ # @return [GetMacrosResponse]
533
+ describe 'edit_document_pptx_get_macro_information test' do
534
+ it 'should work' do
535
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
536
+ end
537
+ end
538
+
515
539
  # unit tests for edit_document_pptx_replace
516
540
  # Replace string in PowerPoint PPTX presentation
517
541
  # Replace all instances of a string in an Office PowerPoint Document (pptx)
@@ -668,6 +692,18 @@ describe 'EditDocumentApi' do
668
692
  end
669
693
  end
670
694
 
695
+ # unit tests for edit_document_xlsx_get_macro_information
696
+ # Get macro information from a Excel XLSX/XLSM spreadsheet, worksheet
697
+ # Returns information about the Macros (e.g. VBA) defined in the Excel Spreadsheet
698
+ # @param input_file Input file to perform the operation on.
699
+ # @param [Hash] opts the optional parameters
700
+ # @return [GetMacrosResponse]
701
+ describe 'edit_document_xlsx_get_macro_information test' do
702
+ it 'should work' do
703
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
704
+ end
705
+ end
706
+
671
707
  # unit tests for edit_document_xlsx_get_rows_and_cells
672
708
  # Get rows and cells from a Excel XLSX spreadsheet, worksheet
673
709
  # Returns the rows and cells defined in the Excel Spreadsheet worksheet
@@ -111,4 +111,18 @@ describe 'EditHtmlApi' do
111
111
  end
112
112
  end
113
113
 
114
+ # unit tests for edit_html_html_get_links
115
+ # Extract resolved link URLs from HTML File
116
+ # Extracts the resolved link URLs, fully-qualified if possible, from an input HTML file.
117
+ # @param [Hash] opts the optional parameters
118
+ # @option opts [File] :input_file Optional: Input file to perform the operation on.
119
+ # @option opts [String] :input_file_url Optional: URL of a file to operate on as input.
120
+ # @option opts [String] :base_url Optional: Base URL of the page, such as https://mydomain.com
121
+ # @return [HtmlGetLinksResponse]
122
+ describe 'edit_html_html_get_links test' do
123
+ it 'should work' do
124
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
125
+ end
126
+ end
127
+
114
128
  end
@@ -66,6 +66,40 @@ describe 'MergeDocumentApi' do
66
66
  end
67
67
  end
68
68
 
69
+ # unit tests for merge_document_html
70
+ # Merge Two HTML (HTM) Files Together
71
+ # Combine two HTML (.HTM) files into a single text document, preserving the order of the input documents in the combined document by stacking them vertically. The title will be taken from the first document.
72
+ # @param input_file1 First input file to perform the operation on.
73
+ # @param input_file2 Second input file to perform the operation on (more than 2 can be supplied).
74
+ # @param [Hash] opts the optional parameters
75
+ # @return [Object]
76
+ describe 'merge_document_html test' do
77
+ it 'should work' do
78
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
79
+ end
80
+ end
81
+
82
+ # unit tests for merge_document_html_multi
83
+ # Merge Multple HTML (HTM) Files Together
84
+ # Combine multiple HTML (.HTM) files into a single text document, preserving the order of the input documents in the combined document by stacking them vertically. The title will be taken from the first document.
85
+ # @param input_file1 First input file to perform the operation on.
86
+ # @param input_file2 Second input file to perform the operation on.
87
+ # @param [Hash] opts the optional parameters
88
+ # @option opts [File] :input_file3 Third input file to perform the operation on.
89
+ # @option opts [File] :input_file4 Fourth input file to perform the operation on.
90
+ # @option opts [File] :input_file5 Fifth input file to perform the operation on.
91
+ # @option opts [File] :input_file6 Sixth input file to perform the operation on.
92
+ # @option opts [File] :input_file7 Seventh input file to perform the operation on.
93
+ # @option opts [File] :input_file8 Eighth input file to perform the operation on.
94
+ # @option opts [File] :input_file9 Ninth input file to perform the operation on.
95
+ # @option opts [File] :input_file10 Tenth input file to perform the operation on.
96
+ # @return [String]
97
+ describe 'merge_document_html_multi test' do
98
+ it 'should work' do
99
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
100
+ end
101
+ end
102
+
69
103
  # unit tests for merge_document_pdf
70
104
  # Merge Two PDF Files Together
71
105
  # Combine two PDF files (pdf) into a single PDF document, preserving the order of the input documents in the combined document
@@ -104,6 +104,18 @@ describe 'ValidateDocumentApi' do
104
104
  end
105
105
  end
106
106
 
107
+ # unit tests for validate_document_html_ssrf_validation
108
+ # Validate an HTML file and checks for SSRF threats
109
+ # Validate an HTML document file and checks for SSRF (Server-side Request Forgery) threats in the file; if the document is not valid, identifies the errors in the document
110
+ # @param input_file Input file to perform the operation on.
111
+ # @param [Hash] opts the optional parameters
112
+ # @return [HtmlSsrfThreatCheckResult]
113
+ describe 'validate_document_html_ssrf_validation test' do
114
+ it 'should work' do
115
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
116
+ end
117
+ end
118
+
107
119
  # unit tests for validate_document_html_validation
108
120
  # Validate an HTML file
109
121
  # Validate an HTML document file; if the document is not valid, identifies the errors in the document
@@ -128,6 +140,18 @@ describe 'ValidateDocumentApi' do
128
140
  end
129
141
  end
130
142
 
143
+ # unit tests for validate_document_jpg_validation
144
+ # Validate a JPG File
145
+ # Validate a JPEG image file; if the document is not valid, identifies the errors in the document..
146
+ # @param input_file Input file to perform the operation on.
147
+ # @param [Hash] opts the optional parameters
148
+ # @return [DocumentValidationResult]
149
+ describe 'validate_document_jpg_validation test' do
150
+ it 'should work' do
151
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
152
+ end
153
+ end
154
+
131
155
  # unit tests for validate_document_json_validation
132
156
  # Validate a JSON file
133
157
  # Validate a JSON (JavaScript Object Notation) document file; if the document is not valid, identifies the errors in the document
@@ -164,6 +188,18 @@ describe 'ValidateDocumentApi' do
164
188
  end
165
189
  end
166
190
 
191
+ # unit tests for validate_document_png_validation
192
+ # Validate a PNG File
193
+ # Validate a PNG image file; if the document is not valid, identifies the errors in the document.
194
+ # @param input_file Input file to perform the operation on.
195
+ # @param [Hash] opts the optional parameters
196
+ # @return [DocumentValidationResult]
197
+ describe 'validate_document_png_validation test' do
198
+ it 'should work' do
199
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
200
+ end
201
+ end
202
+
167
203
  # unit tests for validate_document_pptx_validation
168
204
  # Validate a PowerPoint presentation (PPTX)
169
205
  # Validate a PowerPoint presentation (PPTX); if the document is not valid, identifies the errors in the document
@@ -236,6 +272,18 @@ describe 'ValidateDocumentApi' do
236
272
  end
237
273
  end
238
274
 
275
+ # unit tests for validate_document_xml_xxe_threat_validation
276
+ # Validate an XML file for XML External Entity (XXE) threats
277
+ # Validate an XML document file for XML External Entity (XXE) threats; if the document is not valid, identifies the errors in the document. XXE threats are a type of threat that exploits vulnerabilities in the XML standard relating to external or local entity URIs in XML documents.
278
+ # @param input_file Input file to perform the operation on.
279
+ # @param [Hash] opts the optional parameters
280
+ # @return [XxeThreatDetectionResult]
281
+ describe 'validate_document_xml_xxe_threat_validation test' do
282
+ it 'should work' do
283
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
284
+ end
285
+ end
286
+
239
287
  # unit tests for validate_document_zip_validation
240
288
  # Validate a Zip Archive file (zip)
241
289
  # Validate a Zip archive file (ZIP)
@@ -88,6 +88,20 @@ describe 'ZipArchiveApi' do
88
88
  end
89
89
  end
90
90
 
91
+ # unit tests for zip_archive_zip_create_quarantine
92
+ # Create an encrypted zip file to quarantine a dangerous file
93
+ # Create a new zip archive by compressing input files, and also applies encryption and password protection to the zip, for the purposes of quarantining the underlyikng file.
94
+ # @param password Password to place on the Zip file; the longer the password, the more secure
95
+ # @param input_file1 First input file to perform the operation on.
96
+ # @param [Hash] opts the optional parameters
97
+ # @option opts [String] :encryption_algorithm Encryption algorithm to use; possible values are AES-256 (recommended), AES-128, and PK-Zip (not recommended; legacy, weak encryption algorithm). Default is AES-256.
98
+ # @return [Object]
99
+ describe 'zip_archive_zip_create_quarantine test' do
100
+ it 'should work' do
101
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
102
+ end
103
+ end
104
+
91
105
  # unit tests for zip_archive_zip_decrypt
92
106
  # Decrypt and remove password protection on a zip file
93
107
  # Decrypts and removes password protection from an encrypted zip file with the specified password
@@ -0,0 +1,47 @@
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.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveConvertApiClient::GetMacrosResponse
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'GetMacrosResponse' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveConvertApiClient::GetMacrosResponse.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of GetMacrosResponse' do
31
+ it 'should create an instance of GetMacrosResponse' do
32
+ expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::GetMacrosResponse)
33
+ end
34
+ end
35
+ describe 'test attribute "successful"' 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 "contains_vba_macros"' 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
+ end