aspose_slides_cloud 22.2.0 → 22.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +7 -7
- data/LICENSE +20 -20
- data/README.md +27 -0
- data/Rakefile +8 -8
- data/TestData/oleObject.xlsx +0 -0
- data/TestData/test.pptx +0 -0
- data/aspose_slides_cloud.gemspec +56 -56
- data/lib/aspose_slides_cloud/api/slides_api.rb +192 -13
- data/lib/aspose_slides_cloud/api_error.rb +48 -48
- data/lib/aspose_slides_cloud/configuration.rb +188 -188
- data/lib/aspose_slides_cloud/models/access_permissions.rb +321 -0
- data/lib/aspose_slides_cloud/models/{waterfall_series.rb → alpha_bi_level_effect.rb} +16 -26
- data/lib/aspose_slides_cloud/models/alpha_ceiling_effect.rb +223 -0
- data/lib/aspose_slides_cloud/models/alpha_floor_effect.rb +223 -0
- data/lib/aspose_slides_cloud/models/alpha_inverse_effect.rb +223 -0
- data/lib/aspose_slides_cloud/models/alpha_modulate_effect.rb +223 -0
- data/lib/aspose_slides_cloud/models/alpha_modulate_fixed_effect.rb +238 -0
- data/lib/aspose_slides_cloud/models/alpha_replace_effect.rb +238 -0
- data/lib/aspose_slides_cloud/models/audio_frame.rb +12 -3
- data/lib/aspose_slides_cloud/models/axis.rb +22 -2
- data/lib/aspose_slides_cloud/models/bi_level_effect.rb +238 -0
- data/lib/aspose_slides_cloud/models/blur_image_effect.rb +253 -0
- data/lib/aspose_slides_cloud/models/chart.rb +1 -2
- data/lib/aspose_slides_cloud/models/chart_lines_format.rb +221 -0
- data/lib/aspose_slides_cloud/models/color_change_effect.rb +243 -0
- data/lib/aspose_slides_cloud/models/color_replace_effect.rb +233 -0
- data/lib/aspose_slides_cloud/models/connector.rb +1 -2
- data/lib/aspose_slides_cloud/models/duotone_effect.rb +243 -0
- data/lib/aspose_slides_cloud/models/export_options.rb +10 -18
- data/lib/aspose_slides_cloud/models/fill_overlay_image_effect.rb +260 -0
- data/lib/aspose_slides_cloud/models/font_fallback_rule.rb +243 -0
- data/lib/aspose_slides_cloud/models/geometry_shape.rb +1 -2
- data/lib/aspose_slides_cloud/models/gif_export_options.rb +4 -3
- data/lib/aspose_slides_cloud/models/graphical_object.rb +1 -2
- data/lib/aspose_slides_cloud/models/{waterfall_chart_data_point.rb → gray_scale_effect.rb} +26 -13
- data/lib/aspose_slides_cloud/models/group_shape.rb +12 -3
- data/lib/aspose_slides_cloud/models/hsl_effect.rb +268 -0
- data/lib/aspose_slides_cloud/models/html5_export_options.rb +2 -3
- data/lib/aspose_slides_cloud/models/html_export_options.rb +2 -3
- data/lib/aspose_slides_cloud/models/image_export_options.rb +4 -3
- data/lib/aspose_slides_cloud/models/image_export_options_base.rb +222 -0
- data/lib/aspose_slides_cloud/models/image_transform_effect.rb +244 -0
- data/lib/aspose_slides_cloud/models/legend.rb +12 -2
- data/lib/aspose_slides_cloud/models/luminance_effect.rb +253 -0
- data/lib/aspose_slides_cloud/models/ole_object_frame.rb +72 -3
- data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +12 -2
- data/lib/aspose_slides_cloud/models/one_value_series.rb +74 -2
- data/lib/aspose_slides_cloud/models/paragraph.rb +12 -2
- data/lib/aspose_slides_cloud/models/pdf_export_options.rb +3 -16
- data/lib/aspose_slides_cloud/models/picture_fill.rb +14 -2
- data/lib/aspose_slides_cloud/models/picture_frame.rb +1 -2
- data/lib/aspose_slides_cloud/models/portion.rb +32 -2
- data/lib/aspose_slides_cloud/models/portion_format.rb +633 -0
- data/lib/aspose_slides_cloud/models/pptx_export_options.rb +2 -3
- data/lib/aspose_slides_cloud/models/resource_uri.rb +22 -2
- data/lib/aspose_slides_cloud/models/section_zoom_frame.rb +1 -2
- data/lib/aspose_slides_cloud/models/shape.rb +1 -2
- data/lib/aspose_slides_cloud/models/shape_base.rb +1 -11
- data/lib/aspose_slides_cloud/models/shape_type.rb +54 -0
- data/lib/aspose_slides_cloud/models/slide_comment.rb +32 -48
- data/lib/aspose_slides_cloud/models/slide_comment_base.rb +286 -0
- data/lib/aspose_slides_cloud/models/slide_comments.rb +1 -1
- data/lib/aspose_slides_cloud/models/{box_and_whisker_series.rb → slide_modern_comment.rb} +37 -68
- data/lib/aspose_slides_cloud/models/smart_art.rb +1 -2
- data/lib/aspose_slides_cloud/models/smart_art_node.rb +12 -2
- data/lib/aspose_slides_cloud/models/smart_art_shape.rb +1 -2
- data/lib/aspose_slides_cloud/models/summary_zoom_frame.rb +1 -2
- data/lib/aspose_slides_cloud/models/summary_zoom_section.rb +1 -2
- data/lib/aspose_slides_cloud/models/svg_export_options.rb +2 -3
- data/lib/aspose_slides_cloud/models/swf_export_options.rb +2 -3
- data/lib/aspose_slides_cloud/models/table.rb +1 -2
- data/lib/aspose_slides_cloud/models/table_cell.rb +22 -2
- data/lib/aspose_slides_cloud/models/text_bounds.rb +261 -0
- data/lib/aspose_slides_cloud/models/tiff_export_options.rb +4 -3
- data/lib/aspose_slides_cloud/models/tint_effect.rb +253 -0
- data/lib/aspose_slides_cloud/models/video_export_options.rb +35 -4
- data/lib/aspose_slides_cloud/models/video_frame.rb +12 -3
- data/lib/aspose_slides_cloud/models/xaml_export_options.rb +2 -3
- data/lib/aspose_slides_cloud/models/xps_export_options.rb +2 -3
- data/lib/aspose_slides_cloud/models/zoom_frame.rb +1 -2
- data/lib/aspose_slides_cloud/models/zoom_object.rb +2 -2
- data/lib/aspose_slides_cloud/type_registry.rb +54 -13
- data/lib/aspose_slides_cloud/version.rb +1 -1
- data/lib/aspose_slides_cloud.rb +31 -7
- data/spec/api/slides_api_spec.rb +585 -33
- data/spec/spec_helper.rb +122 -122
- data/spec/use_cases/merge_spec.rb +0 -1
- data/spec/use_cases/shape_spec.rb +0 -2
- data/testRules.json +6 -4
- metadata +30 -7
- data/Dockerfile +0 -16
- data/docker-entrypoint.sh +0 -7
@@ -37,6 +37,12 @@ module AsposeSlidesCloud
|
|
37
37
|
# Gets or sets the title of link.
|
38
38
|
attr_accessor :title
|
39
39
|
|
40
|
+
# Resource slide index.
|
41
|
+
attr_accessor :slide_index
|
42
|
+
|
43
|
+
# Resource shape index.
|
44
|
+
attr_accessor :shape_index
|
45
|
+
|
40
46
|
# Attribute mapping from ruby-style variable name to JSON key.
|
41
47
|
def self.attribute_map
|
42
48
|
{
|
@@ -44,6 +50,8 @@ module AsposeSlidesCloud
|
|
44
50
|
:'relation' => :'Relation',
|
45
51
|
:'link_type' => :'LinkType',
|
46
52
|
:'title' => :'Title',
|
53
|
+
:'slide_index' => :'SlideIndex',
|
54
|
+
:'shape_index' => :'ShapeIndex',
|
47
55
|
}
|
48
56
|
end
|
49
57
|
|
@@ -54,6 +62,8 @@ module AsposeSlidesCloud
|
|
54
62
|
:'relation' => :'String',
|
55
63
|
:'link_type' => :'String',
|
56
64
|
:'title' => :'String',
|
65
|
+
:'slide_index' => :'Integer',
|
66
|
+
:'shape_index' => :'Integer',
|
57
67
|
}
|
58
68
|
end
|
59
69
|
|
@@ -80,6 +90,14 @@ module AsposeSlidesCloud
|
|
80
90
|
if attributes.has_key?(:'Title')
|
81
91
|
self.title = attributes[:'Title']
|
82
92
|
end
|
93
|
+
|
94
|
+
if attributes.has_key?(:'SlideIndex')
|
95
|
+
self.slide_index = attributes[:'SlideIndex']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.has_key?(:'ShapeIndex')
|
99
|
+
self.shape_index = attributes[:'ShapeIndex']
|
100
|
+
end
|
83
101
|
end
|
84
102
|
|
85
103
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -103,7 +121,9 @@ module AsposeSlidesCloud
|
|
103
121
|
href == o.href &&
|
104
122
|
relation == o.relation &&
|
105
123
|
link_type == o.link_type &&
|
106
|
-
title == o.title
|
124
|
+
title == o.title &&
|
125
|
+
slide_index == o.slide_index &&
|
126
|
+
shape_index == o.shape_index
|
107
127
|
end
|
108
128
|
|
109
129
|
# @see the `==` method
|
@@ -115,7 +135,7 @@ module AsposeSlidesCloud
|
|
115
135
|
# Calculates hash code according to all attributes.
|
116
136
|
# @return [Fixnum] Hash code
|
117
137
|
def hash
|
118
|
-
[href, relation, link_type, title].hash
|
138
|
+
[href, relation, link_type, title, slide_index, shape_index].hash
|
119
139
|
end
|
120
140
|
|
121
141
|
# Builds the object from hash
|
@@ -105,7 +105,6 @@ module AsposeSlidesCloud
|
|
105
105
|
x == o.x &&
|
106
106
|
y == o.y &&
|
107
107
|
z_order_position == o.z_order_position &&
|
108
|
-
shapes == o.shapes &&
|
109
108
|
fill_format == o.fill_format &&
|
110
109
|
effect_format == o.effect_format &&
|
111
110
|
three_d_format == o.three_d_format &&
|
@@ -130,7 +129,7 @@ module AsposeSlidesCloud
|
|
130
129
|
# Calculates hash code according to all attributes.
|
131
130
|
# @return [Fixnum] Hash code
|
132
131
|
def hash
|
133
|
-
[self_uri, alternate_links, name, width, height, alternative_text, alternative_text_title, hidden, x, y, z_order_position,
|
132
|
+
[self_uri, alternate_links, name, width, height, alternative_text, alternative_text_title, hidden, x, y, z_order_position, fill_format, effect_format, three_d_format, line_format, hyperlink_click, hyperlink_mouse_over, type, image_type, return_to_parent, show_background, image, transition_duration, target_section_index].hash
|
134
133
|
end
|
135
134
|
|
136
135
|
# Builds the object from hash
|
@@ -123,7 +123,6 @@ module AsposeSlidesCloud
|
|
123
123
|
x == o.x &&
|
124
124
|
y == o.y &&
|
125
125
|
z_order_position == o.z_order_position &&
|
126
|
-
shapes == o.shapes &&
|
127
126
|
fill_format == o.fill_format &&
|
128
127
|
effect_format == o.effect_format &&
|
129
128
|
three_d_format == o.three_d_format &&
|
@@ -146,7 +145,7 @@ module AsposeSlidesCloud
|
|
146
145
|
# Calculates hash code according to all attributes.
|
147
146
|
# @return [Fixnum] Hash code
|
148
147
|
def hash
|
149
|
-
[self_uri, alternate_links, name, width, height, alternative_text, alternative_text_title, hidden, x, y, z_order_position,
|
148
|
+
[self_uri, alternate_links, name, width, height, alternative_text, alternative_text_title, hidden, x, y, z_order_position, fill_format, effect_format, three_d_format, line_format, hyperlink_click, hyperlink_mouse_over, type, shape_type, text, paragraphs, text_frame_format].hash
|
150
149
|
end
|
151
150
|
|
152
151
|
# Builds the object from hash
|
@@ -52,9 +52,6 @@ module AsposeSlidesCloud
|
|
52
52
|
# Gets z-order position of shape
|
53
53
|
attr_accessor :z_order_position
|
54
54
|
|
55
|
-
# Gets or sets the link to shapes.
|
56
|
-
attr_accessor :shapes
|
57
|
-
|
58
55
|
# Gets or sets the fill format.
|
59
56
|
attr_accessor :fill_format
|
60
57
|
|
@@ -109,7 +106,6 @@ module AsposeSlidesCloud
|
|
109
106
|
:'x' => :'X',
|
110
107
|
:'y' => :'Y',
|
111
108
|
:'z_order_position' => :'ZOrderPosition',
|
112
|
-
:'shapes' => :'Shapes',
|
113
109
|
:'fill_format' => :'FillFormat',
|
114
110
|
:'effect_format' => :'EffectFormat',
|
115
111
|
:'three_d_format' => :'ThreeDFormat',
|
@@ -132,7 +128,6 @@ module AsposeSlidesCloud
|
|
132
128
|
:'x' => :'Float',
|
133
129
|
:'y' => :'Float',
|
134
130
|
:'z_order_position' => :'Integer',
|
135
|
-
:'shapes' => :'ResourceUri',
|
136
131
|
:'fill_format' => :'FillFormat',
|
137
132
|
:'effect_format' => :'EffectFormat',
|
138
133
|
:'three_d_format' => :'ThreeDFormat',
|
@@ -184,10 +179,6 @@ module AsposeSlidesCloud
|
|
184
179
|
self.z_order_position = attributes[:'ZOrderPosition']
|
185
180
|
end
|
186
181
|
|
187
|
-
if attributes.has_key?(:'Shapes')
|
188
|
-
self.shapes = attributes[:'Shapes']
|
189
|
-
end
|
190
|
-
|
191
182
|
if attributes.has_key?(:'FillFormat')
|
192
183
|
self.fill_format = attributes[:'FillFormat']
|
193
184
|
end
|
@@ -264,7 +255,6 @@ module AsposeSlidesCloud
|
|
264
255
|
x == o.x &&
|
265
256
|
y == o.y &&
|
266
257
|
z_order_position == o.z_order_position &&
|
267
|
-
shapes == o.shapes &&
|
268
258
|
fill_format == o.fill_format &&
|
269
259
|
effect_format == o.effect_format &&
|
270
260
|
three_d_format == o.three_d_format &&
|
@@ -283,7 +273,7 @@ module AsposeSlidesCloud
|
|
283
273
|
# Calculates hash code according to all attributes.
|
284
274
|
# @return [Fixnum] Hash code
|
285
275
|
def hash
|
286
|
-
[self_uri, alternate_links, name, width, height, alternative_text, alternative_text_title, hidden, x, y, z_order_position,
|
276
|
+
[self_uri, alternate_links, name, width, height, alternative_text, alternative_text_title, hidden, x, y, z_order_position, fill_format, effect_format, three_d_format, line_format, hyperlink_click, hyperlink_mouse_over, type].hash
|
287
277
|
end
|
288
278
|
|
289
279
|
# Builds the object from hash
|
@@ -0,0 +1,54 @@
|
|
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
|
+
class ShapeType
|
27
|
+
|
28
|
+
SHAPE = "Shape".freeze
|
29
|
+
CHART = "Chart".freeze
|
30
|
+
TABLE = "Table".freeze
|
31
|
+
PICTURE_FRAME = "PictureFrame".freeze
|
32
|
+
VIDEO_FRAME = "VideoFrame".freeze
|
33
|
+
AUDIO_FRAME = "AudioFrame".freeze
|
34
|
+
SMART_ART = "SmartArt".freeze
|
35
|
+
OLE_OBJECT_FRAME = "OleObjectFrame".freeze
|
36
|
+
GROUP_SHAPE = "GroupShape".freeze
|
37
|
+
GRAPHICAL_OBJECT = "GraphicalObject".freeze
|
38
|
+
CONNECTOR = "Connector".freeze
|
39
|
+
SMART_ART_SHAPE = "SmartArtShape".freeze
|
40
|
+
ZOOM_FRAME = "ZoomFrame".freeze
|
41
|
+
SECTION_ZOOM_FRAME = "SectionZoomFrame".freeze
|
42
|
+
SUMMARY_ZOOM_FRAME = "SummaryZoomFrame".freeze
|
43
|
+
SUMMARY_ZOOM_SECTION = "SummaryZoomSection".freeze
|
44
|
+
|
45
|
+
# Builds the enum from string
|
46
|
+
# @param [String] The enum value in the form of the string
|
47
|
+
# @return [String] The enum value
|
48
|
+
def build_from_hash(value)
|
49
|
+
constantValues = ShapeType.constants.select { |c| ShapeType::const_get(c) == value }
|
50
|
+
raise "Invalid ENUM value #{value} for class #ShapeType" if constantValues.empty?
|
51
|
+
value
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -24,76 +24,59 @@ require 'date'
|
|
24
24
|
|
25
25
|
module AsposeSlidesCloud
|
26
26
|
# Represents comment of slide
|
27
|
-
class SlideComment
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
27
|
+
class SlideComment < SlideCommentBase
|
28
|
+
class EnumAttributeValidator
|
29
|
+
attr_reader :datatype
|
30
|
+
attr_reader :allowable_values
|
31
|
+
|
32
|
+
def initialize(datatype, allowable_values)
|
33
|
+
@allowable_values = allowable_values.map do |value|
|
34
|
+
case datatype.to_s
|
35
|
+
when /Integer/i
|
36
|
+
value.to_i
|
37
|
+
when /Float/i
|
38
|
+
value.to_f
|
39
|
+
else
|
40
|
+
value
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
36
44
|
|
37
|
-
|
38
|
-
|
45
|
+
def valid?(value)
|
46
|
+
!value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
|
47
|
+
end
|
48
|
+
end
|
39
49
|
|
40
50
|
# Attribute mapping from ruby-style variable name to JSON key.
|
41
51
|
def self.attribute_map
|
42
|
-
{
|
43
|
-
|
44
|
-
:'text' => :'Text',
|
45
|
-
:'created_time' => :'CreatedTime',
|
46
|
-
:'child_comments' => :'ChildComments',
|
47
|
-
}
|
52
|
+
super.merge({
|
53
|
+
})
|
48
54
|
end
|
49
55
|
|
50
56
|
# Attribute type mapping.
|
51
57
|
def self.swagger_types
|
52
|
-
{
|
53
|
-
|
54
|
-
:'text' => :'String',
|
55
|
-
:'created_time' => :'String',
|
56
|
-
:'child_comments' => :'Array<SlideComment>',
|
57
|
-
}
|
58
|
+
super.merge({
|
59
|
+
})
|
58
60
|
end
|
59
61
|
|
60
62
|
# Initializes the object
|
61
63
|
# @param [Hash] attributes Model attributes in the form of hash
|
62
64
|
def initialize(attributes = {})
|
63
|
-
|
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?(:'Author')
|
69
|
-
self.author = attributes[:'Author']
|
70
|
-
end
|
71
|
-
|
72
|
-
if attributes.has_key?(:'Text')
|
73
|
-
self.text = attributes[:'Text']
|
74
|
-
end
|
75
|
-
|
76
|
-
if attributes.has_key?(:'CreatedTime')
|
77
|
-
self.created_time = attributes[:'CreatedTime']
|
78
|
-
end
|
79
|
-
|
80
|
-
if attributes.has_key?(:'ChildComments')
|
81
|
-
if (value = attributes[:'ChildComments']).is_a?(Array)
|
82
|
-
self.child_comments = value
|
83
|
-
end
|
84
|
-
end
|
65
|
+
super
|
66
|
+
self.type = "Regular"
|
85
67
|
end
|
86
68
|
|
87
69
|
# Show invalid properties with the reasons. Usually used together with valid?
|
88
70
|
# @return Array for valid properties with the reasons
|
89
71
|
def list_invalid_properties
|
90
|
-
invalid_properties =
|
72
|
+
invalid_properties = super
|
91
73
|
invalid_properties
|
92
74
|
end
|
93
75
|
|
94
76
|
# Check to see if the all the properties in the model are valid
|
95
77
|
# @return true if the model is valid
|
96
78
|
def valid?
|
79
|
+
return false if !super
|
97
80
|
true
|
98
81
|
end
|
99
82
|
|
@@ -105,7 +88,8 @@ module AsposeSlidesCloud
|
|
105
88
|
author == o.author &&
|
106
89
|
text == o.text &&
|
107
90
|
created_time == o.created_time &&
|
108
|
-
child_comments == o.child_comments
|
91
|
+
child_comments == o.child_comments &&
|
92
|
+
type == o.type
|
109
93
|
end
|
110
94
|
|
111
95
|
# @see the `==` method
|
@@ -117,7 +101,7 @@ module AsposeSlidesCloud
|
|
117
101
|
# Calculates hash code according to all attributes.
|
118
102
|
# @return [Fixnum] Hash code
|
119
103
|
def hash
|
120
|
-
[author, text, created_time, child_comments].hash
|
104
|
+
[author, text, created_time, child_comments, type].hash
|
121
105
|
end
|
122
106
|
|
123
107
|
# Builds the object from hash
|
@@ -0,0 +1,286 @@
|
|
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 slide comment
|
27
|
+
class SlideCommentBase
|
28
|
+
# Author.
|
29
|
+
attr_accessor :author
|
30
|
+
|
31
|
+
# Text.
|
32
|
+
attr_accessor :text
|
33
|
+
|
34
|
+
# Creation time.
|
35
|
+
attr_accessor :created_time
|
36
|
+
|
37
|
+
# Child comments.
|
38
|
+
attr_accessor :child_comments
|
39
|
+
|
40
|
+
attr_accessor :type
|
41
|
+
|
42
|
+
class EnumAttributeValidator
|
43
|
+
attr_reader :datatype
|
44
|
+
attr_reader :allowable_values
|
45
|
+
|
46
|
+
def initialize(datatype, allowable_values)
|
47
|
+
@allowable_values = allowable_values.map do |value|
|
48
|
+
case datatype.to_s
|
49
|
+
when /Integer/i
|
50
|
+
value.to_i
|
51
|
+
when /Float/i
|
52
|
+
value.to_f
|
53
|
+
else
|
54
|
+
value
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def valid?(value)
|
60
|
+
!value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
65
|
+
def self.attribute_map
|
66
|
+
{
|
67
|
+
:'author' => :'Author',
|
68
|
+
:'text' => :'Text',
|
69
|
+
:'created_time' => :'CreatedTime',
|
70
|
+
:'child_comments' => :'ChildComments',
|
71
|
+
:'type' => :'Type',
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
# Attribute type mapping.
|
76
|
+
def self.swagger_types
|
77
|
+
{
|
78
|
+
:'author' => :'String',
|
79
|
+
:'text' => :'String',
|
80
|
+
:'created_time' => :'String',
|
81
|
+
:'child_comments' => :'Array<SlideCommentBase>',
|
82
|
+
:'type' => :'String',
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
# Initializes the object
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
88
|
+
def initialize(attributes = {})
|
89
|
+
return unless attributes.is_a?(Hash)
|
90
|
+
|
91
|
+
# convert string to symbol for hash key
|
92
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
93
|
+
|
94
|
+
if attributes.has_key?(:'Author')
|
95
|
+
self.author = attributes[:'Author']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.has_key?(:'Text')
|
99
|
+
self.text = attributes[:'Text']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.has_key?(:'CreatedTime')
|
103
|
+
self.created_time = attributes[:'CreatedTime']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.has_key?(:'ChildComments')
|
107
|
+
if (value = attributes[:'ChildComments']).is_a?(Array)
|
108
|
+
self.child_comments = value
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.has_key?(:'Type')
|
113
|
+
self.type = attributes[:'Type']
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
118
|
+
# @return Array for valid properties with the reasons
|
119
|
+
def list_invalid_properties
|
120
|
+
invalid_properties = Array.new
|
121
|
+
invalid_properties
|
122
|
+
end
|
123
|
+
|
124
|
+
# Check to see if the all the properties in the model are valid
|
125
|
+
# @return true if the model is valid
|
126
|
+
def valid?
|
127
|
+
type_validator = EnumAttributeValidator.new('String', ['Regular', 'Modern'])
|
128
|
+
return false unless type_validator.valid?(@type)
|
129
|
+
true
|
130
|
+
end
|
131
|
+
|
132
|
+
# Custom attribute writer method checking allowed values (enum).
|
133
|
+
# @param [Object] type Object to be assigned
|
134
|
+
def type=(type)
|
135
|
+
validator = EnumAttributeValidator.new('String', ['Regular', 'Modern'])
|
136
|
+
unless validator.valid?(type)
|
137
|
+
fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
|
138
|
+
end
|
139
|
+
@type = type
|
140
|
+
end
|
141
|
+
|
142
|
+
# Checks equality by comparing each attribute.
|
143
|
+
# @param [Object] Object to be compared
|
144
|
+
def ==(o)
|
145
|
+
return true if self.equal?(o)
|
146
|
+
self.class == o.class &&
|
147
|
+
author == o.author &&
|
148
|
+
text == o.text &&
|
149
|
+
created_time == o.created_time &&
|
150
|
+
child_comments == o.child_comments &&
|
151
|
+
type == o.type
|
152
|
+
end
|
153
|
+
|
154
|
+
# @see the `==` method
|
155
|
+
# @param [Object] Object to be compared
|
156
|
+
def eql?(o)
|
157
|
+
self == o
|
158
|
+
end
|
159
|
+
|
160
|
+
# Calculates hash code according to all attributes.
|
161
|
+
# @return [Fixnum] Hash code
|
162
|
+
def hash
|
163
|
+
[author, text, created_time, child_comments, type].hash
|
164
|
+
end
|
165
|
+
|
166
|
+
# Builds the object from hash
|
167
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
168
|
+
# @return [Object] Returns the model itself
|
169
|
+
def build_from_hash(attributes)
|
170
|
+
return nil unless attributes.is_a?(Hash)
|
171
|
+
self.class.swagger_types.each_pair do |key, type|
|
172
|
+
mapKey = self.class.attribute_map[key]
|
173
|
+
if !mapKey.nil?
|
174
|
+
val = attributes[mapKey]
|
175
|
+
if val.nil?
|
176
|
+
mapKeyString = mapKey.to_s
|
177
|
+
mapKeyString[0] = mapKeyString[0].downcase
|
178
|
+
mapKey = mapKeyString.to_sym
|
179
|
+
val = attributes[mapKey]
|
180
|
+
end
|
181
|
+
if !val.nil?
|
182
|
+
if type =~ /\AArray<(.*)>/i
|
183
|
+
# check to ensure the input is an array given that the the attribute
|
184
|
+
# is documented as an array but the input is not
|
185
|
+
if val.is_a?(Array)
|
186
|
+
self.send("#{key}=", val.map { |v| _deserialize($1, v) })
|
187
|
+
end
|
188
|
+
else
|
189
|
+
self.send("#{key}=", _deserialize(type, val))
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
self
|
196
|
+
end
|
197
|
+
|
198
|
+
# Deserializes the data based on type
|
199
|
+
# @param string type Data type
|
200
|
+
# @param string value Value to be deserialized
|
201
|
+
# @return [Object] Deserialized data
|
202
|
+
def _deserialize(type, value)
|
203
|
+
case type.to_sym
|
204
|
+
when :DateTime
|
205
|
+
DateTime.parse(value)
|
206
|
+
when :Date
|
207
|
+
Date.parse(value)
|
208
|
+
when :String
|
209
|
+
value.to_s
|
210
|
+
when :Integer
|
211
|
+
value.to_i
|
212
|
+
when :Float
|
213
|
+
value.to_f
|
214
|
+
when :BOOLEAN
|
215
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
216
|
+
true
|
217
|
+
else
|
218
|
+
false
|
219
|
+
end
|
220
|
+
when :Object
|
221
|
+
# generic object (usually a Hash), return directly
|
222
|
+
value
|
223
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
224
|
+
inner_type = Regexp.last_match[:inner_type]
|
225
|
+
value.map { |v| _deserialize(inner_type, v) }
|
226
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
227
|
+
k_type = Regexp.last_match[:k_type]
|
228
|
+
v_type = Regexp.last_match[:v_type]
|
229
|
+
{}.tap do |hash|
|
230
|
+
value.each do |k, v|
|
231
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
232
|
+
end
|
233
|
+
end
|
234
|
+
else # model
|
235
|
+
registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
|
236
|
+
if registry_type
|
237
|
+
type = registry_type
|
238
|
+
end
|
239
|
+
temp_model = AsposeSlidesCloud.const_get(type).new
|
240
|
+
temp_model.build_from_hash(value)
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
# Returns the string representation of the object
|
245
|
+
# @return [String] String presentation of the object
|
246
|
+
def to_s
|
247
|
+
to_hash.to_s
|
248
|
+
end
|
249
|
+
|
250
|
+
# to_body is an alias to to_hash (backward compatibility)
|
251
|
+
# @return [Hash] Returns the object in the form of hash
|
252
|
+
def to_body
|
253
|
+
to_hash
|
254
|
+
end
|
255
|
+
|
256
|
+
# Returns the object in the form of hash
|
257
|
+
# @return [Hash] Returns the object in the form of hash
|
258
|
+
def to_hash
|
259
|
+
hash = {}
|
260
|
+
self.class.attribute_map.each_pair do |attr, param|
|
261
|
+
value = self.send(attr)
|
262
|
+
next if value.nil?
|
263
|
+
hash[param] = _to_hash(value)
|
264
|
+
end
|
265
|
+
hash
|
266
|
+
end
|
267
|
+
|
268
|
+
# Outputs non-array value in the form of hash
|
269
|
+
# For object, use to_hash. Otherwise, just return the value
|
270
|
+
# @param [Object] value Any valid value
|
271
|
+
# @return [Hash] Returns the value in the form of hash
|
272
|
+
def _to_hash(value)
|
273
|
+
if value.is_a?(Array)
|
274
|
+
value.compact.map { |v| _to_hash(v) }
|
275
|
+
elsif value.is_a?(Hash)
|
276
|
+
{}.tap do |hash|
|
277
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
278
|
+
end
|
279
|
+
elsif value.respond_to? :to_hash
|
280
|
+
value.to_hash
|
281
|
+
else
|
282
|
+
value
|
283
|
+
end
|
284
|
+
end
|
285
|
+
end
|
286
|
+
end
|