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,261 @@
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
+ # Specifies the fraction object, consisting of a numerator and denominator separated by a fraction bar.
27
+ class FractionElement < MathElement
28
+ # Fraction type
29
+ attr_accessor :fraction_type
30
+
31
+ # Numerator
32
+ attr_accessor :numerator
33
+
34
+ # Denominator
35
+ attr_accessor :denominator
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
+ :'fraction_type' => :'FractionType',
63
+ :'numerator' => :'Numerator',
64
+ :'denominator' => :'Denominator',
65
+ })
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.swagger_types
70
+ super.merge({
71
+ :'fraction_type' => :'String',
72
+ :'numerator' => :'MathElement',
73
+ :'denominator' => :'MathElement',
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?(:'FractionType')
83
+ self.fraction_type = attributes[:'FractionType']
84
+ end
85
+
86
+ if attributes.has_key?(:'Numerator')
87
+ self.numerator = attributes[:'Numerator']
88
+ end
89
+
90
+ if attributes.has_key?(:'Denominator')
91
+ self.denominator = attributes[:'Denominator']
92
+ end
93
+ self.type = "Fraction"
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
+ fraction_type_validator = EnumAttributeValidator.new('String', ['Bar', 'Skewed', 'Linear', 'NoBar'])
108
+ return false unless fraction_type_validator.valid?(@fraction_type)
109
+ true
110
+ end
111
+
112
+ # Custom attribute writer method checking allowed values (enum).
113
+ # @param [Object] fraction_type Object to be assigned
114
+ def fraction_type=(fraction_type)
115
+ validator = EnumAttributeValidator.new('String', ['Bar', 'Skewed', 'Linear', 'NoBar'])
116
+ unless validator.valid?(fraction_type)
117
+ fail ArgumentError, 'invalid value for "fraction_type", must be one of #{validator.allowable_values}.'
118
+ end
119
+ @fraction_type = fraction_type
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ type == o.type &&
128
+ fraction_type == o.fraction_type &&
129
+ numerator == o.numerator &&
130
+ denominator == o.denominator
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Fixnum] Hash code
141
+ def hash
142
+ [type, fraction_type, numerator, denominator].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ self.class.swagger_types.each_pair do |key, type|
151
+ mapKey = self.class.attribute_map[key]
152
+ if !mapKey.nil?
153
+ val = attributes[mapKey]
154
+ if val.nil?
155
+ mapKeyString = mapKey.to_s
156
+ mapKeyString[0] = mapKeyString[0].downcase
157
+ mapKey = mapKeyString.to_sym
158
+ val = attributes[mapKey]
159
+ end
160
+ if !val.nil?
161
+ if type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the the attribute
163
+ # is documented as an array but the input is not
164
+ if val.is_a?(Array)
165
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
166
+ end
167
+ else
168
+ self.send("#{key}=", _deserialize(type, val))
169
+ end
170
+ end
171
+ end
172
+ end
173
+
174
+ self
175
+ end
176
+
177
+ # Deserializes the data based on type
178
+ # @param string type Data type
179
+ # @param string value Value to be deserialized
180
+ # @return [Object] Deserialized data
181
+ def _deserialize(type, value)
182
+ case type.to_sym
183
+ when :DateTime
184
+ DateTime.parse(value)
185
+ when :Date
186
+ Date.parse(value)
187
+ when :String
188
+ value.to_s
189
+ when :Integer
190
+ value.to_i
191
+ when :Float
192
+ value.to_f
193
+ when :BOOLEAN
194
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
195
+ true
196
+ else
197
+ false
198
+ end
199
+ when :Object
200
+ # generic object (usually a Hash), return directly
201
+ value
202
+ when /\AArray<(?<inner_type>.+)>\z/
203
+ inner_type = Regexp.last_match[:inner_type]
204
+ value.map { |v| _deserialize(inner_type, v) }
205
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
206
+ k_type = Regexp.last_match[:k_type]
207
+ v_type = Regexp.last_match[:v_type]
208
+ {}.tap do |hash|
209
+ value.each do |k, v|
210
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
211
+ end
212
+ end
213
+ else # model
214
+ temp_model = AsposeSlidesCloud.const_get(type).new
215
+ temp_model.build_from_hash(value)
216
+ end
217
+ end
218
+
219
+ # Returns the string representation of the object
220
+ # @return [String] String presentation of the object
221
+ def to_s
222
+ to_hash.to_s
223
+ end
224
+
225
+ # to_body is an alias to to_hash (backward compatibility)
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_body
228
+ to_hash
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ next if value.nil?
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash
256
+ else
257
+ value
258
+ end
259
+ end
260
+ end
261
+ end
@@ -0,0 +1,239 @@
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
+ # Specifies a function of an argument.
27
+ class FunctionElement < MathElement
28
+ # Function
29
+ attr_accessor :name
30
+
31
+ # Function Argument
32
+ attr_accessor :base
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ super.merge({
59
+ :'name' => :'Name',
60
+ :'base' => :'Base',
61
+ })
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.swagger_types
66
+ super.merge({
67
+ :'name' => :'MathElement',
68
+ :'base' => :'MathElement',
69
+ })
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ super
76
+
77
+ if attributes.has_key?(:'Name')
78
+ self.name = attributes[:'Name']
79
+ end
80
+
81
+ if attributes.has_key?(:'Base')
82
+ self.base = attributes[:'Base']
83
+ end
84
+ self.type = "Function"
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = super
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return false if !super
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ type == o.type &&
107
+ name == o.name &&
108
+ base == o.base
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Fixnum] Hash code
119
+ def hash
120
+ [type, name, base].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ self.class.swagger_types.each_pair do |key, type|
129
+ mapKey = self.class.attribute_map[key]
130
+ if !mapKey.nil?
131
+ val = attributes[mapKey]
132
+ if val.nil?
133
+ mapKeyString = mapKey.to_s
134
+ mapKeyString[0] = mapKeyString[0].downcase
135
+ mapKey = mapKeyString.to_sym
136
+ val = attributes[mapKey]
137
+ end
138
+ if !val.nil?
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the the attribute
141
+ # is documented as an array but the input is not
142
+ if val.is_a?(Array)
143
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
144
+ end
145
+ else
146
+ self.send("#{key}=", _deserialize(type, val))
147
+ end
148
+ end
149
+ end
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Deserializes the data based on type
156
+ # @param string type Data type
157
+ # @param string value Value to be deserialized
158
+ # @return [Object] Deserialized data
159
+ def _deserialize(type, value)
160
+ case type.to_sym
161
+ when :DateTime
162
+ DateTime.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value.to_s
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :BOOLEAN
172
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when /\AArray<(?<inner_type>.+)>\z/
181
+ inner_type = Regexp.last_match[:inner_type]
182
+ value.map { |v| _deserialize(inner_type, v) }
183
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184
+ k_type = Regexp.last_match[:k_type]
185
+ v_type = Regexp.last_match[:v_type]
186
+ {}.tap do |hash|
187
+ value.each do |k, v|
188
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
+ end
190
+ end
191
+ else # model
192
+ temp_model = AsposeSlidesCloud.const_get(type).new
193
+ temp_model.build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ next if value.nil?
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ # Outputs non-array value in the form of hash
222
+ # For object, use to_hash. Otherwise, just return the value
223
+ # @param [Object] value Any valid value
224
+ # @return [Hash] Returns the value in the form of hash
225
+ def _to_hash(value)
226
+ if value.is_a?(Array)
227
+ value.compact.map { |v| _to_hash(v) }
228
+ elsif value.is_a?(Hash)
229
+ {}.tap do |hash|
230
+ value.each { |k, v| hash[k] = _to_hash(v) }
231
+ end
232
+ elsif value.respond_to? :to_hash
233
+ value.to_hash
234
+ else
235
+ value
236
+ end
237
+ end
238
+ end
239
+ end