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
@@ -0,0 +1,267 @@
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
+ # Represents header/footer info of notes slide
27
+ class NotesSlideHeaderFooter < ResourceBase
28
+ # True if date is displayed in the footer
29
+ attr_accessor :is_date_time_visible
30
+
31
+ # Text to be displayed as date in the footer
32
+ attr_accessor :date_time_text
33
+
34
+ # True if footer is displayed
35
+ attr_accessor :is_footer_visible
36
+
37
+ # Text to be displayed in the footer
38
+ attr_accessor :footer_text
39
+
40
+ # True if header is displayed
41
+ attr_accessor :is_header_visible
42
+
43
+ # Text to be displayed in the header
44
+ attr_accessor :header_text
45
+
46
+ # True if slide number is displayed in the footer
47
+ attr_accessor :is_slide_number_visible
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ super.merge({
52
+ :'is_date_time_visible' => :'IsDateTimeVisible',
53
+ :'date_time_text' => :'DateTimeText',
54
+ :'is_footer_visible' => :'IsFooterVisible',
55
+ :'footer_text' => :'FooterText',
56
+ :'is_header_visible' => :'IsHeaderVisible',
57
+ :'header_text' => :'HeaderText',
58
+ :'is_slide_number_visible' => :'IsSlideNumberVisible',
59
+ })
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.swagger_types
64
+ super.merge({
65
+ :'is_date_time_visible' => :'BOOLEAN',
66
+ :'date_time_text' => :'String',
67
+ :'is_footer_visible' => :'BOOLEAN',
68
+ :'footer_text' => :'String',
69
+ :'is_header_visible' => :'BOOLEAN',
70
+ :'header_text' => :'String',
71
+ :'is_slide_number_visible' => :'BOOLEAN',
72
+ })
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ super
79
+
80
+ if attributes.has_key?(:'IsDateTimeVisible')
81
+ self.is_date_time_visible = attributes[:'IsDateTimeVisible']
82
+ end
83
+
84
+ if attributes.has_key?(:'DateTimeText')
85
+ self.date_time_text = attributes[:'DateTimeText']
86
+ end
87
+
88
+ if attributes.has_key?(:'IsFooterVisible')
89
+ self.is_footer_visible = attributes[:'IsFooterVisible']
90
+ end
91
+
92
+ if attributes.has_key?(:'FooterText')
93
+ self.footer_text = attributes[:'FooterText']
94
+ end
95
+
96
+ if attributes.has_key?(:'IsHeaderVisible')
97
+ self.is_header_visible = attributes[:'IsHeaderVisible']
98
+ end
99
+
100
+ if attributes.has_key?(:'HeaderText')
101
+ self.header_text = attributes[:'HeaderText']
102
+ end
103
+
104
+ if attributes.has_key?(:'IsSlideNumberVisible')
105
+ self.is_slide_number_visible = attributes[:'IsSlideNumberVisible']
106
+ end
107
+ end
108
+
109
+ # Show invalid properties with the reasons. Usually used together with valid?
110
+ # @return Array for valid properties with the reasons
111
+ def list_invalid_properties
112
+ invalid_properties = super
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ return false if !super
120
+ true
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(o)
126
+ return true if self.equal?(o)
127
+ self.class == o.class &&
128
+ self_uri == o.self_uri &&
129
+ alternate_links == o.alternate_links &&
130
+ is_date_time_visible == o.is_date_time_visible &&
131
+ date_time_text == o.date_time_text &&
132
+ is_footer_visible == o.is_footer_visible &&
133
+ footer_text == o.footer_text &&
134
+ is_header_visible == o.is_header_visible &&
135
+ header_text == o.header_text &&
136
+ is_slide_number_visible == o.is_slide_number_visible
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Fixnum] Hash code
147
+ def hash
148
+ [self_uri, alternate_links, is_date_time_visible, date_time_text, is_footer_visible, footer_text, is_header_visible, header_text, is_slide_number_visible].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ self.class.swagger_types.each_pair do |key, type|
157
+ mapKey = self.class.attribute_map[key]
158
+ if !mapKey.nil?
159
+ val = attributes[mapKey]
160
+ if val.nil?
161
+ mapKeyString = mapKey.to_s
162
+ mapKeyString[0] = mapKeyString[0].downcase
163
+ mapKey = mapKeyString.to_sym
164
+ val = attributes[mapKey]
165
+ end
166
+ if !val.nil?
167
+ if type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the the attribute
169
+ # is documented as an array but the input is not
170
+ if val.is_a?(Array)
171
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
172
+ end
173
+ else
174
+ self.send("#{key}=", _deserialize(type, val))
175
+ end
176
+ end
177
+ end
178
+ end
179
+
180
+ self
181
+ end
182
+
183
+ # Deserializes the data based on type
184
+ # @param string type Data type
185
+ # @param string value Value to be deserialized
186
+ # @return [Object] Deserialized data
187
+ def _deserialize(type, value)
188
+ case type.to_sym
189
+ when :DateTime
190
+ DateTime.parse(value)
191
+ when :Date
192
+ Date.parse(value)
193
+ when :String
194
+ value.to_s
195
+ when :Integer
196
+ value.to_i
197
+ when :Float
198
+ value.to_f
199
+ when :BOOLEAN
200
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
201
+ true
202
+ else
203
+ false
204
+ end
205
+ when :Object
206
+ # generic object (usually a Hash), return directly
207
+ value
208
+ when /\AArray<(?<inner_type>.+)>\z/
209
+ inner_type = Regexp.last_match[:inner_type]
210
+ value.map { |v| _deserialize(inner_type, v) }
211
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
212
+ k_type = Regexp.last_match[:k_type]
213
+ v_type = Regexp.last_match[:v_type]
214
+ {}.tap do |hash|
215
+ value.each do |k, v|
216
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
+ end
218
+ end
219
+ else # model
220
+ temp_model = AsposeSlidesCloud.const_get(type).new
221
+ temp_model.build_from_hash(value)
222
+ end
223
+ end
224
+
225
+ # Returns the string representation of the object
226
+ # @return [String] String presentation of the object
227
+ def to_s
228
+ to_hash.to_s
229
+ end
230
+
231
+ # to_body is an alias to to_hash (backward compatibility)
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_body
234
+ to_hash
235
+ end
236
+
237
+ # Returns the object in the form of hash
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_hash
240
+ hash = {}
241
+ self.class.attribute_map.each_pair do |attr, param|
242
+ value = self.send(attr)
243
+ next if value.nil?
244
+ hash[param] = _to_hash(value)
245
+ end
246
+ hash
247
+ end
248
+
249
+ # Outputs non-array value in the form of hash
250
+ # For object, use to_hash. Otherwise, just return the value
251
+ # @param [Object] value Any valid value
252
+ # @return [Hash] Returns the value in the form of hash
253
+ def _to_hash(value)
254
+ if value.is_a?(Array)
255
+ value.compact.map { |v| _to_hash(v) }
256
+ elsif value.is_a?(Hash)
257
+ {}.tap do |hash|
258
+ value.each { |k, v| hash[k] = _to_hash(v) }
259
+ end
260
+ elsif value.respond_to? :to_hash
261
+ value.to_hash
262
+ else
263
+ value
264
+ end
265
+ end
266
+ end
267
+ end
@@ -82,7 +82,6 @@ module AsposeSlidesCloud
82
82
  self.substitute_picture_title = attributes[:'SubstitutePictureTitle']
83
83
  end
84
84
  self.type = "OleObjectFrame"
85
- self.shape_type = "OleObjectFrame"
86
85
  end
87
86
 
88
87
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -125,7 +124,6 @@ module AsposeSlidesCloud
125
124
  effect_format == o.effect_format &&
126
125
  line_format == o.line_format &&
127
126
  type == o.type &&
128
- shape_type == o.shape_type &&
129
127
  is_object_icon == o.is_object_icon &&
130
128
  substitute_picture_title == o.substitute_picture_title
131
129
  end
@@ -139,7 +137,7 @@ module AsposeSlidesCloud
139
137
  # Calculates hash code according to all attributes.
140
138
  # @return [Fixnum] Hash code
141
139
  def hash
142
- [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, is_object_icon, substitute_picture_title].hash
140
+ [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, is_object_icon, substitute_picture_title].hash
143
141
  end
144
142
 
145
143
  # 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
- :'paragraph_links' => :'Array<ResourceUriElement>',
41
+ :'paragraph_links' => :'Array<ResourceUri>',
42
42
  })
43
43
  end
44
44
 
@@ -97,7 +97,7 @@ module AsposeSlidesCloud
97
97
  :'crop_right' => :'Float',
98
98
  :'crop_top' => :'Float',
99
99
  :'dpi' => :'Integer',
100
- :'image' => :'ResourceUriElement',
100
+ :'image' => :'ResourceUri',
101
101
  :'base64_data' => :'String',
102
102
  :'svg_data' => :'String',
103
103
  :'picture_fill_mode' => :'String',
@@ -73,7 +73,6 @@ module AsposeSlidesCloud
73
73
  self.picture_fill_format = attributes[:'PictureFillFormat']
74
74
  end
75
75
  self.type = "PictureFrame"
76
- self.shape_type = "PictureFrame"
77
76
  end
78
77
 
79
78
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -112,7 +111,6 @@ module AsposeSlidesCloud
112
111
  line_format == o.line_format &&
113
112
  type == o.type &&
114
113
  shape_type == o.shape_type &&
115
- geometry_shape_type == o.geometry_shape_type &&
116
114
  picture_fill_format == o.picture_fill_format
117
115
  end
118
116
 
@@ -125,7 +123,7 @@ module AsposeSlidesCloud
125
123
  # Calculates hash code according to all attributes.
126
124
  # @return [Fixnum] Hash code
127
125
  def hash
128
- [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, picture_fill_format].hash
126
+ [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, picture_fill_format].hash
129
127
  end
130
128
 
131
129
  # Builds the object from hash
@@ -80,7 +80,7 @@ module AsposeSlidesCloud
80
80
  :'orientation' => :'String',
81
81
  :'size' => :'String',
82
82
  :'type' => :'String',
83
- :'shape' => :'ResourceUriElement',
83
+ :'shape' => :'ResourceUri',
84
84
  })
85
85
  end
86
86
 
@@ -34,12 +34,38 @@ module AsposeSlidesCloud
34
34
  # Get or sets the indexes of slides to merge
35
35
  attr_accessor :slides
36
36
 
37
+ # Merge (request or storage).
38
+ attr_accessor :source
39
+
40
+ class EnumAttributeValidator
41
+ attr_reader :datatype
42
+ attr_reader :allowable_values
43
+
44
+ def initialize(datatype, allowable_values)
45
+ @allowable_values = allowable_values.map do |value|
46
+ case datatype.to_s
47
+ when /Integer/i
48
+ value.to_i
49
+ when /Float/i
50
+ value.to_f
51
+ else
52
+ value
53
+ end
54
+ end
55
+ end
56
+
57
+ def valid?(value)
58
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
59
+ end
60
+ end
61
+
37
62
  # Attribute mapping from ruby-style variable name to JSON key.
38
63
  def self.attribute_map
39
64
  {
40
65
  :'path' => :'Path',
41
66
  :'password' => :'Password',
42
67
  :'slides' => :'Slides',
68
+ :'source' => :'Source',
43
69
  }
44
70
  end
45
71
 
@@ -49,6 +75,7 @@ module AsposeSlidesCloud
49
75
  :'path' => :'String',
50
76
  :'password' => :'String',
51
77
  :'slides' => :'Array<Integer>',
78
+ :'source' => :'String',
52
79
  }
53
80
  end
54
81
 
@@ -73,6 +100,10 @@ module AsposeSlidesCloud
73
100
  self.slides = value
74
101
  end
75
102
  end
103
+
104
+ if attributes.has_key?(:'Source')
105
+ self.source = attributes[:'Source']
106
+ end
76
107
  end
77
108
 
78
109
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -85,9 +116,21 @@ module AsposeSlidesCloud
85
116
  # Check to see if the all the properties in the model are valid
86
117
  # @return true if the model is valid
87
118
  def valid?
119
+ source_validator = EnumAttributeValidator.new('String', ['Storage', 'Request'])
120
+ return false unless source_validator.valid?(@source)
88
121
  true
89
122
  end
90
123
 
124
+ # Custom attribute writer method checking allowed values (enum).
125
+ # @param [Object] source Object to be assigned
126
+ def source=(source)
127
+ validator = EnumAttributeValidator.new('String', ['Storage', 'Request'])
128
+ unless validator.valid?(source)
129
+ fail ArgumentError, 'invalid value for "source", must be one of #{validator.allowable_values}.'
130
+ end
131
+ @source = source
132
+ end
133
+
91
134
  # Checks equality by comparing each attribute.
92
135
  # @param [Object] Object to be compared
93
136
  def ==(o)
@@ -95,7 +138,8 @@ module AsposeSlidesCloud
95
138
  self.class == o.class &&
96
139
  path == o.path &&
97
140
  password == o.password &&
98
- slides == o.slides
141
+ slides == o.slides &&
142
+ source == o.source
99
143
  end
100
144
 
101
145
  # @see the `==` method
@@ -107,7 +151,7 @@ module AsposeSlidesCloud
107
151
  # Calculates hash code according to all attributes.
108
152
  # @return [Fixnum] Hash code
109
153
  def hash
110
- [path, password, slides].hash
154
+ [path, password, slides, source].hash
111
155
  end
112
156
 
113
157
  # Builds the object from hash
@@ -0,0 +1,217 @@
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
+ # Protection properties.
27
+ class ProtectionProperties < ResourceBase
28
+ # True if document properties are encrypted. Has effect only for password protected presentations.
29
+ attr_accessor :encrypt_document_properties
30
+
31
+ # True if the document should be opened as read-only.
32
+ attr_accessor :read_only_recommended
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ super.merge({
37
+ :'encrypt_document_properties' => :'EncryptDocumentProperties',
38
+ :'read_only_recommended' => :'ReadOnlyRecommended',
39
+ })
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ super.merge({
45
+ :'encrypt_document_properties' => :'BOOLEAN',
46
+ :'read_only_recommended' => :'BOOLEAN',
47
+ })
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ super
54
+
55
+ if attributes.has_key?(:'EncryptDocumentProperties')
56
+ self.encrypt_document_properties = attributes[:'EncryptDocumentProperties']
57
+ end
58
+
59
+ if attributes.has_key?(:'ReadOnlyRecommended')
60
+ self.read_only_recommended = attributes[:'ReadOnlyRecommended']
61
+ end
62
+ end
63
+
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = super
68
+ invalid_properties
69
+ end
70
+
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ return false if !super
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ self_uri == o.self_uri &&
84
+ alternate_links == o.alternate_links &&
85
+ encrypt_document_properties == o.encrypt_document_properties &&
86
+ read_only_recommended == o.read_only_recommended
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Fixnum] Hash code
97
+ def hash
98
+ [self_uri, alternate_links, encrypt_document_properties, read_only_recommended].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.swagger_types.each_pair do |key, type|
107
+ mapKey = self.class.attribute_map[key]
108
+ if !mapKey.nil?
109
+ val = attributes[mapKey]
110
+ if val.nil?
111
+ mapKeyString = mapKey.to_s
112
+ mapKeyString[0] = mapKeyString[0].downcase
113
+ mapKey = mapKeyString.to_sym
114
+ val = attributes[mapKey]
115
+ end
116
+ if !val.nil?
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the the attribute
119
+ # is documented as an array but the input is not
120
+ if val.is_a?(Array)
121
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
122
+ end
123
+ else
124
+ self.send("#{key}=", _deserialize(type, val))
125
+ end
126
+ end
127
+ end
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :DateTime
140
+ DateTime.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :BOOLEAN
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ temp_model = AsposeSlidesCloud.const_get(type).new
171
+ temp_model.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ next if value.nil?
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+ end
217
+ end