cloudmersive-convert-api-client 2.1.8 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -7
  3. data/docs/DocumentEditingEditSession.md +9 -0
  4. data/docs/DocumentTransformEditSession.md +9 -0
  5. data/docs/DocxTableTableFillRequest.md +12 -0
  6. data/docs/DocxTableTableFillTableCell.md +9 -0
  7. data/docs/DocxTableTableFillTableRow.md +8 -0
  8. data/docs/EditDocumentApi.md +58 -3
  9. data/docs/EditHtmlApi.md +418 -0
  10. data/docs/EditPdfApi.md +6 -2
  11. data/docs/HtmlGetLanguageResult.md +9 -0
  12. data/docs/HtmlGetRelCanonicalUrlResult.md +9 -0
  13. data/docs/HtmlGetSitemapUrlResult.md +9 -0
  14. data/docs/MergeDocumentApi.md +2 -2
  15. data/docs/TransformDocumentApi.md +182 -6
  16. data/lib/cloudmersive-convert-api-client.rb +8 -0
  17. data/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +56 -2
  18. data/lib/cloudmersive-convert-api-client/api/edit_html_api.rb +392 -0
  19. data/lib/cloudmersive-convert-api-client/api/edit_pdf_api.rb +3 -0
  20. data/lib/cloudmersive-convert-api-client/api/merge_document_api.rb +3 -3
  21. data/lib/cloudmersive-convert-api-client/api/transform_document_api.rb +181 -4
  22. data/lib/cloudmersive-convert-api-client/models/document_editing_edit_session.rb +196 -0
  23. data/lib/cloudmersive-convert-api-client/models/document_transform_edit_session.rb +196 -0
  24. data/lib/cloudmersive-convert-api-client/models/docx_table_table_fill_request.rb +243 -0
  25. data/lib/cloudmersive-convert-api-client/models/docx_table_table_fill_table_cell.rb +196 -0
  26. data/lib/cloudmersive-convert-api-client/models/docx_table_table_fill_table_row.rb +188 -0
  27. data/lib/cloudmersive-convert-api-client/models/html_get_language_result.rb +196 -0
  28. data/lib/cloudmersive-convert-api-client/models/html_get_rel_canonical_url_result.rb +196 -0
  29. data/lib/cloudmersive-convert-api-client/models/html_get_sitemap_url_result.rb +196 -0
  30. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  31. data/spec/api/edit_document_api_spec.rb +13 -1
  32. data/spec/api/edit_html_api_spec.rb +95 -0
  33. data/spec/api/edit_pdf_api_spec.rb +1 -0
  34. data/spec/api/merge_document_api_spec.rb +1 -1
  35. data/spec/api/transform_document_api_spec.rb +42 -2
  36. data/spec/models/document_editing_edit_session_spec.rb +47 -0
  37. data/spec/models/document_transform_edit_session_spec.rb +47 -0
  38. data/spec/models/docx_table_table_fill_request_spec.rb +65 -0
  39. data/spec/models/docx_table_table_fill_table_cell_spec.rb +47 -0
  40. data/spec/models/docx_table_table_fill_table_row_spec.rb +41 -0
  41. data/spec/models/html_get_language_result_spec.rb +47 -0
  42. data/spec/models/html_get_rel_canonical_url_result_spec.rb +47 -0
  43. data/spec/models/html_get_sitemap_url_result_spec.rb +47 -0
  44. metadata +26 -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 getting the sitemap URL of the input HTML document
17
+ class HtmlGetSitemapUrlResult
18
+ # True if the operation was successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # HTML sitemap URL if present
22
+ attr_accessor :canonical_url
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'successful' => :'Successful',
28
+ :'canonical_url' => :'CanonicalUrl'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'successful' => :'BOOLEAN',
36
+ :'canonical_url' => :'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?(:'Successful')
49
+ self.successful = attributes[:'Successful']
50
+ end
51
+
52
+ if attributes.has_key?(:'CanonicalUrl')
53
+ self.canonical_url = attributes[:'CanonicalUrl']
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
+ canonical_url == o.canonical_url
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, canonical_url].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.8'
14
+ VERSION = '2.2.2'
15
15
  end
@@ -405,7 +405,7 @@ describe 'EditDocumentApi' do
405
405
  end
406
406
 
407
407
  # unit tests for edit_document_docx_replace_multi
408
- # Replace multiple strings in Word DOCX document
408
+ # Replace multiple strings in Word DOCX document, return result
409
409
  # Replace all instances of multiple strings in an Office Word Document (docx)
410
410
  # @param req_config Document string replacement configuration input
411
411
  # @param [Hash] opts the optional parameters
@@ -416,6 +416,18 @@ describe 'EditDocumentApi' do
416
416
  end
417
417
  end
418
418
 
419
+ # unit tests for edit_document_docx_replace_multi_edit_session
420
+ # Replace multiple strings in Word DOCX document, return edit session
421
+ # Replace all instances of multiple strings in an Office Word Document (docx). Returns an edit session URL so that you can chain together multiple edit operations without having to send the entire document contents back and forth multiple times. Call the Finish Editing API to retrieve the final document once editing is complete.
422
+ # @param req_config Document string replacement configuration input
423
+ # @param [Hash] opts the optional parameters
424
+ # @return [DocumentEditingEditSession]
425
+ describe 'edit_document_docx_replace_multi_edit_session 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
+
419
431
  # unit tests for edit_document_docx_replace_paragraph
420
432
  # Replace matching paragraphs in a Word DOCX document
421
433
  # Returns the edited Word Document (DOCX) format file with the matching paragraphs replaced as requested. Replace a paragraph with another object such as an image. Useful for performing templating operations.
@@ -32,6 +32,20 @@ describe 'EditHtmlApi' do
32
32
  end
33
33
  end
34
34
 
35
+ # unit tests for edit_html_html_append_header_tag
36
+ # Append an HTML tag to the HEAD section of an HTML Document
37
+ # Appends an HTML tag to the HEAD section of an HTML document.
38
+ # @param html_tag The HTML tag to append.
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [File] :input_file Optional: Input file to perform the operation on.
41
+ # @option opts [String] :input_file_url Optional: URL of a file to operate on as input.
42
+ # @return [String]
43
+ describe 'edit_html_html_append_header_tag test' do
44
+ it 'should work' do
45
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
46
+ end
47
+ end
48
+
35
49
  # unit tests for edit_html_html_append_heading
36
50
  # Append a Heading to an HTML Document
37
51
  # Appends a heading to the end of an HTML document.
@@ -111,6 +125,19 @@ describe 'EditHtmlApi' do
111
125
  end
112
126
  end
113
127
 
128
+ # unit tests for edit_html_html_get_language
129
+ # Gets the language for the HTML document
130
+ # Retrieves the language code (e.g. \&quot;en\&quot; or \&quot;de\&quot;) of an HTML document.
131
+ # @param [Hash] opts the optional parameters
132
+ # @option opts [File] :input_file Optional: Input file to perform the operation on.
133
+ # @option opts [String] :input_file_url Optional: URL of a file to operate on as input.
134
+ # @return [HtmlGetLanguageResult]
135
+ describe 'edit_html_html_get_language test' do
136
+ it 'should work' do
137
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
138
+ end
139
+ end
140
+
114
141
  # unit tests for edit_html_html_get_links
115
142
  # Extract resolved link URLs from HTML File
116
143
  # Extracts the resolved link URLs, fully-qualified if possible, from an input HTML file.
@@ -125,4 +152,72 @@ describe 'EditHtmlApi' do
125
152
  end
126
153
  end
127
154
 
155
+ # unit tests for edit_html_html_get_rel_canonical
156
+ # Gets the rel canonical URL for the HTML document
157
+ # Gets the rel canonical URL of an HTML document.
158
+ # @param [Hash] opts the optional parameters
159
+ # @option opts [File] :input_file Optional: Input file to perform the operation on.
160
+ # @option opts [String] :input_file_url Optional: URL of a file to operate on as input.
161
+ # @return [HtmlGetRelCanonicalUrlResult]
162
+ describe 'edit_html_html_get_rel_canonical test' do
163
+ it 'should work' do
164
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
165
+ end
166
+ end
167
+
168
+ # unit tests for edit_html_html_get_sitemap
169
+ # Gets the sitemap URL for the HTML document
170
+ # Gets the sitemap link URL of an HTML document.
171
+ # @param [Hash] opts the optional parameters
172
+ # @option opts [File] :input_file Optional: Input file to perform the operation on.
173
+ # @option opts [String] :input_file_url Optional: URL of a file to operate on as input.
174
+ # @return [HtmlGetSitemapUrlResult]
175
+ describe 'edit_html_html_get_sitemap test' do
176
+ it 'should work' do
177
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
178
+ end
179
+ end
180
+
181
+ # unit tests for edit_html_html_set_language
182
+ # Sets the language for the HTML document
183
+ # Sets the language code of an HTML document.
184
+ # @param language_code The HTML langauge code to set.
185
+ # @param [Hash] opts the optional parameters
186
+ # @option opts [File] :input_file Optional: Input file to perform the operation on.
187
+ # @option opts [String] :input_file_url Optional: URL of a file to operate on as input.
188
+ # @return [String]
189
+ describe 'edit_html_html_set_language test' do
190
+ it 'should work' do
191
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
192
+ end
193
+ end
194
+
195
+ # unit tests for edit_html_html_set_rel_canonical
196
+ # Sets the rel canonical URL for the HTML document
197
+ # Sets the rel canonical URL of an HTML document. This is useful for telling search engines and other indexers which pages are duplicates of eachother; any pages with the rel&#x3D;canonical tag will be treated as duplicates of the canonical URL.
198
+ # @param canonical_url The HTML canonical URL to set.
199
+ # @param [Hash] opts the optional parameters
200
+ # @option opts [File] :input_file Optional: Input file to perform the operation on.
201
+ # @option opts [String] :input_file_url Optional: URL of a file to operate on as input.
202
+ # @return [String]
203
+ describe 'edit_html_html_set_rel_canonical test' do
204
+ it 'should work' do
205
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
206
+ end
207
+ end
208
+
209
+ # unit tests for edit_html_html_set_sitemap_url
210
+ # Sets the sitemap URL for the HTML document
211
+ # Sets the sitemap URL of an HTML document.
212
+ # @param sitemap_url The HTML sitemap URL to set.
213
+ # @param [Hash] opts the optional parameters
214
+ # @option opts [File] :input_file Optional: Input file to perform the operation on.
215
+ # @option opts [String] :input_file_url Optional: URL of a file to operate on as input.
216
+ # @return [String]
217
+ describe 'edit_html_html_set_sitemap_url test' do
218
+ it 'should work' do
219
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
220
+ end
221
+ end
222
+
128
223
  end
@@ -193,6 +193,7 @@ describe 'EditPdfApi' do
193
193
  # Reduces the file size and optimizes the content of a PDF to minimize its file size.
194
194
  # @param input_file Input file to perform the operation on.
195
195
  # @param [Hash] opts the optional parameters
196
+ # @option opts [Float] :quality Quality level for the images in the PDF, ranging from 0.0 (low quality) to 1.0 (high quality); default is 0.3
196
197
  # @return [String]
197
198
  describe 'edit_pdf_reduce_file_size test' do
198
199
  it 'should work' do
@@ -72,7 +72,7 @@ describe 'MergeDocumentApi' do
72
72
  # @param input_file1 First input file to perform the operation on.
73
73
  # @param input_file2 Second input file to perform the operation on (more than 2 can be supplied).
74
74
  # @param [Hash] opts the optional parameters
75
- # @return [Object]
75
+ # @return [String]
76
76
  describe 'merge_document_html test' do
77
77
  it 'should work' do
78
78
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -33,7 +33,7 @@ describe 'TransformDocumentApi' do
33
33
  end
34
34
 
35
35
  # unit tests for transform_document_docx_replace
36
- # Replace string in Word DOCX document
36
+ # Replace string in Word DOCX document, return result
37
37
  # Replace all instances of a string in an Office Word Document (docx)
38
38
  # @param match_string String to search for and match against, to be replaced
39
39
  # @param replace_string String to replace the matched values with
@@ -48,8 +48,48 @@ describe 'TransformDocumentApi' do
48
48
  end
49
49
  end
50
50
 
51
+ # unit tests for transform_document_docx_replace_edit_session
52
+ # Replace string in Word DOCX document, return edit session
53
+ # Replace all instances of a string in an Office Word Document (docx). Returns an edit session URL so that you can chain together multiple edit operations without having to send the entire document contents back and forth multiple times. Call the Finish Editing API to retrieve the final document once editing is complete.
54
+ # @param match_string String to search for and match against, to be replaced
55
+ # @param replace_string String to replace the matched values with
56
+ # @param [Hash] opts the optional parameters
57
+ # @option opts [File] :input_file Optional: Input file to perform the operation on.
58
+ # @option opts [String] :input_file_url Optional: URL of a file to operate on as input. This can be a public URL, or you can also use the begin-editing API (part of EditDocumentApi) to upload a document and pass in the secure URL result from that operation as the URL here (this URL is not public).
59
+ # @option opts [BOOLEAN] :match_case Optional: True if the case should be matched, false for case insensitive match. Default is false.
60
+ # @return [DocumentTransformEditSession]
61
+ describe 'transform_document_docx_replace_edit_session test' do
62
+ it 'should work' do
63
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
64
+ end
65
+ end
66
+
67
+ # unit tests for transform_document_docx_table_fill_in
68
+ # Fill in data in a table in a Word DOCX document, return result
69
+ # Replace placeholder rows ina table in an Office Word Document (docx) using one or more templates
70
+ # @param request
71
+ # @param [Hash] opts the optional parameters
72
+ # @return [String]
73
+ describe 'transform_document_docx_table_fill_in test' do
74
+ it 'should work' do
75
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
76
+ end
77
+ end
78
+
79
+ # unit tests for transform_document_docx_table_fill_in_edit_session
80
+ # Fill in data in a table in a Word DOCX document, return edit session
81
+ # Replace placeholder rows ina table in an Office Word Document (docx) using one or more templates. Returns an edit session URL so that you can chain together multiple edit operations without having to send the entire document contents back and forth multiple times. Call the Finish Editing API to retrieve the final document once editing is complete.
82
+ # @param request
83
+ # @param [Hash] opts the optional parameters
84
+ # @return [DocumentTransformEditSession]
85
+ describe 'transform_document_docx_table_fill_in_edit_session test' do
86
+ it 'should work' do
87
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
88
+ end
89
+ end
90
+
51
91
  # unit tests for transform_document_pptx_replace
52
- # Replace string in PowerPoint PPTX presentation
92
+ # Replace string in PowerPoint PPTX presentation, return result
53
93
  # Replace all instances of a string in an Office PowerPoint Document (pptx)
54
94
  # @param match_string String to search for and match against, to be replaced
55
95
  # @param replace_string String to replace the matched values with
@@ -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::DocumentEditingEditSession
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'DocumentEditingEditSession' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveConvertApiClient::DocumentEditingEditSession.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of DocumentEditingEditSession' do
31
+ it 'should create an instance of DocumentEditingEditSession' do
32
+ expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::DocumentEditingEditSession)
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 "edit_session_url"' 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