groupdocs_conversion_cloud 19.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (178) hide show
  1. checksums.yaml +7 -0
  2. data/lib/groupdocs_conversion_cloud.rb +205 -0
  3. data/lib/groupdocs_conversion_cloud/api/conversion_api.rb +336 -0
  4. data/lib/groupdocs_conversion_cloud/api/file_api.rb +729 -0
  5. data/lib/groupdocs_conversion_cloud/api/folder_api.rb +694 -0
  6. data/lib/groupdocs_conversion_cloud/api/storage_api.rb +541 -0
  7. data/lib/groupdocs_conversion_cloud/api_client.rb +380 -0
  8. data/lib/groupdocs_conversion_cloud/api_error.rb +58 -0
  9. data/lib/groupdocs_conversion_cloud/configuration.rb +95 -0
  10. data/lib/groupdocs_conversion_cloud/models/bmp_convert_options.rb +361 -0
  11. data/lib/groupdocs_conversion_cloud/models/bmp_load_options.rb +214 -0
  12. data/lib/groupdocs_conversion_cloud/models/cad_load_options.rb +246 -0
  13. data/lib/groupdocs_conversion_cloud/models/cgm_convert_options.rb +361 -0
  14. data/lib/groupdocs_conversion_cloud/models/convert_options.rb +246 -0
  15. data/lib/groupdocs_conversion_cloud/models/convert_settings.rb +312 -0
  16. data/lib/groupdocs_conversion_cloud/models/csv_load_options.rb +279 -0
  17. data/lib/groupdocs_conversion_cloud/models/dcm_convert_options.rb +361 -0
  18. data/lib/groupdocs_conversion_cloud/models/dcm_load_options.rb +214 -0
  19. data/lib/groupdocs_conversion_cloud/models/dgn_load_options.rb +246 -0
  20. data/lib/groupdocs_conversion_cloud/models/diagram_load_options.rb +214 -0
  21. data/lib/groupdocs_conversion_cloud/models/disc_usage.rb +234 -0
  22. data/lib/groupdocs_conversion_cloud/models/djvu_convert_options.rb +361 -0
  23. data/lib/groupdocs_conversion_cloud/models/dng_convert_options.rb +361 -0
  24. data/lib/groupdocs_conversion_cloud/models/dng_load_options.rb +214 -0
  25. data/lib/groupdocs_conversion_cloud/models/doc_convert_options.rb +326 -0
  26. data/lib/groupdocs_conversion_cloud/models/doc_load_options.rb +281 -0
  27. data/lib/groupdocs_conversion_cloud/models/docm_convert_options.rb +326 -0
  28. data/lib/groupdocs_conversion_cloud/models/docm_load_options.rb +281 -0
  29. data/lib/groupdocs_conversion_cloud/models/docx_convert_options.rb +326 -0
  30. data/lib/groupdocs_conversion_cloud/models/docx_load_options.rb +281 -0
  31. data/lib/groupdocs_conversion_cloud/models/dot_convert_options.rb +326 -0
  32. data/lib/groupdocs_conversion_cloud/models/dot_load_options.rb +281 -0
  33. data/lib/groupdocs_conversion_cloud/models/dotm_convert_options.rb +326 -0
  34. data/lib/groupdocs_conversion_cloud/models/dotm_load_options.rb +281 -0
  35. data/lib/groupdocs_conversion_cloud/models/dotx_convert_options.rb +326 -0
  36. data/lib/groupdocs_conversion_cloud/models/dotx_load_options.rb +281 -0
  37. data/lib/groupdocs_conversion_cloud/models/dwf_load_options.rb +246 -0
  38. data/lib/groupdocs_conversion_cloud/models/dwg_load_options.rb +246 -0
  39. data/lib/groupdocs_conversion_cloud/models/dxf_load_options.rb +246 -0
  40. data/lib/groupdocs_conversion_cloud/models/email_load_options.rb +294 -0
  41. data/lib/groupdocs_conversion_cloud/models/emf_convert_options.rb +361 -0
  42. data/lib/groupdocs_conversion_cloud/models/emf_load_options.rb +214 -0
  43. data/lib/groupdocs_conversion_cloud/models/eml_load_options.rb +294 -0
  44. data/lib/groupdocs_conversion_cloud/models/emlx_load_options.rb +294 -0
  45. data/lib/groupdocs_conversion_cloud/models/epub_convert_options.rb +386 -0
  46. data/lib/groupdocs_conversion_cloud/models/error.rb +244 -0
  47. data/lib/groupdocs_conversion_cloud/models/error_details.rb +229 -0
  48. data/lib/groupdocs_conversion_cloud/models/file_version.rb +289 -0
  49. data/lib/groupdocs_conversion_cloud/models/file_versions.rb +216 -0
  50. data/lib/groupdocs_conversion_cloud/models/files_list.rb +216 -0
  51. data/lib/groupdocs_conversion_cloud/models/files_upload_result.rb +228 -0
  52. data/lib/groupdocs_conversion_cloud/models/gif_convert_options.rb +361 -0
  53. data/lib/groupdocs_conversion_cloud/models/gif_load_options.rb +214 -0
  54. data/lib/groupdocs_conversion_cloud/models/html_convert_options.rb +301 -0
  55. data/lib/groupdocs_conversion_cloud/models/ico_convert_options.rb +361 -0
  56. data/lib/groupdocs_conversion_cloud/models/ico_load_options.rb +214 -0
  57. data/lib/groupdocs_conversion_cloud/models/ifc_load_options.rb +246 -0
  58. data/lib/groupdocs_conversion_cloud/models/igs_load_options.rb +246 -0
  59. data/lib/groupdocs_conversion_cloud/models/image_convert_options.rb +361 -0
  60. data/lib/groupdocs_conversion_cloud/models/image_load_options.rb +214 -0
  61. data/lib/groupdocs_conversion_cloud/models/j2c_convert_options.rb +376 -0
  62. data/lib/groupdocs_conversion_cloud/models/j2c_load_options.rb +214 -0
  63. data/lib/groupdocs_conversion_cloud/models/j2k_convert_options.rb +376 -0
  64. data/lib/groupdocs_conversion_cloud/models/j2k_load_options.rb +214 -0
  65. data/lib/groupdocs_conversion_cloud/models/jp2_convert_options.rb +376 -0
  66. data/lib/groupdocs_conversion_cloud/models/jp2_load_options.rb +214 -0
  67. data/lib/groupdocs_conversion_cloud/models/jpeg_convert_options.rb +376 -0
  68. data/lib/groupdocs_conversion_cloud/models/jpeg_load_options.rb +214 -0
  69. data/lib/groupdocs_conversion_cloud/models/jpf_convert_options.rb +376 -0
  70. data/lib/groupdocs_conversion_cloud/models/jpf_load_options.rb +214 -0
  71. data/lib/groupdocs_conversion_cloud/models/jpg_convert_options.rb +376 -0
  72. data/lib/groupdocs_conversion_cloud/models/jpg_load_options.rb +214 -0
  73. data/lib/groupdocs_conversion_cloud/models/jpm_convert_options.rb +376 -0
  74. data/lib/groupdocs_conversion_cloud/models/jpm_load_options.rb +214 -0
  75. data/lib/groupdocs_conversion_cloud/models/jpx_convert_options.rb +376 -0
  76. data/lib/groupdocs_conversion_cloud/models/jpx_load_options.rb +214 -0
  77. data/lib/groupdocs_conversion_cloud/models/load_options.rb +204 -0
  78. data/lib/groupdocs_conversion_cloud/models/mht_load_options.rb +294 -0
  79. data/lib/groupdocs_conversion_cloud/models/mobi_load_options.rb +281 -0
  80. data/lib/groupdocs_conversion_cloud/models/msg_load_options.rb +294 -0
  81. data/lib/groupdocs_conversion_cloud/models/object_exist.rb +234 -0
  82. data/lib/groupdocs_conversion_cloud/models/odg_convert_options.rb +361 -0
  83. data/lib/groupdocs_conversion_cloud/models/odg_load_options.rb +214 -0
  84. data/lib/groupdocs_conversion_cloud/models/odp_convert_options.rb +281 -0
  85. data/lib/groupdocs_conversion_cloud/models/odp_load_options.rb +266 -0
  86. data/lib/groupdocs_conversion_cloud/models/ods_convert_options.rb +296 -0
  87. data/lib/groupdocs_conversion_cloud/models/ods_load_options.rb +321 -0
  88. data/lib/groupdocs_conversion_cloud/models/odt_convert_options.rb +326 -0
  89. data/lib/groupdocs_conversion_cloud/models/odt_load_options.rb +281 -0
  90. data/lib/groupdocs_conversion_cloud/models/one_load_options.rb +236 -0
  91. data/lib/groupdocs_conversion_cloud/models/ost_load_options.rb +294 -0
  92. data/lib/groupdocs_conversion_cloud/models/otp_convert_options.rb +281 -0
  93. data/lib/groupdocs_conversion_cloud/models/otp_load_options.rb +266 -0
  94. data/lib/groupdocs_conversion_cloud/models/ots_convert_options.rb +296 -0
  95. data/lib/groupdocs_conversion_cloud/models/ots_load_options.rb +321 -0
  96. data/lib/groupdocs_conversion_cloud/models/ott_convert_options.rb +326 -0
  97. data/lib/groupdocs_conversion_cloud/models/ott_load_options.rb +281 -0
  98. data/lib/groupdocs_conversion_cloud/models/pdf_convert_options.rb +863 -0
  99. data/lib/groupdocs_conversion_cloud/models/pdf_load_options.rb +259 -0
  100. data/lib/groupdocs_conversion_cloud/models/plt_load_options.rb +246 -0
  101. data/lib/groupdocs_conversion_cloud/models/png_convert_options.rb +361 -0
  102. data/lib/groupdocs_conversion_cloud/models/png_load_options.rb +214 -0
  103. data/lib/groupdocs_conversion_cloud/models/potm_convert_options.rb +281 -0
  104. data/lib/groupdocs_conversion_cloud/models/potm_load_options.rb +266 -0
  105. data/lib/groupdocs_conversion_cloud/models/potx_convert_options.rb +281 -0
  106. data/lib/groupdocs_conversion_cloud/models/potx_load_options.rb +266 -0
  107. data/lib/groupdocs_conversion_cloud/models/pps_convert_options.rb +281 -0
  108. data/lib/groupdocs_conversion_cloud/models/pps_load_options.rb +266 -0
  109. data/lib/groupdocs_conversion_cloud/models/ppsm_convert_options.rb +281 -0
  110. data/lib/groupdocs_conversion_cloud/models/ppsm_load_options.rb +266 -0
  111. data/lib/groupdocs_conversion_cloud/models/ppsx_convert_options.rb +281 -0
  112. data/lib/groupdocs_conversion_cloud/models/ppsx_load_options.rb +266 -0
  113. data/lib/groupdocs_conversion_cloud/models/ppt_convert_options.rb +281 -0
  114. data/lib/groupdocs_conversion_cloud/models/ppt_load_options.rb +266 -0
  115. data/lib/groupdocs_conversion_cloud/models/pptm_convert_options.rb +281 -0
  116. data/lib/groupdocs_conversion_cloud/models/pptm_load_options.rb +266 -0
  117. data/lib/groupdocs_conversion_cloud/models/pptx_convert_options.rb +281 -0
  118. data/lib/groupdocs_conversion_cloud/models/pptx_load_options.rb +266 -0
  119. data/lib/groupdocs_conversion_cloud/models/presentation_convert_options.rb +281 -0
  120. data/lib/groupdocs_conversion_cloud/models/presentation_load_options.rb +266 -0
  121. data/lib/groupdocs_conversion_cloud/models/psd_convert_options.rb +489 -0
  122. data/lib/groupdocs_conversion_cloud/models/psd_load_options.rb +214 -0
  123. data/lib/groupdocs_conversion_cloud/models/pst_load_options.rb +294 -0
  124. data/lib/groupdocs_conversion_cloud/models/rtf_convert_options.rb +341 -0
  125. data/lib/groupdocs_conversion_cloud/models/spreadsheet_convert_options.rb +296 -0
  126. data/lib/groupdocs_conversion_cloud/models/spreadsheet_load_options.rb +321 -0
  127. data/lib/groupdocs_conversion_cloud/models/stl_load_options.rb +246 -0
  128. data/lib/groupdocs_conversion_cloud/models/storage_exist.rb +219 -0
  129. data/lib/groupdocs_conversion_cloud/models/storage_file.rb +264 -0
  130. data/lib/groupdocs_conversion_cloud/models/stored_converted_result.rb +249 -0
  131. data/lib/groupdocs_conversion_cloud/models/supported_format.rb +226 -0
  132. data/lib/groupdocs_conversion_cloud/models/svg_convert_options.rb +331 -0
  133. data/lib/groupdocs_conversion_cloud/models/tif_convert_options.rb +408 -0
  134. data/lib/groupdocs_conversion_cloud/models/tif_load_options.rb +214 -0
  135. data/lib/groupdocs_conversion_cloud/models/tiff_convert_options.rb +408 -0
  136. data/lib/groupdocs_conversion_cloud/models/tiff_load_options.rb +214 -0
  137. data/lib/groupdocs_conversion_cloud/models/tsv_convert_options.rb +296 -0
  138. data/lib/groupdocs_conversion_cloud/models/tsv_load_options.rb +321 -0
  139. data/lib/groupdocs_conversion_cloud/models/txt_convert_options.rb +246 -0
  140. data/lib/groupdocs_conversion_cloud/models/txt_load_options.rb +302 -0
  141. data/lib/groupdocs_conversion_cloud/models/vdw_load_options.rb +214 -0
  142. data/lib/groupdocs_conversion_cloud/models/vdx_load_options.rb +214 -0
  143. data/lib/groupdocs_conversion_cloud/models/vsd_load_options.rb +214 -0
  144. data/lib/groupdocs_conversion_cloud/models/vsdm_load_options.rb +214 -0
  145. data/lib/groupdocs_conversion_cloud/models/vsdx_load_options.rb +214 -0
  146. data/lib/groupdocs_conversion_cloud/models/vss_load_options.rb +214 -0
  147. data/lib/groupdocs_conversion_cloud/models/vssm_load_options.rb +214 -0
  148. data/lib/groupdocs_conversion_cloud/models/vssx_load_options.rb +214 -0
  149. data/lib/groupdocs_conversion_cloud/models/vst_load_options.rb +214 -0
  150. data/lib/groupdocs_conversion_cloud/models/vstm_load_options.rb +214 -0
  151. data/lib/groupdocs_conversion_cloud/models/vstx_load_options.rb +214 -0
  152. data/lib/groupdocs_conversion_cloud/models/vsx_load_options.rb +214 -0
  153. data/lib/groupdocs_conversion_cloud/models/vtx_load_options.rb +214 -0
  154. data/lib/groupdocs_conversion_cloud/models/watermark_options.rb +364 -0
  155. data/lib/groupdocs_conversion_cloud/models/webp_convert_options.rb +376 -0
  156. data/lib/groupdocs_conversion_cloud/models/webp_load_options.rb +214 -0
  157. data/lib/groupdocs_conversion_cloud/models/wmf_convert_options.rb +361 -0
  158. data/lib/groupdocs_conversion_cloud/models/wmf_load_options.rb +214 -0
  159. data/lib/groupdocs_conversion_cloud/models/word_processing_convert_options.rb +326 -0
  160. data/lib/groupdocs_conversion_cloud/models/word_processing_load_options.rb +281 -0
  161. data/lib/groupdocs_conversion_cloud/models/xls2003_convert_options.rb +296 -0
  162. data/lib/groupdocs_conversion_cloud/models/xls2003_load_options.rb +321 -0
  163. data/lib/groupdocs_conversion_cloud/models/xls_convert_options.rb +296 -0
  164. data/lib/groupdocs_conversion_cloud/models/xls_load_options.rb +321 -0
  165. data/lib/groupdocs_conversion_cloud/models/xlsb_convert_options.rb +296 -0
  166. data/lib/groupdocs_conversion_cloud/models/xlsb_load_options.rb +321 -0
  167. data/lib/groupdocs_conversion_cloud/models/xlsm_convert_options.rb +296 -0
  168. data/lib/groupdocs_conversion_cloud/models/xlsm_load_options.rb +321 -0
  169. data/lib/groupdocs_conversion_cloud/models/xlsx_convert_options.rb +296 -0
  170. data/lib/groupdocs_conversion_cloud/models/xlsx_load_options.rb +321 -0
  171. data/lib/groupdocs_conversion_cloud/models/xltm_convert_options.rb +296 -0
  172. data/lib/groupdocs_conversion_cloud/models/xltm_load_options.rb +321 -0
  173. data/lib/groupdocs_conversion_cloud/models/xltx_convert_options.rb +296 -0
  174. data/lib/groupdocs_conversion_cloud/models/xltx_load_options.rb +321 -0
  175. data/lib/groupdocs_conversion_cloud/models/xml_load_options.rb +230 -0
  176. data/lib/groupdocs_conversion_cloud/models/xps_convert_options.rb +386 -0
  177. data/lib/groupdocs_conversion_cloud/version.rb +29 -0
  178. metadata +288 -0
@@ -0,0 +1,246 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="igs_load_options.rb">
4
+ # Copyright (c) 2003-2019 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
+ # Igs load options
32
+ class IgsLoadOptions
33
+
34
+ # Set desired page width for converting CAD document
35
+ attr_accessor :width
36
+
37
+ # Set desired page height for converting CAD document
38
+ attr_accessor :height
39
+
40
+ # Render specific CAD layouts
41
+ attr_accessor :layout_names
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'width' => :'Width',
47
+ :'height' => :'Height',
48
+ :'layout_names' => :'LayoutNames'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ :'width' => :'Integer',
56
+ :'height' => :'Integer',
57
+ :'layout_names' => :'Array<String>'
58
+ }
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ return unless attributes.is_a?(Hash)
65
+
66
+ # convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
+
69
+ if attributes.key?(:'Width')
70
+ self.width = attributes[:'Width']
71
+ end
72
+
73
+ if attributes.key?(:'Height')
74
+ self.height = attributes[:'Height']
75
+ end
76
+
77
+ if attributes.key?(:'LayoutNames')
78
+ if (value = attributes[:'LayoutNames']).is_a?(Array)
79
+ self.layout_names = value
80
+ end
81
+ end
82
+
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properies with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = []
89
+ if @width.nil?
90
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
91
+ end
92
+
93
+ if @height.nil?
94
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
95
+ end
96
+
97
+ return invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ return false if @width.nil?
104
+ return false if @height.nil?
105
+ return true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(other)
111
+ return true if self.equal?(other)
112
+ self.class == other.class &&
113
+ width == other.width &&
114
+ height == other.height &&
115
+ layout_names == other.layout_names
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(other)
121
+ self == other
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Fixnum] Hash code
126
+ def hash
127
+ [width, height, layout_names].hash
128
+ end
129
+
130
+ # Downcases first letter.
131
+ # @return downcased string
132
+ def uncap(str)
133
+ str[0, 1].downcase + str[1..-1]
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ self.class.swagger_types.each_pair do |key, type|
142
+ pname = uncap(self.class.attribute_map[key]).intern
143
+ value = attributes[pname]
144
+ if type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the the attribute
146
+ # is documented as an array but the input is not
147
+ if value.is_a?(Array)
148
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
149
+ end
150
+ elsif !value.nil?
151
+ self.send("#{key}=", _deserialize(type, value))
152
+ end
153
+ # or else data not found in attributes(hash), not an issue as the data can be optional
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :DateTime
166
+ Date.parse value
167
+ when :Date
168
+ Date.parse value
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :BOOLEAN
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else
196
+ # model
197
+ temp_model = GroupDocsConversionCloud.const_get(type).new
198
+ temp_model.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ next if value.nil?
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map { |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+
244
+ end
245
+
246
+ end
@@ -0,0 +1,361 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="image_convert_options.rb">
4
+ # Copyright (c) 2003-2019 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
+ # Options for to Image conversion
32
+ class ImageConvertOptions
33
+
34
+ # Start conversion from FromPage page
35
+ attr_accessor :from_page
36
+
37
+ # Number of pages to convert
38
+ attr_accessor :pages_count
39
+
40
+ # Convert specific pages. The list contains the page indexes of the pages to be converted
41
+ attr_accessor :pages
42
+
43
+ # Desired image width after conversion
44
+ attr_accessor :width
45
+
46
+ # Desired image height after conversion
47
+ attr_accessor :height
48
+
49
+ # Desired image horizontal resolution after conversion. The default resolution is the resolution of the input file or 96dpi
50
+ attr_accessor :horizontal_resolution
51
+
52
+ # Desired image vertical resolution after conversion. The default resolution is the resolution of the input file or 96dpi
53
+ attr_accessor :vertical_resolution
54
+
55
+ # Convert to grayscale image
56
+ attr_accessor :grayscale
57
+
58
+ # Image rotation angle
59
+ attr_accessor :rotate_angle
60
+
61
+ # If true, the input firstly is converted to PDF and after that to desired format
62
+ attr_accessor :use_pdf
63
+
64
+ # Watermark specific options
65
+ attr_accessor :watermark_options
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ :'from_page' => :'FromPage',
71
+ :'pages_count' => :'PagesCount',
72
+ :'pages' => :'Pages',
73
+ :'width' => :'Width',
74
+ :'height' => :'Height',
75
+ :'horizontal_resolution' => :'HorizontalResolution',
76
+ :'vertical_resolution' => :'VerticalResolution',
77
+ :'grayscale' => :'Grayscale',
78
+ :'rotate_angle' => :'RotateAngle',
79
+ :'use_pdf' => :'UsePdf',
80
+ :'watermark_options' => :'WatermarkOptions'
81
+ }
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.swagger_types
86
+ {
87
+ :'from_page' => :'Integer',
88
+ :'pages_count' => :'Integer',
89
+ :'pages' => :'Array<Integer>',
90
+ :'width' => :'Integer',
91
+ :'height' => :'Integer',
92
+ :'horizontal_resolution' => :'Integer',
93
+ :'vertical_resolution' => :'Integer',
94
+ :'grayscale' => :'BOOLEAN',
95
+ :'rotate_angle' => :'Integer',
96
+ :'use_pdf' => :'BOOLEAN',
97
+ :'watermark_options' => :'WatermarkOptions'
98
+ }
99
+ end
100
+
101
+ # Initializes the object
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ def initialize(attributes = {})
104
+ return unless attributes.is_a?(Hash)
105
+
106
+ # convert string to symbol for hash key
107
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
108
+
109
+ if attributes.key?(:'FromPage')
110
+ self.from_page = attributes[:'FromPage']
111
+ end
112
+
113
+ if attributes.key?(:'PagesCount')
114
+ self.pages_count = attributes[:'PagesCount']
115
+ end
116
+
117
+ if attributes.key?(:'Pages')
118
+ if (value = attributes[:'Pages']).is_a?(Array)
119
+ self.pages = value
120
+ end
121
+ end
122
+
123
+ if attributes.key?(:'Width')
124
+ self.width = attributes[:'Width']
125
+ end
126
+
127
+ if attributes.key?(:'Height')
128
+ self.height = attributes[:'Height']
129
+ end
130
+
131
+ if attributes.key?(:'HorizontalResolution')
132
+ self.horizontal_resolution = attributes[:'HorizontalResolution']
133
+ end
134
+
135
+ if attributes.key?(:'VerticalResolution')
136
+ self.vertical_resolution = attributes[:'VerticalResolution']
137
+ end
138
+
139
+ if attributes.key?(:'Grayscale')
140
+ self.grayscale = attributes[:'Grayscale']
141
+ end
142
+
143
+ if attributes.key?(:'RotateAngle')
144
+ self.rotate_angle = attributes[:'RotateAngle']
145
+ end
146
+
147
+ if attributes.key?(:'UsePdf')
148
+ self.use_pdf = attributes[:'UsePdf']
149
+ end
150
+
151
+ if attributes.key?(:'WatermarkOptions')
152
+ self.watermark_options = attributes[:'WatermarkOptions']
153
+ end
154
+
155
+ end
156
+
157
+ # Show invalid properties with the reasons. Usually used together with valid?
158
+ # @return Array for valid properies with the reasons
159
+ def list_invalid_properties
160
+ invalid_properties = []
161
+ if @from_page.nil?
162
+ invalid_properties.push("invalid value for 'from_page', from_page cannot be nil.")
163
+ end
164
+
165
+ if @pages_count.nil?
166
+ invalid_properties.push("invalid value for 'pages_count', pages_count cannot be nil.")
167
+ end
168
+
169
+ if @width.nil?
170
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
171
+ end
172
+
173
+ if @height.nil?
174
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
175
+ end
176
+
177
+ if @horizontal_resolution.nil?
178
+ invalid_properties.push("invalid value for 'horizontal_resolution', horizontal_resolution cannot be nil.")
179
+ end
180
+
181
+ if @vertical_resolution.nil?
182
+ invalid_properties.push("invalid value for 'vertical_resolution', vertical_resolution cannot be nil.")
183
+ end
184
+
185
+ if @grayscale.nil?
186
+ invalid_properties.push("invalid value for 'grayscale', grayscale cannot be nil.")
187
+ end
188
+
189
+ if @rotate_angle.nil?
190
+ invalid_properties.push("invalid value for 'rotate_angle', rotate_angle cannot be nil.")
191
+ end
192
+
193
+ if @use_pdf.nil?
194
+ invalid_properties.push("invalid value for 'use_pdf', use_pdf cannot be nil.")
195
+ end
196
+
197
+ return invalid_properties
198
+ end
199
+
200
+ # Check to see if the all the properties in the model are valid
201
+ # @return true if the model is valid
202
+ def valid?
203
+ return false if @from_page.nil?
204
+ return false if @pages_count.nil?
205
+ return false if @width.nil?
206
+ return false if @height.nil?
207
+ return false if @horizontal_resolution.nil?
208
+ return false if @vertical_resolution.nil?
209
+ return false if @grayscale.nil?
210
+ return false if @rotate_angle.nil?
211
+ return false if @use_pdf.nil?
212
+ return true
213
+ end
214
+
215
+ # Checks equality by comparing each attribute.
216
+ # @param [Object] Object to be compared
217
+ def ==(other)
218
+ return true if self.equal?(other)
219
+ self.class == other.class &&
220
+ from_page == other.from_page &&
221
+ pages_count == other.pages_count &&
222
+ pages == other.pages &&
223
+ width == other.width &&
224
+ height == other.height &&
225
+ horizontal_resolution == other.horizontal_resolution &&
226
+ vertical_resolution == other.vertical_resolution &&
227
+ grayscale == other.grayscale &&
228
+ rotate_angle == other.rotate_angle &&
229
+ use_pdf == other.use_pdf &&
230
+ watermark_options == other.watermark_options
231
+ end
232
+
233
+ # @see the `==` method
234
+ # @param [Object] Object to be compared
235
+ def eql?(other)
236
+ self == other
237
+ end
238
+
239
+ # Calculates hash code according to all attributes.
240
+ # @return [Fixnum] Hash code
241
+ def hash
242
+ [from_page, pages_count, pages, width, height, horizontal_resolution, vertical_resolution, grayscale, rotate_angle, use_pdf, watermark_options].hash
243
+ end
244
+
245
+ # Downcases first letter.
246
+ # @return downcased string
247
+ def uncap(str)
248
+ str[0, 1].downcase + str[1..-1]
249
+ end
250
+
251
+ # Builds the object from hash
252
+ # @param [Hash] attributes Model attributes in the form of hash
253
+ # @return [Object] Returns the model itself
254
+ def build_from_hash(attributes)
255
+ return nil unless attributes.is_a?(Hash)
256
+ self.class.swagger_types.each_pair do |key, type|
257
+ pname = uncap(self.class.attribute_map[key]).intern
258
+ value = attributes[pname]
259
+ if type =~ /\AArray<(.*)>/i
260
+ # check to ensure the input is an array given that the the attribute
261
+ # is documented as an array but the input is not
262
+ if value.is_a?(Array)
263
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
264
+ end
265
+ elsif !value.nil?
266
+ self.send("#{key}=", _deserialize(type, value))
267
+ end
268
+ # or else data not found in attributes(hash), not an issue as the data can be optional
269
+ end
270
+
271
+ self
272
+ end
273
+
274
+ # Deserializes the data based on type
275
+ # @param string type Data type
276
+ # @param string value Value to be deserialized
277
+ # @return [Object] Deserialized data
278
+ def _deserialize(type, value)
279
+ case type.to_sym
280
+ when :DateTime
281
+ Date.parse value
282
+ when :Date
283
+ Date.parse value
284
+ when :String
285
+ value.to_s
286
+ when :Integer
287
+ value.to_i
288
+ when :Float
289
+ value.to_f
290
+ when :BOOLEAN
291
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
292
+ true
293
+ else
294
+ false
295
+ end
296
+ when :Object
297
+ # generic object (usually a Hash), return directly
298
+ value
299
+ when /\AArray<(?<inner_type>.+)>\z/
300
+ inner_type = Regexp.last_match[:inner_type]
301
+ value.map { |v| _deserialize(inner_type, v) }
302
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
303
+ k_type = Regexp.last_match[:k_type]
304
+ v_type = Regexp.last_match[:v_type]
305
+ {}.tap do |hash|
306
+ value.each do |k, v|
307
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
308
+ end
309
+ end
310
+ else
311
+ # model
312
+ temp_model = GroupDocsConversionCloud.const_get(type).new
313
+ temp_model.build_from_hash(value)
314
+ end
315
+ end
316
+
317
+ # Returns the string representation of the object
318
+ # @return [String] String presentation of the object
319
+ def to_s
320
+ to_hash.to_s
321
+ end
322
+
323
+ # to_body is an alias to to_hash (backward compatibility)
324
+ # @return [Hash] Returns the object in the form of hash
325
+ def to_body
326
+ to_hash
327
+ end
328
+
329
+ # Returns the object in the form of hash
330
+ # @return [Hash] Returns the object in the form of hash
331
+ def to_hash
332
+ hash = {}
333
+ self.class.attribute_map.each_pair do |attr, param|
334
+ value = self.send(attr)
335
+ next if value.nil?
336
+ hash[param] = _to_hash(value)
337
+ end
338
+ hash
339
+ end
340
+
341
+ # Outputs non-array value in the form of hash
342
+ # For object, use to_hash. Otherwise, just return the value
343
+ # @param [Object] value Any valid value
344
+ # @return [Hash] Returns the value in the form of hash
345
+ def _to_hash(value)
346
+ if value.is_a?(Array)
347
+ value.compact.map { |v| _to_hash(v) }
348
+ elsif value.is_a?(Hash)
349
+ {}.tap do |hash|
350
+ value.each { |k, v| hash[k] = _to_hash(v) }
351
+ end
352
+ elsif value.respond_to? :to_hash
353
+ value.to_hash
354
+ else
355
+ value
356
+ end
357
+ end
358
+
359
+ end
360
+
361
+ end