cloudmersive-convert-api-client 1.7.3 → 1.7.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +45 -5
  3. data/docs/AutodetectToThumbnailsResult.md +9 -0
  4. data/docs/ConvertDataApi.md +6 -2
  5. data/docs/ConvertDocumentApi.md +794 -84
  6. data/docs/CsvCollection.md +10 -0
  7. data/docs/CsvFileResult.md +9 -0
  8. data/docs/DocumentValidationResult.md +1 -0
  9. data/docs/DocxParagraph.md +1 -1
  10. data/docs/DocxRun.md +1 -1
  11. data/docs/DocxText.md +1 -1
  12. data/docs/DocxToPngResult.md +9 -0
  13. data/docs/EditDocumentApi.md +110 -0
  14. data/docs/EmlAttachment.md +9 -0
  15. data/docs/EmlToHtmlResult.md +16 -0
  16. data/docs/FindDocxParagraphRequest.md +11 -0
  17. data/docs/FindDocxParagraphResponse.md +10 -0
  18. data/docs/GetFileTypeIconResult.md +10 -0
  19. data/docs/MsgAttachment.md +9 -0
  20. data/docs/MsgToHtmlResult.md +16 -0
  21. data/docs/PptxToPngResult.md +9 -0
  22. data/docs/ReplaceDocxParagraphRequest.md +12 -0
  23. data/docs/ReplaceDocxParagraphResponse.md +9 -0
  24. data/docs/Thumbnail.md +9 -0
  25. data/docs/ValidateDocumentApi.md +386 -1
  26. data/docs/XlsxToPngResult.md +9 -0
  27. data/docs/ZipArchiveApi.md +144 -5
  28. data/docs/ZipEncryptionAdvancedRequest.md +10 -0
  29. data/lib/cloudmersive-convert-api-client.rb +17 -0
  30. data/lib/cloudmersive-convert-api-client/api/convert_data_api.rb +3 -0
  31. data/lib/cloudmersive-convert-api-client/api/convert_document_api.rb +722 -6
  32. data/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +110 -0
  33. data/lib/cloudmersive-convert-api-client/api/validate_document_api.rb +394 -2
  34. data/lib/cloudmersive-convert-api-client/api/zip_archive_api.rb +160 -6
  35. data/lib/cloudmersive-convert-api-client/models/autodetect_to_thumbnails_result.rb +201 -0
  36. data/lib/cloudmersive-convert-api-client/models/csv_collection.rb +211 -0
  37. data/lib/cloudmersive-convert-api-client/models/csv_file_result.rb +215 -0
  38. data/lib/cloudmersive-convert-api-client/models/document_validation_result.rb +11 -1
  39. data/lib/cloudmersive-convert-api-client/models/docx_paragraph.rb +1 -1
  40. data/lib/cloudmersive-convert-api-client/models/docx_run.rb +1 -1
  41. data/lib/cloudmersive-convert-api-client/models/docx_text.rb +1 -1
  42. data/lib/cloudmersive-convert-api-client/models/docx_to_png_result.rb +201 -0
  43. data/lib/cloudmersive-convert-api-client/models/eml_attachment.rb +215 -0
  44. data/lib/cloudmersive-convert-api-client/models/eml_to_html_result.rb +271 -0
  45. data/lib/cloudmersive-convert-api-client/models/find_docx_paragraph_request.rb +235 -0
  46. data/lib/cloudmersive-convert-api-client/models/find_docx_paragraph_response.rb +211 -0
  47. data/lib/cloudmersive-convert-api-client/models/get_file_type_icon_result.rb +225 -0
  48. data/lib/cloudmersive-convert-api-client/models/msg_attachment.rb +215 -0
  49. data/lib/cloudmersive-convert-api-client/models/msg_to_html_result.rb +271 -0
  50. data/lib/cloudmersive-convert-api-client/models/pptx_to_png_result.rb +201 -0
  51. data/lib/cloudmersive-convert-api-client/models/replace_docx_paragraph_request.rb +245 -0
  52. data/lib/cloudmersive-convert-api-client/models/replace_docx_paragraph_response.rb +199 -0
  53. data/lib/cloudmersive-convert-api-client/models/thumbnail.rb +215 -0
  54. data/lib/cloudmersive-convert-api-client/models/xlsx_to_png_result.rb +201 -0
  55. data/lib/cloudmersive-convert-api-client/models/zip_encryption_advanced_request.rb +225 -0
  56. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  57. data/spec/api/convert_data_api_spec.rb +1 -0
  58. data/spec/api/convert_document_api_spec.rb +163 -3
  59. data/spec/api/edit_document_api_spec.rb +24 -0
  60. data/spec/api/validate_document_api_spec.rb +85 -1
  61. data/spec/api/zip_archive_api_spec.rb +36 -1
  62. data/spec/models/autodetect_to_thumbnails_result_spec.rb +48 -0
  63. data/spec/models/csv_collection_spec.rb +54 -0
  64. data/spec/models/csv_file_result_spec.rb +48 -0
  65. data/spec/models/document_validation_result_spec.rb +6 -0
  66. data/spec/models/docx_to_png_result_spec.rb +48 -0
  67. data/spec/models/eml_attachment_spec.rb +48 -0
  68. data/spec/models/eml_to_html_result_spec.rb +90 -0
  69. data/spec/models/find_docx_paragraph_request_spec.rb +60 -0
  70. data/spec/models/find_docx_paragraph_response_spec.rb +54 -0
  71. data/spec/models/get_file_type_icon_result_spec.rb +54 -0
  72. data/spec/models/msg_attachment_spec.rb +48 -0
  73. data/spec/models/msg_to_html_result_spec.rb +90 -0
  74. data/spec/models/pptx_to_png_result_spec.rb +48 -0
  75. data/spec/models/replace_docx_paragraph_request_spec.rb +66 -0
  76. data/spec/models/replace_docx_paragraph_response_spec.rb +48 -0
  77. data/spec/models/thumbnail_spec.rb +48 -0
  78. data/spec/models/xlsx_to_png_result_spec.rb +48 -0
  79. data/spec/models/zip_encryption_advanced_request_spec.rb +54 -0
  80. metadata +53 -2
@@ -0,0 +1,215 @@
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
+ # An MSG file attachment
17
+ class MsgAttachment
18
+ # Name of the attachment, including file extension
19
+ attr_accessor :name
20
+
21
+ # The MSG attachment as a byte[]
22
+ attr_accessor :content
23
+
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'name' => :'Name',
29
+ :'content' => :'Content'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.swagger_types
35
+ {
36
+ :'name' => :'String',
37
+ :'content' => :'String'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
+
49
+ if attributes.has_key?(:'Name')
50
+ self.name = attributes[:'Name']
51
+ end
52
+
53
+ if attributes.has_key?(:'Content')
54
+ self.content = attributes[:'Content']
55
+ end
56
+
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
+ if !@content.nil? && @content !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
64
+ invalid_properties.push("invalid value for 'content', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.")
65
+ end
66
+
67
+ return invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ return false if !@content.nil? && @content !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
74
+ return true
75
+ end
76
+
77
+ # Custom attribute writer method with validation
78
+ # @param [Object] content Value to be assigned
79
+ def content=(content)
80
+
81
+ if !content.nil? && content !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
82
+ fail ArgumentError, "invalid value for 'content', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."
83
+ end
84
+
85
+ @content = content
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ name == o.name &&
94
+ content == o.content
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Fixnum] Hash code
105
+ def hash
106
+ [name, content].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.swagger_types.each_pair do |key, type|
115
+ if type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :DateTime
136
+ DateTime.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :BOOLEAN
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
167
+ temp_model.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ next if value.nil?
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map{ |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+
213
+ end
214
+
215
+ end
@@ -0,0 +1,271 @@
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
+ # Result of converting an MSG file to HTML string
17
+ class MsgToHtmlResult
18
+ # True if the operation was successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # An HTML string version of the MSG file
22
+ attr_accessor :content
23
+
24
+ # The main body of the MSG file's email as an HTML string
25
+ attr_accessor :body
26
+
27
+ # The From sender of the MSG file's email
28
+ attr_accessor :from
29
+
30
+ # The To recipients of the MSG file's email
31
+ attr_accessor :to
32
+
33
+ # The CC recipients of the MSG file's email
34
+ attr_accessor :cc
35
+
36
+ # The time that the MSG file's email was received
37
+ attr_accessor :received_time
38
+
39
+ # The subject of the MSG file's email
40
+ attr_accessor :subject
41
+
42
+ # List of all attachments for the MSG file
43
+ attr_accessor :attachments
44
+
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'successful' => :'Successful',
50
+ :'content' => :'Content',
51
+ :'body' => :'Body',
52
+ :'from' => :'From',
53
+ :'to' => :'To',
54
+ :'cc' => :'Cc',
55
+ :'received_time' => :'ReceivedTime',
56
+ :'subject' => :'Subject',
57
+ :'attachments' => :'Attachments'
58
+ }
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.swagger_types
63
+ {
64
+ :'successful' => :'BOOLEAN',
65
+ :'content' => :'String',
66
+ :'body' => :'String',
67
+ :'from' => :'String',
68
+ :'to' => :'String',
69
+ :'cc' => :'String',
70
+ :'received_time' => :'String',
71
+ :'subject' => :'String',
72
+ :'attachments' => :'Array<MsgAttachment>'
73
+ }
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ return unless attributes.is_a?(Hash)
80
+
81
+ # convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
83
+
84
+ if attributes.has_key?(:'Successful')
85
+ self.successful = attributes[:'Successful']
86
+ end
87
+
88
+ if attributes.has_key?(:'Content')
89
+ self.content = attributes[:'Content']
90
+ end
91
+
92
+ if attributes.has_key?(:'Body')
93
+ self.body = attributes[:'Body']
94
+ end
95
+
96
+ if attributes.has_key?(:'From')
97
+ self.from = attributes[:'From']
98
+ end
99
+
100
+ if attributes.has_key?(:'To')
101
+ self.to = attributes[:'To']
102
+ end
103
+
104
+ if attributes.has_key?(:'Cc')
105
+ self.cc = attributes[:'Cc']
106
+ end
107
+
108
+ if attributes.has_key?(:'ReceivedTime')
109
+ self.received_time = attributes[:'ReceivedTime']
110
+ end
111
+
112
+ if attributes.has_key?(:'Subject')
113
+ self.subject = attributes[:'Subject']
114
+ end
115
+
116
+ if attributes.has_key?(:'Attachments')
117
+ if (value = attributes[:'Attachments']).is_a?(Array)
118
+ self.attachments = value
119
+ end
120
+ end
121
+
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ invalid_properties = Array.new
128
+ return invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ return true
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ successful == o.successful &&
143
+ content == o.content &&
144
+ body == o.body &&
145
+ from == o.from &&
146
+ to == o.to &&
147
+ cc == o.cc &&
148
+ received_time == o.received_time &&
149
+ subject == o.subject &&
150
+ attachments == o.attachments
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Fixnum] Hash code
161
+ def hash
162
+ [successful, content, body, from, to, cc, received_time, subject, attachments].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ self.class.swagger_types.each_pair do |key, type|
171
+ if type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
175
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
176
+ end
177
+ elsif !attributes[self.class.attribute_map[key]].nil?
178
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
179
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
180
+ end
181
+
182
+ self
183
+ end
184
+
185
+ # Deserializes the data based on type
186
+ # @param string type Data type
187
+ # @param string value Value to be deserialized
188
+ # @return [Object] Deserialized data
189
+ def _deserialize(type, value)
190
+ case type.to_sym
191
+ when :DateTime
192
+ DateTime.parse(value)
193
+ when :Date
194
+ Date.parse(value)
195
+ when :String
196
+ value.to_s
197
+ when :Integer
198
+ value.to_i
199
+ when :Float
200
+ value.to_f
201
+ when :BOOLEAN
202
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
203
+ true
204
+ else
205
+ false
206
+ end
207
+ when :Object
208
+ # generic object (usually a Hash), return directly
209
+ value
210
+ when /\AArray<(?<inner_type>.+)>\z/
211
+ inner_type = Regexp.last_match[:inner_type]
212
+ value.map { |v| _deserialize(inner_type, v) }
213
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
214
+ k_type = Regexp.last_match[:k_type]
215
+ v_type = Regexp.last_match[:v_type]
216
+ {}.tap do |hash|
217
+ value.each do |k, v|
218
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
219
+ end
220
+ end
221
+ else # model
222
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
223
+ temp_model.build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ next if value.nil?
246
+ hash[param] = _to_hash(value)
247
+ end
248
+ hash
249
+ end
250
+
251
+ # Outputs non-array value in the form of hash
252
+ # For object, use to_hash. Otherwise, just return the value
253
+ # @param [Object] value Any valid value
254
+ # @return [Hash] Returns the value in the form of hash
255
+ def _to_hash(value)
256
+ if value.is_a?(Array)
257
+ value.compact.map{ |v| _to_hash(v) }
258
+ elsif value.is_a?(Hash)
259
+ {}.tap do |hash|
260
+ value.each { |k, v| hash[k] = _to_hash(v) }
261
+ end
262
+ elsif value.respond_to? :to_hash
263
+ value.to_hash
264
+ else
265
+ value
266
+ end
267
+ end
268
+
269
+ end
270
+
271
+ end