cloudmersive-convert-api-client 1.5.2 → 1.5.3

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 +17 -5
  3. data/docs/DeleteDocxTableRowRequest.md +11 -0
  4. data/docs/DeleteDocxTableRowResponse.md +9 -0
  5. data/docs/EditDocumentApi.md +223 -3
  6. data/docs/GetDocxTableByIndexRequest.md +10 -0
  7. data/docs/GetDocxTableByIndexResponse.md +9 -0
  8. data/docs/GetDocxTableRowRequest.md +11 -0
  9. data/docs/GetDocxTableRowResponse.md +9 -0
  10. data/docs/PdfMetadata.md +1 -0
  11. data/docs/UpdateDocxTableRowRequest.md +12 -0
  12. data/docs/UpdateDocxTableRowResponse.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 +222 -2
  15. data/lib/cloudmersive-convert-api-client/models/delete_docx_table_row_request.rb +235 -0
  16. data/lib/cloudmersive-convert-api-client/models/delete_docx_table_row_response.rb +199 -0
  17. data/lib/cloudmersive-convert-api-client/models/get_docx_table_by_index_request.rb +225 -0
  18. data/lib/cloudmersive-convert-api-client/models/get_docx_table_by_index_response.rb +199 -0
  19. data/lib/cloudmersive-convert-api-client/models/get_docx_table_row_request.rb +235 -0
  20. data/lib/cloudmersive-convert-api-client/models/get_docx_table_row_response.rb +199 -0
  21. data/lib/cloudmersive-convert-api-client/models/pdf_metadata.rb +14 -4
  22. data/lib/cloudmersive-convert-api-client/models/update_docx_table_row_request.rb +245 -0
  23. data/lib/cloudmersive-convert-api-client/models/update_docx_table_row_response.rb +199 -0
  24. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  25. data/spec/api/edit_document_api_spec.rb +49 -1
  26. data/spec/models/delete_docx_table_row_request_spec.rb +60 -0
  27. data/spec/models/delete_docx_table_row_response_spec.rb +48 -0
  28. data/spec/models/get_docx_table_by_index_request_spec.rb +54 -0
  29. data/spec/models/get_docx_table_by_index_response_spec.rb +48 -0
  30. data/spec/models/get_docx_table_row_request_spec.rb +60 -0
  31. data/spec/models/get_docx_table_row_response_spec.rb +48 -0
  32. data/spec/models/pdf_metadata_spec.rb +6 -0
  33. data/spec/models/update_docx_table_row_request_spec.rb +66 -0
  34. data/spec/models/update_docx_table_row_response_spec.rb +48 -0
  35. metadata +26 -2
@@ -0,0 +1,235 @@
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
+ # Input to a get DOCX table row request
17
+ class GetDocxTableRowRequest
18
+ # Optional: Bytes of the input file to operate on
19
+ attr_accessor :input_file_bytes
20
+
21
+ # 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 to upload a document and pass in the secure URL result from that operation as the URL here (this URL is not public).
22
+ attr_accessor :input_file_url
23
+
24
+ # Path to the table to retrievew the row from
25
+ attr_accessor :table_path
26
+
27
+ # 0-based index of the row to retrieve (e.g. 0, 1, 2, ...) in the table
28
+ attr_accessor :table_row_row_index
29
+
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'input_file_bytes' => :'InputFileBytes',
35
+ :'input_file_url' => :'InputFileUrl',
36
+ :'table_path' => :'TablePath',
37
+ :'table_row_row_index' => :'TableRowRowIndex'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'input_file_bytes' => :'String',
45
+ :'input_file_url' => :'String',
46
+ :'table_path' => :'String',
47
+ :'table_row_row_index' => :'Integer'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
58
+
59
+ if attributes.has_key?(:'InputFileBytes')
60
+ self.input_file_bytes = attributes[:'InputFileBytes']
61
+ end
62
+
63
+ if attributes.has_key?(:'InputFileUrl')
64
+ self.input_file_url = attributes[:'InputFileUrl']
65
+ end
66
+
67
+ if attributes.has_key?(:'TablePath')
68
+ self.table_path = attributes[:'TablePath']
69
+ end
70
+
71
+ if attributes.has_key?(:'TableRowRowIndex')
72
+ self.table_row_row_index = attributes[:'TableRowRowIndex']
73
+ end
74
+
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ if !@input_file_bytes.nil? && @input_file_bytes !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
82
+ invalid_properties.push("invalid value for 'input_file_bytes', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.")
83
+ end
84
+
85
+ return invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return false if !@input_file_bytes.nil? && @input_file_bytes !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
92
+ return true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] input_file_bytes Value to be assigned
97
+ def input_file_bytes=(input_file_bytes)
98
+
99
+ if !input_file_bytes.nil? && input_file_bytes !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
100
+ fail ArgumentError, "invalid value for 'input_file_bytes', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."
101
+ end
102
+
103
+ @input_file_bytes = input_file_bytes
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ input_file_bytes == o.input_file_bytes &&
112
+ input_file_url == o.input_file_url &&
113
+ table_path == o.table_path &&
114
+ table_row_row_index == o.table_row_row_index
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Fixnum] Hash code
125
+ def hash
126
+ [input_file_bytes, input_file_url, table_path, table_row_row_index].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ self.class.swagger_types.each_pair do |key, type|
135
+ if type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :DateTime
156
+ DateTime.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :BOOLEAN
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
187
+ temp_model.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ next if value.nil?
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ # Outputs non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ # @param [Object] value Any valid value
218
+ # @return [Hash] Returns the value in the form of hash
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map{ |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+
233
+ end
234
+
235
+ end
@@ -0,0 +1,199 @@
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 running an Get Table Row command
17
+ class GetDocxTableRowResponse
18
+ # True if successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # Contents of the table row that was requested
22
+ attr_accessor :row_result
23
+
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'successful' => :'Successful',
29
+ :'row_result' => :'RowResult'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.swagger_types
35
+ {
36
+ :'successful' => :'BOOLEAN',
37
+ :'row_result' => :'DocxTableRow'
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?(:'Successful')
50
+ self.successful = attributes[:'Successful']
51
+ end
52
+
53
+ if attributes.has_key?(:'RowResult')
54
+ self.row_result = attributes[:'RowResult']
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
+ return 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
+ return 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
+ row_result == o.row_result
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, row_result].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 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
+
199
+ end
@@ -39,6 +39,9 @@ module CloudmersiveConvertApiClient
39
39
  # The timestamp that the document was created, if available, null if not available
40
40
  attr_accessor :date_created
41
41
 
42
+ # The number of pages in the document
43
+ attr_accessor :page_count
44
+
42
45
 
43
46
  # Attribute mapping from ruby-style variable name to JSON key.
44
47
  def self.attribute_map
@@ -50,7 +53,8 @@ module CloudmersiveConvertApiClient
50
53
  :'author' => :'Author',
51
54
  :'creator' => :'Creator',
52
55
  :'date_modified' => :'DateModified',
53
- :'date_created' => :'DateCreated'
56
+ :'date_created' => :'DateCreated',
57
+ :'page_count' => :'PageCount'
54
58
  }
55
59
  end
56
60
 
@@ -64,7 +68,8 @@ module CloudmersiveConvertApiClient
64
68
  :'author' => :'String',
65
69
  :'creator' => :'String',
66
70
  :'date_modified' => :'DateTime',
67
- :'date_created' => :'DateTime'
71
+ :'date_created' => :'DateTime',
72
+ :'page_count' => :'Integer'
68
73
  }
69
74
  end
70
75
 
@@ -108,6 +113,10 @@ module CloudmersiveConvertApiClient
108
113
  self.date_created = attributes[:'DateCreated']
109
114
  end
110
115
 
116
+ if attributes.has_key?(:'PageCount')
117
+ self.page_count = attributes[:'PageCount']
118
+ end
119
+
111
120
  end
112
121
 
113
122
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -135,7 +144,8 @@ module CloudmersiveConvertApiClient
135
144
  author == o.author &&
136
145
  creator == o.creator &&
137
146
  date_modified == o.date_modified &&
138
- date_created == o.date_created
147
+ date_created == o.date_created &&
148
+ page_count == o.page_count
139
149
  end
140
150
 
141
151
  # @see the `==` method
@@ -147,7 +157,7 @@ module CloudmersiveConvertApiClient
147
157
  # Calculates hash code according to all attributes.
148
158
  # @return [Fixnum] Hash code
149
159
  def hash
150
- [successful, title, keywords, subject, author, creator, date_modified, date_created].hash
160
+ [successful, title, keywords, subject, author, creator, date_modified, date_created, page_count].hash
151
161
  end
152
162
 
153
163
  # Builds the object from hash