groupdocs_parser_cloud 22.12 → 25.9

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 (68) hide show
  1. checksums.yaml +5 -5
  2. data/lib/groupdocs_parser_cloud/api/file_api.rb +6 -6
  3. data/lib/groupdocs_parser_cloud/api/folder_api.rb +6 -6
  4. data/lib/groupdocs_parser_cloud/api/info_api.rb +3 -3
  5. data/lib/groupdocs_parser_cloud/api/parse_api.rb +101 -4
  6. data/lib/groupdocs_parser_cloud/api/storage_api.rb +5 -5
  7. data/lib/groupdocs_parser_cloud/api/template_api.rb +4 -4
  8. data/lib/groupdocs_parser_cloud/api_client.rb +4 -4
  9. data/lib/groupdocs_parser_cloud/{api_error.rb → api_client_error.rb} +22 -17
  10. data/lib/groupdocs_parser_cloud/configuration.rb +1 -1
  11. data/lib/groupdocs_parser_cloud/models/barcode.rb +254 -0
  12. data/lib/groupdocs_parser_cloud/models/barcode_page.rb +229 -0
  13. data/lib/groupdocs_parser_cloud/models/barcodes_options.rb +254 -0
  14. data/lib/groupdocs_parser_cloud/models/barcodes_result.rb +216 -0
  15. data/lib/groupdocs_parser_cloud/models/container_item.rb +1 -1
  16. data/lib/groupdocs_parser_cloud/models/container_item_info.rb +1 -1
  17. data/lib/groupdocs_parser_cloud/models/container_options.rb +1 -1
  18. data/lib/groupdocs_parser_cloud/models/container_result.rb +1 -1
  19. data/lib/groupdocs_parser_cloud/models/coordinates.rb +1 -1
  20. data/lib/groupdocs_parser_cloud/models/create_template_options.rb +1 -1
  21. data/lib/groupdocs_parser_cloud/models/detector_parameters.rb +1 -1
  22. data/lib/groupdocs_parser_cloud/models/disc_usage.rb +1 -1
  23. data/lib/groupdocs_parser_cloud/models/error.rb +1 -1
  24. data/lib/groupdocs_parser_cloud/models/error_details.rb +1 -1
  25. data/lib/groupdocs_parser_cloud/models/field.rb +1 -1
  26. data/lib/groupdocs_parser_cloud/models/field_data.rb +1 -1
  27. data/lib/groupdocs_parser_cloud/models/field_position.rb +1 -1
  28. data/lib/groupdocs_parser_cloud/models/file_info.rb +1 -1
  29. data/lib/groupdocs_parser_cloud/models/file_type.rb +1 -1
  30. data/lib/groupdocs_parser_cloud/models/file_version.rb +1 -1
  31. data/lib/groupdocs_parser_cloud/models/file_versions.rb +1 -1
  32. data/lib/groupdocs_parser_cloud/models/files_list.rb +1 -1
  33. data/lib/groupdocs_parser_cloud/models/files_upload_result.rb +1 -1
  34. data/lib/groupdocs_parser_cloud/models/format.rb +1 -1
  35. data/lib/groupdocs_parser_cloud/models/formats_result.rb +1 -1
  36. data/lib/groupdocs_parser_cloud/models/formatted_text_options.rb +1 -1
  37. data/lib/groupdocs_parser_cloud/models/image.rb +1 -1
  38. data/lib/groupdocs_parser_cloud/models/image_page.rb +1 -1
  39. data/lib/groupdocs_parser_cloud/models/images_options.rb +1 -1
  40. data/lib/groupdocs_parser_cloud/models/images_result.rb +1 -1
  41. data/lib/groupdocs_parser_cloud/models/info_options.rb +1 -1
  42. data/lib/groupdocs_parser_cloud/models/info_result.rb +1 -1
  43. data/lib/groupdocs_parser_cloud/models/object_exist.rb +1 -1
  44. data/lib/groupdocs_parser_cloud/models/page.rb +1 -1
  45. data/lib/groupdocs_parser_cloud/models/page_area.rb +1 -1
  46. data/lib/groupdocs_parser_cloud/models/page_table_area.rb +1 -1
  47. data/lib/groupdocs_parser_cloud/models/page_table_area_cell.rb +1 -1
  48. data/lib/groupdocs_parser_cloud/models/page_text_area.rb +1 -1
  49. data/lib/groupdocs_parser_cloud/models/parse_options.rb +1 -1
  50. data/lib/groupdocs_parser_cloud/models/parse_result.rb +1 -1
  51. data/lib/groupdocs_parser_cloud/models/parser_options.rb +1 -1
  52. data/lib/groupdocs_parser_cloud/models/point.rb +1 -1
  53. data/lib/groupdocs_parser_cloud/models/rectangle.rb +1 -1
  54. data/lib/groupdocs_parser_cloud/models/size.rb +1 -1
  55. data/lib/groupdocs_parser_cloud/models/storage_exist.rb +1 -1
  56. data/lib/groupdocs_parser_cloud/models/storage_file.rb +1 -1
  57. data/lib/groupdocs_parser_cloud/models/table.rb +1 -1
  58. data/lib/groupdocs_parser_cloud/models/table_layout.rb +1 -1
  59. data/lib/groupdocs_parser_cloud/models/template.rb +1 -1
  60. data/lib/groupdocs_parser_cloud/models/template_options.rb +1 -1
  61. data/lib/groupdocs_parser_cloud/models/template_result.rb +1 -1
  62. data/lib/groupdocs_parser_cloud/models/text_options.rb +1 -1
  63. data/lib/groupdocs_parser_cloud/models/text_page.rb +1 -1
  64. data/lib/groupdocs_parser_cloud/models/text_result.rb +1 -1
  65. data/lib/groupdocs_parser_cloud/models/text_style.rb +1 -1
  66. data/lib/groupdocs_parser_cloud/version.rb +2 -2
  67. data/lib/groupdocs_parser_cloud.rb +6 -2
  68. metadata +15 -12
@@ -0,0 +1,254 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="barcode.rb">
4
+ # Copyright (c) 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
+ # Represents an barcode.
32
+ class Barcode
33
+
34
+ # Gets the name of the barcode type.
35
+ attr_accessor :code_type_name
36
+
37
+ # Gets the document page information such as page index and page size.
38
+ attr_accessor :page
39
+
40
+ # Gets the rectangular area.
41
+ attr_accessor :rectangle
42
+
43
+ # Gets the barcode value.
44
+ attr_accessor :value
45
+
46
+ # Gets or sets the barcode download URL.
47
+ attr_accessor :download_url
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'code_type_name' => :'CodeTypeName',
53
+ :'page' => :'Page',
54
+ :'rectangle' => :'Rectangle',
55
+ :'value' => :'Value',
56
+ :'download_url' => :'DownloadUrl'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.swagger_types
62
+ {
63
+ :'code_type_name' => :'String',
64
+ :'page' => :'BarcodePage',
65
+ :'rectangle' => :'Rectangle',
66
+ :'value' => :'String',
67
+ :'download_url' => :'String'
68
+ }
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ return unless attributes.is_a?(Hash)
75
+
76
+ # convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
78
+
79
+ if attributes.key?(:'CodeTypeName')
80
+ self.code_type_name = attributes[:'CodeTypeName']
81
+ end
82
+
83
+ if attributes.key?(:'Page')
84
+ self.page = attributes[:'Page']
85
+ end
86
+
87
+ if attributes.key?(:'Rectangle')
88
+ self.rectangle = attributes[:'Rectangle']
89
+ end
90
+
91
+ if attributes.key?(:'Value')
92
+ self.value = attributes[:'Value']
93
+ end
94
+
95
+ if attributes.key?(:'DownloadUrl')
96
+ self.download_url = attributes[:'DownloadUrl']
97
+ end
98
+
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properies with the reasons
103
+ def list_invalid_properties
104
+ invalid_properties = []
105
+ return invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ return true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(other)
117
+ return true if self.equal?(other)
118
+ self.class == other.class &&
119
+ code_type_name == other.code_type_name &&
120
+ page == other.page &&
121
+ rectangle == other.rectangle &&
122
+ value == other.value &&
123
+ download_url == other.download_url
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(other)
129
+ self == other
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Fixnum] Hash code
134
+ def hash
135
+ [code_type_name, page, rectangle, value, download_url].hash
136
+ end
137
+
138
+ # Downcases first letter.
139
+ # @return downcased string
140
+ def uncap(str)
141
+ str[0, 1].downcase + str[1..-1]
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ self.class.swagger_types.each_pair do |key, type|
150
+ pname = uncap(self.class.attribute_map[key]).intern
151
+ value = attributes[pname]
152
+ if type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the the attribute
154
+ # is documented as an array but the input is not
155
+ if value.is_a?(Array)
156
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
157
+ end
158
+ elsif !value.nil?
159
+ self.send("#{key}=", _deserialize(type, value))
160
+ end
161
+ # or else data not found in attributes(hash), not an issue as the data can be optional
162
+ end
163
+
164
+ self
165
+ end
166
+
167
+ # Deserializes the data based on type
168
+ # @param string type Data type
169
+ # @param string value Value to be deserialized
170
+ # @return [Object] Deserialized data
171
+ def _deserialize(type, value)
172
+ case type.to_sym
173
+ when :DateTime
174
+ Date.parse value
175
+ when :Date
176
+ Date.parse value
177
+ when :String
178
+ value.to_s
179
+ when :Integer
180
+ value.to_i
181
+ when :Float
182
+ value.to_f
183
+ when :BOOLEAN
184
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
185
+ true
186
+ else
187
+ false
188
+ end
189
+ when :Object
190
+ # generic object (usually a Hash), return directly
191
+ value
192
+ when /\AArray<(?<inner_type>.+)>\z/
193
+ inner_type = Regexp.last_match[:inner_type]
194
+ value.map { |v| _deserialize(inner_type, v) }
195
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
196
+ k_type = Regexp.last_match[:k_type]
197
+ v_type = Regexp.last_match[:v_type]
198
+ {}.tap do |hash|
199
+ value.each do |k, v|
200
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
201
+ end
202
+ end
203
+ else
204
+ # model
205
+ temp_model = GroupDocsParserCloud.const_get(type).new
206
+ temp_model.build_from_hash(value)
207
+ end
208
+ end
209
+
210
+ # Returns the string representation of the object
211
+ # @return [String] String presentation of the object
212
+ def to_s
213
+ to_hash.to_s
214
+ end
215
+
216
+ # to_body is an alias to to_hash (backward compatibility)
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_body
219
+ to_hash
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ self.class.attribute_map.each_pair do |attr, param|
227
+ value = self.send(attr)
228
+ next if value.nil?
229
+ hash[param] = _to_hash(value)
230
+ end
231
+ hash
232
+ end
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map { |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+
252
+ end
253
+
254
+ end
@@ -0,0 +1,229 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="barcode_page.rb">
4
+ # Copyright (c) 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
+
32
+ class BarcodePage
33
+
34
+ # Gets the page index.
35
+ attr_accessor :index
36
+
37
+ # Gets the page size.
38
+ attr_accessor :size
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'index' => :'Index',
44
+ :'size' => :'Size'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'index' => :'Integer',
52
+ :'size' => :'Size'
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?(:'Index')
65
+ self.index = attributes[:'Index']
66
+ end
67
+
68
+ if attributes.key?(:'Size')
69
+ self.size = attributes[:'Size']
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 @index.nil?
79
+ invalid_properties.push("invalid value for 'index', index cannot be nil.")
80
+ end
81
+
82
+ return invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ return false if @index.nil?
89
+ return true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(other)
95
+ return true if self.equal?(other)
96
+ self.class == other.class &&
97
+ index == other.index &&
98
+ size == other.size
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(other)
104
+ self == other
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Fixnum] Hash code
109
+ def hash
110
+ [index, size].hash
111
+ end
112
+
113
+ # Downcases first letter.
114
+ # @return downcased string
115
+ def uncap(str)
116
+ str[0, 1].downcase + str[1..-1]
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ self.class.swagger_types.each_pair do |key, type|
125
+ pname = uncap(self.class.attribute_map[key]).intern
126
+ value = attributes[pname]
127
+ if type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the the attribute
129
+ # is documented as an array but the input is not
130
+ if value.is_a?(Array)
131
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !value.nil?
134
+ self.send("#{key}=", _deserialize(type, value))
135
+ end
136
+ # or else data not found in attributes(hash), not an issue as the data can be optional
137
+ end
138
+
139
+ self
140
+ end
141
+
142
+ # Deserializes the data based on type
143
+ # @param string type Data type
144
+ # @param string value Value to be deserialized
145
+ # @return [Object] Deserialized data
146
+ def _deserialize(type, value)
147
+ case type.to_sym
148
+ when :DateTime
149
+ Date.parse value
150
+ when :Date
151
+ Date.parse value
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :BOOLEAN
159
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else
179
+ # model
180
+ temp_model = GroupDocsParserCloud.const_get(type).new
181
+ temp_model.build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ next if value.nil?
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+ end
228
+
229
+ end