groupdocs_parser_cloud 19.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/lib/groupdocs_parser_cloud.rb +91 -0
  3. data/lib/groupdocs_parser_cloud/api/file_api.rb +729 -0
  4. data/lib/groupdocs_parser_cloud/api/folder_api.rb +694 -0
  5. data/lib/groupdocs_parser_cloud/api/info_api.rb +363 -0
  6. data/lib/groupdocs_parser_cloud/api/parse_api.rb +411 -0
  7. data/lib/groupdocs_parser_cloud/api/storage_api.rb +541 -0
  8. data/lib/groupdocs_parser_cloud/api/template_api.rb +410 -0
  9. data/lib/groupdocs_parser_cloud/api_client.rb +380 -0
  10. data/lib/groupdocs_parser_cloud/api_error.rb +64 -0
  11. data/lib/groupdocs_parser_cloud/configuration.rb +95 -0
  12. data/lib/groupdocs_parser_cloud/models/container_item.rb +246 -0
  13. data/lib/groupdocs_parser_cloud/models/container_item_info.rb +224 -0
  14. data/lib/groupdocs_parser_cloud/models/container_options.rb +224 -0
  15. data/lib/groupdocs_parser_cloud/models/container_result.rb +216 -0
  16. data/lib/groupdocs_parser_cloud/models/coordinates.rb +264 -0
  17. data/lib/groupdocs_parser_cloud/models/create_template_options.rb +234 -0
  18. data/lib/groupdocs_parser_cloud/models/detector_parameters.rb +266 -0
  19. data/lib/groupdocs_parser_cloud/models/disc_usage.rb +234 -0
  20. data/lib/groupdocs_parser_cloud/models/error.rb +244 -0
  21. data/lib/groupdocs_parser_cloud/models/error_details.rb +229 -0
  22. data/lib/groupdocs_parser_cloud/models/field.rb +234 -0
  23. data/lib/groupdocs_parser_cloud/models/field_data.rb +249 -0
  24. data/lib/groupdocs_parser_cloud/models/field_position.rb +344 -0
  25. data/lib/groupdocs_parser_cloud/models/file_info.rb +234 -0
  26. data/lib/groupdocs_parser_cloud/models/file_type.rb +224 -0
  27. data/lib/groupdocs_parser_cloud/models/file_version.rb +289 -0
  28. data/lib/groupdocs_parser_cloud/models/file_versions.rb +216 -0
  29. data/lib/groupdocs_parser_cloud/models/files_list.rb +216 -0
  30. data/lib/groupdocs_parser_cloud/models/files_upload_result.rb +228 -0
  31. data/lib/groupdocs_parser_cloud/models/format.rb +224 -0
  32. data/lib/groupdocs_parser_cloud/models/formats_result.rb +216 -0
  33. data/lib/groupdocs_parser_cloud/models/formatted_text_options.rb +214 -0
  34. data/lib/groupdocs_parser_cloud/models/image.rb +224 -0
  35. data/lib/groupdocs_parser_cloud/models/image_page.rb +231 -0
  36. data/lib/groupdocs_parser_cloud/models/images_options.rb +254 -0
  37. data/lib/groupdocs_parser_cloud/models/images_result.rb +228 -0
  38. data/lib/groupdocs_parser_cloud/models/info_options.rb +224 -0
  39. data/lib/groupdocs_parser_cloud/models/info_result.rb +244 -0
  40. data/lib/groupdocs_parser_cloud/models/object_exist.rb +234 -0
  41. data/lib/groupdocs_parser_cloud/models/page.rb +229 -0
  42. data/lib/groupdocs_parser_cloud/models/page_area.rb +244 -0
  43. data/lib/groupdocs_parser_cloud/models/page_table_area.rb +246 -0
  44. data/lib/groupdocs_parser_cloud/models/page_table_area_cell.rb +274 -0
  45. data/lib/groupdocs_parser_cloud/models/page_text_area.rb +251 -0
  46. data/lib/groupdocs_parser_cloud/models/parse_options.rb +244 -0
  47. data/lib/groupdocs_parser_cloud/models/parse_result.rb +231 -0
  48. data/lib/groupdocs_parser_cloud/models/parser_options.rb +224 -0
  49. data/lib/groupdocs_parser_cloud/models/point.rb +234 -0
  50. data/lib/groupdocs_parser_cloud/models/rectangle.rb +234 -0
  51. data/lib/groupdocs_parser_cloud/models/size.rb +234 -0
  52. data/lib/groupdocs_parser_cloud/models/storage_exist.rb +219 -0
  53. data/lib/groupdocs_parser_cloud/models/storage_file.rb +264 -0
  54. data/lib/groupdocs_parser_cloud/models/table.rb +244 -0
  55. data/lib/groupdocs_parser_cloud/models/table_layout.rb +228 -0
  56. data/lib/groupdocs_parser_cloud/models/template.rb +228 -0
  57. data/lib/groupdocs_parser_cloud/models/template_options.rb +224 -0
  58. data/lib/groupdocs_parser_cloud/models/template_result.rb +224 -0
  59. data/lib/groupdocs_parser_cloud/models/text_options.rb +254 -0
  60. data/lib/groupdocs_parser_cloud/models/text_page.rb +229 -0
  61. data/lib/groupdocs_parser_cloud/models/text_result.rb +226 -0
  62. data/lib/groupdocs_parser_cloud/models/text_style.rb +269 -0
  63. data/lib/groupdocs_parser_cloud/version.rb +29 -0
  64. metadata +174 -0
@@ -0,0 +1,234 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="point.rb">
4
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsParserCloud
31
+ # Class for rectangle position model.
32
+ class Point
33
+
34
+ # Gets or sets the x-coordinate.
35
+ attr_accessor :x
36
+
37
+ # Gets or sets the y-coordinate.
38
+ attr_accessor :y
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'x' => :'X',
44
+ :'y' => :'Y'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'x' => :'Float',
52
+ :'y' => :'Float'
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
63
+
64
+ if attributes.key?(:'X')
65
+ self.x = attributes[:'X']
66
+ end
67
+
68
+ if attributes.key?(:'Y')
69
+ self.y = attributes[:'Y']
70
+ end
71
+
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properies with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = []
78
+ if @x.nil?
79
+ invalid_properties.push("invalid value for 'x', x cannot be nil.")
80
+ end
81
+
82
+ if @y.nil?
83
+ invalid_properties.push("invalid value for 'y', y cannot be nil.")
84
+ end
85
+
86
+ return invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ return false if @x.nil?
93
+ return false if @y.nil?
94
+ return true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(other)
100
+ return true if self.equal?(other)
101
+ self.class == other.class &&
102
+ x == other.x &&
103
+ y == other.y
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(other)
109
+ self == other
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [x, y].hash
116
+ end
117
+
118
+ # Downcases first letter.
119
+ # @return downcased string
120
+ def uncap(str)
121
+ str[0, 1].downcase + str[1..-1]
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.swagger_types.each_pair do |key, type|
130
+ pname = uncap(self.class.attribute_map[key]).intern
131
+ value = attributes[pname]
132
+ if type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the the attribute
134
+ # is documented as an array but the input is not
135
+ if value.is_a?(Array)
136
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
137
+ end
138
+ elsif !value.nil?
139
+ self.send("#{key}=", _deserialize(type, value))
140
+ end
141
+ # or else data not found in attributes(hash), not an issue as the data can be optional
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :DateTime
154
+ Date.parse value
155
+ when :Date
156
+ Date.parse value
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :BOOLEAN
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else
184
+ # model
185
+ temp_model = GroupDocsParserCloud.const_get(type).new
186
+ temp_model.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ next if value.nil?
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end
@@ -0,0 +1,234 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="rectangle.rb">
4
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsParserCloud
31
+ # Rectangular area on the page.
32
+ class Rectangle
33
+
34
+ # Gets the coordinates of the upper-left corner of the rectangular area.
35
+ attr_accessor :position
36
+
37
+ # Gets or sets the size of the rectangle.
38
+ attr_accessor :size
39
+
40
+ # Gets or sets the coordinates.
41
+ attr_accessor :coordinates
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'position' => :'Position',
47
+ :'size' => :'Size',
48
+ :'coordinates' => :'Coordinates'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ :'position' => :'Point',
56
+ :'size' => :'Size',
57
+ :'coordinates' => :'Coordinates'
58
+ }
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ return unless attributes.is_a?(Hash)
65
+
66
+ # convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
+
69
+ if attributes.key?(:'Position')
70
+ self.position = attributes[:'Position']
71
+ end
72
+
73
+ if attributes.key?(:'Size')
74
+ self.size = attributes[:'Size']
75
+ end
76
+
77
+ if attributes.key?(:'Coordinates')
78
+ self.coordinates = attributes[:'Coordinates']
79
+ end
80
+
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properies with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = []
87
+ return invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(other)
99
+ return true if self.equal?(other)
100
+ self.class == other.class &&
101
+ position == other.position &&
102
+ size == other.size &&
103
+ coordinates == other.coordinates
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(other)
109
+ self == other
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [position, size, coordinates].hash
116
+ end
117
+
118
+ # Downcases first letter.
119
+ # @return downcased string
120
+ def uncap(str)
121
+ str[0, 1].downcase + str[1..-1]
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.swagger_types.each_pair do |key, type|
130
+ pname = uncap(self.class.attribute_map[key]).intern
131
+ value = attributes[pname]
132
+ if type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the the attribute
134
+ # is documented as an array but the input is not
135
+ if value.is_a?(Array)
136
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
137
+ end
138
+ elsif !value.nil?
139
+ self.send("#{key}=", _deserialize(type, value))
140
+ end
141
+ # or else data not found in attributes(hash), not an issue as the data can be optional
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :DateTime
154
+ Date.parse value
155
+ when :Date
156
+ Date.parse value
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :BOOLEAN
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else
184
+ # model
185
+ temp_model = GroupDocsParserCloud.const_get(type).new
186
+ temp_model.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ next if value.nil?
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end