aspose_slides_cloud 21.12.1 → 22.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -40
  3. data/TestData/test-unprotected.pptx +0 -0
  4. data/TestData/test.pptx +0 -0
  5. data/aspose_slides_cloud.gemspec +1 -1
  6. data/lib/aspose_slides_cloud/api/slides_api.rb +442 -30
  7. data/lib/aspose_slides_cloud/api_client.rb +1 -1
  8. data/lib/aspose_slides_cloud/configuration.rb +1 -1
  9. data/lib/aspose_slides_cloud/models/accent_element.rb +239 -0
  10. data/lib/aspose_slides_cloud/models/arc_to_path_segment.rb +279 -0
  11. data/lib/aspose_slides_cloud/models/array_element.rb +305 -0
  12. data/lib/aspose_slides_cloud/models/audio_frame.rb +26 -4
  13. data/lib/aspose_slides_cloud/models/bar_element.rb +251 -0
  14. data/lib/aspose_slides_cloud/models/block_element.rb +231 -0
  15. data/lib/aspose_slides_cloud/models/border_box_element.rb +309 -0
  16. data/lib/aspose_slides_cloud/models/box_element.rb +279 -0
  17. data/lib/aspose_slides_cloud/models/chart.rb +3 -1
  18. data/lib/aspose_slides_cloud/models/close_path_segment.rb +219 -0
  19. data/lib/aspose_slides_cloud/models/connector.rb +3 -1
  20. data/lib/aspose_slides_cloud/models/cubic_bezier_to_path_segment.rb +309 -0
  21. data/lib/aspose_slides_cloud/models/delimiter_element.rb +293 -0
  22. data/lib/aspose_slides_cloud/models/export_format.rb +1 -0
  23. data/lib/aspose_slides_cloud/models/fraction_element.rb +261 -0
  24. data/lib/aspose_slides_cloud/models/function_element.rb +239 -0
  25. data/lib/aspose_slides_cloud/models/geometry_path.rb +263 -0
  26. data/lib/aspose_slides_cloud/models/geometry_paths.rb +209 -0
  27. data/lib/aspose_slides_cloud/models/geometry_shape.rb +3 -1
  28. data/lib/aspose_slides_cloud/models/gif_export_options.rb +230 -0
  29. data/lib/aspose_slides_cloud/models/graphical_object.rb +3 -1
  30. data/lib/aspose_slides_cloud/models/group_shape.rb +3 -1
  31. data/lib/aspose_slides_cloud/models/grouping_character_element.rb +283 -0
  32. data/lib/aspose_slides_cloud/models/hyperlink.rb +348 -0
  33. data/lib/aspose_slides_cloud/models/left_sub_superscript_element.rb +249 -0
  34. data/lib/aspose_slides_cloud/models/limit_element.rb +249 -0
  35. data/lib/aspose_slides_cloud/models/line_to_path_segment.rb +249 -0
  36. data/lib/aspose_slides_cloud/models/math_element.rb +240 -0
  37. data/lib/aspose_slides_cloud/models/math_paragraph.rb +253 -0
  38. data/lib/aspose_slides_cloud/models/matrix_element.rb +337 -0
  39. data/lib/aspose_slides_cloud/models/move_to_path_segment.rb +249 -0
  40. data/lib/aspose_slides_cloud/models/nary_operator_element.rb +311 -0
  41. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +3 -1
  42. data/lib/aspose_slides_cloud/models/path_segment.rb +240 -0
  43. data/lib/aspose_slides_cloud/models/picture_frame.rb +3 -1
  44. data/lib/aspose_slides_cloud/models/portion.rb +32 -2
  45. data/lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb +279 -0
  46. data/lib/aspose_slides_cloud/models/radical_element.rb +249 -0
  47. data/lib/aspose_slides_cloud/models/right_sub_superscript_element.rb +259 -0
  48. data/lib/aspose_slides_cloud/models/save.rb +2 -2
  49. data/lib/aspose_slides_cloud/models/save_slide.rb +2 -2
  50. data/lib/aspose_slides_cloud/models/shape.rb +3 -1
  51. data/lib/aspose_slides_cloud/models/shape_base.rb +21 -1
  52. data/lib/aspose_slides_cloud/models/slide_export_format.rb +1 -0
  53. data/lib/aspose_slides_cloud/models/smart_art.rb +3 -1
  54. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +3 -1
  55. data/lib/aspose_slides_cloud/models/subscript_element.rb +239 -0
  56. data/lib/aspose_slides_cloud/models/superscript_element.rb +239 -0
  57. data/lib/aspose_slides_cloud/models/table.rb +3 -1
  58. data/lib/aspose_slides_cloud/models/text_element.rb +229 -0
  59. data/lib/aspose_slides_cloud/models/video_frame.rb +5 -3
  60. data/lib/aspose_slides_cloud/models/xaml_export_options.rb +210 -0
  61. data/lib/aspose_slides_cloud/type_registry.rb +72 -0
  62. data/lib/aspose_slides_cloud/version.rb +1 -1
  63. data/lib/aspose_slides_cloud.rb +33 -0
  64. data/spec/api/slides_api_spec.rb +1203 -4
  65. data/spec/spec_utils.rb +7 -1
  66. data/testRules.json +9 -0
  67. metadata +39 -6
@@ -0,0 +1,279 @@
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
+ # Quadratic Bezier curve segment of the geometry path
27
+ class QuadraticBezierToPathSegment < PathSegment
28
+ # X coordinate of direction point
29
+ attr_accessor :x1
30
+
31
+ # Y coordinate of direction point
32
+ attr_accessor :y1
33
+
34
+ # X coordinate of end point
35
+ attr_accessor :x2
36
+
37
+ # Y coordinate of end point
38
+ attr_accessor :y2
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
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ super.merge({
65
+ :'x1' => :'X1',
66
+ :'y1' => :'Y1',
67
+ :'x2' => :'X2',
68
+ :'y2' => :'Y2',
69
+ })
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.swagger_types
74
+ super.merge({
75
+ :'x1' => :'Float',
76
+ :'y1' => :'Float',
77
+ :'x2' => :'Float',
78
+ :'y2' => :'Float',
79
+ })
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ super
86
+
87
+ if attributes.has_key?(:'X1')
88
+ self.x1 = attributes[:'X1']
89
+ end
90
+
91
+ if attributes.has_key?(:'Y1')
92
+ self.y1 = attributes[:'Y1']
93
+ end
94
+
95
+ if attributes.has_key?(:'X2')
96
+ self.x2 = attributes[:'X2']
97
+ end
98
+
99
+ if attributes.has_key?(:'Y2')
100
+ self.y2 = attributes[:'Y2']
101
+ end
102
+ self.type = "QuadBezierTo"
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = super
109
+ if @x1.nil?
110
+ invalid_properties.push('invalid value for "x1", x1 cannot be nil.')
111
+ end
112
+
113
+ if @y1.nil?
114
+ invalid_properties.push('invalid value for "y1", y1 cannot be nil.')
115
+ end
116
+
117
+ if @x2.nil?
118
+ invalid_properties.push('invalid value for "x2", x2 cannot be nil.')
119
+ end
120
+
121
+ if @y2.nil?
122
+ invalid_properties.push('invalid value for "y2", y2 cannot be nil.')
123
+ end
124
+
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ return false if !super
132
+ return false if @x1.nil?
133
+ return false if @y1.nil?
134
+ return false if @x2.nil?
135
+ return false if @y2.nil?
136
+ true
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ type == o.type &&
145
+ x1 == o.x1 &&
146
+ y1 == o.y1 &&
147
+ x2 == o.x2 &&
148
+ y2 == o.y2
149
+ end
150
+
151
+ # @see the `==` method
152
+ # @param [Object] Object to be compared
153
+ def eql?(o)
154
+ self == o
155
+ end
156
+
157
+ # Calculates hash code according to all attributes.
158
+ # @return [Fixnum] Hash code
159
+ def hash
160
+ [type, x1, y1, x2, y2].hash
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ self.class.swagger_types.each_pair do |key, type|
169
+ mapKey = self.class.attribute_map[key]
170
+ if !mapKey.nil?
171
+ val = attributes[mapKey]
172
+ if val.nil?
173
+ mapKeyString = mapKey.to_s
174
+ mapKeyString[0] = mapKeyString[0].downcase
175
+ mapKey = mapKeyString.to_sym
176
+ val = attributes[mapKey]
177
+ end
178
+ if !val.nil?
179
+ if type =~ /\AArray<(.*)>/i
180
+ # check to ensure the input is an array given that the the attribute
181
+ # is documented as an array but the input is not
182
+ if val.is_a?(Array)
183
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
184
+ end
185
+ else
186
+ self.send("#{key}=", _deserialize(type, val))
187
+ end
188
+ end
189
+ end
190
+ end
191
+
192
+ self
193
+ end
194
+
195
+ # Deserializes the data based on type
196
+ # @param string type Data type
197
+ # @param string value Value to be deserialized
198
+ # @return [Object] Deserialized data
199
+ def _deserialize(type, value)
200
+ case type.to_sym
201
+ when :DateTime
202
+ DateTime.parse(value)
203
+ when :Date
204
+ Date.parse(value)
205
+ when :String
206
+ value.to_s
207
+ when :Integer
208
+ value.to_i
209
+ when :Float
210
+ value.to_f
211
+ when :BOOLEAN
212
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
213
+ true
214
+ else
215
+ false
216
+ end
217
+ when :Object
218
+ # generic object (usually a Hash), return directly
219
+ value
220
+ when /\AArray<(?<inner_type>.+)>\z/
221
+ inner_type = Regexp.last_match[:inner_type]
222
+ value.map { |v| _deserialize(inner_type, v) }
223
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
224
+ k_type = Regexp.last_match[:k_type]
225
+ v_type = Regexp.last_match[:v_type]
226
+ {}.tap do |hash|
227
+ value.each do |k, v|
228
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
229
+ end
230
+ end
231
+ else # model
232
+ temp_model = AsposeSlidesCloud.const_get(type).new
233
+ temp_model.build_from_hash(value)
234
+ end
235
+ end
236
+
237
+ # Returns the string representation of the object
238
+ # @return [String] String presentation of the object
239
+ def to_s
240
+ to_hash.to_s
241
+ end
242
+
243
+ # to_body is an alias to to_hash (backward compatibility)
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_body
246
+ to_hash
247
+ end
248
+
249
+ # Returns the object in the form of hash
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_hash
252
+ hash = {}
253
+ self.class.attribute_map.each_pair do |attr, param|
254
+ value = self.send(attr)
255
+ next if value.nil?
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.compact.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to? :to_hash
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+ end
279
+ end
@@ -0,0 +1,249 @@
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
+ # Radical function
27
+ class RadicalElement < MathElement
28
+ # Base argument
29
+ attr_accessor :base
30
+
31
+ # Degree argument
32
+ attr_accessor :degree
33
+
34
+ # Hide degree
35
+ attr_accessor :hide_degree
36
+
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
56
+ end
57
+ end
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ super.merge({
62
+ :'base' => :'Base',
63
+ :'degree' => :'Degree',
64
+ :'hide_degree' => :'HideDegree',
65
+ })
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.swagger_types
70
+ super.merge({
71
+ :'base' => :'MathElement',
72
+ :'degree' => :'MathElement',
73
+ :'hide_degree' => :'BOOLEAN',
74
+ })
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ super
81
+
82
+ if attributes.has_key?(:'Base')
83
+ self.base = attributes[:'Base']
84
+ end
85
+
86
+ if attributes.has_key?(:'Degree')
87
+ self.degree = attributes[:'Degree']
88
+ end
89
+
90
+ if attributes.has_key?(:'HideDegree')
91
+ self.hide_degree = attributes[:'HideDegree']
92
+ end
93
+ self.type = "Radical"
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ invalid_properties = super
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ return false if !super
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ type == o.type &&
116
+ base == o.base &&
117
+ degree == o.degree &&
118
+ hide_degree == o.hide_degree
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Fixnum] Hash code
129
+ def hash
130
+ [type, base, degree, hide_degree].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.swagger_types.each_pair do |key, type|
139
+ mapKey = self.class.attribute_map[key]
140
+ if !mapKey.nil?
141
+ val = attributes[mapKey]
142
+ if val.nil?
143
+ mapKeyString = mapKey.to_s
144
+ mapKeyString[0] = mapKeyString[0].downcase
145
+ mapKey = mapKeyString.to_sym
146
+ val = attributes[mapKey]
147
+ end
148
+ if !val.nil?
149
+ if type =~ /\AArray<(.*)>/i
150
+ # check to ensure the input is an array given that the the attribute
151
+ # is documented as an array but the input is not
152
+ if val.is_a?(Array)
153
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
154
+ end
155
+ else
156
+ self.send("#{key}=", _deserialize(type, val))
157
+ end
158
+ end
159
+ end
160
+ end
161
+
162
+ self
163
+ end
164
+
165
+ # Deserializes the data based on type
166
+ # @param string type Data type
167
+ # @param string value Value to be deserialized
168
+ # @return [Object] Deserialized data
169
+ def _deserialize(type, value)
170
+ case type.to_sym
171
+ when :DateTime
172
+ DateTime.parse(value)
173
+ when :Date
174
+ Date.parse(value)
175
+ when :String
176
+ value.to_s
177
+ when :Integer
178
+ value.to_i
179
+ when :Float
180
+ value.to_f
181
+ when :BOOLEAN
182
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
+ true
184
+ else
185
+ false
186
+ end
187
+ when :Object
188
+ # generic object (usually a Hash), return directly
189
+ value
190
+ when /\AArray<(?<inner_type>.+)>\z/
191
+ inner_type = Regexp.last_match[:inner_type]
192
+ value.map { |v| _deserialize(inner_type, v) }
193
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
+ k_type = Regexp.last_match[:k_type]
195
+ v_type = Regexp.last_match[:v_type]
196
+ {}.tap do |hash|
197
+ value.each do |k, v|
198
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
+ end
200
+ end
201
+ else # model
202
+ temp_model = AsposeSlidesCloud.const_get(type).new
203
+ temp_model.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ next if value.nil?
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ # Outputs non-array value in the form of hash
232
+ # For object, use to_hash. Otherwise, just return the value
233
+ # @param [Object] value Any valid value
234
+ # @return [Hash] Returns the value in the form of hash
235
+ def _to_hash(value)
236
+ if value.is_a?(Array)
237
+ value.compact.map { |v| _to_hash(v) }
238
+ elsif value.is_a?(Hash)
239
+ {}.tap do |hash|
240
+ value.each { |k, v| hash[k] = _to_hash(v) }
241
+ end
242
+ elsif value.respond_to? :to_hash
243
+ value.to_hash
244
+ else
245
+ value
246
+ end
247
+ end
248
+ end
249
+ end