aspose_words_cloud 20.4.0 → 20.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose_words_cloud.rb +30 -0
  3. data/lib/aspose_words_cloud/api/words_api.rb +4292 -2201
  4. data/lib/aspose_words_cloud/api_client.rb +1 -0
  5. data/lib/aspose_words_cloud/models/bmp_save_options_data.rb +61 -4
  6. data/lib/aspose_words_cloud/models/csv_data_load_options.rb +237 -0
  7. data/lib/aspose_words_cloud/models/doc_save_options_data.rb +58 -1
  8. data/lib/aspose_words_cloud/models/emf_save_options_data.rb +61 -4
  9. data/lib/aspose_words_cloud/models/epub_save_options_data.rb +37 -1
  10. data/lib/aspose_words_cloud/models/fixed_page_save_options_data.rb +58 -1
  11. data/lib/aspose_words_cloud/models/gif_save_options_data.rb +61 -4
  12. data/lib/aspose_words_cloud/models/html_fixed_save_options_data.rb +71 -4
  13. data/lib/aspose_words_cloud/models/html_save_options_data.rb +37 -1
  14. data/lib/aspose_words_cloud/models/image_save_options_data.rb +58 -1
  15. data/lib/aspose_words_cloud/models/jpeg_save_options_data.rb +61 -4
  16. data/lib/aspose_words_cloud/models/list_format.rb +236 -0
  17. data/lib/aspose_words_cloud/models/list_format_update.rb +217 -0
  18. data/lib/aspose_words_cloud/models/list_info.rb +274 -0
  19. data/lib/aspose_words_cloud/models/list_insert.rb +244 -0
  20. data/lib/aspose_words_cloud/models/list_level.rb +393 -0
  21. data/lib/aspose_words_cloud/models/list_level_update.rb +366 -0
  22. data/lib/aspose_words_cloud/models/list_levels.rb +218 -0
  23. data/lib/aspose_words_cloud/models/list_response.rb +216 -0
  24. data/lib/aspose_words_cloud/models/list_update.rb +207 -0
  25. data/lib/aspose_words_cloud/models/lists.rb +218 -0
  26. data/lib/aspose_words_cloud/models/lists_response.rb +216 -0
  27. data/lib/aspose_words_cloud/models/mhtml_save_options_data.rb +37 -1
  28. data/lib/aspose_words_cloud/models/odt_save_options_data.rb +47 -1
  29. data/lib/aspose_words_cloud/models/ooxml_save_options_data.rb +58 -1
  30. data/lib/aspose_words_cloud/models/paragraph_format.rb +10 -1
  31. data/lib/aspose_words_cloud/models/paragraph_list_format_response.rb +216 -0
  32. data/lib/aspose_words_cloud/models/pcl_save_options_data.rb +58 -1
  33. data/lib/aspose_words_cloud/models/pdf_save_options_data.rb +47 -1
  34. data/lib/aspose_words_cloud/models/png_save_options_data.rb +61 -4
  35. data/lib/aspose_words_cloud/models/ps_save_options_data.rb +58 -1
  36. data/lib/aspose_words_cloud/models/report_build_options.rb +26 -0
  37. data/lib/aspose_words_cloud/models/report_engine_settings.rb +275 -0
  38. data/lib/aspose_words_cloud/models/requests/ApplyStyleToDocumentElementRequest.rb +81 -0
  39. data/lib/aspose_words_cloud/models/requests/BuildReportOnlineRequest.rb +57 -0
  40. data/lib/aspose_words_cloud/models/requests/BuildReportRequest.rb +73 -0
  41. data/lib/aspose_words_cloud/models/requests/CopyStyleRequest.rb +77 -0
  42. data/lib/aspose_words_cloud/models/requests/DeleteAllParagraphTabStopsRequest.rb +73 -0
  43. data/lib/aspose_words_cloud/models/requests/DeleteParagraphListFormatRequest.rb +81 -0
  44. data/lib/aspose_words_cloud/models/requests/DeleteParagraphTabStopRequest.rb +77 -0
  45. data/lib/aspose_words_cloud/models/requests/ExecuteMailMergeOnlineRequest.rb +2 -2
  46. data/lib/aspose_words_cloud/models/requests/ExecuteMailMergeRequest.rb +2 -2
  47. data/lib/aspose_words_cloud/models/requests/GetDocumentFieldNamesRequest.rb +2 -2
  48. data/lib/aspose_words_cloud/models/requests/GetListRequest.rb +65 -0
  49. data/lib/aspose_words_cloud/models/requests/GetListsRequest.rb +61 -0
  50. data/lib/aspose_words_cloud/models/requests/GetParagraphListFormatRequest.rb +69 -0
  51. data/lib/aspose_words_cloud/models/requests/GetParagraphListFormatWithoutNodePathRequest.rb +65 -0
  52. data/lib/aspose_words_cloud/models/requests/GetParagraphTabStopsRequest.rb +69 -0
  53. data/lib/aspose_words_cloud/models/requests/GetStyleFromDocumentElementRequest.rb +65 -0
  54. data/lib/aspose_words_cloud/models/requests/GetStyleRequest.rb +65 -0
  55. data/lib/aspose_words_cloud/models/requests/GetStylesRequest.rb +61 -0
  56. data/lib/aspose_words_cloud/models/requests/InsertListRequest.rb +77 -0
  57. data/lib/aspose_words_cloud/models/requests/InsertOrUpdateParagraphTabStopRequest.rb +77 -0
  58. data/lib/aspose_words_cloud/models/requests/InsertStyleRequest.rb +77 -0
  59. data/lib/aspose_words_cloud/models/requests/UpdateListLevelRequest.rb +85 -0
  60. data/lib/aspose_words_cloud/models/requests/UpdateListRequest.rb +81 -0
  61. data/lib/aspose_words_cloud/models/requests/UpdateParagraphListFormatRequest.rb +85 -0
  62. data/lib/aspose_words_cloud/models/requests/UpdateStyleRequest.rb +81 -0
  63. data/lib/aspose_words_cloud/models/rtf_save_options_data.rb +58 -1
  64. data/lib/aspose_words_cloud/models/save_options_data.rb +61 -4
  65. data/lib/aspose_words_cloud/models/shading.rb +262 -0
  66. data/lib/aspose_words_cloud/models/style.rb +370 -0
  67. data/lib/aspose_words_cloud/models/style_apply.rb +207 -0
  68. data/lib/aspose_words_cloud/models/style_copy.rb +207 -0
  69. data/lib/aspose_words_cloud/models/style_insert.rb +254 -0
  70. data/lib/aspose_words_cloud/models/style_response.rb +216 -0
  71. data/lib/aspose_words_cloud/models/style_update.rb +237 -0
  72. data/lib/aspose_words_cloud/models/styles.rb +218 -0
  73. data/lib/aspose_words_cloud/models/styles_response.rb +216 -0
  74. data/lib/aspose_words_cloud/models/svg_save_options_data.rb +58 -1
  75. data/lib/aspose_words_cloud/models/tab_stop.rb +290 -0
  76. data/lib/aspose_words_cloud/models/tab_stop_base.rb +280 -0
  77. data/lib/aspose_words_cloud/models/tab_stop_insert.rb +280 -0
  78. data/lib/aspose_words_cloud/models/tab_stops_response.rb +219 -0
  79. data/lib/aspose_words_cloud/models/text_save_options_data.rb +37 -1
  80. data/lib/aspose_words_cloud/models/tiff_save_options_data.rb +58 -1
  81. data/lib/aspose_words_cloud/models/word_ml_save_options_data.rb +58 -1
  82. data/lib/aspose_words_cloud/models/xaml_fixed_save_options_data.rb +58 -1
  83. data/lib/aspose_words_cloud/models/xaml_flow_save_options_data.rb +58 -1
  84. data/lib/aspose_words_cloud/models/xps_save_options_data.rb +58 -1
  85. data/lib/aspose_words_cloud/version.rb +1 -1
  86. metadata +52 -2
@@ -113,6 +113,33 @@ module AsposeWordsCloud
113
113
  # Gets or sets a value determining if fields should be updated before saving the document to a fixed page format. Default value for this property is. true
114
114
  attr_accessor :update_fields
115
115
 
116
+ # Gets or sets a value determining how 3D effects are rendered.
117
+ attr_accessor :dml3_d_effects_rendering_mode
118
+
119
+ # Gets or sets a value determining whether the Aspose.Words.Properties.BuiltInDocumentProperties.LastPrinted property is updated before saving.
120
+ attr_accessor :update_last_printed_property
121
+
122
+ class EnumAttributeValidator
123
+ attr_reader :datatype
124
+ attr_reader :allowable_values
125
+
126
+ def initialize(datatype, allowable_values)
127
+ @allowable_values = allowable_values.map do |value|
128
+ case datatype.to_s
129
+ when /Integer/i
130
+ value.to_i
131
+ when /Float/i
132
+ value.to_f
133
+ else
134
+ value
135
+ end
136
+ end
137
+ end
138
+
139
+ def valid?(value)
140
+ !value || allowable_values.include?(value)
141
+ end
142
+ end
116
143
 
117
144
  # Attribute mapping from ruby-style variable name to JSON key.
118
145
  def self.attribute_map
@@ -144,7 +171,9 @@ module AsposeWordsCloud
144
171
  :'zip_output' => :'ZipOutput',
145
172
  :'update_last_saved_time_property' => :'UpdateLastSavedTimeProperty',
146
173
  :'update_sdt_content' => :'UpdateSdtContent',
147
- :'update_fields' => :'UpdateFields'
174
+ :'update_fields' => :'UpdateFields',
175
+ :'dml3_d_effects_rendering_mode' => :'Dml3DEffectsRenderingMode',
176
+ :'update_last_printed_property' => :'UpdateLastPrintedProperty'
148
177
  }
149
178
  end
150
179
 
@@ -178,7 +207,9 @@ module AsposeWordsCloud
178
207
  :'zip_output' => :'BOOLEAN',
179
208
  :'update_last_saved_time_property' => :'BOOLEAN',
180
209
  :'update_sdt_content' => :'BOOLEAN',
181
- :'update_fields' => :'BOOLEAN'
210
+ :'update_fields' => :'BOOLEAN',
211
+ :'dml3_d_effects_rendering_mode' => :'String',
212
+ :'update_last_printed_property' => :'BOOLEAN'
182
213
  }
183
214
  end
184
215
 
@@ -302,6 +333,14 @@ module AsposeWordsCloud
302
333
  self.update_fields = attributes[:'UpdateFields']
303
334
  end
304
335
 
336
+ if attributes.key?(:'Dml3DEffectsRenderingMode')
337
+ self.dml3_d_effects_rendering_mode = attributes[:'Dml3DEffectsRenderingMode']
338
+ end
339
+
340
+ if attributes.key?(:'UpdateLastPrintedProperty')
341
+ self.update_last_printed_property = attributes[:'UpdateLastPrintedProperty']
342
+ end
343
+
305
344
  end
306
345
 
307
346
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -314,9 +353,25 @@ module AsposeWordsCloud
314
353
  # Check to see if the all the properties in the model are valid
315
354
  # @return true if the model is valid
316
355
  def valid?
356
+ dml3_d_effects_rendering_mode_validator = EnumAttributeValidator.new('String', ["Basic", "Advanced"])
357
+ return false unless dml3_d_effects_rendering_mode_validator.valid?(@dml3_d_effects_rendering_mode)
317
358
  return true
318
359
  end
319
360
 
361
+ # Custom attribute writer method checking allowed values (enum).
362
+ # @param [Object] dml3_d_effects_rendering_mode Object to be assigned
363
+ def dml3_d_effects_rendering_mode=(dml3_d_effects_rendering_mode)
364
+ validator = EnumAttributeValidator.new('String', ["Basic", "Advanced"])
365
+ if dml3_d_effects_rendering_mode.to_i == 0
366
+ unless validator.valid?(dml3_d_effects_rendering_mode)
367
+ raise ArgumentError, "invalid value for 'dml3_d_effects_rendering_mode', must be one of #{validator.allowable_values}."
368
+ end
369
+ @dml3_d_effects_rendering_mode = dml3_d_effects_rendering_mode
370
+ else
371
+ @dml3_d_effects_rendering_mode = validator.allowable_values[dml3_d_effects_rendering_mode.to_i]
372
+ end
373
+ end
374
+
320
375
  # Checks equality by comparing each attribute.
321
376
  # @param [Object] Object to be compared
322
377
  def ==(other)
@@ -349,7 +404,9 @@ module AsposeWordsCloud
349
404
  zip_output == other.zip_output &&
350
405
  update_last_saved_time_property == other.update_last_saved_time_property &&
351
406
  update_sdt_content == other.update_sdt_content &&
352
- update_fields == other.update_fields
407
+ update_fields == other.update_fields &&
408
+ dml3_d_effects_rendering_mode == other.dml3_d_effects_rendering_mode &&
409
+ update_last_printed_property == other.update_last_printed_property
353
410
  end
354
411
 
355
412
  # @see the `==` method
@@ -361,7 +418,7 @@ module AsposeWordsCloud
361
418
  # Calculates hash code according to all attributes.
362
419
  # @return [Fixnum] Hash code
363
420
  def hash
364
- [graphics_quality_options, horizontal_resolution, image_brightness, image_color_mode, image_contrast, paper_color, pixel_format, resolution, scale, use_anti_aliasing, use_gdi_emf_renderer, use_high_quality_rendering, vertical_resolution, color_mode, jpeg_quality, metafile_rendering_options, numeral_format, optimize_output, page_count, page_index, save_format, file_name, dml_rendering_mode, dml_effects_rendering_mode, zip_output, update_last_saved_time_property, update_sdt_content, update_fields].hash
421
+ [graphics_quality_options, horizontal_resolution, image_brightness, image_color_mode, image_contrast, paper_color, pixel_format, resolution, scale, use_anti_aliasing, use_gdi_emf_renderer, use_high_quality_rendering, vertical_resolution, color_mode, jpeg_quality, metafile_rendering_options, numeral_format, optimize_output, page_count, page_index, save_format, file_name, dml_rendering_mode, dml_effects_rendering_mode, zip_output, update_last_saved_time_property, update_sdt_content, update_fields, dml3_d_effects_rendering_mode, update_last_printed_property].hash
365
422
  end
366
423
 
367
424
  # Builds the object from hash
@@ -75,9 +75,36 @@ module AsposeWordsCloud
75
75
  # Gets or sets a value determining if fields should be updated before saving the document to a fixed page format. Default value for this property is. true
76
76
  attr_accessor :update_fields
77
77
 
78
+ # Gets or sets a value determining how 3D effects are rendered.
79
+ attr_accessor :dml3_d_effects_rendering_mode
80
+
81
+ # Gets or sets a value determining whether the Aspose.Words.Properties.BuiltInDocumentProperties.LastPrinted property is updated before saving.
82
+ attr_accessor :update_last_printed_property
83
+
78
84
  # Gets or sets determines whether the document should be saved using a booklet printing layout.
79
85
  attr_accessor :use_book_fold_printing_settings
80
86
 
87
+ class EnumAttributeValidator
88
+ attr_reader :datatype
89
+ attr_reader :allowable_values
90
+
91
+ def initialize(datatype, allowable_values)
92
+ @allowable_values = allowable_values.map do |value|
93
+ case datatype.to_s
94
+ when /Integer/i
95
+ value.to_i
96
+ when /Float/i
97
+ value.to_f
98
+ else
99
+ value
100
+ end
101
+ end
102
+ end
103
+
104
+ def valid?(value)
105
+ !value || allowable_values.include?(value)
106
+ end
107
+ end
81
108
 
82
109
  # Attribute mapping from ruby-style variable name to JSON key.
83
110
  def self.attribute_map
@@ -97,6 +124,8 @@ module AsposeWordsCloud
97
124
  :'update_last_saved_time_property' => :'UpdateLastSavedTimeProperty',
98
125
  :'update_sdt_content' => :'UpdateSdtContent',
99
126
  :'update_fields' => :'UpdateFields',
127
+ :'dml3_d_effects_rendering_mode' => :'Dml3DEffectsRenderingMode',
128
+ :'update_last_printed_property' => :'UpdateLastPrintedProperty',
100
129
  :'use_book_fold_printing_settings' => :'UseBookFoldPrintingSettings'
101
130
  }
102
131
  end
@@ -119,6 +148,8 @@ module AsposeWordsCloud
119
148
  :'update_last_saved_time_property' => :'BOOLEAN',
120
149
  :'update_sdt_content' => :'BOOLEAN',
121
150
  :'update_fields' => :'BOOLEAN',
151
+ :'dml3_d_effects_rendering_mode' => :'String',
152
+ :'update_last_printed_property' => :'BOOLEAN',
122
153
  :'use_book_fold_printing_settings' => :'BOOLEAN'
123
154
  }
124
155
  end
@@ -191,6 +222,14 @@ module AsposeWordsCloud
191
222
  self.update_fields = attributes[:'UpdateFields']
192
223
  end
193
224
 
225
+ if attributes.key?(:'Dml3DEffectsRenderingMode')
226
+ self.dml3_d_effects_rendering_mode = attributes[:'Dml3DEffectsRenderingMode']
227
+ end
228
+
229
+ if attributes.key?(:'UpdateLastPrintedProperty')
230
+ self.update_last_printed_property = attributes[:'UpdateLastPrintedProperty']
231
+ end
232
+
194
233
  if attributes.key?(:'UseBookFoldPrintingSettings')
195
234
  self.use_book_fold_printing_settings = attributes[:'UseBookFoldPrintingSettings']
196
235
  end
@@ -207,9 +246,25 @@ module AsposeWordsCloud
207
246
  # Check to see if the all the properties in the model are valid
208
247
  # @return true if the model is valid
209
248
  def valid?
249
+ dml3_d_effects_rendering_mode_validator = EnumAttributeValidator.new('String', ["Basic", "Advanced"])
250
+ return false unless dml3_d_effects_rendering_mode_validator.valid?(@dml3_d_effects_rendering_mode)
210
251
  return true
211
252
  end
212
253
 
254
+ # Custom attribute writer method checking allowed values (enum).
255
+ # @param [Object] dml3_d_effects_rendering_mode Object to be assigned
256
+ def dml3_d_effects_rendering_mode=(dml3_d_effects_rendering_mode)
257
+ validator = EnumAttributeValidator.new('String', ["Basic", "Advanced"])
258
+ if dml3_d_effects_rendering_mode.to_i == 0
259
+ unless validator.valid?(dml3_d_effects_rendering_mode)
260
+ raise ArgumentError, "invalid value for 'dml3_d_effects_rendering_mode', must be one of #{validator.allowable_values}."
261
+ end
262
+ @dml3_d_effects_rendering_mode = dml3_d_effects_rendering_mode
263
+ else
264
+ @dml3_d_effects_rendering_mode = validator.allowable_values[dml3_d_effects_rendering_mode.to_i]
265
+ end
266
+ end
267
+
213
268
  # Checks equality by comparing each attribute.
214
269
  # @param [Object] Object to be compared
215
270
  def ==(other)
@@ -230,6 +285,8 @@ module AsposeWordsCloud
230
285
  update_last_saved_time_property == other.update_last_saved_time_property &&
231
286
  update_sdt_content == other.update_sdt_content &&
232
287
  update_fields == other.update_fields &&
288
+ dml3_d_effects_rendering_mode == other.dml3_d_effects_rendering_mode &&
289
+ update_last_printed_property == other.update_last_printed_property &&
233
290
  use_book_fold_printing_settings == other.use_book_fold_printing_settings
234
291
  end
235
292
 
@@ -242,7 +299,7 @@ module AsposeWordsCloud
242
299
  # Calculates hash code according to all attributes.
243
300
  # @return [Fixnum] Hash code
244
301
  def hash
245
- [color_mode, jpeg_quality, metafile_rendering_options, numeral_format, optimize_output, page_count, page_index, save_format, file_name, dml_rendering_mode, dml_effects_rendering_mode, zip_output, update_last_saved_time_property, update_sdt_content, update_fields, use_book_fold_printing_settings].hash
302
+ [color_mode, jpeg_quality, metafile_rendering_options, numeral_format, optimize_output, page_count, page_index, save_format, file_name, dml_rendering_mode, dml_effects_rendering_mode, zip_output, update_last_saved_time_property, update_sdt_content, update_fields, dml3_d_effects_rendering_mode, update_last_printed_property, use_book_fold_printing_settings].hash
246
303
  end
247
304
 
248
305
  # Builds the object from hash
@@ -0,0 +1,26 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeWordsCloud
5
+
6
+ class ReportBuildOptions
7
+
8
+ NONE = "None".freeze
9
+
10
+ ALLOWMISSINGMEMBERS = "AllowMissingMembers".freeze
11
+
12
+ REMOVEEMPTYPARAGRAPHS = "RemoveEmptyParagraphs".freeze
13
+
14
+ INLINEERRORMESSAGES = "InlineErrorMessages".freeze
15
+
16
+ # Builds the enum from string
17
+ # @param [String] The enum value in the form of the string
18
+ # @return [String] The enum value
19
+ def build_from_hash(value)
20
+ constantValues = ReportBuildOptions.constants.select{|c| ReportBuildOptions::const_get(c) == value}
21
+ raise "Invalid ENUM value #{value} for class #ReportBuildOptions" if constantValues.empty?
22
+ value
23
+ end
24
+ end
25
+
26
+ end
@@ -0,0 +1,275 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeWordsCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="ReportEngineSettings.rb">
8
+ # Copyright (c) 2019 Aspose.Words for Cloud
9
+ # </copyright>
10
+ # <summary>
11
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ # of this software and associated documentation files (the "Software"), to deal
13
+ # in the Software without restriction, including without limitation the rights
14
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ # copies of the Software, and to permit persons to whom the Software is
16
+ # furnished to do so, subject to the following conditions:
17
+ #
18
+ # The above copyright notice and this permission notice shall be included in all
19
+ # copies or substantial portions of the Software.
20
+ #
21
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ # SOFTWARE.
28
+ # </summary>
29
+ # --------------------------------------------------------------------------------------------------------------------
30
+ #
31
+
32
+ # Report engine settings.
33
+ class ReportEngineSettings
34
+ # Gets or sets type of datasource.
35
+ attr_accessor :data_source_type
36
+
37
+ # Gets or sets type of options to build report.
38
+ attr_accessor :report_build_options
39
+
40
+ # Gets or sets a name to reference the data source object in the template.
41
+ attr_accessor :data_source_name
42
+
43
+ attr_accessor :csv_data_load_options
44
+
45
+ class EnumAttributeValidator
46
+ attr_reader :datatype
47
+ attr_reader :allowable_values
48
+
49
+ def initialize(datatype, allowable_values)
50
+ @allowable_values = allowable_values.map do |value|
51
+ case datatype.to_s
52
+ when /Integer/i
53
+ value.to_i
54
+ when /Float/i
55
+ value.to_f
56
+ else
57
+ value
58
+ end
59
+ end
60
+ end
61
+
62
+ def valid?(value)
63
+ !value || allowable_values.include?(value)
64
+ end
65
+ end
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ :'data_source_type' => :'DataSourceType',
71
+ :'report_build_options' => :'ReportBuildOptions',
72
+ :'data_source_name' => :'DataSourceName',
73
+ :'csv_data_load_options' => :'CsvDataLoadOptions'
74
+ }
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.swagger_types
79
+ {
80
+ :'data_source_type' => :'String',
81
+ :'report_build_options' => :'Array<ReportBuildOptions>',
82
+ :'data_source_name' => :'String',
83
+ :'csv_data_load_options' => :'CsvDataLoadOptions'
84
+ }
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ return unless attributes.is_a?(Hash)
91
+
92
+ # convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
94
+
95
+ if attributes.key?(:'DataSourceType')
96
+ self.data_source_type = attributes[:'DataSourceType']
97
+ end
98
+
99
+ if attributes.key?(:'ReportBuildOptions')
100
+ if (value = attributes[:'ReportBuildOptions']).is_a?(Array)
101
+ self.report_build_options = value
102
+ end
103
+ end
104
+
105
+ if attributes.key?(:'DataSourceName')
106
+ self.data_source_name = attributes[:'DataSourceName']
107
+ end
108
+
109
+ if attributes.key?(:'CsvDataLoadOptions')
110
+ self.csv_data_load_options = attributes[:'CsvDataLoadOptions']
111
+ end
112
+
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properies with the reasons
117
+ def list_invalid_properties
118
+ invalid_properties = []
119
+ return invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ data_source_type_validator = EnumAttributeValidator.new('String', ["Xml", "Json", "Csv"])
126
+ return false unless data_source_type_validator.valid?(@data_source_type)
127
+ return true
128
+ end
129
+
130
+ # Custom attribute writer method checking allowed values (enum).
131
+ # @param [Object] data_source_type Object to be assigned
132
+ def data_source_type=(data_source_type)
133
+ validator = EnumAttributeValidator.new('String', ["Xml", "Json", "Csv"])
134
+ if data_source_type.to_i == 0
135
+ unless validator.valid?(data_source_type)
136
+ raise ArgumentError, "invalid value for 'data_source_type', must be one of #{validator.allowable_values}."
137
+ end
138
+ @data_source_type = data_source_type
139
+ else
140
+ @data_source_type = validator.allowable_values[data_source_type.to_i]
141
+ end
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(other)
147
+ return true if self.equal?(other)
148
+ self.class == other.class &&
149
+ data_source_type == other.data_source_type &&
150
+ report_build_options == other.report_build_options &&
151
+ data_source_name == other.data_source_name &&
152
+ csv_data_load_options == other.csv_data_load_options
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(other)
158
+ self == other
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Fixnum] Hash code
163
+ def hash
164
+ [data_source_type, report_build_options, data_source_name, csv_data_load_options].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ self.class.swagger_types.each_pair do |key, type|
173
+ if type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
177
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
178
+ end
179
+ elsif !attributes[self.class.attribute_map[key]].nil?
180
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
181
+ end
182
+ # or else data not found in attributes(hash), not an issue as the data can be optional
183
+ end
184
+
185
+ self
186
+ end
187
+
188
+ # Deserializes the data based on type
189
+ # @param string type Data type
190
+ # @param string value Value to be deserialized
191
+ # @return [Object] Deserialized data
192
+ def _deserialize(type, value)
193
+ case type.to_sym
194
+ when :DateTime
195
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
196
+ when :Date
197
+ Time.at(/\d/.match(value)[0].to_f).to_date
198
+ when :String
199
+ value.to_s
200
+ when :Integer
201
+ value.to_i
202
+ when :Float
203
+ value.to_f
204
+ when :BOOLEAN
205
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
206
+ true
207
+ else
208
+ false
209
+ end
210
+ when :Object
211
+ # generic object (usually a Hash), return directly
212
+ value
213
+ when /\AArray<(?<inner_type>.+)>\z/
214
+ inner_type = Regexp.last_match[:inner_type]
215
+ value.map { |v| _deserialize(inner_type, v) }
216
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
217
+ k_type = Regexp.last_match[:k_type]
218
+ v_type = Regexp.last_match[:v_type]
219
+ {}.tap do |hash|
220
+ value.each do |k, v|
221
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
222
+ end
223
+ end
224
+ else
225
+ # model
226
+ temp_model = AsposeWordsCloud.const_get(type).new
227
+ temp_model.build_from_hash(value)
228
+ end
229
+ end
230
+
231
+ # Returns the string representation of the object
232
+ # @return [String] String presentation of the object
233
+ def to_s
234
+ to_hash.to_s
235
+ end
236
+
237
+ # to_body is an alias to to_hash (backward compatibility)
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_body
240
+ to_hash
241
+ end
242
+
243
+ # Returns the object in the form of hash
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_hash
246
+ hash = {}
247
+ self.class.attribute_map.each_pair do |attr, param|
248
+ value = self.send(attr)
249
+ next if value.nil?
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ # Outputs non-array value in the form of hash
256
+ # For object, use to_hash. Otherwise, just return the value
257
+ # @param [Object] value Any valid value
258
+ # @return [Hash] Returns the value in the form of hash
259
+ def _to_hash(value)
260
+ if value.is_a?(Array)
261
+ value.compact.map { |v| _to_hash(v) }
262
+ elsif value.is_a?(Hash)
263
+ {}.tap do |hash|
264
+ value.each { |k, v| hash[k] = _to_hash(v) }
265
+ end
266
+ elsif value.respond_to? :to_hash
267
+ value.to_hash
268
+ else
269
+ value
270
+ end
271
+ end
272
+
273
+ end
274
+
275
+ end