AsposeDiagramCloud 18.10 → 20.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +5 -5
  2. data/AsposeDiagramCloud.gemspec +46 -0
  3. data/Gemfile +7 -0
  4. data/README.md +74 -0
  5. data/Rakefile +8 -0
  6. data/git_push.sh +55 -0
  7. data/lib/AsposeDiagramCloud.rb +85 -0
  8. data/lib/AsposeDiagramCloud/api/diagram_api.rb +768 -0
  9. data/lib/AsposeDiagramCloud/api/o_auth_api.rb +93 -0
  10. data/lib/AsposeDiagramCloud/api/storage_api.rb +905 -0
  11. data/lib/AsposeDiagramCloud/api_client.rb +391 -0
  12. data/lib/AsposeDiagramCloud/api_error.rb +38 -0
  13. data/lib/AsposeDiagramCloud/configuration.rb +209 -0
  14. data/lib/AsposeDiagramCloud/models/access_token_response.rb +251 -0
  15. data/lib/AsposeDiagramCloud/models/api_response_of_list_of_page_data.rb +190 -0
  16. data/lib/AsposeDiagramCloud/models/create_new_response.rb +188 -0
  17. data/lib/AsposeDiagramCloud/models/diagram_save_options.rb +244 -0
  18. data/lib/AsposeDiagramCloud/models/disc_usage.rb +209 -0
  19. data/lib/AsposeDiagramCloud/models/draw_shape_data.rb +262 -0
  20. data/lib/AsposeDiagramCloud/models/ellipse_data.rb +262 -0
  21. data/lib/AsposeDiagramCloud/models/error.rb +219 -0
  22. data/lib/AsposeDiagramCloud/models/error_details.rb +204 -0
  23. data/lib/AsposeDiagramCloud/models/file_version.rb +264 -0
  24. data/lib/AsposeDiagramCloud/models/file_versions.rb +191 -0
  25. data/lib/AsposeDiagramCloud/models/files_list.rb +191 -0
  26. data/lib/AsposeDiagramCloud/models/files_upload_result.rb +203 -0
  27. data/lib/AsposeDiagramCloud/models/html_save_options.rb +330 -0
  28. data/lib/AsposeDiagramCloud/models/image_save_options.rb +492 -0
  29. data/lib/AsposeDiagramCloud/models/line_data.rb +273 -0
  30. data/lib/AsposeDiagramCloud/models/modify_response.rb +202 -0
  31. data/lib/AsposeDiagramCloud/models/object_exist.rb +209 -0
  32. data/lib/AsposeDiagramCloud/models/page_data.rb +216 -0
  33. data/lib/AsposeDiagramCloud/models/page_setting.rb +219 -0
  34. data/lib/AsposeDiagramCloud/models/page_size.rb +221 -0
  35. data/lib/AsposeDiagramCloud/models/pdf_digital_signature_details.rb +248 -0
  36. data/lib/AsposeDiagramCloud/models/pdf_encryption_details.rb +260 -0
  37. data/lib/AsposeDiagramCloud/models/pdf_save_options.rb +408 -0
  38. data/lib/AsposeDiagramCloud/models/point_f.rb +221 -0
  39. data/lib/AsposeDiagramCloud/models/polyline_data.rb +273 -0
  40. data/lib/AsposeDiagramCloud/models/rectangle_f.rb +333 -0
  41. data/lib/AsposeDiagramCloud/models/rendering_save_options.rb +276 -0
  42. data/lib/AsposeDiagramCloud/models/saa_spose_response.rb +179 -0
  43. data/lib/AsposeDiagramCloud/models/save_as_response.rb +208 -0
  44. data/lib/AsposeDiagramCloud/models/save_options_model.rb +235 -0
  45. data/lib/AsposeDiagramCloud/models/save_options_request.rb +206 -0
  46. data/lib/AsposeDiagramCloud/models/shape_data.rb +221 -0
  47. data/lib/AsposeDiagramCloud/models/shape_style_data.rb +189 -0
  48. data/lib/AsposeDiagramCloud/models/storage_exist.rb +194 -0
  49. data/lib/AsposeDiagramCloud/models/storage_file.rb +239 -0
  50. data/lib/AsposeDiagramCloud/models/svg_save_options.rb +321 -0
  51. data/lib/AsposeDiagramCloud/models/swf_save_options.rb +271 -0
  52. data/lib/AsposeDiagramCloud/models/text_style_data.rb +253 -0
  53. data/lib/AsposeDiagramCloud/models/upload_response.rb +188 -0
  54. data/lib/AsposeDiagramCloud/models/xaml_save_options.rb +262 -0
  55. data/lib/AsposeDiagramCloud/models/xps_save_options.rb +271 -0
  56. data/lib/AsposeDiagramCloud/version.rb +15 -0
  57. data/spec/_spec.rb +308 -0
  58. data/spec/api/test_convert_spec.rb +308 -0
  59. data/spec/api/test_drawing_spec.rb +136 -0
  60. data/spec/api/test_page_spec.rb +92 -0
  61. data/spec/api_client_spec.rb +226 -0
  62. data/spec/configuration_spec.rb +42 -0
  63. data/spec/spec_helper.rb +120 -0
  64. data/testData/FileUpload.vdx +437 -0
  65. metadata +118 -49
@@ -0,0 +1,330 @@
1
+ =begin
2
+ #Aspose.Diagram Cloud API Reference
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 3.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module AsposeDiagramCloud
16
+
17
+ class HTMLSaveOptions
18
+ attr_accessor :save_format
19
+
20
+ attr_accessor :default_font
21
+
22
+ attr_accessor :area
23
+
24
+ attr_accessor :export_guide_shapes
25
+
26
+ attr_accessor :page_size
27
+
28
+ attr_accessor :is_export_comments
29
+
30
+ attr_accessor :page_count
31
+
32
+ attr_accessor :save_tool_bar
33
+
34
+ attr_accessor :export_hidden_page
35
+
36
+ attr_accessor :page_index
37
+
38
+ attr_accessor :save_foreground_pages_only
39
+
40
+ attr_accessor :title
41
+
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'save_format' => :'SaveFormat',
68
+ :'default_font' => :'DefaultFont',
69
+ :'area' => :'Area',
70
+ :'export_guide_shapes' => :'ExportGuideShapes',
71
+ :'page_size' => :'PageSize',
72
+ :'is_export_comments' => :'IsExportComments',
73
+ :'page_count' => :'PageCount',
74
+ :'save_tool_bar' => :'SaveToolBar',
75
+ :'export_hidden_page' => :'ExportHiddenPage',
76
+ :'page_index' => :'PageIndex',
77
+ :'save_foreground_pages_only' => :'SaveForegroundPagesOnly',
78
+ :'title' => :'Title'
79
+ }
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.swagger_types
84
+ {
85
+ :'save_format' => :'String',
86
+ :'default_font' => :'String',
87
+ :'area' => :'RectangleF',
88
+ :'export_guide_shapes' => :'BOOLEAN',
89
+ :'page_size' => :'PageSize',
90
+ :'is_export_comments' => :'BOOLEAN',
91
+ :'page_count' => :'Integer',
92
+ :'save_tool_bar' => :'BOOLEAN',
93
+ :'export_hidden_page' => :'BOOLEAN',
94
+ :'page_index' => :'Integer',
95
+ :'save_foreground_pages_only' => :'BOOLEAN',
96
+ :'title' => :'String'
97
+ }
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ return unless attributes.is_a?(Hash)
104
+
105
+ # convert string to symbol for hash key
106
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
107
+
108
+ if attributes.has_key?(:'SaveFormat')
109
+ self.save_format = attributes[:'SaveFormat']
110
+ end
111
+
112
+ if attributes.has_key?(:'DefaultFont')
113
+ self.default_font = attributes[:'DefaultFont']
114
+ end
115
+
116
+ if attributes.has_key?(:'Area')
117
+ self.area = attributes[:'Area']
118
+ end
119
+
120
+ if attributes.has_key?(:'ExportGuideShapes')
121
+ self.export_guide_shapes = attributes[:'ExportGuideShapes']
122
+ end
123
+
124
+ if attributes.has_key?(:'PageSize')
125
+ self.page_size = attributes[:'PageSize']
126
+ end
127
+
128
+ if attributes.has_key?(:'IsExportComments')
129
+ self.is_export_comments = attributes[:'IsExportComments']
130
+ end
131
+
132
+ if attributes.has_key?(:'PageCount')
133
+ self.page_count = attributes[:'PageCount']
134
+ end
135
+
136
+ if attributes.has_key?(:'SaveToolBar')
137
+ self.save_tool_bar = attributes[:'SaveToolBar']
138
+ end
139
+
140
+ if attributes.has_key?(:'ExportHiddenPage')
141
+ self.export_hidden_page = attributes[:'ExportHiddenPage']
142
+ end
143
+
144
+ if attributes.has_key?(:'PageIndex')
145
+ self.page_index = attributes[:'PageIndex']
146
+ end
147
+
148
+ if attributes.has_key?(:'SaveForegroundPagesOnly')
149
+ self.save_foreground_pages_only = attributes[:'SaveForegroundPagesOnly']
150
+ end
151
+
152
+ if attributes.has_key?(:'Title')
153
+ self.title = attributes[:'Title']
154
+ end
155
+
156
+ end
157
+
158
+ # Show invalid properties with the reasons. Usually used together with valid?
159
+ # @return Array for valid properies with the reasons
160
+ def list_invalid_properties
161
+ invalid_properties = Array.new
162
+ if @save_format.nil?
163
+ invalid_properties.push("invalid value for 'save_format', save_format cannot be nil.")
164
+ end
165
+
166
+ if @area.nil?
167
+ invalid_properties.push("invalid value for 'area', area cannot be nil.")
168
+ end
169
+
170
+ return invalid_properties
171
+ end
172
+
173
+ # Check to see if the all the properties in the model are valid
174
+ # @return true if the model is valid
175
+ def valid?
176
+ return false if @save_format.nil?
177
+ save_format_validator = EnumAttributeValidator.new('String', ["VDX", "VSX", "VTX", "TIFF", "PNG", "BMP", "EMF", "JPEG", "PDF", "XPS", "GIF", "HTML", "SVG", "SWF", "XAML", "VSDX", "VSTX", "VSSX", "VSDM", "VSSM", "VSTM"])
178
+ return false unless save_format_validator.valid?(@save_format)
179
+ return false if @area.nil?
180
+ return true
181
+ end
182
+
183
+ # Custom attribute writer method checking allowed values (enum).
184
+ # @param [Object] save_format Object to be assigned
185
+ def save_format=(save_format)
186
+ validator = EnumAttributeValidator.new('String', ["VDX", "VSX", "VTX", "TIFF", "PNG", "BMP", "EMF", "JPEG", "PDF", "XPS", "GIF", "HTML", "SVG", "SWF", "XAML", "VSDX", "VSTX", "VSSX", "VSDM", "VSSM", "VSTM"])
187
+ unless validator.valid?(save_format)
188
+ fail ArgumentError, "invalid value for 'save_format', must be one of #{validator.allowable_values}."
189
+ end
190
+ @save_format = save_format
191
+ end
192
+
193
+ # Checks equality by comparing each attribute.
194
+ # @param [Object] Object to be compared
195
+ def ==(o)
196
+ return true if self.equal?(o)
197
+ self.class == o.class &&
198
+ save_format == o.save_format &&
199
+ default_font == o.default_font &&
200
+ area == o.area &&
201
+ export_guide_shapes == o.export_guide_shapes &&
202
+ page_size == o.page_size &&
203
+ is_export_comments == o.is_export_comments &&
204
+ page_count == o.page_count &&
205
+ save_tool_bar == o.save_tool_bar &&
206
+ export_hidden_page == o.export_hidden_page &&
207
+ page_index == o.page_index &&
208
+ save_foreground_pages_only == o.save_foreground_pages_only &&
209
+ title == o.title
210
+ end
211
+
212
+ # @see the `==` method
213
+ # @param [Object] Object to be compared
214
+ def eql?(o)
215
+ self == o
216
+ end
217
+
218
+ # Calculates hash code according to all attributes.
219
+ # @return [Fixnum] Hash code
220
+ def hash
221
+ [save_format, default_font, area, export_guide_shapes, page_size, is_export_comments, page_count, save_tool_bar, export_hidden_page, page_index, save_foreground_pages_only, title].hash
222
+ end
223
+
224
+ # Builds the object from hash
225
+ # @param [Hash] attributes Model attributes in the form of hash
226
+ # @return [Object] Returns the model itself
227
+ def build_from_hash(attributes)
228
+ return nil unless attributes.is_a?(Hash)
229
+ self.class.swagger_types.each_pair do |key, type|
230
+ if type =~ /\AArray<(.*)>/i
231
+ # check to ensure the input is an array given that the the attribute
232
+ # is documented as an array but the input is not
233
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
234
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
235
+ end
236
+ elsif !attributes[self.class.attribute_map[key]].nil?
237
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
238
+ end # 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
+ DateTime.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 # model
281
+ temp_model = AsposeDiagramCloud.const_get(type).new
282
+ temp_model.build_from_hash(value)
283
+ end
284
+ end
285
+
286
+ # Returns the string representation of the object
287
+ # @return [String] String presentation of the object
288
+ def to_s
289
+ to_hash.to_s
290
+ end
291
+
292
+ # to_body is an alias to to_hash (backward compatibility)
293
+ # @return [Hash] Returns the object in the form of hash
294
+ def to_body
295
+ to_hash
296
+ end
297
+
298
+ # Returns the object in the form of hash
299
+ # @return [Hash] Returns the object in the form of hash
300
+ def to_hash
301
+ hash = {}
302
+ self.class.attribute_map.each_pair do |attr, param|
303
+ value = self.send(attr)
304
+ next if value.nil?
305
+ hash[param] = _to_hash(value)
306
+ end
307
+ hash
308
+ end
309
+
310
+ # Outputs non-array value in the form of hash
311
+ # For object, use to_hash. Otherwise, just return the value
312
+ # @param [Object] value Any valid value
313
+ # @return [Hash] Returns the value in the form of hash
314
+ def _to_hash(value)
315
+ if value.is_a?(Array)
316
+ value.compact.map{ |v| _to_hash(v) }
317
+ elsif value.is_a?(Hash)
318
+ {}.tap do |hash|
319
+ value.each { |k, v| hash[k] = _to_hash(v) }
320
+ end
321
+ elsif value.respond_to? :to_hash
322
+ value.to_hash
323
+ else
324
+ value
325
+ end
326
+ end
327
+
328
+ end
329
+
330
+ end
@@ -0,0 +1,492 @@
1
+ =begin
2
+ #Aspose.Diagram Cloud API Reference
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 3.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module AsposeDiagramCloud
16
+
17
+ class ImageSaveOptions
18
+ attr_accessor :save_format
19
+
20
+ attr_accessor :default_font
21
+
22
+ attr_accessor :area
23
+
24
+ attr_accessor :export_guide_shapes
25
+
26
+ attr_accessor :page_size
27
+
28
+ attr_accessor :is_export_comments
29
+
30
+ attr_accessor :image_brightness
31
+
32
+ attr_accessor :image_contrast
33
+
34
+ attr_accessor :jpeg_quality
35
+
36
+ attr_accessor :page_count
37
+
38
+ attr_accessor :resolution
39
+
40
+ attr_accessor :scale
41
+
42
+ attr_accessor :tiff_compression
43
+
44
+ attr_accessor :export_hidden_page
45
+
46
+ attr_accessor :image_color_mode
47
+
48
+ attr_accessor :page_index
49
+
50
+ attr_accessor :save_foreground_pages_only
51
+
52
+ attr_accessor :same_as_pdf_conversion_area
53
+
54
+ attr_accessor :pixel_offset_mode
55
+
56
+ attr_accessor :smoothing_mode
57
+
58
+ attr_accessor :compositing_quality
59
+
60
+ attr_accessor :interpolation_mode
61
+
62
+ class EnumAttributeValidator
63
+ attr_reader :datatype
64
+ attr_reader :allowable_values
65
+
66
+ def initialize(datatype, allowable_values)
67
+ @allowable_values = allowable_values.map do |value|
68
+ case datatype.to_s
69
+ when /Integer/i
70
+ value.to_i
71
+ when /Float/i
72
+ value.to_f
73
+ else
74
+ value
75
+ end
76
+ end
77
+ end
78
+
79
+ def valid?(value)
80
+ !value || allowable_values.include?(value)
81
+ end
82
+ end
83
+
84
+ # Attribute mapping from ruby-style variable name to JSON key.
85
+ def self.attribute_map
86
+ {
87
+ :'save_format' => :'SaveFormat',
88
+ :'default_font' => :'DefaultFont',
89
+ :'area' => :'Area',
90
+ :'export_guide_shapes' => :'ExportGuideShapes',
91
+ :'page_size' => :'PageSize',
92
+ :'is_export_comments' => :'IsExportComments',
93
+ :'image_brightness' => :'ImageBrightness',
94
+ :'image_contrast' => :'ImageContrast',
95
+ :'jpeg_quality' => :'JpegQuality',
96
+ :'page_count' => :'PageCount',
97
+ :'resolution' => :'Resolution',
98
+ :'scale' => :'Scale',
99
+ :'tiff_compression' => :'TiffCompression',
100
+ :'export_hidden_page' => :'ExportHiddenPage',
101
+ :'image_color_mode' => :'ImageColorMode',
102
+ :'page_index' => :'PageIndex',
103
+ :'save_foreground_pages_only' => :'SaveForegroundPagesOnly',
104
+ :'same_as_pdf_conversion_area' => :'SameAsPdfConversionArea',
105
+ :'pixel_offset_mode' => :'PixelOffsetMode',
106
+ :'smoothing_mode' => :'SmoothingMode',
107
+ :'compositing_quality' => :'CompositingQuality',
108
+ :'interpolation_mode' => :'InterpolationMode'
109
+ }
110
+ end
111
+
112
+ # Attribute type mapping.
113
+ def self.swagger_types
114
+ {
115
+ :'save_format' => :'String',
116
+ :'default_font' => :'String',
117
+ :'area' => :'RectangleF',
118
+ :'export_guide_shapes' => :'BOOLEAN',
119
+ :'page_size' => :'PageSize',
120
+ :'is_export_comments' => :'BOOLEAN',
121
+ :'image_brightness' => :'Float',
122
+ :'image_contrast' => :'Float',
123
+ :'jpeg_quality' => :'Integer',
124
+ :'page_count' => :'Integer',
125
+ :'resolution' => :'Float',
126
+ :'scale' => :'Float',
127
+ :'tiff_compression' => :'String',
128
+ :'export_hidden_page' => :'BOOLEAN',
129
+ :'image_color_mode' => :'String',
130
+ :'page_index' => :'Integer',
131
+ :'save_foreground_pages_only' => :'BOOLEAN',
132
+ :'same_as_pdf_conversion_area' => :'BOOLEAN',
133
+ :'pixel_offset_mode' => :'String',
134
+ :'smoothing_mode' => :'String',
135
+ :'compositing_quality' => :'String',
136
+ :'interpolation_mode' => :'String'
137
+ }
138
+ end
139
+
140
+ # Initializes the object
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ def initialize(attributes = {})
143
+ return unless attributes.is_a?(Hash)
144
+
145
+ # convert string to symbol for hash key
146
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
147
+
148
+ if attributes.has_key?(:'SaveFormat')
149
+ self.save_format = attributes[:'SaveFormat']
150
+ end
151
+
152
+ if attributes.has_key?(:'DefaultFont')
153
+ self.default_font = attributes[:'DefaultFont']
154
+ end
155
+
156
+ if attributes.has_key?(:'Area')
157
+ self.area = attributes[:'Area']
158
+ end
159
+
160
+ if attributes.has_key?(:'ExportGuideShapes')
161
+ self.export_guide_shapes = attributes[:'ExportGuideShapes']
162
+ end
163
+
164
+ if attributes.has_key?(:'PageSize')
165
+ self.page_size = attributes[:'PageSize']
166
+ end
167
+
168
+ if attributes.has_key?(:'IsExportComments')
169
+ self.is_export_comments = attributes[:'IsExportComments']
170
+ end
171
+
172
+ if attributes.has_key?(:'ImageBrightness')
173
+ self.image_brightness = attributes[:'ImageBrightness']
174
+ end
175
+
176
+ if attributes.has_key?(:'ImageContrast')
177
+ self.image_contrast = attributes[:'ImageContrast']
178
+ end
179
+
180
+ if attributes.has_key?(:'JpegQuality')
181
+ self.jpeg_quality = attributes[:'JpegQuality']
182
+ end
183
+
184
+ if attributes.has_key?(:'PageCount')
185
+ self.page_count = attributes[:'PageCount']
186
+ end
187
+
188
+ if attributes.has_key?(:'Resolution')
189
+ self.resolution = attributes[:'Resolution']
190
+ end
191
+
192
+ if attributes.has_key?(:'Scale')
193
+ self.scale = attributes[:'Scale']
194
+ end
195
+
196
+ if attributes.has_key?(:'TiffCompression')
197
+ self.tiff_compression = attributes[:'TiffCompression']
198
+ end
199
+
200
+ if attributes.has_key?(:'ExportHiddenPage')
201
+ self.export_hidden_page = attributes[:'ExportHiddenPage']
202
+ end
203
+
204
+ if attributes.has_key?(:'ImageColorMode')
205
+ self.image_color_mode = attributes[:'ImageColorMode']
206
+ end
207
+
208
+ if attributes.has_key?(:'PageIndex')
209
+ self.page_index = attributes[:'PageIndex']
210
+ end
211
+
212
+ if attributes.has_key?(:'SaveForegroundPagesOnly')
213
+ self.save_foreground_pages_only = attributes[:'SaveForegroundPagesOnly']
214
+ end
215
+
216
+ if attributes.has_key?(:'SameAsPdfConversionArea')
217
+ self.same_as_pdf_conversion_area = attributes[:'SameAsPdfConversionArea']
218
+ end
219
+
220
+ if attributes.has_key?(:'PixelOffsetMode')
221
+ self.pixel_offset_mode = attributes[:'PixelOffsetMode']
222
+ end
223
+
224
+ if attributes.has_key?(:'SmoothingMode')
225
+ self.smoothing_mode = attributes[:'SmoothingMode']
226
+ end
227
+
228
+ if attributes.has_key?(:'CompositingQuality')
229
+ self.compositing_quality = attributes[:'CompositingQuality']
230
+ end
231
+
232
+ if attributes.has_key?(:'InterpolationMode')
233
+ self.interpolation_mode = attributes[:'InterpolationMode']
234
+ end
235
+
236
+ end
237
+
238
+ # Show invalid properties with the reasons. Usually used together with valid?
239
+ # @return Array for valid properies with the reasons
240
+ def list_invalid_properties
241
+ invalid_properties = Array.new
242
+ if @save_format.nil?
243
+ invalid_properties.push("invalid value for 'save_format', save_format cannot be nil.")
244
+ end
245
+
246
+ if @area.nil?
247
+ invalid_properties.push("invalid value for 'area', area cannot be nil.")
248
+ end
249
+
250
+ return invalid_properties
251
+ end
252
+
253
+ # Check to see if the all the properties in the model are valid
254
+ # @return true if the model is valid
255
+ def valid?
256
+ return false if @save_format.nil?
257
+ save_format_validator = EnumAttributeValidator.new('String', ["VDX", "VSX", "VTX", "TIFF", "PNG", "BMP", "EMF", "JPEG", "PDF", "XPS", "GIF", "HTML", "SVG", "SWF", "XAML", "VSDX", "VSTX", "VSSX", "VSDM", "VSSM", "VSTM"])
258
+ return false unless save_format_validator.valid?(@save_format)
259
+ return false if @area.nil?
260
+ tiff_compression_validator = EnumAttributeValidator.new('String', ["None", "Rle", "Ccitt3", "Ccitt4", "Lzw"])
261
+ return false unless tiff_compression_validator.valid?(@tiff_compression)
262
+ image_color_mode_validator = EnumAttributeValidator.new('String', ["None", "Grayscale", "BlackAndWhite"])
263
+ return false unless image_color_mode_validator.valid?(@image_color_mode)
264
+ pixel_offset_mode_validator = EnumAttributeValidator.new('String', ["Default", "HighSpeed", "HighQuality", "None", "Half", "Invalid"])
265
+ return false unless pixel_offset_mode_validator.valid?(@pixel_offset_mode)
266
+ smoothing_mode_validator = EnumAttributeValidator.new('String', ["Default", "HighSpeed", "HighQuality", "None", "AntiAlias", "Invalid"])
267
+ return false unless smoothing_mode_validator.valid?(@smoothing_mode)
268
+ compositing_quality_validator = EnumAttributeValidator.new('String', ["Default", "HighSpeed", "HighQuality", "GammaCorrected", "AssumeLinear", "Invalid"])
269
+ return false unless compositing_quality_validator.valid?(@compositing_quality)
270
+ interpolation_mode_validator = EnumAttributeValidator.new('String', ["Default", "Low", "High", "Bilinear", "Bicubic", "NearestNeighbor", "HighQualityBilinear", "HighQualityBicubic", "Invalid"])
271
+ return false unless interpolation_mode_validator.valid?(@interpolation_mode)
272
+ return true
273
+ end
274
+
275
+ # Custom attribute writer method checking allowed values (enum).
276
+ # @param [Object] save_format Object to be assigned
277
+ def save_format=(save_format)
278
+ validator = EnumAttributeValidator.new('String', ["VDX", "VSX", "VTX", "TIFF", "PNG", "BMP", "EMF", "JPEG", "PDF", "XPS", "GIF", "HTML", "SVG", "SWF", "XAML", "VSDX", "VSTX", "VSSX", "VSDM", "VSSM", "VSTM"])
279
+ unless validator.valid?(save_format)
280
+ fail ArgumentError, "invalid value for 'save_format', must be one of #{validator.allowable_values}."
281
+ end
282
+ @save_format = save_format
283
+ end
284
+
285
+ # Custom attribute writer method checking allowed values (enum).
286
+ # @param [Object] tiff_compression Object to be assigned
287
+ def tiff_compression=(tiff_compression)
288
+ validator = EnumAttributeValidator.new('String', ["None", "Rle", "Ccitt3", "Ccitt4", "Lzw"])
289
+ unless validator.valid?(tiff_compression)
290
+ fail ArgumentError, "invalid value for 'tiff_compression', must be one of #{validator.allowable_values}."
291
+ end
292
+ @tiff_compression = tiff_compression
293
+ end
294
+
295
+ # Custom attribute writer method checking allowed values (enum).
296
+ # @param [Object] image_color_mode Object to be assigned
297
+ def image_color_mode=(image_color_mode)
298
+ validator = EnumAttributeValidator.new('String', ["None", "Grayscale", "BlackAndWhite"])
299
+ unless validator.valid?(image_color_mode)
300
+ fail ArgumentError, "invalid value for 'image_color_mode', must be one of #{validator.allowable_values}."
301
+ end
302
+ @image_color_mode = image_color_mode
303
+ end
304
+
305
+ # Custom attribute writer method checking allowed values (enum).
306
+ # @param [Object] pixel_offset_mode Object to be assigned
307
+ def pixel_offset_mode=(pixel_offset_mode)
308
+ validator = EnumAttributeValidator.new('String', ["Default", "HighSpeed", "HighQuality", "None", "Half", "Invalid"])
309
+ unless validator.valid?(pixel_offset_mode)
310
+ fail ArgumentError, "invalid value for 'pixel_offset_mode', must be one of #{validator.allowable_values}."
311
+ end
312
+ @pixel_offset_mode = pixel_offset_mode
313
+ end
314
+
315
+ # Custom attribute writer method checking allowed values (enum).
316
+ # @param [Object] smoothing_mode Object to be assigned
317
+ def smoothing_mode=(smoothing_mode)
318
+ validator = EnumAttributeValidator.new('String', ["Default", "HighSpeed", "HighQuality", "None", "AntiAlias", "Invalid"])
319
+ unless validator.valid?(smoothing_mode)
320
+ fail ArgumentError, "invalid value for 'smoothing_mode', must be one of #{validator.allowable_values}."
321
+ end
322
+ @smoothing_mode = smoothing_mode
323
+ end
324
+
325
+ # Custom attribute writer method checking allowed values (enum).
326
+ # @param [Object] compositing_quality Object to be assigned
327
+ def compositing_quality=(compositing_quality)
328
+ validator = EnumAttributeValidator.new('String', ["Default", "HighSpeed", "HighQuality", "GammaCorrected", "AssumeLinear", "Invalid"])
329
+ unless validator.valid?(compositing_quality)
330
+ fail ArgumentError, "invalid value for 'compositing_quality', must be one of #{validator.allowable_values}."
331
+ end
332
+ @compositing_quality = compositing_quality
333
+ end
334
+
335
+ # Custom attribute writer method checking allowed values (enum).
336
+ # @param [Object] interpolation_mode Object to be assigned
337
+ def interpolation_mode=(interpolation_mode)
338
+ validator = EnumAttributeValidator.new('String', ["Default", "Low", "High", "Bilinear", "Bicubic", "NearestNeighbor", "HighQualityBilinear", "HighQualityBicubic", "Invalid"])
339
+ unless validator.valid?(interpolation_mode)
340
+ fail ArgumentError, "invalid value for 'interpolation_mode', must be one of #{validator.allowable_values}."
341
+ end
342
+ @interpolation_mode = interpolation_mode
343
+ end
344
+
345
+ # Checks equality by comparing each attribute.
346
+ # @param [Object] Object to be compared
347
+ def ==(o)
348
+ return true if self.equal?(o)
349
+ self.class == o.class &&
350
+ save_format == o.save_format &&
351
+ default_font == o.default_font &&
352
+ area == o.area &&
353
+ export_guide_shapes == o.export_guide_shapes &&
354
+ page_size == o.page_size &&
355
+ is_export_comments == o.is_export_comments &&
356
+ image_brightness == o.image_brightness &&
357
+ image_contrast == o.image_contrast &&
358
+ jpeg_quality == o.jpeg_quality &&
359
+ page_count == o.page_count &&
360
+ resolution == o.resolution &&
361
+ scale == o.scale &&
362
+ tiff_compression == o.tiff_compression &&
363
+ export_hidden_page == o.export_hidden_page &&
364
+ image_color_mode == o.image_color_mode &&
365
+ page_index == o.page_index &&
366
+ save_foreground_pages_only == o.save_foreground_pages_only &&
367
+ same_as_pdf_conversion_area == o.same_as_pdf_conversion_area &&
368
+ pixel_offset_mode == o.pixel_offset_mode &&
369
+ smoothing_mode == o.smoothing_mode &&
370
+ compositing_quality == o.compositing_quality &&
371
+ interpolation_mode == o.interpolation_mode
372
+ end
373
+
374
+ # @see the `==` method
375
+ # @param [Object] Object to be compared
376
+ def eql?(o)
377
+ self == o
378
+ end
379
+
380
+ # Calculates hash code according to all attributes.
381
+ # @return [Fixnum] Hash code
382
+ def hash
383
+ [save_format, default_font, area, export_guide_shapes, page_size, is_export_comments, image_brightness, image_contrast, jpeg_quality, page_count, resolution, scale, tiff_compression, export_hidden_page, image_color_mode, page_index, save_foreground_pages_only, same_as_pdf_conversion_area, pixel_offset_mode, smoothing_mode, compositing_quality, interpolation_mode].hash
384
+ end
385
+
386
+ # Builds the object from hash
387
+ # @param [Hash] attributes Model attributes in the form of hash
388
+ # @return [Object] Returns the model itself
389
+ def build_from_hash(attributes)
390
+ return nil unless attributes.is_a?(Hash)
391
+ self.class.swagger_types.each_pair do |key, type|
392
+ if type =~ /\AArray<(.*)>/i
393
+ # check to ensure the input is an array given that the the attribute
394
+ # is documented as an array but the input is not
395
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
396
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
397
+ end
398
+ elsif !attributes[self.class.attribute_map[key]].nil?
399
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
400
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
401
+ end
402
+
403
+ self
404
+ end
405
+
406
+ # Deserializes the data based on type
407
+ # @param string type Data type
408
+ # @param string value Value to be deserialized
409
+ # @return [Object] Deserialized data
410
+ def _deserialize(type, value)
411
+ case type.to_sym
412
+ when :DateTime
413
+ DateTime.parse(value)
414
+ when :Date
415
+ Date.parse(value)
416
+ when :String
417
+ value.to_s
418
+ when :Integer
419
+ value.to_i
420
+ when :Float
421
+ value.to_f
422
+ when :BOOLEAN
423
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
424
+ true
425
+ else
426
+ false
427
+ end
428
+ when :Object
429
+ # generic object (usually a Hash), return directly
430
+ value
431
+ when /\AArray<(?<inner_type>.+)>\z/
432
+ inner_type = Regexp.last_match[:inner_type]
433
+ value.map { |v| _deserialize(inner_type, v) }
434
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
435
+ k_type = Regexp.last_match[:k_type]
436
+ v_type = Regexp.last_match[:v_type]
437
+ {}.tap do |hash|
438
+ value.each do |k, v|
439
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
440
+ end
441
+ end
442
+ else # model
443
+ temp_model = AsposeDiagramCloud.const_get(type).new
444
+ temp_model.build_from_hash(value)
445
+ end
446
+ end
447
+
448
+ # Returns the string representation of the object
449
+ # @return [String] String presentation of the object
450
+ def to_s
451
+ to_hash.to_s
452
+ end
453
+
454
+ # to_body is an alias to to_hash (backward compatibility)
455
+ # @return [Hash] Returns the object in the form of hash
456
+ def to_body
457
+ to_hash
458
+ end
459
+
460
+ # Returns the object in the form of hash
461
+ # @return [Hash] Returns the object in the form of hash
462
+ def to_hash
463
+ hash = {}
464
+ self.class.attribute_map.each_pair do |attr, param|
465
+ value = self.send(attr)
466
+ next if value.nil?
467
+ hash[param] = _to_hash(value)
468
+ end
469
+ hash
470
+ end
471
+
472
+ # Outputs non-array value in the form of hash
473
+ # For object, use to_hash. Otherwise, just return the value
474
+ # @param [Object] value Any valid value
475
+ # @return [Hash] Returns the value in the form of hash
476
+ def _to_hash(value)
477
+ if value.is_a?(Array)
478
+ value.compact.map{ |v| _to_hash(v) }
479
+ elsif value.is_a?(Hash)
480
+ {}.tap do |hash|
481
+ value.each { |k, v| hash[k] = _to_hash(v) }
482
+ end
483
+ elsif value.respond_to? :to_hash
484
+ value.to_hash
485
+ else
486
+ value
487
+ end
488
+ end
489
+
490
+ end
491
+
492
+ end