cloudmersive-convert-api-client 2.1.1 → 2.1.6

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -4
  3. data/docs/DocxMetadataCustomProperty.md +13 -0
  4. data/docs/DocxSetCustomMetadataPropertiesRequest.md +10 -0
  5. data/docs/EditDocumentApi.md +275 -0
  6. data/docs/EditHtmlApi.md +60 -0
  7. data/docs/GetDocxMetadataPropertiesResponse.md +16 -0
  8. data/docs/GetMacrosResponse.md +9 -0
  9. data/docs/HtmlGetLinksResponse.md +9 -0
  10. data/docs/HtmlHyperlink.md +9 -0
  11. data/docs/HtmlSsrfThreatCheckResult.md +10 -0
  12. data/docs/HtmlThreatLink.md +9 -0
  13. data/docs/MergeDocumentApi.md +134 -0
  14. data/docs/ValidateDocumentApi.md +220 -0
  15. data/docs/ViewerToolsApi.md +8 -2
  16. data/lib/cloudmersive-convert-api-client.rb +8 -0
  17. data/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +274 -0
  18. data/lib/cloudmersive-convert-api-client/api/edit_html_api.rb +55 -0
  19. data/lib/cloudmersive-convert-api-client/api/merge_document_api.rb +148 -0
  20. data/lib/cloudmersive-convert-api-client/api/validate_document_api.rb +220 -0
  21. data/lib/cloudmersive-convert-api-client/api/viewer_tools_api.rb +6 -0
  22. data/lib/cloudmersive-convert-api-client/models/docx_metadata_custom_property.rb +236 -0
  23. data/lib/cloudmersive-convert-api-client/models/docx_set_custom_metadata_properties_request.rb +223 -0
  24. data/lib/cloudmersive-convert-api-client/models/get_docx_metadata_properties_response.rb +268 -0
  25. data/lib/cloudmersive-convert-api-client/models/get_macros_response.rb +196 -0
  26. data/lib/cloudmersive-convert-api-client/models/html_get_links_response.rb +198 -0
  27. data/lib/cloudmersive-convert-api-client/models/html_hyperlink.rb +196 -0
  28. data/lib/cloudmersive-convert-api-client/models/html_ssrf_threat_check_result.rb +208 -0
  29. data/lib/cloudmersive-convert-api-client/models/html_threat_link.rb +196 -0
  30. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  31. data/spec/api/edit_document_api_spec.rb +60 -0
  32. data/spec/api/edit_html_api_spec.rb +14 -0
  33. data/spec/api/merge_document_api_spec.rb +34 -0
  34. data/spec/api/validate_document_api_spec.rb +48 -0
  35. data/spec/api/viewer_tools_api_spec.rb +2 -0
  36. data/spec/models/docx_metadata_custom_property_spec.rb +71 -0
  37. data/spec/models/docx_set_custom_metadata_properties_request_spec.rb +53 -0
  38. data/spec/models/get_docx_metadata_properties_response_spec.rb +89 -0
  39. data/spec/models/get_macros_response_spec.rb +47 -0
  40. data/spec/models/html_get_links_response_spec.rb +47 -0
  41. data/spec/models/html_hyperlink_spec.rb +47 -0
  42. data/spec/models/html_ssrf_threat_check_result_spec.rb +53 -0
  43. data/spec/models/html_threat_link_spec.rb +47 -0
  44. metadata +26 -2
@@ -0,0 +1,208 @@
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
+ # HTML SSRF validation result
17
+ class HtmlSsrfThreatCheckResult
18
+ # True if the document is valid and has no errors, false otherwise
19
+ attr_accessor :is_valid
20
+
21
+ # True if the document contains an SSRF threat, false otherwise
22
+ attr_accessor :is_threat
23
+
24
+ # Links found in the input HTML that contains threats
25
+ attr_accessor :threat_links
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'is_valid' => :'IsValid',
31
+ :'is_threat' => :'IsThreat',
32
+ :'threat_links' => :'ThreatLinks'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'is_valid' => :'BOOLEAN',
40
+ :'is_threat' => :'BOOLEAN',
41
+ :'threat_links' => :'Array<HtmlThreatLink>'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+
53
+ if attributes.has_key?(:'IsValid')
54
+ self.is_valid = attributes[:'IsValid']
55
+ end
56
+
57
+ if attributes.has_key?(:'IsThreat')
58
+ self.is_threat = attributes[:'IsThreat']
59
+ end
60
+
61
+ if attributes.has_key?(:'ThreatLinks')
62
+ if (value = attributes[:'ThreatLinks']).is_a?(Array)
63
+ self.threat_links = value
64
+ end
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ is_valid == o.is_valid &&
87
+ is_threat == o.is_threat &&
88
+ threat_links == o.threat_links
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [is_valid, is_threat, threat_links].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ if type =~ /\AArray<(.*)>/i
110
+ # check to ensure the input is an array given that the attribute
111
+ # is documented as an array but the input is not
112
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
113
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ end
115
+ elsif !attributes[self.class.attribute_map[key]].nil?
116
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
118
+ end
119
+
120
+ self
121
+ end
122
+
123
+ # Deserializes the data based on type
124
+ # @param string type Data type
125
+ # @param string value Value to be deserialized
126
+ # @return [Object] Deserialized data
127
+ def _deserialize(type, value)
128
+ case type.to_sym
129
+ when :DateTime
130
+ DateTime.parse(value)
131
+ when :Date
132
+ Date.parse(value)
133
+ when :String
134
+ value.to_s
135
+ when :Integer
136
+ value.to_i
137
+ when :Float
138
+ value.to_f
139
+ when :BOOLEAN
140
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
+ true
142
+ else
143
+ false
144
+ end
145
+ when :Object
146
+ # generic object (usually a Hash), return directly
147
+ value
148
+ when /\AArray<(?<inner_type>.+)>\z/
149
+ inner_type = Regexp.last_match[:inner_type]
150
+ value.map { |v| _deserialize(inner_type, v) }
151
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
+ k_type = Regexp.last_match[:k_type]
153
+ v_type = Regexp.last_match[:v_type]
154
+ {}.tap do |hash|
155
+ value.each do |k, v|
156
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
+ end
158
+ end
159
+ else # model
160
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
161
+ temp_model.build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ next if value.nil?
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ # Outputs non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ # @param [Object] value Any valid value
192
+ # @return [Hash] Returns the value in the form of hash
193
+ def _to_hash(value)
194
+ if value.is_a?(Array)
195
+ value.compact.map { |v| _to_hash(v) }
196
+ elsif value.is_a?(Hash)
197
+ {}.tap do |hash|
198
+ value.each { |k, v| hash[k] = _to_hash(v) }
199
+ end
200
+ elsif value.respond_to? :to_hash
201
+ value.to_hash
202
+ else
203
+ value
204
+ end
205
+ end
206
+
207
+ end
208
+ end
@@ -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
+ # Threat assessment for a hyperlink URL
17
+ class HtmlThreatLink
18
+ # URL of the link
19
+ attr_accessor :link_url
20
+
21
+ # Threat assessment level; possible values are None, Low, Medium and High
22
+ attr_accessor :threat_level
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'link_url' => :'LinkUrl',
28
+ :'threat_level' => :'ThreatLevel'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'link_url' => :'String',
36
+ :'threat_level' => :'String'
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?(:'LinkUrl')
49
+ self.link_url = attributes[:'LinkUrl']
50
+ end
51
+
52
+ if attributes.has_key?(:'ThreatLevel')
53
+ self.threat_level = attributes[:'ThreatLevel']
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
+ link_url == o.link_url &&
76
+ threat_level == o.threat_level
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
+ [link_url, threat_level].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.1'
14
+ VERSION = '2.1.6'
15
15
  end
@@ -200,6 +200,30 @@ 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
+
215
+ # unit tests for edit_document_docx_get_metadata_properties
216
+ # Get all metadata properties in Word DOCX document
217
+ # Returns all the metadata properties in an Office Word Document (docx)
218
+ # @param input_file Input file to perform the operation on.
219
+ # @param [Hash] opts the optional parameters
220
+ # @return [GetDocxMetadataPropertiesResponse]
221
+ describe 'edit_document_docx_get_metadata_properties test' do
222
+ it 'should work' do
223
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
224
+ end
225
+ end
226
+
203
227
  # unit tests for edit_document_docx_get_sections
204
228
  # Get sections from a Word DOCX document
205
229
  # Returns the sections defined in the Word Document (DOCX) format file
@@ -404,6 +428,18 @@ describe 'EditDocumentApi' do
404
428
  end
405
429
  end
406
430
 
431
+ # unit tests for edit_document_docx_set_custom_metadata_properties
432
+ # Set custom property metadata properties in Word DOCX document
433
+ # Sets the custom property metadata for the metadata properties in an Office Word Document (docx)
434
+ # @param input
435
+ # @param [Hash] opts the optional parameters
436
+ # @return [String]
437
+ describe 'edit_document_docx_set_custom_metadata_properties test' do
438
+ it 'should work' do
439
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
440
+ end
441
+ end
442
+
407
443
  # unit tests for edit_document_docx_set_footer
408
444
  # Set the footer in a Word DOCX document
409
445
  # Set the footer in a Word Document (DOCX). Call Finish Editing on the output URL to complete the operation.
@@ -488,6 +524,18 @@ describe 'EditDocumentApi' do
488
524
  end
489
525
  end
490
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
+
491
539
  # unit tests for edit_document_pptx_replace
492
540
  # Replace string in PowerPoint PPTX presentation
493
541
  # Replace all instances of a string in an Office PowerPoint Document (pptx)
@@ -644,6 +692,18 @@ describe 'EditDocumentApi' do
644
692
  end
645
693
  end
646
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
+
647
707
  # unit tests for edit_document_xlsx_get_rows_and_cells
648
708
  # Get rows and cells from a Excel XLSX spreadsheet, worksheet
649
709
  # Returns the rows and cells defined in the Excel Spreadsheet worksheet