aspose_cad_cloud 19.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/lib/aspose_cad_cloud.rb +83 -0
  3. data/lib/aspose_cad_cloud/api/cad_api.rb +2138 -0
  4. data/lib/aspose_cad_cloud/api_client.rb +403 -0
  5. data/lib/aspose_cad_cloud/api_error.rb +54 -0
  6. data/lib/aspose_cad_cloud/configuration.rb +189 -0
  7. data/lib/aspose_cad_cloud/models/bmp_options_dto.rb +327 -0
  8. data/lib/aspose_cad_cloud/models/cad_rasterization_options_dto.rb +473 -0
  9. data/lib/aspose_cad_cloud/models/cad_response.rb +317 -0
  10. data/lib/aspose_cad_cloud/models/cff2_properties.rb +197 -0
  11. data/lib/aspose_cad_cloud/models/color.rb +312 -0
  12. data/lib/aspose_cad_cloud/models/dgn_properties.rb +197 -0
  13. data/lib/aspose_cad_cloud/models/drawing_options_base_dto.rb +281 -0
  14. data/lib/aspose_cad_cloud/models/dwf_properties.rb +197 -0
  15. data/lib/aspose_cad_cloud/models/dwg_properties.rb +197 -0
  16. data/lib/aspose_cad_cloud/models/dxf_properties.rb +197 -0
  17. data/lib/aspose_cad_cloud/models/gif_options_dto.rb +386 -0
  18. data/lib/aspose_cad_cloud/models/graphics_options.rb +311 -0
  19. data/lib/aspose_cad_cloud/models/ifc_properties.rb +197 -0
  20. data/lib/aspose_cad_cloud/models/igs_properties.rb +197 -0
  21. data/lib/aspose_cad_cloud/models/jpeg2000_options_dto.rb +322 -0
  22. data/lib/aspose_cad_cloud/models/jpeg_options_dto.rb +378 -0
  23. data/lib/aspose_cad_cloud/models/pdf_document_info.rb +237 -0
  24. data/lib/aspose_cad_cloud/models/pdf_document_options.rb +249 -0
  25. data/lib/aspose_cad_cloud/models/pdf_options_dto.rb +301 -0
  26. data/lib/aspose_cad_cloud/models/pen_options.rb +280 -0
  27. data/lib/aspose_cad_cloud/models/png_options_dto.rb +388 -0
  28. data/lib/aspose_cad_cloud/models/psd_options_dto.rb +388 -0
  29. data/lib/aspose_cad_cloud/models/rd_optimizer_settings.rb +302 -0
  30. data/lib/aspose_cad_cloud/models/requests/GetDrawingPropertiesRequest.rb +53 -0
  31. data/lib/aspose_cad_cloud/models/requests/GetDrawingResizeRequest.rb +69 -0
  32. data/lib/aspose_cad_cloud/models/requests/GetDrawingRotateFlipRequest.rb +65 -0
  33. data/lib/aspose_cad_cloud/models/requests/GetDrawingSaveAsRequest.rb +61 -0
  34. data/lib/aspose_cad_cloud/models/requests/PostDrawingBmpRequest.rb +61 -0
  35. data/lib/aspose_cad_cloud/models/requests/PostDrawingGifRequest.rb +61 -0
  36. data/lib/aspose_cad_cloud/models/requests/PostDrawingJpeg2000Request.rb +61 -0
  37. data/lib/aspose_cad_cloud/models/requests/PostDrawingJpegRequest.rb +61 -0
  38. data/lib/aspose_cad_cloud/models/requests/PostDrawingPdfRequest.rb +61 -0
  39. data/lib/aspose_cad_cloud/models/requests/PostDrawingPngRequest.rb +61 -0
  40. data/lib/aspose_cad_cloud/models/requests/PostDrawingPropertiesRequest.rb +45 -0
  41. data/lib/aspose_cad_cloud/models/requests/PostDrawingPsdRequest.rb +61 -0
  42. data/lib/aspose_cad_cloud/models/requests/PostDrawingResizeRequest.rb +65 -0
  43. data/lib/aspose_cad_cloud/models/requests/PostDrawingRotateFlipRequest.rb +61 -0
  44. data/lib/aspose_cad_cloud/models/requests/PostDrawingSaveAsRequest.rb +57 -0
  45. data/lib/aspose_cad_cloud/models/requests/PostDrawingSvgRequest.rb +61 -0
  46. data/lib/aspose_cad_cloud/models/requests/PostDrawingTiffRequest.rb +61 -0
  47. data/lib/aspose_cad_cloud/models/requests/PostDrawingWmfRequest.rb +61 -0
  48. data/lib/aspose_cad_cloud/models/requests/PutDrawingBmpRequest.rb +57 -0
  49. data/lib/aspose_cad_cloud/models/requests/PutDrawingGifRequest.rb +57 -0
  50. data/lib/aspose_cad_cloud/models/requests/PutDrawingJpeg2000Request.rb +57 -0
  51. data/lib/aspose_cad_cloud/models/requests/PutDrawingJpegRequest.rb +57 -0
  52. data/lib/aspose_cad_cloud/models/requests/PutDrawingPdfRequest.rb +57 -0
  53. data/lib/aspose_cad_cloud/models/requests/PutDrawingPngRequest.rb +57 -0
  54. data/lib/aspose_cad_cloud/models/requests/PutDrawingPsdRequest.rb +57 -0
  55. data/lib/aspose_cad_cloud/models/requests/PutDrawingSvgRequest.rb +57 -0
  56. data/lib/aspose_cad_cloud/models/requests/PutDrawingTiffRequest.rb +57 -0
  57. data/lib/aspose_cad_cloud/models/requests/PutDrawingWmfRequest.rb +57 -0
  58. data/lib/aspose_cad_cloud/models/resolution_setting.rb +227 -0
  59. data/lib/aspose_cad_cloud/models/stl_properties.rb +197 -0
  60. data/lib/aspose_cad_cloud/models/svg_options_dto.rb +327 -0
  61. data/lib/aspose_cad_cloud/models/tiff_options_dto.rb +417 -0
  62. data/lib/aspose_cad_cloud/models/vector_rasterization_options_dto.rb +363 -0
  63. data/lib/aspose_cad_cloud/models/wmf_options_dto.rb +296 -0
  64. data/lib/aspose_cad_cloud/version.rb +29 -0
  65. metadata +178 -0
@@ -0,0 +1,197 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeCadCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="IgsProperties.rb">
8
+ # Copyright (c) 2017 Aspose.CAD Cloud
9
+ # </copyright>
10
+ # <summary>
11
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ # of this software and associated documentation files (the "Software"), to deal
13
+ # in the Software without restriction, including without limitation the rights
14
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ # copies of the Software, and to permit persons to whom the Software is
16
+ # furnished to do so, subject to the following conditions:
17
+ #
18
+ # The above copyright notice and this permission notice shall be included in all
19
+ # copies or substantial portions of the Software.
20
+ #
21
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ # SOFTWARE.
28
+ # </summary>
29
+ # --------------------------------------------------------------------------------------------------------------------
30
+ #
31
+
32
+ # Represents information about IGS drawing.
33
+ class IgsProperties
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ return unless attributes.is_a?(Hash)
51
+
52
+ # convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
54
+
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properies with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = []
61
+ return 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
+ return true
68
+ end
69
+
70
+ # Checks equality by comparing each attribute.
71
+ # @param [Object] Object to be compared
72
+ def ==(other)
73
+ return true if self.equal?(other)
74
+ self.class == other.class
75
+ end
76
+
77
+ # @see the `==` method
78
+ # @param [Object] Object to be compared
79
+ def eql?(other)
80
+ self == other
81
+ end
82
+
83
+ # Calculates hash code according to all attributes.
84
+ # @return [Fixnum] Hash code
85
+ def hash
86
+ [].hash
87
+ end
88
+
89
+ # Builds the object from hash
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ # @return [Object] Returns the model itself
92
+ def build_from_hash(attributes)
93
+ return nil unless attributes.is_a?(Hash)
94
+ self.class.swagger_types.each_pair do |key, type|
95
+ if type =~ /\AArray<(.*)>/i
96
+ # check to ensure the input is an array given that the the attribute
97
+ # is documented as an array but the input is not
98
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
99
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
100
+ end
101
+ elsif !attributes[self.class.attribute_map[key]].nil?
102
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
103
+ end
104
+ # or else data not found in attributes(hash), not an issue as the data can be optional
105
+ end
106
+
107
+ self
108
+ end
109
+
110
+ # Deserializes the data based on type
111
+ # @param string type Data type
112
+ # @param string value Value to be deserialized
113
+ # @return [Object] Deserialized data
114
+ def _deserialize(type, value)
115
+ case type.to_sym
116
+ when :DateTime
117
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
118
+ when :Date
119
+ Time.at(/\d/.match(value)[0].to_f).to_date
120
+ when :String
121
+ value.to_s
122
+ when :Integer
123
+ value.to_i
124
+ when :Float
125
+ value.to_f
126
+ when :BOOLEAN
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
+ true
129
+ else
130
+ false
131
+ end
132
+ when :Object
133
+ # generic object (usually a Hash), return directly
134
+ value
135
+ when /\AArray<(?<inner_type>.+)>\z/
136
+ inner_type = Regexp.last_match[:inner_type]
137
+ value.map { |v| _deserialize(inner_type, v) }
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
+ k_type = Regexp.last_match[:k_type]
140
+ v_type = Regexp.last_match[:v_type]
141
+ {}.tap do |hash|
142
+ value.each do |k, v|
143
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
+ end
145
+ end
146
+ else
147
+ # model
148
+ temp_model = AsposeCadCloud.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
+
197
+ end
@@ -0,0 +1,322 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeCadCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="Jpeg2000OptionsDTO.rb">
8
+ # Copyright (c) 2017 Aspose.CAD Cloud
9
+ # </copyright>
10
+ # <summary>
11
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ # of this software and associated documentation files (the "Software"), to deal
13
+ # in the Software without restriction, including without limitation the rights
14
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ # copies of the Software, and to permit persons to whom the Software is
16
+ # furnished to do so, subject to the following conditions:
17
+ #
18
+ # The above copyright notice and this permission notice shall be included in all
19
+ # copies or substantial portions of the Software.
20
+ #
21
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ # SOFTWARE.
28
+ # </summary>
29
+ # --------------------------------------------------------------------------------------------------------------------
30
+ #
31
+
32
+ # Export options for JPEG2000 format
33
+ class Jpeg2000OptionsDTO
34
+ # Resulting rotation operation
35
+ attr_accessor :rotation
36
+
37
+ # Layers to export
38
+ attr_accessor :layers
39
+
40
+ # DPI resolution settings
41
+ attr_accessor :resolution_settings
42
+
43
+ # Raster options
44
+ attr_accessor :vector_rasterization_options
45
+
46
+ attr_accessor :comments
47
+
48
+ attr_accessor :codec
49
+
50
+ class EnumAttributeValidator
51
+ attr_reader :datatype
52
+ attr_reader :allowable_values
53
+
54
+ def initialize(datatype, allowable_values)
55
+ @allowable_values = allowable_values.map do |value|
56
+ case datatype.to_s
57
+ when /Integer/i
58
+ value.to_i
59
+ when /Float/i
60
+ value.to_f
61
+ else
62
+ value
63
+ end
64
+ end
65
+ end
66
+
67
+ def valid?(value)
68
+ !value || allowable_values.include?(value)
69
+ end
70
+ end
71
+
72
+ # Attribute mapping from ruby-style variable name to JSON key.
73
+ def self.attribute_map
74
+ {
75
+ :'rotation' => :'Rotation',
76
+ :'layers' => :'Layers',
77
+ :'resolution_settings' => :'ResolutionSettings',
78
+ :'vector_rasterization_options' => :'VectorRasterizationOptions',
79
+ :'comments' => :'Comments',
80
+ :'codec' => :'Codec'
81
+ }
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.swagger_types
86
+ {
87
+ :'rotation' => :'String',
88
+ :'layers' => :'Array<String>',
89
+ :'resolution_settings' => :'ResolutionSetting',
90
+ :'vector_rasterization_options' => :'CadRasterizationOptionsDTO',
91
+ :'comments' => :'Array<String>',
92
+ :'codec' => :'String'
93
+ }
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ return unless attributes.is_a?(Hash)
100
+
101
+ # convert string to symbol for hash key
102
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
103
+
104
+ if attributes.key?(:'Rotation')
105
+ self.rotation = attributes[:'Rotation']
106
+ end
107
+
108
+ if attributes.key?(:'Layers')
109
+ if (value = attributes[:'Layers']).is_a?(Array)
110
+ self.layers = value
111
+ end
112
+ end
113
+
114
+ if attributes.key?(:'ResolutionSettings')
115
+ self.resolution_settings = attributes[:'ResolutionSettings']
116
+ end
117
+
118
+ if attributes.key?(:'VectorRasterizationOptions')
119
+ self.vector_rasterization_options = attributes[:'VectorRasterizationOptions']
120
+ end
121
+
122
+ if attributes.key?(:'Comments')
123
+ if (value = attributes[:'Comments']).is_a?(Array)
124
+ self.comments = value
125
+ end
126
+ end
127
+
128
+ if attributes.key?(:'Codec')
129
+ self.codec = attributes[:'Codec']
130
+ end
131
+
132
+ end
133
+
134
+ # Show invalid properties with the reasons. Usually used together with valid?
135
+ # @return Array for valid properies with the reasons
136
+ def list_invalid_properties
137
+ invalid_properties = []
138
+ if @rotation.nil?
139
+ invalid_properties.push("invalid value for 'rotation', rotation cannot be nil.")
140
+ end
141
+
142
+ if @codec.nil?
143
+ invalid_properties.push("invalid value for 'codec', codec cannot be nil.")
144
+ end
145
+
146
+ return invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ return false if @rotation.nil?
153
+ rotation_validator = EnumAttributeValidator.new('String', ["RotateNoneFlipNone", "Rotate90FlipNone", "Rotate180FlipNone", "Rotate270FlipNone", "RotateNoneFlipX", "Rotate90FlipX", "Rotate180FlipX", "Rotate270FlipX", "RotateNoneFlipY", "Rotate90FlipY", "Rotate180FlipY", "Rotate270FlipY", "RotateNoneFlipXY", "Rotate90FlipXY", "Rotate180FlipXY", "Rotate270FlipXY"])
154
+ return false unless rotation_validator.valid?(@rotation)
155
+ return false if @codec.nil?
156
+ codec_validator = EnumAttributeValidator.new('String', ["J2K", "Jp2", "Jpt"])
157
+ return false unless codec_validator.valid?(@codec)
158
+ return true
159
+ end
160
+
161
+ # Custom attribute writer method checking allowed values (enum).
162
+ # @param [Object] rotation Object to be assigned
163
+ def rotation=(rotation)
164
+ validator = EnumAttributeValidator.new('String', ["RotateNoneFlipNone", "Rotate90FlipNone", "Rotate180FlipNone", "Rotate270FlipNone", "RotateNoneFlipX", "Rotate90FlipX", "Rotate180FlipX", "Rotate270FlipX", "RotateNoneFlipY", "Rotate90FlipY", "Rotate180FlipY", "Rotate270FlipY", "RotateNoneFlipXY", "Rotate90FlipXY", "Rotate180FlipXY", "Rotate270FlipXY"])
165
+ if rotation.to_i == 0
166
+ unless validator.valid?(rotation)
167
+ raise ArgumentError, "invalid value for 'rotation', must be one of #{validator.allowable_values}."
168
+ end
169
+ @rotation = rotation
170
+ else
171
+ @rotation = validator.allowable_values[rotation.to_i]
172
+ end
173
+ end
174
+
175
+ # Custom attribute writer method checking allowed values (enum).
176
+ # @param [Object] codec Object to be assigned
177
+ def codec=(codec)
178
+ validator = EnumAttributeValidator.new('String', ["J2K", "Jp2", "Jpt"])
179
+ if codec.to_i == 0
180
+ unless validator.valid?(codec)
181
+ raise ArgumentError, "invalid value for 'codec', must be one of #{validator.allowable_values}."
182
+ end
183
+ @codec = codec
184
+ else
185
+ @codec = validator.allowable_values[codec.to_i]
186
+ end
187
+ end
188
+
189
+ # Checks equality by comparing each attribute.
190
+ # @param [Object] Object to be compared
191
+ def ==(other)
192
+ return true if self.equal?(other)
193
+ self.class == other.class &&
194
+ rotation == other.rotation &&
195
+ layers == other.layers &&
196
+ resolution_settings == other.resolution_settings &&
197
+ vector_rasterization_options == other.vector_rasterization_options &&
198
+ comments == other.comments &&
199
+ codec == other.codec
200
+ end
201
+
202
+ # @see the `==` method
203
+ # @param [Object] Object to be compared
204
+ def eql?(other)
205
+ self == other
206
+ end
207
+
208
+ # Calculates hash code according to all attributes.
209
+ # @return [Fixnum] Hash code
210
+ def hash
211
+ [rotation, layers, resolution_settings, vector_rasterization_options, comments, codec].hash
212
+ end
213
+
214
+ # Builds the object from hash
215
+ # @param [Hash] attributes Model attributes in the form of hash
216
+ # @return [Object] Returns the model itself
217
+ def build_from_hash(attributes)
218
+ return nil unless attributes.is_a?(Hash)
219
+ self.class.swagger_types.each_pair do |key, type|
220
+ if type =~ /\AArray<(.*)>/i
221
+ # check to ensure the input is an array given that the the attribute
222
+ # is documented as an array but the input is not
223
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
224
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
225
+ end
226
+ elsif !attributes[self.class.attribute_map[key]].nil?
227
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
228
+ end
229
+ # or else data not found in attributes(hash), not an issue as the data can be optional
230
+ end
231
+
232
+ self
233
+ end
234
+
235
+ # Deserializes the data based on type
236
+ # @param string type Data type
237
+ # @param string value Value to be deserialized
238
+ # @return [Object] Deserialized data
239
+ def _deserialize(type, value)
240
+ case type.to_sym
241
+ when :DateTime
242
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
243
+ when :Date
244
+ Time.at(/\d/.match(value)[0].to_f).to_date
245
+ when :String
246
+ value.to_s
247
+ when :Integer
248
+ value.to_i
249
+ when :Float
250
+ value.to_f
251
+ when :BOOLEAN
252
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
253
+ true
254
+ else
255
+ false
256
+ end
257
+ when :Object
258
+ # generic object (usually a Hash), return directly
259
+ value
260
+ when /\AArray<(?<inner_type>.+)>\z/
261
+ inner_type = Regexp.last_match[:inner_type]
262
+ value.map { |v| _deserialize(inner_type, v) }
263
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
264
+ k_type = Regexp.last_match[:k_type]
265
+ v_type = Regexp.last_match[:v_type]
266
+ {}.tap do |hash|
267
+ value.each do |k, v|
268
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
269
+ end
270
+ end
271
+ else
272
+ # model
273
+ temp_model = AsposeCadCloud.const_get(type).new
274
+ temp_model.build_from_hash(value)
275
+ end
276
+ end
277
+
278
+ # Returns the string representation of the object
279
+ # @return [String] String presentation of the object
280
+ def to_s
281
+ to_hash.to_s
282
+ end
283
+
284
+ # to_body is an alias to to_hash (backward compatibility)
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_body
287
+ to_hash
288
+ end
289
+
290
+ # Returns the object in the form of hash
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_hash
293
+ hash = {}
294
+ self.class.attribute_map.each_pair do |attr, param|
295
+ value = self.send(attr)
296
+ next if value.nil?
297
+ hash[param] = _to_hash(value)
298
+ end
299
+ hash
300
+ end
301
+
302
+ # Outputs non-array value in the form of hash
303
+ # For object, use to_hash. Otherwise, just return the value
304
+ # @param [Object] value Any valid value
305
+ # @return [Hash] Returns the value in the form of hash
306
+ def _to_hash(value)
307
+ if value.is_a?(Array)
308
+ value.compact.map { |v| _to_hash(v) }
309
+ elsif value.is_a?(Hash)
310
+ {}.tap do |hash|
311
+ value.each { |k, v| hash[k] = _to_hash(v) }
312
+ end
313
+ elsif value.respond_to? :to_hash
314
+ value.to_hash
315
+ else
316
+ value
317
+ end
318
+ end
319
+
320
+ end
321
+
322
+ end