aspose_slides_cloud 1.0.3 → 19.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/Gemfile +7 -0
  4. data/LICENSE +2 -3
  5. data/README.md +7 -39
  6. data/Rakefile +8 -0
  7. data/TestData/TemplateCV.pptx +0 -0
  8. data/TestData/TemplatingCVDataWithBase64.xml +23 -0
  9. data/TestData/placeholders.pptx +0 -0
  10. data/TestData/test-unprotected.ppt +0 -0
  11. data/TestData/test.ppt +0 -0
  12. data/aspose_slides_cloud.gemspec +42 -14
  13. data/lib/aspose_slides_cloud.rb +183 -78
  14. data/lib/aspose_slides_cloud/api/slides_api.rb +6906 -2256
  15. data/lib/aspose_slides_cloud/api/slides_api_requests.rb +3067 -0
  16. data/lib/aspose_slides_cloud/api_client.rb +273 -183
  17. data/lib/aspose_slides_cloud/api_error.rb +29 -5
  18. data/lib/aspose_slides_cloud/configuration.rb +93 -81
  19. data/lib/aspose_slides_cloud/models/add_layout_slide.rb +261 -0
  20. data/lib/aspose_slides_cloud/models/add_master_slide.rb +276 -0
  21. data/lib/aspose_slides_cloud/models/add_shape.rb +256 -0
  22. data/lib/aspose_slides_cloud/models/add_slide.rb +286 -0
  23. data/lib/aspose_slides_cloud/models/api_info.rb +205 -0
  24. data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +257 -22
  25. data/lib/aspose_slides_cloud/models/audio_frame.rb +573 -0
  26. data/lib/aspose_slides_cloud/models/axes.rb +225 -0
  27. data/lib/aspose_slides_cloud/models/axis.rb +847 -0
  28. data/lib/aspose_slides_cloud/models/base64_input_file.rb +256 -0
  29. data/lib/aspose_slides_cloud/models/blur_effect.rb +215 -0
  30. data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +230 -0
  31. data/lib/aspose_slides_cloud/models/bubble_series.rb +463 -0
  32. data/lib/aspose_slides_cloud/models/chart.rb +543 -0
  33. data/lib/aspose_slides_cloud/models/chart_title.rb +210 -0
  34. data/lib/aspose_slides_cloud/models/chart_wall.rb +279 -0
  35. data/lib/aspose_slides_cloud/models/color_scheme.rb +258 -84
  36. data/lib/aspose_slides_cloud/models/connector.rb +487 -0
  37. data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +171 -13
  38. data/lib/aspose_slides_cloud/models/disc_usage.rb +215 -0
  39. data/lib/aspose_slides_cloud/models/document.rb +222 -46
  40. data/lib/aspose_slides_cloud/models/document_properties.rb +188 -36
  41. data/lib/aspose_slides_cloud/models/document_property.rb +209 -48
  42. data/lib/aspose_slides_cloud/models/document_replace_result.rb +272 -0
  43. data/lib/aspose_slides_cloud/models/effect.rb +412 -0
  44. data/lib/aspose_slides_cloud/models/effect_format.rb +265 -0
  45. data/lib/aspose_slides_cloud/models/error.rb +225 -0
  46. data/lib/aspose_slides_cloud/models/error_details.rb +210 -0
  47. data/lib/aspose_slides_cloud/models/export_format.rb +59 -0
  48. data/lib/aspose_slides_cloud/models/export_options.rb +194 -0
  49. data/lib/aspose_slides_cloud/models/file_version.rb +270 -0
  50. data/lib/aspose_slides_cloud/models/file_versions.rb +197 -0
  51. data/lib/aspose_slides_cloud/models/files_list.rb +197 -0
  52. data/lib/aspose_slides_cloud/models/files_upload_result.rb +209 -0
  53. data/lib/aspose_slides_cloud/models/fill_format.rb +204 -13
  54. data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +234 -0
  55. data/lib/aspose_slides_cloud/models/font_scheme.rb +204 -48
  56. data/lib/aspose_slides_cloud/models/font_set.rb +184 -22
  57. data/lib/aspose_slides_cloud/models/format_scheme.rb +210 -52
  58. data/lib/aspose_slides_cloud/models/geometry_shape.rb +439 -0
  59. data/lib/aspose_slides_cloud/models/glow_effect.rb +210 -0
  60. data/lib/aspose_slides_cloud/models/gradient_fill.rb +359 -0
  61. data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +210 -0
  62. data/lib/aspose_slides_cloud/models/graphical_object.rb +422 -0
  63. data/lib/aspose_slides_cloud/models/group_shape.rb +422 -0
  64. data/lib/aspose_slides_cloud/models/html_export_options.rb +392 -25
  65. data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +195 -0
  66. data/lib/aspose_slides_cloud/models/image.rb +216 -42
  67. data/lib/aspose_slides_cloud/models/image_export_format.rb +43 -0
  68. data/lib/aspose_slides_cloud/models/image_export_options.rb +298 -0
  69. data/lib/aspose_slides_cloud/models/images.rb +188 -36
  70. data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +240 -0
  71. data/lib/aspose_slides_cloud/models/input.rb +215 -0
  72. data/lib/aspose_slides_cloud/models/input_file.rb +238 -0
  73. data/lib/aspose_slides_cloud/models/interactive_sequence.rb +212 -0
  74. data/lib/aspose_slides_cloud/models/layout_slide.rb +288 -0
  75. data/lib/aspose_slides_cloud/models/layout_slides.rb +219 -0
  76. data/lib/aspose_slides_cloud/models/legend.rb +339 -0
  77. data/lib/aspose_slides_cloud/models/line_format.rb +349 -54
  78. data/lib/aspose_slides_cloud/models/master_slide.rb +241 -0
  79. data/lib/aspose_slides_cloud/models/master_slides.rb +219 -0
  80. data/lib/aspose_slides_cloud/models/merge.rb +248 -0
  81. data/lib/aspose_slides_cloud/models/merging_source.rb +207 -0
  82. data/lib/aspose_slides_cloud/models/no_fill.rb +236 -0
  83. data/lib/aspose_slides_cloud/models/notes_slide.rb +227 -0
  84. data/lib/aspose_slides_cloud/models/notes_slide_export_format.rb +43 -0
  85. data/lib/aspose_slides_cloud/models/object_exist.rb +215 -0
  86. data/lib/aspose_slides_cloud/models/ole_object_frame.rb +447 -0
  87. data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +200 -0
  88. data/lib/aspose_slides_cloud/models/one_value_series.rb +463 -0
  89. data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +171 -13
  90. data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +240 -0
  91. data/lib/aspose_slides_cloud/models/output_file.rb +228 -0
  92. data/lib/aspose_slides_cloud/models/paragraph.rb +494 -34
  93. data/lib/aspose_slides_cloud/models/paragraphs.rb +187 -35
  94. data/lib/aspose_slides_cloud/models/path_input_file.rb +266 -0
  95. data/lib/aspose_slides_cloud/models/path_output_file.rb +256 -0
  96. data/lib/aspose_slides_cloud/models/pattern_fill.rb +283 -0
  97. data/lib/aspose_slides_cloud/models/pdf_export_options.rb +467 -49
  98. data/lib/aspose_slides_cloud/models/picture_fill.rb +368 -0
  99. data/lib/aspose_slides_cloud/models/picture_frame.rb +459 -0
  100. data/lib/aspose_slides_cloud/models/pipeline.rb +207 -0
  101. data/lib/aspose_slides_cloud/models/placeholder.rb +294 -56
  102. data/lib/aspose_slides_cloud/models/placeholders.rb +188 -36
  103. data/lib/aspose_slides_cloud/models/plot_area.rb +324 -0
  104. data/lib/aspose_slides_cloud/models/portion.rb +564 -46
  105. data/lib/aspose_slides_cloud/models/portions.rb +219 -0
  106. data/lib/aspose_slides_cloud/models/pptx_export_options.rb +246 -0
  107. data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +188 -18
  108. data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +185 -15
  109. data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +274 -0
  110. data/lib/aspose_slides_cloud/models/reflection_effect.rb +429 -0
  111. data/lib/aspose_slides_cloud/models/remove_shape.rb +246 -0
  112. data/lib/aspose_slides_cloud/models/remove_slide.rb +251 -0
  113. data/lib/aspose_slides_cloud/models/reorder_slide.rb +266 -0
  114. data/lib/aspose_slides_cloud/models/replace_text.rb +286 -0
  115. data/lib/aspose_slides_cloud/models/request_input_file.rb +261 -0
  116. data/lib/aspose_slides_cloud/models/reset_slide.rb +251 -0
  117. data/lib/aspose_slides_cloud/models/resource_base.rb +207 -0
  118. data/lib/aspose_slides_cloud/models/resource_uri.rb +190 -26
  119. data/lib/aspose_slides_cloud/models/resource_uri_element.rb +171 -13
  120. data/lib/aspose_slides_cloud/models/response_output_file.rb +236 -0
  121. data/lib/aspose_slides_cloud/models/save.rb +283 -0
  122. data/lib/aspose_slides_cloud/models/save_shape.rb +293 -0
  123. data/lib/aspose_slides_cloud/models/save_slide.rb +318 -0
  124. data/lib/aspose_slides_cloud/models/scale_type.rb +41 -0
  125. data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +215 -0
  126. data/lib/aspose_slides_cloud/models/scatter_series.rb +463 -0
  127. data/lib/aspose_slides_cloud/models/series.rb +424 -0
  128. data/lib/aspose_slides_cloud/models/series_marker.rb +279 -0
  129. data/lib/aspose_slides_cloud/models/shape.rb +398 -100
  130. data/lib/aspose_slides_cloud/models/shape_base.rb +406 -0
  131. data/lib/aspose_slides_cloud/models/shape_export_format.rb +44 -0
  132. data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +274 -0
  133. data/lib/aspose_slides_cloud/models/shape_thumbnail_bounds.rb +41 -0
  134. data/lib/aspose_slides_cloud/models/shapes.rb +219 -0
  135. data/lib/aspose_slides_cloud/models/size_type.rb +55 -0
  136. data/lib/aspose_slides_cloud/models/slide.rb +277 -66
  137. data/lib/aspose_slides_cloud/models/slide_animation.rb +231 -0
  138. data/lib/aspose_slides_cloud/models/slide_background.rb +245 -42
  139. data/lib/aspose_slides_cloud/models/slide_comment.rb +198 -24
  140. data/lib/aspose_slides_cloud/models/slide_comments.rb +188 -36
  141. data/lib/aspose_slides_cloud/models/slide_export_format.rb +58 -0
  142. data/lib/aspose_slides_cloud/models/slide_replace_result.rb +347 -0
  143. data/lib/aspose_slides_cloud/models/slides.rb +188 -36
  144. data/lib/aspose_slides_cloud/models/smart_art.rb +530 -0
  145. data/lib/aspose_slides_cloud/models/smart_art_node.rb +281 -0
  146. data/lib/aspose_slides_cloud/models/smart_art_shape.rb +422 -0
  147. data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +200 -0
  148. data/lib/aspose_slides_cloud/models/solid_fill.rb +246 -0
  149. data/lib/aspose_slides_cloud/models/split_document_result.rb +188 -36
  150. data/lib/aspose_slides_cloud/models/storage_exist.rb +200 -0
  151. data/lib/aspose_slides_cloud/models/storage_file.rb +245 -0
  152. data/lib/aspose_slides_cloud/models/svg_export_options.rb +378 -0
  153. data/lib/aspose_slides_cloud/models/swf_export_options.rb +528 -0
  154. data/lib/aspose_slides_cloud/models/table.rb +578 -0
  155. data/lib/aspose_slides_cloud/models/table_cell.rb +431 -0
  156. data/lib/aspose_slides_cloud/models/table_column.rb +200 -0
  157. data/lib/aspose_slides_cloud/models/table_row.rb +227 -0
  158. data/lib/aspose_slides_cloud/models/task.rb +228 -0
  159. data/lib/aspose_slides_cloud/models/text_item.rb +178 -18
  160. data/lib/aspose_slides_cloud/models/text_items.rb +188 -36
  161. data/lib/aspose_slides_cloud/models/theme.rb +210 -52
  162. data/lib/aspose_slides_cloud/models/tiff_export_options.rb +385 -40
  163. data/lib/aspose_slides_cloud/models/update_background.rb +258 -0
  164. data/lib/aspose_slides_cloud/models/update_shape.rb +256 -0
  165. data/lib/aspose_slides_cloud/models/video_frame.rb +543 -0
  166. data/lib/aspose_slides_cloud/models/xps_export_options.rb +242 -0
  167. data/lib/aspose_slides_cloud/version.rb +23 -1
  168. data/spec/api/slides_api_spec.rb +24188 -0
  169. data/spec/extra/extra_spec.rb +84 -0
  170. data/spec/spec_helper.rb +122 -0
  171. data/spec/spec_utils.rb +154 -0
  172. data/testConfig.json +7 -0
  173. data/testRules.json +333 -0
  174. metadata +273 -61
  175. data/lib/aspose_slides_cloud/models/base_object.rb +0 -86
  176. data/lib/aspose_slides_cloud/models/base_response.rb +0 -53
  177. data/lib/aspose_slides_cloud/models/color.rb +0 -29
  178. data/lib/aspose_slides_cloud/models/color_scheme_response.rb +0 -61
  179. data/lib/aspose_slides_cloud/models/common_response.rb +0 -53
  180. data/lib/aspose_slides_cloud/models/document_properties_response.rb +0 -61
  181. data/lib/aspose_slides_cloud/models/document_property_response.rb +0 -61
  182. data/lib/aspose_slides_cloud/models/document_response.rb +0 -61
  183. data/lib/aspose_slides_cloud/models/font_scheme_response.rb +0 -61
  184. data/lib/aspose_slides_cloud/models/format_scheme_response.rb +0 -61
  185. data/lib/aspose_slides_cloud/models/images_response.rb +0 -61
  186. data/lib/aspose_slides_cloud/models/new_shape_response.rb +0 -61
  187. data/lib/aspose_slides_cloud/models/paragraph_portion_response.rb +0 -61
  188. data/lib/aspose_slides_cloud/models/placeholder_response.rb +0 -61
  189. data/lib/aspose_slides_cloud/models/placeholders_response.rb +0 -61
  190. data/lib/aspose_slides_cloud/models/presentation_string_replace_response.rb +0 -69
  191. data/lib/aspose_slides_cloud/models/shape_list.rb +0 -67
  192. data/lib/aspose_slides_cloud/models/shape_paragraph_response.rb +0 -61
  193. data/lib/aspose_slides_cloud/models/shape_paragraphs_response.rb +0 -61
  194. data/lib/aspose_slides_cloud/models/shape_response.rb +0 -61
  195. data/lib/aspose_slides_cloud/models/slide_background_response.rb +0 -61
  196. data/lib/aspose_slides_cloud/models/slide_comments_response.rb +0 -61
  197. data/lib/aspose_slides_cloud/models/slide_list_response.rb +0 -61
  198. data/lib/aspose_slides_cloud/models/slide_response.rb +0 -61
  199. data/lib/aspose_slides_cloud/models/slide_string_replace_response.rb +0 -69
  200. data/lib/aspose_slides_cloud/models/split_document_response.rb +0 -61
  201. data/lib/aspose_slides_cloud/models/text_items_response.rb +0 -61
  202. data/lib/aspose_slides_cloud/models/theme_response.rb +0 -61
  203. data/test/slides_tests.rb +0 -580
@@ -0,0 +1,197 @@
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
+ # Files list
27
+ class FilesList
28
+ # Files and folders contained by folder StorageFile.
29
+ attr_accessor :value
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'value' => :'Value'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'value' => :'Array<StorageFile>'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+
53
+ if attributes.has_key?(:'Value')
54
+ if (value = attributes[:'Value']).is_a?(Array)
55
+ self.value = value
56
+ end
57
+ end
58
+ end
59
+
60
+ # Show invalid properties with the reasons. Usually used together with valid?
61
+ # @return Array for valid properties with the reasons
62
+ def list_invalid_properties
63
+ invalid_properties = Array.new
64
+ invalid_properties
65
+ end
66
+
67
+ # Check to see if the all the properties in the model are valid
68
+ # @return true if the model is valid
69
+ def valid?
70
+ true
71
+ end
72
+
73
+ # Checks equality by comparing each attribute.
74
+ # @param [Object] Object to be compared
75
+ def ==(o)
76
+ return true if self.equal?(o)
77
+ self.class == o.class &&
78
+ value == o.value
79
+ end
80
+
81
+ # @see the `==` method
82
+ # @param [Object] Object to be compared
83
+ def eql?(o)
84
+ self == o
85
+ end
86
+
87
+ # Calculates hash code according to all attributes.
88
+ # @return [Fixnum] Hash code
89
+ def hash
90
+ [value].hash
91
+ end
92
+
93
+ # Builds the object from hash
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ # @return [Object] Returns the model itself
96
+ def build_from_hash(attributes)
97
+ return nil unless attributes.is_a?(Hash)
98
+ self.class.swagger_types.each_pair do |key, type|
99
+ if type =~ /\AArray<(.*)>/i
100
+ # check to ensure the input is an array given that the the attribute
101
+ # is documented as an array but the input is not
102
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
103
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
104
+ end
105
+ elsif !attributes[self.class.attribute_map[key]].nil?
106
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
107
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
108
+ end
109
+
110
+ self
111
+ end
112
+
113
+ # Deserializes the data based on type
114
+ # @param string type Data type
115
+ # @param string value Value to be deserialized
116
+ # @return [Object] Deserialized data
117
+ def _deserialize(type, value)
118
+ case type.to_sym
119
+ when :DateTime
120
+ DateTime.parse(value)
121
+ when :Date
122
+ Date.parse(value)
123
+ when :String
124
+ value.to_s
125
+ when :Integer
126
+ value.to_i
127
+ when :Float
128
+ value.to_f
129
+ when :BOOLEAN
130
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
131
+ true
132
+ else
133
+ false
134
+ end
135
+ when :Object
136
+ # generic object (usually a Hash), return directly
137
+ value
138
+ when /\AArray<(?<inner_type>.+)>\z/
139
+ inner_type = Regexp.last_match[:inner_type]
140
+ value.map { |v| _deserialize(inner_type, v) }
141
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
142
+ k_type = Regexp.last_match[:k_type]
143
+ v_type = Regexp.last_match[:v_type]
144
+ {}.tap do |hash|
145
+ value.each do |k, v|
146
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
147
+ end
148
+ end
149
+ else # model
150
+ temp_model = AsposeSlidesCloud.const_get(type).new
151
+ temp_model.build_from_hash(value)
152
+ end
153
+ end
154
+
155
+ # Returns the string representation of the object
156
+ # @return [String] String presentation of the object
157
+ def to_s
158
+ to_hash.to_s
159
+ end
160
+
161
+ # to_body is an alias to to_hash (backward compatibility)
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_body
164
+ to_hash
165
+ end
166
+
167
+ # Returns the object in the form of hash
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_hash
170
+ hash = {}
171
+ self.class.attribute_map.each_pair do |attr, param|
172
+ value = self.send(attr)
173
+ next if value.nil?
174
+ hash[param] = _to_hash(value)
175
+ end
176
+ hash
177
+ end
178
+
179
+ # Outputs non-array value in the form of hash
180
+ # For object, use to_hash. Otherwise, just return the value
181
+ # @param [Object] value Any valid value
182
+ # @return [Hash] Returns the value in the form of hash
183
+ def _to_hash(value)
184
+ if value.is_a?(Array)
185
+ value.compact.map { |v| _to_hash(v) }
186
+ elsif value.is_a?(Hash)
187
+ {}.tap do |hash|
188
+ value.each { |k, v| hash[k] = _to_hash(v) }
189
+ end
190
+ elsif value.respond_to? :to_hash
191
+ value.to_hash
192
+ else
193
+ value
194
+ end
195
+ end
196
+ end
197
+ end
@@ -0,0 +1,209 @@
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
+ # File upload result
27
+ class FilesUploadResult
28
+ # List of uploaded file names
29
+ attr_accessor :uploaded
30
+
31
+ # List of errors.
32
+ attr_accessor :errors
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'uploaded' => :'Uploaded',
38
+ :'errors' => :'Errors'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'uploaded' => :'Array<String>',
46
+ :'errors' => :'Array<Error>'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'Uploaded')
59
+ if (value = attributes[:'Uploaded']).is_a?(Array)
60
+ self.uploaded = value
61
+ end
62
+ end
63
+
64
+ if attributes.has_key?(:'Errors')
65
+ if (value = attributes[:'Errors']).is_a?(Array)
66
+ self.errors = value
67
+ end
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ invalid_properties = Array.new
75
+ invalid_properties
76
+ end
77
+
78
+ # Check to see if the all the properties in the model are valid
79
+ # @return true if the model is valid
80
+ def valid?
81
+ true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ uploaded == o.uploaded &&
90
+ errors == o.errors
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Fixnum] Hash code
101
+ def hash
102
+ [uploaded, errors].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.swagger_types.each_pair do |key, type|
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :BOOLEAN
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ temp_model = AsposeSlidesCloud.const_get(type).new
163
+ temp_model.build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ next if value.nil?
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ # Outputs non-array value in the form of hash
192
+ # For object, use to_hash. Otherwise, just return the value
193
+ # @param [Object] value Any valid value
194
+ # @return [Hash] Returns the value in the form of hash
195
+ def _to_hash(value)
196
+ if value.is_a?(Array)
197
+ value.compact.map { |v| _to_hash(v) }
198
+ elsif value.is_a?(Hash)
199
+ {}.tap do |hash|
200
+ value.each { |k, v| hash[k] = _to_hash(v) }
201
+ end
202
+ elsif value.respond_to? :to_hash
203
+ value.to_hash
204
+ else
205
+ value
206
+ end
207
+ end
208
+ end
209
+ end
@@ -1,37 +1,228 @@
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
+
1
25
  module AsposeSlidesCloud
2
- #
3
- class FillFormat < BaseObject
26
+ # Base class for fill formats
27
+ class FillFormat
4
28
  attr_accessor :type
5
- # attribute mapping from ruby-style variable name to JSON key
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
6
53
  def self.attribute_map
7
54
  {
8
-
9
- #
10
55
  :'type' => :'Type'
11
-
12
56
  }
13
57
  end
14
58
 
15
- # attribute type
59
+ # Attribute type mapping.
16
60
  def self.swagger_types
17
61
  {
18
62
  :'type' => :'String'
19
-
20
63
  }
21
64
  end
22
65
 
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
23
68
  def initialize(attributes = {})
24
- return if !attributes.is_a?(Hash) || attributes.empty?
69
+ return unless attributes.is_a?(Hash)
25
70
 
26
71
  # convert string to symbol for hash key
27
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
72
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
28
73
 
29
-
30
- if attributes[:'Type']
74
+ if attributes.has_key?(:'Type')
31
75
  self.type = attributes[:'Type']
32
76
  end
33
-
34
77
  end
35
78
 
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ type_validator = EnumAttributeValidator.new('String', ['NoFill', 'Solid', 'Gradient', 'Pattern', 'Picture', 'NotDefined'])
90
+ return false unless type_validator.valid?(@type)
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method checking allowed values (enum).
95
+ # @param [Object] type Object to be assigned
96
+ def type=(type)
97
+ validator = EnumAttributeValidator.new('String', ['NoFill', 'Solid', 'Gradient', 'Pattern', 'Picture', 'NotDefined'])
98
+ unless validator.valid?(type)
99
+ fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
100
+ end
101
+ @type = type
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ type == o.type
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Fixnum] Hash code
120
+ def hash
121
+ [type].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.swagger_types.each_pair do |key, type|
130
+ if type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
139
+ end
140
+
141
+ self
142
+ end
143
+
144
+ # Deserializes the data based on type
145
+ # @param string type Data type
146
+ # @param string value Value to be deserialized
147
+ # @return [Object] Deserialized data
148
+ def _deserialize(type, value)
149
+ case type.to_sym
150
+ when :DateTime
151
+ DateTime.parse(value)
152
+ when :Date
153
+ Date.parse(value)
154
+ when :String
155
+ value.to_s
156
+ when :Integer
157
+ value.to_i
158
+ when :Float
159
+ value.to_f
160
+ when :BOOLEAN
161
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
162
+ true
163
+ else
164
+ false
165
+ end
166
+ when :Object
167
+ # generic object (usually a Hash), return directly
168
+ value
169
+ when /\AArray<(?<inner_type>.+)>\z/
170
+ inner_type = Regexp.last_match[:inner_type]
171
+ value.map { |v| _deserialize(inner_type, v) }
172
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
173
+ k_type = Regexp.last_match[:k_type]
174
+ v_type = Regexp.last_match[:v_type]
175
+ {}.tap do |hash|
176
+ value.each do |k, v|
177
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
178
+ end
179
+ end
180
+ else # model
181
+ temp_model = AsposeSlidesCloud.const_get(type).new
182
+ temp_model.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ next if value.nil?
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
36
227
  end
37
228
  end