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,224 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="vstx_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
- # Vstx load options
32
- class VstxLoadOptions
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 Diagram document. 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
@@ -1,224 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="vsx_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
- # Vsx load options
32
- class VsxLoadOptions
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 Diagram document. 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
@@ -1,224 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="vtx_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
- # Vtx load options
32
- class VtxLoadOptions
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 Diagram document. 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