cloudmersive-convert-api-client 2.1.0 → 2.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -4
  3. data/docs/ConvertDataApi.md +117 -3
  4. data/docs/ConvertDocumentApi.md +159 -0
  5. data/docs/DocxMetadataCustomProperty.md +13 -0
  6. data/docs/DocxSetCustomMetadataPropertiesRequest.md +10 -0
  7. data/docs/EditDocumentApi.md +110 -0
  8. data/docs/EditHtmlApi.md +60 -0
  9. data/docs/EditPdfApi.md +169 -0
  10. data/docs/GetDocxMetadataPropertiesResponse.md +16 -0
  11. data/docs/HtmlGetLinksResponse.md +9 -0
  12. data/docs/HtmlHyperlink.md +9 -0
  13. data/docs/HtmlSsrfThreatCheckResult.md +10 -0
  14. data/docs/HtmlThreatLink.md +9 -0
  15. data/docs/MergeDocumentApi.md +134 -0
  16. data/docs/ValidateDocumentApi.md +220 -0
  17. data/docs/ViewerToolsApi.md +8 -2
  18. data/lib/cloudmersive-convert-api-client.rb +7 -0
  19. data/lib/cloudmersive-convert-api-client/api/convert_data_api.rb +117 -4
  20. data/lib/cloudmersive-convert-api-client/api/convert_document_api.rb +156 -0
  21. data/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +109 -0
  22. data/lib/cloudmersive-convert-api-client/api/edit_html_api.rb +55 -0
  23. data/lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb +168 -0
  24. data/lib/cloudmersive-convert-api-client/api/merge_document_api.rb +148 -0
  25. data/lib/cloudmersive-convert-api-client/api/validate_document_api.rb +220 -0
  26. data/lib/cloudmersive-convert-api-client/api/viewer_tools_api.rb +6 -0
  27. data/lib/cloudmersive-convert-api-client/models/docx_metadata_custom_property.rb +236 -0
  28. data/lib/cloudmersive-convert-api-client/models/docx_set_custom_metadata_properties_request.rb +223 -0
  29. data/lib/cloudmersive-convert-api-client/models/get_docx_metadata_properties_response.rb +268 -0
  30. data/lib/cloudmersive-convert-api-client/models/html_get_links_response.rb +198 -0
  31. data/lib/cloudmersive-convert-api-client/models/html_hyperlink.rb +196 -0
  32. data/lib/cloudmersive-convert-api-client/models/html_ssrf_threat_check_result.rb +208 -0
  33. data/lib/cloudmersive-convert-api-client/models/html_threat_link.rb +196 -0
  34. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  35. data/spec/api/convert_data_api_spec.rb +26 -1
  36. data/spec/api/convert_document_api_spec.rb +35 -0
  37. data/spec/api/edit_document_api_spec.rb +24 -0
  38. data/spec/api/edit_html_api_spec.rb +14 -0
  39. data/spec/api/edit_pdf_api_spec.rb +37 -0
  40. data/spec/api/merge_document_api_spec.rb +34 -0
  41. data/spec/api/validate_document_api_spec.rb +48 -0
  42. data/spec/api/viewer_tools_api_spec.rb +2 -0
  43. data/spec/models/docx_metadata_custom_property_spec.rb +71 -0
  44. data/spec/models/docx_set_custom_metadata_properties_request_spec.rb +53 -0
  45. data/spec/models/get_docx_metadata_properties_response_spec.rb +89 -0
  46. data/spec/models/html_get_links_response_spec.rb +47 -0
  47. data/spec/models/html_hyperlink_spec.rb +47 -0
  48. data/spec/models/html_ssrf_threat_check_result_spec.rb +53 -0
  49. data/spec/models/html_threat_link_spec.rb +47 -0
  50. metadata +23 -2
@@ -0,0 +1,268 @@
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 running a DocxGetMetadataProperties command
17
+ class GetDocxMetadataPropertiesResponse
18
+ # Name of the Company that authored the document, if available
19
+ attr_accessor :company
20
+
21
+ # Name of the Manager that authored the document, if available
22
+ attr_accessor :manager
23
+
24
+ # Application version that authored the document, if available
25
+ attr_accessor :application_version
26
+
27
+ # Word count of the document
28
+ attr_accessor :word_count
29
+
30
+ # Line count of the document
31
+ attr_accessor :line_count
32
+
33
+ # Paragraph count of the document
34
+ attr_accessor :paragraph_count
35
+
36
+ # Page count of the document
37
+ attr_accessor :page_count
38
+
39
+ # Custom properties applied to the document
40
+ attr_accessor :custom_properties
41
+
42
+ # True if successful, false otherwise
43
+ attr_accessor :successful
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'company' => :'Company',
49
+ :'manager' => :'Manager',
50
+ :'application_version' => :'ApplicationVersion',
51
+ :'word_count' => :'WordCount',
52
+ :'line_count' => :'LineCount',
53
+ :'paragraph_count' => :'ParagraphCount',
54
+ :'page_count' => :'PageCount',
55
+ :'custom_properties' => :'CustomProperties',
56
+ :'successful' => :'Successful'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.swagger_types
62
+ {
63
+ :'company' => :'String',
64
+ :'manager' => :'String',
65
+ :'application_version' => :'String',
66
+ :'word_count' => :'Integer',
67
+ :'line_count' => :'Integer',
68
+ :'paragraph_count' => :'Integer',
69
+ :'page_count' => :'Integer',
70
+ :'custom_properties' => :'Array<DocxMetadataCustomProperty>',
71
+ :'successful' => :'BOOLEAN'
72
+ }
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ return unless attributes.is_a?(Hash)
79
+
80
+ # convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
82
+
83
+ if attributes.has_key?(:'Company')
84
+ self.company = attributes[:'Company']
85
+ end
86
+
87
+ if attributes.has_key?(:'Manager')
88
+ self.manager = attributes[:'Manager']
89
+ end
90
+
91
+ if attributes.has_key?(:'ApplicationVersion')
92
+ self.application_version = attributes[:'ApplicationVersion']
93
+ end
94
+
95
+ if attributes.has_key?(:'WordCount')
96
+ self.word_count = attributes[:'WordCount']
97
+ end
98
+
99
+ if attributes.has_key?(:'LineCount')
100
+ self.line_count = attributes[:'LineCount']
101
+ end
102
+
103
+ if attributes.has_key?(:'ParagraphCount')
104
+ self.paragraph_count = attributes[:'ParagraphCount']
105
+ end
106
+
107
+ if attributes.has_key?(:'PageCount')
108
+ self.page_count = attributes[:'PageCount']
109
+ end
110
+
111
+ if attributes.has_key?(:'CustomProperties')
112
+ if (value = attributes[:'CustomProperties']).is_a?(Array)
113
+ self.custom_properties = value
114
+ end
115
+ end
116
+
117
+ if attributes.has_key?(:'Successful')
118
+ self.successful = attributes[:'Successful']
119
+ end
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properties with the reasons
124
+ def list_invalid_properties
125
+ invalid_properties = Array.new
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ true
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ company == o.company &&
141
+ manager == o.manager &&
142
+ application_version == o.application_version &&
143
+ word_count == o.word_count &&
144
+ line_count == o.line_count &&
145
+ paragraph_count == o.paragraph_count &&
146
+ page_count == o.page_count &&
147
+ custom_properties == o.custom_properties &&
148
+ successful == o.successful
149
+ end
150
+
151
+ # @see the `==` method
152
+ # @param [Object] Object to be compared
153
+ def eql?(o)
154
+ self == o
155
+ end
156
+
157
+ # Calculates hash code according to all attributes.
158
+ # @return [Fixnum] Hash code
159
+ def hash
160
+ [company, manager, application_version, word_count, line_count, paragraph_count, page_count, custom_properties, successful].hash
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ self.class.swagger_types.each_pair do |key, type|
169
+ if type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the attribute
171
+ # is documented as an array but the input is not
172
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
173
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
174
+ end
175
+ elsif !attributes[self.class.attribute_map[key]].nil?
176
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
178
+ end
179
+
180
+ self
181
+ end
182
+
183
+ # Deserializes the data based on type
184
+ # @param string type Data type
185
+ # @param string value Value to be deserialized
186
+ # @return [Object] Deserialized data
187
+ def _deserialize(type, value)
188
+ case type.to_sym
189
+ when :DateTime
190
+ DateTime.parse(value)
191
+ when :Date
192
+ Date.parse(value)
193
+ when :String
194
+ value.to_s
195
+ when :Integer
196
+ value.to_i
197
+ when :Float
198
+ value.to_f
199
+ when :BOOLEAN
200
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
201
+ true
202
+ else
203
+ false
204
+ end
205
+ when :Object
206
+ # generic object (usually a Hash), return directly
207
+ value
208
+ when /\AArray<(?<inner_type>.+)>\z/
209
+ inner_type = Regexp.last_match[:inner_type]
210
+ value.map { |v| _deserialize(inner_type, v) }
211
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
212
+ k_type = Regexp.last_match[:k_type]
213
+ v_type = Regexp.last_match[:v_type]
214
+ {}.tap do |hash|
215
+ value.each do |k, v|
216
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
+ end
218
+ end
219
+ else # model
220
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
221
+ temp_model.build_from_hash(value)
222
+ end
223
+ end
224
+
225
+ # Returns the string representation of the object
226
+ # @return [String] String presentation of the object
227
+ def to_s
228
+ to_hash.to_s
229
+ end
230
+
231
+ # to_body is an alias to to_hash (backward compatibility)
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_body
234
+ to_hash
235
+ end
236
+
237
+ # Returns the object in the form of hash
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_hash
240
+ hash = {}
241
+ self.class.attribute_map.each_pair do |attr, param|
242
+ value = self.send(attr)
243
+ next if value.nil?
244
+ hash[param] = _to_hash(value)
245
+ end
246
+ hash
247
+ end
248
+
249
+ # Outputs non-array value in the form of hash
250
+ # For object, use to_hash. Otherwise, just return the value
251
+ # @param [Object] value Any valid value
252
+ # @return [Hash] Returns the value in the form of hash
253
+ def _to_hash(value)
254
+ if value.is_a?(Array)
255
+ value.compact.map { |v| _to_hash(v) }
256
+ elsif value.is_a?(Hash)
257
+ {}.tap do |hash|
258
+ value.each { |k, v| hash[k] = _to_hash(v) }
259
+ end
260
+ elsif value.respond_to? :to_hash
261
+ value.to_hash
262
+ else
263
+ value
264
+ end
265
+ end
266
+
267
+ end
268
+ end
@@ -0,0 +1,198 @@
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 extracting links from an HTML file
17
+ class HtmlGetLinksResponse
18
+ # True if the operation was successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # All hyperlinks in the HTML document
22
+ attr_accessor :links
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'successful' => :'Successful',
28
+ :'links' => :'Links'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'successful' => :'BOOLEAN',
36
+ :'links' => :'Array<HtmlHyperlink>'
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?(:'Links')
53
+ if (value = attributes[:'Links']).is_a?(Array)
54
+ self.links = value
55
+ end
56
+ end
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ invalid_properties
64
+ end
65
+
66
+ # Check to see if the all the properties in the model are valid
67
+ # @return true if the model is valid
68
+ def valid?
69
+ true
70
+ end
71
+
72
+ # Checks equality by comparing each attribute.
73
+ # @param [Object] Object to be compared
74
+ def ==(o)
75
+ return true if self.equal?(o)
76
+ self.class == o.class &&
77
+ successful == o.successful &&
78
+ links == o.links
79
+ end
80
+
81
+ # @see the `==` method
82
+ # @param [Object] Object to be compared
83
+ def eql?(o)
84
+ self == o
85
+ end
86
+
87
+ # Calculates hash code according to all attributes.
88
+ # @return [Fixnum] Hash code
89
+ def hash
90
+ [successful, links].hash
91
+ end
92
+
93
+ # Builds the object from hash
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ # @return [Object] Returns the model itself
96
+ def build_from_hash(attributes)
97
+ return nil unless attributes.is_a?(Hash)
98
+ self.class.swagger_types.each_pair do |key, type|
99
+ if type =~ /\AArray<(.*)>/i
100
+ # check to ensure the input is an array given that the attribute
101
+ # is documented as an array but the input is not
102
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
103
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
104
+ end
105
+ elsif !attributes[self.class.attribute_map[key]].nil?
106
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
107
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
108
+ end
109
+
110
+ self
111
+ end
112
+
113
+ # Deserializes the data based on type
114
+ # @param string type Data type
115
+ # @param string value Value to be deserialized
116
+ # @return [Object] Deserialized data
117
+ def _deserialize(type, value)
118
+ case type.to_sym
119
+ when :DateTime
120
+ DateTime.parse(value)
121
+ when :Date
122
+ Date.parse(value)
123
+ when :String
124
+ value.to_s
125
+ when :Integer
126
+ value.to_i
127
+ when :Float
128
+ value.to_f
129
+ when :BOOLEAN
130
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
131
+ true
132
+ else
133
+ false
134
+ end
135
+ when :Object
136
+ # generic object (usually a Hash), return directly
137
+ value
138
+ when /\AArray<(?<inner_type>.+)>\z/
139
+ inner_type = Regexp.last_match[:inner_type]
140
+ value.map { |v| _deserialize(inner_type, v) }
141
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
142
+ k_type = Regexp.last_match[:k_type]
143
+ v_type = Regexp.last_match[:v_type]
144
+ {}.tap do |hash|
145
+ value.each do |k, v|
146
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
147
+ end
148
+ end
149
+ else # model
150
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
151
+ temp_model.build_from_hash(value)
152
+ end
153
+ end
154
+
155
+ # Returns the string representation of the object
156
+ # @return [String] String presentation of the object
157
+ def to_s
158
+ to_hash.to_s
159
+ end
160
+
161
+ # to_body is an alias to to_hash (backward compatibility)
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_body
164
+ to_hash
165
+ end
166
+
167
+ # Returns the object in the form of hash
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_hash
170
+ hash = {}
171
+ self.class.attribute_map.each_pair do |attr, param|
172
+ value = self.send(attr)
173
+ next if value.nil?
174
+ hash[param] = _to_hash(value)
175
+ end
176
+ hash
177
+ end
178
+
179
+ # Outputs non-array value in the form of hash
180
+ # For object, use to_hash. Otherwise, just return the value
181
+ # @param [Object] value Any valid value
182
+ # @return [Hash] Returns the value in the form of hash
183
+ def _to_hash(value)
184
+ if value.is_a?(Array)
185
+ value.compact.map { |v| _to_hash(v) }
186
+ elsif value.is_a?(Hash)
187
+ {}.tap do |hash|
188
+ value.each { |k, v| hash[k] = _to_hash(v) }
189
+ end
190
+ elsif value.respond_to? :to_hash
191
+ value.to_hash
192
+ else
193
+ value
194
+ end
195
+ end
196
+
197
+ end
198
+ end