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,406 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="msg_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
- # Msg load options
32
- class MsgLoadOptions
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
- # Defines whether need to keep original date header string in mail message when saving or not (Default value is true)
38
- attr_accessor :preserve_original_date
39
-
40
- # The mapping between email message field and field text representation
41
- attr_accessor :field_labels
42
-
43
- # Gets or sets the Coordinated Universal Time (UTC) offset for the message dates. This property defines the time zone difference, between the localtime and UTC.
44
- attr_accessor :time_zone_offset
45
-
46
- # Option to display or hide sent date/time in the header. Default: true.
47
- attr_accessor :display_sent
48
-
49
- # Option to display or hide subject in the header. Default: true.
50
- attr_accessor :display_subject
51
-
52
- # Option to display or hide attachments in the header. Default: true.
53
- attr_accessor :display_attachments
54
- attr_accessor :display_email_addresses
55
-
56
- # Option to display or hide \"Bcc\" email address. Default: false
57
- attr_accessor :display_bcc_email_address
58
-
59
- # Option to display or hide \"Cc\" email address. Default: false
60
- attr_accessor :display_cc_email_address
61
-
62
- # Option to display or hide \"to\" email address. Default: true
63
- attr_accessor :display_to_email_address
64
-
65
- # Option to display or hide \"from\" email address. Default: true
66
- attr_accessor :display_from_email_address
67
-
68
- # Option to display or hide the email header. Default: true
69
- attr_accessor :display_header
70
-
71
- # Default font for Email document. The following font will be used if a font is missing.
72
- attr_accessor :default_font
73
-
74
- # List of font substitutes.
75
- attr_accessor :font_substitutes
76
-
77
- # Attribute mapping from ruby-style variable name to JSON key.
78
- def self.attribute_map
79
- {
80
- :'format' => :'Format',
81
- :'preserve_original_date' => :'PreserveOriginalDate',
82
- :'field_labels' => :'FieldLabels',
83
- :'time_zone_offset' => :'TimeZoneOffset',
84
- :'display_sent' => :'DisplaySent',
85
- :'display_subject' => :'DisplaySubject',
86
- :'display_attachments' => :'DisplayAttachments',
87
- :'display_email_addresses' => :'DisplayEmailAddresses',
88
- :'display_bcc_email_address' => :'DisplayBccEmailAddress',
89
- :'display_cc_email_address' => :'DisplayCcEmailAddress',
90
- :'display_to_email_address' => :'DisplayToEmailAddress',
91
- :'display_from_email_address' => :'DisplayFromEmailAddress',
92
- :'display_header' => :'DisplayHeader',
93
- :'default_font' => :'DefaultFont',
94
- :'font_substitutes' => :'FontSubstitutes'
95
- }
96
- end
97
-
98
- # Attribute type mapping.
99
- def self.swagger_types
100
- {
101
- :'format' => :'String',
102
- :'preserve_original_date' => :'BOOLEAN',
103
- :'field_labels' => :'Array<FieldLabel>',
104
- :'time_zone_offset' => :'String',
105
- :'display_sent' => :'BOOLEAN',
106
- :'display_subject' => :'BOOLEAN',
107
- :'display_attachments' => :'BOOLEAN',
108
- :'display_email_addresses' => :'BOOLEAN',
109
- :'display_bcc_email_address' => :'BOOLEAN',
110
- :'display_cc_email_address' => :'BOOLEAN',
111
- :'display_to_email_address' => :'BOOLEAN',
112
- :'display_from_email_address' => :'BOOLEAN',
113
- :'display_header' => :'BOOLEAN',
114
- :'default_font' => :'String',
115
- :'font_substitutes' => :'Hash<String, String>'
116
- }
117
- end
118
-
119
- # Initializes the object
120
- # @param [Hash] attributes Model attributes in the form of hash
121
- def initialize(attributes = {})
122
- return unless attributes.is_a?(Hash)
123
-
124
- # convert string to symbol for hash key
125
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
126
-
127
- if attributes.key?(:'Format')
128
- self.format = attributes[:'Format']
129
- end
130
-
131
- if attributes.key?(:'PreserveOriginalDate')
132
- self.preserve_original_date = attributes[:'PreserveOriginalDate']
133
- end
134
-
135
- if attributes.key?(:'FieldLabels')
136
- if (value = attributes[:'FieldLabels']).is_a?(Array)
137
- self.field_labels = value
138
- end
139
- end
140
-
141
- if attributes.key?(:'TimeZoneOffset')
142
- self.time_zone_offset = attributes[:'TimeZoneOffset']
143
- end
144
-
145
- if attributes.key?(:'DisplaySent')
146
- self.display_sent = attributes[:'DisplaySent']
147
- end
148
-
149
- if attributes.key?(:'DisplaySubject')
150
- self.display_subject = attributes[:'DisplaySubject']
151
- end
152
-
153
- if attributes.key?(:'DisplayAttachments')
154
- self.display_attachments = attributes[:'DisplayAttachments']
155
- end
156
-
157
- if attributes.key?(:'DisplayEmailAddresses')
158
- self.display_email_addresses = attributes[:'DisplayEmailAddresses']
159
- end
160
-
161
- if attributes.key?(:'DisplayBccEmailAddress')
162
- self.display_bcc_email_address = attributes[:'DisplayBccEmailAddress']
163
- end
164
-
165
- if attributes.key?(:'DisplayCcEmailAddress')
166
- self.display_cc_email_address = attributes[:'DisplayCcEmailAddress']
167
- end
168
-
169
- if attributes.key?(:'DisplayToEmailAddress')
170
- self.display_to_email_address = attributes[:'DisplayToEmailAddress']
171
- end
172
-
173
- if attributes.key?(:'DisplayFromEmailAddress')
174
- self.display_from_email_address = attributes[:'DisplayFromEmailAddress']
175
- end
176
-
177
- if attributes.key?(:'DisplayHeader')
178
- self.display_header = attributes[:'DisplayHeader']
179
- end
180
-
181
- if attributes.key?(:'DefaultFont')
182
- self.default_font = attributes[:'DefaultFont']
183
- end
184
-
185
- if attributes.key?(:'FontSubstitutes')
186
- if (value = attributes[:'FontSubstitutes']).is_a?(Hash)
187
- self.font_substitutes = value
188
- end
189
- end
190
-
191
- end
192
-
193
- # Show invalid properties with the reasons. Usually used together with valid?
194
- # @return Array for valid properies with the reasons
195
- def list_invalid_properties
196
- invalid_properties = []
197
- if @preserve_original_date.nil?
198
- invalid_properties.push("invalid value for 'preserve_original_date', preserve_original_date cannot be nil.")
199
- end
200
-
201
- if @display_sent.nil?
202
- invalid_properties.push("invalid value for 'display_sent', display_sent cannot be nil.")
203
- end
204
-
205
- if @display_subject.nil?
206
- invalid_properties.push("invalid value for 'display_subject', display_subject cannot be nil.")
207
- end
208
-
209
- if @display_attachments.nil?
210
- invalid_properties.push("invalid value for 'display_attachments', display_attachments cannot be nil.")
211
- end
212
-
213
- if @display_email_addresses.nil?
214
- invalid_properties.push("invalid value for 'display_email_addresses', display_email_addresses cannot be nil.")
215
- end
216
-
217
- if @display_bcc_email_address.nil?
218
- invalid_properties.push("invalid value for 'display_bcc_email_address', display_bcc_email_address cannot be nil.")
219
- end
220
-
221
- if @display_cc_email_address.nil?
222
- invalid_properties.push("invalid value for 'display_cc_email_address', display_cc_email_address cannot be nil.")
223
- end
224
-
225
- if @display_to_email_address.nil?
226
- invalid_properties.push("invalid value for 'display_to_email_address', display_to_email_address cannot be nil.")
227
- end
228
-
229
- if @display_from_email_address.nil?
230
- invalid_properties.push("invalid value for 'display_from_email_address', display_from_email_address cannot be nil.")
231
- end
232
-
233
- if @display_header.nil?
234
- invalid_properties.push("invalid value for 'display_header', display_header cannot be nil.")
235
- end
236
-
237
- return invalid_properties
238
- end
239
-
240
- # Check to see if the all the properties in the model are valid
241
- # @return true if the model is valid
242
- def valid?
243
- return false if @preserve_original_date.nil?
244
- return false if @display_sent.nil?
245
- return false if @display_subject.nil?
246
- return false if @display_attachments.nil?
247
- return false if @display_email_addresses.nil?
248
- return false if @display_bcc_email_address.nil?
249
- return false if @display_cc_email_address.nil?
250
- return false if @display_to_email_address.nil?
251
- return false if @display_from_email_address.nil?
252
- return false if @display_header.nil?
253
- return true
254
- end
255
-
256
- # Checks equality by comparing each attribute.
257
- # @param [Object] Object to be compared
258
- def ==(other)
259
- return true if self.equal?(other)
260
- self.class == other.class &&
261
- format == other.format &&
262
- preserve_original_date == other.preserve_original_date &&
263
- field_labels == other.field_labels &&
264
- time_zone_offset == other.time_zone_offset &&
265
- display_sent == other.display_sent &&
266
- display_subject == other.display_subject &&
267
- display_attachments == other.display_attachments &&
268
- display_email_addresses == other.display_email_addresses &&
269
- display_bcc_email_address == other.display_bcc_email_address &&
270
- display_cc_email_address == other.display_cc_email_address &&
271
- display_to_email_address == other.display_to_email_address &&
272
- display_from_email_address == other.display_from_email_address &&
273
- display_header == other.display_header &&
274
- default_font == other.default_font &&
275
- font_substitutes == other.font_substitutes
276
- end
277
-
278
- # @see the `==` method
279
- # @param [Object] Object to be compared
280
- def eql?(other)
281
- self == other
282
- end
283
-
284
- # Calculates hash code according to all attributes.
285
- # @return [Fixnum] Hash code
286
- def hash
287
- [format, preserve_original_date, field_labels, time_zone_offset, display_sent, display_subject, display_attachments, display_email_addresses, display_bcc_email_address, display_cc_email_address, display_to_email_address, display_from_email_address, display_header, default_font, font_substitutes].hash
288
- end
289
-
290
- # Downcases first letter.
291
- # @return downcased string
292
- def uncap(str)
293
- str[0, 1].downcase + str[1..-1]
294
- end
295
-
296
- # Builds the object from hash
297
- # @param [Hash] attributes Model attributes in the form of hash
298
- # @return [Object] Returns the model itself
299
- def build_from_hash(attributes)
300
- return nil unless attributes.is_a?(Hash)
301
- self.class.swagger_types.each_pair do |key, type|
302
- pname = uncap(self.class.attribute_map[key]).intern
303
- value = attributes[pname]
304
- if type =~ /\AArray<(.*)>/i
305
- # check to ensure the input is an array given that the the attribute
306
- # is documented as an array but the input is not
307
- if value.is_a?(Array)
308
- self.send("#{key}=", value.map { |v| _deserialize($1, v) })
309
- end
310
- elsif !value.nil?
311
- self.send("#{key}=", _deserialize(type, value))
312
- end
313
- # or else data not found in attributes(hash), not an issue as the data can be optional
314
- end
315
-
316
- self
317
- end
318
-
319
- # Deserializes the data based on type
320
- # @param string type Data type
321
- # @param string value Value to be deserialized
322
- # @return [Object] Deserialized data
323
- def _deserialize(type, value)
324
- case type.to_sym
325
- when :DateTime
326
- Date.parse value
327
- when :Date
328
- Date.parse value
329
- when :String
330
- value.to_s
331
- when :Integer
332
- value.to_i
333
- when :Float
334
- value.to_f
335
- when :BOOLEAN
336
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
337
- true
338
- else
339
- false
340
- end
341
- when :Object
342
- # generic object (usually a Hash), return directly
343
- value
344
- when /\AArray<(?<inner_type>.+)>\z/
345
- inner_type = Regexp.last_match[:inner_type]
346
- value.map { |v| _deserialize(inner_type, v) }
347
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
348
- k_type = Regexp.last_match[:k_type]
349
- v_type = Regexp.last_match[:v_type]
350
- {}.tap do |hash|
351
- value.each do |k, v|
352
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
353
- end
354
- end
355
- else
356
- # model
357
- temp_model = GroupDocsConversionCloud.const_get(type).new
358
- temp_model.build_from_hash(value)
359
- end
360
- end
361
-
362
- # Returns the string representation of the object
363
- # @return [String] String presentation of the object
364
- def to_s
365
- to_hash.to_s
366
- end
367
-
368
- # to_body is an alias to to_hash (backward compatibility)
369
- # @return [Hash] Returns the object in the form of hash
370
- def to_body
371
- to_hash
372
- end
373
-
374
- # Returns the object in the form of hash
375
- # @return [Hash] Returns the object in the form of hash
376
- def to_hash
377
- hash = {}
378
- self.class.attribute_map.each_pair do |attr, param|
379
- value = self.send(attr)
380
- next if value.nil?
381
- hash[param] = _to_hash(value)
382
- end
383
- hash
384
- end
385
-
386
- # Outputs non-array value in the form of hash
387
- # For object, use to_hash. Otherwise, just return the value
388
- # @param [Object] value Any valid value
389
- # @return [Hash] Returns the value in the form of hash
390
- def _to_hash(value)
391
- if value.is_a?(Array)
392
- value.compact.map { |v| _to_hash(v) }
393
- elsif value.is_a?(Hash)
394
- {}.tap do |hash|
395
- value.each { |k, v| hash[k] = _to_hash(v) }
396
- end
397
- elsif value.respond_to? :to_hash
398
- value.to_hash
399
- else
400
- value
401
- end
402
- end
403
-
404
- end
405
-
406
- end
@@ -1,224 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="odg_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
- # Odg load options
32
- class OdgLoadOptions
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