aspose_slides_cloud 1.0.3 → 19.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/Gemfile +7 -0
  4. data/LICENSE +2 -3
  5. data/README.md +7 -39
  6. data/Rakefile +8 -0
  7. data/TestData/TemplateCV.pptx +0 -0
  8. data/TestData/TemplatingCVDataWithBase64.xml +23 -0
  9. data/TestData/placeholders.pptx +0 -0
  10. data/TestData/test-unprotected.ppt +0 -0
  11. data/TestData/test.ppt +0 -0
  12. data/aspose_slides_cloud.gemspec +42 -14
  13. data/lib/aspose_slides_cloud.rb +183 -78
  14. data/lib/aspose_slides_cloud/api/slides_api.rb +6906 -2256
  15. data/lib/aspose_slides_cloud/api/slides_api_requests.rb +3067 -0
  16. data/lib/aspose_slides_cloud/api_client.rb +273 -183
  17. data/lib/aspose_slides_cloud/api_error.rb +29 -5
  18. data/lib/aspose_slides_cloud/configuration.rb +93 -81
  19. data/lib/aspose_slides_cloud/models/add_layout_slide.rb +261 -0
  20. data/lib/aspose_slides_cloud/models/add_master_slide.rb +276 -0
  21. data/lib/aspose_slides_cloud/models/add_shape.rb +256 -0
  22. data/lib/aspose_slides_cloud/models/add_slide.rb +286 -0
  23. data/lib/aspose_slides_cloud/models/api_info.rb +205 -0
  24. data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +257 -22
  25. data/lib/aspose_slides_cloud/models/audio_frame.rb +573 -0
  26. data/lib/aspose_slides_cloud/models/axes.rb +225 -0
  27. data/lib/aspose_slides_cloud/models/axis.rb +847 -0
  28. data/lib/aspose_slides_cloud/models/base64_input_file.rb +256 -0
  29. data/lib/aspose_slides_cloud/models/blur_effect.rb +215 -0
  30. data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +230 -0
  31. data/lib/aspose_slides_cloud/models/bubble_series.rb +463 -0
  32. data/lib/aspose_slides_cloud/models/chart.rb +543 -0
  33. data/lib/aspose_slides_cloud/models/chart_title.rb +210 -0
  34. data/lib/aspose_slides_cloud/models/chart_wall.rb +279 -0
  35. data/lib/aspose_slides_cloud/models/color_scheme.rb +258 -84
  36. data/lib/aspose_slides_cloud/models/connector.rb +487 -0
  37. data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +171 -13
  38. data/lib/aspose_slides_cloud/models/disc_usage.rb +215 -0
  39. data/lib/aspose_slides_cloud/models/document.rb +222 -46
  40. data/lib/aspose_slides_cloud/models/document_properties.rb +188 -36
  41. data/lib/aspose_slides_cloud/models/document_property.rb +209 -48
  42. data/lib/aspose_slides_cloud/models/document_replace_result.rb +272 -0
  43. data/lib/aspose_slides_cloud/models/effect.rb +412 -0
  44. data/lib/aspose_slides_cloud/models/effect_format.rb +265 -0
  45. data/lib/aspose_slides_cloud/models/error.rb +225 -0
  46. data/lib/aspose_slides_cloud/models/error_details.rb +210 -0
  47. data/lib/aspose_slides_cloud/models/export_format.rb +59 -0
  48. data/lib/aspose_slides_cloud/models/export_options.rb +194 -0
  49. data/lib/aspose_slides_cloud/models/file_version.rb +270 -0
  50. data/lib/aspose_slides_cloud/models/file_versions.rb +197 -0
  51. data/lib/aspose_slides_cloud/models/files_list.rb +197 -0
  52. data/lib/aspose_slides_cloud/models/files_upload_result.rb +209 -0
  53. data/lib/aspose_slides_cloud/models/fill_format.rb +204 -13
  54. data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +234 -0
  55. data/lib/aspose_slides_cloud/models/font_scheme.rb +204 -48
  56. data/lib/aspose_slides_cloud/models/font_set.rb +184 -22
  57. data/lib/aspose_slides_cloud/models/format_scheme.rb +210 -52
  58. data/lib/aspose_slides_cloud/models/geometry_shape.rb +439 -0
  59. data/lib/aspose_slides_cloud/models/glow_effect.rb +210 -0
  60. data/lib/aspose_slides_cloud/models/gradient_fill.rb +359 -0
  61. data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +210 -0
  62. data/lib/aspose_slides_cloud/models/graphical_object.rb +422 -0
  63. data/lib/aspose_slides_cloud/models/group_shape.rb +422 -0
  64. data/lib/aspose_slides_cloud/models/html_export_options.rb +392 -25
  65. data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +195 -0
  66. data/lib/aspose_slides_cloud/models/image.rb +216 -42
  67. data/lib/aspose_slides_cloud/models/image_export_format.rb +43 -0
  68. data/lib/aspose_slides_cloud/models/image_export_options.rb +298 -0
  69. data/lib/aspose_slides_cloud/models/images.rb +188 -36
  70. data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +240 -0
  71. data/lib/aspose_slides_cloud/models/input.rb +215 -0
  72. data/lib/aspose_slides_cloud/models/input_file.rb +238 -0
  73. data/lib/aspose_slides_cloud/models/interactive_sequence.rb +212 -0
  74. data/lib/aspose_slides_cloud/models/layout_slide.rb +288 -0
  75. data/lib/aspose_slides_cloud/models/layout_slides.rb +219 -0
  76. data/lib/aspose_slides_cloud/models/legend.rb +339 -0
  77. data/lib/aspose_slides_cloud/models/line_format.rb +349 -54
  78. data/lib/aspose_slides_cloud/models/master_slide.rb +241 -0
  79. data/lib/aspose_slides_cloud/models/master_slides.rb +219 -0
  80. data/lib/aspose_slides_cloud/models/merge.rb +248 -0
  81. data/lib/aspose_slides_cloud/models/merging_source.rb +207 -0
  82. data/lib/aspose_slides_cloud/models/no_fill.rb +236 -0
  83. data/lib/aspose_slides_cloud/models/notes_slide.rb +227 -0
  84. data/lib/aspose_slides_cloud/models/notes_slide_export_format.rb +43 -0
  85. data/lib/aspose_slides_cloud/models/object_exist.rb +215 -0
  86. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +447 -0
  87. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +200 -0
  88. data/lib/aspose_slides_cloud/models/one_value_series.rb +463 -0
  89. data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +171 -13
  90. data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +240 -0
  91. data/lib/aspose_slides_cloud/models/output_file.rb +228 -0
  92. data/lib/aspose_slides_cloud/models/paragraph.rb +494 -34
  93. data/lib/aspose_slides_cloud/models/paragraphs.rb +187 -35
  94. data/lib/aspose_slides_cloud/models/path_input_file.rb +266 -0
  95. data/lib/aspose_slides_cloud/models/path_output_file.rb +256 -0
  96. data/lib/aspose_slides_cloud/models/pattern_fill.rb +283 -0
  97. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +467 -49
  98. data/lib/aspose_slides_cloud/models/picture_fill.rb +368 -0
  99. data/lib/aspose_slides_cloud/models/picture_frame.rb +459 -0
  100. data/lib/aspose_slides_cloud/models/pipeline.rb +207 -0
  101. data/lib/aspose_slides_cloud/models/placeholder.rb +294 -56
  102. data/lib/aspose_slides_cloud/models/placeholders.rb +188 -36
  103. data/lib/aspose_slides_cloud/models/plot_area.rb +324 -0
  104. data/lib/aspose_slides_cloud/models/portion.rb +564 -46
  105. data/lib/aspose_slides_cloud/models/portions.rb +219 -0
  106. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +246 -0
  107. data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +188 -18
  108. data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +185 -15
  109. data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +274 -0
  110. data/lib/aspose_slides_cloud/models/reflection_effect.rb +429 -0
  111. data/lib/aspose_slides_cloud/models/remove_shape.rb +246 -0
  112. data/lib/aspose_slides_cloud/models/remove_slide.rb +251 -0
  113. data/lib/aspose_slides_cloud/models/reorder_slide.rb +266 -0
  114. data/lib/aspose_slides_cloud/models/replace_text.rb +286 -0
  115. data/lib/aspose_slides_cloud/models/request_input_file.rb +261 -0
  116. data/lib/aspose_slides_cloud/models/reset_slide.rb +251 -0
  117. data/lib/aspose_slides_cloud/models/resource_base.rb +207 -0
  118. data/lib/aspose_slides_cloud/models/resource_uri.rb +190 -26
  119. data/lib/aspose_slides_cloud/models/resource_uri_element.rb +171 -13
  120. data/lib/aspose_slides_cloud/models/response_output_file.rb +236 -0
  121. data/lib/aspose_slides_cloud/models/save.rb +283 -0
  122. data/lib/aspose_slides_cloud/models/save_shape.rb +293 -0
  123. data/lib/aspose_slides_cloud/models/save_slide.rb +318 -0
  124. data/lib/aspose_slides_cloud/models/scale_type.rb +41 -0
  125. data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +215 -0
  126. data/lib/aspose_slides_cloud/models/scatter_series.rb +463 -0
  127. data/lib/aspose_slides_cloud/models/series.rb +424 -0
  128. data/lib/aspose_slides_cloud/models/series_marker.rb +279 -0
  129. data/lib/aspose_slides_cloud/models/shape.rb +398 -100
  130. data/lib/aspose_slides_cloud/models/shape_base.rb +406 -0
  131. data/lib/aspose_slides_cloud/models/shape_export_format.rb +44 -0
  132. data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +274 -0
  133. data/lib/aspose_slides_cloud/models/shape_thumbnail_bounds.rb +41 -0
  134. data/lib/aspose_slides_cloud/models/shapes.rb +219 -0
  135. data/lib/aspose_slides_cloud/models/size_type.rb +55 -0
  136. data/lib/aspose_slides_cloud/models/slide.rb +277 -66
  137. data/lib/aspose_slides_cloud/models/slide_animation.rb +231 -0
  138. data/lib/aspose_slides_cloud/models/slide_background.rb +245 -42
  139. data/lib/aspose_slides_cloud/models/slide_comment.rb +198 -24
  140. data/lib/aspose_slides_cloud/models/slide_comments.rb +188 -36
  141. data/lib/aspose_slides_cloud/models/slide_export_format.rb +58 -0
  142. data/lib/aspose_slides_cloud/models/slide_replace_result.rb +347 -0
  143. data/lib/aspose_slides_cloud/models/slides.rb +188 -36
  144. data/lib/aspose_slides_cloud/models/smart_art.rb +530 -0
  145. data/lib/aspose_slides_cloud/models/smart_art_node.rb +281 -0
  146. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +422 -0
  147. data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +200 -0
  148. data/lib/aspose_slides_cloud/models/solid_fill.rb +246 -0
  149. data/lib/aspose_slides_cloud/models/split_document_result.rb +188 -36
  150. data/lib/aspose_slides_cloud/models/storage_exist.rb +200 -0
  151. data/lib/aspose_slides_cloud/models/storage_file.rb +245 -0
  152. data/lib/aspose_slides_cloud/models/svg_export_options.rb +378 -0
  153. data/lib/aspose_slides_cloud/models/swf_export_options.rb +528 -0
  154. data/lib/aspose_slides_cloud/models/table.rb +578 -0
  155. data/lib/aspose_slides_cloud/models/table_cell.rb +431 -0
  156. data/lib/aspose_slides_cloud/models/table_column.rb +200 -0
  157. data/lib/aspose_slides_cloud/models/table_row.rb +227 -0
  158. data/lib/aspose_slides_cloud/models/task.rb +228 -0
  159. data/lib/aspose_slides_cloud/models/text_item.rb +178 -18
  160. data/lib/aspose_slides_cloud/models/text_items.rb +188 -36
  161. data/lib/aspose_slides_cloud/models/theme.rb +210 -52
  162. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +385 -40
  163. data/lib/aspose_slides_cloud/models/update_background.rb +258 -0
  164. data/lib/aspose_slides_cloud/models/update_shape.rb +256 -0
  165. data/lib/aspose_slides_cloud/models/video_frame.rb +543 -0
  166. data/lib/aspose_slides_cloud/models/xps_export_options.rb +242 -0
  167. data/lib/aspose_slides_cloud/version.rb +23 -1
  168. data/spec/api/slides_api_spec.rb +24188 -0
  169. data/spec/extra/extra_spec.rb +84 -0
  170. data/spec/spec_helper.rb +122 -0
  171. data/spec/spec_utils.rb +154 -0
  172. data/testConfig.json +7 -0
  173. data/testRules.json +333 -0
  174. metadata +273 -61
  175. data/lib/aspose_slides_cloud/models/base_object.rb +0 -86
  176. data/lib/aspose_slides_cloud/models/base_response.rb +0 -53
  177. data/lib/aspose_slides_cloud/models/color.rb +0 -29
  178. data/lib/aspose_slides_cloud/models/color_scheme_response.rb +0 -61
  179. data/lib/aspose_slides_cloud/models/common_response.rb +0 -53
  180. data/lib/aspose_slides_cloud/models/document_properties_response.rb +0 -61
  181. data/lib/aspose_slides_cloud/models/document_property_response.rb +0 -61
  182. data/lib/aspose_slides_cloud/models/document_response.rb +0 -61
  183. data/lib/aspose_slides_cloud/models/font_scheme_response.rb +0 -61
  184. data/lib/aspose_slides_cloud/models/format_scheme_response.rb +0 -61
  185. data/lib/aspose_slides_cloud/models/images_response.rb +0 -61
  186. data/lib/aspose_slides_cloud/models/new_shape_response.rb +0 -61
  187. data/lib/aspose_slides_cloud/models/paragraph_portion_response.rb +0 -61
  188. data/lib/aspose_slides_cloud/models/placeholder_response.rb +0 -61
  189. data/lib/aspose_slides_cloud/models/placeholders_response.rb +0 -61
  190. data/lib/aspose_slides_cloud/models/presentation_string_replace_response.rb +0 -69
  191. data/lib/aspose_slides_cloud/models/shape_list.rb +0 -67
  192. data/lib/aspose_slides_cloud/models/shape_paragraph_response.rb +0 -61
  193. data/lib/aspose_slides_cloud/models/shape_paragraphs_response.rb +0 -61
  194. data/lib/aspose_slides_cloud/models/shape_response.rb +0 -61
  195. data/lib/aspose_slides_cloud/models/slide_background_response.rb +0 -61
  196. data/lib/aspose_slides_cloud/models/slide_comments_response.rb +0 -61
  197. data/lib/aspose_slides_cloud/models/slide_list_response.rb +0 -61
  198. data/lib/aspose_slides_cloud/models/slide_response.rb +0 -61
  199. data/lib/aspose_slides_cloud/models/slide_string_replace_response.rb +0 -69
  200. data/lib/aspose_slides_cloud/models/split_document_response.rb +0 -61
  201. data/lib/aspose_slides_cloud/models/text_items_response.rb +0 -61
  202. data/lib/aspose_slides_cloud/models/theme_response.rb +0 -61
  203. data/test/slides_tests.rb +0 -580
@@ -0,0 +1,225 @@
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 chart axes
27
+ class Axes
28
+ # Gets or sets the horizontal axis.
29
+ attr_accessor :horizontal_axis
30
+
31
+ # Gets or sets the vertical axis.
32
+ attr_accessor :vertical_axis
33
+
34
+ # Gets or sets the secondary horizontal axis.
35
+ attr_accessor :secondary_horizontal_axis
36
+
37
+ # Gets or sets the secondary vertical axis.
38
+ attr_accessor :secondary_vertical_axis
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'horizontal_axis' => :'HorizontalAxis',
44
+ :'vertical_axis' => :'VerticalAxis',
45
+ :'secondary_horizontal_axis' => :'SecondaryHorizontalAxis',
46
+ :'secondary_vertical_axis' => :'SecondaryVerticalAxis'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.swagger_types
52
+ {
53
+ :'horizontal_axis' => :'Axis',
54
+ :'vertical_axis' => :'Axis',
55
+ :'secondary_horizontal_axis' => :'Axis',
56
+ :'secondary_vertical_axis' => :'Axis'
57
+ }
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ return unless attributes.is_a?(Hash)
64
+
65
+ # convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
67
+
68
+ if attributes.has_key?(:'HorizontalAxis')
69
+ self.horizontal_axis = attributes[:'HorizontalAxis']
70
+ end
71
+
72
+ if attributes.has_key?(:'VerticalAxis')
73
+ self.vertical_axis = attributes[:'VerticalAxis']
74
+ end
75
+
76
+ if attributes.has_key?(:'SecondaryHorizontalAxis')
77
+ self.secondary_horizontal_axis = attributes[:'SecondaryHorizontalAxis']
78
+ end
79
+
80
+ if attributes.has_key?(:'SecondaryVerticalAxis')
81
+ self.secondary_vertical_axis = attributes[:'SecondaryVerticalAxis']
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ horizontal_axis == o.horizontal_axis &&
104
+ vertical_axis == o.vertical_axis &&
105
+ secondary_horizontal_axis == o.secondary_horizontal_axis &&
106
+ secondary_vertical_axis == o.secondary_vertical_axis
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] Object to be compared
111
+ def eql?(o)
112
+ self == o
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Fixnum] Hash code
117
+ def hash
118
+ [horizontal_axis, vertical_axis, secondary_horizontal_axis, secondary_vertical_axis].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ self.class.swagger_types.each_pair do |key, type|
127
+ if type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :BOOLEAN
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ temp_model = AsposeSlidesCloud.const_get(type).new
179
+ temp_model.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ next if value.nil?
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+ end
225
+ end
@@ -0,0 +1,847 @@
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 a chart axis
27
+ class Axis
28
+ # True if the axis is visible
29
+ attr_accessor :is_visible
30
+
31
+ # True if the axis has a visible title
32
+ attr_accessor :has_title
33
+
34
+ # Axis position
35
+ attr_accessor :position
36
+
37
+ # The scaling value of the display units for the value axis
38
+ attr_accessor :display_unit
39
+
40
+ # The smallest time unit that is represented on the date axis
41
+ attr_accessor :base_unit_scale
42
+
43
+ # True the major unit of the axis is automatically assigned
44
+ attr_accessor :is_automatic_major_unit
45
+
46
+ # The major units for the date or value axis
47
+ attr_accessor :major_unit
48
+
49
+ # The major unit scale for the date axis
50
+ attr_accessor :major_unit_scale
51
+
52
+ # The type of major tick mark for the specified axis
53
+ attr_accessor :major_tick_mark
54
+
55
+ # True the minor unit of the axis is automatically assigned
56
+ attr_accessor :is_automatic_minor_unit
57
+
58
+ # The minor units for the date or value axis
59
+ attr_accessor :minor_unit
60
+
61
+ # The minor unit scale for the date axis
62
+ attr_accessor :minor_unit_scale
63
+
64
+ # The type of minor tick mark for the specified axis
65
+ attr_accessor :minor_tick_mark
66
+
67
+ # True if the max value is automatically assigned
68
+ attr_accessor :is_automatic_max_value
69
+
70
+ # The maximum value on the value axis
71
+ attr_accessor :max_value
72
+
73
+ # True if the min value is automatically assigned
74
+ attr_accessor :is_automatic_min_value
75
+
76
+ # The minimum value on the value axis
77
+ attr_accessor :min_value
78
+
79
+ # True if the value axis scale type is logarithmic
80
+ attr_accessor :is_logarithmic
81
+
82
+ # The logarithmic base. Default value is 10
83
+ attr_accessor :log_base
84
+
85
+ # The type of the category axis
86
+ attr_accessor :category_axis_type
87
+
88
+ # True if the value axis crosses the category axis between categories. This property applies only to category axes, and it doesn't apply to 3-D charts
89
+ attr_accessor :axis_between_categories
90
+
91
+ # The distance of labels from the axis. Applied to category or date axis. Value must be between 0% and 1000%.
92
+ attr_accessor :label_offset
93
+
94
+ # True if MS PowerPoint plots data points from last to first
95
+ attr_accessor :is_plot_order_reversed
96
+
97
+ # True if the format is linked to source data
98
+ attr_accessor :is_number_format_linked_to_source
99
+
100
+ # the format string for the Axis Labels
101
+ attr_accessor :number_format
102
+
103
+ # The CrossType on the specified axis where the other axis crosses
104
+ attr_accessor :cross_type
105
+
106
+ # The point on the axis where the perpendicular axis crosses it
107
+ attr_accessor :cross_at
108
+
109
+ # True for automatic tick marks spacing value
110
+ attr_accessor :is_automatic_tick_marks_spacing
111
+
112
+ # Specifies how many tick marks shall be skipped before the next one shall be drawn. Applied to category or series axis.
113
+ attr_accessor :tick_marks_spacing
114
+
115
+ # True for automatic tick label spacing value
116
+ attr_accessor :is_automatic_tick_label_spacing
117
+
118
+ # Specifies how many tick labels to skip between label that is drawn.
119
+ attr_accessor :tick_label_spacing
120
+
121
+ # The position of tick-mark labels on the specified axis.
122
+ attr_accessor :tick_label_position
123
+
124
+ # Represents the rotation angle of tick labels.
125
+ attr_accessor :tick_label_rotation_angle
126
+
127
+ # Get or sets the fill format.
128
+ attr_accessor :fill_format
129
+
130
+ # Get or sets the effect format.
131
+ attr_accessor :effect_format
132
+
133
+ # Get or sets the line format.
134
+ attr_accessor :line_format
135
+
136
+ class EnumAttributeValidator
137
+ attr_reader :datatype
138
+ attr_reader :allowable_values
139
+
140
+ def initialize(datatype, allowable_values)
141
+ @allowable_values = allowable_values.map do |value|
142
+ case datatype.to_s
143
+ when /Integer/i
144
+ value.to_i
145
+ when /Float/i
146
+ value.to_f
147
+ else
148
+ value
149
+ end
150
+ end
151
+ end
152
+
153
+ def valid?(value)
154
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
155
+ end
156
+ end
157
+
158
+ # Attribute mapping from ruby-style variable name to JSON key.
159
+ def self.attribute_map
160
+ {
161
+ :'is_visible' => :'IsVisible',
162
+ :'has_title' => :'HasTitle',
163
+ :'position' => :'Position',
164
+ :'display_unit' => :'DisplayUnit',
165
+ :'base_unit_scale' => :'BaseUnitScale',
166
+ :'is_automatic_major_unit' => :'IsAutomaticMajorUnit',
167
+ :'major_unit' => :'MajorUnit',
168
+ :'major_unit_scale' => :'MajorUnitScale',
169
+ :'major_tick_mark' => :'MajorTickMark',
170
+ :'is_automatic_minor_unit' => :'IsAutomaticMinorUnit',
171
+ :'minor_unit' => :'MinorUnit',
172
+ :'minor_unit_scale' => :'MinorUnitScale',
173
+ :'minor_tick_mark' => :'MinorTickMark',
174
+ :'is_automatic_max_value' => :'IsAutomaticMaxValue',
175
+ :'max_value' => :'MaxValue',
176
+ :'is_automatic_min_value' => :'IsAutomaticMinValue',
177
+ :'min_value' => :'MinValue',
178
+ :'is_logarithmic' => :'IsLogarithmic',
179
+ :'log_base' => :'LogBase',
180
+ :'category_axis_type' => :'CategoryAxisType',
181
+ :'axis_between_categories' => :'AxisBetweenCategories',
182
+ :'label_offset' => :'LabelOffset',
183
+ :'is_plot_order_reversed' => :'IsPlotOrderReversed',
184
+ :'is_number_format_linked_to_source' => :'IsNumberFormatLinkedToSource',
185
+ :'number_format' => :'NumberFormat',
186
+ :'cross_type' => :'CrossType',
187
+ :'cross_at' => :'CrossAt',
188
+ :'is_automatic_tick_marks_spacing' => :'IsAutomaticTickMarksSpacing',
189
+ :'tick_marks_spacing' => :'TickMarksSpacing',
190
+ :'is_automatic_tick_label_spacing' => :'IsAutomaticTickLabelSpacing',
191
+ :'tick_label_spacing' => :'TickLabelSpacing',
192
+ :'tick_label_position' => :'TickLabelPosition',
193
+ :'tick_label_rotation_angle' => :'TickLabelRotationAngle',
194
+ :'fill_format' => :'FillFormat',
195
+ :'effect_format' => :'EffectFormat',
196
+ :'line_format' => :'LineFormat'
197
+ }
198
+ end
199
+
200
+ # Attribute type mapping.
201
+ def self.swagger_types
202
+ {
203
+ :'is_visible' => :'BOOLEAN',
204
+ :'has_title' => :'BOOLEAN',
205
+ :'position' => :'String',
206
+ :'display_unit' => :'String',
207
+ :'base_unit_scale' => :'String',
208
+ :'is_automatic_major_unit' => :'BOOLEAN',
209
+ :'major_unit' => :'Float',
210
+ :'major_unit_scale' => :'String',
211
+ :'major_tick_mark' => :'String',
212
+ :'is_automatic_minor_unit' => :'BOOLEAN',
213
+ :'minor_unit' => :'Float',
214
+ :'minor_unit_scale' => :'String',
215
+ :'minor_tick_mark' => :'String',
216
+ :'is_automatic_max_value' => :'BOOLEAN',
217
+ :'max_value' => :'Float',
218
+ :'is_automatic_min_value' => :'BOOLEAN',
219
+ :'min_value' => :'Float',
220
+ :'is_logarithmic' => :'BOOLEAN',
221
+ :'log_base' => :'Float',
222
+ :'category_axis_type' => :'String',
223
+ :'axis_between_categories' => :'BOOLEAN',
224
+ :'label_offset' => :'Integer',
225
+ :'is_plot_order_reversed' => :'BOOLEAN',
226
+ :'is_number_format_linked_to_source' => :'BOOLEAN',
227
+ :'number_format' => :'String',
228
+ :'cross_type' => :'String',
229
+ :'cross_at' => :'Float',
230
+ :'is_automatic_tick_marks_spacing' => :'BOOLEAN',
231
+ :'tick_marks_spacing' => :'Integer',
232
+ :'is_automatic_tick_label_spacing' => :'BOOLEAN',
233
+ :'tick_label_spacing' => :'Integer',
234
+ :'tick_label_position' => :'String',
235
+ :'tick_label_rotation_angle' => :'Float',
236
+ :'fill_format' => :'FillFormat',
237
+ :'effect_format' => :'EffectFormat',
238
+ :'line_format' => :'LineFormat'
239
+ }
240
+ end
241
+
242
+ # Initializes the object
243
+ # @param [Hash] attributes Model attributes in the form of hash
244
+ def initialize(attributes = {})
245
+ return unless attributes.is_a?(Hash)
246
+
247
+ # convert string to symbol for hash key
248
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
249
+
250
+ if attributes.has_key?(:'IsVisible')
251
+ self.is_visible = attributes[:'IsVisible']
252
+ end
253
+
254
+ if attributes.has_key?(:'HasTitle')
255
+ self.has_title = attributes[:'HasTitle']
256
+ end
257
+
258
+ if attributes.has_key?(:'Position')
259
+ self.position = attributes[:'Position']
260
+ end
261
+
262
+ if attributes.has_key?(:'DisplayUnit')
263
+ self.display_unit = attributes[:'DisplayUnit']
264
+ end
265
+
266
+ if attributes.has_key?(:'BaseUnitScale')
267
+ self.base_unit_scale = attributes[:'BaseUnitScale']
268
+ end
269
+
270
+ if attributes.has_key?(:'IsAutomaticMajorUnit')
271
+ self.is_automatic_major_unit = attributes[:'IsAutomaticMajorUnit']
272
+ end
273
+
274
+ if attributes.has_key?(:'MajorUnit')
275
+ self.major_unit = attributes[:'MajorUnit']
276
+ end
277
+
278
+ if attributes.has_key?(:'MajorUnitScale')
279
+ self.major_unit_scale = attributes[:'MajorUnitScale']
280
+ end
281
+
282
+ if attributes.has_key?(:'MajorTickMark')
283
+ self.major_tick_mark = attributes[:'MajorTickMark']
284
+ end
285
+
286
+ if attributes.has_key?(:'IsAutomaticMinorUnit')
287
+ self.is_automatic_minor_unit = attributes[:'IsAutomaticMinorUnit']
288
+ end
289
+
290
+ if attributes.has_key?(:'MinorUnit')
291
+ self.minor_unit = attributes[:'MinorUnit']
292
+ end
293
+
294
+ if attributes.has_key?(:'MinorUnitScale')
295
+ self.minor_unit_scale = attributes[:'MinorUnitScale']
296
+ end
297
+
298
+ if attributes.has_key?(:'MinorTickMark')
299
+ self.minor_tick_mark = attributes[:'MinorTickMark']
300
+ end
301
+
302
+ if attributes.has_key?(:'IsAutomaticMaxValue')
303
+ self.is_automatic_max_value = attributes[:'IsAutomaticMaxValue']
304
+ end
305
+
306
+ if attributes.has_key?(:'MaxValue')
307
+ self.max_value = attributes[:'MaxValue']
308
+ end
309
+
310
+ if attributes.has_key?(:'IsAutomaticMinValue')
311
+ self.is_automatic_min_value = attributes[:'IsAutomaticMinValue']
312
+ end
313
+
314
+ if attributes.has_key?(:'MinValue')
315
+ self.min_value = attributes[:'MinValue']
316
+ end
317
+
318
+ if attributes.has_key?(:'IsLogarithmic')
319
+ self.is_logarithmic = attributes[:'IsLogarithmic']
320
+ end
321
+
322
+ if attributes.has_key?(:'LogBase')
323
+ self.log_base = attributes[:'LogBase']
324
+ end
325
+
326
+ if attributes.has_key?(:'CategoryAxisType')
327
+ self.category_axis_type = attributes[:'CategoryAxisType']
328
+ end
329
+
330
+ if attributes.has_key?(:'AxisBetweenCategories')
331
+ self.axis_between_categories = attributes[:'AxisBetweenCategories']
332
+ end
333
+
334
+ if attributes.has_key?(:'LabelOffset')
335
+ self.label_offset = attributes[:'LabelOffset']
336
+ end
337
+
338
+ if attributes.has_key?(:'IsPlotOrderReversed')
339
+ self.is_plot_order_reversed = attributes[:'IsPlotOrderReversed']
340
+ end
341
+
342
+ if attributes.has_key?(:'IsNumberFormatLinkedToSource')
343
+ self.is_number_format_linked_to_source = attributes[:'IsNumberFormatLinkedToSource']
344
+ end
345
+
346
+ if attributes.has_key?(:'NumberFormat')
347
+ self.number_format = attributes[:'NumberFormat']
348
+ end
349
+
350
+ if attributes.has_key?(:'CrossType')
351
+ self.cross_type = attributes[:'CrossType']
352
+ end
353
+
354
+ if attributes.has_key?(:'CrossAt')
355
+ self.cross_at = attributes[:'CrossAt']
356
+ end
357
+
358
+ if attributes.has_key?(:'IsAutomaticTickMarksSpacing')
359
+ self.is_automatic_tick_marks_spacing = attributes[:'IsAutomaticTickMarksSpacing']
360
+ end
361
+
362
+ if attributes.has_key?(:'TickMarksSpacing')
363
+ self.tick_marks_spacing = attributes[:'TickMarksSpacing']
364
+ end
365
+
366
+ if attributes.has_key?(:'IsAutomaticTickLabelSpacing')
367
+ self.is_automatic_tick_label_spacing = attributes[:'IsAutomaticTickLabelSpacing']
368
+ end
369
+
370
+ if attributes.has_key?(:'TickLabelSpacing')
371
+ self.tick_label_spacing = attributes[:'TickLabelSpacing']
372
+ end
373
+
374
+ if attributes.has_key?(:'TickLabelPosition')
375
+ self.tick_label_position = attributes[:'TickLabelPosition']
376
+ end
377
+
378
+ if attributes.has_key?(:'TickLabelRotationAngle')
379
+ self.tick_label_rotation_angle = attributes[:'TickLabelRotationAngle']
380
+ end
381
+
382
+ if attributes.has_key?(:'FillFormat')
383
+ self.fill_format = attributes[:'FillFormat']
384
+ end
385
+
386
+ if attributes.has_key?(:'EffectFormat')
387
+ self.effect_format = attributes[:'EffectFormat']
388
+ end
389
+
390
+ if attributes.has_key?(:'LineFormat')
391
+ self.line_format = attributes[:'LineFormat']
392
+ end
393
+ end
394
+
395
+ # Show invalid properties with the reasons. Usually used together with valid?
396
+ # @return Array for valid properties with the reasons
397
+ def list_invalid_properties
398
+ invalid_properties = Array.new
399
+ if @is_visible.nil?
400
+ invalid_properties.push('invalid value for "is_visible", is_visible cannot be nil.')
401
+ end
402
+
403
+ if @has_title.nil?
404
+ invalid_properties.push('invalid value for "has_title", has_title cannot be nil.')
405
+ end
406
+
407
+ if @position.nil?
408
+ invalid_properties.push('invalid value for "position", position cannot be nil.')
409
+ end
410
+
411
+ if @display_unit.nil?
412
+ invalid_properties.push('invalid value for "display_unit", display_unit cannot be nil.')
413
+ end
414
+
415
+ if @base_unit_scale.nil?
416
+ invalid_properties.push('invalid value for "base_unit_scale", base_unit_scale cannot be nil.')
417
+ end
418
+
419
+ if @is_automatic_major_unit.nil?
420
+ invalid_properties.push('invalid value for "is_automatic_major_unit", is_automatic_major_unit cannot be nil.')
421
+ end
422
+
423
+ if @major_unit.nil?
424
+ invalid_properties.push('invalid value for "major_unit", major_unit cannot be nil.')
425
+ end
426
+
427
+ if @major_unit_scale.nil?
428
+ invalid_properties.push('invalid value for "major_unit_scale", major_unit_scale cannot be nil.')
429
+ end
430
+
431
+ if @major_tick_mark.nil?
432
+ invalid_properties.push('invalid value for "major_tick_mark", major_tick_mark cannot be nil.')
433
+ end
434
+
435
+ if @is_automatic_minor_unit.nil?
436
+ invalid_properties.push('invalid value for "is_automatic_minor_unit", is_automatic_minor_unit cannot be nil.')
437
+ end
438
+
439
+ if @minor_unit.nil?
440
+ invalid_properties.push('invalid value for "minor_unit", minor_unit cannot be nil.')
441
+ end
442
+
443
+ if @minor_unit_scale.nil?
444
+ invalid_properties.push('invalid value for "minor_unit_scale", minor_unit_scale cannot be nil.')
445
+ end
446
+
447
+ if @minor_tick_mark.nil?
448
+ invalid_properties.push('invalid value for "minor_tick_mark", minor_tick_mark cannot be nil.')
449
+ end
450
+
451
+ if @is_automatic_max_value.nil?
452
+ invalid_properties.push('invalid value for "is_automatic_max_value", is_automatic_max_value cannot be nil.')
453
+ end
454
+
455
+ if @max_value.nil?
456
+ invalid_properties.push('invalid value for "max_value", max_value cannot be nil.')
457
+ end
458
+
459
+ if @is_automatic_min_value.nil?
460
+ invalid_properties.push('invalid value for "is_automatic_min_value", is_automatic_min_value cannot be nil.')
461
+ end
462
+
463
+ if @min_value.nil?
464
+ invalid_properties.push('invalid value for "min_value", min_value cannot be nil.')
465
+ end
466
+
467
+ if @is_logarithmic.nil?
468
+ invalid_properties.push('invalid value for "is_logarithmic", is_logarithmic cannot be nil.')
469
+ end
470
+
471
+ if @log_base.nil?
472
+ invalid_properties.push('invalid value for "log_base", log_base cannot be nil.')
473
+ end
474
+
475
+ if @category_axis_type.nil?
476
+ invalid_properties.push('invalid value for "category_axis_type", category_axis_type cannot be nil.')
477
+ end
478
+
479
+ if @axis_between_categories.nil?
480
+ invalid_properties.push('invalid value for "axis_between_categories", axis_between_categories cannot be nil.')
481
+ end
482
+
483
+ if @label_offset.nil?
484
+ invalid_properties.push('invalid value for "label_offset", label_offset cannot be nil.')
485
+ end
486
+
487
+ if @is_plot_order_reversed.nil?
488
+ invalid_properties.push('invalid value for "is_plot_order_reversed", is_plot_order_reversed cannot be nil.')
489
+ end
490
+
491
+ if @is_number_format_linked_to_source.nil?
492
+ invalid_properties.push('invalid value for "is_number_format_linked_to_source", is_number_format_linked_to_source cannot be nil.')
493
+ end
494
+
495
+ if @cross_type.nil?
496
+ invalid_properties.push('invalid value for "cross_type", cross_type cannot be nil.')
497
+ end
498
+
499
+ if @cross_at.nil?
500
+ invalid_properties.push('invalid value for "cross_at", cross_at cannot be nil.')
501
+ end
502
+
503
+ if @is_automatic_tick_marks_spacing.nil?
504
+ invalid_properties.push('invalid value for "is_automatic_tick_marks_spacing", is_automatic_tick_marks_spacing cannot be nil.')
505
+ end
506
+
507
+ if @tick_marks_spacing.nil?
508
+ invalid_properties.push('invalid value for "tick_marks_spacing", tick_marks_spacing cannot be nil.')
509
+ end
510
+
511
+ if @is_automatic_tick_label_spacing.nil?
512
+ invalid_properties.push('invalid value for "is_automatic_tick_label_spacing", is_automatic_tick_label_spacing cannot be nil.')
513
+ end
514
+
515
+ if @tick_label_spacing.nil?
516
+ invalid_properties.push('invalid value for "tick_label_spacing", tick_label_spacing cannot be nil.')
517
+ end
518
+
519
+ if @tick_label_position.nil?
520
+ invalid_properties.push('invalid value for "tick_label_position", tick_label_position cannot be nil.')
521
+ end
522
+
523
+ if @tick_label_rotation_angle.nil?
524
+ invalid_properties.push('invalid value for "tick_label_rotation_angle", tick_label_rotation_angle cannot be nil.')
525
+ end
526
+
527
+ invalid_properties
528
+ end
529
+
530
+ # Check to see if the all the properties in the model are valid
531
+ # @return true if the model is valid
532
+ def valid?
533
+ return false if @is_visible.nil?
534
+ return false if @has_title.nil?
535
+ return false if @position.nil?
536
+ position_validator = EnumAttributeValidator.new('String', ['Bottom', 'Left', 'Right', 'Top'])
537
+ return false unless position_validator.valid?(@position)
538
+ return false if @display_unit.nil?
539
+ display_unit_validator = EnumAttributeValidator.new('String', ['None', 'Hundreds', 'Thousands', 'TenThousands', 'HundredThousands', 'Millions', 'TenMillions', 'HundredMillions', 'Billions', 'Trillions', 'CustomValue'])
540
+ return false unless display_unit_validator.valid?(@display_unit)
541
+ return false if @base_unit_scale.nil?
542
+ base_unit_scale_validator = EnumAttributeValidator.new('String', ['Days', 'Months', 'Years'])
543
+ return false unless base_unit_scale_validator.valid?(@base_unit_scale)
544
+ return false if @is_automatic_major_unit.nil?
545
+ return false if @major_unit.nil?
546
+ return false if @major_unit_scale.nil?
547
+ major_unit_scale_validator = EnumAttributeValidator.new('String', ['Days', 'Months', 'Years'])
548
+ return false unless major_unit_scale_validator.valid?(@major_unit_scale)
549
+ return false if @major_tick_mark.nil?
550
+ major_tick_mark_validator = EnumAttributeValidator.new('String', ['Cross', 'Inside', 'None', 'Outside'])
551
+ return false unless major_tick_mark_validator.valid?(@major_tick_mark)
552
+ return false if @is_automatic_minor_unit.nil?
553
+ return false if @minor_unit.nil?
554
+ return false if @minor_unit_scale.nil?
555
+ minor_unit_scale_validator = EnumAttributeValidator.new('String', ['Days', 'Months', 'Years'])
556
+ return false unless minor_unit_scale_validator.valid?(@minor_unit_scale)
557
+ return false if @minor_tick_mark.nil?
558
+ minor_tick_mark_validator = EnumAttributeValidator.new('String', ['Cross', 'Inside', 'None', 'Outside'])
559
+ return false unless minor_tick_mark_validator.valid?(@minor_tick_mark)
560
+ return false if @is_automatic_max_value.nil?
561
+ return false if @max_value.nil?
562
+ return false if @is_automatic_min_value.nil?
563
+ return false if @min_value.nil?
564
+ return false if @is_logarithmic.nil?
565
+ return false if @log_base.nil?
566
+ return false if @category_axis_type.nil?
567
+ category_axis_type_validator = EnumAttributeValidator.new('String', ['Text', 'Date'])
568
+ return false unless category_axis_type_validator.valid?(@category_axis_type)
569
+ return false if @axis_between_categories.nil?
570
+ return false if @label_offset.nil?
571
+ return false if @is_plot_order_reversed.nil?
572
+ return false if @is_number_format_linked_to_source.nil?
573
+ return false if @cross_type.nil?
574
+ cross_type_validator = EnumAttributeValidator.new('String', ['AxisCrossesAtZero', 'Maximum', 'Custom'])
575
+ return false unless cross_type_validator.valid?(@cross_type)
576
+ return false if @cross_at.nil?
577
+ return false if @is_automatic_tick_marks_spacing.nil?
578
+ return false if @tick_marks_spacing.nil?
579
+ return false if @is_automatic_tick_label_spacing.nil?
580
+ return false if @tick_label_spacing.nil?
581
+ return false if @tick_label_position.nil?
582
+ tick_label_position_validator = EnumAttributeValidator.new('String', ['High', 'Low', 'NextTo', 'None'])
583
+ return false unless tick_label_position_validator.valid?(@tick_label_position)
584
+ return false if @tick_label_rotation_angle.nil?
585
+ true
586
+ end
587
+
588
+ # Custom attribute writer method checking allowed values (enum).
589
+ # @param [Object] position Object to be assigned
590
+ def position=(position)
591
+ validator = EnumAttributeValidator.new('String', ['Bottom', 'Left', 'Right', 'Top'])
592
+ unless validator.valid?(position)
593
+ fail ArgumentError, 'invalid value for "position", must be one of #{validator.allowable_values}.'
594
+ end
595
+ @position = position
596
+ end
597
+
598
+ # Custom attribute writer method checking allowed values (enum).
599
+ # @param [Object] display_unit Object to be assigned
600
+ def display_unit=(display_unit)
601
+ validator = EnumAttributeValidator.new('String', ['None', 'Hundreds', 'Thousands', 'TenThousands', 'HundredThousands', 'Millions', 'TenMillions', 'HundredMillions', 'Billions', 'Trillions', 'CustomValue'])
602
+ unless validator.valid?(display_unit)
603
+ fail ArgumentError, 'invalid value for "display_unit", must be one of #{validator.allowable_values}.'
604
+ end
605
+ @display_unit = display_unit
606
+ end
607
+
608
+ # Custom attribute writer method checking allowed values (enum).
609
+ # @param [Object] base_unit_scale Object to be assigned
610
+ def base_unit_scale=(base_unit_scale)
611
+ validator = EnumAttributeValidator.new('String', ['Days', 'Months', 'Years'])
612
+ unless validator.valid?(base_unit_scale)
613
+ fail ArgumentError, 'invalid value for "base_unit_scale", must be one of #{validator.allowable_values}.'
614
+ end
615
+ @base_unit_scale = base_unit_scale
616
+ end
617
+
618
+ # Custom attribute writer method checking allowed values (enum).
619
+ # @param [Object] major_unit_scale Object to be assigned
620
+ def major_unit_scale=(major_unit_scale)
621
+ validator = EnumAttributeValidator.new('String', ['Days', 'Months', 'Years'])
622
+ unless validator.valid?(major_unit_scale)
623
+ fail ArgumentError, 'invalid value for "major_unit_scale", must be one of #{validator.allowable_values}.'
624
+ end
625
+ @major_unit_scale = major_unit_scale
626
+ end
627
+
628
+ # Custom attribute writer method checking allowed values (enum).
629
+ # @param [Object] major_tick_mark Object to be assigned
630
+ def major_tick_mark=(major_tick_mark)
631
+ validator = EnumAttributeValidator.new('String', ['Cross', 'Inside', 'None', 'Outside'])
632
+ unless validator.valid?(major_tick_mark)
633
+ fail ArgumentError, 'invalid value for "major_tick_mark", must be one of #{validator.allowable_values}.'
634
+ end
635
+ @major_tick_mark = major_tick_mark
636
+ end
637
+
638
+ # Custom attribute writer method checking allowed values (enum).
639
+ # @param [Object] minor_unit_scale Object to be assigned
640
+ def minor_unit_scale=(minor_unit_scale)
641
+ validator = EnumAttributeValidator.new('String', ['Days', 'Months', 'Years'])
642
+ unless validator.valid?(minor_unit_scale)
643
+ fail ArgumentError, 'invalid value for "minor_unit_scale", must be one of #{validator.allowable_values}.'
644
+ end
645
+ @minor_unit_scale = minor_unit_scale
646
+ end
647
+
648
+ # Custom attribute writer method checking allowed values (enum).
649
+ # @param [Object] minor_tick_mark Object to be assigned
650
+ def minor_tick_mark=(minor_tick_mark)
651
+ validator = EnumAttributeValidator.new('String', ['Cross', 'Inside', 'None', 'Outside'])
652
+ unless validator.valid?(minor_tick_mark)
653
+ fail ArgumentError, 'invalid value for "minor_tick_mark", must be one of #{validator.allowable_values}.'
654
+ end
655
+ @minor_tick_mark = minor_tick_mark
656
+ end
657
+
658
+ # Custom attribute writer method checking allowed values (enum).
659
+ # @param [Object] category_axis_type Object to be assigned
660
+ def category_axis_type=(category_axis_type)
661
+ validator = EnumAttributeValidator.new('String', ['Text', 'Date'])
662
+ unless validator.valid?(category_axis_type)
663
+ fail ArgumentError, 'invalid value for "category_axis_type", must be one of #{validator.allowable_values}.'
664
+ end
665
+ @category_axis_type = category_axis_type
666
+ end
667
+
668
+ # Custom attribute writer method checking allowed values (enum).
669
+ # @param [Object] cross_type Object to be assigned
670
+ def cross_type=(cross_type)
671
+ validator = EnumAttributeValidator.new('String', ['AxisCrossesAtZero', 'Maximum', 'Custom'])
672
+ unless validator.valid?(cross_type)
673
+ fail ArgumentError, 'invalid value for "cross_type", must be one of #{validator.allowable_values}.'
674
+ end
675
+ @cross_type = cross_type
676
+ end
677
+
678
+ # Custom attribute writer method checking allowed values (enum).
679
+ # @param [Object] tick_label_position Object to be assigned
680
+ def tick_label_position=(tick_label_position)
681
+ validator = EnumAttributeValidator.new('String', ['High', 'Low', 'NextTo', 'None'])
682
+ unless validator.valid?(tick_label_position)
683
+ fail ArgumentError, 'invalid value for "tick_label_position", must be one of #{validator.allowable_values}.'
684
+ end
685
+ @tick_label_position = tick_label_position
686
+ end
687
+
688
+ # Checks equality by comparing each attribute.
689
+ # @param [Object] Object to be compared
690
+ def ==(o)
691
+ return true if self.equal?(o)
692
+ self.class == o.class &&
693
+ is_visible == o.is_visible &&
694
+ has_title == o.has_title &&
695
+ position == o.position &&
696
+ display_unit == o.display_unit &&
697
+ base_unit_scale == o.base_unit_scale &&
698
+ is_automatic_major_unit == o.is_automatic_major_unit &&
699
+ major_unit == o.major_unit &&
700
+ major_unit_scale == o.major_unit_scale &&
701
+ major_tick_mark == o.major_tick_mark &&
702
+ is_automatic_minor_unit == o.is_automatic_minor_unit &&
703
+ minor_unit == o.minor_unit &&
704
+ minor_unit_scale == o.minor_unit_scale &&
705
+ minor_tick_mark == o.minor_tick_mark &&
706
+ is_automatic_max_value == o.is_automatic_max_value &&
707
+ max_value == o.max_value &&
708
+ is_automatic_min_value == o.is_automatic_min_value &&
709
+ min_value == o.min_value &&
710
+ is_logarithmic == o.is_logarithmic &&
711
+ log_base == o.log_base &&
712
+ category_axis_type == o.category_axis_type &&
713
+ axis_between_categories == o.axis_between_categories &&
714
+ label_offset == o.label_offset &&
715
+ is_plot_order_reversed == o.is_plot_order_reversed &&
716
+ is_number_format_linked_to_source == o.is_number_format_linked_to_source &&
717
+ number_format == o.number_format &&
718
+ cross_type == o.cross_type &&
719
+ cross_at == o.cross_at &&
720
+ is_automatic_tick_marks_spacing == o.is_automatic_tick_marks_spacing &&
721
+ tick_marks_spacing == o.tick_marks_spacing &&
722
+ is_automatic_tick_label_spacing == o.is_automatic_tick_label_spacing &&
723
+ tick_label_spacing == o.tick_label_spacing &&
724
+ tick_label_position == o.tick_label_position &&
725
+ tick_label_rotation_angle == o.tick_label_rotation_angle &&
726
+ fill_format == o.fill_format &&
727
+ effect_format == o.effect_format &&
728
+ line_format == o.line_format
729
+ end
730
+
731
+ # @see the `==` method
732
+ # @param [Object] Object to be compared
733
+ def eql?(o)
734
+ self == o
735
+ end
736
+
737
+ # Calculates hash code according to all attributes.
738
+ # @return [Fixnum] Hash code
739
+ def hash
740
+ [is_visible, has_title, position, display_unit, base_unit_scale, is_automatic_major_unit, major_unit, major_unit_scale, major_tick_mark, is_automatic_minor_unit, minor_unit, minor_unit_scale, minor_tick_mark, is_automatic_max_value, max_value, is_automatic_min_value, min_value, is_logarithmic, log_base, category_axis_type, axis_between_categories, label_offset, is_plot_order_reversed, is_number_format_linked_to_source, number_format, cross_type, cross_at, is_automatic_tick_marks_spacing, tick_marks_spacing, is_automatic_tick_label_spacing, tick_label_spacing, tick_label_position, tick_label_rotation_angle, fill_format, effect_format, line_format].hash
741
+ end
742
+
743
+ # Builds the object from hash
744
+ # @param [Hash] attributes Model attributes in the form of hash
745
+ # @return [Object] Returns the model itself
746
+ def build_from_hash(attributes)
747
+ return nil unless attributes.is_a?(Hash)
748
+ self.class.swagger_types.each_pair do |key, type|
749
+ if type =~ /\AArray<(.*)>/i
750
+ # check to ensure the input is an array given that the the attribute
751
+ # is documented as an array but the input is not
752
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
753
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
754
+ end
755
+ elsif !attributes[self.class.attribute_map[key]].nil?
756
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
757
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
758
+ end
759
+
760
+ self
761
+ end
762
+
763
+ # Deserializes the data based on type
764
+ # @param string type Data type
765
+ # @param string value Value to be deserialized
766
+ # @return [Object] Deserialized data
767
+ def _deserialize(type, value)
768
+ case type.to_sym
769
+ when :DateTime
770
+ DateTime.parse(value)
771
+ when :Date
772
+ Date.parse(value)
773
+ when :String
774
+ value.to_s
775
+ when :Integer
776
+ value.to_i
777
+ when :Float
778
+ value.to_f
779
+ when :BOOLEAN
780
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
781
+ true
782
+ else
783
+ false
784
+ end
785
+ when :Object
786
+ # generic object (usually a Hash), return directly
787
+ value
788
+ when /\AArray<(?<inner_type>.+)>\z/
789
+ inner_type = Regexp.last_match[:inner_type]
790
+ value.map { |v| _deserialize(inner_type, v) }
791
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
792
+ k_type = Regexp.last_match[:k_type]
793
+ v_type = Regexp.last_match[:v_type]
794
+ {}.tap do |hash|
795
+ value.each do |k, v|
796
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
797
+ end
798
+ end
799
+ else # model
800
+ temp_model = AsposeSlidesCloud.const_get(type).new
801
+ temp_model.build_from_hash(value)
802
+ end
803
+ end
804
+
805
+ # Returns the string representation of the object
806
+ # @return [String] String presentation of the object
807
+ def to_s
808
+ to_hash.to_s
809
+ end
810
+
811
+ # to_body is an alias to to_hash (backward compatibility)
812
+ # @return [Hash] Returns the object in the form of hash
813
+ def to_body
814
+ to_hash
815
+ end
816
+
817
+ # Returns the object in the form of hash
818
+ # @return [Hash] Returns the object in the form of hash
819
+ def to_hash
820
+ hash = {}
821
+ self.class.attribute_map.each_pair do |attr, param|
822
+ value = self.send(attr)
823
+ next if value.nil?
824
+ hash[param] = _to_hash(value)
825
+ end
826
+ hash
827
+ end
828
+
829
+ # Outputs non-array value in the form of hash
830
+ # For object, use to_hash. Otherwise, just return the value
831
+ # @param [Object] value Any valid value
832
+ # @return [Hash] Returns the value in the form of hash
833
+ def _to_hash(value)
834
+ if value.is_a?(Array)
835
+ value.compact.map { |v| _to_hash(v) }
836
+ elsif value.is_a?(Hash)
837
+ {}.tap do |hash|
838
+ value.each { |k, v| hash[k] = _to_hash(v) }
839
+ end
840
+ elsif value.respond_to? :to_hash
841
+ value.to_hash
842
+ else
843
+ value
844
+ end
845
+ end
846
+ end
847
+ end