groupdocs_conversion_cloud 25.8 → 25.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_conversion_cloud/version.rb +1 -1
  3. data/lib/groupdocs_conversion_cloud.rb +0 -79
  4. metadata +2 -81
  5. data/lib/groupdocs_conversion_cloud/models/bmp_load_options.rb +0 -224
  6. data/lib/groupdocs_conversion_cloud/models/cf2_load_options.rb +0 -298
  7. data/lib/groupdocs_conversion_cloud/models/dcm_load_options.rb +0 -224
  8. data/lib/groupdocs_conversion_cloud/models/dgn_load_options.rb +0 -298
  9. data/lib/groupdocs_conversion_cloud/models/dng_load_options.rb +0 -224
  10. data/lib/groupdocs_conversion_cloud/models/doc_load_options.rb +0 -658
  11. data/lib/groupdocs_conversion_cloud/models/docm_load_options.rb +0 -658
  12. data/lib/groupdocs_conversion_cloud/models/docx_load_options.rb +0 -658
  13. data/lib/groupdocs_conversion_cloud/models/dot_load_options.rb +0 -658
  14. data/lib/groupdocs_conversion_cloud/models/dotm_load_options.rb +0 -658
  15. data/lib/groupdocs_conversion_cloud/models/dotx_load_options.rb +0 -658
  16. data/lib/groupdocs_conversion_cloud/models/dwf_load_options.rb +0 -298
  17. data/lib/groupdocs_conversion_cloud/models/dwfx_load_options.rb +0 -298
  18. data/lib/groupdocs_conversion_cloud/models/dwg_load_options.rb +0 -298
  19. data/lib/groupdocs_conversion_cloud/models/dwt_load_options.rb +0 -298
  20. data/lib/groupdocs_conversion_cloud/models/dxf_load_options.rb +0 -298
  21. data/lib/groupdocs_conversion_cloud/models/emf_load_options.rb +0 -224
  22. data/lib/groupdocs_conversion_cloud/models/eml_load_options.rb +0 -406
  23. data/lib/groupdocs_conversion_cloud/models/emlx_load_options.rb +0 -406
  24. data/lib/groupdocs_conversion_cloud/models/gif_load_options.rb +0 -224
  25. data/lib/groupdocs_conversion_cloud/models/ico_load_options.rb +0 -224
  26. data/lib/groupdocs_conversion_cloud/models/ifc_load_options.rb +0 -298
  27. data/lib/groupdocs_conversion_cloud/models/igs_load_options.rb +0 -298
  28. data/lib/groupdocs_conversion_cloud/models/j2c_load_options.rb +0 -224
  29. data/lib/groupdocs_conversion_cloud/models/j2k_load_options.rb +0 -224
  30. data/lib/groupdocs_conversion_cloud/models/jp2_load_options.rb +0 -224
  31. data/lib/groupdocs_conversion_cloud/models/jpeg_load_options.rb +0 -224
  32. data/lib/groupdocs_conversion_cloud/models/jpf_load_options.rb +0 -224
  33. data/lib/groupdocs_conversion_cloud/models/jpg_load_options.rb +0 -224
  34. data/lib/groupdocs_conversion_cloud/models/jpm_load_options.rb +0 -224
  35. data/lib/groupdocs_conversion_cloud/models/jpx_load_options.rb +0 -224
  36. data/lib/groupdocs_conversion_cloud/models/mht_load_options.rb +0 -406
  37. data/lib/groupdocs_conversion_cloud/models/mobi_load_options.rb +0 -658
  38. data/lib/groupdocs_conversion_cloud/models/msg_load_options.rb +0 -406
  39. data/lib/groupdocs_conversion_cloud/models/odg_load_options.rb +0 -224
  40. data/lib/groupdocs_conversion_cloud/models/odp_load_options.rb +0 -434
  41. data/lib/groupdocs_conversion_cloud/models/ods_load_options.rb +0 -537
  42. data/lib/groupdocs_conversion_cloud/models/odt_load_options.rb +0 -658
  43. data/lib/groupdocs_conversion_cloud/models/ost_load_options.rb +0 -406
  44. data/lib/groupdocs_conversion_cloud/models/otp_load_options.rb +0 -434
  45. data/lib/groupdocs_conversion_cloud/models/ots_load_options.rb +0 -537
  46. data/lib/groupdocs_conversion_cloud/models/ott_load_options.rb +0 -658
  47. data/lib/groupdocs_conversion_cloud/models/plt_load_options.rb +0 -298
  48. data/lib/groupdocs_conversion_cloud/models/png_load_options.rb +0 -224
  49. data/lib/groupdocs_conversion_cloud/models/potm_load_options.rb +0 -434
  50. data/lib/groupdocs_conversion_cloud/models/potx_load_options.rb +0 -434
  51. data/lib/groupdocs_conversion_cloud/models/pps_load_options.rb +0 -434
  52. data/lib/groupdocs_conversion_cloud/models/ppsm_load_options.rb +0 -434
  53. data/lib/groupdocs_conversion_cloud/models/ppsx_load_options.rb +0 -434
  54. data/lib/groupdocs_conversion_cloud/models/ppt_load_options.rb +0 -434
  55. data/lib/groupdocs_conversion_cloud/models/pptm_load_options.rb +0 -434
  56. data/lib/groupdocs_conversion_cloud/models/pptx_load_options.rb +0 -434
  57. data/lib/groupdocs_conversion_cloud/models/psd_load_options.rb +0 -224
  58. data/lib/groupdocs_conversion_cloud/models/pst_load_options.rb +0 -406
  59. data/lib/groupdocs_conversion_cloud/models/stl_load_options.rb +0 -298
  60. data/lib/groupdocs_conversion_cloud/models/tif_load_options.rb +0 -224
  61. data/lib/groupdocs_conversion_cloud/models/tiff_load_options.rb +0 -224
  62. data/lib/groupdocs_conversion_cloud/models/vdw_load_options.rb +0 -224
  63. data/lib/groupdocs_conversion_cloud/models/vdx_load_options.rb +0 -224
  64. data/lib/groupdocs_conversion_cloud/models/vsd_load_options.rb +0 -224
  65. data/lib/groupdocs_conversion_cloud/models/vsdm_load_options.rb +0 -224
  66. data/lib/groupdocs_conversion_cloud/models/vsdx_load_options.rb +0 -224
  67. data/lib/groupdocs_conversion_cloud/models/vss_load_options.rb +0 -224
  68. data/lib/groupdocs_conversion_cloud/models/vssm_load_options.rb +0 -224
  69. data/lib/groupdocs_conversion_cloud/models/vssx_load_options.rb +0 -224
  70. data/lib/groupdocs_conversion_cloud/models/vst_load_options.rb +0 -224
  71. data/lib/groupdocs_conversion_cloud/models/vstm_load_options.rb +0 -224
  72. data/lib/groupdocs_conversion_cloud/models/vstx_load_options.rb +0 -224
  73. data/lib/groupdocs_conversion_cloud/models/vsx_load_options.rb +0 -224
  74. data/lib/groupdocs_conversion_cloud/models/vtx_load_options.rb +0 -224
  75. data/lib/groupdocs_conversion_cloud/models/webp_load_options.rb +0 -224
  76. data/lib/groupdocs_conversion_cloud/models/wmf_load_options.rb +0 -224
  77. data/lib/groupdocs_conversion_cloud/models/xls2003_load_options.rb +0 -537
  78. data/lib/groupdocs_conversion_cloud/models/xls_load_options.rb +0 -537
  79. data/lib/groupdocs_conversion_cloud/models/xlsb_load_options.rb +0 -537
  80. data/lib/groupdocs_conversion_cloud/models/xlsm_load_options.rb +0 -537
  81. data/lib/groupdocs_conversion_cloud/models/xlsx_load_options.rb +0 -537
  82. data/lib/groupdocs_conversion_cloud/models/xltm_load_options.rb +0 -537
  83. data/lib/groupdocs_conversion_cloud/models/xltx_load_options.rb +0 -537
@@ -1,434 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="pptx_load_options.rb">
4
- # Copyright (c) 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
- # Pptx load options
32
- class PptxLoadOptions
33
-
34
- # The format of input file, (\"docx\", for example). This field must be filled with correct input file format when using ConvertDirect method, which accept input file as binary stream, and, because of that, API can correctly handle LoadOptions. In regular conversion, the input file format taken from the input file name and this field ignored.
35
- attr_accessor :format
36
-
37
- # Determines whether the document structure should be preserved when converting to PDF (default is false).
38
- attr_accessor :preserve_document_structure
39
-
40
- # Value indicating whether custom document properties should be cleared.
41
- attr_accessor :clear_custom_document_properties
42
-
43
- # Value indicating whether built in document properties should be cleared.
44
- attr_accessor :clear_built_in_document_properties
45
-
46
- # Option to control how many levels in depth to perform conversion Default: 1
47
- attr_accessor :depth
48
-
49
- # Option to control whether the owned documents in the documents container must be converted
50
- attr_accessor :convert_owned
51
-
52
- # Option to control whether the documents container itself must be converted If this property is true the documents container will be the first converted document Default is true
53
- attr_accessor :convert_owner
54
-
55
- # Show hidden slides.
56
- attr_accessor :show_hidden_slides
57
-
58
- # Default font for rendering the presentation. The following font will be used if a presentation font is missing.
59
- attr_accessor :default_font
60
-
61
- # Substitute specific fonts when converting Slides document.
62
- attr_accessor :font_substitutes
63
-
64
- # Set password to unprotect protected document
65
- attr_accessor :password
66
-
67
- # Represents the way comments are printed with the slide. Default is None.
68
- attr_accessor :comments_position
69
-
70
- # Represents the way notes are printed with the slide. Default is None.
71
- attr_accessor :notes_position
72
- class EnumAttributeValidator
73
- attr_reader :datatype
74
- attr_reader :allowable_values
75
-
76
- def initialize(datatype, allowable_values)
77
- @allowable_values = allowable_values.map do |value|
78
- case datatype.to_s
79
- when /Integer/i
80
- value.to_i
81
- when /Float/i
82
- value.to_f
83
- else
84
- value
85
- end
86
- end
87
- end
88
-
89
- def valid?(value)
90
- !value || allowable_values.include?(value)
91
- end
92
- end
93
-
94
- # Attribute mapping from ruby-style variable name to JSON key.
95
- def self.attribute_map
96
- {
97
- :'format' => :'Format',
98
- :'preserve_document_structure' => :'PreserveDocumentStructure',
99
- :'clear_custom_document_properties' => :'ClearCustomDocumentProperties',
100
- :'clear_built_in_document_properties' => :'ClearBuiltInDocumentProperties',
101
- :'depth' => :'Depth',
102
- :'convert_owned' => :'ConvertOwned',
103
- :'convert_owner' => :'ConvertOwner',
104
- :'show_hidden_slides' => :'ShowHiddenSlides',
105
- :'default_font' => :'DefaultFont',
106
- :'font_substitutes' => :'FontSubstitutes',
107
- :'password' => :'Password',
108
- :'comments_position' => :'CommentsPosition',
109
- :'notes_position' => :'NotesPosition'
110
- }
111
- end
112
-
113
- # Attribute type mapping.
114
- def self.swagger_types
115
- {
116
- :'format' => :'String',
117
- :'preserve_document_structure' => :'BOOLEAN',
118
- :'clear_custom_document_properties' => :'BOOLEAN',
119
- :'clear_built_in_document_properties' => :'BOOLEAN',
120
- :'depth' => :'Integer',
121
- :'convert_owned' => :'BOOLEAN',
122
- :'convert_owner' => :'BOOLEAN',
123
- :'show_hidden_slides' => :'BOOLEAN',
124
- :'default_font' => :'String',
125
- :'font_substitutes' => :'Hash<String, String>',
126
- :'password' => :'String',
127
- :'comments_position' => :'String',
128
- :'notes_position' => :'String'
129
- }
130
- end
131
-
132
- # Initializes the object
133
- # @param [Hash] attributes Model attributes in the form of hash
134
- def initialize(attributes = {})
135
- return unless attributes.is_a?(Hash)
136
-
137
- # convert string to symbol for hash key
138
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
139
-
140
- if attributes.key?(:'Format')
141
- self.format = attributes[:'Format']
142
- end
143
-
144
- if attributes.key?(:'PreserveDocumentStructure')
145
- self.preserve_document_structure = attributes[:'PreserveDocumentStructure']
146
- end
147
-
148
- if attributes.key?(:'ClearCustomDocumentProperties')
149
- self.clear_custom_document_properties = attributes[:'ClearCustomDocumentProperties']
150
- end
151
-
152
- if attributes.key?(:'ClearBuiltInDocumentProperties')
153
- self.clear_built_in_document_properties = attributes[:'ClearBuiltInDocumentProperties']
154
- end
155
-
156
- if attributes.key?(:'Depth')
157
- self.depth = attributes[:'Depth']
158
- end
159
-
160
- if attributes.key?(:'ConvertOwned')
161
- self.convert_owned = attributes[:'ConvertOwned']
162
- end
163
-
164
- if attributes.key?(:'ConvertOwner')
165
- self.convert_owner = attributes[:'ConvertOwner']
166
- end
167
-
168
- if attributes.key?(:'ShowHiddenSlides')
169
- self.show_hidden_slides = attributes[:'ShowHiddenSlides']
170
- end
171
-
172
- if attributes.key?(:'DefaultFont')
173
- self.default_font = attributes[:'DefaultFont']
174
- end
175
-
176
- if attributes.key?(:'FontSubstitutes')
177
- if (value = attributes[:'FontSubstitutes']).is_a?(Hash)
178
- self.font_substitutes = value
179
- end
180
- end
181
-
182
- if attributes.key?(:'Password')
183
- self.password = attributes[:'Password']
184
- end
185
-
186
- if attributes.key?(:'CommentsPosition')
187
- self.comments_position = attributes[:'CommentsPosition']
188
- end
189
-
190
- if attributes.key?(:'NotesPosition')
191
- self.notes_position = attributes[:'NotesPosition']
192
- end
193
-
194
- end
195
-
196
- # Show invalid properties with the reasons. Usually used together with valid?
197
- # @return Array for valid properies with the reasons
198
- def list_invalid_properties
199
- invalid_properties = []
200
- if @preserve_document_structure.nil?
201
- invalid_properties.push("invalid value for 'preserve_document_structure', preserve_document_structure cannot be nil.")
202
- end
203
-
204
- if @clear_custom_document_properties.nil?
205
- invalid_properties.push("invalid value for 'clear_custom_document_properties', clear_custom_document_properties cannot be nil.")
206
- end
207
-
208
- if @clear_built_in_document_properties.nil?
209
- invalid_properties.push("invalid value for 'clear_built_in_document_properties', clear_built_in_document_properties cannot be nil.")
210
- end
211
-
212
- if @depth.nil?
213
- invalid_properties.push("invalid value for 'depth', depth cannot be nil.")
214
- end
215
-
216
- if @convert_owned.nil?
217
- invalid_properties.push("invalid value for 'convert_owned', convert_owned cannot be nil.")
218
- end
219
-
220
- if @convert_owner.nil?
221
- invalid_properties.push("invalid value for 'convert_owner', convert_owner cannot be nil.")
222
- end
223
-
224
- if @show_hidden_slides.nil?
225
- invalid_properties.push("invalid value for 'show_hidden_slides', show_hidden_slides cannot be nil.")
226
- end
227
-
228
- if @comments_position.nil?
229
- invalid_properties.push("invalid value for 'comments_position', comments_position cannot be nil.")
230
- end
231
-
232
- if @notes_position.nil?
233
- invalid_properties.push("invalid value for 'notes_position', notes_position cannot be nil.")
234
- end
235
-
236
- return invalid_properties
237
- end
238
-
239
- # Check to see if the all the properties in the model are valid
240
- # @return true if the model is valid
241
- def valid?
242
- return false if @preserve_document_structure.nil?
243
- return false if @clear_custom_document_properties.nil?
244
- return false if @clear_built_in_document_properties.nil?
245
- return false if @depth.nil?
246
- return false if @convert_owned.nil?
247
- return false if @convert_owner.nil?
248
- return false if @show_hidden_slides.nil?
249
- return false if @comments_position.nil?
250
- comments_position_validator = EnumAttributeValidator.new('String', ["None", "Bottom", "Right"])
251
- return false unless comments_position_validator.valid?(@comments_position)
252
- return false if @notes_position.nil?
253
- notes_position_validator = EnumAttributeValidator.new('String', ["None", "BottomTruncated", "BottomFull"])
254
- return false unless notes_position_validator.valid?(@notes_position)
255
- return true
256
- end
257
-
258
- # Custom attribute writer method checking allowed values (enum).
259
- # @param [Object] comments_position Object to be assigned
260
- def comments_position=(comments_position)
261
- validator = EnumAttributeValidator.new('String', ["None", "Bottom", "Right"])
262
- if comments_position.to_i == 0
263
- unless validator.valid?(comments_position)
264
- raise ArgumentError, "invalid value for 'comments_position', must be one of #{validator.allowable_values}."
265
- end
266
- @comments_position = comments_position
267
- else
268
- @comments_position = validator.allowable_values[comments_position.to_i]
269
- end
270
- end
271
-
272
- # Custom attribute writer method checking allowed values (enum).
273
- # @param [Object] notes_position Object to be assigned
274
- def notes_position=(notes_position)
275
- validator = EnumAttributeValidator.new('String', ["None", "BottomTruncated", "BottomFull"])
276
- if notes_position.to_i == 0
277
- unless validator.valid?(notes_position)
278
- raise ArgumentError, "invalid value for 'notes_position', must be one of #{validator.allowable_values}."
279
- end
280
- @notes_position = notes_position
281
- else
282
- @notes_position = validator.allowable_values[notes_position.to_i]
283
- end
284
- end
285
-
286
- # Checks equality by comparing each attribute.
287
- # @param [Object] Object to be compared
288
- def ==(other)
289
- return true if self.equal?(other)
290
- self.class == other.class &&
291
- format == other.format &&
292
- preserve_document_structure == other.preserve_document_structure &&
293
- clear_custom_document_properties == other.clear_custom_document_properties &&
294
- clear_built_in_document_properties == other.clear_built_in_document_properties &&
295
- depth == other.depth &&
296
- convert_owned == other.convert_owned &&
297
- convert_owner == other.convert_owner &&
298
- show_hidden_slides == other.show_hidden_slides &&
299
- default_font == other.default_font &&
300
- font_substitutes == other.font_substitutes &&
301
- password == other.password &&
302
- comments_position == other.comments_position &&
303
- notes_position == other.notes_position
304
- end
305
-
306
- # @see the `==` method
307
- # @param [Object] Object to be compared
308
- def eql?(other)
309
- self == other
310
- end
311
-
312
- # Calculates hash code according to all attributes.
313
- # @return [Fixnum] Hash code
314
- def hash
315
- [format, preserve_document_structure, clear_custom_document_properties, clear_built_in_document_properties, depth, convert_owned, convert_owner, show_hidden_slides, default_font, font_substitutes, password, comments_position, notes_position].hash
316
- end
317
-
318
- # Downcases first letter.
319
- # @return downcased string
320
- def uncap(str)
321
- str[0, 1].downcase + str[1..-1]
322
- end
323
-
324
- # Builds the object from hash
325
- # @param [Hash] attributes Model attributes in the form of hash
326
- # @return [Object] Returns the model itself
327
- def build_from_hash(attributes)
328
- return nil unless attributes.is_a?(Hash)
329
- self.class.swagger_types.each_pair do |key, type|
330
- pname = uncap(self.class.attribute_map[key]).intern
331
- value = attributes[pname]
332
- if type =~ /\AArray<(.*)>/i
333
- # check to ensure the input is an array given that the the attribute
334
- # is documented as an array but the input is not
335
- if value.is_a?(Array)
336
- self.send("#{key}=", value.map { |v| _deserialize($1, v) })
337
- end
338
- elsif !value.nil?
339
- self.send("#{key}=", _deserialize(type, value))
340
- end
341
- # or else data not found in attributes(hash), not an issue as the data can be optional
342
- end
343
-
344
- self
345
- end
346
-
347
- # Deserializes the data based on type
348
- # @param string type Data type
349
- # @param string value Value to be deserialized
350
- # @return [Object] Deserialized data
351
- def _deserialize(type, value)
352
- case type.to_sym
353
- when :DateTime
354
- Date.parse value
355
- when :Date
356
- Date.parse value
357
- when :String
358
- value.to_s
359
- when :Integer
360
- value.to_i
361
- when :Float
362
- value.to_f
363
- when :BOOLEAN
364
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
365
- true
366
- else
367
- false
368
- end
369
- when :Object
370
- # generic object (usually a Hash), return directly
371
- value
372
- when /\AArray<(?<inner_type>.+)>\z/
373
- inner_type = Regexp.last_match[:inner_type]
374
- value.map { |v| _deserialize(inner_type, v) }
375
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
376
- k_type = Regexp.last_match[:k_type]
377
- v_type = Regexp.last_match[:v_type]
378
- {}.tap do |hash|
379
- value.each do |k, v|
380
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
381
- end
382
- end
383
- else
384
- # model
385
- temp_model = GroupDocsConversionCloud.const_get(type).new
386
- temp_model.build_from_hash(value)
387
- end
388
- end
389
-
390
- # Returns the string representation of the object
391
- # @return [String] String presentation of the object
392
- def to_s
393
- to_hash.to_s
394
- end
395
-
396
- # to_body is an alias to to_hash (backward compatibility)
397
- # @return [Hash] Returns the object in the form of hash
398
- def to_body
399
- to_hash
400
- end
401
-
402
- # Returns the object in the form of hash
403
- # @return [Hash] Returns the object in the form of hash
404
- def to_hash
405
- hash = {}
406
- self.class.attribute_map.each_pair do |attr, param|
407
- value = self.send(attr)
408
- next if value.nil?
409
- hash[param] = _to_hash(value)
410
- end
411
- hash
412
- end
413
-
414
- # Outputs non-array value in the form of hash
415
- # For object, use to_hash. Otherwise, just return the value
416
- # @param [Object] value Any valid value
417
- # @return [Hash] Returns the value in the form of hash
418
- def _to_hash(value)
419
- if value.is_a?(Array)
420
- value.compact.map { |v| _to_hash(v) }
421
- elsif value.is_a?(Hash)
422
- {}.tap do |hash|
423
- value.each { |k, v| hash[k] = _to_hash(v) }
424
- end
425
- elsif value.respond_to? :to_hash
426
- value.to_hash
427
- else
428
- value
429
- end
430
- end
431
-
432
- end
433
-
434
- end
@@ -1,224 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="psd_load_options.rb">
4
- # Copyright (c) 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
- # Psd load options
32
- class PsdLoadOptions
33
-
34
- # The format of input file, (\"docx\", for example). This field must be filled with correct input file format when using ConvertDirect method, which accept input file as binary stream, and, because of that, API can correctly handle LoadOptions. In regular conversion, the input file format taken from the input file name and this field ignored.
35
- attr_accessor :format
36
-
37
- # Default font for Psd, Emf, Wmf document types. The following font will be used if a font is missing.
38
- attr_accessor :default_font
39
-
40
- # Attribute mapping from ruby-style variable name to JSON key.
41
- def self.attribute_map
42
- {
43
- :'format' => :'Format',
44
- :'default_font' => :'DefaultFont'
45
- }
46
- end
47
-
48
- # Attribute type mapping.
49
- def self.swagger_types
50
- {
51
- :'format' => :'String',
52
- :'default_font' => :'String'
53
- }
54
- end
55
-
56
- # Initializes the object
57
- # @param [Hash] attributes Model attributes in the form of hash
58
- def initialize(attributes = {})
59
- return unless attributes.is_a?(Hash)
60
-
61
- # convert string to symbol for hash key
62
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
63
-
64
- if attributes.key?(:'Format')
65
- self.format = attributes[:'Format']
66
- end
67
-
68
- if attributes.key?(:'DefaultFont')
69
- self.default_font = attributes[:'DefaultFont']
70
- end
71
-
72
- end
73
-
74
- # Show invalid properties with the reasons. Usually used together with valid?
75
- # @return Array for valid properies with the reasons
76
- def list_invalid_properties
77
- invalid_properties = []
78
- return invalid_properties
79
- end
80
-
81
- # Check to see if the all the properties in the model are valid
82
- # @return true if the model is valid
83
- def valid?
84
- return true
85
- end
86
-
87
- # Checks equality by comparing each attribute.
88
- # @param [Object] Object to be compared
89
- def ==(other)
90
- return true if self.equal?(other)
91
- self.class == other.class &&
92
- format == other.format &&
93
- default_font == other.default_font
94
- end
95
-
96
- # @see the `==` method
97
- # @param [Object] Object to be compared
98
- def eql?(other)
99
- self == other
100
- end
101
-
102
- # Calculates hash code according to all attributes.
103
- # @return [Fixnum] Hash code
104
- def hash
105
- [format, default_font].hash
106
- end
107
-
108
- # Downcases first letter.
109
- # @return downcased string
110
- def uncap(str)
111
- str[0, 1].downcase + str[1..-1]
112
- end
113
-
114
- # Builds the object from hash
115
- # @param [Hash] attributes Model attributes in the form of hash
116
- # @return [Object] Returns the model itself
117
- def build_from_hash(attributes)
118
- return nil unless attributes.is_a?(Hash)
119
- self.class.swagger_types.each_pair do |key, type|
120
- pname = uncap(self.class.attribute_map[key]).intern
121
- value = attributes[pname]
122
- if type =~ /\AArray<(.*)>/i
123
- # check to ensure the input is an array given that the the attribute
124
- # is documented as an array but the input is not
125
- if value.is_a?(Array)
126
- self.send("#{key}=", value.map { |v| _deserialize($1, v) })
127
- end
128
- elsif !value.nil?
129
- self.send("#{key}=", _deserialize(type, value))
130
- end
131
- # or else data not found in attributes(hash), not an issue as the data can be optional
132
- end
133
-
134
- self
135
- end
136
-
137
- # Deserializes the data based on type
138
- # @param string type Data type
139
- # @param string value Value to be deserialized
140
- # @return [Object] Deserialized data
141
- def _deserialize(type, value)
142
- case type.to_sym
143
- when :DateTime
144
- Date.parse value
145
- when :Date
146
- Date.parse value
147
- when :String
148
- value.to_s
149
- when :Integer
150
- value.to_i
151
- when :Float
152
- value.to_f
153
- when :BOOLEAN
154
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
- true
156
- else
157
- false
158
- end
159
- when :Object
160
- # generic object (usually a Hash), return directly
161
- value
162
- when /\AArray<(?<inner_type>.+)>\z/
163
- inner_type = Regexp.last_match[:inner_type]
164
- value.map { |v| _deserialize(inner_type, v) }
165
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
- k_type = Regexp.last_match[:k_type]
167
- v_type = Regexp.last_match[:v_type]
168
- {}.tap do |hash|
169
- value.each do |k, v|
170
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
- end
172
- end
173
- else
174
- # model
175
- temp_model = GroupDocsConversionCloud.const_get(type).new
176
- temp_model.build_from_hash(value)
177
- end
178
- end
179
-
180
- # Returns the string representation of the object
181
- # @return [String] String presentation of the object
182
- def to_s
183
- to_hash.to_s
184
- end
185
-
186
- # to_body is an alias to to_hash (backward compatibility)
187
- # @return [Hash] Returns the object in the form of hash
188
- def to_body
189
- to_hash
190
- end
191
-
192
- # Returns the object in the form of hash
193
- # @return [Hash] Returns the object in the form of hash
194
- def to_hash
195
- hash = {}
196
- self.class.attribute_map.each_pair do |attr, param|
197
- value = self.send(attr)
198
- next if value.nil?
199
- hash[param] = _to_hash(value)
200
- end
201
- hash
202
- end
203
-
204
- # Outputs non-array value in the form of hash
205
- # For object, use to_hash. Otherwise, just return the value
206
- # @param [Object] value Any valid value
207
- # @return [Hash] Returns the value in the form of hash
208
- def _to_hash(value)
209
- if value.is_a?(Array)
210
- value.compact.map { |v| _to_hash(v) }
211
- elsif value.is_a?(Hash)
212
- {}.tap do |hash|
213
- value.each { |k, v| hash[k] = _to_hash(v) }
214
- end
215
- elsif value.respond_to? :to_hash
216
- value.to_hash
217
- else
218
- value
219
- end
220
- end
221
-
222
- end
223
-
224
- end