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.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/Gemfile +7 -0
- data/LICENSE +2 -3
- data/README.md +7 -39
- data/Rakefile +8 -0
- data/TestData/TemplateCV.pptx +0 -0
- data/TestData/TemplatingCVDataWithBase64.xml +23 -0
- data/TestData/placeholders.pptx +0 -0
- data/TestData/test-unprotected.ppt +0 -0
- data/TestData/test.ppt +0 -0
- data/aspose_slides_cloud.gemspec +42 -14
- data/lib/aspose_slides_cloud.rb +183 -78
- data/lib/aspose_slides_cloud/api/slides_api.rb +6906 -2256
- data/lib/aspose_slides_cloud/api/slides_api_requests.rb +3067 -0
- data/lib/aspose_slides_cloud/api_client.rb +273 -183
- data/lib/aspose_slides_cloud/api_error.rb +29 -5
- data/lib/aspose_slides_cloud/configuration.rb +93 -81
- data/lib/aspose_slides_cloud/models/add_layout_slide.rb +261 -0
- data/lib/aspose_slides_cloud/models/add_master_slide.rb +276 -0
- data/lib/aspose_slides_cloud/models/add_shape.rb +256 -0
- data/lib/aspose_slides_cloud/models/add_slide.rb +286 -0
- data/lib/aspose_slides_cloud/models/api_info.rb +205 -0
- data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +257 -22
- data/lib/aspose_slides_cloud/models/audio_frame.rb +573 -0
- data/lib/aspose_slides_cloud/models/axes.rb +225 -0
- data/lib/aspose_slides_cloud/models/axis.rb +847 -0
- data/lib/aspose_slides_cloud/models/base64_input_file.rb +256 -0
- data/lib/aspose_slides_cloud/models/blur_effect.rb +215 -0
- data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +230 -0
- data/lib/aspose_slides_cloud/models/bubble_series.rb +463 -0
- data/lib/aspose_slides_cloud/models/chart.rb +543 -0
- data/lib/aspose_slides_cloud/models/chart_title.rb +210 -0
- data/lib/aspose_slides_cloud/models/chart_wall.rb +279 -0
- data/lib/aspose_slides_cloud/models/color_scheme.rb +258 -84
- data/lib/aspose_slides_cloud/models/connector.rb +487 -0
- data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +171 -13
- data/lib/aspose_slides_cloud/models/disc_usage.rb +215 -0
- data/lib/aspose_slides_cloud/models/document.rb +222 -46
- data/lib/aspose_slides_cloud/models/document_properties.rb +188 -36
- data/lib/aspose_slides_cloud/models/document_property.rb +209 -48
- data/lib/aspose_slides_cloud/models/document_replace_result.rb +272 -0
- data/lib/aspose_slides_cloud/models/effect.rb +412 -0
- data/lib/aspose_slides_cloud/models/effect_format.rb +265 -0
- data/lib/aspose_slides_cloud/models/error.rb +225 -0
- data/lib/aspose_slides_cloud/models/error_details.rb +210 -0
- data/lib/aspose_slides_cloud/models/export_format.rb +59 -0
- data/lib/aspose_slides_cloud/models/export_options.rb +194 -0
- data/lib/aspose_slides_cloud/models/file_version.rb +270 -0
- data/lib/aspose_slides_cloud/models/file_versions.rb +197 -0
- data/lib/aspose_slides_cloud/models/files_list.rb +197 -0
- data/lib/aspose_slides_cloud/models/files_upload_result.rb +209 -0
- data/lib/aspose_slides_cloud/models/fill_format.rb +204 -13
- data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +234 -0
- data/lib/aspose_slides_cloud/models/font_scheme.rb +204 -48
- data/lib/aspose_slides_cloud/models/font_set.rb +184 -22
- data/lib/aspose_slides_cloud/models/format_scheme.rb +210 -52
- data/lib/aspose_slides_cloud/models/geometry_shape.rb +439 -0
- data/lib/aspose_slides_cloud/models/glow_effect.rb +210 -0
- data/lib/aspose_slides_cloud/models/gradient_fill.rb +359 -0
- data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +210 -0
- data/lib/aspose_slides_cloud/models/graphical_object.rb +422 -0
- data/lib/aspose_slides_cloud/models/group_shape.rb +422 -0
- data/lib/aspose_slides_cloud/models/html_export_options.rb +392 -25
- data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +195 -0
- data/lib/aspose_slides_cloud/models/image.rb +216 -42
- data/lib/aspose_slides_cloud/models/image_export_format.rb +43 -0
- data/lib/aspose_slides_cloud/models/image_export_options.rb +298 -0
- data/lib/aspose_slides_cloud/models/images.rb +188 -36
- data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +240 -0
- data/lib/aspose_slides_cloud/models/input.rb +215 -0
- data/lib/aspose_slides_cloud/models/input_file.rb +238 -0
- data/lib/aspose_slides_cloud/models/interactive_sequence.rb +212 -0
- data/lib/aspose_slides_cloud/models/layout_slide.rb +288 -0
- data/lib/aspose_slides_cloud/models/layout_slides.rb +219 -0
- data/lib/aspose_slides_cloud/models/legend.rb +339 -0
- data/lib/aspose_slides_cloud/models/line_format.rb +349 -54
- data/lib/aspose_slides_cloud/models/master_slide.rb +241 -0
- data/lib/aspose_slides_cloud/models/master_slides.rb +219 -0
- data/lib/aspose_slides_cloud/models/merge.rb +248 -0
- data/lib/aspose_slides_cloud/models/merging_source.rb +207 -0
- data/lib/aspose_slides_cloud/models/no_fill.rb +236 -0
- data/lib/aspose_slides_cloud/models/notes_slide.rb +227 -0
- data/lib/aspose_slides_cloud/models/notes_slide_export_format.rb +43 -0
- data/lib/aspose_slides_cloud/models/object_exist.rb +215 -0
- data/lib/aspose_slides_cloud/models/ole_object_frame.rb +447 -0
- data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +200 -0
- data/lib/aspose_slides_cloud/models/one_value_series.rb +463 -0
- data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +171 -13
- data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +240 -0
- data/lib/aspose_slides_cloud/models/output_file.rb +228 -0
- data/lib/aspose_slides_cloud/models/paragraph.rb +494 -34
- data/lib/aspose_slides_cloud/models/paragraphs.rb +187 -35
- data/lib/aspose_slides_cloud/models/path_input_file.rb +266 -0
- data/lib/aspose_slides_cloud/models/path_output_file.rb +256 -0
- data/lib/aspose_slides_cloud/models/pattern_fill.rb +283 -0
- data/lib/aspose_slides_cloud/models/pdf_export_options.rb +467 -49
- data/lib/aspose_slides_cloud/models/picture_fill.rb +368 -0
- data/lib/aspose_slides_cloud/models/picture_frame.rb +459 -0
- data/lib/aspose_slides_cloud/models/pipeline.rb +207 -0
- data/lib/aspose_slides_cloud/models/placeholder.rb +294 -56
- data/lib/aspose_slides_cloud/models/placeholders.rb +188 -36
- data/lib/aspose_slides_cloud/models/plot_area.rb +324 -0
- data/lib/aspose_slides_cloud/models/portion.rb +564 -46
- data/lib/aspose_slides_cloud/models/portions.rb +219 -0
- data/lib/aspose_slides_cloud/models/pptx_export_options.rb +246 -0
- data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +188 -18
- data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +185 -15
- data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +274 -0
- data/lib/aspose_slides_cloud/models/reflection_effect.rb +429 -0
- data/lib/aspose_slides_cloud/models/remove_shape.rb +246 -0
- data/lib/aspose_slides_cloud/models/remove_slide.rb +251 -0
- data/lib/aspose_slides_cloud/models/reorder_slide.rb +266 -0
- data/lib/aspose_slides_cloud/models/replace_text.rb +286 -0
- data/lib/aspose_slides_cloud/models/request_input_file.rb +261 -0
- data/lib/aspose_slides_cloud/models/reset_slide.rb +251 -0
- data/lib/aspose_slides_cloud/models/resource_base.rb +207 -0
- data/lib/aspose_slides_cloud/models/resource_uri.rb +190 -26
- data/lib/aspose_slides_cloud/models/resource_uri_element.rb +171 -13
- data/lib/aspose_slides_cloud/models/response_output_file.rb +236 -0
- data/lib/aspose_slides_cloud/models/save.rb +283 -0
- data/lib/aspose_slides_cloud/models/save_shape.rb +293 -0
- data/lib/aspose_slides_cloud/models/save_slide.rb +318 -0
- data/lib/aspose_slides_cloud/models/scale_type.rb +41 -0
- data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +215 -0
- data/lib/aspose_slides_cloud/models/scatter_series.rb +463 -0
- data/lib/aspose_slides_cloud/models/series.rb +424 -0
- data/lib/aspose_slides_cloud/models/series_marker.rb +279 -0
- data/lib/aspose_slides_cloud/models/shape.rb +398 -100
- data/lib/aspose_slides_cloud/models/shape_base.rb +406 -0
- data/lib/aspose_slides_cloud/models/shape_export_format.rb +44 -0
- data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +274 -0
- data/lib/aspose_slides_cloud/models/shape_thumbnail_bounds.rb +41 -0
- data/lib/aspose_slides_cloud/models/shapes.rb +219 -0
- data/lib/aspose_slides_cloud/models/size_type.rb +55 -0
- data/lib/aspose_slides_cloud/models/slide.rb +277 -66
- data/lib/aspose_slides_cloud/models/slide_animation.rb +231 -0
- data/lib/aspose_slides_cloud/models/slide_background.rb +245 -42
- data/lib/aspose_slides_cloud/models/slide_comment.rb +198 -24
- data/lib/aspose_slides_cloud/models/slide_comments.rb +188 -36
- data/lib/aspose_slides_cloud/models/slide_export_format.rb +58 -0
- data/lib/aspose_slides_cloud/models/slide_replace_result.rb +347 -0
- data/lib/aspose_slides_cloud/models/slides.rb +188 -36
- data/lib/aspose_slides_cloud/models/smart_art.rb +530 -0
- data/lib/aspose_slides_cloud/models/smart_art_node.rb +281 -0
- data/lib/aspose_slides_cloud/models/smart_art_shape.rb +422 -0
- data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +200 -0
- data/lib/aspose_slides_cloud/models/solid_fill.rb +246 -0
- data/lib/aspose_slides_cloud/models/split_document_result.rb +188 -36
- data/lib/aspose_slides_cloud/models/storage_exist.rb +200 -0
- data/lib/aspose_slides_cloud/models/storage_file.rb +245 -0
- data/lib/aspose_slides_cloud/models/svg_export_options.rb +378 -0
- data/lib/aspose_slides_cloud/models/swf_export_options.rb +528 -0
- data/lib/aspose_slides_cloud/models/table.rb +578 -0
- data/lib/aspose_slides_cloud/models/table_cell.rb +431 -0
- data/lib/aspose_slides_cloud/models/table_column.rb +200 -0
- data/lib/aspose_slides_cloud/models/table_row.rb +227 -0
- data/lib/aspose_slides_cloud/models/task.rb +228 -0
- data/lib/aspose_slides_cloud/models/text_item.rb +178 -18
- data/lib/aspose_slides_cloud/models/text_items.rb +188 -36
- data/lib/aspose_slides_cloud/models/theme.rb +210 -52
- data/lib/aspose_slides_cloud/models/tiff_export_options.rb +385 -40
- data/lib/aspose_slides_cloud/models/update_background.rb +258 -0
- data/lib/aspose_slides_cloud/models/update_shape.rb +256 -0
- data/lib/aspose_slides_cloud/models/video_frame.rb +543 -0
- data/lib/aspose_slides_cloud/models/xps_export_options.rb +242 -0
- data/lib/aspose_slides_cloud/version.rb +23 -1
- data/spec/api/slides_api_spec.rb +24188 -0
- data/spec/extra/extra_spec.rb +84 -0
- data/spec/spec_helper.rb +122 -0
- data/spec/spec_utils.rb +154 -0
- data/testConfig.json +7 -0
- data/testRules.json +333 -0
- metadata +273 -61
- data/lib/aspose_slides_cloud/models/base_object.rb +0 -86
- data/lib/aspose_slides_cloud/models/base_response.rb +0 -53
- data/lib/aspose_slides_cloud/models/color.rb +0 -29
- data/lib/aspose_slides_cloud/models/color_scheme_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/common_response.rb +0 -53
- data/lib/aspose_slides_cloud/models/document_properties_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/document_property_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/document_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/font_scheme_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/format_scheme_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/images_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/new_shape_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/paragraph_portion_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/placeholder_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/placeholders_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/presentation_string_replace_response.rb +0 -69
- data/lib/aspose_slides_cloud/models/shape_list.rb +0 -67
- data/lib/aspose_slides_cloud/models/shape_paragraph_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/shape_paragraphs_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/shape_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/slide_background_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/slide_comments_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/slide_list_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/slide_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/slide_string_replace_response.rb +0 -69
- data/lib/aspose_slides_cloud/models/split_document_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/text_items_response.rb +0 -61
- data/lib/aspose_slides_cloud/models/theme_response.rb +0 -61
- data/test/slides_tests.rb +0 -580
@@ -0,0 +1,424 @@
|
|
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
|
+
# A chart series.
|
27
|
+
class Series
|
28
|
+
# Series type.
|
29
|
+
attr_accessor :type
|
30
|
+
|
31
|
+
# Series name.
|
32
|
+
attr_accessor :name
|
33
|
+
|
34
|
+
# True if each data marker in the series has a different color.
|
35
|
+
attr_accessor :is_color_varied
|
36
|
+
|
37
|
+
# Invert solid color for the series.
|
38
|
+
attr_accessor :inverted_solid_fill_color
|
39
|
+
|
40
|
+
# True if curve smoothing is turned on. Applies only to line and scatter connected by lines charts.
|
41
|
+
attr_accessor :smooth
|
42
|
+
|
43
|
+
# True if the series is plotted on second value axis.
|
44
|
+
attr_accessor :plot_on_second_axis
|
45
|
+
|
46
|
+
# Series order.
|
47
|
+
attr_accessor :order
|
48
|
+
|
49
|
+
# The number format for the series y values.
|
50
|
+
attr_accessor :number_format_of_y_values
|
51
|
+
|
52
|
+
# The number format for the series x values.
|
53
|
+
attr_accessor :number_format_of_x_values
|
54
|
+
|
55
|
+
# The number format for the series values.
|
56
|
+
attr_accessor :number_format_of_values
|
57
|
+
|
58
|
+
# The number format for the series bubble sizes.
|
59
|
+
attr_accessor :number_format_of_bubble_sizes
|
60
|
+
|
61
|
+
# True if the series shall invert its colors if the value is negative. Applies to bar, column and bubble series.
|
62
|
+
attr_accessor :invert_if_negative
|
63
|
+
|
64
|
+
# The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
|
65
|
+
attr_accessor :explosion
|
66
|
+
|
67
|
+
# Series marker.
|
68
|
+
attr_accessor :marker
|
69
|
+
|
70
|
+
# Fill properties set for the series.
|
71
|
+
attr_accessor :fill_format
|
72
|
+
|
73
|
+
# Effect properties set for the series.
|
74
|
+
attr_accessor :effect_format
|
75
|
+
|
76
|
+
# Line properties set for the series.
|
77
|
+
attr_accessor :line_format
|
78
|
+
|
79
|
+
class EnumAttributeValidator
|
80
|
+
attr_reader :datatype
|
81
|
+
attr_reader :allowable_values
|
82
|
+
|
83
|
+
def initialize(datatype, allowable_values)
|
84
|
+
@allowable_values = allowable_values.map do |value|
|
85
|
+
case datatype.to_s
|
86
|
+
when /Integer/i
|
87
|
+
value.to_i
|
88
|
+
when /Float/i
|
89
|
+
value.to_f
|
90
|
+
else
|
91
|
+
value
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def valid?(value)
|
97
|
+
!value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
102
|
+
def self.attribute_map
|
103
|
+
{
|
104
|
+
:'type' => :'Type',
|
105
|
+
:'name' => :'Name',
|
106
|
+
:'is_color_varied' => :'IsColorVaried',
|
107
|
+
:'inverted_solid_fill_color' => :'InvertedSolidFillColor',
|
108
|
+
:'smooth' => :'Smooth',
|
109
|
+
:'plot_on_second_axis' => :'PlotOnSecondAxis',
|
110
|
+
:'order' => :'Order',
|
111
|
+
:'number_format_of_y_values' => :'NumberFormatOfYValues',
|
112
|
+
:'number_format_of_x_values' => :'NumberFormatOfXValues',
|
113
|
+
:'number_format_of_values' => :'NumberFormatOfValues',
|
114
|
+
:'number_format_of_bubble_sizes' => :'NumberFormatOfBubbleSizes',
|
115
|
+
:'invert_if_negative' => :'InvertIfNegative',
|
116
|
+
:'explosion' => :'Explosion',
|
117
|
+
:'marker' => :'Marker',
|
118
|
+
:'fill_format' => :'FillFormat',
|
119
|
+
:'effect_format' => :'EffectFormat',
|
120
|
+
:'line_format' => :'LineFormat'
|
121
|
+
}
|
122
|
+
end
|
123
|
+
|
124
|
+
# Attribute type mapping.
|
125
|
+
def self.swagger_types
|
126
|
+
{
|
127
|
+
:'type' => :'String',
|
128
|
+
:'name' => :'String',
|
129
|
+
:'is_color_varied' => :'BOOLEAN',
|
130
|
+
:'inverted_solid_fill_color' => :'String',
|
131
|
+
:'smooth' => :'BOOLEAN',
|
132
|
+
:'plot_on_second_axis' => :'BOOLEAN',
|
133
|
+
:'order' => :'Integer',
|
134
|
+
:'number_format_of_y_values' => :'String',
|
135
|
+
:'number_format_of_x_values' => :'String',
|
136
|
+
:'number_format_of_values' => :'String',
|
137
|
+
:'number_format_of_bubble_sizes' => :'String',
|
138
|
+
:'invert_if_negative' => :'BOOLEAN',
|
139
|
+
:'explosion' => :'Integer',
|
140
|
+
:'marker' => :'SeriesMarker',
|
141
|
+
:'fill_format' => :'FillFormat',
|
142
|
+
:'effect_format' => :'EffectFormat',
|
143
|
+
:'line_format' => :'LineFormat'
|
144
|
+
}
|
145
|
+
end
|
146
|
+
|
147
|
+
# Initializes the object
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
149
|
+
def initialize(attributes = {})
|
150
|
+
return unless attributes.is_a?(Hash)
|
151
|
+
|
152
|
+
# convert string to symbol for hash key
|
153
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
154
|
+
|
155
|
+
if attributes.has_key?(:'Type')
|
156
|
+
self.type = attributes[:'Type']
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.has_key?(:'Name')
|
160
|
+
self.name = attributes[:'Name']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.has_key?(:'IsColorVaried')
|
164
|
+
self.is_color_varied = attributes[:'IsColorVaried']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.has_key?(:'InvertedSolidFillColor')
|
168
|
+
self.inverted_solid_fill_color = attributes[:'InvertedSolidFillColor']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.has_key?(:'Smooth')
|
172
|
+
self.smooth = attributes[:'Smooth']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.has_key?(:'PlotOnSecondAxis')
|
176
|
+
self.plot_on_second_axis = attributes[:'PlotOnSecondAxis']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.has_key?(:'Order')
|
180
|
+
self.order = attributes[:'Order']
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.has_key?(:'NumberFormatOfYValues')
|
184
|
+
self.number_format_of_y_values = attributes[:'NumberFormatOfYValues']
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.has_key?(:'NumberFormatOfXValues')
|
188
|
+
self.number_format_of_x_values = attributes[:'NumberFormatOfXValues']
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.has_key?(:'NumberFormatOfValues')
|
192
|
+
self.number_format_of_values = attributes[:'NumberFormatOfValues']
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.has_key?(:'NumberFormatOfBubbleSizes')
|
196
|
+
self.number_format_of_bubble_sizes = attributes[:'NumberFormatOfBubbleSizes']
|
197
|
+
end
|
198
|
+
|
199
|
+
if attributes.has_key?(:'InvertIfNegative')
|
200
|
+
self.invert_if_negative = attributes[:'InvertIfNegative']
|
201
|
+
end
|
202
|
+
|
203
|
+
if attributes.has_key?(:'Explosion')
|
204
|
+
self.explosion = attributes[:'Explosion']
|
205
|
+
end
|
206
|
+
|
207
|
+
if attributes.has_key?(:'Marker')
|
208
|
+
self.marker = attributes[:'Marker']
|
209
|
+
end
|
210
|
+
|
211
|
+
if attributes.has_key?(:'FillFormat')
|
212
|
+
self.fill_format = attributes[:'FillFormat']
|
213
|
+
end
|
214
|
+
|
215
|
+
if attributes.has_key?(:'EffectFormat')
|
216
|
+
self.effect_format = attributes[:'EffectFormat']
|
217
|
+
end
|
218
|
+
|
219
|
+
if attributes.has_key?(:'LineFormat')
|
220
|
+
self.line_format = attributes[:'LineFormat']
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
225
|
+
# @return Array for valid properties with the reasons
|
226
|
+
def list_invalid_properties
|
227
|
+
invalid_properties = Array.new
|
228
|
+
if @type.nil?
|
229
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
230
|
+
end
|
231
|
+
|
232
|
+
if @is_color_varied.nil?
|
233
|
+
invalid_properties.push('invalid value for "is_color_varied", is_color_varied cannot be nil.')
|
234
|
+
end
|
235
|
+
|
236
|
+
if @smooth.nil?
|
237
|
+
invalid_properties.push('invalid value for "smooth", smooth cannot be nil.')
|
238
|
+
end
|
239
|
+
|
240
|
+
if @plot_on_second_axis.nil?
|
241
|
+
invalid_properties.push('invalid value for "plot_on_second_axis", plot_on_second_axis cannot be nil.')
|
242
|
+
end
|
243
|
+
|
244
|
+
if @order.nil?
|
245
|
+
invalid_properties.push('invalid value for "order", order cannot be nil.')
|
246
|
+
end
|
247
|
+
|
248
|
+
if @invert_if_negative.nil?
|
249
|
+
invalid_properties.push('invalid value for "invert_if_negative", invert_if_negative cannot be nil.')
|
250
|
+
end
|
251
|
+
|
252
|
+
if @explosion.nil?
|
253
|
+
invalid_properties.push('invalid value for "explosion", explosion cannot be nil.')
|
254
|
+
end
|
255
|
+
|
256
|
+
invalid_properties
|
257
|
+
end
|
258
|
+
|
259
|
+
# Check to see if the all the properties in the model are valid
|
260
|
+
# @return true if the model is valid
|
261
|
+
def valid?
|
262
|
+
return false if @type.nil?
|
263
|
+
type_validator = EnumAttributeValidator.new('String', ['ClusteredColumn', 'StackedColumn', 'PercentsStackedColumn', 'ClusteredColumn3D', 'StackedColumn3D', 'PercentsStackedColumn3D', 'Column3D', 'ClusteredCylinder', 'StackedCylinder', 'PercentsStackedCylinder', 'Cylinder3D', 'ClusteredCone', 'StackedCone', 'PercentsStackedCone', 'Cone3D', 'ClusteredPyramid', 'StackedPyramid', 'PercentsStackedPyramid', 'Pyramid3D', 'Line', 'StackedLine', 'PercentsStackedLine', 'LineWithMarkers', 'StackedLineWithMarkers', 'PercentsStackedLineWithMarkers', 'Line3D', 'Pie', 'Pie3D', 'PieOfPie', 'ExplodedPie', 'ExplodedPie3D', 'BarOfPie', 'PercentsStackedBar', 'ClusteredBar3D', 'ClusteredBar', 'StackedBar', 'StackedBar3D', 'PercentsStackedBar3D', 'ClusteredHorizontalCylinder', 'StackedHorizontalCylinder', 'PercentsStackedHorizontalCylinder', 'ClusteredHorizontalCone', 'StackedHorizontalCone', 'PercentsStackedHorizontalCone', 'ClusteredHorizontalPyramid', 'StackedHorizontalPyramid', 'PercentsStackedHorizontalPyramid', 'Area', 'StackedArea', 'PercentsStackedArea', 'Area3D', 'StackedArea3D', 'PercentsStackedArea3D', 'ScatterWithMarkers', 'ScatterWithSmoothLinesAndMarkers', 'ScatterWithSmoothLines', 'ScatterWithStraightLinesAndMarkers', 'ScatterWithStraightLines', 'HighLowClose', 'OpenHighLowClose', 'VolumeHighLowClose', 'VolumeOpenHighLowClose', 'Surface3D', 'WireframeSurface3D', 'Contour', 'WireframeContour', 'Doughnut', 'ExplodedDoughnut', 'Bubble', 'BubbleWith3D', 'Radar', 'RadarWithMarkers', 'FilledRadar', 'SeriesOfMixedTypes'])
|
264
|
+
return false unless type_validator.valid?(@type)
|
265
|
+
return false if @is_color_varied.nil?
|
266
|
+
return false if @smooth.nil?
|
267
|
+
return false if @plot_on_second_axis.nil?
|
268
|
+
return false if @order.nil?
|
269
|
+
return false if @invert_if_negative.nil?
|
270
|
+
return false if @explosion.nil?
|
271
|
+
true
|
272
|
+
end
|
273
|
+
|
274
|
+
# Custom attribute writer method checking allowed values (enum).
|
275
|
+
# @param [Object] type Object to be assigned
|
276
|
+
def type=(type)
|
277
|
+
validator = EnumAttributeValidator.new('String', ['ClusteredColumn', 'StackedColumn', 'PercentsStackedColumn', 'ClusteredColumn3D', 'StackedColumn3D', 'PercentsStackedColumn3D', 'Column3D', 'ClusteredCylinder', 'StackedCylinder', 'PercentsStackedCylinder', 'Cylinder3D', 'ClusteredCone', 'StackedCone', 'PercentsStackedCone', 'Cone3D', 'ClusteredPyramid', 'StackedPyramid', 'PercentsStackedPyramid', 'Pyramid3D', 'Line', 'StackedLine', 'PercentsStackedLine', 'LineWithMarkers', 'StackedLineWithMarkers', 'PercentsStackedLineWithMarkers', 'Line3D', 'Pie', 'Pie3D', 'PieOfPie', 'ExplodedPie', 'ExplodedPie3D', 'BarOfPie', 'PercentsStackedBar', 'ClusteredBar3D', 'ClusteredBar', 'StackedBar', 'StackedBar3D', 'PercentsStackedBar3D', 'ClusteredHorizontalCylinder', 'StackedHorizontalCylinder', 'PercentsStackedHorizontalCylinder', 'ClusteredHorizontalCone', 'StackedHorizontalCone', 'PercentsStackedHorizontalCone', 'ClusteredHorizontalPyramid', 'StackedHorizontalPyramid', 'PercentsStackedHorizontalPyramid', 'Area', 'StackedArea', 'PercentsStackedArea', 'Area3D', 'StackedArea3D', 'PercentsStackedArea3D', 'ScatterWithMarkers', 'ScatterWithSmoothLinesAndMarkers', 'ScatterWithSmoothLines', 'ScatterWithStraightLinesAndMarkers', 'ScatterWithStraightLines', 'HighLowClose', 'OpenHighLowClose', 'VolumeHighLowClose', 'VolumeOpenHighLowClose', 'Surface3D', 'WireframeSurface3D', 'Contour', 'WireframeContour', 'Doughnut', 'ExplodedDoughnut', 'Bubble', 'BubbleWith3D', 'Radar', 'RadarWithMarkers', 'FilledRadar', 'SeriesOfMixedTypes'])
|
278
|
+
unless validator.valid?(type)
|
279
|
+
fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
|
280
|
+
end
|
281
|
+
@type = type
|
282
|
+
end
|
283
|
+
|
284
|
+
# Checks equality by comparing each attribute.
|
285
|
+
# @param [Object] Object to be compared
|
286
|
+
def ==(o)
|
287
|
+
return true if self.equal?(o)
|
288
|
+
self.class == o.class &&
|
289
|
+
type == o.type &&
|
290
|
+
name == o.name &&
|
291
|
+
is_color_varied == o.is_color_varied &&
|
292
|
+
inverted_solid_fill_color == o.inverted_solid_fill_color &&
|
293
|
+
smooth == o.smooth &&
|
294
|
+
plot_on_second_axis == o.plot_on_second_axis &&
|
295
|
+
order == o.order &&
|
296
|
+
number_format_of_y_values == o.number_format_of_y_values &&
|
297
|
+
number_format_of_x_values == o.number_format_of_x_values &&
|
298
|
+
number_format_of_values == o.number_format_of_values &&
|
299
|
+
number_format_of_bubble_sizes == o.number_format_of_bubble_sizes &&
|
300
|
+
invert_if_negative == o.invert_if_negative &&
|
301
|
+
explosion == o.explosion &&
|
302
|
+
marker == o.marker &&
|
303
|
+
fill_format == o.fill_format &&
|
304
|
+
effect_format == o.effect_format &&
|
305
|
+
line_format == o.line_format
|
306
|
+
end
|
307
|
+
|
308
|
+
# @see the `==` method
|
309
|
+
# @param [Object] Object to be compared
|
310
|
+
def eql?(o)
|
311
|
+
self == o
|
312
|
+
end
|
313
|
+
|
314
|
+
# Calculates hash code according to all attributes.
|
315
|
+
# @return [Fixnum] Hash code
|
316
|
+
def hash
|
317
|
+
[type, name, is_color_varied, inverted_solid_fill_color, smooth, plot_on_second_axis, order, number_format_of_y_values, number_format_of_x_values, number_format_of_values, number_format_of_bubble_sizes, invert_if_negative, explosion, marker, fill_format, effect_format, line_format].hash
|
318
|
+
end
|
319
|
+
|
320
|
+
# Builds the object from hash
|
321
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
322
|
+
# @return [Object] Returns the model itself
|
323
|
+
def build_from_hash(attributes)
|
324
|
+
return nil unless attributes.is_a?(Hash)
|
325
|
+
self.class.swagger_types.each_pair do |key, type|
|
326
|
+
if type =~ /\AArray<(.*)>/i
|
327
|
+
# check to ensure the input is an array given that the the attribute
|
328
|
+
# is documented as an array but the input is not
|
329
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
330
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
331
|
+
end
|
332
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
333
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
334
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
335
|
+
end
|
336
|
+
|
337
|
+
self
|
338
|
+
end
|
339
|
+
|
340
|
+
# Deserializes the data based on type
|
341
|
+
# @param string type Data type
|
342
|
+
# @param string value Value to be deserialized
|
343
|
+
# @return [Object] Deserialized data
|
344
|
+
def _deserialize(type, value)
|
345
|
+
case type.to_sym
|
346
|
+
when :DateTime
|
347
|
+
DateTime.parse(value)
|
348
|
+
when :Date
|
349
|
+
Date.parse(value)
|
350
|
+
when :String
|
351
|
+
value.to_s
|
352
|
+
when :Integer
|
353
|
+
value.to_i
|
354
|
+
when :Float
|
355
|
+
value.to_f
|
356
|
+
when :BOOLEAN
|
357
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
358
|
+
true
|
359
|
+
else
|
360
|
+
false
|
361
|
+
end
|
362
|
+
when :Object
|
363
|
+
# generic object (usually a Hash), return directly
|
364
|
+
value
|
365
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
366
|
+
inner_type = Regexp.last_match[:inner_type]
|
367
|
+
value.map { |v| _deserialize(inner_type, v) }
|
368
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
369
|
+
k_type = Regexp.last_match[:k_type]
|
370
|
+
v_type = Regexp.last_match[:v_type]
|
371
|
+
{}.tap do |hash|
|
372
|
+
value.each do |k, v|
|
373
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
374
|
+
end
|
375
|
+
end
|
376
|
+
else # model
|
377
|
+
temp_model = AsposeSlidesCloud.const_get(type).new
|
378
|
+
temp_model.build_from_hash(value)
|
379
|
+
end
|
380
|
+
end
|
381
|
+
|
382
|
+
# Returns the string representation of the object
|
383
|
+
# @return [String] String presentation of the object
|
384
|
+
def to_s
|
385
|
+
to_hash.to_s
|
386
|
+
end
|
387
|
+
|
388
|
+
# to_body is an alias to to_hash (backward compatibility)
|
389
|
+
# @return [Hash] Returns the object in the form of hash
|
390
|
+
def to_body
|
391
|
+
to_hash
|
392
|
+
end
|
393
|
+
|
394
|
+
# Returns the object in the form of hash
|
395
|
+
# @return [Hash] Returns the object in the form of hash
|
396
|
+
def to_hash
|
397
|
+
hash = {}
|
398
|
+
self.class.attribute_map.each_pair do |attr, param|
|
399
|
+
value = self.send(attr)
|
400
|
+
next if value.nil?
|
401
|
+
hash[param] = _to_hash(value)
|
402
|
+
end
|
403
|
+
hash
|
404
|
+
end
|
405
|
+
|
406
|
+
# Outputs non-array value in the form of hash
|
407
|
+
# For object, use to_hash. Otherwise, just return the value
|
408
|
+
# @param [Object] value Any valid value
|
409
|
+
# @return [Hash] Returns the value in the form of hash
|
410
|
+
def _to_hash(value)
|
411
|
+
if value.is_a?(Array)
|
412
|
+
value.compact.map { |v| _to_hash(v) }
|
413
|
+
elsif value.is_a?(Hash)
|
414
|
+
{}.tap do |hash|
|
415
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
416
|
+
end
|
417
|
+
elsif value.respond_to? :to_hash
|
418
|
+
value.to_hash
|
419
|
+
else
|
420
|
+
value
|
421
|
+
end
|
422
|
+
end
|
423
|
+
end
|
424
|
+
end
|
@@ -0,0 +1,279 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2019 Aspose Pty Ltd
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
12
|
+
copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
SOFTWARE.
|
21
|
+
=end
|
22
|
+
|
23
|
+
require 'date'
|
24
|
+
|
25
|
+
module AsposeSlidesCloud
|
26
|
+
# Represents a series marker
|
27
|
+
class SeriesMarker
|
28
|
+
# size
|
29
|
+
attr_accessor :size
|
30
|
+
|
31
|
+
# symbol
|
32
|
+
attr_accessor :symbol
|
33
|
+
|
34
|
+
# Get or sets the fill format.
|
35
|
+
attr_accessor :fill_format
|
36
|
+
|
37
|
+
# Get or sets the effect format.
|
38
|
+
attr_accessor :effect_format
|
39
|
+
|
40
|
+
# Get or sets the line format.
|
41
|
+
attr_accessor :line_format
|
42
|
+
|
43
|
+
class EnumAttributeValidator
|
44
|
+
attr_reader :datatype
|
45
|
+
attr_reader :allowable_values
|
46
|
+
|
47
|
+
def initialize(datatype, allowable_values)
|
48
|
+
@allowable_values = allowable_values.map do |value|
|
49
|
+
case datatype.to_s
|
50
|
+
when /Integer/i
|
51
|
+
value.to_i
|
52
|
+
when /Float/i
|
53
|
+
value.to_f
|
54
|
+
else
|
55
|
+
value
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def valid?(value)
|
61
|
+
!value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
66
|
+
def self.attribute_map
|
67
|
+
{
|
68
|
+
:'size' => :'Size',
|
69
|
+
:'symbol' => :'Symbol',
|
70
|
+
:'fill_format' => :'FillFormat',
|
71
|
+
:'effect_format' => :'EffectFormat',
|
72
|
+
:'line_format' => :'LineFormat'
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
# Attribute type mapping.
|
77
|
+
def self.swagger_types
|
78
|
+
{
|
79
|
+
:'size' => :'Integer',
|
80
|
+
:'symbol' => :'String',
|
81
|
+
:'fill_format' => :'FillFormat',
|
82
|
+
:'effect_format' => :'EffectFormat',
|
83
|
+
:'line_format' => :'LineFormat'
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
87
|
+
# Initializes the object
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
89
|
+
def initialize(attributes = {})
|
90
|
+
return unless attributes.is_a?(Hash)
|
91
|
+
|
92
|
+
# convert string to symbol for hash key
|
93
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
94
|
+
|
95
|
+
if attributes.has_key?(:'Size')
|
96
|
+
self.size = attributes[:'Size']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.has_key?(:'Symbol')
|
100
|
+
self.symbol = attributes[:'Symbol']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.has_key?(:'FillFormat')
|
104
|
+
self.fill_format = attributes[:'FillFormat']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.has_key?(:'EffectFormat')
|
108
|
+
self.effect_format = attributes[:'EffectFormat']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.has_key?(:'LineFormat')
|
112
|
+
self.line_format = attributes[:'LineFormat']
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
117
|
+
# @return Array for valid properties with the reasons
|
118
|
+
def list_invalid_properties
|
119
|
+
invalid_properties = Array.new
|
120
|
+
if @size.nil?
|
121
|
+
invalid_properties.push('invalid value for "size", size cannot be nil.')
|
122
|
+
end
|
123
|
+
|
124
|
+
if @symbol.nil?
|
125
|
+
invalid_properties.push('invalid value for "symbol", symbol cannot be nil.')
|
126
|
+
end
|
127
|
+
|
128
|
+
invalid_properties
|
129
|
+
end
|
130
|
+
|
131
|
+
# Check to see if the all the properties in the model are valid
|
132
|
+
# @return true if the model is valid
|
133
|
+
def valid?
|
134
|
+
return false if @size.nil?
|
135
|
+
return false if @symbol.nil?
|
136
|
+
symbol_validator = EnumAttributeValidator.new('String', ['Circle', 'Dash', 'Diamond', 'Dot', 'None', 'Picture', 'Plus', 'Square', 'Star', 'Triangle', 'X', 'NotDefined'])
|
137
|
+
return false unless symbol_validator.valid?(@symbol)
|
138
|
+
true
|
139
|
+
end
|
140
|
+
|
141
|
+
# Custom attribute writer method checking allowed values (enum).
|
142
|
+
# @param [Object] symbol Object to be assigned
|
143
|
+
def symbol=(symbol)
|
144
|
+
validator = EnumAttributeValidator.new('String', ['Circle', 'Dash', 'Diamond', 'Dot', 'None', 'Picture', 'Plus', 'Square', 'Star', 'Triangle', 'X', 'NotDefined'])
|
145
|
+
unless validator.valid?(symbol)
|
146
|
+
fail ArgumentError, 'invalid value for "symbol", must be one of #{validator.allowable_values}.'
|
147
|
+
end
|
148
|
+
@symbol = symbol
|
149
|
+
end
|
150
|
+
|
151
|
+
# Checks equality by comparing each attribute.
|
152
|
+
# @param [Object] Object to be compared
|
153
|
+
def ==(o)
|
154
|
+
return true if self.equal?(o)
|
155
|
+
self.class == o.class &&
|
156
|
+
size == o.size &&
|
157
|
+
symbol == o.symbol &&
|
158
|
+
fill_format == o.fill_format &&
|
159
|
+
effect_format == o.effect_format &&
|
160
|
+
line_format == o.line_format
|
161
|
+
end
|
162
|
+
|
163
|
+
# @see the `==` method
|
164
|
+
# @param [Object] Object to be compared
|
165
|
+
def eql?(o)
|
166
|
+
self == o
|
167
|
+
end
|
168
|
+
|
169
|
+
# Calculates hash code according to all attributes.
|
170
|
+
# @return [Fixnum] Hash code
|
171
|
+
def hash
|
172
|
+
[size, symbol, fill_format, effect_format, line_format].hash
|
173
|
+
end
|
174
|
+
|
175
|
+
# Builds the object from hash
|
176
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
177
|
+
# @return [Object] Returns the model itself
|
178
|
+
def build_from_hash(attributes)
|
179
|
+
return nil unless attributes.is_a?(Hash)
|
180
|
+
self.class.swagger_types.each_pair do |key, type|
|
181
|
+
if type =~ /\AArray<(.*)>/i
|
182
|
+
# check to ensure the input is an array given that the the attribute
|
183
|
+
# is documented as an array but the input is not
|
184
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
185
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
186
|
+
end
|
187
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
188
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
189
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
190
|
+
end
|
191
|
+
|
192
|
+
self
|
193
|
+
end
|
194
|
+
|
195
|
+
# Deserializes the data based on type
|
196
|
+
# @param string type Data type
|
197
|
+
# @param string value Value to be deserialized
|
198
|
+
# @return [Object] Deserialized data
|
199
|
+
def _deserialize(type, value)
|
200
|
+
case type.to_sym
|
201
|
+
when :DateTime
|
202
|
+
DateTime.parse(value)
|
203
|
+
when :Date
|
204
|
+
Date.parse(value)
|
205
|
+
when :String
|
206
|
+
value.to_s
|
207
|
+
when :Integer
|
208
|
+
value.to_i
|
209
|
+
when :Float
|
210
|
+
value.to_f
|
211
|
+
when :BOOLEAN
|
212
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
213
|
+
true
|
214
|
+
else
|
215
|
+
false
|
216
|
+
end
|
217
|
+
when :Object
|
218
|
+
# generic object (usually a Hash), return directly
|
219
|
+
value
|
220
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
221
|
+
inner_type = Regexp.last_match[:inner_type]
|
222
|
+
value.map { |v| _deserialize(inner_type, v) }
|
223
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
224
|
+
k_type = Regexp.last_match[:k_type]
|
225
|
+
v_type = Regexp.last_match[:v_type]
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each do |k, v|
|
228
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
229
|
+
end
|
230
|
+
end
|
231
|
+
else # model
|
232
|
+
temp_model = AsposeSlidesCloud.const_get(type).new
|
233
|
+
temp_model.build_from_hash(value)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the string representation of the object
|
238
|
+
# @return [String] String presentation of the object
|
239
|
+
def to_s
|
240
|
+
to_hash.to_s
|
241
|
+
end
|
242
|
+
|
243
|
+
# to_body is an alias to to_hash (backward compatibility)
|
244
|
+
# @return [Hash] Returns the object in the form of hash
|
245
|
+
def to_body
|
246
|
+
to_hash
|
247
|
+
end
|
248
|
+
|
249
|
+
# Returns the object in the form of hash
|
250
|
+
# @return [Hash] Returns the object in the form of hash
|
251
|
+
def to_hash
|
252
|
+
hash = {}
|
253
|
+
self.class.attribute_map.each_pair do |attr, param|
|
254
|
+
value = self.send(attr)
|
255
|
+
next if value.nil?
|
256
|
+
hash[param] = _to_hash(value)
|
257
|
+
end
|
258
|
+
hash
|
259
|
+
end
|
260
|
+
|
261
|
+
# Outputs non-array value in the form of hash
|
262
|
+
# For object, use to_hash. Otherwise, just return the value
|
263
|
+
# @param [Object] value Any valid value
|
264
|
+
# @return [Hash] Returns the value in the form of hash
|
265
|
+
def _to_hash(value)
|
266
|
+
if value.is_a?(Array)
|
267
|
+
value.compact.map { |v| _to_hash(v) }
|
268
|
+
elsif value.is_a?(Hash)
|
269
|
+
{}.tap do |hash|
|
270
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
271
|
+
end
|
272
|
+
elsif value.respond_to? :to_hash
|
273
|
+
value.to_hash
|
274
|
+
else
|
275
|
+
value
|
276
|
+
end
|
277
|
+
end
|
278
|
+
end
|
279
|
+
end
|