aspose_slides_cloud 20.8.0 → 21.3.0

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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/TestData/Sections.pptx +0 -0
  4. data/TestData/test-unprotected.pptx +0 -0
  5. data/TestData/test.pdf +0 -0
  6. data/TestData/test.pptx +0 -0
  7. data/lib/aspose_slides_cloud.rb +8 -2
  8. data/lib/aspose_slides_cloud/api/slides_api.rb +10162 -3258
  9. data/lib/aspose_slides_cloud/api/slides_api_requests.rb +949 -225
  10. data/lib/aspose_slides_cloud/api_client.rb +24 -22
  11. data/lib/aspose_slides_cloud/configuration.rb +7 -2
  12. data/lib/aspose_slides_cloud/models/audio_frame.rb +1 -3
  13. data/lib/aspose_slides_cloud/models/chart.rb +3 -5
  14. data/lib/aspose_slides_cloud/models/chart_category.rb +19 -9
  15. data/lib/aspose_slides_cloud/models/connector.rb +1 -2
  16. data/lib/aspose_slides_cloud/models/{resource_uri_element.rb → data_point.rb} +4 -14
  17. data/lib/aspose_slides_cloud/models/document.rb +6 -6
  18. data/lib/aspose_slides_cloud/models/geometry_shape.rb +18 -19
  19. data/lib/aspose_slides_cloud/models/graphical_object.rb +2 -4
  20. data/lib/aspose_slides_cloud/models/group_shape.rb +2 -4
  21. data/lib/aspose_slides_cloud/models/header_footer.rb +247 -0
  22. data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +2 -12
  23. data/lib/aspose_slides_cloud/models/layout_slide.rb +2 -2
  24. data/lib/aspose_slides_cloud/models/layout_slides.rb +1 -1
  25. data/lib/aspose_slides_cloud/models/line_format.rb +23 -1
  26. data/lib/aspose_slides_cloud/models/master_slide.rb +2 -2
  27. data/lib/aspose_slides_cloud/models/master_slides.rb +1 -1
  28. data/lib/aspose_slides_cloud/models/notes_slide.rb +1 -1
  29. data/lib/aspose_slides_cloud/models/notes_slide_header_footer.rb +267 -0
  30. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +1 -3
  31. data/lib/aspose_slides_cloud/models/paragraphs.rb +1 -1
  32. data/lib/aspose_slides_cloud/models/picture_fill.rb +1 -1
  33. data/lib/aspose_slides_cloud/models/picture_frame.rb +1 -3
  34. data/lib/aspose_slides_cloud/models/placeholder.rb +1 -1
  35. data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +46 -2
  36. data/lib/aspose_slides_cloud/models/protection_properties.rb +217 -0
  37. data/lib/aspose_slides_cloud/models/section.rb +234 -0
  38. data/lib/aspose_slides_cloud/models/sections.rb +209 -0
  39. data/lib/aspose_slides_cloud/models/series.rb +2 -2
  40. data/lib/aspose_slides_cloud/models/shape.rb +2 -3
  41. data/lib/aspose_slides_cloud/models/shape_base.rb +3 -24
  42. data/lib/aspose_slides_cloud/models/shapes.rb +1 -1
  43. data/lib/aspose_slides_cloud/models/slide.rb +8 -8
  44. data/lib/aspose_slides_cloud/models/slide_properties.rb +315 -0
  45. data/lib/aspose_slides_cloud/models/slides.rb +1 -1
  46. data/lib/aspose_slides_cloud/models/smart_art.rb +1 -3
  47. data/lib/aspose_slides_cloud/models/smart_art_node.rb +1 -1
  48. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +2 -3
  49. data/lib/aspose_slides_cloud/models/table.rb +1 -3
  50. data/lib/aspose_slides_cloud/models/theme.rb +3 -3
  51. data/lib/aspose_slides_cloud/models/video_frame.rb +1 -3
  52. data/lib/aspose_slides_cloud/models/waterfall_chart_data_point.rb +206 -0
  53. data/lib/aspose_slides_cloud/type_registry.rb +24 -12
  54. data/lib/aspose_slides_cloud/version.rb +1 -1
  55. data/spec/api/slides_api_spec.rb +25848 -18001
  56. data/spec/extra/extra_spec.rb +73 -107
  57. data/spec/spec_utils.rb +21 -24
  58. data/testConfig.json +2 -2
  59. data/testRules.json +160 -103
  60. metadata +14 -3
@@ -65,7 +65,7 @@ module AsposeSlidesCloud
65
65
  def self.swagger_types
66
66
  super.merge({
67
67
  :'text' => :'String',
68
- :'paragraphs' => :'ResourceUriElement',
68
+ :'paragraphs' => :'ResourceUri',
69
69
  })
70
70
  end
71
71
 
@@ -120,7 +120,6 @@ module AsposeSlidesCloud
120
120
  line_format == o.line_format &&
121
121
  type == o.type &&
122
122
  shape_type == o.shape_type &&
123
- geometry_shape_type == o.geometry_shape_type &&
124
123
  text == o.text &&
125
124
  paragraphs == o.paragraphs
126
125
  end
@@ -134,7 +133,7 @@ module AsposeSlidesCloud
134
133
  # Calculates hash code according to all attributes.
135
134
  # @return [Fixnum] Hash code
136
135
  def hash
137
- [self_uri, alternate_links, name, width, height, alternative_text, alternative_text_title, hidden, x, y, z_order_position, shapes, fill_format, effect_format, line_format, type, shape_type, geometry_shape_type, text, paragraphs].hash
136
+ [self_uri, alternate_links, name, width, height, alternative_text, alternative_text_title, hidden, x, y, z_order_position, shapes, fill_format, effect_format, line_format, type, shape_type, text, paragraphs].hash
138
137
  end
139
138
 
140
139
  # Builds the object from hash
@@ -66,8 +66,6 @@ module AsposeSlidesCloud
66
66
 
67
67
  attr_accessor :type
68
68
 
69
- attr_accessor :shape_type
70
-
71
69
  class EnumAttributeValidator
72
70
  attr_reader :datatype
73
71
  attr_reader :allowable_values
@@ -107,7 +105,6 @@ module AsposeSlidesCloud
107
105
  :'effect_format' => :'EffectFormat',
108
106
  :'line_format' => :'LineFormat',
109
107
  :'type' => :'Type',
110
- :'shape_type' => :'ShapeType',
111
108
  })
112
109
  end
113
110
 
@@ -123,12 +120,11 @@ module AsposeSlidesCloud
123
120
  :'x' => :'Float',
124
121
  :'y' => :'Float',
125
122
  :'z_order_position' => :'Integer',
126
- :'shapes' => :'ResourceUriElement',
123
+ :'shapes' => :'ResourceUri',
127
124
  :'fill_format' => :'FillFormat',
128
125
  :'effect_format' => :'EffectFormat',
129
126
  :'line_format' => :'LineFormat',
130
127
  :'type' => :'String',
131
- :'shape_type' => :'String',
132
128
  })
133
129
  end
134
130
 
@@ -192,10 +188,6 @@ module AsposeSlidesCloud
192
188
  if attributes.has_key?(:'Type')
193
189
  self.type = attributes[:'Type']
194
190
  end
195
-
196
- if attributes.has_key?(:'ShapeType')
197
- self.shape_type = attributes[:'ShapeType']
198
- end
199
191
  end
200
192
 
201
193
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -216,8 +208,6 @@ module AsposeSlidesCloud
216
208
  return false if @z_order_position.nil?
217
209
  type_validator = EnumAttributeValidator.new('String', ['Shape', 'Chart', 'Table', 'PictureFrame', 'VideoFrame', 'AudioFrame', 'SmartArt', 'OleObjectFrame', 'GroupShape', 'GraphicalObject', 'Connector', 'SmartArtShape'])
218
210
  return false unless type_validator.valid?(@type)
219
- shape_type_validator = EnumAttributeValidator.new('String', ['Custom', 'Line', 'LineInverse', 'Triangle', 'RightTriangle', 'Rectangle', 'Diamond', 'Parallelogram', 'Trapezoid', 'NonIsoscelesTrapezoid', 'Pentagon', 'Hexagon', 'Heptagon', 'Octagon', 'Decagon', 'Dodecagon', 'FourPointedStar', 'FivePointedStar', 'SixPointedStar', 'SevenPointedStar', 'EightPointedStar', 'TenPointedStar', 'TwelvePointedStar', 'SixteenPointedStar', 'TwentyFourPointedStar', 'ThirtyTwoPointedStar', 'RoundCornerRectangle', 'OneRoundCornerRectangle', 'TwoSamesideRoundCornerRectangle', 'TwoDiagonalRoundCornerRectangle', 'OneSnipOneRoundCornerRectangle', 'OneSnipCornerRectangle', 'TwoSamesideSnipCornerRectangle', 'TwoDiagonalSnipCornerRectangle', 'Plaque', 'Ellipse', 'Teardrop', 'HomePlate', 'Chevron', 'PieWedge', 'Pie', 'BlockArc', 'Donut', 'NoSmoking', 'RightArrow', 'LeftArrow', 'UpArrow', 'DownArrow', 'StripedRightArrow', 'NotchedRightArrow', 'BentUpArrow', 'LeftRightArrow', 'UpDownArrow', 'LeftUpArrow', 'LeftRightUpArrow', 'QuadArrow', 'CalloutLeftArrow', 'CalloutRightArrow', 'CalloutUpArrow', 'CalloutDownArrow', 'CalloutLeftRightArrow', 'CalloutUpDownArrow', 'CalloutQuadArrow', 'BentArrow', 'UTurnArrow', 'CircularArrow', 'LeftCircularArrow', 'LeftRightCircularArrow', 'CurvedRightArrow', 'CurvedLeftArrow', 'CurvedUpArrow', 'CurvedDownArrow', 'SwooshArrow', 'Cube', 'Can', 'LightningBolt', 'Heart', 'Sun', 'Moon', 'SmileyFace', 'IrregularSeal1', 'IrregularSeal2', 'FoldedCorner', 'Bevel', 'Frame', 'HalfFrame', 'Corner', 'DiagonalStripe', 'Chord', 'CurvedArc', 'LeftBracket', 'RightBracket', 'LeftBrace', 'RightBrace', 'BracketPair', 'BracePair', 'StraightConnector1', 'BentConnector2', 'BentConnector3', 'BentConnector4', 'BentConnector5', 'CurvedConnector2', 'CurvedConnector3', 'CurvedConnector4', 'CurvedConnector5', 'Callout1', 'Callout2', 'Callout3', 'Callout1WithAccent', 'Callout2WithAccent', 'Callout3WithAccent', 'Callout1WithBorder', 'Callout2WithBorder', 'Callout3WithBorder', 'Callout1WithBorderAndAccent', 'Callout2WithBorderAndAccent', 'Callout3WithBorderAndAccent', 'CalloutWedgeRectangle', 'CalloutWedgeRoundRectangle', 'CalloutWedgeEllipse', 'CalloutCloud', 'Cloud', 'Ribbon', 'Ribbon2', 'EllipseRibbon', 'EllipseRibbon2', 'LeftRightRibbon', 'VerticalScroll', 'HorizontalScroll', 'Wave', 'DoubleWave', 'Plus', 'ProcessFlow', 'DecisionFlow', 'InputOutputFlow', 'PredefinedProcessFlow', 'InternalStorageFlow', 'DocumentFlow', 'MultiDocumentFlow', 'TerminatorFlow', 'PreparationFlow', 'ManualInputFlow', 'ManualOperationFlow', 'ConnectorFlow', 'PunchedCardFlow', 'PunchedTapeFlow', 'SummingJunctionFlow', 'OrFlow', 'CollateFlow', 'SortFlow', 'ExtractFlow', 'MergeFlow', 'OfflineStorageFlow', 'OnlineStorageFlow', 'MagneticTapeFlow', 'MagneticDiskFlow', 'MagneticDrumFlow', 'DisplayFlow', 'DelayFlow', 'AlternateProcessFlow', 'OffPageConnectorFlow', 'BlankButton', 'HomeButton', 'HelpButton', 'InformationButton', 'ForwardOrNextButton', 'BackOrPreviousButton', 'EndButton', 'BeginningButton', 'ReturnButton', 'DocumentButton', 'SoundButton', 'MovieButton', 'Gear6', 'Gear9', 'Funnel', 'PlusMath', 'MinusMath', 'MultiplyMath', 'DivideMath', 'EqualMath', 'NotEqualMath', 'CornerTabs', 'SquareTabs', 'PlaqueTabs', 'ChartX', 'ChartStar', 'ChartPlus', 'Chart', 'Table', 'PictureFrame', 'VideoFrame', 'AudioFrame', 'Diagram', 'OleObjectFrame', 'GroupShape', 'GraphicalObject', 'NotDefined'])
220
- return false unless shape_type_validator.valid?(@shape_type)
221
211
  true
222
212
  end
223
213
 
@@ -231,16 +221,6 @@ module AsposeSlidesCloud
231
221
  @type = type
232
222
  end
233
223
 
234
- # Custom attribute writer method checking allowed values (enum).
235
- # @param [Object] shape_type Object to be assigned
236
- def shape_type=(shape_type)
237
- validator = EnumAttributeValidator.new('String', ['Custom', 'Line', 'LineInverse', 'Triangle', 'RightTriangle', 'Rectangle', 'Diamond', 'Parallelogram', 'Trapezoid', 'NonIsoscelesTrapezoid', 'Pentagon', 'Hexagon', 'Heptagon', 'Octagon', 'Decagon', 'Dodecagon', 'FourPointedStar', 'FivePointedStar', 'SixPointedStar', 'SevenPointedStar', 'EightPointedStar', 'TenPointedStar', 'TwelvePointedStar', 'SixteenPointedStar', 'TwentyFourPointedStar', 'ThirtyTwoPointedStar', 'RoundCornerRectangle', 'OneRoundCornerRectangle', 'TwoSamesideRoundCornerRectangle', 'TwoDiagonalRoundCornerRectangle', 'OneSnipOneRoundCornerRectangle', 'OneSnipCornerRectangle', 'TwoSamesideSnipCornerRectangle', 'TwoDiagonalSnipCornerRectangle', 'Plaque', 'Ellipse', 'Teardrop', 'HomePlate', 'Chevron', 'PieWedge', 'Pie', 'BlockArc', 'Donut', 'NoSmoking', 'RightArrow', 'LeftArrow', 'UpArrow', 'DownArrow', 'StripedRightArrow', 'NotchedRightArrow', 'BentUpArrow', 'LeftRightArrow', 'UpDownArrow', 'LeftUpArrow', 'LeftRightUpArrow', 'QuadArrow', 'CalloutLeftArrow', 'CalloutRightArrow', 'CalloutUpArrow', 'CalloutDownArrow', 'CalloutLeftRightArrow', 'CalloutUpDownArrow', 'CalloutQuadArrow', 'BentArrow', 'UTurnArrow', 'CircularArrow', 'LeftCircularArrow', 'LeftRightCircularArrow', 'CurvedRightArrow', 'CurvedLeftArrow', 'CurvedUpArrow', 'CurvedDownArrow', 'SwooshArrow', 'Cube', 'Can', 'LightningBolt', 'Heart', 'Sun', 'Moon', 'SmileyFace', 'IrregularSeal1', 'IrregularSeal2', 'FoldedCorner', 'Bevel', 'Frame', 'HalfFrame', 'Corner', 'DiagonalStripe', 'Chord', 'CurvedArc', 'LeftBracket', 'RightBracket', 'LeftBrace', 'RightBrace', 'BracketPair', 'BracePair', 'StraightConnector1', 'BentConnector2', 'BentConnector3', 'BentConnector4', 'BentConnector5', 'CurvedConnector2', 'CurvedConnector3', 'CurvedConnector4', 'CurvedConnector5', 'Callout1', 'Callout2', 'Callout3', 'Callout1WithAccent', 'Callout2WithAccent', 'Callout3WithAccent', 'Callout1WithBorder', 'Callout2WithBorder', 'Callout3WithBorder', 'Callout1WithBorderAndAccent', 'Callout2WithBorderAndAccent', 'Callout3WithBorderAndAccent', 'CalloutWedgeRectangle', 'CalloutWedgeRoundRectangle', 'CalloutWedgeEllipse', 'CalloutCloud', 'Cloud', 'Ribbon', 'Ribbon2', 'EllipseRibbon', 'EllipseRibbon2', 'LeftRightRibbon', 'VerticalScroll', 'HorizontalScroll', 'Wave', 'DoubleWave', 'Plus', 'ProcessFlow', 'DecisionFlow', 'InputOutputFlow', 'PredefinedProcessFlow', 'InternalStorageFlow', 'DocumentFlow', 'MultiDocumentFlow', 'TerminatorFlow', 'PreparationFlow', 'ManualInputFlow', 'ManualOperationFlow', 'ConnectorFlow', 'PunchedCardFlow', 'PunchedTapeFlow', 'SummingJunctionFlow', 'OrFlow', 'CollateFlow', 'SortFlow', 'ExtractFlow', 'MergeFlow', 'OfflineStorageFlow', 'OnlineStorageFlow', 'MagneticTapeFlow', 'MagneticDiskFlow', 'MagneticDrumFlow', 'DisplayFlow', 'DelayFlow', 'AlternateProcessFlow', 'OffPageConnectorFlow', 'BlankButton', 'HomeButton', 'HelpButton', 'InformationButton', 'ForwardOrNextButton', 'BackOrPreviousButton', 'EndButton', 'BeginningButton', 'ReturnButton', 'DocumentButton', 'SoundButton', 'MovieButton', 'Gear6', 'Gear9', 'Funnel', 'PlusMath', 'MinusMath', 'MultiplyMath', 'DivideMath', 'EqualMath', 'NotEqualMath', 'CornerTabs', 'SquareTabs', 'PlaqueTabs', 'ChartX', 'ChartStar', 'ChartPlus', 'Chart', 'Table', 'PictureFrame', 'VideoFrame', 'AudioFrame', 'Diagram', 'OleObjectFrame', 'GroupShape', 'GraphicalObject', 'NotDefined'])
238
- unless validator.valid?(shape_type)
239
- fail ArgumentError, 'invalid value for "shape_type", must be one of #{validator.allowable_values}.'
240
- end
241
- @shape_type = shape_type
242
- end
243
-
244
224
  # Checks equality by comparing each attribute.
245
225
  # @param [Object] Object to be compared
246
226
  def ==(o)
@@ -261,8 +241,7 @@ module AsposeSlidesCloud
261
241
  fill_format == o.fill_format &&
262
242
  effect_format == o.effect_format &&
263
243
  line_format == o.line_format &&
264
- type == o.type &&
265
- shape_type == o.shape_type
244
+ type == o.type
266
245
  end
267
246
 
268
247
  # @see the `==` method
@@ -274,7 +253,7 @@ module AsposeSlidesCloud
274
253
  # Calculates hash code according to all attributes.
275
254
  # @return [Fixnum] Hash code
276
255
  def hash
277
- [self_uri, alternate_links, name, width, height, alternative_text, alternative_text_title, hidden, x, y, z_order_position, shapes, fill_format, effect_format, line_format, type, shape_type].hash
256
+ [self_uri, alternate_links, name, width, height, alternative_text, alternative_text_title, hidden, x, y, z_order_position, shapes, fill_format, effect_format, line_format, type].hash
278
257
  end
279
258
 
280
259
  # Builds the object from hash
@@ -38,7 +38,7 @@ module AsposeSlidesCloud
38
38
  # Attribute type mapping.
39
39
  def self.swagger_types
40
40
  super.merge({
41
- :'shapes_links' => :'Array<ResourceUriElement>',
41
+ :'shapes_links' => :'Array<ResourceUri>',
42
42
  })
43
43
  end
44
44
 
@@ -81,14 +81,14 @@ module AsposeSlidesCloud
81
81
  :'width' => :'Float',
82
82
  :'height' => :'Float',
83
83
  :'show_master_shapes' => :'BOOLEAN',
84
- :'layout_slide' => :'ResourceUriElement',
85
- :'shapes' => :'ResourceUriElement',
86
- :'theme' => :'ResourceUriElement',
87
- :'placeholders' => :'ResourceUriElement',
88
- :'images' => :'ResourceUriElement',
89
- :'comments' => :'ResourceUriElement',
90
- :'background' => :'ResourceUriElement',
91
- :'notes_slide' => :'ResourceUriElement',
84
+ :'layout_slide' => :'ResourceUri',
85
+ :'shapes' => :'ResourceUri',
86
+ :'theme' => :'ResourceUri',
87
+ :'placeholders' => :'ResourceUri',
88
+ :'images' => :'ResourceUri',
89
+ :'comments' => :'ResourceUri',
90
+ :'background' => :'ResourceUri',
91
+ :'notes_slide' => :'ResourceUri',
92
92
  })
93
93
  end
94
94
 
@@ -0,0 +1,315 @@
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
+ # Slide properties.
27
+ class SlideProperties < ResourceBase
28
+ # First slide number.
29
+ attr_accessor :first_slide_number
30
+
31
+ # Slide orientation.
32
+ attr_accessor :orientation
33
+
34
+ # Scale type.
35
+ attr_accessor :scale_type
36
+
37
+ # Size type.
38
+ attr_accessor :size_type
39
+
40
+ # Width.
41
+ attr_accessor :width
42
+
43
+ # Height.
44
+ attr_accessor :height
45
+
46
+ class EnumAttributeValidator
47
+ attr_reader :datatype
48
+ attr_reader :allowable_values
49
+
50
+ def initialize(datatype, allowable_values)
51
+ @allowable_values = allowable_values.map do |value|
52
+ case datatype.to_s
53
+ when /Integer/i
54
+ value.to_i
55
+ when /Float/i
56
+ value.to_f
57
+ else
58
+ value
59
+ end
60
+ end
61
+ end
62
+
63
+ def valid?(value)
64
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
65
+ end
66
+ end
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ super.merge({
71
+ :'first_slide_number' => :'FirstSlideNumber',
72
+ :'orientation' => :'Orientation',
73
+ :'scale_type' => :'ScaleType',
74
+ :'size_type' => :'SizeType',
75
+ :'width' => :'Width',
76
+ :'height' => :'Height',
77
+ })
78
+ end
79
+
80
+ # Attribute type mapping.
81
+ def self.swagger_types
82
+ super.merge({
83
+ :'first_slide_number' => :'Integer',
84
+ :'orientation' => :'String',
85
+ :'scale_type' => :'String',
86
+ :'size_type' => :'String',
87
+ :'width' => :'Integer',
88
+ :'height' => :'Integer',
89
+ })
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ super
96
+
97
+ if attributes.has_key?(:'FirstSlideNumber')
98
+ self.first_slide_number = attributes[:'FirstSlideNumber']
99
+ end
100
+
101
+ if attributes.has_key?(:'Orientation')
102
+ self.orientation = attributes[:'Orientation']
103
+ end
104
+
105
+ if attributes.has_key?(:'ScaleType')
106
+ self.scale_type = attributes[:'ScaleType']
107
+ end
108
+
109
+ if attributes.has_key?(:'SizeType')
110
+ self.size_type = attributes[:'SizeType']
111
+ end
112
+
113
+ if attributes.has_key?(:'Width')
114
+ self.width = attributes[:'Width']
115
+ end
116
+
117
+ if attributes.has_key?(:'Height')
118
+ self.height = attributes[:'Height']
119
+ end
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properties with the reasons
124
+ def list_invalid_properties
125
+ invalid_properties = super
126
+ 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 !super
133
+ orientation_validator = EnumAttributeValidator.new('String', ['Landscape', 'Portrait'])
134
+ return false unless orientation_validator.valid?(@orientation)
135
+ scale_type_validator = EnumAttributeValidator.new('String', ['DoNotScale', 'EnsureFit', 'Maximize'])
136
+ return false unless scale_type_validator.valid?(@scale_type)
137
+ size_type_validator = EnumAttributeValidator.new('String', ['OnScreen', 'LetterPaper', 'A4Paper', 'Slide35mm', 'Overhead', 'Banner', 'Custom', 'Ledger', 'A3Paper', 'B4IsoPaper', 'B5IsoPaper', 'B4JisPaper', 'B5JisPaper', 'HagakiCard', 'OnScreen16x9', 'OnScreen16x10', 'Widescreen'])
138
+ return false unless size_type_validator.valid?(@size_type)
139
+ true
140
+ end
141
+
142
+ # Custom attribute writer method checking allowed values (enum).
143
+ # @param [Object] orientation Object to be assigned
144
+ def orientation=(orientation)
145
+ validator = EnumAttributeValidator.new('String', ['Landscape', 'Portrait'])
146
+ unless validator.valid?(orientation)
147
+ fail ArgumentError, 'invalid value for "orientation", must be one of #{validator.allowable_values}.'
148
+ end
149
+ @orientation = orientation
150
+ end
151
+
152
+ # Custom attribute writer method checking allowed values (enum).
153
+ # @param [Object] scale_type Object to be assigned
154
+ def scale_type=(scale_type)
155
+ validator = EnumAttributeValidator.new('String', ['DoNotScale', 'EnsureFit', 'Maximize'])
156
+ unless validator.valid?(scale_type)
157
+ fail ArgumentError, 'invalid value for "scale_type", must be one of #{validator.allowable_values}.'
158
+ end
159
+ @scale_type = scale_type
160
+ end
161
+
162
+ # Custom attribute writer method checking allowed values (enum).
163
+ # @param [Object] size_type Object to be assigned
164
+ def size_type=(size_type)
165
+ validator = EnumAttributeValidator.new('String', ['OnScreen', 'LetterPaper', 'A4Paper', 'Slide35mm', 'Overhead', 'Banner', 'Custom', 'Ledger', 'A3Paper', 'B4IsoPaper', 'B5IsoPaper', 'B4JisPaper', 'B5JisPaper', 'HagakiCard', 'OnScreen16x9', 'OnScreen16x10', 'Widescreen'])
166
+ unless validator.valid?(size_type)
167
+ fail ArgumentError, 'invalid value for "size_type", must be one of #{validator.allowable_values}.'
168
+ end
169
+ @size_type = size_type
170
+ end
171
+
172
+ # Checks equality by comparing each attribute.
173
+ # @param [Object] Object to be compared
174
+ def ==(o)
175
+ return true if self.equal?(o)
176
+ self.class == o.class &&
177
+ self_uri == o.self_uri &&
178
+ alternate_links == o.alternate_links &&
179
+ first_slide_number == o.first_slide_number &&
180
+ orientation == o.orientation &&
181
+ scale_type == o.scale_type &&
182
+ size_type == o.size_type &&
183
+ width == o.width &&
184
+ height == o.height
185
+ end
186
+
187
+ # @see the `==` method
188
+ # @param [Object] Object to be compared
189
+ def eql?(o)
190
+ self == o
191
+ end
192
+
193
+ # Calculates hash code according to all attributes.
194
+ # @return [Fixnum] Hash code
195
+ def hash
196
+ [self_uri, alternate_links, first_slide_number, orientation, scale_type, size_type, width, height].hash
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def build_from_hash(attributes)
203
+ return nil unless attributes.is_a?(Hash)
204
+ self.class.swagger_types.each_pair do |key, type|
205
+ mapKey = self.class.attribute_map[key]
206
+ if !mapKey.nil?
207
+ val = attributes[mapKey]
208
+ if val.nil?
209
+ mapKeyString = mapKey.to_s
210
+ mapKeyString[0] = mapKeyString[0].downcase
211
+ mapKey = mapKeyString.to_sym
212
+ val = attributes[mapKey]
213
+ end
214
+ if !val.nil?
215
+ if type =~ /\AArray<(.*)>/i
216
+ # check to ensure the input is an array given that the the attribute
217
+ # is documented as an array but the input is not
218
+ if val.is_a?(Array)
219
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
220
+ end
221
+ else
222
+ self.send("#{key}=", _deserialize(type, val))
223
+ end
224
+ end
225
+ end
226
+ end
227
+
228
+ self
229
+ end
230
+
231
+ # Deserializes the data based on type
232
+ # @param string type Data type
233
+ # @param string value Value to be deserialized
234
+ # @return [Object] Deserialized data
235
+ def _deserialize(type, value)
236
+ case type.to_sym
237
+ when :DateTime
238
+ DateTime.parse(value)
239
+ when :Date
240
+ Date.parse(value)
241
+ when :String
242
+ value.to_s
243
+ when :Integer
244
+ value.to_i
245
+ when :Float
246
+ value.to_f
247
+ when :BOOLEAN
248
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
249
+ true
250
+ else
251
+ false
252
+ end
253
+ when :Object
254
+ # generic object (usually a Hash), return directly
255
+ value
256
+ when /\AArray<(?<inner_type>.+)>\z/
257
+ inner_type = Regexp.last_match[:inner_type]
258
+ value.map { |v| _deserialize(inner_type, v) }
259
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
260
+ k_type = Regexp.last_match[:k_type]
261
+ v_type = Regexp.last_match[:v_type]
262
+ {}.tap do |hash|
263
+ value.each do |k, v|
264
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
265
+ end
266
+ end
267
+ else # model
268
+ temp_model = AsposeSlidesCloud.const_get(type).new
269
+ temp_model.build_from_hash(value)
270
+ end
271
+ end
272
+
273
+ # Returns the string representation of the object
274
+ # @return [String] String presentation of the object
275
+ def to_s
276
+ to_hash.to_s
277
+ end
278
+
279
+ # to_body is an alias to to_hash (backward compatibility)
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_body
282
+ to_hash
283
+ end
284
+
285
+ # Returns the object in the form of hash
286
+ # @return [Hash] Returns the object in the form of hash
287
+ def to_hash
288
+ hash = {}
289
+ self.class.attribute_map.each_pair do |attr, param|
290
+ value = self.send(attr)
291
+ next if value.nil?
292
+ hash[param] = _to_hash(value)
293
+ end
294
+ hash
295
+ end
296
+
297
+ # Outputs non-array value in the form of hash
298
+ # For object, use to_hash. Otherwise, just return the value
299
+ # @param [Object] value Any valid value
300
+ # @return [Hash] Returns the value in the form of hash
301
+ def _to_hash(value)
302
+ if value.is_a?(Array)
303
+ value.compact.map { |v| _to_hash(v) }
304
+ elsif value.is_a?(Hash)
305
+ {}.tap do |hash|
306
+ value.each { |k, v| hash[k] = _to_hash(v) }
307
+ end
308
+ elsif value.respond_to? :to_hash
309
+ value.to_hash
310
+ else
311
+ value
312
+ end
313
+ end
314
+ end
315
+ end