aspose_slides_cloud 22.2.0 → 22.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -7
  3. data/LICENSE +20 -20
  4. data/README.md +27 -0
  5. data/Rakefile +8 -8
  6. data/TestData/oleObject.xlsx +0 -0
  7. data/TestData/test.pptx +0 -0
  8. data/aspose_slides_cloud.gemspec +56 -56
  9. data/lib/aspose_slides_cloud/api/slides_api.rb +192 -13
  10. data/lib/aspose_slides_cloud/api_error.rb +48 -48
  11. data/lib/aspose_slides_cloud/configuration.rb +188 -188
  12. data/lib/aspose_slides_cloud/models/access_permissions.rb +321 -0
  13. data/lib/aspose_slides_cloud/models/{waterfall_series.rb → alpha_bi_level_effect.rb} +16 -26
  14. data/lib/aspose_slides_cloud/models/alpha_ceiling_effect.rb +223 -0
  15. data/lib/aspose_slides_cloud/models/alpha_floor_effect.rb +223 -0
  16. data/lib/aspose_slides_cloud/models/alpha_inverse_effect.rb +223 -0
  17. data/lib/aspose_slides_cloud/models/alpha_modulate_effect.rb +223 -0
  18. data/lib/aspose_slides_cloud/models/alpha_modulate_fixed_effect.rb +238 -0
  19. data/lib/aspose_slides_cloud/models/alpha_replace_effect.rb +238 -0
  20. data/lib/aspose_slides_cloud/models/audio_frame.rb +12 -3
  21. data/lib/aspose_slides_cloud/models/axis.rb +22 -2
  22. data/lib/aspose_slides_cloud/models/bi_level_effect.rb +238 -0
  23. data/lib/aspose_slides_cloud/models/blur_image_effect.rb +253 -0
  24. data/lib/aspose_slides_cloud/models/chart.rb +1 -2
  25. data/lib/aspose_slides_cloud/models/chart_lines_format.rb +221 -0
  26. data/lib/aspose_slides_cloud/models/color_change_effect.rb +243 -0
  27. data/lib/aspose_slides_cloud/models/color_replace_effect.rb +233 -0
  28. data/lib/aspose_slides_cloud/models/connector.rb +1 -2
  29. data/lib/aspose_slides_cloud/models/duotone_effect.rb +243 -0
  30. data/lib/aspose_slides_cloud/models/export_options.rb +10 -18
  31. data/lib/aspose_slides_cloud/models/fill_overlay_image_effect.rb +260 -0
  32. data/lib/aspose_slides_cloud/models/font_fallback_rule.rb +243 -0
  33. data/lib/aspose_slides_cloud/models/geometry_shape.rb +1 -2
  34. data/lib/aspose_slides_cloud/models/gif_export_options.rb +4 -3
  35. data/lib/aspose_slides_cloud/models/graphical_object.rb +1 -2
  36. data/lib/aspose_slides_cloud/models/{waterfall_chart_data_point.rb → gray_scale_effect.rb} +26 -13
  37. data/lib/aspose_slides_cloud/models/group_shape.rb +12 -3
  38. data/lib/aspose_slides_cloud/models/hsl_effect.rb +268 -0
  39. data/lib/aspose_slides_cloud/models/html5_export_options.rb +2 -3
  40. data/lib/aspose_slides_cloud/models/html_export_options.rb +2 -3
  41. data/lib/aspose_slides_cloud/models/image_export_options.rb +4 -3
  42. data/lib/aspose_slides_cloud/models/image_export_options_base.rb +222 -0
  43. data/lib/aspose_slides_cloud/models/image_transform_effect.rb +244 -0
  44. data/lib/aspose_slides_cloud/models/legend.rb +12 -2
  45. data/lib/aspose_slides_cloud/models/luminance_effect.rb +253 -0
  46. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +72 -3
  47. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +12 -2
  48. data/lib/aspose_slides_cloud/models/one_value_series.rb +74 -2
  49. data/lib/aspose_slides_cloud/models/paragraph.rb +12 -2
  50. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +3 -16
  51. data/lib/aspose_slides_cloud/models/picture_fill.rb +14 -2
  52. data/lib/aspose_slides_cloud/models/picture_frame.rb +1 -2
  53. data/lib/aspose_slides_cloud/models/portion.rb +32 -2
  54. data/lib/aspose_slides_cloud/models/portion_format.rb +633 -0
  55. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +2 -3
  56. data/lib/aspose_slides_cloud/models/resource_uri.rb +22 -2
  57. data/lib/aspose_slides_cloud/models/section_zoom_frame.rb +1 -2
  58. data/lib/aspose_slides_cloud/models/shape.rb +1 -2
  59. data/lib/aspose_slides_cloud/models/shape_base.rb +1 -11
  60. data/lib/aspose_slides_cloud/models/shape_type.rb +54 -0
  61. data/lib/aspose_slides_cloud/models/slide_comment.rb +32 -48
  62. data/lib/aspose_slides_cloud/models/slide_comment_base.rb +286 -0
  63. data/lib/aspose_slides_cloud/models/slide_comments.rb +1 -1
  64. data/lib/aspose_slides_cloud/models/{box_and_whisker_series.rb → slide_modern_comment.rb} +37 -68
  65. data/lib/aspose_slides_cloud/models/smart_art.rb +1 -2
  66. data/lib/aspose_slides_cloud/models/smart_art_node.rb +12 -2
  67. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +1 -2
  68. data/lib/aspose_slides_cloud/models/summary_zoom_frame.rb +1 -2
  69. data/lib/aspose_slides_cloud/models/summary_zoom_section.rb +1 -2
  70. data/lib/aspose_slides_cloud/models/svg_export_options.rb +2 -3
  71. data/lib/aspose_slides_cloud/models/swf_export_options.rb +2 -3
  72. data/lib/aspose_slides_cloud/models/table.rb +1 -2
  73. data/lib/aspose_slides_cloud/models/table_cell.rb +22 -2
  74. data/lib/aspose_slides_cloud/models/text_bounds.rb +261 -0
  75. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +4 -3
  76. data/lib/aspose_slides_cloud/models/tint_effect.rb +253 -0
  77. data/lib/aspose_slides_cloud/models/video_export_options.rb +35 -4
  78. data/lib/aspose_slides_cloud/models/video_frame.rb +12 -3
  79. data/lib/aspose_slides_cloud/models/xaml_export_options.rb +2 -3
  80. data/lib/aspose_slides_cloud/models/xps_export_options.rb +2 -3
  81. data/lib/aspose_slides_cloud/models/zoom_frame.rb +1 -2
  82. data/lib/aspose_slides_cloud/models/zoom_object.rb +2 -2
  83. data/lib/aspose_slides_cloud/type_registry.rb +54 -13
  84. data/lib/aspose_slides_cloud/version.rb +1 -1
  85. data/lib/aspose_slides_cloud.rb +31 -7
  86. data/spec/api/slides_api_spec.rb +585 -33
  87. data/spec/spec_helper.rb +122 -122
  88. data/spec/use_cases/merge_spec.rb +0 -1
  89. data/spec/use_cases/shape_spec.rb +0 -2
  90. data/testRules.json +6 -4
  91. metadata +30 -7
  92. data/Dockerfile +0 -16
  93. data/docker-entrypoint.sh +0 -7
@@ -0,0 +1,223 @@
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 an Alpha Floor effect.
27
+ class AlphaFloorEffect < ImageTransformEffect
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ super.merge({
53
+ })
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ super.merge({
59
+ })
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ super
66
+ self.type = "AlphaFloor"
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = super
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if !super
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ type == o.type
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [type].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ mapKey = self.class.attribute_map[key]
110
+ if !mapKey.nil?
111
+ val = attributes[mapKey]
112
+ if val.nil?
113
+ mapKeyString = mapKey.to_s
114
+ mapKeyString[0] = mapKeyString[0].downcase
115
+ mapKey = mapKeyString.to_sym
116
+ val = attributes[mapKey]
117
+ end
118
+ if !val.nil?
119
+ if type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the the attribute
121
+ # is documented as an array but the input is not
122
+ if val.is_a?(Array)
123
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
124
+ end
125
+ else
126
+ self.send("#{key}=", _deserialize(type, val))
127
+ end
128
+ end
129
+ end
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :DateTime
142
+ DateTime.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :BOOLEAN
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
173
+ if registry_type
174
+ type = registry_type
175
+ end
176
+ temp_model = AsposeSlidesCloud.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+ end
223
+ end
@@ -0,0 +1,223 @@
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 an Alpha Inverse effect.
27
+ class AlphaInverseEffect < ImageTransformEffect
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ super.merge({
53
+ })
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ super.merge({
59
+ })
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ super
66
+ self.type = "AlphaInverse"
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = super
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if !super
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ type == o.type
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [type].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ mapKey = self.class.attribute_map[key]
110
+ if !mapKey.nil?
111
+ val = attributes[mapKey]
112
+ if val.nil?
113
+ mapKeyString = mapKey.to_s
114
+ mapKeyString[0] = mapKeyString[0].downcase
115
+ mapKey = mapKeyString.to_sym
116
+ val = attributes[mapKey]
117
+ end
118
+ if !val.nil?
119
+ if type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the the attribute
121
+ # is documented as an array but the input is not
122
+ if val.is_a?(Array)
123
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
124
+ end
125
+ else
126
+ self.send("#{key}=", _deserialize(type, val))
127
+ end
128
+ end
129
+ end
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :DateTime
142
+ DateTime.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :BOOLEAN
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
173
+ if registry_type
174
+ type = registry_type
175
+ end
176
+ temp_model = AsposeSlidesCloud.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+ end
223
+ end
@@ -0,0 +1,223 @@
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 an Alpha Modulate effect.
27
+ class AlphaModulateEffect < ImageTransformEffect
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ super.merge({
53
+ })
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ super.merge({
59
+ })
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ super
66
+ self.type = "AlphaModulate"
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = super
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if !super
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ type == o.type
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [type].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ mapKey = self.class.attribute_map[key]
110
+ if !mapKey.nil?
111
+ val = attributes[mapKey]
112
+ if val.nil?
113
+ mapKeyString = mapKey.to_s
114
+ mapKeyString[0] = mapKeyString[0].downcase
115
+ mapKey = mapKeyString.to_sym
116
+ val = attributes[mapKey]
117
+ end
118
+ if !val.nil?
119
+ if type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the the attribute
121
+ # is documented as an array but the input is not
122
+ if val.is_a?(Array)
123
+ self.send("#{key}=", val.map { |v| _deserialize($1, v) })
124
+ end
125
+ else
126
+ self.send("#{key}=", _deserialize(type, val))
127
+ end
128
+ end
129
+ end
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :DateTime
142
+ DateTime.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :BOOLEAN
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
173
+ if registry_type
174
+ type = registry_type
175
+ end
176
+ temp_model = AsposeSlidesCloud.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+ end
223
+ end