aspose_slides_cloud 23.1.0 → 23.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,533 @@
1
+ =begin
2
+ Copyright (c) 2019 Aspose Pty Ltd
3
+
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
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
21
+ =end
22
+
23
+ require 'date'
24
+
25
+ module AsposeSlidesCloud
26
+ # Paragraph formatting properties.
27
+ class ParagraphFormat
28
+ # Depth.
29
+ attr_accessor :depth
30
+
31
+ # Text alignment.
32
+ attr_accessor :alignment
33
+
34
+ # Left margin.
35
+ attr_accessor :margin_left
36
+
37
+ # Right margin.
38
+ attr_accessor :margin_right
39
+
40
+ # Left spacing.
41
+ attr_accessor :space_before
42
+
43
+ # Right spacing.
44
+ attr_accessor :space_after
45
+
46
+ # Spacing between lines.
47
+ attr_accessor :space_within
48
+
49
+ # Font alignment.
50
+ attr_accessor :font_alignment
51
+
52
+ # First line indent.
53
+ attr_accessor :indent
54
+
55
+ # Determines whether the Right to Left writing is used in a paragraph. No inheritance applied.
56
+ attr_accessor :right_to_left
57
+
58
+ # Determines whether the East Asian line break is used in a paragraph. No inheritance applied.
59
+ attr_accessor :east_asian_line_break
60
+
61
+ # Determines whether the Latin line break is used in a paragraph. No inheritance applied.
62
+ attr_accessor :latin_line_break
63
+
64
+ # Determines whether the hanging punctuation is used in a paragraph. No inheritance applied.
65
+ attr_accessor :hanging_punctuation
66
+
67
+ # Returns or sets default tabulation size with no inheritance.
68
+ attr_accessor :default_tab_size
69
+
70
+ # Default portion format.
71
+ attr_accessor :default_portion_format
72
+
73
+ # Bullet char.
74
+ attr_accessor :bullet_char
75
+
76
+ # Bullet height.
77
+ attr_accessor :bullet_height
78
+
79
+ # Bullet type.
80
+ attr_accessor :bullet_type
81
+
82
+ # Starting number for a numbered bullet.
83
+ attr_accessor :numbered_bullet_start_with
84
+
85
+ # Numbered bullet style.
86
+ attr_accessor :numbered_bullet_style
87
+
88
+ # Bullet fill format.
89
+ attr_accessor :bullet_fill_format
90
+
91
+ class EnumAttributeValidator
92
+ attr_reader :datatype
93
+ attr_reader :allowable_values
94
+
95
+ def initialize(datatype, allowable_values)
96
+ @allowable_values = allowable_values.map do |value|
97
+ case datatype.to_s
98
+ when /Integer/i
99
+ value.to_i
100
+ when /Float/i
101
+ value.to_f
102
+ else
103
+ value
104
+ end
105
+ end
106
+ end
107
+
108
+ def valid?(value)
109
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
110
+ end
111
+ end
112
+
113
+ # Attribute mapping from ruby-style variable name to JSON key.
114
+ def self.attribute_map
115
+ {
116
+ :'depth' => :'Depth',
117
+ :'alignment' => :'Alignment',
118
+ :'margin_left' => :'MarginLeft',
119
+ :'margin_right' => :'MarginRight',
120
+ :'space_before' => :'SpaceBefore',
121
+ :'space_after' => :'SpaceAfter',
122
+ :'space_within' => :'SpaceWithin',
123
+ :'font_alignment' => :'FontAlignment',
124
+ :'indent' => :'Indent',
125
+ :'right_to_left' => :'RightToLeft',
126
+ :'east_asian_line_break' => :'EastAsianLineBreak',
127
+ :'latin_line_break' => :'LatinLineBreak',
128
+ :'hanging_punctuation' => :'HangingPunctuation',
129
+ :'default_tab_size' => :'DefaultTabSize',
130
+ :'default_portion_format' => :'DefaultPortionFormat',
131
+ :'bullet_char' => :'BulletChar',
132
+ :'bullet_height' => :'BulletHeight',
133
+ :'bullet_type' => :'BulletType',
134
+ :'numbered_bullet_start_with' => :'NumberedBulletStartWith',
135
+ :'numbered_bullet_style' => :'NumberedBulletStyle',
136
+ :'bullet_fill_format' => :'BulletFillFormat',
137
+ }
138
+ end
139
+
140
+ # Attribute type mapping.
141
+ def self.swagger_types
142
+ {
143
+ :'depth' => :'Integer',
144
+ :'alignment' => :'String',
145
+ :'margin_left' => :'Float',
146
+ :'margin_right' => :'Float',
147
+ :'space_before' => :'Float',
148
+ :'space_after' => :'Float',
149
+ :'space_within' => :'Float',
150
+ :'font_alignment' => :'String',
151
+ :'indent' => :'Float',
152
+ :'right_to_left' => :'String',
153
+ :'east_asian_line_break' => :'String',
154
+ :'latin_line_break' => :'String',
155
+ :'hanging_punctuation' => :'String',
156
+ :'default_tab_size' => :'Float',
157
+ :'default_portion_format' => :'PortionFormat',
158
+ :'bullet_char' => :'String',
159
+ :'bullet_height' => :'Float',
160
+ :'bullet_type' => :'String',
161
+ :'numbered_bullet_start_with' => :'Integer',
162
+ :'numbered_bullet_style' => :'String',
163
+ :'bullet_fill_format' => :'FillFormat',
164
+ }
165
+ end
166
+
167
+ # Initializes the object
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ def initialize(attributes = {})
170
+ return unless attributes.is_a?(Hash)
171
+
172
+ # convert string to symbol for hash key
173
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
174
+
175
+ if attributes.has_key?(:'Depth')
176
+ self.depth = attributes[:'Depth']
177
+ end
178
+
179
+ if attributes.has_key?(:'Alignment')
180
+ self.alignment = attributes[:'Alignment']
181
+ end
182
+
183
+ if attributes.has_key?(:'MarginLeft')
184
+ self.margin_left = attributes[:'MarginLeft']
185
+ end
186
+
187
+ if attributes.has_key?(:'MarginRight')
188
+ self.margin_right = attributes[:'MarginRight']
189
+ end
190
+
191
+ if attributes.has_key?(:'SpaceBefore')
192
+ self.space_before = attributes[:'SpaceBefore']
193
+ end
194
+
195
+ if attributes.has_key?(:'SpaceAfter')
196
+ self.space_after = attributes[:'SpaceAfter']
197
+ end
198
+
199
+ if attributes.has_key?(:'SpaceWithin')
200
+ self.space_within = attributes[:'SpaceWithin']
201
+ end
202
+
203
+ if attributes.has_key?(:'FontAlignment')
204
+ self.font_alignment = attributes[:'FontAlignment']
205
+ end
206
+
207
+ if attributes.has_key?(:'Indent')
208
+ self.indent = attributes[:'Indent']
209
+ end
210
+
211
+ if attributes.has_key?(:'RightToLeft')
212
+ self.right_to_left = attributes[:'RightToLeft']
213
+ end
214
+
215
+ if attributes.has_key?(:'EastAsianLineBreak')
216
+ self.east_asian_line_break = attributes[:'EastAsianLineBreak']
217
+ end
218
+
219
+ if attributes.has_key?(:'LatinLineBreak')
220
+ self.latin_line_break = attributes[:'LatinLineBreak']
221
+ end
222
+
223
+ if attributes.has_key?(:'HangingPunctuation')
224
+ self.hanging_punctuation = attributes[:'HangingPunctuation']
225
+ end
226
+
227
+ if attributes.has_key?(:'DefaultTabSize')
228
+ self.default_tab_size = attributes[:'DefaultTabSize']
229
+ end
230
+
231
+ if attributes.has_key?(:'DefaultPortionFormat')
232
+ self.default_portion_format = attributes[:'DefaultPortionFormat']
233
+ end
234
+
235
+ if attributes.has_key?(:'BulletChar')
236
+ self.bullet_char = attributes[:'BulletChar']
237
+ end
238
+
239
+ if attributes.has_key?(:'BulletHeight')
240
+ self.bullet_height = attributes[:'BulletHeight']
241
+ end
242
+
243
+ if attributes.has_key?(:'BulletType')
244
+ self.bullet_type = attributes[:'BulletType']
245
+ end
246
+
247
+ if attributes.has_key?(:'NumberedBulletStartWith')
248
+ self.numbered_bullet_start_with = attributes[:'NumberedBulletStartWith']
249
+ end
250
+
251
+ if attributes.has_key?(:'NumberedBulletStyle')
252
+ self.numbered_bullet_style = attributes[:'NumberedBulletStyle']
253
+ end
254
+
255
+ if attributes.has_key?(:'BulletFillFormat')
256
+ self.bullet_fill_format = attributes[:'BulletFillFormat']
257
+ end
258
+ end
259
+
260
+ # Show invalid properties with the reasons. Usually used together with valid?
261
+ # @return Array for valid properties with the reasons
262
+ def list_invalid_properties
263
+ invalid_properties = Array.new
264
+ invalid_properties
265
+ end
266
+
267
+ # Check to see if the all the properties in the model are valid
268
+ # @return true if the model is valid
269
+ def valid?
270
+ alignment_validator = EnumAttributeValidator.new('String', ['Left', 'Center', 'Right', 'Justify', 'JustifyLow', 'Distributed', 'NotDefined'])
271
+ return false unless alignment_validator.valid?(@alignment)
272
+ font_alignment_validator = EnumAttributeValidator.new('String', ['Automatic', 'Top', 'Center', 'Bottom', 'Baseline', 'Default'])
273
+ return false unless font_alignment_validator.valid?(@font_alignment)
274
+ right_to_left_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
275
+ return false unless right_to_left_validator.valid?(@right_to_left)
276
+ east_asian_line_break_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
277
+ return false unless east_asian_line_break_validator.valid?(@east_asian_line_break)
278
+ latin_line_break_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
279
+ return false unless latin_line_break_validator.valid?(@latin_line_break)
280
+ hanging_punctuation_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
281
+ return false unless hanging_punctuation_validator.valid?(@hanging_punctuation)
282
+ bullet_type_validator = EnumAttributeValidator.new('String', ['None', 'Symbol', 'Numbered', 'Picture', 'NotDefined'])
283
+ return false unless bullet_type_validator.valid?(@bullet_type)
284
+ numbered_bullet_style_validator = EnumAttributeValidator.new('String', ['BulletAlphaLCPeriod', 'BulletAlphaUCPeriod', 'BulletArabicParenRight', 'BulletArabicPeriod', 'BulletRomanLCParenBoth', 'BulletRomanLCParenRight', 'BulletRomanLCPeriod', 'BulletRomanUCPeriod', 'BulletAlphaLCParenBoth', 'BulletAlphaLCParenRight', 'BulletAlphaUCParenBoth', 'BulletAlphaUCParenRight', 'BulletArabicParenBoth', 'BulletArabicPlain', 'BulletRomanUCParenBoth', 'BulletRomanUCParenRight', 'BulletSimpChinPlain', 'BulletSimpChinPeriod', 'BulletCircleNumDBPlain', 'BulletCircleNumWDWhitePlain', 'BulletCircleNumWDBlackPlain', 'BulletTradChinPlain', 'BulletTradChinPeriod', 'BulletArabicAlphaDash', 'BulletArabicAbjadDash', 'BulletHebrewAlphaDash', 'BulletKanjiKoreanPlain', 'BulletKanjiKoreanPeriod', 'BulletArabicDBPlain', 'BulletArabicDBPeriod', 'BulletThaiAlphaPeriod', 'BulletThaiAlphaParenRight', 'BulletThaiAlphaParenBoth', 'BulletThaiNumPeriod', 'BulletThaiNumParenRight', 'BulletThaiNumParenBoth', 'BulletHindiAlphaPeriod', 'BulletHindiNumPeriod', 'BulletKanjiSimpChinDBPeriod', 'BulletHindiNumParenRight', 'BulletHindiAlpha1Period', 'NotDefined'])
285
+ return false unless numbered_bullet_style_validator.valid?(@numbered_bullet_style)
286
+ true
287
+ end
288
+
289
+ # Custom attribute writer method checking allowed values (enum).
290
+ # @param [Object] alignment Object to be assigned
291
+ def alignment=(alignment)
292
+ validator = EnumAttributeValidator.new('String', ['Left', 'Center', 'Right', 'Justify', 'JustifyLow', 'Distributed', 'NotDefined'])
293
+ unless validator.valid?(alignment)
294
+ fail ArgumentError, 'invalid value for "alignment", must be one of #{validator.allowable_values}.'
295
+ end
296
+ @alignment = alignment
297
+ end
298
+
299
+ # Custom attribute writer method checking allowed values (enum).
300
+ # @param [Object] font_alignment Object to be assigned
301
+ def font_alignment=(font_alignment)
302
+ validator = EnumAttributeValidator.new('String', ['Automatic', 'Top', 'Center', 'Bottom', 'Baseline', 'Default'])
303
+ unless validator.valid?(font_alignment)
304
+ fail ArgumentError, 'invalid value for "font_alignment", must be one of #{validator.allowable_values}.'
305
+ end
306
+ @font_alignment = font_alignment
307
+ end
308
+
309
+ # Custom attribute writer method checking allowed values (enum).
310
+ # @param [Object] right_to_left Object to be assigned
311
+ def right_to_left=(right_to_left)
312
+ validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
313
+ unless validator.valid?(right_to_left)
314
+ fail ArgumentError, 'invalid value for "right_to_left", must be one of #{validator.allowable_values}.'
315
+ end
316
+ @right_to_left = right_to_left
317
+ end
318
+
319
+ # Custom attribute writer method checking allowed values (enum).
320
+ # @param [Object] east_asian_line_break Object to be assigned
321
+ def east_asian_line_break=(east_asian_line_break)
322
+ validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
323
+ unless validator.valid?(east_asian_line_break)
324
+ fail ArgumentError, 'invalid value for "east_asian_line_break", must be one of #{validator.allowable_values}.'
325
+ end
326
+ @east_asian_line_break = east_asian_line_break
327
+ end
328
+
329
+ # Custom attribute writer method checking allowed values (enum).
330
+ # @param [Object] latin_line_break Object to be assigned
331
+ def latin_line_break=(latin_line_break)
332
+ validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
333
+ unless validator.valid?(latin_line_break)
334
+ fail ArgumentError, 'invalid value for "latin_line_break", must be one of #{validator.allowable_values}.'
335
+ end
336
+ @latin_line_break = latin_line_break
337
+ end
338
+
339
+ # Custom attribute writer method checking allowed values (enum).
340
+ # @param [Object] hanging_punctuation Object to be assigned
341
+ def hanging_punctuation=(hanging_punctuation)
342
+ validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
343
+ unless validator.valid?(hanging_punctuation)
344
+ fail ArgumentError, 'invalid value for "hanging_punctuation", must be one of #{validator.allowable_values}.'
345
+ end
346
+ @hanging_punctuation = hanging_punctuation
347
+ end
348
+
349
+ # Custom attribute writer method checking allowed values (enum).
350
+ # @param [Object] bullet_type Object to be assigned
351
+ def bullet_type=(bullet_type)
352
+ validator = EnumAttributeValidator.new('String', ['None', 'Symbol', 'Numbered', 'Picture', 'NotDefined'])
353
+ unless validator.valid?(bullet_type)
354
+ fail ArgumentError, 'invalid value for "bullet_type", must be one of #{validator.allowable_values}.'
355
+ end
356
+ @bullet_type = bullet_type
357
+ end
358
+
359
+ # Custom attribute writer method checking allowed values (enum).
360
+ # @param [Object] numbered_bullet_style Object to be assigned
361
+ def numbered_bullet_style=(numbered_bullet_style)
362
+ validator = EnumAttributeValidator.new('String', ['BulletAlphaLCPeriod', 'BulletAlphaUCPeriod', 'BulletArabicParenRight', 'BulletArabicPeriod', 'BulletRomanLCParenBoth', 'BulletRomanLCParenRight', 'BulletRomanLCPeriod', 'BulletRomanUCPeriod', 'BulletAlphaLCParenBoth', 'BulletAlphaLCParenRight', 'BulletAlphaUCParenBoth', 'BulletAlphaUCParenRight', 'BulletArabicParenBoth', 'BulletArabicPlain', 'BulletRomanUCParenBoth', 'BulletRomanUCParenRight', 'BulletSimpChinPlain', 'BulletSimpChinPeriod', 'BulletCircleNumDBPlain', 'BulletCircleNumWDWhitePlain', 'BulletCircleNumWDBlackPlain', 'BulletTradChinPlain', 'BulletTradChinPeriod', 'BulletArabicAlphaDash', 'BulletArabicAbjadDash', 'BulletHebrewAlphaDash', 'BulletKanjiKoreanPlain', 'BulletKanjiKoreanPeriod', 'BulletArabicDBPlain', 'BulletArabicDBPeriod', 'BulletThaiAlphaPeriod', 'BulletThaiAlphaParenRight', 'BulletThaiAlphaParenBoth', 'BulletThaiNumPeriod', 'BulletThaiNumParenRight', 'BulletThaiNumParenBoth', 'BulletHindiAlphaPeriod', 'BulletHindiNumPeriod', 'BulletKanjiSimpChinDBPeriod', 'BulletHindiNumParenRight', 'BulletHindiAlpha1Period', 'NotDefined'])
363
+ unless validator.valid?(numbered_bullet_style)
364
+ fail ArgumentError, 'invalid value for "numbered_bullet_style", must be one of #{validator.allowable_values}.'
365
+ end
366
+ @numbered_bullet_style = numbered_bullet_style
367
+ end
368
+
369
+ # Checks equality by comparing each attribute.
370
+ # @param [Object] Object to be compared
371
+ def ==(o)
372
+ return true if self.equal?(o)
373
+ self.class == o.class &&
374
+ depth == o.depth &&
375
+ alignment == o.alignment &&
376
+ margin_left == o.margin_left &&
377
+ margin_right == o.margin_right &&
378
+ space_before == o.space_before &&
379
+ space_after == o.space_after &&
380
+ space_within == o.space_within &&
381
+ font_alignment == o.font_alignment &&
382
+ indent == o.indent &&
383
+ right_to_left == o.right_to_left &&
384
+ east_asian_line_break == o.east_asian_line_break &&
385
+ latin_line_break == o.latin_line_break &&
386
+ hanging_punctuation == o.hanging_punctuation &&
387
+ default_tab_size == o.default_tab_size &&
388
+ default_portion_format == o.default_portion_format &&
389
+ bullet_char == o.bullet_char &&
390
+ bullet_height == o.bullet_height &&
391
+ bullet_type == o.bullet_type &&
392
+ numbered_bullet_start_with == o.numbered_bullet_start_with &&
393
+ numbered_bullet_style == o.numbered_bullet_style &&
394
+ bullet_fill_format == o.bullet_fill_format
395
+ end
396
+
397
+ # @see the `==` method
398
+ # @param [Object] Object to be compared
399
+ def eql?(o)
400
+ self == o
401
+ end
402
+
403
+ # Calculates hash code according to all attributes.
404
+ # @return [Fixnum] Hash code
405
+ def hash
406
+ [depth, alignment, margin_left, margin_right, space_before, space_after, space_within, font_alignment, indent, right_to_left, east_asian_line_break, latin_line_break, hanging_punctuation, default_tab_size, default_portion_format, bullet_char, bullet_height, bullet_type, numbered_bullet_start_with, numbered_bullet_style, bullet_fill_format].hash
407
+ end
408
+
409
+ # Builds the object from hash
410
+ # @param [Hash] attributes Model attributes in the form of hash
411
+ # @return [Object] Returns the model itself
412
+ def build_from_hash(attributes)
413
+ return nil unless attributes.is_a?(Hash)
414
+ self.class.swagger_types.each_pair do |key, type|
415
+ mapKey = self.class.attribute_map[key]
416
+ if !mapKey.nil?
417
+ val = attributes[mapKey]
418
+ if val.nil?
419
+ mapKeyString = mapKey.to_s
420
+ mapKeyString[0] = mapKeyString[0].downcase
421
+ mapKey = mapKeyString.to_sym
422
+ val = attributes[mapKey]
423
+ end
424
+ if !val.nil?
425
+ if type =~ /\AArray<(.*)>/i
426
+ # check to ensure the input is an array given that the the attribute
427
+ # is documented as an array but the input is not
428
+ if val.is_a?(Array)
429
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
430
+ end
431
+ else
432
+ self.send("#{key}=", _deserialize(type, val))
433
+ end
434
+ end
435
+ end
436
+ end
437
+
438
+ self
439
+ end
440
+
441
+ # Deserializes the data based on type
442
+ # @param string type Data type
443
+ # @param string value Value to be deserialized
444
+ # @return [Object] Deserialized data
445
+ def _deserialize(type, value)
446
+ if value.nil?
447
+ nil
448
+ else
449
+ case type.to_sym
450
+ when :DateTime
451
+ DateTime.parse(value)
452
+ when :Date
453
+ Date.parse(value)
454
+ when :String
455
+ value.to_s
456
+ when :Integer
457
+ value.to_i
458
+ when :Float
459
+ value.to_f
460
+ when :BOOLEAN
461
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
462
+ true
463
+ else
464
+ false
465
+ end
466
+ when :Object
467
+ # generic object (usually a Hash), return directly
468
+ value
469
+ when /\AArray<(?<inner_type>.+)>\z/
470
+ inner_type = Regexp.last_match[:inner_type]
471
+ value.map { |v| _deserialize(inner_type, v) }
472
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
473
+ k_type = Regexp.last_match[:k_type]
474
+ v_type = Regexp.last_match[:v_type]
475
+ {}.tap do |hash|
476
+ value.each do |k, v|
477
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
478
+ end
479
+ end
480
+ else # model
481
+ registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
482
+ if registry_type
483
+ type = registry_type
484
+ end
485
+ temp_model = AsposeSlidesCloud.const_get(type).new
486
+ temp_model.build_from_hash(value)
487
+ end
488
+ end
489
+ end
490
+
491
+ # Returns the string representation of the object
492
+ # @return [String] String presentation of the object
493
+ def to_s
494
+ to_hash.to_s
495
+ end
496
+
497
+ # to_body is an alias to to_hash (backward compatibility)
498
+ # @return [Hash] Returns the object in the form of hash
499
+ def to_body
500
+ to_hash
501
+ end
502
+
503
+ # Returns the object in the form of hash
504
+ # @return [Hash] Returns the object in the form of hash
505
+ def to_hash
506
+ hash = {}
507
+ self.class.attribute_map.each_pair do |attr, param|
508
+ value = self.send(attr)
509
+ next if value.nil?
510
+ hash[param] = _to_hash(value)
511
+ end
512
+ hash
513
+ end
514
+
515
+ # Outputs non-array value in the form of hash
516
+ # For object, use to_hash. Otherwise, just return the value
517
+ # @param [Object] value Any valid value
518
+ # @return [Hash] Returns the value in the form of hash
519
+ def _to_hash(value)
520
+ if value.is_a?(Array)
521
+ value.compact.map { |v| _to_hash(v) }
522
+ elsif value.is_a?(Hash)
523
+ {}.tap do |hash|
524
+ value.each { |k, v| hash[k] = _to_hash(v) }
525
+ end
526
+ elsif value.respond_to? :to_hash
527
+ value.to_hash
528
+ else
529
+ value
530
+ end
531
+ end
532
+ end
533
+ end
@@ -252,7 +252,7 @@ module AsposeSlidesCloud
252
252
  return false if !super
253
253
  text_compression_validator = EnumAttributeValidator.new('String', ['None', 'Flate'])
254
254
  return false unless text_compression_validator.valid?(@text_compression)
255
- compliance_validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b', 'PdfA1a', 'PdfUa'])
255
+ compliance_validator = EnumAttributeValidator.new('String', ['Pdf15', 'Pdf16', 'Pdf17', 'PdfA1b', 'PdfA1a', 'PdfA2b', 'PdfA2a', 'PdfA3b', 'PdfA3a', 'PdfUa', 'PdfA2u'])
256
256
  return false unless compliance_validator.valid?(@compliance)
257
257
  notes_position_validator = EnumAttributeValidator.new('String', ['None', 'BottomFull', 'BottomTruncated'])
258
258
  return false unless notes_position_validator.valid?(@notes_position)
@@ -274,7 +274,7 @@ module AsposeSlidesCloud
274
274
  # Custom attribute writer method checking allowed values (enum).
275
275
  # @param [Object] compliance Object to be assigned
276
276
  def compliance=(compliance)
277
- validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b', 'PdfA1a', 'PdfUa'])
277
+ validator = EnumAttributeValidator.new('String', ['Pdf15', 'Pdf16', 'Pdf17', 'PdfA1b', 'PdfA1a', 'PdfA2b', 'PdfA2a', 'PdfA3b', 'PdfA3a', 'PdfUa', 'PdfA2u'])
278
278
  unless validator.valid?(compliance)
279
279
  fail ArgumentError, 'invalid value for "compliance", must be one of #{validator.allowable_values}.'
280
280
  end