groupdocs_conversion_cloud 19.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (178) hide show
  1. checksums.yaml +7 -0
  2. data/lib/groupdocs_conversion_cloud.rb +205 -0
  3. data/lib/groupdocs_conversion_cloud/api/conversion_api.rb +336 -0
  4. data/lib/groupdocs_conversion_cloud/api/file_api.rb +729 -0
  5. data/lib/groupdocs_conversion_cloud/api/folder_api.rb +694 -0
  6. data/lib/groupdocs_conversion_cloud/api/storage_api.rb +541 -0
  7. data/lib/groupdocs_conversion_cloud/api_client.rb +380 -0
  8. data/lib/groupdocs_conversion_cloud/api_error.rb +58 -0
  9. data/lib/groupdocs_conversion_cloud/configuration.rb +95 -0
  10. data/lib/groupdocs_conversion_cloud/models/bmp_convert_options.rb +361 -0
  11. data/lib/groupdocs_conversion_cloud/models/bmp_load_options.rb +214 -0
  12. data/lib/groupdocs_conversion_cloud/models/cad_load_options.rb +246 -0
  13. data/lib/groupdocs_conversion_cloud/models/cgm_convert_options.rb +361 -0
  14. data/lib/groupdocs_conversion_cloud/models/convert_options.rb +246 -0
  15. data/lib/groupdocs_conversion_cloud/models/convert_settings.rb +312 -0
  16. data/lib/groupdocs_conversion_cloud/models/csv_load_options.rb +279 -0
  17. data/lib/groupdocs_conversion_cloud/models/dcm_convert_options.rb +361 -0
  18. data/lib/groupdocs_conversion_cloud/models/dcm_load_options.rb +214 -0
  19. data/lib/groupdocs_conversion_cloud/models/dgn_load_options.rb +246 -0
  20. data/lib/groupdocs_conversion_cloud/models/diagram_load_options.rb +214 -0
  21. data/lib/groupdocs_conversion_cloud/models/disc_usage.rb +234 -0
  22. data/lib/groupdocs_conversion_cloud/models/djvu_convert_options.rb +361 -0
  23. data/lib/groupdocs_conversion_cloud/models/dng_convert_options.rb +361 -0
  24. data/lib/groupdocs_conversion_cloud/models/dng_load_options.rb +214 -0
  25. data/lib/groupdocs_conversion_cloud/models/doc_convert_options.rb +326 -0
  26. data/lib/groupdocs_conversion_cloud/models/doc_load_options.rb +281 -0
  27. data/lib/groupdocs_conversion_cloud/models/docm_convert_options.rb +326 -0
  28. data/lib/groupdocs_conversion_cloud/models/docm_load_options.rb +281 -0
  29. data/lib/groupdocs_conversion_cloud/models/docx_convert_options.rb +326 -0
  30. data/lib/groupdocs_conversion_cloud/models/docx_load_options.rb +281 -0
  31. data/lib/groupdocs_conversion_cloud/models/dot_convert_options.rb +326 -0
  32. data/lib/groupdocs_conversion_cloud/models/dot_load_options.rb +281 -0
  33. data/lib/groupdocs_conversion_cloud/models/dotm_convert_options.rb +326 -0
  34. data/lib/groupdocs_conversion_cloud/models/dotm_load_options.rb +281 -0
  35. data/lib/groupdocs_conversion_cloud/models/dotx_convert_options.rb +326 -0
  36. data/lib/groupdocs_conversion_cloud/models/dotx_load_options.rb +281 -0
  37. data/lib/groupdocs_conversion_cloud/models/dwf_load_options.rb +246 -0
  38. data/lib/groupdocs_conversion_cloud/models/dwg_load_options.rb +246 -0
  39. data/lib/groupdocs_conversion_cloud/models/dxf_load_options.rb +246 -0
  40. data/lib/groupdocs_conversion_cloud/models/email_load_options.rb +294 -0
  41. data/lib/groupdocs_conversion_cloud/models/emf_convert_options.rb +361 -0
  42. data/lib/groupdocs_conversion_cloud/models/emf_load_options.rb +214 -0
  43. data/lib/groupdocs_conversion_cloud/models/eml_load_options.rb +294 -0
  44. data/lib/groupdocs_conversion_cloud/models/emlx_load_options.rb +294 -0
  45. data/lib/groupdocs_conversion_cloud/models/epub_convert_options.rb +386 -0
  46. data/lib/groupdocs_conversion_cloud/models/error.rb +244 -0
  47. data/lib/groupdocs_conversion_cloud/models/error_details.rb +229 -0
  48. data/lib/groupdocs_conversion_cloud/models/file_version.rb +289 -0
  49. data/lib/groupdocs_conversion_cloud/models/file_versions.rb +216 -0
  50. data/lib/groupdocs_conversion_cloud/models/files_list.rb +216 -0
  51. data/lib/groupdocs_conversion_cloud/models/files_upload_result.rb +228 -0
  52. data/lib/groupdocs_conversion_cloud/models/gif_convert_options.rb +361 -0
  53. data/lib/groupdocs_conversion_cloud/models/gif_load_options.rb +214 -0
  54. data/lib/groupdocs_conversion_cloud/models/html_convert_options.rb +301 -0
  55. data/lib/groupdocs_conversion_cloud/models/ico_convert_options.rb +361 -0
  56. data/lib/groupdocs_conversion_cloud/models/ico_load_options.rb +214 -0
  57. data/lib/groupdocs_conversion_cloud/models/ifc_load_options.rb +246 -0
  58. data/lib/groupdocs_conversion_cloud/models/igs_load_options.rb +246 -0
  59. data/lib/groupdocs_conversion_cloud/models/image_convert_options.rb +361 -0
  60. data/lib/groupdocs_conversion_cloud/models/image_load_options.rb +214 -0
  61. data/lib/groupdocs_conversion_cloud/models/j2c_convert_options.rb +376 -0
  62. data/lib/groupdocs_conversion_cloud/models/j2c_load_options.rb +214 -0
  63. data/lib/groupdocs_conversion_cloud/models/j2k_convert_options.rb +376 -0
  64. data/lib/groupdocs_conversion_cloud/models/j2k_load_options.rb +214 -0
  65. data/lib/groupdocs_conversion_cloud/models/jp2_convert_options.rb +376 -0
  66. data/lib/groupdocs_conversion_cloud/models/jp2_load_options.rb +214 -0
  67. data/lib/groupdocs_conversion_cloud/models/jpeg_convert_options.rb +376 -0
  68. data/lib/groupdocs_conversion_cloud/models/jpeg_load_options.rb +214 -0
  69. data/lib/groupdocs_conversion_cloud/models/jpf_convert_options.rb +376 -0
  70. data/lib/groupdocs_conversion_cloud/models/jpf_load_options.rb +214 -0
  71. data/lib/groupdocs_conversion_cloud/models/jpg_convert_options.rb +376 -0
  72. data/lib/groupdocs_conversion_cloud/models/jpg_load_options.rb +214 -0
  73. data/lib/groupdocs_conversion_cloud/models/jpm_convert_options.rb +376 -0
  74. data/lib/groupdocs_conversion_cloud/models/jpm_load_options.rb +214 -0
  75. data/lib/groupdocs_conversion_cloud/models/jpx_convert_options.rb +376 -0
  76. data/lib/groupdocs_conversion_cloud/models/jpx_load_options.rb +214 -0
  77. data/lib/groupdocs_conversion_cloud/models/load_options.rb +204 -0
  78. data/lib/groupdocs_conversion_cloud/models/mht_load_options.rb +294 -0
  79. data/lib/groupdocs_conversion_cloud/models/mobi_load_options.rb +281 -0
  80. data/lib/groupdocs_conversion_cloud/models/msg_load_options.rb +294 -0
  81. data/lib/groupdocs_conversion_cloud/models/object_exist.rb +234 -0
  82. data/lib/groupdocs_conversion_cloud/models/odg_convert_options.rb +361 -0
  83. data/lib/groupdocs_conversion_cloud/models/odg_load_options.rb +214 -0
  84. data/lib/groupdocs_conversion_cloud/models/odp_convert_options.rb +281 -0
  85. data/lib/groupdocs_conversion_cloud/models/odp_load_options.rb +266 -0
  86. data/lib/groupdocs_conversion_cloud/models/ods_convert_options.rb +296 -0
  87. data/lib/groupdocs_conversion_cloud/models/ods_load_options.rb +321 -0
  88. data/lib/groupdocs_conversion_cloud/models/odt_convert_options.rb +326 -0
  89. data/lib/groupdocs_conversion_cloud/models/odt_load_options.rb +281 -0
  90. data/lib/groupdocs_conversion_cloud/models/one_load_options.rb +236 -0
  91. data/lib/groupdocs_conversion_cloud/models/ost_load_options.rb +294 -0
  92. data/lib/groupdocs_conversion_cloud/models/otp_convert_options.rb +281 -0
  93. data/lib/groupdocs_conversion_cloud/models/otp_load_options.rb +266 -0
  94. data/lib/groupdocs_conversion_cloud/models/ots_convert_options.rb +296 -0
  95. data/lib/groupdocs_conversion_cloud/models/ots_load_options.rb +321 -0
  96. data/lib/groupdocs_conversion_cloud/models/ott_convert_options.rb +326 -0
  97. data/lib/groupdocs_conversion_cloud/models/ott_load_options.rb +281 -0
  98. data/lib/groupdocs_conversion_cloud/models/pdf_convert_options.rb +863 -0
  99. data/lib/groupdocs_conversion_cloud/models/pdf_load_options.rb +259 -0
  100. data/lib/groupdocs_conversion_cloud/models/plt_load_options.rb +246 -0
  101. data/lib/groupdocs_conversion_cloud/models/png_convert_options.rb +361 -0
  102. data/lib/groupdocs_conversion_cloud/models/png_load_options.rb +214 -0
  103. data/lib/groupdocs_conversion_cloud/models/potm_convert_options.rb +281 -0
  104. data/lib/groupdocs_conversion_cloud/models/potm_load_options.rb +266 -0
  105. data/lib/groupdocs_conversion_cloud/models/potx_convert_options.rb +281 -0
  106. data/lib/groupdocs_conversion_cloud/models/potx_load_options.rb +266 -0
  107. data/lib/groupdocs_conversion_cloud/models/pps_convert_options.rb +281 -0
  108. data/lib/groupdocs_conversion_cloud/models/pps_load_options.rb +266 -0
  109. data/lib/groupdocs_conversion_cloud/models/ppsm_convert_options.rb +281 -0
  110. data/lib/groupdocs_conversion_cloud/models/ppsm_load_options.rb +266 -0
  111. data/lib/groupdocs_conversion_cloud/models/ppsx_convert_options.rb +281 -0
  112. data/lib/groupdocs_conversion_cloud/models/ppsx_load_options.rb +266 -0
  113. data/lib/groupdocs_conversion_cloud/models/ppt_convert_options.rb +281 -0
  114. data/lib/groupdocs_conversion_cloud/models/ppt_load_options.rb +266 -0
  115. data/lib/groupdocs_conversion_cloud/models/pptm_convert_options.rb +281 -0
  116. data/lib/groupdocs_conversion_cloud/models/pptm_load_options.rb +266 -0
  117. data/lib/groupdocs_conversion_cloud/models/pptx_convert_options.rb +281 -0
  118. data/lib/groupdocs_conversion_cloud/models/pptx_load_options.rb +266 -0
  119. data/lib/groupdocs_conversion_cloud/models/presentation_convert_options.rb +281 -0
  120. data/lib/groupdocs_conversion_cloud/models/presentation_load_options.rb +266 -0
  121. data/lib/groupdocs_conversion_cloud/models/psd_convert_options.rb +489 -0
  122. data/lib/groupdocs_conversion_cloud/models/psd_load_options.rb +214 -0
  123. data/lib/groupdocs_conversion_cloud/models/pst_load_options.rb +294 -0
  124. data/lib/groupdocs_conversion_cloud/models/rtf_convert_options.rb +341 -0
  125. data/lib/groupdocs_conversion_cloud/models/spreadsheet_convert_options.rb +296 -0
  126. data/lib/groupdocs_conversion_cloud/models/spreadsheet_load_options.rb +321 -0
  127. data/lib/groupdocs_conversion_cloud/models/stl_load_options.rb +246 -0
  128. data/lib/groupdocs_conversion_cloud/models/storage_exist.rb +219 -0
  129. data/lib/groupdocs_conversion_cloud/models/storage_file.rb +264 -0
  130. data/lib/groupdocs_conversion_cloud/models/stored_converted_result.rb +249 -0
  131. data/lib/groupdocs_conversion_cloud/models/supported_format.rb +226 -0
  132. data/lib/groupdocs_conversion_cloud/models/svg_convert_options.rb +331 -0
  133. data/lib/groupdocs_conversion_cloud/models/tif_convert_options.rb +408 -0
  134. data/lib/groupdocs_conversion_cloud/models/tif_load_options.rb +214 -0
  135. data/lib/groupdocs_conversion_cloud/models/tiff_convert_options.rb +408 -0
  136. data/lib/groupdocs_conversion_cloud/models/tiff_load_options.rb +214 -0
  137. data/lib/groupdocs_conversion_cloud/models/tsv_convert_options.rb +296 -0
  138. data/lib/groupdocs_conversion_cloud/models/tsv_load_options.rb +321 -0
  139. data/lib/groupdocs_conversion_cloud/models/txt_convert_options.rb +246 -0
  140. data/lib/groupdocs_conversion_cloud/models/txt_load_options.rb +302 -0
  141. data/lib/groupdocs_conversion_cloud/models/vdw_load_options.rb +214 -0
  142. data/lib/groupdocs_conversion_cloud/models/vdx_load_options.rb +214 -0
  143. data/lib/groupdocs_conversion_cloud/models/vsd_load_options.rb +214 -0
  144. data/lib/groupdocs_conversion_cloud/models/vsdm_load_options.rb +214 -0
  145. data/lib/groupdocs_conversion_cloud/models/vsdx_load_options.rb +214 -0
  146. data/lib/groupdocs_conversion_cloud/models/vss_load_options.rb +214 -0
  147. data/lib/groupdocs_conversion_cloud/models/vssm_load_options.rb +214 -0
  148. data/lib/groupdocs_conversion_cloud/models/vssx_load_options.rb +214 -0
  149. data/lib/groupdocs_conversion_cloud/models/vst_load_options.rb +214 -0
  150. data/lib/groupdocs_conversion_cloud/models/vstm_load_options.rb +214 -0
  151. data/lib/groupdocs_conversion_cloud/models/vstx_load_options.rb +214 -0
  152. data/lib/groupdocs_conversion_cloud/models/vsx_load_options.rb +214 -0
  153. data/lib/groupdocs_conversion_cloud/models/vtx_load_options.rb +214 -0
  154. data/lib/groupdocs_conversion_cloud/models/watermark_options.rb +364 -0
  155. data/lib/groupdocs_conversion_cloud/models/webp_convert_options.rb +376 -0
  156. data/lib/groupdocs_conversion_cloud/models/webp_load_options.rb +214 -0
  157. data/lib/groupdocs_conversion_cloud/models/wmf_convert_options.rb +361 -0
  158. data/lib/groupdocs_conversion_cloud/models/wmf_load_options.rb +214 -0
  159. data/lib/groupdocs_conversion_cloud/models/word_processing_convert_options.rb +326 -0
  160. data/lib/groupdocs_conversion_cloud/models/word_processing_load_options.rb +281 -0
  161. data/lib/groupdocs_conversion_cloud/models/xls2003_convert_options.rb +296 -0
  162. data/lib/groupdocs_conversion_cloud/models/xls2003_load_options.rb +321 -0
  163. data/lib/groupdocs_conversion_cloud/models/xls_convert_options.rb +296 -0
  164. data/lib/groupdocs_conversion_cloud/models/xls_load_options.rb +321 -0
  165. data/lib/groupdocs_conversion_cloud/models/xlsb_convert_options.rb +296 -0
  166. data/lib/groupdocs_conversion_cloud/models/xlsb_load_options.rb +321 -0
  167. data/lib/groupdocs_conversion_cloud/models/xlsm_convert_options.rb +296 -0
  168. data/lib/groupdocs_conversion_cloud/models/xlsm_load_options.rb +321 -0
  169. data/lib/groupdocs_conversion_cloud/models/xlsx_convert_options.rb +296 -0
  170. data/lib/groupdocs_conversion_cloud/models/xlsx_load_options.rb +321 -0
  171. data/lib/groupdocs_conversion_cloud/models/xltm_convert_options.rb +296 -0
  172. data/lib/groupdocs_conversion_cloud/models/xltm_load_options.rb +321 -0
  173. data/lib/groupdocs_conversion_cloud/models/xltx_convert_options.rb +296 -0
  174. data/lib/groupdocs_conversion_cloud/models/xltx_load_options.rb +321 -0
  175. data/lib/groupdocs_conversion_cloud/models/xml_load_options.rb +230 -0
  176. data/lib/groupdocs_conversion_cloud/models/xps_convert_options.rb +386 -0
  177. data/lib/groupdocs_conversion_cloud/version.rb +29 -0
  178. metadata +288 -0
@@ -0,0 +1,281 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="potx_convert_options.rb">
4
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsConversionCloud
31
+ # Potx convert options
32
+ class PotxConvertOptions
33
+
34
+ # Start conversion from FromPage page
35
+ attr_accessor :from_page
36
+
37
+ # Number of pages to convert
38
+ attr_accessor :pages_count
39
+
40
+ # Convert specific pages. The list contains the page indexes of the pages to be converted
41
+ attr_accessor :pages
42
+
43
+ # Set this property if you want to protect the converted document with a password
44
+ attr_accessor :password
45
+
46
+ # Specifies the zoom level in percentage. Default is 100. Default zoom is supported till Microsoft Powerpoint 2010. Starting from Microsoft Powerpoint 2013 default zoom is no longer set to document, instead it appears to use the zoom factor of the last document that was opened.
47
+ attr_accessor :zoom
48
+
49
+ # Watermark specific options
50
+ attr_accessor :watermark_options
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'from_page' => :'FromPage',
56
+ :'pages_count' => :'PagesCount',
57
+ :'pages' => :'Pages',
58
+ :'password' => :'Password',
59
+ :'zoom' => :'Zoom',
60
+ :'watermark_options' => :'WatermarkOptions'
61
+ }
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.swagger_types
66
+ {
67
+ :'from_page' => :'Integer',
68
+ :'pages_count' => :'Integer',
69
+ :'pages' => :'Array<Integer>',
70
+ :'password' => :'String',
71
+ :'zoom' => :'Integer',
72
+ :'watermark_options' => :'WatermarkOptions'
73
+ }
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ return unless attributes.is_a?(Hash)
80
+
81
+ # convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
83
+
84
+ if attributes.key?(:'FromPage')
85
+ self.from_page = attributes[:'FromPage']
86
+ end
87
+
88
+ if attributes.key?(:'PagesCount')
89
+ self.pages_count = attributes[:'PagesCount']
90
+ end
91
+
92
+ if attributes.key?(:'Pages')
93
+ if (value = attributes[:'Pages']).is_a?(Array)
94
+ self.pages = value
95
+ end
96
+ end
97
+
98
+ if attributes.key?(:'Password')
99
+ self.password = attributes[:'Password']
100
+ end
101
+
102
+ if attributes.key?(:'Zoom')
103
+ self.zoom = attributes[:'Zoom']
104
+ end
105
+
106
+ if attributes.key?(:'WatermarkOptions')
107
+ self.watermark_options = attributes[:'WatermarkOptions']
108
+ end
109
+
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properies with the reasons
114
+ def list_invalid_properties
115
+ invalid_properties = []
116
+ if @from_page.nil?
117
+ invalid_properties.push("invalid value for 'from_page', from_page cannot be nil.")
118
+ end
119
+
120
+ if @pages_count.nil?
121
+ invalid_properties.push("invalid value for 'pages_count', pages_count cannot be nil.")
122
+ end
123
+
124
+ if @zoom.nil?
125
+ invalid_properties.push("invalid value for 'zoom', zoom cannot be nil.")
126
+ end
127
+
128
+ return invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ return false if @from_page.nil?
135
+ return false if @pages_count.nil?
136
+ return false if @zoom.nil?
137
+ return true
138
+ end
139
+
140
+ # Checks equality by comparing each attribute.
141
+ # @param [Object] Object to be compared
142
+ def ==(other)
143
+ return true if self.equal?(other)
144
+ self.class == other.class &&
145
+ from_page == other.from_page &&
146
+ pages_count == other.pages_count &&
147
+ pages == other.pages &&
148
+ password == other.password &&
149
+ zoom == other.zoom &&
150
+ watermark_options == other.watermark_options
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(other)
156
+ self == other
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Fixnum] Hash code
161
+ def hash
162
+ [from_page, pages_count, pages, password, zoom, watermark_options].hash
163
+ end
164
+
165
+ # Downcases first letter.
166
+ # @return downcased string
167
+ def uncap(str)
168
+ str[0, 1].downcase + str[1..-1]
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+ self.class.swagger_types.each_pair do |key, type|
177
+ pname = uncap(self.class.attribute_map[key]).intern
178
+ value = attributes[pname]
179
+ if type =~ /\AArray<(.*)>/i
180
+ # check to ensure the input is an array given that the the attribute
181
+ # is documented as an array but the input is not
182
+ if value.is_a?(Array)
183
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
184
+ end
185
+ elsif !value.nil?
186
+ self.send("#{key}=", _deserialize(type, value))
187
+ end
188
+ # or else data not found in attributes(hash), not an issue as the data can be optional
189
+ end
190
+
191
+ self
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def _deserialize(type, value)
199
+ case type.to_sym
200
+ when :DateTime
201
+ Date.parse value
202
+ when :Date
203
+ Date.parse value
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :BOOLEAN
211
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else
231
+ # model
232
+ temp_model = GroupDocsConversionCloud.const_get(type).new
233
+ temp_model.build_from_hash(value)
234
+ end
235
+ end
236
+
237
+ # Returns the string representation of the object
238
+ # @return [String] String presentation of the object
239
+ def to_s
240
+ to_hash.to_s
241
+ end
242
+
243
+ # to_body is an alias to to_hash (backward compatibility)
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_body
246
+ to_hash
247
+ end
248
+
249
+ # Returns the object in the form of hash
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_hash
252
+ hash = {}
253
+ self.class.attribute_map.each_pair do |attr, param|
254
+ value = self.send(attr)
255
+ next if value.nil?
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.compact.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to? :to_hash
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+
279
+ end
280
+
281
+ end
@@ -0,0 +1,266 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="potx_load_options.rb">
4
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsConversionCloud
31
+ # Potx load options
32
+ class PotxLoadOptions
33
+
34
+ # Default font for rendering the presentation. The following font will be used if a presentation font is missing.
35
+ attr_accessor :default_font
36
+
37
+ # Substitute specific fonts when converting Slides document.
38
+ attr_accessor :font_substitutes
39
+
40
+ # Set password to unprotect protected document
41
+ attr_accessor :password
42
+
43
+ # Hide comments
44
+ attr_accessor :hide_comments
45
+
46
+ # Show hidden slides
47
+ attr_accessor :show_hidden_slides
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'default_font' => :'DefaultFont',
53
+ :'font_substitutes' => :'FontSubstitutes',
54
+ :'password' => :'Password',
55
+ :'hide_comments' => :'HideComments',
56
+ :'show_hidden_slides' => :'ShowHiddenSlides'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.swagger_types
62
+ {
63
+ :'default_font' => :'String',
64
+ :'font_substitutes' => :'Hash<String, String>',
65
+ :'password' => :'String',
66
+ :'hide_comments' => :'BOOLEAN',
67
+ :'show_hidden_slides' => :'BOOLEAN'
68
+ }
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ return unless attributes.is_a?(Hash)
75
+
76
+ # convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
78
+
79
+ if attributes.key?(:'DefaultFont')
80
+ self.default_font = attributes[:'DefaultFont']
81
+ end
82
+
83
+ if attributes.key?(:'FontSubstitutes')
84
+ if (value = attributes[:'FontSubstitutes']).is_a?(Hash)
85
+ self.font_substitutes = value
86
+ end
87
+ end
88
+
89
+ if attributes.key?(:'Password')
90
+ self.password = attributes[:'Password']
91
+ end
92
+
93
+ if attributes.key?(:'HideComments')
94
+ self.hide_comments = attributes[:'HideComments']
95
+ end
96
+
97
+ if attributes.key?(:'ShowHiddenSlides')
98
+ self.show_hidden_slides = attributes[:'ShowHiddenSlides']
99
+ end
100
+
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properies with the reasons
105
+ def list_invalid_properties
106
+ invalid_properties = []
107
+ if @hide_comments.nil?
108
+ invalid_properties.push("invalid value for 'hide_comments', hide_comments cannot be nil.")
109
+ end
110
+
111
+ if @show_hidden_slides.nil?
112
+ invalid_properties.push("invalid value for 'show_hidden_slides', show_hidden_slides cannot be nil.")
113
+ end
114
+
115
+ return invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ return false if @hide_comments.nil?
122
+ return false if @show_hidden_slides.nil?
123
+ return true
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(other)
129
+ return true if self.equal?(other)
130
+ self.class == other.class &&
131
+ default_font == other.default_font &&
132
+ font_substitutes == other.font_substitutes &&
133
+ password == other.password &&
134
+ hide_comments == other.hide_comments &&
135
+ show_hidden_slides == other.show_hidden_slides
136
+ end
137
+
138
+ # @see the `==` method
139
+ # @param [Object] Object to be compared
140
+ def eql?(other)
141
+ self == other
142
+ end
143
+
144
+ # Calculates hash code according to all attributes.
145
+ # @return [Fixnum] Hash code
146
+ def hash
147
+ [default_font, font_substitutes, password, hide_comments, show_hidden_slides].hash
148
+ end
149
+
150
+ # Downcases first letter.
151
+ # @return downcased string
152
+ def uncap(str)
153
+ str[0, 1].downcase + str[1..-1]
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ self.class.swagger_types.each_pair do |key, type|
162
+ pname = uncap(self.class.attribute_map[key]).intern
163
+ value = attributes[pname]
164
+ if type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the the attribute
166
+ # is documented as an array but the input is not
167
+ if value.is_a?(Array)
168
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
169
+ end
170
+ elsif !value.nil?
171
+ self.send("#{key}=", _deserialize(type, value))
172
+ end
173
+ # or else data not found in attributes(hash), not an issue as the data can be optional
174
+ end
175
+
176
+ self
177
+ end
178
+
179
+ # Deserializes the data based on type
180
+ # @param string type Data type
181
+ # @param string value Value to be deserialized
182
+ # @return [Object] Deserialized data
183
+ def _deserialize(type, value)
184
+ case type.to_sym
185
+ when :DateTime
186
+ Date.parse value
187
+ when :Date
188
+ Date.parse value
189
+ when :String
190
+ value.to_s
191
+ when :Integer
192
+ value.to_i
193
+ when :Float
194
+ value.to_f
195
+ when :BOOLEAN
196
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
197
+ true
198
+ else
199
+ false
200
+ end
201
+ when :Object
202
+ # generic object (usually a Hash), return directly
203
+ value
204
+ when /\AArray<(?<inner_type>.+)>\z/
205
+ inner_type = Regexp.last_match[:inner_type]
206
+ value.map { |v| _deserialize(inner_type, v) }
207
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
208
+ k_type = Regexp.last_match[:k_type]
209
+ v_type = Regexp.last_match[:v_type]
210
+ {}.tap do |hash|
211
+ value.each do |k, v|
212
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
213
+ end
214
+ end
215
+ else
216
+ # model
217
+ temp_model = GroupDocsConversionCloud.const_get(type).new
218
+ temp_model.build_from_hash(value)
219
+ end
220
+ end
221
+
222
+ # Returns the string representation of the object
223
+ # @return [String] String presentation of the object
224
+ def to_s
225
+ to_hash.to_s
226
+ end
227
+
228
+ # to_body is an alias to to_hash (backward compatibility)
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_body
231
+ to_hash
232
+ end
233
+
234
+ # Returns the object in the form of hash
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_hash
237
+ hash = {}
238
+ self.class.attribute_map.each_pair do |attr, param|
239
+ value = self.send(attr)
240
+ next if value.nil?
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ # Outputs non-array value in the form of hash
247
+ # For object, use to_hash. Otherwise, just return the value
248
+ # @param [Object] value Any valid value
249
+ # @return [Hash] Returns the value in the form of hash
250
+ def _to_hash(value)
251
+ if value.is_a?(Array)
252
+ value.compact.map { |v| _to_hash(v) }
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.each { |k, v| hash[k] = _to_hash(v) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash
259
+ else
260
+ value
261
+ end
262
+ end
263
+
264
+ end
265
+
266
+ end