Class: ProtonApi::GoalAccumulationAllocationRequest
- Inherits:
-
Object
- Object
- ProtonApi::GoalAccumulationAllocationRequest
- Defined in:
- lib/proton_api/models/goal_accumulation_allocation_request.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#adjust_for_compounding ⇒ Object
Returns the value of attribute adjust_for_compounding.
-
#allocation_method ⇒ Object
Returns the value of attribute allocation_method.
-
#allocation_priority ⇒ Object
Returns the value of attribute allocation_priority.
-
#allocations ⇒ Object
Returns the value of attribute allocations.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#compounding_rate ⇒ Object
Returns the value of attribute compounding_rate.
-
#conf_tgt ⇒ Object
Returns the value of attribute conf_tgt.
-
#create_log ⇒ Object
Returns the value of attribute create_log.
-
#curr_inv ⇒ Object
Returns the value of attribute curr_inv.
-
#deposit_config ⇒ Object
Returns the value of attribute deposit_config.
-
#goal_config ⇒ Object
Returns the value of attribute goal_config.
-
#goal_id ⇒ Object
Returns the value of attribute goal_id.
-
#horizon ⇒ Object
Returns the value of attribute horizon.
-
#horizon_frequency ⇒ Object
Returns the value of attribute horizon_frequency.
-
#market_data_source ⇒ Object
Returns the value of attribute market_data_source.
-
#n ⇒ Object
Returns the value of attribute n.
-
#opt_config ⇒ Object
Returns the value of attribute opt_config.
-
#recommend_type ⇒ Object
Returns the value of attribute recommend_type.
-
#recommendation_config ⇒ Object
Returns the value of attribute recommendation_config.
-
#remove_outliers ⇒ Object
Returns the value of attribute remove_outliers.
-
#risk_score ⇒ Object
Returns the value of attribute risk_score.
-
#thresh ⇒ Object
Returns the value of attribute thresh.
-
#thresh_type ⇒ Object
Returns the value of attribute thresh_type.
-
#trading_days_per_year ⇒ Object
Returns the value of attribute trading_days_per_year.
-
#use_proxy_data ⇒ Object
Returns the value of attribute use_proxy_data.
-
#withdrawal_tax ⇒ Object
Returns the value of attribute withdrawal_tax.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserialized data.
-
#_to_hash(value) ⇒ Hash
For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ GoalAccumulationAllocationRequest
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
String presentation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ GoalAccumulationAllocationRequest
Initializes the object
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 157 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'recommendation_config') self.recommendation_config = attributes[:'recommendation_config'] end if attributes.has_key?(:'compounding_rate') self.compounding_rate = attributes[:'compounding_rate'] else self.compounding_rate = 0.0 end if attributes.has_key?(:'risk_score') self.risk_score = attributes[:'risk_score'] end if attributes.has_key?(:'recommend_type') self.recommend_type = attributes[:'recommend_type'] else self.recommend_type = 'horizon' end if attributes.has_key?(:'create_log') self.create_log = attributes[:'create_log'] else self.create_log = false end if attributes.has_key?(:'goal_config') self.goal_config = attributes[:'goal_config'] end if attributes.has_key?(:'n') self.n = attributes[:'n'] else self.n = 1000 end if attributes.has_key?(:'allocation_method') self.allocation_method = attributes[:'allocation_method'] end if attributes.has_key?(:'allocation_priority') self.allocation_priority = attributes[:'allocation_priority'] end if attributes.has_key?(:'remove_outliers') self.remove_outliers = attributes[:'remove_outliers'] else self.remove_outliers = true end if attributes.has_key?(:'adjust_for_compounding') self.adjust_for_compounding = attributes[:'adjust_for_compounding'] else self.adjust_for_compounding = false end if attributes.has_key?(:'goal_id') self.goal_id = attributes[:'goal_id'] end if attributes.has_key?(:'conf_tgt') self.conf_tgt = attributes[:'conf_tgt'] else self.conf_tgt = 0.9 end if attributes.has_key?(:'trading_days_per_year') self.trading_days_per_year = attributes[:'trading_days_per_year'] else self.trading_days_per_year = 252 end if attributes.has_key?(:'use_proxy_data') self.use_proxy_data = attributes[:'use_proxy_data'] else self.use_proxy_data = false end if attributes.has_key?(:'thresh') self.thresh = attributes[:'thresh'] end if attributes.has_key?(:'withdrawal_tax') self.withdrawal_tax = attributes[:'withdrawal_tax'] else self.withdrawal_tax = 0.0 end if attributes.has_key?(:'client_id') self.client_id = attributes[:'client_id'] end if attributes.has_key?(:'opt_config') self.opt_config = attributes[:'opt_config'] end if attributes.has_key?(:'market_data_source') self.market_data_source = attributes[:'market_data_source'] else self.market_data_source = 'nucleus' end if attributes.has_key?(:'thresh_type') self.thresh_type = attributes[:'thresh_type'] else self.thresh_type = 'perc' end if attributes.has_key?(:'horizon_frequency') self.horizon_frequency = attributes[:'horizon_frequency'] else self.horizon_frequency = 'year' end if attributes.has_key?(:'horizon') self.horizon = attributes[:'horizon'] end if attributes.has_key?(:'allocations') if (value = attributes[:'allocations']).is_a?(Array) self.allocations = value end end if attributes.has_key?(:'curr_inv') self.curr_inv = attributes[:'curr_inv'] end if attributes.has_key?(:'deposit_config') if (value = attributes[:'deposit_config']).is_a?(Array) self.deposit_config = value end end end |
Instance Attribute Details
#adjust_for_compounding ⇒ Object
Returns the value of attribute adjust_for_compounding.
37 38 39 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 37 def adjust_for_compounding @adjust_for_compounding end |
#allocation_method ⇒ Object
Returns the value of attribute allocation_method.
31 32 33 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 31 def allocation_method @allocation_method end |
#allocation_priority ⇒ Object
Returns the value of attribute allocation_priority.
33 34 35 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 33 def allocation_priority @allocation_priority end |
#allocations ⇒ Object
Returns the value of attribute allocations.
63 64 65 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 63 def allocations @allocations end |
#client_id ⇒ Object
Returns the value of attribute client_id.
51 52 53 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 51 def client_id @client_id end |
#compounding_rate ⇒ Object
Returns the value of attribute compounding_rate.
19 20 21 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 19 def compounding_rate @compounding_rate end |
#conf_tgt ⇒ Object
Returns the value of attribute conf_tgt.
41 42 43 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 41 def conf_tgt @conf_tgt end |
#create_log ⇒ Object
Returns the value of attribute create_log.
25 26 27 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 25 def create_log @create_log end |
#curr_inv ⇒ Object
Returns the value of attribute curr_inv.
65 66 67 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 65 def curr_inv @curr_inv end |
#deposit_config ⇒ Object
Returns the value of attribute deposit_config.
67 68 69 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 67 def deposit_config @deposit_config end |
#goal_config ⇒ Object
Returns the value of attribute goal_config.
27 28 29 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 27 def goal_config @goal_config end |
#goal_id ⇒ Object
Returns the value of attribute goal_id.
39 40 41 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 39 def goal_id @goal_id end |
#horizon ⇒ Object
Returns the value of attribute horizon.
61 62 63 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 61 def horizon @horizon end |
#horizon_frequency ⇒ Object
Returns the value of attribute horizon_frequency.
59 60 61 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 59 def horizon_frequency @horizon_frequency end |
#market_data_source ⇒ Object
Returns the value of attribute market_data_source.
55 56 57 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 55 def market_data_source @market_data_source end |
#n ⇒ Object
Returns the value of attribute n.
29 30 31 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 29 def n @n end |
#opt_config ⇒ Object
Returns the value of attribute opt_config.
53 54 55 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 53 def opt_config @opt_config end |
#recommend_type ⇒ Object
Returns the value of attribute recommend_type.
23 24 25 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 23 def recommend_type @recommend_type end |
#recommendation_config ⇒ Object
Returns the value of attribute recommendation_config.
17 18 19 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 17 def recommendation_config @recommendation_config end |
#remove_outliers ⇒ Object
Returns the value of attribute remove_outliers.
35 36 37 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 35 def remove_outliers @remove_outliers end |
#risk_score ⇒ Object
Returns the value of attribute risk_score.
21 22 23 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 21 def risk_score @risk_score end |
#thresh ⇒ Object
Returns the value of attribute thresh.
47 48 49 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 47 def thresh @thresh end |
#thresh_type ⇒ Object
Returns the value of attribute thresh_type.
57 58 59 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 57 def thresh_type @thresh_type end |
#trading_days_per_year ⇒ Object
Returns the value of attribute trading_days_per_year.
43 44 45 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 43 def trading_days_per_year @trading_days_per_year end |
#use_proxy_data ⇒ Object
Returns the value of attribute use_proxy_data.
45 46 47 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 45 def use_proxy_data @use_proxy_data end |
#withdrawal_tax ⇒ Object
Returns the value of attribute withdrawal_tax.
49 50 51 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 49 def withdrawal_tax @withdrawal_tax end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 92 def self.attribute_map { :'recommendation_config' => :'recommendation_config', :'compounding_rate' => :'compounding_rate', :'risk_score' => :'risk_score', :'recommend_type' => :'recommend_type', :'create_log' => :'create_log', :'goal_config' => :'goal_config', :'n' => :'n', :'allocation_method' => :'allocation_method', :'allocation_priority' => :'allocation_priority', :'remove_outliers' => :'remove_outliers', :'adjust_for_compounding' => :'adjust_for_compounding', :'goal_id' => :'goal_id', :'conf_tgt' => :'conf_tgt', :'trading_days_per_year' => :'trading_days_per_year', :'use_proxy_data' => :'use_proxy_data', :'thresh' => :'thresh', :'withdrawal_tax' => :'withdrawal_tax', :'client_id' => :'client_id', :'opt_config' => :'opt_config', :'market_data_source' => :'market_data_source', :'thresh_type' => :'thresh_type', :'horizon_frequency' => :'horizon_frequency', :'horizon' => :'horizon', :'allocations' => :'allocations', :'curr_inv' => :'curr_inv', :'deposit_config' => :'deposit_config' } end |
.swagger_types ⇒ Object
Attribute type mapping.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 124 def self.swagger_types { :'recommendation_config' => :'RecommendationConfig', :'compounding_rate' => :'Float', :'risk_score' => :'Float', :'recommend_type' => :'String', :'create_log' => :'BOOLEAN', :'goal_config' => :'GoalConfig', :'n' => :'Integer', :'allocation_method' => :'String', :'allocation_priority' => :'String', :'remove_outliers' => :'BOOLEAN', :'adjust_for_compounding' => :'BOOLEAN', :'goal_id' => :'String', :'conf_tgt' => :'Float', :'trading_days_per_year' => :'Integer', :'use_proxy_data' => :'BOOLEAN', :'thresh' => :'Float', :'withdrawal_tax' => :'Float', :'client_id' => :'String', :'opt_config' => :'OptConfig', :'market_data_source' => :'String', :'thresh_type' => :'String', :'horizon_frequency' => :'String', :'horizon' => :'Integer', :'allocations' => :'Array<String>', :'curr_inv' => :'Float', :'deposit_config' => :'Array<AccumulationGoalDepositConfig>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 584 def ==(o) return true if self.equal?(o) self.class == o.class && recommendation_config == o.recommendation_config && compounding_rate == o.compounding_rate && risk_score == o.risk_score && recommend_type == o.recommend_type && create_log == o.create_log && goal_config == o.goal_config && n == o.n && allocation_method == o.allocation_method && allocation_priority == o.allocation_priority && remove_outliers == o.remove_outliers && adjust_for_compounding == o.adjust_for_compounding && goal_id == o.goal_id && conf_tgt == o.conf_tgt && trading_days_per_year == o.trading_days_per_year && use_proxy_data == o.use_proxy_data && thresh == o.thresh && withdrawal_tax == o.withdrawal_tax && client_id == o.client_id && opt_config == o.opt_config && market_data_source == o.market_data_source && thresh_type == o.thresh_type && horizon_frequency == o.horizon_frequency && horizon == o.horizon && allocations == o.allocations && curr_inv == o.curr_inv && deposit_config == o.deposit_config end |
#_deserialize(type, value) ⇒ Object
Returns Deserialized data.
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 650 def _deserialize(type, value) case type.to_sym when :DateTime value when :Date value when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = ProtonApi.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
For object, use to_hash. Otherwise, just return the value
714 715 716 717 718 719 720 721 722 723 724 725 726 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 714 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 630 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
617 618 619 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 617 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
623 624 625 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 623 def hash [recommendation_config, compounding_rate, risk_score, recommend_type, create_log, goal_config, n, allocation_method, allocation_priority, remove_outliers, adjust_for_compounding, goal_id, conf_tgt, trading_days_per_year, use_proxy_data, thresh, withdrawal_tax, client_id, opt_config, market_data_source, thresh_type, horizon_frequency, horizon, allocations, curr_inv, deposit_config].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 300 def list_invalid_properties invalid_properties = Array.new if !@compounding_rate.nil? && @compounding_rate < -1 invalid_properties.push('invalid value for "compounding_rate", must be greater than or equal to -1.') end if !@risk_score.nil? && @risk_score > 100 invalid_properties.push('invalid value for "risk_score", must be smaller than or equal to 100.') end if !@risk_score.nil? && @risk_score < 0 invalid_properties.push('invalid value for "risk_score", must be greater than or equal to 0.') end if !@n.nil? && @n > 10000 invalid_properties.push('invalid value for "n", must be smaller than or equal to 10000.') end if !@n.nil? && @n < 1 invalid_properties.push('invalid value for "n", must be greater than or equal to 1.') end if @allocation_method.nil? invalid_properties.push('invalid value for "allocation_method", allocation_method cannot be nil.') end if @allocation_priority.nil? invalid_properties.push('invalid value for "allocation_priority", allocation_priority cannot be nil.') end if !@conf_tgt.nil? && @conf_tgt > 1 invalid_properties.push('invalid value for "conf_tgt", must be smaller than or equal to 1.') end if !@conf_tgt.nil? && @conf_tgt < 0 invalid_properties.push('invalid value for "conf_tgt", must be greater than or equal to 0.') end if !@trading_days_per_year.nil? && @trading_days_per_year > 365 invalid_properties.push('invalid value for "trading_days_per_year", must be smaller than or equal to 365.') end if !@trading_days_per_year.nil? && @trading_days_per_year < 1 invalid_properties.push('invalid value for "trading_days_per_year", must be greater than or equal to 1.') end if !@thresh.nil? && @thresh < 0 invalid_properties.push('invalid value for "thresh", must be greater than or equal to 0.') end if !@withdrawal_tax.nil? && @withdrawal_tax > 1 invalid_properties.push('invalid value for "withdrawal_tax", must be smaller than or equal to 1.') end if !@withdrawal_tax.nil? && @withdrawal_tax < 0 invalid_properties.push('invalid value for "withdrawal_tax", must be greater than or equal to 0.') end if !@horizon.nil? && @horizon > 350 invalid_properties.push('invalid value for "horizon", must be smaller than or equal to 350.') end if !@horizon.nil? && @horizon < 0 invalid_properties.push('invalid value for "horizon", must be greater than or equal to 0.') end if !@curr_inv.nil? && @curr_inv < 0 invalid_properties.push('invalid value for "curr_inv", must be greater than or equal to 0.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
695 696 697 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 695 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
701 702 703 704 705 706 707 708 709 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 701 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns String presentation of the object.
689 690 691 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 689 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
# File 'lib/proton_api/models/goal_accumulation_allocation_request.rb', line 375 def valid? return false if !@compounding_rate.nil? && @compounding_rate < -1 return false if !@risk_score.nil? && @risk_score > 100 return false if !@risk_score.nil? && @risk_score < 0 recommend_type_validator = EnumAttributeValidator.new('String', ['recurring', 'one-time', 'combo', 'horizon']) return false unless recommend_type_validator.valid?(@recommend_type) return false if !@n.nil? && @n > 10000 return false if !@n.nil? && @n < 1 return false if @allocation_method.nil? allocation_method_validator = EnumAttributeValidator.new('String', ['select', 'create']) return false unless allocation_method_validator.valid?(@allocation_method) return false if @allocation_priority.nil? allocation_priority_validator = EnumAttributeValidator.new('String', ['goal', 'risk']) return false unless allocation_priority_validator.valid?(@allocation_priority) return false if !@conf_tgt.nil? && @conf_tgt > 1 return false if !@conf_tgt.nil? && @conf_tgt < 0 return false if !@trading_days_per_year.nil? && @trading_days_per_year > 365 return false if !@trading_days_per_year.nil? && @trading_days_per_year < 1 return false if !@thresh.nil? && @thresh < 0 return false if !@withdrawal_tax.nil? && @withdrawal_tax > 1 return false if !@withdrawal_tax.nil? && @withdrawal_tax < 0 market_data_source_validator = EnumAttributeValidator.new('String', ['nucleus', 'integration']) return false unless market_data_source_validator.valid?(@market_data_source) thresh_type_validator = EnumAttributeValidator.new('String', ['amnt', 'perc']) return false unless thresh_type_validator.valid?(@thresh_type) horizon_frequency_validator = EnumAttributeValidator.new('String', ['year', 'six_months', 'quarter', 'month', 'two_weeks', 'week', 'day']) return false unless horizon_frequency_validator.valid?(@horizon_frequency) return false if !@horizon.nil? && @horizon > 350 return false if !@horizon.nil? && @horizon < 0 return false if !@curr_inv.nil? && @curr_inv < 0 true end |