|
| 1 | +=begin |
| 2 | +#Web API Swagger specification |
| 3 | +
|
| 4 | +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) |
| 5 | +
|
| 6 | +OpenAPI spec version: 1.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 AsposeCellsCloud |
| 16 | + |
| 17 | + class MarkdownSaveOptions |
| 18 | + attr_accessor :enable_http_compression |
| 19 | + |
| 20 | + attr_accessor :save_format |
| 21 | + |
| 22 | + # Make the workbook empty after saving the file. |
| 23 | + attr_accessor :clear_data |
| 24 | + |
| 25 | + # The cached file folder is used to store some large data. |
| 26 | + attr_accessor :cached_file_folder |
| 27 | + |
| 28 | + # Indicates whether validate merged areas before saving the file. The default value is false. |
| 29 | + attr_accessor :validate_merged_areas |
| 30 | + |
| 31 | + attr_accessor :refresh_chart_cache |
| 32 | + |
| 33 | + # If true and the directory does not exist, the directory will be automatically created before saving the file. |
| 34 | + attr_accessor :create_directory |
| 35 | + |
| 36 | + attr_accessor :sort_names |
| 37 | + |
| 38 | + attr_accessor :encoding |
| 39 | + |
| 40 | + attr_accessor :format_strategy |
| 41 | + |
| 42 | + attr_accessor :line_separator |
| 43 | + |
| 44 | + |
| 45 | + # Attribute mapping from ruby-style variable name to JSON key. |
| 46 | + def self.attribute_map |
| 47 | + { |
| 48 | + :'enable_http_compression' => :'EnableHTTPCompression', |
| 49 | + :'save_format' => :'SaveFormat', |
| 50 | + :'clear_data' => :'ClearData', |
| 51 | + :'cached_file_folder' => :'CachedFileFolder', |
| 52 | + :'validate_merged_areas' => :'ValidateMergedAreas', |
| 53 | + :'refresh_chart_cache' => :'RefreshChartCache', |
| 54 | + :'create_directory' => :'CreateDirectory', |
| 55 | + :'sort_names' => :'SortNames', |
| 56 | + :'encoding' => :'Encoding', |
| 57 | + :'format_strategy' => :'FormatStrategy', |
| 58 | + :'line_separator' => :'LineSeparator' |
| 59 | + } |
| 60 | + end |
| 61 | + |
| 62 | + # Attribute type mapping. |
| 63 | + def self.swagger_types |
| 64 | + { |
| 65 | + :'enable_http_compression' => :'BOOLEAN', |
| 66 | + :'save_format' => :'String', |
| 67 | + :'clear_data' => :'BOOLEAN', |
| 68 | + :'cached_file_folder' => :'String', |
| 69 | + :'validate_merged_areas' => :'BOOLEAN', |
| 70 | + :'refresh_chart_cache' => :'BOOLEAN', |
| 71 | + :'create_directory' => :'BOOLEAN', |
| 72 | + :'sort_names' => :'BOOLEAN', |
| 73 | + :'encoding' => :'String', |
| 74 | + :'format_strategy' => :'String', |
| 75 | + :'line_separator' => :'String' |
| 76 | + } |
| 77 | + end |
| 78 | + |
| 79 | + # Initializes the object |
| 80 | + # @param [Hash] attributes Model attributes in the form of hash |
| 81 | + def initialize(attributes = {}) |
| 82 | + return unless attributes.is_a?(Hash) |
| 83 | + |
| 84 | + # convert string to symbol for hash key |
| 85 | + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} |
| 86 | + |
| 87 | + if attributes.has_key?(:'EnableHTTPCompression') |
| 88 | + self.enable_http_compression = attributes[:'EnableHTTPCompression'] |
| 89 | + end |
| 90 | + |
| 91 | + if attributes.has_key?(:'SaveFormat') |
| 92 | + self.save_format = attributes[:'SaveFormat'] |
| 93 | + end |
| 94 | + |
| 95 | + if attributes.has_key?(:'ClearData') |
| 96 | + self.clear_data = attributes[:'ClearData'] |
| 97 | + end |
| 98 | + |
| 99 | + if attributes.has_key?(:'CachedFileFolder') |
| 100 | + self.cached_file_folder = attributes[:'CachedFileFolder'] |
| 101 | + end |
| 102 | + |
| 103 | + if attributes.has_key?(:'ValidateMergedAreas') |
| 104 | + self.validate_merged_areas = attributes[:'ValidateMergedAreas'] |
| 105 | + end |
| 106 | + |
| 107 | + if attributes.has_key?(:'RefreshChartCache') |
| 108 | + self.refresh_chart_cache = attributes[:'RefreshChartCache'] |
| 109 | + end |
| 110 | + |
| 111 | + if attributes.has_key?(:'CreateDirectory') |
| 112 | + self.create_directory = attributes[:'CreateDirectory'] |
| 113 | + end |
| 114 | + |
| 115 | + if attributes.has_key?(:'SortNames') |
| 116 | + self.sort_names = attributes[:'SortNames'] |
| 117 | + end |
| 118 | + |
| 119 | + if attributes.has_key?(:'Encoding') |
| 120 | + self.encoding = attributes[:'Encoding'] |
| 121 | + end |
| 122 | + |
| 123 | + if attributes.has_key?(:'FormatStrategy') |
| 124 | + self.format_strategy = attributes[:'FormatStrategy'] |
| 125 | + end |
| 126 | + |
| 127 | + if attributes.has_key?(:'LineSeparator') |
| 128 | + self.line_separator = attributes[:'LineSeparator'] |
| 129 | + end |
| 130 | + |
| 131 | + end |
| 132 | + |
| 133 | + # Show invalid properties with the reasons. Usually used together with valid? |
| 134 | + # @return Array for valid properies with the reasons |
| 135 | + def list_invalid_properties |
| 136 | + invalid_properties = Array.new |
| 137 | + return invalid_properties |
| 138 | + end |
| 139 | + |
| 140 | + # Check to see if the all the properties in the model are valid |
| 141 | + # @return true if the model is valid |
| 142 | + def valid? |
| 143 | + return true |
| 144 | + end |
| 145 | + |
| 146 | + # Checks equality by comparing each attribute. |
| 147 | + # @param [Object] Object to be compared |
| 148 | + def ==(o) |
| 149 | + return true if self.equal?(o) |
| 150 | + self.class == o.class && |
| 151 | + enable_http_compression == o.enable_http_compression && |
| 152 | + save_format == o.save_format && |
| 153 | + clear_data == o.clear_data && |
| 154 | + cached_file_folder == o.cached_file_folder && |
| 155 | + validate_merged_areas == o.validate_merged_areas && |
| 156 | + refresh_chart_cache == o.refresh_chart_cache && |
| 157 | + create_directory == o.create_directory && |
| 158 | + sort_names == o.sort_names && |
| 159 | + encoding == o.encoding && |
| 160 | + format_strategy == o.format_strategy && |
| 161 | + line_separator == o.line_separator |
| 162 | + end |
| 163 | + |
| 164 | + # @see the `==` method |
| 165 | + # @param [Object] Object to be compared |
| 166 | + def eql?(o) |
| 167 | + self == o |
| 168 | + end |
| 169 | + |
| 170 | + # Calculates hash code according to all attributes. |
| 171 | + # @return [Fixnum] Hash code |
| 172 | + def hash |
| 173 | + [enable_http_compression, save_format, clear_data, cached_file_folder, validate_merged_areas, refresh_chart_cache, create_directory, sort_names, encoding, format_strategy, line_separator].hash |
| 174 | + end |
| 175 | + |
| 176 | + # Builds the object from hash |
| 177 | + # @param [Hash] attributes Model attributes in the form of hash |
| 178 | + # @return [Object] Returns the model itself |
| 179 | + def build_from_hash(attributes) |
| 180 | + return nil unless attributes.is_a?(Hash) |
| 181 | + self.class.swagger_types.each_pair do |key, type| |
| 182 | + if type =~ /\AArray<(.*)>/i |
| 183 | + # check to ensure the input is an array given that the the attribute |
| 184 | + # is documented as an array but the input is not |
| 185 | + if attributes[self.class.attribute_map[key]].is_a?(Array) |
| 186 | + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) |
| 187 | + end |
| 188 | + elsif !attributes[self.class.attribute_map[key]].nil? |
| 189 | + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) |
| 190 | + end # or else data not found in attributes(hash), not an issue as the data can be optional |
| 191 | + end |
| 192 | + |
| 193 | + self |
| 194 | + end |
| 195 | + |
| 196 | + # Deserializes the data based on type |
| 197 | + # @param string type Data type |
| 198 | + # @param string value Value to be deserialized |
| 199 | + # @return [Object] Deserialized data |
| 200 | + def _deserialize(type, value) |
| 201 | + case type.to_sym |
| 202 | + when :DateTime |
| 203 | + DateTime.parse(value) |
| 204 | + when :Date |
| 205 | + Date.parse(value) |
| 206 | + when :String |
| 207 | + value.to_s |
| 208 | + when :Integer |
| 209 | + value.to_i |
| 210 | + when :Float |
| 211 | + value.to_f |
| 212 | + when :BOOLEAN |
| 213 | + if value.to_s =~ /\A(true|t|yes|y|1)\z/i |
| 214 | + true |
| 215 | + else |
| 216 | + false |
| 217 | + end |
| 218 | + when :Object |
| 219 | + # generic object (usually a Hash), return directly |
| 220 | + value |
| 221 | + when /\AArray<(?<inner_type>.+)>\z/ |
| 222 | + inner_type = Regexp.last_match[:inner_type] |
| 223 | + value.map { |v| _deserialize(inner_type, v) } |
| 224 | + when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ |
| 225 | + k_type = Regexp.last_match[:k_type] |
| 226 | + v_type = Regexp.last_match[:v_type] |
| 227 | + {}.tap do |hash| |
| 228 | + value.each do |k, v| |
| 229 | + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) |
| 230 | + end |
| 231 | + end |
| 232 | + else # model |
| 233 | + temp_model = AsposeCellsCloud.const_get(type).new |
| 234 | + temp_model.build_from_hash(value) |
| 235 | + end |
| 236 | + end |
| 237 | + |
| 238 | + # Returns the string representation of the object |
| 239 | + # @return [String] String presentation of the object |
| 240 | + def to_s |
| 241 | + to_hash.to_s |
| 242 | + end |
| 243 | + |
| 244 | + # to_body is an alias to to_hash (backward compatibility) |
| 245 | + # @return [Hash] Returns the object in the form of hash |
| 246 | + def to_body |
| 247 | + to_hash |
| 248 | + end |
| 249 | + |
| 250 | + # Returns the object in the form of hash |
| 251 | + # @return [Hash] Returns the object in the form of hash |
| 252 | + def to_hash |
| 253 | + hash = {} |
| 254 | + self.class.attribute_map.each_pair do |attr, param| |
| 255 | + value = self.send(attr) |
| 256 | + next if value.nil? |
| 257 | + hash[param] = _to_hash(value) |
| 258 | + end |
| 259 | + hash |
| 260 | + end |
| 261 | + |
| 262 | + # Outputs non-array value in the form of hash |
| 263 | + # For object, use to_hash. Otherwise, just return the value |
| 264 | + # @param [Object] value Any valid value |
| 265 | + # @return [Hash] Returns the value in the form of hash |
| 266 | + def _to_hash(value) |
| 267 | + if value.is_a?(Array) |
| 268 | + value.compact.map{ |v| _to_hash(v) } |
| 269 | + elsif value.is_a?(Hash) |
| 270 | + {}.tap do |hash| |
| 271 | + value.each { |k, v| hash[k] = _to_hash(v) } |
| 272 | + end |
| 273 | + elsif value.respond_to? :to_hash |
| 274 | + value.to_hash |
| 275 | + else |
| 276 | + value |
| 277 | + end |
| 278 | + end |
| 279 | + |
| 280 | + end |
| 281 | + |
| 282 | +end |
0 commit comments