groupdocs_conversion_cloud 25.6 → 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 (90) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_conversion_cloud/models/cad_load_options.rb +25 -15
  3. data/lib/groupdocs_conversion_cloud/models/csv_load_options.rb +230 -61
  4. data/lib/groupdocs_conversion_cloud/models/email_load_options.rb +142 -77
  5. data/lib/groupdocs_conversion_cloud/models/pdf_load_options.rb +110 -28
  6. data/lib/groupdocs_conversion_cloud/models/spreadsheet_load_options.rb +233 -64
  7. data/lib/groupdocs_conversion_cloud/models/tsv_load_options.rb +233 -64
  8. data/lib/groupdocs_conversion_cloud/models/web_load_options.rb +81 -4
  9. data/lib/groupdocs_conversion_cloud/version.rb +1 -1
  10. data/lib/groupdocs_conversion_cloud.rb +0 -79
  11. metadata +2 -81
  12. data/lib/groupdocs_conversion_cloud/models/bmp_load_options.rb +0 -224
  13. data/lib/groupdocs_conversion_cloud/models/cf2_load_options.rb +0 -288
  14. data/lib/groupdocs_conversion_cloud/models/dcm_load_options.rb +0 -224
  15. data/lib/groupdocs_conversion_cloud/models/dgn_load_options.rb +0 -288
  16. data/lib/groupdocs_conversion_cloud/models/dng_load_options.rb +0 -224
  17. data/lib/groupdocs_conversion_cloud/models/doc_load_options.rb +0 -658
  18. data/lib/groupdocs_conversion_cloud/models/docm_load_options.rb +0 -658
  19. data/lib/groupdocs_conversion_cloud/models/docx_load_options.rb +0 -658
  20. data/lib/groupdocs_conversion_cloud/models/dot_load_options.rb +0 -658
  21. data/lib/groupdocs_conversion_cloud/models/dotm_load_options.rb +0 -658
  22. data/lib/groupdocs_conversion_cloud/models/dotx_load_options.rb +0 -658
  23. data/lib/groupdocs_conversion_cloud/models/dwf_load_options.rb +0 -288
  24. data/lib/groupdocs_conversion_cloud/models/dwfx_load_options.rb +0 -288
  25. data/lib/groupdocs_conversion_cloud/models/dwg_load_options.rb +0 -288
  26. data/lib/groupdocs_conversion_cloud/models/dwt_load_options.rb +0 -288
  27. data/lib/groupdocs_conversion_cloud/models/dxf_load_options.rb +0 -288
  28. data/lib/groupdocs_conversion_cloud/models/emf_load_options.rb +0 -224
  29. data/lib/groupdocs_conversion_cloud/models/eml_load_options.rb +0 -341
  30. data/lib/groupdocs_conversion_cloud/models/emlx_load_options.rb +0 -341
  31. data/lib/groupdocs_conversion_cloud/models/gif_load_options.rb +0 -224
  32. data/lib/groupdocs_conversion_cloud/models/ico_load_options.rb +0 -224
  33. data/lib/groupdocs_conversion_cloud/models/ifc_load_options.rb +0 -288
  34. data/lib/groupdocs_conversion_cloud/models/igs_load_options.rb +0 -288
  35. data/lib/groupdocs_conversion_cloud/models/j2c_load_options.rb +0 -224
  36. data/lib/groupdocs_conversion_cloud/models/j2k_load_options.rb +0 -224
  37. data/lib/groupdocs_conversion_cloud/models/jp2_load_options.rb +0 -224
  38. data/lib/groupdocs_conversion_cloud/models/jpeg_load_options.rb +0 -224
  39. data/lib/groupdocs_conversion_cloud/models/jpf_load_options.rb +0 -224
  40. data/lib/groupdocs_conversion_cloud/models/jpg_load_options.rb +0 -224
  41. data/lib/groupdocs_conversion_cloud/models/jpm_load_options.rb +0 -224
  42. data/lib/groupdocs_conversion_cloud/models/jpx_load_options.rb +0 -224
  43. data/lib/groupdocs_conversion_cloud/models/mht_load_options.rb +0 -341
  44. data/lib/groupdocs_conversion_cloud/models/mobi_load_options.rb +0 -658
  45. data/lib/groupdocs_conversion_cloud/models/msg_load_options.rb +0 -341
  46. data/lib/groupdocs_conversion_cloud/models/odg_load_options.rb +0 -224
  47. data/lib/groupdocs_conversion_cloud/models/odp_load_options.rb +0 -434
  48. data/lib/groupdocs_conversion_cloud/models/ods_load_options.rb +0 -368
  49. data/lib/groupdocs_conversion_cloud/models/odt_load_options.rb +0 -658
  50. data/lib/groupdocs_conversion_cloud/models/ost_load_options.rb +0 -341
  51. data/lib/groupdocs_conversion_cloud/models/otp_load_options.rb +0 -434
  52. data/lib/groupdocs_conversion_cloud/models/ots_load_options.rb +0 -368
  53. data/lib/groupdocs_conversion_cloud/models/ott_load_options.rb +0 -658
  54. data/lib/groupdocs_conversion_cloud/models/plt_load_options.rb +0 -288
  55. data/lib/groupdocs_conversion_cloud/models/png_load_options.rb +0 -224
  56. data/lib/groupdocs_conversion_cloud/models/potm_load_options.rb +0 -434
  57. data/lib/groupdocs_conversion_cloud/models/potx_load_options.rb +0 -434
  58. data/lib/groupdocs_conversion_cloud/models/pps_load_options.rb +0 -434
  59. data/lib/groupdocs_conversion_cloud/models/ppsm_load_options.rb +0 -434
  60. data/lib/groupdocs_conversion_cloud/models/ppsx_load_options.rb +0 -434
  61. data/lib/groupdocs_conversion_cloud/models/ppt_load_options.rb +0 -434
  62. data/lib/groupdocs_conversion_cloud/models/pptm_load_options.rb +0 -434
  63. data/lib/groupdocs_conversion_cloud/models/pptx_load_options.rb +0 -434
  64. data/lib/groupdocs_conversion_cloud/models/psd_load_options.rb +0 -224
  65. data/lib/groupdocs_conversion_cloud/models/pst_load_options.rb +0 -341
  66. data/lib/groupdocs_conversion_cloud/models/stl_load_options.rb +0 -288
  67. data/lib/groupdocs_conversion_cloud/models/tif_load_options.rb +0 -224
  68. data/lib/groupdocs_conversion_cloud/models/tiff_load_options.rb +0 -224
  69. data/lib/groupdocs_conversion_cloud/models/vdw_load_options.rb +0 -224
  70. data/lib/groupdocs_conversion_cloud/models/vdx_load_options.rb +0 -224
  71. data/lib/groupdocs_conversion_cloud/models/vsd_load_options.rb +0 -224
  72. data/lib/groupdocs_conversion_cloud/models/vsdm_load_options.rb +0 -224
  73. data/lib/groupdocs_conversion_cloud/models/vsdx_load_options.rb +0 -224
  74. data/lib/groupdocs_conversion_cloud/models/vss_load_options.rb +0 -224
  75. data/lib/groupdocs_conversion_cloud/models/vssm_load_options.rb +0 -224
  76. data/lib/groupdocs_conversion_cloud/models/vssx_load_options.rb +0 -224
  77. data/lib/groupdocs_conversion_cloud/models/vst_load_options.rb +0 -224
  78. data/lib/groupdocs_conversion_cloud/models/vstm_load_options.rb +0 -224
  79. data/lib/groupdocs_conversion_cloud/models/vstx_load_options.rb +0 -224
  80. data/lib/groupdocs_conversion_cloud/models/vsx_load_options.rb +0 -224
  81. data/lib/groupdocs_conversion_cloud/models/vtx_load_options.rb +0 -224
  82. data/lib/groupdocs_conversion_cloud/models/webp_load_options.rb +0 -224
  83. data/lib/groupdocs_conversion_cloud/models/wmf_load_options.rb +0 -224
  84. data/lib/groupdocs_conversion_cloud/models/xls2003_load_options.rb +0 -368
  85. data/lib/groupdocs_conversion_cloud/models/xls_load_options.rb +0 -368
  86. data/lib/groupdocs_conversion_cloud/models/xlsb_load_options.rb +0 -368
  87. data/lib/groupdocs_conversion_cloud/models/xlsm_load_options.rb +0 -368
  88. data/lib/groupdocs_conversion_cloud/models/xlsx_load_options.rb +0 -368
  89. data/lib/groupdocs_conversion_cloud/models/xltm_load_options.rb +0 -368
  90. data/lib/groupdocs_conversion_cloud/models/xltx_load_options.rb +0 -368
@@ -1,341 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="pst_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
- # Pst load options
32
- class PstLoadOptions
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
- # Option to display or hide the email header. Default: true
38
- attr_accessor :display_header
39
-
40
- # Option to display or hide \"from\" email address. Default: true
41
- attr_accessor :display_from_email_address
42
-
43
- # Option to display or hide \"to\" email address. Default: true
44
- attr_accessor :display_to_email_address
45
-
46
- # Option to display or hide \"Cc\" email address. Default: false
47
- attr_accessor :display_cc_email_address
48
-
49
- # Option to display or hide \"Bcc\" email address. Default: false
50
- attr_accessor :display_bcc_email_address
51
-
52
- # 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.
53
- attr_accessor :time_zone_offset
54
-
55
- # Option to convert attachments in source email or not. Default: false.
56
- attr_accessor :convert_attachments
57
-
58
- # The mapping between email message field and field text representation
59
- attr_accessor :field_labels
60
-
61
- # Defines whether need to keep original date header string in mail message when saving or not (Default value is true)
62
- attr_accessor :preserve_original_date
63
-
64
- # Attribute mapping from ruby-style variable name to JSON key.
65
- def self.attribute_map
66
- {
67
- :'format' => :'Format',
68
- :'display_header' => :'DisplayHeader',
69
- :'display_from_email_address' => :'DisplayFromEmailAddress',
70
- :'display_to_email_address' => :'DisplayToEmailAddress',
71
- :'display_cc_email_address' => :'DisplayCcEmailAddress',
72
- :'display_bcc_email_address' => :'DisplayBccEmailAddress',
73
- :'time_zone_offset' => :'TimeZoneOffset',
74
- :'convert_attachments' => :'ConvertAttachments',
75
- :'field_labels' => :'FieldLabels',
76
- :'preserve_original_date' => :'PreserveOriginalDate'
77
- }
78
- end
79
-
80
- # Attribute type mapping.
81
- def self.swagger_types
82
- {
83
- :'format' => :'String',
84
- :'display_header' => :'BOOLEAN',
85
- :'display_from_email_address' => :'BOOLEAN',
86
- :'display_to_email_address' => :'BOOLEAN',
87
- :'display_cc_email_address' => :'BOOLEAN',
88
- :'display_bcc_email_address' => :'BOOLEAN',
89
- :'time_zone_offset' => :'String',
90
- :'convert_attachments' => :'BOOLEAN',
91
- :'field_labels' => :'Array<FieldLabel>',
92
- :'preserve_original_date' => :'BOOLEAN'
93
- }
94
- end
95
-
96
- # Initializes the object
97
- # @param [Hash] attributes Model attributes in the form of hash
98
- def initialize(attributes = {})
99
- return unless attributes.is_a?(Hash)
100
-
101
- # convert string to symbol for hash key
102
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
103
-
104
- if attributes.key?(:'Format')
105
- self.format = attributes[:'Format']
106
- end
107
-
108
- if attributes.key?(:'DisplayHeader')
109
- self.display_header = attributes[:'DisplayHeader']
110
- end
111
-
112
- if attributes.key?(:'DisplayFromEmailAddress')
113
- self.display_from_email_address = attributes[:'DisplayFromEmailAddress']
114
- end
115
-
116
- if attributes.key?(:'DisplayToEmailAddress')
117
- self.display_to_email_address = attributes[:'DisplayToEmailAddress']
118
- end
119
-
120
- if attributes.key?(:'DisplayCcEmailAddress')
121
- self.display_cc_email_address = attributes[:'DisplayCcEmailAddress']
122
- end
123
-
124
- if attributes.key?(:'DisplayBccEmailAddress')
125
- self.display_bcc_email_address = attributes[:'DisplayBccEmailAddress']
126
- end
127
-
128
- if attributes.key?(:'TimeZoneOffset')
129
- self.time_zone_offset = attributes[:'TimeZoneOffset']
130
- end
131
-
132
- if attributes.key?(:'ConvertAttachments')
133
- self.convert_attachments = attributes[:'ConvertAttachments']
134
- end
135
-
136
- if attributes.key?(:'FieldLabels')
137
- if (value = attributes[:'FieldLabels']).is_a?(Array)
138
- self.field_labels = value
139
- end
140
- end
141
-
142
- if attributes.key?(:'PreserveOriginalDate')
143
- self.preserve_original_date = attributes[:'PreserveOriginalDate']
144
- end
145
-
146
- end
147
-
148
- # Show invalid properties with the reasons. Usually used together with valid?
149
- # @return Array for valid properies with the reasons
150
- def list_invalid_properties
151
- invalid_properties = []
152
- if @display_header.nil?
153
- invalid_properties.push("invalid value for 'display_header', display_header cannot be nil.")
154
- end
155
-
156
- if @display_from_email_address.nil?
157
- invalid_properties.push("invalid value for 'display_from_email_address', display_from_email_address cannot be nil.")
158
- end
159
-
160
- if @display_to_email_address.nil?
161
- invalid_properties.push("invalid value for 'display_to_email_address', display_to_email_address cannot be nil.")
162
- end
163
-
164
- if @display_cc_email_address.nil?
165
- invalid_properties.push("invalid value for 'display_cc_email_address', display_cc_email_address cannot be nil.")
166
- end
167
-
168
- if @display_bcc_email_address.nil?
169
- invalid_properties.push("invalid value for 'display_bcc_email_address', display_bcc_email_address cannot be nil.")
170
- end
171
-
172
- if @convert_attachments.nil?
173
- invalid_properties.push("invalid value for 'convert_attachments', convert_attachments cannot be nil.")
174
- end
175
-
176
- if @preserve_original_date.nil?
177
- invalid_properties.push("invalid value for 'preserve_original_date', preserve_original_date cannot be nil.")
178
- end
179
-
180
- return invalid_properties
181
- end
182
-
183
- # Check to see if the all the properties in the model are valid
184
- # @return true if the model is valid
185
- def valid?
186
- return false if @display_header.nil?
187
- return false if @display_from_email_address.nil?
188
- return false if @display_to_email_address.nil?
189
- return false if @display_cc_email_address.nil?
190
- return false if @display_bcc_email_address.nil?
191
- return false if @convert_attachments.nil?
192
- return false if @preserve_original_date.nil?
193
- return true
194
- end
195
-
196
- # Checks equality by comparing each attribute.
197
- # @param [Object] Object to be compared
198
- def ==(other)
199
- return true if self.equal?(other)
200
- self.class == other.class &&
201
- format == other.format &&
202
- display_header == other.display_header &&
203
- display_from_email_address == other.display_from_email_address &&
204
- display_to_email_address == other.display_to_email_address &&
205
- display_cc_email_address == other.display_cc_email_address &&
206
- display_bcc_email_address == other.display_bcc_email_address &&
207
- time_zone_offset == other.time_zone_offset &&
208
- convert_attachments == other.convert_attachments &&
209
- field_labels == other.field_labels &&
210
- preserve_original_date == other.preserve_original_date
211
- end
212
-
213
- # @see the `==` method
214
- # @param [Object] Object to be compared
215
- def eql?(other)
216
- self == other
217
- end
218
-
219
- # Calculates hash code according to all attributes.
220
- # @return [Fixnum] Hash code
221
- def hash
222
- [format, display_header, display_from_email_address, display_to_email_address, display_cc_email_address, display_bcc_email_address, time_zone_offset, convert_attachments, field_labels, preserve_original_date].hash
223
- end
224
-
225
- # Downcases first letter.
226
- # @return downcased string
227
- def uncap(str)
228
- str[0, 1].downcase + str[1..-1]
229
- end
230
-
231
- # Builds the object from hash
232
- # @param [Hash] attributes Model attributes in the form of hash
233
- # @return [Object] Returns the model itself
234
- def build_from_hash(attributes)
235
- return nil unless attributes.is_a?(Hash)
236
- self.class.swagger_types.each_pair do |key, type|
237
- pname = uncap(self.class.attribute_map[key]).intern
238
- value = attributes[pname]
239
- if type =~ /\AArray<(.*)>/i
240
- # check to ensure the input is an array given that the the attribute
241
- # is documented as an array but the input is not
242
- if value.is_a?(Array)
243
- self.send("#{key}=", value.map { |v| _deserialize($1, v) })
244
- end
245
- elsif !value.nil?
246
- self.send("#{key}=", _deserialize(type, value))
247
- end
248
- # or else data not found in attributes(hash), not an issue as the data can be optional
249
- end
250
-
251
- self
252
- end
253
-
254
- # Deserializes the data based on type
255
- # @param string type Data type
256
- # @param string value Value to be deserialized
257
- # @return [Object] Deserialized data
258
- def _deserialize(type, value)
259
- case type.to_sym
260
- when :DateTime
261
- Date.parse value
262
- when :Date
263
- Date.parse value
264
- when :String
265
- value.to_s
266
- when :Integer
267
- value.to_i
268
- when :Float
269
- value.to_f
270
- when :BOOLEAN
271
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
272
- true
273
- else
274
- false
275
- end
276
- when :Object
277
- # generic object (usually a Hash), return directly
278
- value
279
- when /\AArray<(?<inner_type>.+)>\z/
280
- inner_type = Regexp.last_match[:inner_type]
281
- value.map { |v| _deserialize(inner_type, v) }
282
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
283
- k_type = Regexp.last_match[:k_type]
284
- v_type = Regexp.last_match[:v_type]
285
- {}.tap do |hash|
286
- value.each do |k, v|
287
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
288
- end
289
- end
290
- else
291
- # model
292
- temp_model = GroupDocsConversionCloud.const_get(type).new
293
- temp_model.build_from_hash(value)
294
- end
295
- end
296
-
297
- # Returns the string representation of the object
298
- # @return [String] String presentation of the object
299
- def to_s
300
- to_hash.to_s
301
- end
302
-
303
- # to_body is an alias to to_hash (backward compatibility)
304
- # @return [Hash] Returns the object in the form of hash
305
- def to_body
306
- to_hash
307
- end
308
-
309
- # Returns the object in the form of hash
310
- # @return [Hash] Returns the object in the form of hash
311
- def to_hash
312
- hash = {}
313
- self.class.attribute_map.each_pair do |attr, param|
314
- value = self.send(attr)
315
- next if value.nil?
316
- hash[param] = _to_hash(value)
317
- end
318
- hash
319
- end
320
-
321
- # Outputs non-array value in the form of hash
322
- # For object, use to_hash. Otherwise, just return the value
323
- # @param [Object] value Any valid value
324
- # @return [Hash] Returns the value in the form of hash
325
- def _to_hash(value)
326
- if value.is_a?(Array)
327
- value.compact.map { |v| _to_hash(v) }
328
- elsif value.is_a?(Hash)
329
- {}.tap do |hash|
330
- value.each { |k, v| hash[k] = _to_hash(v) }
331
- end
332
- elsif value.respond_to? :to_hash
333
- value.to_hash
334
- else
335
- value
336
- end
337
- end
338
-
339
- end
340
-
341
- end
@@ -1,288 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="stl_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
- # Stl load options
32
- class StlLoadOptions
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
- # Render specific CAD layouts
38
- attr_accessor :layout_names
39
-
40
- # Gets or sets a background color.
41
- attr_accessor :background_color
42
-
43
- # Gets or sets type of drawing.
44
- attr_accessor :draw_type
45
- class EnumAttributeValidator
46
- attr_reader :datatype
47
- attr_reader :allowable_values
48
-
49
- def initialize(datatype, allowable_values)
50
- @allowable_values = allowable_values.map do |value|
51
- case datatype.to_s
52
- when /Integer/i
53
- value.to_i
54
- when /Float/i
55
- value.to_f
56
- else
57
- value
58
- end
59
- end
60
- end
61
-
62
- def valid?(value)
63
- !value || allowable_values.include?(value)
64
- end
65
- end
66
-
67
- # Attribute mapping from ruby-style variable name to JSON key.
68
- def self.attribute_map
69
- {
70
- :'format' => :'Format',
71
- :'layout_names' => :'LayoutNames',
72
- :'background_color' => :'BackgroundColor',
73
- :'draw_type' => :'DrawType'
74
- }
75
- end
76
-
77
- # Attribute type mapping.
78
- def self.swagger_types
79
- {
80
- :'format' => :'String',
81
- :'layout_names' => :'Array<String>',
82
- :'background_color' => :'String',
83
- :'draw_type' => :'String'
84
- }
85
- end
86
-
87
- # Initializes the object
88
- # @param [Hash] attributes Model attributes in the form of hash
89
- def initialize(attributes = {})
90
- return unless attributes.is_a?(Hash)
91
-
92
- # convert string to symbol for hash key
93
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
94
-
95
- if attributes.key?(:'Format')
96
- self.format = attributes[:'Format']
97
- end
98
-
99
- if attributes.key?(:'LayoutNames')
100
- if (value = attributes[:'LayoutNames']).is_a?(Array)
101
- self.layout_names = value
102
- end
103
- end
104
-
105
- if attributes.key?(:'BackgroundColor')
106
- self.background_color = attributes[:'BackgroundColor']
107
- end
108
-
109
- if attributes.key?(:'DrawType')
110
- self.draw_type = attributes[:'DrawType']
111
- end
112
-
113
- end
114
-
115
- # Show invalid properties with the reasons. Usually used together with valid?
116
- # @return Array for valid properies with the reasons
117
- def list_invalid_properties
118
- invalid_properties = []
119
- if @draw_type.nil?
120
- invalid_properties.push("invalid value for 'draw_type', draw_type cannot be nil.")
121
- end
122
-
123
- return invalid_properties
124
- end
125
-
126
- # Check to see if the all the properties in the model are valid
127
- # @return true if the model is valid
128
- def valid?
129
- return false if @draw_type.nil?
130
- draw_type_validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
131
- return false unless draw_type_validator.valid?(@draw_type)
132
- return true
133
- end
134
-
135
- # Custom attribute writer method checking allowed values (enum).
136
- # @param [Object] draw_type Object to be assigned
137
- def draw_type=(draw_type)
138
- validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
139
- if draw_type.to_i == 0
140
- unless validator.valid?(draw_type)
141
- raise ArgumentError, "invalid value for 'draw_type', must be one of #{validator.allowable_values}."
142
- end
143
- @draw_type = draw_type
144
- else
145
- @draw_type = validator.allowable_values[draw_type.to_i]
146
- end
147
- end
148
-
149
- # Checks equality by comparing each attribute.
150
- # @param [Object] Object to be compared
151
- def ==(other)
152
- return true if self.equal?(other)
153
- self.class == other.class &&
154
- format == other.format &&
155
- layout_names == other.layout_names &&
156
- background_color == other.background_color &&
157
- draw_type == other.draw_type
158
- end
159
-
160
- # @see the `==` method
161
- # @param [Object] Object to be compared
162
- def eql?(other)
163
- self == other
164
- end
165
-
166
- # Calculates hash code according to all attributes.
167
- # @return [Fixnum] Hash code
168
- def hash
169
- [format, layout_names, background_color, draw_type].hash
170
- end
171
-
172
- # Downcases first letter.
173
- # @return downcased string
174
- def uncap(str)
175
- str[0, 1].downcase + str[1..-1]
176
- end
177
-
178
- # Builds the object from hash
179
- # @param [Hash] attributes Model attributes in the form of hash
180
- # @return [Object] Returns the model itself
181
- def build_from_hash(attributes)
182
- return nil unless attributes.is_a?(Hash)
183
- self.class.swagger_types.each_pair do |key, type|
184
- pname = uncap(self.class.attribute_map[key]).intern
185
- value = attributes[pname]
186
- if type =~ /\AArray<(.*)>/i
187
- # check to ensure the input is an array given that the the attribute
188
- # is documented as an array but the input is not
189
- if value.is_a?(Array)
190
- self.send("#{key}=", value.map { |v| _deserialize($1, v) })
191
- end
192
- elsif !value.nil?
193
- self.send("#{key}=", _deserialize(type, value))
194
- end
195
- # or else data not found in attributes(hash), not an issue as the data can be optional
196
- end
197
-
198
- self
199
- end
200
-
201
- # Deserializes the data based on type
202
- # @param string type Data type
203
- # @param string value Value to be deserialized
204
- # @return [Object] Deserialized data
205
- def _deserialize(type, value)
206
- case type.to_sym
207
- when :DateTime
208
- Date.parse value
209
- when :Date
210
- Date.parse value
211
- when :String
212
- value.to_s
213
- when :Integer
214
- value.to_i
215
- when :Float
216
- value.to_f
217
- when :BOOLEAN
218
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
219
- true
220
- else
221
- false
222
- end
223
- when :Object
224
- # generic object (usually a Hash), return directly
225
- value
226
- when /\AArray<(?<inner_type>.+)>\z/
227
- inner_type = Regexp.last_match[:inner_type]
228
- value.map { |v| _deserialize(inner_type, v) }
229
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
230
- k_type = Regexp.last_match[:k_type]
231
- v_type = Regexp.last_match[:v_type]
232
- {}.tap do |hash|
233
- value.each do |k, v|
234
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
235
- end
236
- end
237
- else
238
- # model
239
- temp_model = GroupDocsConversionCloud.const_get(type).new
240
- temp_model.build_from_hash(value)
241
- end
242
- end
243
-
244
- # Returns the string representation of the object
245
- # @return [String] String presentation of the object
246
- def to_s
247
- to_hash.to_s
248
- end
249
-
250
- # to_body is an alias to to_hash (backward compatibility)
251
- # @return [Hash] Returns the object in the form of hash
252
- def to_body
253
- to_hash
254
- end
255
-
256
- # Returns the object in the form of hash
257
- # @return [Hash] Returns the object in the form of hash
258
- def to_hash
259
- hash = {}
260
- self.class.attribute_map.each_pair do |attr, param|
261
- value = self.send(attr)
262
- next if value.nil?
263
- hash[param] = _to_hash(value)
264
- end
265
- hash
266
- end
267
-
268
- # Outputs non-array value in the form of hash
269
- # For object, use to_hash. Otherwise, just return the value
270
- # @param [Object] value Any valid value
271
- # @return [Hash] Returns the value in the form of hash
272
- def _to_hash(value)
273
- if value.is_a?(Array)
274
- value.compact.map { |v| _to_hash(v) }
275
- elsif value.is_a?(Hash)
276
- {}.tap do |hash|
277
- value.each { |k, v| hash[k] = _to_hash(v) }
278
- end
279
- elsif value.respond_to? :to_hash
280
- value.to_hash
281
- else
282
- value
283
- end
284
- end
285
-
286
- end
287
-
288
- end