aspose_pdf_cloud 19.12.0 → 20.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,7 +49,7 @@ module AsposePdfCloud
49
49
  @default_headers = {
50
50
  'Content-Type' => "application/json",
51
51
  'x-aspose-client' => "ruby sdk",
52
- 'x-aspose-version' => "#{ AsposePdfCloud::VERSION }"
52
+ 'x-aspose-client-version' => "#{ AsposePdfCloud::VERSION }"
53
53
  }
54
54
  end
55
55
 
@@ -40,6 +40,9 @@ module AsposePdfCloud
40
40
  # Gets or sets the background image file.
41
41
  attr_accessor :background_image_file
42
42
 
43
+ # Gets or sets path of the background image file from storage.
44
+ attr_accessor :background_image_storage_file
45
+
43
46
  # Gets or sets the alignment.
44
47
  attr_accessor :alignment
45
48
 
@@ -64,6 +67,12 @@ module AsposePdfCloud
64
67
  # Gets or sets the column width.
65
68
  attr_accessor :width
66
69
 
70
+ # Gets or sets Html fragment.
71
+ attr_accessor :html_fragment
72
+
73
+ # Gets or sets ImageFragment list.
74
+ attr_accessor :images
75
+
67
76
 
68
77
  # Attribute mapping from ruby-style variable name to JSON key.
69
78
  def self.attribute_map
@@ -73,6 +82,7 @@ module AsposePdfCloud
73
82
  :'border' => :'Border',
74
83
  :'background_color' => :'BackgroundColor',
75
84
  :'background_image_file' => :'BackgroundImageFile',
85
+ :'background_image_storage_file' => :'BackgroundImageStorageFile',
76
86
  :'alignment' => :'Alignment',
77
87
  :'default_cell_text_state' => :'DefaultCellTextState',
78
88
  :'paragraphs' => :'Paragraphs',
@@ -80,7 +90,9 @@ module AsposePdfCloud
80
90
  :'vertical_alignment' => :'VerticalAlignment',
81
91
  :'col_span' => :'ColSpan',
82
92
  :'row_span' => :'RowSpan',
83
- :'width' => :'Width'
93
+ :'width' => :'Width',
94
+ :'html_fragment' => :'HtmlFragment',
95
+ :'images' => :'Images'
84
96
  }
85
97
  end
86
98
 
@@ -92,6 +104,7 @@ module AsposePdfCloud
92
104
  :'border' => :'BorderInfo',
93
105
  :'background_color' => :'Color',
94
106
  :'background_image_file' => :'String',
107
+ :'background_image_storage_file' => :'String',
95
108
  :'alignment' => :'HorizontalAlignment',
96
109
  :'default_cell_text_state' => :'TextState',
97
110
  :'paragraphs' => :'Array<TextRect>',
@@ -99,7 +112,9 @@ module AsposePdfCloud
99
112
  :'vertical_alignment' => :'VerticalAlignment',
100
113
  :'col_span' => :'Integer',
101
114
  :'row_span' => :'Integer',
102
- :'width' => :'Float'
115
+ :'width' => :'Float',
116
+ :'html_fragment' => :'String',
117
+ :'images' => :'Array<ImageFragment>'
103
118
  }
104
119
  end
105
120
 
@@ -131,6 +146,10 @@ module AsposePdfCloud
131
146
  self.background_image_file = attributes[:'BackgroundImageFile']
132
147
  end
133
148
 
149
+ if attributes.has_key?(:'BackgroundImageStorageFile')
150
+ self.background_image_storage_file = attributes[:'BackgroundImageStorageFile']
151
+ end
152
+
134
153
  if attributes.has_key?(:'Alignment')
135
154
  self.alignment = attributes[:'Alignment']
136
155
  end
@@ -165,6 +184,16 @@ module AsposePdfCloud
165
184
  self.width = attributes[:'Width']
166
185
  end
167
186
 
187
+ if attributes.has_key?(:'HtmlFragment')
188
+ self.html_fragment = attributes[:'HtmlFragment']
189
+ end
190
+
191
+ if attributes.has_key?(:'Images')
192
+ if (value = attributes[:'Images']).is_a?(Array)
193
+ self.images = value
194
+ end
195
+ end
196
+
168
197
  end
169
198
 
170
199
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -190,6 +219,7 @@ module AsposePdfCloud
190
219
  border == o.border &&
191
220
  background_color == o.background_color &&
192
221
  background_image_file == o.background_image_file &&
222
+ background_image_storage_file == o.background_image_storage_file &&
193
223
  alignment == o.alignment &&
194
224
  default_cell_text_state == o.default_cell_text_state &&
195
225
  paragraphs == o.paragraphs &&
@@ -197,7 +227,9 @@ module AsposePdfCloud
197
227
  vertical_alignment == o.vertical_alignment &&
198
228
  col_span == o.col_span &&
199
229
  row_span == o.row_span &&
200
- width == o.width
230
+ width == o.width &&
231
+ html_fragment == o.html_fragment &&
232
+ images == o.images
201
233
  end
202
234
 
203
235
  # @see the `==` method
@@ -209,7 +241,7 @@ module AsposePdfCloud
209
241
  # Calculates hash code according to all attributes.
210
242
  # @return [Fixnum] Hash code
211
243
  def hash
212
- [is_no_border, margin, border, background_color, background_image_file, alignment, default_cell_text_state, paragraphs, is_word_wrapped, vertical_alignment, col_span, row_span, width].hash
244
+ [is_no_border, margin, border, background_color, background_image_file, background_image_storage_file, alignment, default_cell_text_state, paragraphs, is_word_wrapped, vertical_alignment, col_span, row_span, width, html_fragment, images].hash
213
245
  end
214
246
 
215
247
  # Builds the object from hash
@@ -31,6 +31,9 @@ module AsposePdfCloud
31
31
  # Field name.
32
32
  attr_accessor :partial_name
33
33
 
34
+ # Full Field name.
35
+ attr_accessor :full_name
36
+
34
37
  # Field rectangle.
35
38
  attr_accessor :rect
36
39
 
@@ -103,6 +106,7 @@ module AsposePdfCloud
103
106
  {
104
107
  :'links' => :'Links',
105
108
  :'partial_name' => :'PartialName',
109
+ :'full_name' => :'FullName',
106
110
  :'rect' => :'Rect',
107
111
  :'value' => :'Value',
108
112
  :'page_index' => :'PageIndex',
@@ -133,6 +137,7 @@ module AsposePdfCloud
133
137
  {
134
138
  :'links' => :'Array<Link>',
135
139
  :'partial_name' => :'String',
140
+ :'full_name' => :'String',
136
141
  :'rect' => :'Rectangle',
137
142
  :'value' => :'String',
138
143
  :'page_index' => :'Integer',
@@ -176,6 +181,10 @@ module AsposePdfCloud
176
181
  self.partial_name = attributes[:'PartialName']
177
182
  end
178
183
 
184
+ if attributes.has_key?(:'FullName')
185
+ self.full_name = attributes[:'FullName']
186
+ end
187
+
179
188
  if attributes.has_key?(:'Rect')
180
189
  self.rect = attributes[:'Rect']
181
190
  end
@@ -300,6 +309,7 @@ module AsposePdfCloud
300
309
  self.class == o.class &&
301
310
  links == o.links &&
302
311
  partial_name == o.partial_name &&
312
+ full_name == o.full_name &&
303
313
  rect == o.rect &&
304
314
  value == o.value &&
305
315
  page_index == o.page_index &&
@@ -333,7 +343,7 @@ module AsposePdfCloud
333
343
  # Calculates hash code according to all attributes.
334
344
  # @return [Fixnum] Hash code
335
345
  def hash
336
- [links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, allowed_states, style, active_state, checked, export_value].hash
346
+ [links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, allowed_states, style, active_state, checked, export_value].hash
337
347
  end
338
348
 
339
349
  # Builds the object from hash
@@ -31,6 +31,9 @@ module AsposePdfCloud
31
31
  # Field name.
32
32
  attr_accessor :partial_name
33
33
 
34
+ # Full Field name.
35
+ attr_accessor :full_name
36
+
34
37
  # Field rectangle.
35
38
  attr_accessor :rect
36
39
 
@@ -94,6 +97,7 @@ module AsposePdfCloud
94
97
  {
95
98
  :'links' => :'Links',
96
99
  :'partial_name' => :'PartialName',
100
+ :'full_name' => :'FullName',
97
101
  :'rect' => :'Rect',
98
102
  :'value' => :'Value',
99
103
  :'page_index' => :'PageIndex',
@@ -121,6 +125,7 @@ module AsposePdfCloud
121
125
  {
122
126
  :'links' => :'Array<Link>',
123
127
  :'partial_name' => :'String',
128
+ :'full_name' => :'String',
124
129
  :'rect' => :'Rectangle',
125
130
  :'value' => :'String',
126
131
  :'page_index' => :'Integer',
@@ -161,6 +166,10 @@ module AsposePdfCloud
161
166
  self.partial_name = attributes[:'PartialName']
162
167
  end
163
168
 
169
+ if attributes.has_key?(:'FullName')
170
+ self.full_name = attributes[:'FullName']
171
+ end
172
+
164
173
  if attributes.has_key?(:'Rect')
165
174
  self.rect = attributes[:'Rect']
166
175
  end
@@ -266,6 +275,7 @@ module AsposePdfCloud
266
275
  self.class == o.class &&
267
276
  links == o.links &&
268
277
  partial_name == o.partial_name &&
278
+ full_name == o.full_name &&
269
279
  rect == o.rect &&
270
280
  value == o.value &&
271
281
  page_index == o.page_index &&
@@ -296,7 +306,7 @@ module AsposePdfCloud
296
306
  # Calculates hash code according to all attributes.
297
307
  # @return [Fixnum] Hash code
298
308
  def hash
299
- [links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multi_select, selected].hash
309
+ [links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multi_select, selected].hash
300
310
  end
301
311
 
302
312
  # Builds the object from hash
@@ -31,6 +31,9 @@ module AsposePdfCloud
31
31
  # Field name.
32
32
  attr_accessor :partial_name
33
33
 
34
+ # Full Field name.
35
+ attr_accessor :full_name
36
+
34
37
  # Field rectangle.
35
38
  attr_accessor :rect
36
39
 
@@ -106,6 +109,7 @@ module AsposePdfCloud
106
109
  {
107
110
  :'links' => :'Links',
108
111
  :'partial_name' => :'PartialName',
112
+ :'full_name' => :'FullName',
109
113
  :'rect' => :'Rect',
110
114
  :'value' => :'Value',
111
115
  :'page_index' => :'PageIndex',
@@ -137,6 +141,7 @@ module AsposePdfCloud
137
141
  {
138
142
  :'links' => :'Array<Link>',
139
143
  :'partial_name' => :'String',
144
+ :'full_name' => :'String',
140
145
  :'rect' => :'Rectangle',
141
146
  :'value' => :'String',
142
147
  :'page_index' => :'Integer',
@@ -181,6 +186,10 @@ module AsposePdfCloud
181
186
  self.partial_name = attributes[:'PartialName']
182
187
  end
183
188
 
189
+ if attributes.has_key?(:'FullName')
190
+ self.full_name = attributes[:'FullName']
191
+ end
192
+
184
193
  if attributes.has_key?(:'Rect')
185
194
  self.rect = attributes[:'Rect']
186
195
  end
@@ -304,6 +313,7 @@ module AsposePdfCloud
304
313
  self.class == o.class &&
305
314
  links == o.links &&
306
315
  partial_name == o.partial_name &&
316
+ full_name == o.full_name &&
307
317
  rect == o.rect &&
308
318
  value == o.value &&
309
319
  page_index == o.page_index &&
@@ -338,7 +348,7 @@ module AsposePdfCloud
338
348
  # Calculates hash code according to all attributes.
339
349
  # @return [Fixnum] Hash code
340
350
  def hash
341
- [links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multi_select, selected, options, active_state, editable, spell_check].hash
351
+ [links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multi_select, selected, options, active_state, editable, spell_check].hash
342
352
  end
343
353
 
344
354
  # Builds the object from hash
@@ -31,6 +31,9 @@ module AsposePdfCloud
31
31
  # Field name.
32
32
  attr_accessor :partial_name
33
33
 
34
+ # Full Field name.
35
+ attr_accessor :full_name
36
+
34
37
  # Field rectangle.
35
38
  attr_accessor :rect
36
39
 
@@ -88,6 +91,7 @@ module AsposePdfCloud
88
91
  {
89
92
  :'links' => :'Links',
90
93
  :'partial_name' => :'PartialName',
94
+ :'full_name' => :'FullName',
91
95
  :'rect' => :'Rect',
92
96
  :'value' => :'Value',
93
97
  :'page_index' => :'PageIndex',
@@ -113,6 +117,7 @@ module AsposePdfCloud
113
117
  {
114
118
  :'links' => :'Array<Link>',
115
119
  :'partial_name' => :'String',
120
+ :'full_name' => :'String',
116
121
  :'rect' => :'Rectangle',
117
122
  :'value' => :'String',
118
123
  :'page_index' => :'Integer',
@@ -151,6 +156,10 @@ module AsposePdfCloud
151
156
  self.partial_name = attributes[:'PartialName']
152
157
  end
153
158
 
159
+ if attributes.has_key?(:'FullName')
160
+ self.full_name = attributes[:'FullName']
161
+ end
162
+
154
163
  if attributes.has_key?(:'Rect')
155
164
  self.rect = attributes[:'Rect']
156
165
  end
@@ -248,6 +257,7 @@ module AsposePdfCloud
248
257
  self.class == o.class &&
249
258
  links == o.links &&
250
259
  partial_name == o.partial_name &&
260
+ full_name == o.full_name &&
251
261
  rect == o.rect &&
252
262
  value == o.value &&
253
263
  page_index == o.page_index &&
@@ -276,7 +286,7 @@ module AsposePdfCloud
276
286
  # Calculates hash code according to all attributes.
277
287
  # @return [Fixnum] Hash code
278
288
  def hash
279
- [links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border].hash
289
+ [links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border].hash
280
290
  end
281
291
 
282
292
  # Builds the object from hash
@@ -0,0 +1,283 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2020 Aspose.PDF Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+ =end
21
+
22
+ require 'date'
23
+ require 'time'
24
+
25
+ module AsposePdfCloud
26
+ # Represents Image Fragment DTO.
27
+ class ImageFragment
28
+ # Gets or sets full storage path of image.
29
+ attr_accessor :image_file
30
+
31
+ # Gets or sets fix width of the image.
32
+ attr_accessor :fix_width
33
+
34
+ # Gets or sets fix height of the image.
35
+ attr_accessor :fix_height
36
+
37
+ # Gets or sets horizontal alignment of the image.
38
+ attr_accessor :horizontal_alignment
39
+
40
+ # Gets or sets vertical alignment of the image.
41
+ attr_accessor :vertical_alignment
42
+
43
+ # Gets or sets ImageScale of the image.
44
+ attr_accessor :image_scale
45
+
46
+ # Gets or sets Margin of the image.
47
+ attr_accessor :margin
48
+
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'image_file' => :'ImageFile',
54
+ :'fix_width' => :'FixWidth',
55
+ :'fix_height' => :'FixHeight',
56
+ :'horizontal_alignment' => :'HorizontalAlignment',
57
+ :'vertical_alignment' => :'VerticalAlignment',
58
+ :'image_scale' => :'ImageScale',
59
+ :'margin' => :'Margin'
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.swagger_types
65
+ {
66
+ :'image_file' => :'String',
67
+ :'fix_width' => :'Float',
68
+ :'fix_height' => :'Float',
69
+ :'horizontal_alignment' => :'HorizontalAlignment',
70
+ :'vertical_alignment' => :'VerticalAlignment',
71
+ :'image_scale' => :'Float',
72
+ :'margin' => :'MarginInfo'
73
+ }
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ return unless attributes.is_a?(Hash)
80
+
81
+ # convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
83
+
84
+ if attributes.has_key?(:'ImageFile')
85
+ self.image_file = attributes[:'ImageFile']
86
+ end
87
+
88
+ if attributes.has_key?(:'FixWidth')
89
+ self.fix_width = attributes[:'FixWidth']
90
+ end
91
+
92
+ if attributes.has_key?(:'FixHeight')
93
+ self.fix_height = attributes[:'FixHeight']
94
+ end
95
+
96
+ if attributes.has_key?(:'HorizontalAlignment')
97
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
98
+ end
99
+
100
+ if attributes.has_key?(:'VerticalAlignment')
101
+ self.vertical_alignment = attributes[:'VerticalAlignment']
102
+ end
103
+
104
+ if attributes.has_key?(:'ImageScale')
105
+ self.image_scale = attributes[:'ImageScale']
106
+ end
107
+
108
+ if attributes.has_key?(:'Margin')
109
+ self.margin = attributes[:'Margin']
110
+ end
111
+
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properies with the reasons
116
+ def list_invalid_properties
117
+ invalid_properties = Array.new
118
+ if @image_file.nil?
119
+ invalid_properties.push("invalid value for 'image_file', image_file cannot be nil.")
120
+ end
121
+
122
+ if @image_file.to_s.length < 1
123
+ invalid_properties.push("invalid value for 'image_file', the character length must be great than or equal to 1.")
124
+ end
125
+
126
+ return invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ return false if @image_file.nil?
133
+ return false if @image_file.to_s.length < 1
134
+ return true
135
+ end
136
+
137
+ # Custom attribute writer method with validation
138
+ # @param [Object] image_file Value to be assigned
139
+ def image_file=(image_file)
140
+ if image_file.nil?
141
+ fail ArgumentError, "image_file cannot be nil"
142
+ end
143
+
144
+ if image_file.to_s.length < 1
145
+ fail ArgumentError, "invalid value for 'image_file', the character length must be great than or equal to 1."
146
+ end
147
+
148
+ @image_file = image_file
149
+ end
150
+
151
+ # Checks equality by comparing each attribute.
152
+ # @param [Object] Object to be compared
153
+ def ==(o)
154
+ return true if self.equal?(o)
155
+ self.class == o.class &&
156
+ image_file == o.image_file &&
157
+ fix_width == o.fix_width &&
158
+ fix_height == o.fix_height &&
159
+ horizontal_alignment == o.horizontal_alignment &&
160
+ vertical_alignment == o.vertical_alignment &&
161
+ image_scale == o.image_scale &&
162
+ margin == o.margin
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Fixnum] Hash code
173
+ def hash
174
+ [image_file, fix_width, fix_height, horizontal_alignment, vertical_alignment, image_scale, margin].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ self.class.swagger_types.each_pair do |key, type|
183
+ if type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
187
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
188
+ end
189
+ elsif !attributes[self.class.attribute_map[key]].nil?
190
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
191
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
192
+ end
193
+
194
+ self
195
+ end
196
+
197
+ # Deserializes the data based on type
198
+ # @param string type Data type
199
+ # @param string value Value to be deserialized
200
+ # @return [Object] Deserialized data
201
+ def _deserialize(type, value)
202
+ case type.to_sym
203
+ when :DateTime
204
+ DateTime.parse(value)
205
+ when :Date
206
+ Date.parse(value)
207
+ when :String
208
+ value.to_s
209
+ when :Integer
210
+ value.to_i
211
+ when :Float
212
+ value.to_f
213
+ when :BOOLEAN
214
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
215
+ true
216
+ else
217
+ false
218
+ end
219
+ when :Object
220
+ # generic object (usually a Hash), return directly
221
+ value
222
+ when /\AArray<(?<inner_type>.+)>\z/
223
+ inner_type = Regexp.last_match[:inner_type]
224
+ value.map { |v| _deserialize(inner_type, v) }
225
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
226
+ k_type = Regexp.last_match[:k_type]
227
+ v_type = Regexp.last_match[:v_type]
228
+ {}.tap do |hash|
229
+ value.each do |k, v|
230
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
231
+ end
232
+ end
233
+ else # model
234
+ temp_model = AsposePdfCloud.const_get(type).new
235
+ temp_model.build_from_hash(value)
236
+ end
237
+ end
238
+
239
+ # Returns the string representation of the object
240
+ # @return [String] String presentation of the object
241
+ def to_s
242
+ to_hash.to_s
243
+ end
244
+
245
+ # to_body is an alias to to_hash (backward compatibility)
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_body
248
+ to_hash
249
+ end
250
+
251
+ # Returns the object in the form of hash
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_hash
254
+ hash = {}
255
+ self.class.attribute_map.each_pair do |attr, param|
256
+ value = self.send(attr)
257
+ next if value.nil?
258
+ hash[param] = _to_hash(value)
259
+ end
260
+ hash
261
+ end
262
+
263
+ # Outputs non-array value in the form of hash
264
+ # For object, use to_hash. Otherwise, just return the value
265
+ # @param [Object] value Any valid value
266
+ # @return [Hash] Returns the value in the form of hash
267
+ def _to_hash(value)
268
+ if value.is_a?(Array)
269
+ value.compact.map{ |v| _to_hash(v) }
270
+ elsif value.is_a?(Hash)
271
+ {}.tap do |hash|
272
+ value.each { |k, v| hash[k] = _to_hash(v) }
273
+ end
274
+ elsif value.respond_to? :to_hash
275
+ value.to_hash
276
+ else
277
+ value
278
+ end
279
+ end
280
+
281
+ end
282
+
283
+ end