aspose_slides_cloud 21.4.0 → 21.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +89 -61
- data/TestData/TemplatingCVDataWithBase64.xml +22 -22
- data/lib/aspose_slides_cloud.rb +212 -213
- data/lib/aspose_slides_cloud/api/slides_api.rb +15206 -17689
- data/lib/aspose_slides_cloud/api_client.rb +439 -439
- data/lib/aspose_slides_cloud/models/add_layout_slide.rb +244 -244
- data/lib/aspose_slides_cloud/models/add_master_slide.rb +259 -259
- data/lib/aspose_slides_cloud/models/add_shape.rb +239 -239
- data/lib/aspose_slides_cloud/models/add_slide.rb +269 -269
- data/lib/aspose_slides_cloud/models/api_info.rb +217 -217
- data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +285 -285
- data/lib/aspose_slides_cloud/models/audio_frame.rb +359 -359
- data/lib/aspose_slides_cloud/models/axes.rb +237 -237
- data/lib/aspose_slides_cloud/models/axis.rb +699 -699
- data/lib/aspose_slides_cloud/models/base64_input_file.rb +230 -230
- data/lib/aspose_slides_cloud/models/blur_effect.rb +227 -227
- data/lib/aspose_slides_cloud/models/box_and_whisker_series.rb +299 -299
- data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +212 -212
- data/lib/aspose_slides_cloud/models/bubble_series.rb +248 -248
- data/lib/aspose_slides_cloud/models/chart.rb +365 -365
- data/lib/aspose_slides_cloud/models/chart_category.rb +271 -271
- data/lib/aspose_slides_cloud/models/chart_title.rb +222 -222
- data/lib/aspose_slides_cloud/models/chart_wall.rb +281 -281
- data/lib/aspose_slides_cloud/models/color_scheme.rb +317 -317
- data/lib/aspose_slides_cloud/models/common_slide_view_properties.rb +217 -217
- data/lib/aspose_slides_cloud/models/connector.rb +275 -275
- data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +209 -209
- data/lib/aspose_slides_cloud/models/data_point.rb +197 -197
- data/lib/aspose_slides_cloud/models/disc_usage.rb +227 -227
- data/lib/aspose_slides_cloud/models/document.rb +257 -257
- data/lib/aspose_slides_cloud/models/document_properties.rb +209 -209
- data/lib/aspose_slides_cloud/models/document_property.rb +232 -232
- data/lib/aspose_slides_cloud/models/document_replace_result.rb +218 -218
- data/lib/aspose_slides_cloud/models/effect.rb +424 -424
- data/lib/aspose_slides_cloud/models/effect_format.rb +277 -277
- data/lib/aspose_slides_cloud/models/entity_exists.rb +212 -212
- data/lib/aspose_slides_cloud/models/error.rb +237 -237
- data/lib/aspose_slides_cloud/models/error_details.rb +222 -222
- data/lib/aspose_slides_cloud/models/export_format.rb +60 -60
- data/lib/aspose_slides_cloud/models/export_options.rb +216 -216
- data/lib/aspose_slides_cloud/models/file_version.rb +225 -225
- data/lib/aspose_slides_cloud/models/file_versions.rb +209 -209
- data/lib/aspose_slides_cloud/models/files_list.rb +209 -209
- data/lib/aspose_slides_cloud/models/files_upload_result.rb +221 -221
- data/lib/aspose_slides_cloud/models/fill_format.rb +240 -240
- data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +246 -246
- data/lib/aspose_slides_cloud/models/font_scheme.rb +227 -227
- data/lib/aspose_slides_cloud/models/font_set.rb +227 -227
- data/lib/aspose_slides_cloud/models/format_scheme.rb +245 -245
- data/lib/aspose_slides_cloud/models/geometry_shape.rb +260 -260
- data/lib/aspose_slides_cloud/models/glow_effect.rb +222 -222
- data/lib/aspose_slides_cloud/models/gradient_fill.rb +342 -342
- data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +222 -222
- data/lib/aspose_slides_cloud/models/graphical_object.rb +234 -234
- data/lib/aspose_slides_cloud/models/group_shape.rb +234 -234
- data/lib/aspose_slides_cloud/models/header_footer.rb +247 -247
- data/lib/aspose_slides_cloud/models/html_export_options.rb +421 -421
- data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +197 -197
- data/lib/aspose_slides_cloud/models/image.rb +237 -237
- data/lib/aspose_slides_cloud/models/image_export_format.rb +43 -43
- data/lib/aspose_slides_cloud/models/image_export_options.rb +299 -299
- data/lib/aspose_slides_cloud/models/images.rb +209 -209
- data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +252 -252
- data/lib/aspose_slides_cloud/models/input.rb +227 -227
- data/lib/aspose_slides_cloud/models/input_file.rb +250 -250
- data/lib/aspose_slides_cloud/models/interactive_sequence.rb +224 -224
- data/lib/aspose_slides_cloud/models/layout_slide.rb +278 -278
- data/lib/aspose_slides_cloud/models/layout_slides.rb +209 -209
- data/lib/aspose_slides_cloud/models/legend.rb +321 -321
- data/lib/aspose_slides_cloud/models/line_format.rb +411 -411
- data/lib/aspose_slides_cloud/models/master_slide.rb +231 -231
- data/lib/aspose_slides_cloud/models/master_slides.rb +209 -209
- data/lib/aspose_slides_cloud/models/merge.rb +231 -231
- data/lib/aspose_slides_cloud/models/merging_source.rb +219 -219
- data/lib/aspose_slides_cloud/models/no_fill.rb +219 -219
- data/lib/aspose_slides_cloud/models/normal_view_restored_properties.rb +217 -217
- data/lib/aspose_slides_cloud/models/notes_slide.rb +217 -217
- data/lib/aspose_slides_cloud/models/notes_slide_export_format.rb +43 -43
- data/lib/aspose_slides_cloud/models/notes_slide_header_footer.rb +267 -267
- data/lib/aspose_slides_cloud/models/object_exist.rb +227 -227
- data/lib/aspose_slides_cloud/models/ole_object_frame.rb +259 -259
- data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +210 -210
- data/lib/aspose_slides_cloud/models/one_value_series.rb +248 -248
- data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +209 -209
- data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +252 -252
- data/lib/aspose_slides_cloud/models/output_file.rb +240 -240
- data/lib/aspose_slides_cloud/models/paragraph.rb +517 -517
- data/lib/aspose_slides_cloud/models/paragraphs.rb +209 -209
- data/lib/aspose_slides_cloud/models/path_input_file.rb +240 -240
- data/lib/aspose_slides_cloud/models/path_output_file.rb +239 -239
- data/lib/aspose_slides_cloud/models/pattern_fill.rb +266 -266
- data/lib/aspose_slides_cloud/models/pdf_export_options.rb +547 -547
- data/lib/aspose_slides_cloud/models/picture_fill.rb +351 -351
- data/lib/aspose_slides_cloud/models/picture_frame.rb +245 -245
- data/lib/aspose_slides_cloud/models/pipeline.rb +219 -219
- data/lib/aspose_slides_cloud/models/placeholder.rb +325 -325
- data/lib/aspose_slides_cloud/models/placeholders.rb +209 -209
- data/lib/aspose_slides_cloud/models/plot_area.rb +311 -311
- data/lib/aspose_slides_cloud/models/portion.rb +589 -589
- data/lib/aspose_slides_cloud/models/portions.rb +209 -209
- data/lib/aspose_slides_cloud/models/pptx_export_options.rb +247 -247
- data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +273 -273
- data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +221 -221
- data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +286 -286
- data/lib/aspose_slides_cloud/models/protection_properties.rb +267 -267
- data/lib/aspose_slides_cloud/models/reflection_effect.rb +441 -441
- data/lib/aspose_slides_cloud/models/remove_shape.rb +229 -229
- data/lib/aspose_slides_cloud/models/remove_slide.rb +234 -234
- data/lib/aspose_slides_cloud/models/reorder_slide.rb +249 -249
- data/lib/aspose_slides_cloud/models/replace_text.rb +269 -269
- data/lib/aspose_slides_cloud/models/request_input_file.rb +235 -235
- data/lib/aspose_slides_cloud/models/reset_slide.rb +234 -234
- data/lib/aspose_slides_cloud/models/resource_base.rb +219 -219
- data/lib/aspose_slides_cloud/models/resource_uri.rb +237 -237
- data/lib/aspose_slides_cloud/models/response_output_file.rb +219 -219
- data/lib/aspose_slides_cloud/models/save.rb +266 -266
- data/lib/aspose_slides_cloud/models/save_shape.rb +276 -276
- data/lib/aspose_slides_cloud/models/save_slide.rb +301 -301
- data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +225 -225
- data/lib/aspose_slides_cloud/models/scatter_series.rb +248 -248
- data/lib/aspose_slides_cloud/models/section.rb +234 -234
- data/lib/aspose_slides_cloud/models/sections.rb +209 -209
- data/lib/aspose_slides_cloud/models/series.rb +422 -422
- data/lib/aspose_slides_cloud/models/series_marker.rb +281 -281
- data/lib/aspose_slides_cloud/models/shape.rb +255 -255
- data/lib/aspose_slides_cloud/models/shape_base.rb +375 -375
- data/lib/aspose_slides_cloud/models/shape_export_format.rb +44 -44
- data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +286 -286
- data/lib/aspose_slides_cloud/models/shape_thumbnail_bounds.rb +41 -41
- data/lib/aspose_slides_cloud/models/shapes.rb +209 -209
- data/lib/aspose_slides_cloud/models/shapes_alignment_type.rb +46 -46
- data/lib/aspose_slides_cloud/models/slide.rb +322 -322
- data/lib/aspose_slides_cloud/models/slide_animation.rb +221 -221
- data/lib/aspose_slides_cloud/models/slide_background.rb +266 -266
- data/lib/aspose_slides_cloud/models/slide_comment.rb +239 -239
- data/lib/aspose_slides_cloud/models/slide_comments.rb +209 -209
- data/lib/aspose_slides_cloud/models/slide_export_format.rb +59 -59
- data/lib/aspose_slides_cloud/models/slide_properties.rb +315 -315
- data/lib/aspose_slides_cloud/models/slide_replace_result.rb +223 -223
- data/lib/aspose_slides_cloud/models/slides.rb +209 -209
- data/lib/aspose_slides_cloud/models/smart_art.rb +342 -342
- data/lib/aspose_slides_cloud/models/smart_art_node.rb +293 -293
- data/lib/aspose_slides_cloud/models/smart_art_shape.rb +235 -235
- data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +212 -212
- data/lib/aspose_slides_cloud/models/solid_fill.rb +229 -229
- data/lib/aspose_slides_cloud/models/split_document_result.rb +209 -209
- data/lib/aspose_slides_cloud/models/storage_exist.rb +212 -212
- data/lib/aspose_slides_cloud/models/storage_file.rb +257 -257
- data/lib/aspose_slides_cloud/models/svg_export_options.rb +379 -379
- data/lib/aspose_slides_cloud/models/swf_export_options.rb +529 -529
- data/lib/aspose_slides_cloud/models/table.rb +350 -350
- data/lib/aspose_slides_cloud/models/table_cell.rb +403 -403
- data/lib/aspose_slides_cloud/models/table_column.rb +212 -212
- data/lib/aspose_slides_cloud/models/table_row.rb +239 -239
- data/lib/aspose_slides_cloud/models/task.rb +240 -240
- data/lib/aspose_slides_cloud/models/text_item.rb +217 -217
- data/lib/aspose_slides_cloud/models/text_items.rb +209 -209
- data/lib/aspose_slides_cloud/models/theme.rb +237 -237
- data/lib/aspose_slides_cloud/models/tiff_export_options.rb +423 -423
- data/lib/aspose_slides_cloud/models/update_background.rb +241 -241
- data/lib/aspose_slides_cloud/models/update_shape.rb +239 -239
- data/lib/aspose_slides_cloud/models/video_frame.rb +329 -329
- data/lib/aspose_slides_cloud/models/view_properties.rb +357 -357
- data/lib/aspose_slides_cloud/models/waterfall_chart_data_point.rb +206 -206
- data/lib/aspose_slides_cloud/models/waterfall_series.rb +247 -247
- data/lib/aspose_slides_cloud/models/xps_export_options.rb +243 -243
- data/lib/aspose_slides_cloud/type_registry.rb +323 -323
- data/lib/aspose_slides_cloud/version.rb +25 -25
- data/spec/api/slides_api_spec.rb +40213 -39435
- data/spec/extra/extra_spec.rb +202 -202
- data/spec/spec_utils.rb +182 -182
- data/testConfig.json +7 -7
- data/testRules.json +513 -511
- metadata +2 -3
- data/lib/aspose_slides_cloud/api/slides_api_requests.rb +0 -4742
@@ -1,276 +1,276 @@
|
|
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
|
-
# Save shape task.
|
27
|
-
class SaveShape < Task
|
28
|
-
# Format.
|
29
|
-
attr_accessor :format
|
30
|
-
|
31
|
-
# Shape path.
|
32
|
-
attr_accessor :shape_path
|
33
|
-
|
34
|
-
# Output file.
|
35
|
-
attr_accessor :output
|
36
|
-
|
37
|
-
# Save options.
|
38
|
-
attr_accessor :options
|
39
|
-
|
40
|
-
class EnumAttributeValidator
|
41
|
-
attr_reader :datatype
|
42
|
-
attr_reader :allowable_values
|
43
|
-
|
44
|
-
def initialize(datatype, allowable_values)
|
45
|
-
@allowable_values = allowable_values.map do |value|
|
46
|
-
case datatype.to_s
|
47
|
-
when /Integer/i
|
48
|
-
value.to_i
|
49
|
-
when /Float/i
|
50
|
-
value.to_f
|
51
|
-
else
|
52
|
-
value
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def valid?(value)
|
58
|
-
!value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
63
|
-
def self.attribute_map
|
64
|
-
super.merge({
|
65
|
-
:'format' => :'Format',
|
66
|
-
:'shape_path' => :'ShapePath',
|
67
|
-
:'output' => :'Output',
|
68
|
-
:'options' => :'Options',
|
69
|
-
})
|
70
|
-
end
|
71
|
-
|
72
|
-
# Attribute type mapping.
|
73
|
-
def self.swagger_types
|
74
|
-
super.merge({
|
75
|
-
:'format' => :'String',
|
76
|
-
:'shape_path' => :'String',
|
77
|
-
:'output' => :'OutputFile',
|
78
|
-
:'options' => :'IShapeExportOptions',
|
79
|
-
})
|
80
|
-
end
|
81
|
-
|
82
|
-
# Initializes the object
|
83
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
84
|
-
def initialize(attributes = {})
|
85
|
-
super
|
86
|
-
|
87
|
-
if attributes.has_key?(:'Format')
|
88
|
-
self.format = attributes[:'Format']
|
89
|
-
end
|
90
|
-
|
91
|
-
if attributes.has_key?(:'ShapePath')
|
92
|
-
self.shape_path = attributes[:'ShapePath']
|
93
|
-
end
|
94
|
-
|
95
|
-
if attributes.has_key?(:'Output')
|
96
|
-
self.output = attributes[:'Output']
|
97
|
-
end
|
98
|
-
|
99
|
-
if attributes.has_key?(:'Options')
|
100
|
-
self.options = attributes[:'Options']
|
101
|
-
end
|
102
|
-
self.type = "SaveShape"
|
103
|
-
end
|
104
|
-
|
105
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
106
|
-
# @return Array for valid properties with the reasons
|
107
|
-
def list_invalid_properties
|
108
|
-
invalid_properties = super
|
109
|
-
if @format.nil?
|
110
|
-
invalid_properties.push('invalid value for "format", format cannot be nil.')
|
111
|
-
end
|
112
|
-
|
113
|
-
invalid_properties
|
114
|
-
end
|
115
|
-
|
116
|
-
# Check to see if the all the properties in the model are valid
|
117
|
-
# @return true if the model is valid
|
118
|
-
def valid?
|
119
|
-
return false if !super
|
120
|
-
return false if @format.nil?
|
121
|
-
format_validator = EnumAttributeValidator.new('String', ['Jpeg', 'Png', 'Gif', 'Bmp', 'Tiff', 'Svg'])
|
122
|
-
return false unless format_validator.valid?(@format)
|
123
|
-
true
|
124
|
-
end
|
125
|
-
|
126
|
-
# Custom attribute writer method checking allowed values (enum).
|
127
|
-
# @param [Object] format Object to be assigned
|
128
|
-
def format=(format)
|
129
|
-
validator = EnumAttributeValidator.new('String', ['Jpeg', 'Png', 'Gif', 'Bmp', 'Tiff', 'Svg'])
|
130
|
-
unless validator.valid?(format)
|
131
|
-
fail ArgumentError, 'invalid value for "format", must be one of #{validator.allowable_values}.'
|
132
|
-
end
|
133
|
-
@format = format
|
134
|
-
end
|
135
|
-
|
136
|
-
# Checks equality by comparing each attribute.
|
137
|
-
# @param [Object] Object to be compared
|
138
|
-
def ==(o)
|
139
|
-
return true if self.equal?(o)
|
140
|
-
self.class == o.class &&
|
141
|
-
type == o.type &&
|
142
|
-
format == o.format &&
|
143
|
-
shape_path == o.shape_path &&
|
144
|
-
output == o.output &&
|
145
|
-
options == o.options
|
146
|
-
end
|
147
|
-
|
148
|
-
# @see the `==` method
|
149
|
-
# @param [Object] Object to be compared
|
150
|
-
def eql?(o)
|
151
|
-
self == o
|
152
|
-
end
|
153
|
-
|
154
|
-
# Calculates hash code according to all attributes.
|
155
|
-
# @return [Fixnum] Hash code
|
156
|
-
def hash
|
157
|
-
[type, format, shape_path, output, options].hash
|
158
|
-
end
|
159
|
-
|
160
|
-
# Builds the object from hash
|
161
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
-
# @return [Object] Returns the model itself
|
163
|
-
def build_from_hash(attributes)
|
164
|
-
return nil unless attributes.is_a?(Hash)
|
165
|
-
self.class.swagger_types.each_pair do |key, type|
|
166
|
-
mapKey = self.class.attribute_map[key]
|
167
|
-
if !mapKey.nil?
|
168
|
-
val = attributes[mapKey]
|
169
|
-
if val.nil?
|
170
|
-
mapKeyString = mapKey.to_s
|
171
|
-
mapKeyString[0] = mapKeyString[0].downcase
|
172
|
-
mapKey = mapKeyString.to_sym
|
173
|
-
val = attributes[mapKey]
|
174
|
-
end
|
175
|
-
if !val.nil?
|
176
|
-
if type =~ /\AArray<(.*)>/i
|
177
|
-
# check to ensure the input is an array given that the the attribute
|
178
|
-
# is documented as an array but the input is not
|
179
|
-
if val.is_a?(Array)
|
180
|
-
self.send("#{key}=", val.map { |v| _deserialize($1, v) })
|
181
|
-
end
|
182
|
-
else
|
183
|
-
self.send("#{key}=", _deserialize(type, val))
|
184
|
-
end
|
185
|
-
end
|
186
|
-
end
|
187
|
-
end
|
188
|
-
|
189
|
-
self
|
190
|
-
end
|
191
|
-
|
192
|
-
# Deserializes the data based on type
|
193
|
-
# @param string type Data type
|
194
|
-
# @param string value Value to be deserialized
|
195
|
-
# @return [Object] Deserialized data
|
196
|
-
def _deserialize(type, value)
|
197
|
-
case type.to_sym
|
198
|
-
when :DateTime
|
199
|
-
DateTime.parse(value)
|
200
|
-
when :Date
|
201
|
-
Date.parse(value)
|
202
|
-
when :String
|
203
|
-
value.to_s
|
204
|
-
when :Integer
|
205
|
-
value.to_i
|
206
|
-
when :Float
|
207
|
-
value.to_f
|
208
|
-
when :BOOLEAN
|
209
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
210
|
-
true
|
211
|
-
else
|
212
|
-
false
|
213
|
-
end
|
214
|
-
when :Object
|
215
|
-
# generic object (usually a Hash), return directly
|
216
|
-
value
|
217
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
218
|
-
inner_type = Regexp.last_match[:inner_type]
|
219
|
-
value.map { |v| _deserialize(inner_type, v) }
|
220
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
221
|
-
k_type = Regexp.last_match[:k_type]
|
222
|
-
v_type = Regexp.last_match[:v_type]
|
223
|
-
{}.tap do |hash|
|
224
|
-
value.each do |k, v|
|
225
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
226
|
-
end
|
227
|
-
end
|
228
|
-
else # model
|
229
|
-
temp_model = AsposeSlidesCloud.const_get(type).new
|
230
|
-
temp_model.build_from_hash(value)
|
231
|
-
end
|
232
|
-
end
|
233
|
-
|
234
|
-
# Returns the string representation of the object
|
235
|
-
# @return [String] String presentation of the object
|
236
|
-
def to_s
|
237
|
-
to_hash.to_s
|
238
|
-
end
|
239
|
-
|
240
|
-
# to_body is an alias to to_hash (backward compatibility)
|
241
|
-
# @return [Hash] Returns the object in the form of hash
|
242
|
-
def to_body
|
243
|
-
to_hash
|
244
|
-
end
|
245
|
-
|
246
|
-
# Returns the object in the form of hash
|
247
|
-
# @return [Hash] Returns the object in the form of hash
|
248
|
-
def to_hash
|
249
|
-
hash = {}
|
250
|
-
self.class.attribute_map.each_pair do |attr, param|
|
251
|
-
value = self.send(attr)
|
252
|
-
next if value.nil?
|
253
|
-
hash[param] = _to_hash(value)
|
254
|
-
end
|
255
|
-
hash
|
256
|
-
end
|
257
|
-
|
258
|
-
# Outputs non-array value in the form of hash
|
259
|
-
# For object, use to_hash. Otherwise, just return the value
|
260
|
-
# @param [Object] value Any valid value
|
261
|
-
# @return [Hash] Returns the value in the form of hash
|
262
|
-
def _to_hash(value)
|
263
|
-
if value.is_a?(Array)
|
264
|
-
value.compact.map { |v| _to_hash(v) }
|
265
|
-
elsif value.is_a?(Hash)
|
266
|
-
{}.tap do |hash|
|
267
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
268
|
-
end
|
269
|
-
elsif value.respond_to? :to_hash
|
270
|
-
value.to_hash
|
271
|
-
else
|
272
|
-
value
|
273
|
-
end
|
274
|
-
end
|
275
|
-
end
|
276
|
-
end
|
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
|
+
# Save shape task.
|
27
|
+
class SaveShape < Task
|
28
|
+
# Format.
|
29
|
+
attr_accessor :format
|
30
|
+
|
31
|
+
# Shape path.
|
32
|
+
attr_accessor :shape_path
|
33
|
+
|
34
|
+
# Output file.
|
35
|
+
attr_accessor :output
|
36
|
+
|
37
|
+
# Save options.
|
38
|
+
attr_accessor :options
|
39
|
+
|
40
|
+
class EnumAttributeValidator
|
41
|
+
attr_reader :datatype
|
42
|
+
attr_reader :allowable_values
|
43
|
+
|
44
|
+
def initialize(datatype, allowable_values)
|
45
|
+
@allowable_values = allowable_values.map do |value|
|
46
|
+
case datatype.to_s
|
47
|
+
when /Integer/i
|
48
|
+
value.to_i
|
49
|
+
when /Float/i
|
50
|
+
value.to_f
|
51
|
+
else
|
52
|
+
value
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def valid?(value)
|
58
|
+
!value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
63
|
+
def self.attribute_map
|
64
|
+
super.merge({
|
65
|
+
:'format' => :'Format',
|
66
|
+
:'shape_path' => :'ShapePath',
|
67
|
+
:'output' => :'Output',
|
68
|
+
:'options' => :'Options',
|
69
|
+
})
|
70
|
+
end
|
71
|
+
|
72
|
+
# Attribute type mapping.
|
73
|
+
def self.swagger_types
|
74
|
+
super.merge({
|
75
|
+
:'format' => :'String',
|
76
|
+
:'shape_path' => :'String',
|
77
|
+
:'output' => :'OutputFile',
|
78
|
+
:'options' => :'IShapeExportOptions',
|
79
|
+
})
|
80
|
+
end
|
81
|
+
|
82
|
+
# Initializes the object
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
84
|
+
def initialize(attributes = {})
|
85
|
+
super
|
86
|
+
|
87
|
+
if attributes.has_key?(:'Format')
|
88
|
+
self.format = attributes[:'Format']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.has_key?(:'ShapePath')
|
92
|
+
self.shape_path = attributes[:'ShapePath']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.has_key?(:'Output')
|
96
|
+
self.output = attributes[:'Output']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.has_key?(:'Options')
|
100
|
+
self.options = attributes[:'Options']
|
101
|
+
end
|
102
|
+
self.type = "SaveShape"
|
103
|
+
end
|
104
|
+
|
105
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
106
|
+
# @return Array for valid properties with the reasons
|
107
|
+
def list_invalid_properties
|
108
|
+
invalid_properties = super
|
109
|
+
if @format.nil?
|
110
|
+
invalid_properties.push('invalid value for "format", format cannot be nil.')
|
111
|
+
end
|
112
|
+
|
113
|
+
invalid_properties
|
114
|
+
end
|
115
|
+
|
116
|
+
# Check to see if the all the properties in the model are valid
|
117
|
+
# @return true if the model is valid
|
118
|
+
def valid?
|
119
|
+
return false if !super
|
120
|
+
return false if @format.nil?
|
121
|
+
format_validator = EnumAttributeValidator.new('String', ['Jpeg', 'Png', 'Gif', 'Bmp', 'Tiff', 'Svg'])
|
122
|
+
return false unless format_validator.valid?(@format)
|
123
|
+
true
|
124
|
+
end
|
125
|
+
|
126
|
+
# Custom attribute writer method checking allowed values (enum).
|
127
|
+
# @param [Object] format Object to be assigned
|
128
|
+
def format=(format)
|
129
|
+
validator = EnumAttributeValidator.new('String', ['Jpeg', 'Png', 'Gif', 'Bmp', 'Tiff', 'Svg'])
|
130
|
+
unless validator.valid?(format)
|
131
|
+
fail ArgumentError, 'invalid value for "format", must be one of #{validator.allowable_values}.'
|
132
|
+
end
|
133
|
+
@format = format
|
134
|
+
end
|
135
|
+
|
136
|
+
# Checks equality by comparing each attribute.
|
137
|
+
# @param [Object] Object to be compared
|
138
|
+
def ==(o)
|
139
|
+
return true if self.equal?(o)
|
140
|
+
self.class == o.class &&
|
141
|
+
type == o.type &&
|
142
|
+
format == o.format &&
|
143
|
+
shape_path == o.shape_path &&
|
144
|
+
output == o.output &&
|
145
|
+
options == o.options
|
146
|
+
end
|
147
|
+
|
148
|
+
# @see the `==` method
|
149
|
+
# @param [Object] Object to be compared
|
150
|
+
def eql?(o)
|
151
|
+
self == o
|
152
|
+
end
|
153
|
+
|
154
|
+
# Calculates hash code according to all attributes.
|
155
|
+
# @return [Fixnum] Hash code
|
156
|
+
def hash
|
157
|
+
[type, format, shape_path, output, options].hash
|
158
|
+
end
|
159
|
+
|
160
|
+
# Builds the object from hash
|
161
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
+
# @return [Object] Returns the model itself
|
163
|
+
def build_from_hash(attributes)
|
164
|
+
return nil unless attributes.is_a?(Hash)
|
165
|
+
self.class.swagger_types.each_pair do |key, type|
|
166
|
+
mapKey = self.class.attribute_map[key]
|
167
|
+
if !mapKey.nil?
|
168
|
+
val = attributes[mapKey]
|
169
|
+
if val.nil?
|
170
|
+
mapKeyString = mapKey.to_s
|
171
|
+
mapKeyString[0] = mapKeyString[0].downcase
|
172
|
+
mapKey = mapKeyString.to_sym
|
173
|
+
val = attributes[mapKey]
|
174
|
+
end
|
175
|
+
if !val.nil?
|
176
|
+
if type =~ /\AArray<(.*)>/i
|
177
|
+
# check to ensure the input is an array given that the the attribute
|
178
|
+
# is documented as an array but the input is not
|
179
|
+
if val.is_a?(Array)
|
180
|
+
self.send("#{key}=", val.map { |v| _deserialize($1, v) })
|
181
|
+
end
|
182
|
+
else
|
183
|
+
self.send("#{key}=", _deserialize(type, val))
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
self
|
190
|
+
end
|
191
|
+
|
192
|
+
# Deserializes the data based on type
|
193
|
+
# @param string type Data type
|
194
|
+
# @param string value Value to be deserialized
|
195
|
+
# @return [Object] Deserialized data
|
196
|
+
def _deserialize(type, value)
|
197
|
+
case type.to_sym
|
198
|
+
when :DateTime
|
199
|
+
DateTime.parse(value)
|
200
|
+
when :Date
|
201
|
+
Date.parse(value)
|
202
|
+
when :String
|
203
|
+
value.to_s
|
204
|
+
when :Integer
|
205
|
+
value.to_i
|
206
|
+
when :Float
|
207
|
+
value.to_f
|
208
|
+
when :BOOLEAN
|
209
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
210
|
+
true
|
211
|
+
else
|
212
|
+
false
|
213
|
+
end
|
214
|
+
when :Object
|
215
|
+
# generic object (usually a Hash), return directly
|
216
|
+
value
|
217
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
218
|
+
inner_type = Regexp.last_match[:inner_type]
|
219
|
+
value.map { |v| _deserialize(inner_type, v) }
|
220
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
221
|
+
k_type = Regexp.last_match[:k_type]
|
222
|
+
v_type = Regexp.last_match[:v_type]
|
223
|
+
{}.tap do |hash|
|
224
|
+
value.each do |k, v|
|
225
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
226
|
+
end
|
227
|
+
end
|
228
|
+
else # model
|
229
|
+
temp_model = AsposeSlidesCloud.const_get(type).new
|
230
|
+
temp_model.build_from_hash(value)
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
# Returns the string representation of the object
|
235
|
+
# @return [String] String presentation of the object
|
236
|
+
def to_s
|
237
|
+
to_hash.to_s
|
238
|
+
end
|
239
|
+
|
240
|
+
# to_body is an alias to to_hash (backward compatibility)
|
241
|
+
# @return [Hash] Returns the object in the form of hash
|
242
|
+
def to_body
|
243
|
+
to_hash
|
244
|
+
end
|
245
|
+
|
246
|
+
# Returns the object in the form of hash
|
247
|
+
# @return [Hash] Returns the object in the form of hash
|
248
|
+
def to_hash
|
249
|
+
hash = {}
|
250
|
+
self.class.attribute_map.each_pair do |attr, param|
|
251
|
+
value = self.send(attr)
|
252
|
+
next if value.nil?
|
253
|
+
hash[param] = _to_hash(value)
|
254
|
+
end
|
255
|
+
hash
|
256
|
+
end
|
257
|
+
|
258
|
+
# Outputs non-array value in the form of hash
|
259
|
+
# For object, use to_hash. Otherwise, just return the value
|
260
|
+
# @param [Object] value Any valid value
|
261
|
+
# @return [Hash] Returns the value in the form of hash
|
262
|
+
def _to_hash(value)
|
263
|
+
if value.is_a?(Array)
|
264
|
+
value.compact.map { |v| _to_hash(v) }
|
265
|
+
elsif value.is_a?(Hash)
|
266
|
+
{}.tap do |hash|
|
267
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
268
|
+
end
|
269
|
+
elsif value.respond_to? :to_hash
|
270
|
+
value.to_hash
|
271
|
+
else
|
272
|
+
value
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|