cloudmersive-convert-api-client 2.0.7 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -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 +330 -0
  8. data/docs/EditHtmlApi.md +81 -13
  9. data/docs/EditPdfApi.md +227 -0
  10. data/docs/GetDocxMetadataPropertiesResponse.md +16 -0
  11. data/docs/ValidateDocumentApi.md +165 -0
  12. data/docs/ViewerToolsApi.md +8 -2
  13. data/docs/ZipArchiveApi.md +80 -0
  14. data/lib/cloudmersive-convert-api-client.rb +3 -0
  15. data/lib/cloudmersive-convert-api-client/api/convert_data_api.rb +117 -4
  16. data/lib/cloudmersive-convert-api-client/api/convert_document_api.rb +156 -0
  17. data/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +329 -0
  18. data/lib/cloudmersive-convert-api-client/api/edit_html_api.rb +81 -12
  19. data/lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb +230 -0
  20. data/lib/cloudmersive-convert-api-client/api/validate_document_api.rb +165 -0
  21. data/lib/cloudmersive-convert-api-client/api/viewer_tools_api.rb +6 -0
  22. data/lib/cloudmersive-convert-api-client/api/zip_archive_api.rb +92 -0
  23. data/lib/cloudmersive-convert-api-client/models/docx_metadata_custom_property.rb +236 -0
  24. data/lib/cloudmersive-convert-api-client/models/docx_set_custom_metadata_properties_request.rb +223 -0
  25. data/lib/cloudmersive-convert-api-client/models/get_docx_metadata_properties_response.rb +268 -0
  26. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  27. data/spec/api/convert_data_api_spec.rb +26 -1
  28. data/spec/api/convert_document_api_spec.rb +35 -0
  29. data/spec/api/edit_document_api_spec.rb +72 -0
  30. data/spec/api/edit_html_api_spec.rb +24 -6
  31. data/spec/api/edit_pdf_api_spec.rb +50 -0
  32. data/spec/api/validate_document_api_spec.rb +36 -0
  33. data/spec/api/viewer_tools_api_spec.rb +2 -0
  34. data/spec/api/zip_archive_api_spec.rb +23 -0
  35. data/spec/models/docx_metadata_custom_property_spec.rb +71 -0
  36. data/spec/models/docx_set_custom_metadata_properties_request_spec.rb +53 -0
  37. data/spec/models/get_docx_metadata_properties_response_spec.rb +89 -0
  38. metadata +11 -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
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.14
11
11
  =end
12
12
 
13
13
  module CloudmersiveConvertApiClient
14
- VERSION = '2.0.7'
14
+ VERSION = '2.1.3'
15
15
  end
@@ -45,6 +45,19 @@ describe 'ConvertDataApi' do
45
45
  end
46
46
  end
47
47
 
48
+ # unit tests for convert_data_csv_to_xml
49
+ # Convert CSV to XML conversion
50
+ # Convert a CSV file to a XML file
51
+ # @param input_file Input file to perform the operation on.
52
+ # @param [Hash] opts the optional parameters
53
+ # @option opts [BOOLEAN] :column_names_from_first_row Optional; If true, the first row will be used as the labels for the columns; if false, columns will be named Column0, Column1, etc. Default is true. Set to false if you are not using column headings, or have an irregular column structure.
54
+ # @return [String]
55
+ describe 'convert_data_csv_to_xml test' do
56
+ it 'should work' do
57
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
58
+ end
59
+ end
60
+
48
61
  # unit tests for convert_data_json_to_xml
49
62
  # Convert JSON to XML conversion
50
63
  # Convert a JSON object into XML
@@ -74,13 +87,25 @@ describe 'ConvertDataApi' do
74
87
  # Convert an Excel XLSX file to a JSON object array
75
88
  # @param input_file Input file to perform the operation on.
76
89
  # @param [Hash] opts the optional parameters
77
- # @return [Object]
90
+ # @return [String]
78
91
  describe 'convert_data_xlsx_to_json test' do
79
92
  it 'should work' do
80
93
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
81
94
  end
82
95
  end
83
96
 
97
+ # unit tests for convert_data_xlsx_to_xml
98
+ # Convert Excel XLSX to XML conversion
99
+ # Convert an Excel XLSX file to a XML file
100
+ # @param input_file Input file to perform the operation on.
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [String]
103
+ describe 'convert_data_xlsx_to_xml test' do
104
+ it 'should work' do
105
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
106
+ end
107
+ end
108
+
84
109
  # unit tests for convert_data_xml_edit_add_attribute_with_x_path
85
110
  # Adds an attribute to all XML nodes matching XPath expression
86
111
  # Return the reuslts of editing an XML document by adding an attribute to all of the nodes that match an input XPath expression.
@@ -219,6 +219,18 @@ describe 'ConvertDocumentApi' do
219
219
  end
220
220
  end
221
221
 
222
+ # unit tests for convert_document_docx_to_doc
223
+ # Convert Word DOCX Document to Legacy Word DOC (97-03)
224
+ # Convert/downgrade modern Office Word DOCX Documents (DOCX) to the legacy Word DOC (97-2003 Format) format
225
+ # @param input_file Input file to perform the operation on.
226
+ # @param [Hash] opts the optional parameters
227
+ # @return [String]
228
+ describe 'convert_document_docx_to_doc test' do
229
+ it 'should work' do
230
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
231
+ end
232
+ end
233
+
222
234
  # unit tests for convert_document_docx_to_html
223
235
  # Convert Word DOCX Document to HTML Document
224
236
  # Convert Office Word Document (DOCX) to HTML Document
@@ -812,6 +824,17 @@ describe 'ConvertDocumentApi' do
812
824
  end
813
825
  end
814
826
 
827
+ # unit tests for convert_document_pptx_to_ppt
828
+ # Convert PowerPoint PPTX presentation to Legacy PowerPoint PPT (97-03)
829
+ # Convert/downgrade modern Office PowerPoint PPTX Presentation to the legacy PowerPoint PPT (97-2003 Format) format
830
+ # @param [Hash] opts the optional parameters
831
+ # @return [Object]
832
+ describe 'convert_document_pptx_to_ppt test' do
833
+ it 'should work' do
834
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
835
+ end
836
+ end
837
+
815
838
  # unit tests for convert_document_pptx_to_txt
816
839
  # Convert PowerPoint PPTX Presentation to Text (txt)
817
840
  # Convert Office PowerPoint Documents (pptx) to standard Text
@@ -995,4 +1018,16 @@ describe 'ConvertDocumentApi' do
995
1018
  end
996
1019
  end
997
1020
 
1021
+ # unit tests for convert_document_xlsx_to_xls
1022
+ # Convert Excel XLSX Spreadsheet to Legacy Excel XLS (97-03)
1023
+ # Convert/downgrade modern Office Excel XLSX Spreadsheet to the legacy Excel XLS (97-2003 Format) format
1024
+ # @param input_file Input file to perform the operation on.
1025
+ # @param [Hash] opts the optional parameters
1026
+ # @return [String]
1027
+ describe 'convert_document_xlsx_to_xls test' do
1028
+ it 'should work' do
1029
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
1030
+ end
1031
+ end
1032
+
998
1033
  end
@@ -44,6 +44,18 @@ describe 'EditDocumentApi' do
44
44
  end
45
45
  end
46
46
 
47
+ # unit tests for edit_document_docx_accept_all_track_changes
48
+ # Accept all tracked changes, revisions in a Word DOCX document
49
+ # Accepts all tracked changes and revisions in a Word DOCX document. This will accept all pending changes in the document when tracked changes is turned on. Track changes will remain on (if it is on) after this oepration is completed.
50
+ # @param input_file Input file to perform the operation on.
51
+ # @param [Hash] opts the optional parameters
52
+ # @return [String]
53
+ describe 'edit_document_docx_accept_all_track_changes test' 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
+
47
59
  # unit tests for edit_document_docx_body
48
60
  # Get body from a Word DOCX document
49
61
  # Returns the body defined in the Word Document (DOCX) format file; this is the main content part of a DOCX document
@@ -104,6 +116,30 @@ describe 'EditDocumentApi' do
104
116
  end
105
117
  end
106
118
 
119
+ # unit tests for edit_document_docx_disable_track_changes
120
+ # Disable track changes, revisions in a Word DOCX document
121
+ # Diables tracking of changes and revisions in a Word DOCX document, and accepts any pending changes. Users editing the document will no longer see changes tracked automatically.
122
+ # @param input_file Input file to perform the operation on.
123
+ # @param [Hash] opts the optional parameters
124
+ # @return [String]
125
+ describe 'edit_document_docx_disable_track_changes test' do
126
+ it 'should work' do
127
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
128
+ end
129
+ end
130
+
131
+ # unit tests for edit_document_docx_enable_track_changes
132
+ # Enable track changes, revisions in a Word DOCX document
133
+ # Enables tracking of changes and revisions in a Word DOCX document. Users editing the document will see changes tracked automatically, with edits highlighted, and the ability to accept or reject changes made to the document.
134
+ # @param input_file Input file to perform the operation on.
135
+ # @param [Hash] opts the optional parameters
136
+ # @return [String]
137
+ describe 'edit_document_docx_enable_track_changes test' do
138
+ it 'should work' do
139
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
140
+ end
141
+ end
142
+
107
143
  # unit tests for edit_document_docx_find_paragraph
108
144
  # Find matching paragraphs in a Word DOCX document
109
145
  # Returns the paragraphs defined in the Word Document (DOCX) format file that match the input criteria
@@ -164,6 +200,18 @@ describe 'EditDocumentApi' do
164
200
  end
165
201
  end
166
202
 
203
+ # unit tests for edit_document_docx_get_metadata_properties
204
+ # Get all metadata properties in Word DOCX document
205
+ # Returns all the metadata properties in an Office Word Document (docx)
206
+ # @param input_file Input file to perform the operation on.
207
+ # @param [Hash] opts the optional parameters
208
+ # @return [GetDocxMetadataPropertiesResponse]
209
+ describe 'edit_document_docx_get_metadata_properties 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
+
167
215
  # unit tests for edit_document_docx_get_sections
168
216
  # Get sections from a Word DOCX document
169
217
  # Returns the sections defined in the Word Document (DOCX) format file
@@ -296,6 +344,18 @@ describe 'EditDocumentApi' do
296
344
  end
297
345
  end
298
346
 
347
+ # unit tests for edit_document_docx_remove_all_comments
348
+ # Remove all comments from a Word DOCX document
349
+ # Removes all of the comments from a Word Document.
350
+ # @param input_file Input file to perform the operation on.
351
+ # @param [Hash] opts the optional parameters
352
+ # @return [String]
353
+ describe 'edit_document_docx_remove_all_comments test' do
354
+ it 'should work' do
355
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
356
+ end
357
+ end
358
+
299
359
  # unit tests for edit_document_docx_remove_headers_and_footers
300
360
  # Remove headers and footers from Word DOCX document
301
361
  # Remove all headers, or footers, or both from a Word Document (DOCX). Call Finish Editing on the output URL to complete the operation.
@@ -356,6 +416,18 @@ describe 'EditDocumentApi' do
356
416
  end
357
417
  end
358
418
 
419
+ # unit tests for edit_document_docx_set_custom_metadata_properties
420
+ # Set custom property metadata properties in Word DOCX document
421
+ # Sets the custom property metadata for the metadata properties in an Office Word Document (docx)
422
+ # @param input
423
+ # @param [Hash] opts the optional parameters
424
+ # @return [String]
425
+ describe 'edit_document_docx_set_custom_metadata_properties test' do
426
+ it 'should work' do
427
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
428
+ end
429
+ end
430
+
359
431
  # unit tests for edit_document_docx_set_footer
360
432
  # Set the footer in a Word DOCX document
361
433
  # Set the footer in a Word Document (DOCX). Call Finish Editing on the output URL to complete the operation.