@@ -58,8 +58,8 @@ class CsvLoadOptions
5858 # Set password to unprotect protected document
5959 attr_accessor :password
6060
61- # Hide comments
62- attr_accessor :hide_comments
61+ # Represents the way comments are printed with the sheet. Default is PrintNoComments.
62+ attr_accessor :print_comments
6363
6464 # Delimiter of a Csv file
6565 attr_accessor :separator
@@ -78,6 +78,27 @@ class CsvLoadOptions
7878
7979 # File encoding
8080 attr_accessor :encoding
81+ class EnumAttributeValidator
82+ attr_reader :datatype
83+ attr_reader :allowable_values
84+
85+ def initialize ( datatype , allowable_values )
86+ @allowable_values = allowable_values . map do |value |
87+ case datatype . to_s
88+ when /Integer/i
89+ value . to_i
90+ when /Float/i
91+ value . to_f
92+ else
93+ value
94+ end
95+ end
96+ end
97+
98+ def valid? ( value )
99+ !value || allowable_values . include? ( value )
100+ end
101+ end
81102
82103 # Attribute mapping from ruby-style variable name to JSON key.
83104 def self . attribute_map
@@ -91,7 +112,7 @@ def self.attribute_map
91112 :'convert_range' => :'ConvertRange' ,
92113 :'skip_empty_rows_and_columns' => :'SkipEmptyRowsAndColumns' ,
93114 :'password' => :'Password' ,
94- :'hide_comments ' => :'HideComments ' ,
115+ :'print_comments ' => :'PrintComments ' ,
95116 :'separator' => :'Separator' ,
96117 :'is_multi_encoded' => :'IsMultiEncoded' ,
97118 :'has_formula' => :'HasFormula' ,
@@ -113,7 +134,7 @@ def self.swagger_types
113134 :'convert_range' => :'String' ,
114135 :'skip_empty_rows_and_columns' => :'BOOLEAN' ,
115136 :'password' => :'String' ,
116- :'hide_comments ' => :'BOOLEAN ' ,
137+ :'print_comments ' => :'String ' ,
117138 :'separator' => :'String' ,
118139 :'is_multi_encoded' => :'BOOLEAN' ,
119140 :'has_formula' => :'BOOLEAN' ,
@@ -169,8 +190,8 @@ def initialize(attributes = {})
169190 self . password = attributes [ :'Password' ]
170191 end
171192
172- if attributes . key? ( :'HideComments ' )
173- self . hide_comments = attributes [ :'HideComments ' ]
193+ if attributes . key? ( :'PrintComments ' )
194+ self . print_comments = attributes [ :'PrintComments ' ]
174195 end
175196
176197 if attributes . key? ( :'Separator' )
@@ -219,8 +240,8 @@ def list_invalid_properties
219240 invalid_properties . push ( "invalid value for 'skip_empty_rows_and_columns', skip_empty_rows_and_columns cannot be nil." )
220241 end
221242
222- if @hide_comments . nil?
223- invalid_properties . push ( "invalid value for 'hide_comments ', hide_comments cannot be nil." )
243+ if @print_comments . nil?
244+ invalid_properties . push ( "invalid value for 'print_comments ', print_comments cannot be nil." )
224245 end
225246
226247 if @separator . nil?
@@ -253,7 +274,9 @@ def valid?
253274 return false if @show_hidden_sheets . nil?
254275 return false if @one_page_per_sheet . nil?
255276 return false if @skip_empty_rows_and_columns . nil?
256- return false if @hide_comments . nil?
277+ return false if @print_comments . nil?
278+ print_comments_validator = EnumAttributeValidator . new ( 'String' , [ "PrintInPlace" , "PrintNoComments" , "PrintSheetEnd" , "PrintWithThreadedComments" ] )
279+ return false unless print_comments_validator . valid? ( @print_comments )
257280 return false if @separator . nil?
258281 return false if @is_multi_encoded . nil?
259282 return false if @has_formula . nil?
@@ -262,6 +285,20 @@ def valid?
262285 return true
263286 end
264287
288+ # Custom attribute writer method checking allowed values (enum).
289+ # @param [Object] print_comments Object to be assigned
290+ def print_comments = ( print_comments )
291+ validator = EnumAttributeValidator . new ( 'String' , [ "PrintInPlace" , "PrintNoComments" , "PrintSheetEnd" , "PrintWithThreadedComments" ] )
292+ if print_comments . to_i == 0
293+ unless validator . valid? ( print_comments )
294+ raise ArgumentError , "invalid value for 'print_comments', must be one of #{ validator . allowable_values } ."
295+ end
296+ @print_comments = print_comments
297+ else
298+ @print_comments = validator . allowable_values [ print_comments . to_i ]
299+ end
300+ end
301+
265302 # Checks equality by comparing each attribute.
266303 # @param [Object] Object to be compared
267304 def ==( other )
@@ -276,7 +313,7 @@ def ==(other)
276313 convert_range == other . convert_range &&
277314 skip_empty_rows_and_columns == other . skip_empty_rows_and_columns &&
278315 password == other . password &&
279- hide_comments == other . hide_comments &&
316+ print_comments == other . print_comments &&
280317 separator == other . separator &&
281318 is_multi_encoded == other . is_multi_encoded &&
282319 has_formula == other . has_formula &&
@@ -294,7 +331,7 @@ def eql?(other)
294331 # Calculates hash code according to all attributes.
295332 # @return [Fixnum] Hash code
296333 def hash
297- [ format , default_font , font_substitutes , show_grid_lines , show_hidden_sheets , one_page_per_sheet , convert_range , skip_empty_rows_and_columns , password , hide_comments , separator , is_multi_encoded , has_formula , convert_numeric_data , convert_date_time_data , encoding ] . hash
334+ [ format , default_font , font_substitutes , show_grid_lines , show_hidden_sheets , one_page_per_sheet , convert_range , skip_empty_rows_and_columns , password , print_comments , separator , is_multi_encoded , has_formula , convert_numeric_data , convert_date_time_data , encoding ] . hash
298335 end
299336
300337 # Downcases first letter.
0 commit comments