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