groupdocs_conversion_cloud 19.4

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 (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,331 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="svg_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
+ # Svg convert options
32
+ class SvgConvertOptions
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
+ # Convert to grayscale image
50
+ attr_accessor :grayscale
51
+
52
+ # Image rotation angle
53
+ attr_accessor :rotate_angle
54
+
55
+ # If true, the input firstly is converted to PDF and after that to desired format
56
+ attr_accessor :use_pdf
57
+
58
+ # Watermark specific options
59
+ attr_accessor :watermark_options
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'from_page' => :'FromPage',
65
+ :'pages_count' => :'PagesCount',
66
+ :'pages' => :'Pages',
67
+ :'width' => :'Width',
68
+ :'height' => :'Height',
69
+ :'grayscale' => :'Grayscale',
70
+ :'rotate_angle' => :'RotateAngle',
71
+ :'use_pdf' => :'UsePdf',
72
+ :'watermark_options' => :'WatermarkOptions'
73
+ }
74
+ end
75
+
76
+ # Attribute type mapping.
77
+ def self.swagger_types
78
+ {
79
+ :'from_page' => :'Integer',
80
+ :'pages_count' => :'Integer',
81
+ :'pages' => :'Array<Integer>',
82
+ :'width' => :'Integer',
83
+ :'height' => :'Integer',
84
+ :'grayscale' => :'BOOLEAN',
85
+ :'rotate_angle' => :'Integer',
86
+ :'use_pdf' => :'BOOLEAN',
87
+ :'watermark_options' => :'WatermarkOptions'
88
+ }
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ return unless attributes.is_a?(Hash)
95
+
96
+ # convert string to symbol for hash key
97
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
98
+
99
+ if attributes.key?(:'FromPage')
100
+ self.from_page = attributes[:'FromPage']
101
+ end
102
+
103
+ if attributes.key?(:'PagesCount')
104
+ self.pages_count = attributes[:'PagesCount']
105
+ end
106
+
107
+ if attributes.key?(:'Pages')
108
+ if (value = attributes[:'Pages']).is_a?(Array)
109
+ self.pages = value
110
+ end
111
+ end
112
+
113
+ if attributes.key?(:'Width')
114
+ self.width = attributes[:'Width']
115
+ end
116
+
117
+ if attributes.key?(:'Height')
118
+ self.height = attributes[:'Height']
119
+ end
120
+
121
+ if attributes.key?(:'Grayscale')
122
+ self.grayscale = attributes[:'Grayscale']
123
+ end
124
+
125
+ if attributes.key?(:'RotateAngle')
126
+ self.rotate_angle = attributes[:'RotateAngle']
127
+ end
128
+
129
+ if attributes.key?(:'UsePdf')
130
+ self.use_pdf = attributes[:'UsePdf']
131
+ end
132
+
133
+ if attributes.key?(:'WatermarkOptions')
134
+ self.watermark_options = attributes[:'WatermarkOptions']
135
+ end
136
+
137
+ end
138
+
139
+ # Show invalid properties with the reasons. Usually used together with valid?
140
+ # @return Array for valid properies with the reasons
141
+ def list_invalid_properties
142
+ invalid_properties = []
143
+ if @from_page.nil?
144
+ invalid_properties.push("invalid value for 'from_page', from_page cannot be nil.")
145
+ end
146
+
147
+ if @pages_count.nil?
148
+ invalid_properties.push("invalid value for 'pages_count', pages_count cannot be nil.")
149
+ end
150
+
151
+ if @width.nil?
152
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
153
+ end
154
+
155
+ if @height.nil?
156
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
157
+ end
158
+
159
+ if @grayscale.nil?
160
+ invalid_properties.push("invalid value for 'grayscale', grayscale cannot be nil.")
161
+ end
162
+
163
+ if @rotate_angle.nil?
164
+ invalid_properties.push("invalid value for 'rotate_angle', rotate_angle cannot be nil.")
165
+ end
166
+
167
+ if @use_pdf.nil?
168
+ invalid_properties.push("invalid value for 'use_pdf', use_pdf cannot be nil.")
169
+ end
170
+
171
+ return invalid_properties
172
+ end
173
+
174
+ # Check to see if the all the properties in the model are valid
175
+ # @return true if the model is valid
176
+ def valid?
177
+ return false if @from_page.nil?
178
+ return false if @pages_count.nil?
179
+ return false if @width.nil?
180
+ return false if @height.nil?
181
+ return false if @grayscale.nil?
182
+ return false if @rotate_angle.nil?
183
+ return false if @use_pdf.nil?
184
+ return true
185
+ end
186
+
187
+ # Checks equality by comparing each attribute.
188
+ # @param [Object] Object to be compared
189
+ def ==(other)
190
+ return true if self.equal?(other)
191
+ self.class == other.class &&
192
+ from_page == other.from_page &&
193
+ pages_count == other.pages_count &&
194
+ pages == other.pages &&
195
+ width == other.width &&
196
+ height == other.height &&
197
+ grayscale == other.grayscale &&
198
+ rotate_angle == other.rotate_angle &&
199
+ use_pdf == other.use_pdf &&
200
+ watermark_options == other.watermark_options
201
+ end
202
+
203
+ # @see the `==` method
204
+ # @param [Object] Object to be compared
205
+ def eql?(other)
206
+ self == other
207
+ end
208
+
209
+ # Calculates hash code according to all attributes.
210
+ # @return [Fixnum] Hash code
211
+ def hash
212
+ [from_page, pages_count, pages, width, height, grayscale, rotate_angle, use_pdf, watermark_options].hash
213
+ end
214
+
215
+ # Downcases first letter.
216
+ # @return downcased string
217
+ def uncap(str)
218
+ str[0, 1].downcase + str[1..-1]
219
+ end
220
+
221
+ # Builds the object from hash
222
+ # @param [Hash] attributes Model attributes in the form of hash
223
+ # @return [Object] Returns the model itself
224
+ def build_from_hash(attributes)
225
+ return nil unless attributes.is_a?(Hash)
226
+ self.class.swagger_types.each_pair do |key, type|
227
+ pname = uncap(self.class.attribute_map[key]).intern
228
+ value = attributes[pname]
229
+ if type =~ /\AArray<(.*)>/i
230
+ # check to ensure the input is an array given that the the attribute
231
+ # is documented as an array but the input is not
232
+ if value.is_a?(Array)
233
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
234
+ end
235
+ elsif !value.nil?
236
+ self.send("#{key}=", _deserialize(type, value))
237
+ end
238
+ # or else data not found in attributes(hash), not an issue as the data can be optional
239
+ end
240
+
241
+ self
242
+ end
243
+
244
+ # Deserializes the data based on type
245
+ # @param string type Data type
246
+ # @param string value Value to be deserialized
247
+ # @return [Object] Deserialized data
248
+ def _deserialize(type, value)
249
+ case type.to_sym
250
+ when :DateTime
251
+ Date.parse value
252
+ when :Date
253
+ Date.parse value
254
+ when :String
255
+ value.to_s
256
+ when :Integer
257
+ value.to_i
258
+ when :Float
259
+ value.to_f
260
+ when :BOOLEAN
261
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
262
+ true
263
+ else
264
+ false
265
+ end
266
+ when :Object
267
+ # generic object (usually a Hash), return directly
268
+ value
269
+ when /\AArray<(?<inner_type>.+)>\z/
270
+ inner_type = Regexp.last_match[:inner_type]
271
+ value.map { |v| _deserialize(inner_type, v) }
272
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
273
+ k_type = Regexp.last_match[:k_type]
274
+ v_type = Regexp.last_match[:v_type]
275
+ {}.tap do |hash|
276
+ value.each do |k, v|
277
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
278
+ end
279
+ end
280
+ else
281
+ # model
282
+ temp_model = GroupDocsConversionCloud.const_get(type).new
283
+ temp_model.build_from_hash(value)
284
+ end
285
+ end
286
+
287
+ # Returns the string representation of the object
288
+ # @return [String] String presentation of the object
289
+ def to_s
290
+ to_hash.to_s
291
+ end
292
+
293
+ # to_body is an alias to to_hash (backward compatibility)
294
+ # @return [Hash] Returns the object in the form of hash
295
+ def to_body
296
+ to_hash
297
+ end
298
+
299
+ # Returns the object in the form of hash
300
+ # @return [Hash] Returns the object in the form of hash
301
+ def to_hash
302
+ hash = {}
303
+ self.class.attribute_map.each_pair do |attr, param|
304
+ value = self.send(attr)
305
+ next if value.nil?
306
+ hash[param] = _to_hash(value)
307
+ end
308
+ hash
309
+ end
310
+
311
+ # Outputs non-array value in the form of hash
312
+ # For object, use to_hash. Otherwise, just return the value
313
+ # @param [Object] value Any valid value
314
+ # @return [Hash] Returns the value in the form of hash
315
+ def _to_hash(value)
316
+ if value.is_a?(Array)
317
+ value.compact.map { |v| _to_hash(v) }
318
+ elsif value.is_a?(Hash)
319
+ {}.tap do |hash|
320
+ value.each { |k, v| hash[k] = _to_hash(v) }
321
+ end
322
+ elsif value.respond_to? :to_hash
323
+ value.to_hash
324
+ else
325
+ value
326
+ end
327
+ end
328
+
329
+ end
330
+
331
+ end
@@ -0,0 +1,408 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="tif_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
+ # Tif convert options
32
+ class TifConvertOptions
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
+ # Set Tiff compression
68
+ attr_accessor :compression
69
+ class EnumAttributeValidator
70
+ attr_reader :datatype
71
+ attr_reader :allowable_values
72
+
73
+ def initialize(datatype, allowable_values)
74
+ @allowable_values = allowable_values.map do |value|
75
+ case datatype.to_s
76
+ when /Integer/i
77
+ value.to_i
78
+ when /Float/i
79
+ value.to_f
80
+ else
81
+ value
82
+ end
83
+ end
84
+ end
85
+
86
+ def valid?(value)
87
+ !value || allowable_values.include?(value)
88
+ end
89
+ end
90
+
91
+ # Attribute mapping from ruby-style variable name to JSON key.
92
+ def self.attribute_map
93
+ {
94
+ :'from_page' => :'FromPage',
95
+ :'pages_count' => :'PagesCount',
96
+ :'pages' => :'Pages',
97
+ :'width' => :'Width',
98
+ :'height' => :'Height',
99
+ :'horizontal_resolution' => :'HorizontalResolution',
100
+ :'vertical_resolution' => :'VerticalResolution',
101
+ :'grayscale' => :'Grayscale',
102
+ :'rotate_angle' => :'RotateAngle',
103
+ :'use_pdf' => :'UsePdf',
104
+ :'watermark_options' => :'WatermarkOptions',
105
+ :'compression' => :'Compression'
106
+ }
107
+ end
108
+
109
+ # Attribute type mapping.
110
+ def self.swagger_types
111
+ {
112
+ :'from_page' => :'Integer',
113
+ :'pages_count' => :'Integer',
114
+ :'pages' => :'Array<Integer>',
115
+ :'width' => :'Integer',
116
+ :'height' => :'Integer',
117
+ :'horizontal_resolution' => :'Integer',
118
+ :'vertical_resolution' => :'Integer',
119
+ :'grayscale' => :'BOOLEAN',
120
+ :'rotate_angle' => :'Integer',
121
+ :'use_pdf' => :'BOOLEAN',
122
+ :'watermark_options' => :'WatermarkOptions',
123
+ :'compression' => :'String'
124
+ }
125
+ end
126
+
127
+ # Initializes the object
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ def initialize(attributes = {})
130
+ return unless attributes.is_a?(Hash)
131
+
132
+ # convert string to symbol for hash key
133
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
134
+
135
+ if attributes.key?(:'FromPage')
136
+ self.from_page = attributes[:'FromPage']
137
+ end
138
+
139
+ if attributes.key?(:'PagesCount')
140
+ self.pages_count = attributes[:'PagesCount']
141
+ end
142
+
143
+ if attributes.key?(:'Pages')
144
+ if (value = attributes[:'Pages']).is_a?(Array)
145
+ self.pages = value
146
+ end
147
+ end
148
+
149
+ if attributes.key?(:'Width')
150
+ self.width = attributes[:'Width']
151
+ end
152
+
153
+ if attributes.key?(:'Height')
154
+ self.height = attributes[:'Height']
155
+ end
156
+
157
+ if attributes.key?(:'HorizontalResolution')
158
+ self.horizontal_resolution = attributes[:'HorizontalResolution']
159
+ end
160
+
161
+ if attributes.key?(:'VerticalResolution')
162
+ self.vertical_resolution = attributes[:'VerticalResolution']
163
+ end
164
+
165
+ if attributes.key?(:'Grayscale')
166
+ self.grayscale = attributes[:'Grayscale']
167
+ end
168
+
169
+ if attributes.key?(:'RotateAngle')
170
+ self.rotate_angle = attributes[:'RotateAngle']
171
+ end
172
+
173
+ if attributes.key?(:'UsePdf')
174
+ self.use_pdf = attributes[:'UsePdf']
175
+ end
176
+
177
+ if attributes.key?(:'WatermarkOptions')
178
+ self.watermark_options = attributes[:'WatermarkOptions']
179
+ end
180
+
181
+ if attributes.key?(:'Compression')
182
+ self.compression = attributes[:'Compression']
183
+ end
184
+
185
+ end
186
+
187
+ # Show invalid properties with the reasons. Usually used together with valid?
188
+ # @return Array for valid properies with the reasons
189
+ def list_invalid_properties
190
+ invalid_properties = []
191
+ if @from_page.nil?
192
+ invalid_properties.push("invalid value for 'from_page', from_page cannot be nil.")
193
+ end
194
+
195
+ if @pages_count.nil?
196
+ invalid_properties.push("invalid value for 'pages_count', pages_count cannot be nil.")
197
+ end
198
+
199
+ if @width.nil?
200
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
201
+ end
202
+
203
+ if @height.nil?
204
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
205
+ end
206
+
207
+ if @horizontal_resolution.nil?
208
+ invalid_properties.push("invalid value for 'horizontal_resolution', horizontal_resolution cannot be nil.")
209
+ end
210
+
211
+ if @vertical_resolution.nil?
212
+ invalid_properties.push("invalid value for 'vertical_resolution', vertical_resolution cannot be nil.")
213
+ end
214
+
215
+ if @grayscale.nil?
216
+ invalid_properties.push("invalid value for 'grayscale', grayscale cannot be nil.")
217
+ end
218
+
219
+ if @rotate_angle.nil?
220
+ invalid_properties.push("invalid value for 'rotate_angle', rotate_angle cannot be nil.")
221
+ end
222
+
223
+ if @use_pdf.nil?
224
+ invalid_properties.push("invalid value for 'use_pdf', use_pdf cannot be nil.")
225
+ end
226
+
227
+ return invalid_properties
228
+ end
229
+
230
+ # Check to see if the all the properties in the model are valid
231
+ # @return true if the model is valid
232
+ def valid?
233
+ return false if @from_page.nil?
234
+ return false if @pages_count.nil?
235
+ return false if @width.nil?
236
+ return false if @height.nil?
237
+ return false if @horizontal_resolution.nil?
238
+ return false if @vertical_resolution.nil?
239
+ return false if @grayscale.nil?
240
+ return false if @rotate_angle.nil?
241
+ return false if @use_pdf.nil?
242
+ compression_validator = EnumAttributeValidator.new('String', ["Lzw", "None", "Ccitt3", "Ccitt4", "Rle"])
243
+ return false unless compression_validator.valid?(@compression)
244
+ return true
245
+ end
246
+
247
+ # Custom attribute writer method checking allowed values (enum).
248
+ # @param [Object] compression Object to be assigned
249
+ def compression=(compression)
250
+ validator = EnumAttributeValidator.new('String', ["Lzw", "None", "Ccitt3", "Ccitt4", "Rle"])
251
+ if compression.to_i == 0
252
+ unless validator.valid?(compression)
253
+ raise ArgumentError, "invalid value for 'compression', must be one of #{validator.allowable_values}."
254
+ end
255
+ @compression = compression
256
+ else
257
+ @compression = validator.allowable_values[compression.to_i]
258
+ end
259
+ end
260
+
261
+ # Checks equality by comparing each attribute.
262
+ # @param [Object] Object to be compared
263
+ def ==(other)
264
+ return true if self.equal?(other)
265
+ self.class == other.class &&
266
+ from_page == other.from_page &&
267
+ pages_count == other.pages_count &&
268
+ pages == other.pages &&
269
+ width == other.width &&
270
+ height == other.height &&
271
+ horizontal_resolution == other.horizontal_resolution &&
272
+ vertical_resolution == other.vertical_resolution &&
273
+ grayscale == other.grayscale &&
274
+ rotate_angle == other.rotate_angle &&
275
+ use_pdf == other.use_pdf &&
276
+ watermark_options == other.watermark_options &&
277
+ compression == other.compression
278
+ end
279
+
280
+ # @see the `==` method
281
+ # @param [Object] Object to be compared
282
+ def eql?(other)
283
+ self == other
284
+ end
285
+
286
+ # Calculates hash code according to all attributes.
287
+ # @return [Fixnum] Hash code
288
+ def hash
289
+ [from_page, pages_count, pages, width, height, horizontal_resolution, vertical_resolution, grayscale, rotate_angle, use_pdf, watermark_options, compression].hash
290
+ end
291
+
292
+ # Downcases first letter.
293
+ # @return downcased string
294
+ def uncap(str)
295
+ str[0, 1].downcase + str[1..-1]
296
+ end
297
+
298
+ # Builds the object from hash
299
+ # @param [Hash] attributes Model attributes in the form of hash
300
+ # @return [Object] Returns the model itself
301
+ def build_from_hash(attributes)
302
+ return nil unless attributes.is_a?(Hash)
303
+ self.class.swagger_types.each_pair do |key, type|
304
+ pname = uncap(self.class.attribute_map[key]).intern
305
+ value = attributes[pname]
306
+ if type =~ /\AArray<(.*)>/i
307
+ # check to ensure the input is an array given that the the attribute
308
+ # is documented as an array but the input is not
309
+ if value.is_a?(Array)
310
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
311
+ end
312
+ elsif !value.nil?
313
+ self.send("#{key}=", _deserialize(type, value))
314
+ end
315
+ # or else data not found in attributes(hash), not an issue as the data can be optional
316
+ end
317
+
318
+ self
319
+ end
320
+
321
+ # Deserializes the data based on type
322
+ # @param string type Data type
323
+ # @param string value Value to be deserialized
324
+ # @return [Object] Deserialized data
325
+ def _deserialize(type, value)
326
+ case type.to_sym
327
+ when :DateTime
328
+ Date.parse value
329
+ when :Date
330
+ Date.parse value
331
+ when :String
332
+ value.to_s
333
+ when :Integer
334
+ value.to_i
335
+ when :Float
336
+ value.to_f
337
+ when :BOOLEAN
338
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
339
+ true
340
+ else
341
+ false
342
+ end
343
+ when :Object
344
+ # generic object (usually a Hash), return directly
345
+ value
346
+ when /\AArray<(?<inner_type>.+)>\z/
347
+ inner_type = Regexp.last_match[:inner_type]
348
+ value.map { |v| _deserialize(inner_type, v) }
349
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
350
+ k_type = Regexp.last_match[:k_type]
351
+ v_type = Regexp.last_match[:v_type]
352
+ {}.tap do |hash|
353
+ value.each do |k, v|
354
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
355
+ end
356
+ end
357
+ else
358
+ # model
359
+ temp_model = GroupDocsConversionCloud.const_get(type).new
360
+ temp_model.build_from_hash(value)
361
+ end
362
+ end
363
+
364
+ # Returns the string representation of the object
365
+ # @return [String] String presentation of the object
366
+ def to_s
367
+ to_hash.to_s
368
+ end
369
+
370
+ # to_body is an alias to to_hash (backward compatibility)
371
+ # @return [Hash] Returns the object in the form of hash
372
+ def to_body
373
+ to_hash
374
+ end
375
+
376
+ # Returns the object in the form of hash
377
+ # @return [Hash] Returns the object in the form of hash
378
+ def to_hash
379
+ hash = {}
380
+ self.class.attribute_map.each_pair do |attr, param|
381
+ value = self.send(attr)
382
+ next if value.nil?
383
+ hash[param] = _to_hash(value)
384
+ end
385
+ hash
386
+ end
387
+
388
+ # Outputs non-array value in the form of hash
389
+ # For object, use to_hash. Otherwise, just return the value
390
+ # @param [Object] value Any valid value
391
+ # @return [Hash] Returns the value in the form of hash
392
+ def _to_hash(value)
393
+ if value.is_a?(Array)
394
+ value.compact.map { |v| _to_hash(v) }
395
+ elsif value.is_a?(Hash)
396
+ {}.tap do |hash|
397
+ value.each { |k, v| hash[k] = _to_hash(v) }
398
+ end
399
+ elsif value.respond_to? :to_hash
400
+ value.to_hash
401
+ else
402
+ value
403
+ end
404
+ end
405
+
406
+ end
407
+
408
+ end