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,298 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="dwf_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
- # Dwf load options
32
- class DwfLoadOptions
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
- # A type of drawing.
41
- attr_accessor :draw_type
42
-
43
- # A foreground color.
44
- attr_accessor :draw_color
45
-
46
- # A background color.
47
- attr_accessor :background_color
48
- class EnumAttributeValidator
49
- attr_reader :datatype
50
- attr_reader :allowable_values
51
-
52
- def initialize(datatype, allowable_values)
53
- @allowable_values = allowable_values.map do |value|
54
- case datatype.to_s
55
- when /Integer/i
56
- value.to_i
57
- when /Float/i
58
- value.to_f
59
- else
60
- value
61
- end
62
- end
63
- end
64
-
65
- def valid?(value)
66
- !value || allowable_values.include?(value)
67
- end
68
- end
69
-
70
- # Attribute mapping from ruby-style variable name to JSON key.
71
- def self.attribute_map
72
- {
73
- :'format' => :'Format',
74
- :'layout_names' => :'LayoutNames',
75
- :'draw_type' => :'DrawType',
76
- :'draw_color' => :'DrawColor',
77
- :'background_color' => :'BackgroundColor'
78
- }
79
- end
80
-
81
- # Attribute type mapping.
82
- def self.swagger_types
83
- {
84
- :'format' => :'String',
85
- :'layout_names' => :'Array<String>',
86
- :'draw_type' => :'String',
87
- :'draw_color' => :'String',
88
- :'background_color' => :'String'
89
- }
90
- end
91
-
92
- # Initializes the object
93
- # @param [Hash] attributes Model attributes in the form of hash
94
- def initialize(attributes = {})
95
- return unless attributes.is_a?(Hash)
96
-
97
- # convert string to symbol for hash key
98
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
99
-
100
- if attributes.key?(:'Format')
101
- self.format = attributes[:'Format']
102
- end
103
-
104
- if attributes.key?(:'LayoutNames')
105
- if (value = attributes[:'LayoutNames']).is_a?(Array)
106
- self.layout_names = value
107
- end
108
- end
109
-
110
- if attributes.key?(:'DrawType')
111
- self.draw_type = attributes[:'DrawType']
112
- end
113
-
114
- if attributes.key?(:'DrawColor')
115
- self.draw_color = attributes[:'DrawColor']
116
- end
117
-
118
- if attributes.key?(:'BackgroundColor')
119
- self.background_color = attributes[:'BackgroundColor']
120
- end
121
-
122
- end
123
-
124
- # Show invalid properties with the reasons. Usually used together with valid?
125
- # @return Array for valid properies with the reasons
126
- def list_invalid_properties
127
- invalid_properties = []
128
- if @draw_type.nil?
129
- invalid_properties.push("invalid value for 'draw_type', draw_type cannot be nil.")
130
- end
131
-
132
- return invalid_properties
133
- end
134
-
135
- # Check to see if the all the properties in the model are valid
136
- # @return true if the model is valid
137
- def valid?
138
- return false if @draw_type.nil?
139
- draw_type_validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
140
- return false unless draw_type_validator.valid?(@draw_type)
141
- return true
142
- end
143
-
144
- # Custom attribute writer method checking allowed values (enum).
145
- # @param [Object] draw_type Object to be assigned
146
- def draw_type=(draw_type)
147
- validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
148
- if draw_type.to_i == 0
149
- unless validator.valid?(draw_type)
150
- raise ArgumentError, "invalid value for 'draw_type', must be one of #{validator.allowable_values}."
151
- end
152
- @draw_type = draw_type
153
- else
154
- @draw_type = validator.allowable_values[draw_type.to_i]
155
- end
156
- end
157
-
158
- # Checks equality by comparing each attribute.
159
- # @param [Object] Object to be compared
160
- def ==(other)
161
- return true if self.equal?(other)
162
- self.class == other.class &&
163
- format == other.format &&
164
- layout_names == other.layout_names &&
165
- draw_type == other.draw_type &&
166
- draw_color == other.draw_color &&
167
- background_color == other.background_color
168
- end
169
-
170
- # @see the `==` method
171
- # @param [Object] Object to be compared
172
- def eql?(other)
173
- self == other
174
- end
175
-
176
- # Calculates hash code according to all attributes.
177
- # @return [Fixnum] Hash code
178
- def hash
179
- [format, layout_names, draw_type, draw_color, background_color].hash
180
- end
181
-
182
- # Downcases first letter.
183
- # @return downcased string
184
- def uncap(str)
185
- str[0, 1].downcase + str[1..-1]
186
- end
187
-
188
- # Builds the object from hash
189
- # @param [Hash] attributes Model attributes in the form of hash
190
- # @return [Object] Returns the model itself
191
- def build_from_hash(attributes)
192
- return nil unless attributes.is_a?(Hash)
193
- self.class.swagger_types.each_pair do |key, type|
194
- pname = uncap(self.class.attribute_map[key]).intern
195
- value = attributes[pname]
196
- if type =~ /\AArray<(.*)>/i
197
- # check to ensure the input is an array given that the the attribute
198
- # is documented as an array but the input is not
199
- if value.is_a?(Array)
200
- self.send("#{key}=", value.map { |v| _deserialize($1, v) })
201
- end
202
- elsif !value.nil?
203
- self.send("#{key}=", _deserialize(type, value))
204
- end
205
- # or else data not found in attributes(hash), not an issue as the data can be optional
206
- end
207
-
208
- self
209
- end
210
-
211
- # Deserializes the data based on type
212
- # @param string type Data type
213
- # @param string value Value to be deserialized
214
- # @return [Object] Deserialized data
215
- def _deserialize(type, value)
216
- case type.to_sym
217
- when :DateTime
218
- Date.parse value
219
- when :Date
220
- Date.parse value
221
- when :String
222
- value.to_s
223
- when :Integer
224
- value.to_i
225
- when :Float
226
- value.to_f
227
- when :BOOLEAN
228
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
229
- true
230
- else
231
- false
232
- end
233
- when :Object
234
- # generic object (usually a Hash), return directly
235
- value
236
- when /\AArray<(?<inner_type>.+)>\z/
237
- inner_type = Regexp.last_match[:inner_type]
238
- value.map { |v| _deserialize(inner_type, v) }
239
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
240
- k_type = Regexp.last_match[:k_type]
241
- v_type = Regexp.last_match[:v_type]
242
- {}.tap do |hash|
243
- value.each do |k, v|
244
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
245
- end
246
- end
247
- else
248
- # model
249
- temp_model = GroupDocsConversionCloud.const_get(type).new
250
- temp_model.build_from_hash(value)
251
- end
252
- end
253
-
254
- # Returns the string representation of the object
255
- # @return [String] String presentation of the object
256
- def to_s
257
- to_hash.to_s
258
- end
259
-
260
- # to_body is an alias to to_hash (backward compatibility)
261
- # @return [Hash] Returns the object in the form of hash
262
- def to_body
263
- to_hash
264
- end
265
-
266
- # Returns the object in the form of hash
267
- # @return [Hash] Returns the object in the form of hash
268
- def to_hash
269
- hash = {}
270
- self.class.attribute_map.each_pair do |attr, param|
271
- value = self.send(attr)
272
- next if value.nil?
273
- hash[param] = _to_hash(value)
274
- end
275
- hash
276
- end
277
-
278
- # Outputs non-array value in the form of hash
279
- # For object, use to_hash. Otherwise, just return the value
280
- # @param [Object] value Any valid value
281
- # @return [Hash] Returns the value in the form of hash
282
- def _to_hash(value)
283
- if value.is_a?(Array)
284
- value.compact.map { |v| _to_hash(v) }
285
- elsif value.is_a?(Hash)
286
- {}.tap do |hash|
287
- value.each { |k, v| hash[k] = _to_hash(v) }
288
- end
289
- elsif value.respond_to? :to_hash
290
- value.to_hash
291
- else
292
- value
293
- end
294
- end
295
-
296
- end
297
-
298
- end
@@ -1,298 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="dwfx_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
- # Dwfx load options
32
- class DwfxLoadOptions
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
- # A type of drawing.
41
- attr_accessor :draw_type
42
-
43
- # A foreground color.
44
- attr_accessor :draw_color
45
-
46
- # A background color.
47
- attr_accessor :background_color
48
- class EnumAttributeValidator
49
- attr_reader :datatype
50
- attr_reader :allowable_values
51
-
52
- def initialize(datatype, allowable_values)
53
- @allowable_values = allowable_values.map do |value|
54
- case datatype.to_s
55
- when /Integer/i
56
- value.to_i
57
- when /Float/i
58
- value.to_f
59
- else
60
- value
61
- end
62
- end
63
- end
64
-
65
- def valid?(value)
66
- !value || allowable_values.include?(value)
67
- end
68
- end
69
-
70
- # Attribute mapping from ruby-style variable name to JSON key.
71
- def self.attribute_map
72
- {
73
- :'format' => :'Format',
74
- :'layout_names' => :'LayoutNames',
75
- :'draw_type' => :'DrawType',
76
- :'draw_color' => :'DrawColor',
77
- :'background_color' => :'BackgroundColor'
78
- }
79
- end
80
-
81
- # Attribute type mapping.
82
- def self.swagger_types
83
- {
84
- :'format' => :'String',
85
- :'layout_names' => :'Array<String>',
86
- :'draw_type' => :'String',
87
- :'draw_color' => :'String',
88
- :'background_color' => :'String'
89
- }
90
- end
91
-
92
- # Initializes the object
93
- # @param [Hash] attributes Model attributes in the form of hash
94
- def initialize(attributes = {})
95
- return unless attributes.is_a?(Hash)
96
-
97
- # convert string to symbol for hash key
98
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
99
-
100
- if attributes.key?(:'Format')
101
- self.format = attributes[:'Format']
102
- end
103
-
104
- if attributes.key?(:'LayoutNames')
105
- if (value = attributes[:'LayoutNames']).is_a?(Array)
106
- self.layout_names = value
107
- end
108
- end
109
-
110
- if attributes.key?(:'DrawType')
111
- self.draw_type = attributes[:'DrawType']
112
- end
113
-
114
- if attributes.key?(:'DrawColor')
115
- self.draw_color = attributes[:'DrawColor']
116
- end
117
-
118
- if attributes.key?(:'BackgroundColor')
119
- self.background_color = attributes[:'BackgroundColor']
120
- end
121
-
122
- end
123
-
124
- # Show invalid properties with the reasons. Usually used together with valid?
125
- # @return Array for valid properies with the reasons
126
- def list_invalid_properties
127
- invalid_properties = []
128
- if @draw_type.nil?
129
- invalid_properties.push("invalid value for 'draw_type', draw_type cannot be nil.")
130
- end
131
-
132
- return invalid_properties
133
- end
134
-
135
- # Check to see if the all the properties in the model are valid
136
- # @return true if the model is valid
137
- def valid?
138
- return false if @draw_type.nil?
139
- draw_type_validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
140
- return false unless draw_type_validator.valid?(@draw_type)
141
- return true
142
- end
143
-
144
- # Custom attribute writer method checking allowed values (enum).
145
- # @param [Object] draw_type Object to be assigned
146
- def draw_type=(draw_type)
147
- validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
148
- if draw_type.to_i == 0
149
- unless validator.valid?(draw_type)
150
- raise ArgumentError, "invalid value for 'draw_type', must be one of #{validator.allowable_values}."
151
- end
152
- @draw_type = draw_type
153
- else
154
- @draw_type = validator.allowable_values[draw_type.to_i]
155
- end
156
- end
157
-
158
- # Checks equality by comparing each attribute.
159
- # @param [Object] Object to be compared
160
- def ==(other)
161
- return true if self.equal?(other)
162
- self.class == other.class &&
163
- format == other.format &&
164
- layout_names == other.layout_names &&
165
- draw_type == other.draw_type &&
166
- draw_color == other.draw_color &&
167
- background_color == other.background_color
168
- end
169
-
170
- # @see the `==` method
171
- # @param [Object] Object to be compared
172
- def eql?(other)
173
- self == other
174
- end
175
-
176
- # Calculates hash code according to all attributes.
177
- # @return [Fixnum] Hash code
178
- def hash
179
- [format, layout_names, draw_type, draw_color, background_color].hash
180
- end
181
-
182
- # Downcases first letter.
183
- # @return downcased string
184
- def uncap(str)
185
- str[0, 1].downcase + str[1..-1]
186
- end
187
-
188
- # Builds the object from hash
189
- # @param [Hash] attributes Model attributes in the form of hash
190
- # @return [Object] Returns the model itself
191
- def build_from_hash(attributes)
192
- return nil unless attributes.is_a?(Hash)
193
- self.class.swagger_types.each_pair do |key, type|
194
- pname = uncap(self.class.attribute_map[key]).intern
195
- value = attributes[pname]
196
- if type =~ /\AArray<(.*)>/i
197
- # check to ensure the input is an array given that the the attribute
198
- # is documented as an array but the input is not
199
- if value.is_a?(Array)
200
- self.send("#{key}=", value.map { |v| _deserialize($1, v) })
201
- end
202
- elsif !value.nil?
203
- self.send("#{key}=", _deserialize(type, value))
204
- end
205
- # or else data not found in attributes(hash), not an issue as the data can be optional
206
- end
207
-
208
- self
209
- end
210
-
211
- # Deserializes the data based on type
212
- # @param string type Data type
213
- # @param string value Value to be deserialized
214
- # @return [Object] Deserialized data
215
- def _deserialize(type, value)
216
- case type.to_sym
217
- when :DateTime
218
- Date.parse value
219
- when :Date
220
- Date.parse value
221
- when :String
222
- value.to_s
223
- when :Integer
224
- value.to_i
225
- when :Float
226
- value.to_f
227
- when :BOOLEAN
228
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
229
- true
230
- else
231
- false
232
- end
233
- when :Object
234
- # generic object (usually a Hash), return directly
235
- value
236
- when /\AArray<(?<inner_type>.+)>\z/
237
- inner_type = Regexp.last_match[:inner_type]
238
- value.map { |v| _deserialize(inner_type, v) }
239
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
240
- k_type = Regexp.last_match[:k_type]
241
- v_type = Regexp.last_match[:v_type]
242
- {}.tap do |hash|
243
- value.each do |k, v|
244
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
245
- end
246
- end
247
- else
248
- # model
249
- temp_model = GroupDocsConversionCloud.const_get(type).new
250
- temp_model.build_from_hash(value)
251
- end
252
- end
253
-
254
- # Returns the string representation of the object
255
- # @return [String] String presentation of the object
256
- def to_s
257
- to_hash.to_s
258
- end
259
-
260
- # to_body is an alias to to_hash (backward compatibility)
261
- # @return [Hash] Returns the object in the form of hash
262
- def to_body
263
- to_hash
264
- end
265
-
266
- # Returns the object in the form of hash
267
- # @return [Hash] Returns the object in the form of hash
268
- def to_hash
269
- hash = {}
270
- self.class.attribute_map.each_pair do |attr, param|
271
- value = self.send(attr)
272
- next if value.nil?
273
- hash[param] = _to_hash(value)
274
- end
275
- hash
276
- end
277
-
278
- # Outputs non-array value in the form of hash
279
- # For object, use to_hash. Otherwise, just return the value
280
- # @param [Object] value Any valid value
281
- # @return [Hash] Returns the value in the form of hash
282
- def _to_hash(value)
283
- if value.is_a?(Array)
284
- value.compact.map { |v| _to_hash(v) }
285
- elsif value.is_a?(Hash)
286
- {}.tap do |hash|
287
- value.each { |k, v| hash[k] = _to_hash(v) }
288
- end
289
- elsif value.respond_to? :to_hash
290
- value.to_hash
291
- else
292
- value
293
- end
294
- end
295
-
296
- end
297
-
298
- end