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
@@ -1,89 +1,247 @@
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 Theme < BaseObject
4
- attr_accessor :name, :color_scheme, :font_scheme, :format_scheme, :self_uri, :alternate_links, :links
5
- # attribute mapping from ruby-style variable name to JSON key
26
+ # Represents Slide's theme
27
+ class Theme
28
+ # Gets or sets the link to this resource.
29
+ attr_accessor :self_uri
30
+
31
+ # List of alternate links.
32
+ attr_accessor :alternate_links
33
+
34
+ # Name.
35
+ attr_accessor :name
36
+
37
+ # Color scheme.
38
+ attr_accessor :color_scheme
39
+
40
+ # Font scheme.
41
+ attr_accessor :font_scheme
42
+
43
+ # Format scheme.
44
+ attr_accessor :format_scheme
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
6
47
  def self.attribute_map
7
48
  {
8
-
9
- #
49
+ :'self_uri' => :'SelfUri',
50
+ :'alternate_links' => :'AlternateLinks',
10
51
  :'name' => :'Name',
11
-
12
- #
13
52
  :'color_scheme' => :'ColorScheme',
14
-
15
- #
16
53
  :'font_scheme' => :'FontScheme',
17
-
18
- #
19
- :'format_scheme' => :'FormatScheme',
20
-
21
- #
22
- :'self_uri' => :'SelfUri',
23
-
24
- #
25
- :'alternate_links' => :'AlternateLinks',
26
-
27
- #
28
- :'links' => :'Links'
29
-
54
+ :'format_scheme' => :'FormatScheme'
30
55
  }
31
56
  end
32
57
 
33
- # attribute type
58
+ # Attribute type mapping.
34
59
  def self.swagger_types
35
60
  {
61
+ :'self_uri' => :'ResourceUri',
62
+ :'alternate_links' => :'Array<ResourceUri>',
36
63
  :'name' => :'String',
37
64
  :'color_scheme' => :'ResourceUriElement',
38
65
  :'font_scheme' => :'ResourceUriElement',
39
- :'format_scheme' => :'ResourceUriElement',
40
- :'self_uri' => :'ResourceUri',
41
- :'alternate_links' => :'Array<ResourceUri>',
42
- :'links' => :'Array<ResourceUri>'
43
-
66
+ :'format_scheme' => :'ResourceUriElement'
44
67
  }
45
68
  end
46
69
 
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
47
72
  def initialize(attributes = {})
48
- return if !attributes.is_a?(Hash) || attributes.empty?
73
+ return unless attributes.is_a?(Hash)
49
74
 
50
75
  # convert string to symbol for hash key
51
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
76
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
77
 
53
-
54
- if attributes[:'Name']
78
+ if attributes.has_key?(:'SelfUri')
79
+ self.self_uri = attributes[:'SelfUri']
80
+ end
81
+
82
+ if attributes.has_key?(:'AlternateLinks')
83
+ if (value = attributes[:'AlternateLinks']).is_a?(Array)
84
+ self.alternate_links = value
85
+ end
86
+ end
87
+
88
+ if attributes.has_key?(:'Name')
55
89
  self.name = attributes[:'Name']
56
90
  end
57
-
58
- if attributes[:'ColorScheme']
91
+
92
+ if attributes.has_key?(:'ColorScheme')
59
93
  self.color_scheme = attributes[:'ColorScheme']
60
94
  end
61
-
62
- if attributes[:'FontScheme']
95
+
96
+ if attributes.has_key?(:'FontScheme')
63
97
  self.font_scheme = attributes[:'FontScheme']
64
98
  end
65
-
66
- if attributes[:'FormatScheme']
99
+
100
+ if attributes.has_key?(:'FormatScheme')
67
101
  self.format_scheme = attributes[:'FormatScheme']
68
102
  end
69
-
70
- if attributes[:'SelfUri']
71
- self.self_uri = attributes[:'SelfUri']
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 = Array.new
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ self_uri == o.self_uri &&
124
+ alternate_links == o.alternate_links &&
125
+ name == o.name &&
126
+ color_scheme == o.color_scheme &&
127
+ font_scheme == o.font_scheme &&
128
+ format_scheme == o.format_scheme
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Fixnum] Hash code
139
+ def hash
140
+ [self_uri, alternate_links, name, color_scheme, font_scheme, format_scheme].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ self.class.swagger_types.each_pair do |key, type|
149
+ if type =~ /\AArray<(.*)>/i
150
+ # check to ensure the input is an array given that the the attribute
151
+ # is documented as an array but the input is not
152
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
153
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
154
+ end
155
+ elsif !attributes[self.class.attribute_map[key]].nil?
156
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
157
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
72
158
  end
73
-
74
- if attributes[:'AlternateLinks']
75
- if (value = attributes[:'AlternateLinks']).is_a?(Array)
76
- self.alternate_links = value
159
+
160
+ self
161
+ end
162
+
163
+ # Deserializes the data based on type
164
+ # @param string type Data type
165
+ # @param string value Value to be deserialized
166
+ # @return [Object] Deserialized data
167
+ def _deserialize(type, value)
168
+ case type.to_sym
169
+ when :DateTime
170
+ DateTime.parse(value)
171
+ when :Date
172
+ Date.parse(value)
173
+ when :String
174
+ value.to_s
175
+ when :Integer
176
+ value.to_i
177
+ when :Float
178
+ value.to_f
179
+ when :BOOLEAN
180
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
181
+ true
182
+ else
183
+ false
77
184
  end
78
- end
79
-
80
- if attributes[:'Links']
81
- if (value = attributes[:'Links']).is_a?(Array)
82
- self.links = value
185
+ when :Object
186
+ # generic object (usually a Hash), return directly
187
+ value
188
+ when /\AArray<(?<inner_type>.+)>\z/
189
+ inner_type = Regexp.last_match[:inner_type]
190
+ value.map { |v| _deserialize(inner_type, v) }
191
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
192
+ k_type = Regexp.last_match[:k_type]
193
+ v_type = Regexp.last_match[:v_type]
194
+ {}.tap do |hash|
195
+ value.each do |k, v|
196
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
+ end
83
198
  end
199
+ else # model
200
+ temp_model = AsposeSlidesCloud.const_get(type).new
201
+ temp_model.build_from_hash(value)
202
+ end
203
+ end
204
+
205
+ # Returns the string representation of the object
206
+ # @return [String] String presentation of the object
207
+ def to_s
208
+ to_hash.to_s
209
+ end
210
+
211
+ # to_body is an alias to to_hash (backward compatibility)
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_body
214
+ to_hash
215
+ end
216
+
217
+ # Returns the object in the form of hash
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_hash
220
+ hash = {}
221
+ self.class.attribute_map.each_pair do |attr, param|
222
+ value = self.send(attr)
223
+ next if value.nil?
224
+ hash[param] = _to_hash(value)
84
225
  end
85
-
226
+ hash
86
227
  end
87
228
 
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end
88
246
  end
89
247
  end
@@ -1,77 +1,422 @@
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 TiffExportOptions < BaseObject
4
- attr_accessor :width, :height, :dpi_x, :dpi_y, :compression, :export_format
5
- # attribute mapping from ruby-style variable name to JSON key
26
+ # Provides options that control how a presentation is saved in TIFF format.
27
+ class TiffExportOptions
28
+ # Export format.
29
+ attr_accessor :format
30
+
31
+ # Compression type.
32
+ attr_accessor :compression
33
+
34
+ # Width.
35
+ attr_accessor :width
36
+
37
+ # Height.
38
+ attr_accessor :height
39
+
40
+ # Horizontal resolution, in dots per inch.
41
+ attr_accessor :dpi_x
42
+
43
+ # Vertical resolution, in dots per inch.
44
+ attr_accessor :dpi_y
45
+
46
+ # Specifies whether the generated document should include hidden slides or not. Default is false.
47
+ attr_accessor :show_hidden_slides
48
+
49
+ # Specifies the pixel format for the generated images. Read/write ImagePixelFormat.
50
+ attr_accessor :pixel_format
51
+
52
+ # Gets or sets the position of the notes on the page.
53
+ attr_accessor :notes_position
54
+
55
+ # Gets or sets the position of the comments on the page.
56
+ attr_accessor :comments_position
57
+
58
+ # Gets or sets the width of the comment output area in pixels (Applies only if comments are displayed on the right).
59
+ attr_accessor :comments_area_width
60
+
61
+ # Gets or sets the color of comments area (Applies only if comments are displayed on the right).
62
+ attr_accessor :comments_area_color
63
+
64
+ # True if comments that have no author are displayed. (Applies only if comments are displayed).
65
+ attr_accessor :show_comments_by_no_author
66
+
67
+ class EnumAttributeValidator
68
+ attr_reader :datatype
69
+ attr_reader :allowable_values
70
+
71
+ def initialize(datatype, allowable_values)
72
+ @allowable_values = allowable_values.map do |value|
73
+ case datatype.to_s
74
+ when /Integer/i
75
+ value.to_i
76
+ when /Float/i
77
+ value.to_f
78
+ else
79
+ value
80
+ end
81
+ end
82
+ end
83
+
84
+ def valid?(value)
85
+ !value || allowable_values.any?{ |s| s.casecmp(value) == 0 }
86
+ end
87
+ end
88
+
89
+ # Attribute mapping from ruby-style variable name to JSON key.
6
90
  def self.attribute_map
7
91
  {
8
-
9
- #
92
+ :'format' => :'Format',
93
+ :'compression' => :'Compression',
10
94
  :'width' => :'Width',
11
-
12
- #
13
95
  :'height' => :'Height',
14
-
15
- #
16
96
  :'dpi_x' => :'DpiX',
17
-
18
- #
19
97
  :'dpi_y' => :'DpiY',
20
-
21
- #
22
- :'compression' => :'Compression',
23
-
24
- #
25
- :'export_format' => :'ExportFormat'
26
-
98
+ :'show_hidden_slides' => :'ShowHiddenSlides',
99
+ :'pixel_format' => :'PixelFormat',
100
+ :'notes_position' => :'NotesPosition',
101
+ :'comments_position' => :'CommentsPosition',
102
+ :'comments_area_width' => :'CommentsAreaWidth',
103
+ :'comments_area_color' => :'CommentsAreaColor',
104
+ :'show_comments_by_no_author' => :'ShowCommentsByNoAuthor'
27
105
  }
28
106
  end
29
107
 
30
- # attribute type
108
+ # Attribute type mapping.
31
109
  def self.swagger_types
32
110
  {
111
+ :'format' => :'String',
112
+ :'compression' => :'String',
33
113
  :'width' => :'Integer',
34
114
  :'height' => :'Integer',
35
115
  :'dpi_x' => :'Integer',
36
116
  :'dpi_y' => :'Integer',
37
- :'compression' => :'String',
38
- :'export_format' => :'String'
39
-
117
+ :'show_hidden_slides' => :'BOOLEAN',
118
+ :'pixel_format' => :'String',
119
+ :'notes_position' => :'String',
120
+ :'comments_position' => :'String',
121
+ :'comments_area_width' => :'Integer',
122
+ :'comments_area_color' => :'String',
123
+ :'show_comments_by_no_author' => :'BOOLEAN'
40
124
  }
41
125
  end
42
126
 
127
+ # Initializes the object
128
+ # @param [Hash] attributes Model attributes in the form of hash
43
129
  def initialize(attributes = {})
44
- return if !attributes.is_a?(Hash) || attributes.empty?
130
+ return unless attributes.is_a?(Hash)
45
131
 
46
132
  # convert string to symbol for hash key
47
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
133
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
134
+
135
+ if attributes.has_key?(:'Format')
136
+ self.format = attributes[:'Format']
137
+ else
138
+ self.format = "tiff"
139
+ end
140
+
141
+ if attributes.has_key?(:'Compression')
142
+ self.compression = attributes[:'Compression']
143
+ end
48
144
 
49
-
50
- if attributes[:'Width']
145
+ if attributes.has_key?(:'Width')
51
146
  self.width = attributes[:'Width']
52
147
  end
53
-
54
- if attributes[:'Height']
148
+
149
+ if attributes.has_key?(:'Height')
55
150
  self.height = attributes[:'Height']
56
151
  end
57
-
58
- if attributes[:'DpiX']
152
+
153
+ if attributes.has_key?(:'DpiX')
59
154
  self.dpi_x = attributes[:'DpiX']
60
155
  end
61
-
62
- if attributes[:'DpiY']
156
+
157
+ if attributes.has_key?(:'DpiY')
63
158
  self.dpi_y = attributes[:'DpiY']
64
159
  end
65
-
66
- if attributes[:'Compression']
67
- self.compression = attributes[:'Compression']
160
+
161
+ if attributes.has_key?(:'ShowHiddenSlides')
162
+ self.show_hidden_slides = attributes[:'ShowHiddenSlides']
68
163
  end
69
-
70
- if attributes[:'ExportFormat']
71
- self.export_format = attributes[:'ExportFormat']
164
+
165
+ if attributes.has_key?(:'PixelFormat')
166
+ self.pixel_format = attributes[:'PixelFormat']
167
+ end
168
+
169
+ if attributes.has_key?(:'NotesPosition')
170
+ self.notes_position = attributes[:'NotesPosition']
171
+ end
172
+
173
+ if attributes.has_key?(:'CommentsPosition')
174
+ self.comments_position = attributes[:'CommentsPosition']
175
+ end
176
+
177
+ if attributes.has_key?(:'CommentsAreaWidth')
178
+ self.comments_area_width = attributes[:'CommentsAreaWidth']
179
+ end
180
+
181
+ if attributes.has_key?(:'CommentsAreaColor')
182
+ self.comments_area_color = attributes[:'CommentsAreaColor']
183
+ end
184
+
185
+ if attributes.has_key?(:'ShowCommentsByNoAuthor')
186
+ self.show_comments_by_no_author = attributes[:'ShowCommentsByNoAuthor']
72
187
  end
73
-
74
188
  end
75
189
 
190
+ # Show invalid properties with the reasons. Usually used together with valid?
191
+ # @return Array for valid properties with the reasons
192
+ def list_invalid_properties
193
+ invalid_properties = Array.new
194
+ if @compression.nil?
195
+ invalid_properties.push('invalid value for "compression", compression cannot be nil.')
196
+ end
197
+
198
+ if @show_hidden_slides.nil?
199
+ invalid_properties.push('invalid value for "show_hidden_slides", show_hidden_slides cannot be nil.')
200
+ end
201
+
202
+ if @pixel_format.nil?
203
+ invalid_properties.push('invalid value for "pixel_format", pixel_format cannot be nil.')
204
+ end
205
+
206
+ if @notes_position.nil?
207
+ invalid_properties.push('invalid value for "notes_position", notes_position cannot be nil.')
208
+ end
209
+
210
+ if @comments_position.nil?
211
+ invalid_properties.push('invalid value for "comments_position", comments_position cannot be nil.')
212
+ end
213
+
214
+ if @comments_area_width.nil?
215
+ invalid_properties.push('invalid value for "comments_area_width", comments_area_width cannot be nil.')
216
+ end
217
+
218
+ if @show_comments_by_no_author.nil?
219
+ invalid_properties.push('invalid value for "show_comments_by_no_author", show_comments_by_no_author cannot be nil.')
220
+ end
221
+
222
+ invalid_properties
223
+ end
224
+
225
+ # Check to see if the all the properties in the model are valid
226
+ # @return true if the model is valid
227
+ def valid?
228
+ return false if @compression.nil?
229
+ compression_validator = EnumAttributeValidator.new('String', ['Default', 'None', 'CCITT3', 'CCITT4', 'LZW', 'RLE'])
230
+ return false unless compression_validator.valid?(@compression)
231
+ return false if @show_hidden_slides.nil?
232
+ return false if @pixel_format.nil?
233
+ pixel_format_validator = EnumAttributeValidator.new('String', ['Format1bppIndexed', 'Format4bppIndexed', 'Format8bppIndexed', 'Format24bppRgb', 'Format32bppArgb'])
234
+ return false unless pixel_format_validator.valid?(@pixel_format)
235
+ return false if @notes_position.nil?
236
+ notes_position_validator = EnumAttributeValidator.new('String', ['None', 'BottomFull', 'BottomTruncated'])
237
+ return false unless notes_position_validator.valid?(@notes_position)
238
+ return false if @comments_position.nil?
239
+ comments_position_validator = EnumAttributeValidator.new('String', ['None', 'Bottom', 'Right'])
240
+ return false unless comments_position_validator.valid?(@comments_position)
241
+ return false if @comments_area_width.nil?
242
+ return false if @show_comments_by_no_author.nil?
243
+ true
244
+ end
245
+
246
+ # Custom attribute writer method checking allowed values (enum).
247
+ # @param [Object] compression Object to be assigned
248
+ def compression=(compression)
249
+ validator = EnumAttributeValidator.new('String', ['Default', 'None', 'CCITT3', 'CCITT4', 'LZW', 'RLE'])
250
+ unless validator.valid?(compression)
251
+ fail ArgumentError, 'invalid value for "compression", must be one of #{validator.allowable_values}.'
252
+ end
253
+ @compression = compression
254
+ end
255
+
256
+ # Custom attribute writer method checking allowed values (enum).
257
+ # @param [Object] pixel_format Object to be assigned
258
+ def pixel_format=(pixel_format)
259
+ validator = EnumAttributeValidator.new('String', ['Format1bppIndexed', 'Format4bppIndexed', 'Format8bppIndexed', 'Format24bppRgb', 'Format32bppArgb'])
260
+ unless validator.valid?(pixel_format)
261
+ fail ArgumentError, 'invalid value for "pixel_format", must be one of #{validator.allowable_values}.'
262
+ end
263
+ @pixel_format = pixel_format
264
+ end
265
+
266
+ # Custom attribute writer method checking allowed values (enum).
267
+ # @param [Object] notes_position Object to be assigned
268
+ def notes_position=(notes_position)
269
+ validator = EnumAttributeValidator.new('String', ['None', 'BottomFull', 'BottomTruncated'])
270
+ unless validator.valid?(notes_position)
271
+ fail ArgumentError, 'invalid value for "notes_position", must be one of #{validator.allowable_values}.'
272
+ end
273
+ @notes_position = notes_position
274
+ end
275
+
276
+ # Custom attribute writer method checking allowed values (enum).
277
+ # @param [Object] comments_position Object to be assigned
278
+ def comments_position=(comments_position)
279
+ validator = EnumAttributeValidator.new('String', ['None', 'Bottom', 'Right'])
280
+ unless validator.valid?(comments_position)
281
+ fail ArgumentError, 'invalid value for "comments_position", must be one of #{validator.allowable_values}.'
282
+ end
283
+ @comments_position = comments_position
284
+ end
285
+
286
+ # Checks equality by comparing each attribute.
287
+ # @param [Object] Object to be compared
288
+ def ==(o)
289
+ return true if self.equal?(o)
290
+ self.class == o.class &&
291
+ format == o.format &&
292
+ compression == o.compression &&
293
+ width == o.width &&
294
+ height == o.height &&
295
+ dpi_x == o.dpi_x &&
296
+ dpi_y == o.dpi_y &&
297
+ show_hidden_slides == o.show_hidden_slides &&
298
+ pixel_format == o.pixel_format &&
299
+ notes_position == o.notes_position &&
300
+ comments_position == o.comments_position &&
301
+ comments_area_width == o.comments_area_width &&
302
+ comments_area_color == o.comments_area_color &&
303
+ show_comments_by_no_author == o.show_comments_by_no_author
304
+ end
305
+
306
+ # @see the `==` method
307
+ # @param [Object] Object to be compared
308
+ def eql?(o)
309
+ self == o
310
+ end
311
+
312
+ # Calculates hash code according to all attributes.
313
+ # @return [Fixnum] Hash code
314
+ def hash
315
+ [format, compression, width, height, dpi_x, dpi_y, show_hidden_slides, pixel_format, notes_position, comments_position, comments_area_width, comments_area_color, show_comments_by_no_author].hash
316
+ end
317
+
318
+ # Builds the object from hash
319
+ # @param [Hash] attributes Model attributes in the form of hash
320
+ # @return [Object] Returns the model itself
321
+ def build_from_hash(attributes)
322
+ return nil unless attributes.is_a?(Hash)
323
+ self.class.swagger_types.each_pair do |key, type|
324
+ if type =~ /\AArray<(.*)>/i
325
+ # check to ensure the input is an array given that the the attribute
326
+ # is documented as an array but the input is not
327
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
328
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
329
+ end
330
+ elsif !attributes[self.class.attribute_map[key]].nil?
331
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
332
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
333
+ end
334
+
335
+ self
336
+ end
337
+
338
+ # Deserializes the data based on type
339
+ # @param string type Data type
340
+ # @param string value Value to be deserialized
341
+ # @return [Object] Deserialized data
342
+ def _deserialize(type, value)
343
+ case type.to_sym
344
+ when :DateTime
345
+ DateTime.parse(value)
346
+ when :Date
347
+ Date.parse(value)
348
+ when :String
349
+ value.to_s
350
+ when :Integer
351
+ value.to_i
352
+ when :Float
353
+ value.to_f
354
+ when :BOOLEAN
355
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
356
+ true
357
+ else
358
+ false
359
+ end
360
+ when :Object
361
+ # generic object (usually a Hash), return directly
362
+ value
363
+ when /\AArray<(?<inner_type>.+)>\z/
364
+ inner_type = Regexp.last_match[:inner_type]
365
+ value.map { |v| _deserialize(inner_type, v) }
366
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
367
+ k_type = Regexp.last_match[:k_type]
368
+ v_type = Regexp.last_match[:v_type]
369
+ {}.tap do |hash|
370
+ value.each do |k, v|
371
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
372
+ end
373
+ end
374
+ else # model
375
+ temp_model = AsposeSlidesCloud.const_get(type).new
376
+ temp_model.build_from_hash(value)
377
+ end
378
+ end
379
+
380
+ # Returns the string representation of the object
381
+ # @return [String] String presentation of the object
382
+ def to_s
383
+ to_hash.to_s
384
+ end
385
+
386
+ # to_body is an alias to to_hash (backward compatibility)
387
+ # @return [Hash] Returns the object in the form of hash
388
+ def to_body
389
+ to_hash
390
+ end
391
+
392
+ # Returns the object in the form of hash
393
+ # @return [Hash] Returns the object in the form of hash
394
+ def to_hash
395
+ hash = {}
396
+ self.class.attribute_map.each_pair do |attr, param|
397
+ value = self.send(attr)
398
+ next if value.nil?
399
+ hash[param] = _to_hash(value)
400
+ end
401
+ hash
402
+ end
403
+
404
+ # Outputs non-array value in the form of hash
405
+ # For object, use to_hash. Otherwise, just return the value
406
+ # @param [Object] value Any valid value
407
+ # @return [Hash] Returns the value in the form of hash
408
+ def _to_hash(value)
409
+ if value.is_a?(Array)
410
+ value.compact.map { |v| _to_hash(v) }
411
+ elsif value.is_a?(Hash)
412
+ {}.tap do |hash|
413
+ value.each { |k, v| hash[k] = _to_hash(v) }
414
+ end
415
+ elsif value.respond_to? :to_hash
416
+ value.to_hash
417
+ else
418
+ value
419
+ end
420
+ end
76
421
  end
77
422
  end