cloudmersive-convert-api-client 1.6.5 → 1.6.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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -4
  3. data/docs/DocxComment.md +16 -0
  4. data/docs/DocxInsertCommentOnParagraphRequest.md +11 -0
  5. data/docs/DocxTopLevelComment.md +14 -0
  6. data/docs/EditDocumentApi.md +165 -0
  7. data/docs/GetDocxCommentsHierarchicalResponse.md +10 -0
  8. data/docs/GetDocxCommentsResponse.md +10 -0
  9. data/docs/GetDocxGetCommentsHierarchicalRequest.md +9 -0
  10. data/docs/GetDocxGetCommentsRequest.md +9 -0
  11. data/docs/GetDocxPagesResponse.md +3 -3
  12. data/docs/InsertDocxCommentOnParagraphResponse.md +9 -0
  13. data/lib/cloudmersive-convert-api-client.rb +8 -0
  14. data/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +165 -0
  15. data/lib/cloudmersive-convert-api-client/models/docx_comment.rb +269 -0
  16. data/lib/cloudmersive-convert-api-client/models/docx_insert_comment_on_paragraph_request.rb +235 -0
  17. data/lib/cloudmersive-convert-api-client/models/docx_page.rb +1 -1
  18. data/lib/cloudmersive-convert-api-client/models/docx_top_level_comment.rb +251 -0
  19. data/lib/cloudmersive-convert-api-client/models/get_docx_comments_hierarchical_response.rb +211 -0
  20. data/lib/cloudmersive-convert-api-client/models/get_docx_comments_response.rb +211 -0
  21. data/lib/cloudmersive-convert-api-client/models/get_docx_get_comments_hierarchical_request.rb +215 -0
  22. data/lib/cloudmersive-convert-api-client/models/get_docx_get_comments_request.rb +215 -0
  23. data/lib/cloudmersive-convert-api-client/models/get_docx_pages_response.rb +4 -1
  24. data/lib/cloudmersive-convert-api-client/models/insert_docx_comment_on_paragraph_response.rb +199 -0
  25. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  26. data/spec/api/edit_document_api_spec.rb +36 -0
  27. data/spec/models/docx_comment_spec.rb +90 -0
  28. data/spec/models/docx_insert_comment_on_paragraph_request_spec.rb +60 -0
  29. data/spec/models/docx_top_level_comment_spec.rb +78 -0
  30. data/spec/models/get_docx_comments_hierarchical_response_spec.rb +54 -0
  31. data/spec/models/get_docx_comments_response_spec.rb +54 -0
  32. data/spec/models/get_docx_get_comments_hierarchical_request_spec.rb +48 -0
  33. data/spec/models/get_docx_get_comments_request_spec.rb +48 -0
  34. data/spec/models/insert_docx_comment_on_paragraph_response_spec.rb +48 -0
  35. metadata +26 -2
@@ -13,7 +13,7 @@ Swagger Codegen version: 2.3.1
13
13
  require 'date'
14
14
 
15
15
  module CloudmersiveConvertApiClient
16
-
16
+ # One page in a Word Document DOCX
17
17
  class DocxPage
18
18
  # Page number of this page, 1-based
19
19
  attr_accessor :page_number
@@ -0,0 +1,251 @@
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
+ # Top-level Comment in a Word Document
17
+ class DocxTopLevelComment
18
+ # Path to the comment in the document
19
+ attr_accessor :path
20
+
21
+ # Author name of the comment
22
+ attr_accessor :author
23
+
24
+ # Initials of the author of the comment
25
+ attr_accessor :author_initials
26
+
27
+ # Text content of the comment
28
+ attr_accessor :comment_text
29
+
30
+ # Date timestamp of the comment
31
+ attr_accessor :comment_date
32
+
33
+ # Child comments, that are replies to this one
34
+ attr_accessor :reply_child_comments
35
+
36
+ # True if this comment is marked as Done in Word, otherwise it is false
37
+ attr_accessor :done
38
+
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'path' => :'Path',
44
+ :'author' => :'Author',
45
+ :'author_initials' => :'AuthorInitials',
46
+ :'comment_text' => :'CommentText',
47
+ :'comment_date' => :'CommentDate',
48
+ :'reply_child_comments' => :'ReplyChildComments',
49
+ :'done' => :'Done'
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+ :'path' => :'String',
57
+ :'author' => :'String',
58
+ :'author_initials' => :'String',
59
+ :'comment_text' => :'String',
60
+ :'comment_date' => :'DateTime',
61
+ :'reply_child_comments' => :'Array<DocxComment>',
62
+ :'done' => :'BOOLEAN'
63
+ }
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
73
+
74
+ if attributes.has_key?(:'Path')
75
+ self.path = attributes[:'Path']
76
+ end
77
+
78
+ if attributes.has_key?(:'Author')
79
+ self.author = attributes[:'Author']
80
+ end
81
+
82
+ if attributes.has_key?(:'AuthorInitials')
83
+ self.author_initials = attributes[:'AuthorInitials']
84
+ end
85
+
86
+ if attributes.has_key?(:'CommentText')
87
+ self.comment_text = attributes[:'CommentText']
88
+ end
89
+
90
+ if attributes.has_key?(:'CommentDate')
91
+ self.comment_date = attributes[:'CommentDate']
92
+ end
93
+
94
+ if attributes.has_key?(:'ReplyChildComments')
95
+ if (value = attributes[:'ReplyChildComments']).is_a?(Array)
96
+ self.reply_child_comments = value
97
+ end
98
+ end
99
+
100
+ if attributes.has_key?(:'Done')
101
+ self.done = attributes[:'Done']
102
+ end
103
+
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ return invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ return true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ path == o.path &&
125
+ author == o.author &&
126
+ author_initials == o.author_initials &&
127
+ comment_text == o.comment_text &&
128
+ comment_date == o.comment_date &&
129
+ reply_child_comments == o.reply_child_comments &&
130
+ done == o.done
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Fixnum] Hash code
141
+ def hash
142
+ [path, author, author_initials, comment_text, comment_date, reply_child_comments, done].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ self.class.swagger_types.each_pair do |key, type|
151
+ if type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
155
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
160
+ end
161
+
162
+ self
163
+ end
164
+
165
+ # Deserializes the data based on type
166
+ # @param string type Data type
167
+ # @param string value Value to be deserialized
168
+ # @return [Object] Deserialized data
169
+ def _deserialize(type, value)
170
+ case type.to_sym
171
+ when :DateTime
172
+ DateTime.parse(value)
173
+ when :Date
174
+ Date.parse(value)
175
+ when :String
176
+ value.to_s
177
+ when :Integer
178
+ value.to_i
179
+ when :Float
180
+ value.to_f
181
+ when :BOOLEAN
182
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
+ true
184
+ else
185
+ false
186
+ end
187
+ when :Object
188
+ # generic object (usually a Hash), return directly
189
+ value
190
+ when /\AArray<(?<inner_type>.+)>\z/
191
+ inner_type = Regexp.last_match[:inner_type]
192
+ value.map { |v| _deserialize(inner_type, v) }
193
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
+ k_type = Regexp.last_match[:k_type]
195
+ v_type = Regexp.last_match[:v_type]
196
+ {}.tap do |hash|
197
+ value.each do |k, v|
198
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
+ end
200
+ end
201
+ else # model
202
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
203
+ temp_model.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ next if value.nil?
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ # Outputs non-array value in the form of hash
232
+ # For object, use to_hash. Otherwise, just return the value
233
+ # @param [Object] value Any valid value
234
+ # @return [Hash] Returns the value in the form of hash
235
+ def _to_hash(value)
236
+ if value.is_a?(Array)
237
+ value.compact.map{ |v| _to_hash(v) }
238
+ elsif value.is_a?(Hash)
239
+ {}.tap do |hash|
240
+ value.each { |k, v| hash[k] = _to_hash(v) }
241
+ end
242
+ elsif value.respond_to? :to_hash
243
+ value.to_hash
244
+ else
245
+ value
246
+ end
247
+ end
248
+
249
+ end
250
+
251
+ end
@@ -0,0 +1,211 @@
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 getting comments hierarchically from a Word Document DOCX
17
+ class GetDocxCommentsHierarchicalResponse
18
+ # True if successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # Comments in the document
22
+ attr_accessor :comments
23
+
24
+ # The number of comments in the document
25
+ attr_accessor :top_level_comment_count
26
+
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'successful' => :'Successful',
32
+ :'comments' => :'Comments',
33
+ :'top_level_comment_count' => :'TopLevelCommentCount'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.swagger_types
39
+ {
40
+ :'successful' => :'BOOLEAN',
41
+ :'comments' => :'Array<DocxTopLevelComment>',
42
+ :'top_level_comment_count' => :'Integer'
43
+ }
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ return unless attributes.is_a?(Hash)
50
+
51
+ # convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
53
+
54
+ if attributes.has_key?(:'Successful')
55
+ self.successful = attributes[:'Successful']
56
+ end
57
+
58
+ if attributes.has_key?(:'Comments')
59
+ if (value = attributes[:'Comments']).is_a?(Array)
60
+ self.comments = value
61
+ end
62
+ end
63
+
64
+ if attributes.has_key?(:'TopLevelCommentCount')
65
+ self.top_level_comment_count = attributes[:'TopLevelCommentCount']
66
+ end
67
+
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+ return invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ return true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ successful == o.successful &&
89
+ comments == o.comments &&
90
+ top_level_comment_count == o.top_level_comment_count
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Fixnum] Hash code
101
+ def hash
102
+ [successful, comments, top_level_comment_count].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.swagger_types.each_pair do |key, type|
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :BOOLEAN
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
163
+ temp_model.build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ next if value.nil?
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ # Outputs non-array value in the form of hash
192
+ # For object, use to_hash. Otherwise, just return the value
193
+ # @param [Object] value Any valid value
194
+ # @return [Hash] Returns the value in the form of hash
195
+ def _to_hash(value)
196
+ if value.is_a?(Array)
197
+ value.compact.map{ |v| _to_hash(v) }
198
+ elsif value.is_a?(Hash)
199
+ {}.tap do |hash|
200
+ value.each { |k, v| hash[k] = _to_hash(v) }
201
+ end
202
+ elsif value.respond_to? :to_hash
203
+ value.to_hash
204
+ else
205
+ value
206
+ end
207
+ end
208
+
209
+ end
210
+
211
+ end