Class: ProtonApi::PerformanceCalculatorRequest
- Inherits:
-
Object
- Object
- ProtonApi::PerformanceCalculatorRequest
- Defined in:
- lib/proton_api/models/performance_calculator_request.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#active_premium_period ⇒ Object
Returns the value of attribute active_premium_period.
-
#allocation_id ⇒ Object
Returns the value of attribute allocation_id.
-
#annualized_return_period ⇒ Object
Returns the value of attribute annualized_return_period.
-
#benchmark_id ⇒ Object
Returns the value of attribute benchmark_id.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#goal_id ⇒ Object
Returns the value of attribute goal_id.
-
#hist_factor ⇒ Object
Returns the value of attribute hist_factor.
-
#household_id ⇒ Object
Returns the value of attribute household_id.
-
#mar_downside_deviation ⇒ Object
Returns the value of attribute mar_downside_deviation.
-
#max_percentile_monte_carlo ⇒ Object
Returns the value of attribute max_percentile_monte_carlo.
-
#mean_percentile_monte_carlo ⇒ Object
Returns the value of attribute mean_percentile_monte_carlo.
-
#min_percentile_monte_carlo ⇒ Object
Returns the value of attribute min_percentile_monte_carlo.
-
#model_id ⇒ Object
Returns the value of attribute model_id.
-
#moving_average_n_day ⇒ Object
Returns the value of attribute moving_average_n_day.
-
#n_day_returns ⇒ Object
Returns the value of attribute n_day_returns.
-
#n_path_monte_carlo ⇒ Object
Returns the value of attribute n_path_monte_carlo.
-
#n_rolling_max_drawdown ⇒ Object
Returns the value of attribute n_rolling_max_drawdown.
-
#n_rolling_volatility ⇒ Object
Returns the value of attribute n_rolling_volatility.
-
#num_sim_monte_carlo ⇒ Object
Returns the value of attribute num_sim_monte_carlo.
-
#period_type ⇒ Object
Returns the value of attribute period_type.
-
#portfolio_id ⇒ Object
Returns the value of attribute portfolio_id.
-
#risk_free_alpha ⇒ Object
Returns the value of attribute risk_free_alpha.
-
#risk_free_sharpe ⇒ Object
Returns the value of attribute risk_free_sharpe.
-
#risk_free_sortino ⇒ Object
Returns the value of attribute risk_free_sortino.
-
#risk_free_treynor ⇒ Object
Returns the value of attribute risk_free_treynor.
-
#security_id ⇒ Object
Returns the value of attribute security_id.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#stat_name ⇒ Object
Returns the value of attribute stat_name.
-
#var_conf_interval ⇒ Object
Returns the value of attribute var_conf_interval.
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 = {}) ⇒ PerformanceCalculatorRequest
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 = {}) ⇒ PerformanceCalculatorRequest
Initializes the object
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 297 298 299 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 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 177 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?(:'annualized_return_period') self.annualized_return_period = attributes[:'annualized_return_period'] else self.annualized_return_period = 'D' end if attributes.has_key?(:'risk_free_alpha') self.risk_free_alpha = attributes[:'risk_free_alpha'] else self.risk_free_alpha = 0.0 end if attributes.has_key?(:'allocation_id') self.allocation_id = attributes[:'allocation_id'] end if attributes.has_key?(:'mean_percentile_monte_carlo') self.mean_percentile_monte_carlo = attributes[:'mean_percentile_monte_carlo'] else self.mean_percentile_monte_carlo = 50.0 end if attributes.has_key?(:'model_id') self.model_id = attributes[:'model_id'] end if attributes.has_key?(:'mar_downside_deviation') self.mar_downside_deviation = attributes[:'mar_downside_deviation'] else self.mar_downside_deviation = 0.0 end if attributes.has_key?(:'risk_free_sharpe') self.risk_free_sharpe = attributes[:'risk_free_sharpe'] else self.risk_free_sharpe = 0.0 end if attributes.has_key?(:'benchmark_id') self.benchmark_id = attributes[:'benchmark_id'] end if attributes.has_key?(:'risk_free_sortino') self.risk_free_sortino = attributes[:'risk_free_sortino'] else self.risk_free_sortino = 0.0 end if attributes.has_key?(:'household_id') self.household_id = attributes[:'household_id'] end if attributes.has_key?(:'min_percentile_monte_carlo') self.min_percentile_monte_carlo = attributes[:'min_percentile_monte_carlo'] else self.min_percentile_monte_carlo = 20.0 end if attributes.has_key?(:'moving_average_n_day') self.moving_average_n_day = attributes[:'moving_average_n_day'] else self.moving_average_n_day = 7 end if attributes.has_key?(:'active_premium_period') self.active_premium_period = attributes[:'active_premium_period'] else self.active_premium_period = 'D' end if attributes.has_key?(:'stat_name') self.stat_name = attributes[:'stat_name'] end if attributes.has_key?(:'end_date') self.end_date = attributes[:'end_date'] end if attributes.has_key?(:'start_date') self.start_date = attributes[:'start_date'] end if attributes.has_key?(:'n_day_returns') self.n_day_returns = attributes[:'n_day_returns'] else self.n_day_returns = 7 end if attributes.has_key?(:'var_conf_interval') self.var_conf_interval = attributes[:'var_conf_interval'] else self.var_conf_interval = 95.0 end if attributes.has_key?(:'period_type') self.period_type = attributes[:'period_type'] else self.period_type = 'D' end if attributes.has_key?(:'risk_free_treynor') self.risk_free_treynor = attributes[:'risk_free_treynor'] else self.risk_free_treynor = 0.0 end if attributes.has_key?(:'n_rolling_max_drawdown') self.n_rolling_max_drawdown = attributes[:'n_rolling_max_drawdown'] else self.n_rolling_max_drawdown = 7 end if attributes.has_key?(:'portfolio_id') self.portfolio_id = attributes[:'portfolio_id'] end if attributes.has_key?(:'num_sim_monte_carlo') self.num_sim_monte_carlo = attributes[:'num_sim_monte_carlo'] else self.num_sim_monte_carlo = 1000 end if attributes.has_key?(:'goal_id') self.goal_id = attributes[:'goal_id'] end if attributes.has_key?(:'account_id') self.account_id = attributes[:'account_id'] end if attributes.has_key?(:'security_id') self.security_id = attributes[:'security_id'] end if attributes.has_key?(:'n_path_monte_carlo') self.n_path_monte_carlo = attributes[:'n_path_monte_carlo'] else self.n_path_monte_carlo = 100 end if attributes.has_key?(:'client_id') self.client_id = attributes[:'client_id'] end if attributes.has_key?(:'n_rolling_volatility') self.n_rolling_volatility = attributes[:'n_rolling_volatility'] else self.n_rolling_volatility = 7 end if attributes.has_key?(:'hist_factor') self.hist_factor = attributes[:'hist_factor'] else self.hist_factor = 5.0 end if attributes.has_key?(:'max_percentile_monte_carlo') self.max_percentile_monte_carlo = attributes[:'max_percentile_monte_carlo'] else self.max_percentile_monte_carlo = 80.0 end end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
65 66 67 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 65 def account_id @account_id end |
#active_premium_period ⇒ Object
Returns the value of attribute active_premium_period.
41 42 43 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 41 def active_premium_period @active_premium_period end |
#allocation_id ⇒ Object
Returns the value of attribute allocation_id.
21 22 23 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 21 def allocation_id @allocation_id end |
#annualized_return_period ⇒ Object
Returns the value of attribute annualized_return_period.
17 18 19 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 17 def annualized_return_period @annualized_return_period end |
#benchmark_id ⇒ Object
Returns the value of attribute benchmark_id.
31 32 33 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 31 def benchmark_id @benchmark_id end |
#client_id ⇒ Object
Returns the value of attribute client_id.
71 72 73 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 71 def client_id @client_id end |
#end_date ⇒ Object
Returns the value of attribute end_date.
45 46 47 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 45 def end_date @end_date end |
#goal_id ⇒ Object
Returns the value of attribute goal_id.
63 64 65 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 63 def goal_id @goal_id end |
#hist_factor ⇒ Object
Returns the value of attribute hist_factor.
75 76 77 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 75 def hist_factor @hist_factor end |
#household_id ⇒ Object
Returns the value of attribute household_id.
35 36 37 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 35 def household_id @household_id end |
#mar_downside_deviation ⇒ Object
Returns the value of attribute mar_downside_deviation.
27 28 29 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 27 def mar_downside_deviation @mar_downside_deviation end |
#max_percentile_monte_carlo ⇒ Object
Returns the value of attribute max_percentile_monte_carlo.
77 78 79 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 77 def max_percentile_monte_carlo @max_percentile_monte_carlo end |
#mean_percentile_monte_carlo ⇒ Object
Returns the value of attribute mean_percentile_monte_carlo.
23 24 25 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 23 def mean_percentile_monte_carlo @mean_percentile_monte_carlo end |
#min_percentile_monte_carlo ⇒ Object
Returns the value of attribute min_percentile_monte_carlo.
37 38 39 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 37 def min_percentile_monte_carlo @min_percentile_monte_carlo end |
#model_id ⇒ Object
Returns the value of attribute model_id.
25 26 27 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 25 def model_id @model_id end |
#moving_average_n_day ⇒ Object
Returns the value of attribute moving_average_n_day.
39 40 41 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 39 def moving_average_n_day @moving_average_n_day end |
#n_day_returns ⇒ Object
Returns the value of attribute n_day_returns.
49 50 51 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 49 def n_day_returns @n_day_returns end |
#n_path_monte_carlo ⇒ Object
Returns the value of attribute n_path_monte_carlo.
69 70 71 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 69 def n_path_monte_carlo @n_path_monte_carlo end |
#n_rolling_max_drawdown ⇒ Object
Returns the value of attribute n_rolling_max_drawdown.
57 58 59 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 57 def n_rolling_max_drawdown @n_rolling_max_drawdown end |
#n_rolling_volatility ⇒ Object
Returns the value of attribute n_rolling_volatility.
73 74 75 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 73 def n_rolling_volatility @n_rolling_volatility end |
#num_sim_monte_carlo ⇒ Object
Returns the value of attribute num_sim_monte_carlo.
61 62 63 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 61 def num_sim_monte_carlo @num_sim_monte_carlo end |
#period_type ⇒ Object
Returns the value of attribute period_type.
53 54 55 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 53 def period_type @period_type end |
#portfolio_id ⇒ Object
Returns the value of attribute portfolio_id.
59 60 61 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 59 def portfolio_id @portfolio_id end |
#risk_free_alpha ⇒ Object
Returns the value of attribute risk_free_alpha.
19 20 21 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 19 def risk_free_alpha @risk_free_alpha end |
#risk_free_sharpe ⇒ Object
Returns the value of attribute risk_free_sharpe.
29 30 31 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 29 def risk_free_sharpe @risk_free_sharpe end |
#risk_free_sortino ⇒ Object
Returns the value of attribute risk_free_sortino.
33 34 35 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 33 def risk_free_sortino @risk_free_sortino end |
#risk_free_treynor ⇒ Object
Returns the value of attribute risk_free_treynor.
55 56 57 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 55 def risk_free_treynor @risk_free_treynor end |
#security_id ⇒ Object
Returns the value of attribute security_id.
67 68 69 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 67 def security_id @security_id end |
#start_date ⇒ Object
Returns the value of attribute start_date.
47 48 49 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 47 def start_date @start_date end |
#stat_name ⇒ Object
Returns the value of attribute stat_name.
43 44 45 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 43 def stat_name @stat_name end |
#var_conf_interval ⇒ Object
Returns the value of attribute var_conf_interval.
51 52 53 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 51 def var_conf_interval @var_conf_interval end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 102 def self.attribute_map { :'annualized_return_period' => :'annualized_return_period', :'risk_free_alpha' => :'risk_free_alpha', :'allocation_id' => :'allocation_id', :'mean_percentile_monte_carlo' => :'mean_percentile_monte_carlo', :'model_id' => :'model_id', :'mar_downside_deviation' => :'mar_downside_deviation', :'risk_free_sharpe' => :'risk_free_sharpe', :'benchmark_id' => :'benchmark_id', :'risk_free_sortino' => :'risk_free_sortino', :'household_id' => :'household_id', :'min_percentile_monte_carlo' => :'min_percentile_monte_carlo', :'moving_average_n_day' => :'moving_average_n_day', :'active_premium_period' => :'active_premium_period', :'stat_name' => :'stat_name', :'end_date' => :'end_date', :'start_date' => :'start_date', :'n_day_returns' => :'n_day_returns', :'var_conf_interval' => :'var_conf_interval', :'period_type' => :'period_type', :'risk_free_treynor' => :'risk_free_treynor', :'n_rolling_max_drawdown' => :'n_rolling_max_drawdown', :'portfolio_id' => :'portfolio_id', :'num_sim_monte_carlo' => :'num_sim_monte_carlo', :'goal_id' => :'goal_id', :'account_id' => :'account_id', :'security_id' => :'security_id', :'n_path_monte_carlo' => :'n_path_monte_carlo', :'client_id' => :'client_id', :'n_rolling_volatility' => :'n_rolling_volatility', :'hist_factor' => :'hist_factor', :'max_percentile_monte_carlo' => :'max_percentile_monte_carlo' } end |
.swagger_types ⇒ Object
Attribute type mapping.
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 139 def self.swagger_types { :'annualized_return_period' => :'String', :'risk_free_alpha' => :'Float', :'allocation_id' => :'String', :'mean_percentile_monte_carlo' => :'Float', :'model_id' => :'String', :'mar_downside_deviation' => :'Float', :'risk_free_sharpe' => :'Float', :'benchmark_id' => :'String', :'risk_free_sortino' => :'Float', :'household_id' => :'String', :'min_percentile_monte_carlo' => :'Float', :'moving_average_n_day' => :'Integer', :'active_premium_period' => :'String', :'stat_name' => :'String', :'end_date' => :'Date', :'start_date' => :'Date', :'n_day_returns' => :'Integer', :'var_conf_interval' => :'Float', :'period_type' => :'String', :'risk_free_treynor' => :'Float', :'n_rolling_max_drawdown' => :'Integer', :'portfolio_id' => :'String', :'num_sim_monte_carlo' => :'Integer', :'goal_id' => :'String', :'account_id' => :'String', :'security_id' => :'String', :'n_path_monte_carlo' => :'Integer', :'client_id' => :'String', :'n_rolling_volatility' => :'Integer', :'hist_factor' => :'Float', :'max_percentile_monte_carlo' => :'Float' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 537 def ==(o) return true if self.equal?(o) self.class == o.class && annualized_return_period == o.annualized_return_period && risk_free_alpha == o.risk_free_alpha && allocation_id == o.allocation_id && mean_percentile_monte_carlo == o.mean_percentile_monte_carlo && model_id == o.model_id && mar_downside_deviation == o.mar_downside_deviation && risk_free_sharpe == o.risk_free_sharpe && benchmark_id == o.benchmark_id && risk_free_sortino == o.risk_free_sortino && household_id == o.household_id && min_percentile_monte_carlo == o.min_percentile_monte_carlo && moving_average_n_day == o.moving_average_n_day && active_premium_period == o.active_premium_period && stat_name == o.stat_name && end_date == o.end_date && start_date == o.start_date && n_day_returns == o.n_day_returns && var_conf_interval == o.var_conf_interval && period_type == o.period_type && risk_free_treynor == o.risk_free_treynor && n_rolling_max_drawdown == o.n_rolling_max_drawdown && portfolio_id == o.portfolio_id && num_sim_monte_carlo == o.num_sim_monte_carlo && goal_id == o.goal_id && account_id == o.account_id && security_id == o.security_id && n_path_monte_carlo == o.n_path_monte_carlo && client_id == o.client_id && n_rolling_volatility == o.n_rolling_volatility && hist_factor == o.hist_factor && max_percentile_monte_carlo == o.max_percentile_monte_carlo end |
#_deserialize(type, value) ⇒ Object
Returns Deserialized data.
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 608 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
672 673 674 675 676 677 678 679 680 681 682 683 684 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 672 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
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 588 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
575 576 577 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 575 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
581 582 583 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 581 def hash [annualized_return_period, risk_free_alpha, allocation_id, mean_percentile_monte_carlo, model_id, mar_downside_deviation, risk_free_sharpe, benchmark_id, risk_free_sortino, household_id, min_percentile_monte_carlo, moving_average_n_day, active_premium_period, stat_name, end_date, start_date, n_day_returns, var_conf_interval, period_type, risk_free_treynor, n_rolling_max_drawdown, portfolio_id, num_sim_monte_carlo, goal_id, account_id, security_id, n_path_monte_carlo, client_id, n_rolling_volatility, hist_factor, max_percentile_monte_carlo].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 348 def list_invalid_properties invalid_properties = Array.new if !@mean_percentile_monte_carlo.nil? && @mean_percentile_monte_carlo < 0 invalid_properties.push('invalid value for "mean_percentile_monte_carlo", must be greater than or equal to 0.') end if !@min_percentile_monte_carlo.nil? && @min_percentile_monte_carlo < 0 invalid_properties.push('invalid value for "min_percentile_monte_carlo", must be greater than or equal to 0.') end if !@moving_average_n_day.nil? && @moving_average_n_day < 1 invalid_properties.push('invalid value for "moving_average_n_day", must be greater than or equal to 1.') end if @stat_name.nil? invalid_properties.push('invalid value for "stat_name", stat_name cannot be nil.') end if !@n_day_returns.nil? && @n_day_returns < 1 invalid_properties.push('invalid value for "n_day_returns", must be greater than or equal to 1.') end if !@n_rolling_max_drawdown.nil? && @n_rolling_max_drawdown < 1 invalid_properties.push('invalid value for "n_rolling_max_drawdown", must be greater than or equal to 1.') end if !@num_sim_monte_carlo.nil? && @num_sim_monte_carlo < 1 invalid_properties.push('invalid value for "num_sim_monte_carlo", must be greater than or equal to 1.') end if !@n_path_monte_carlo.nil? && @n_path_monte_carlo < 1 invalid_properties.push('invalid value for "n_path_monte_carlo", must be greater than or equal to 1.') end if !@n_rolling_volatility.nil? && @n_rolling_volatility < 1 invalid_properties.push('invalid value for "n_rolling_volatility", must be greater than or equal to 1.') end if !@max_percentile_monte_carlo.nil? && @max_percentile_monte_carlo < 0 invalid_properties.push('invalid value for "max_percentile_monte_carlo", 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)
653 654 655 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 653 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
659 660 661 662 663 664 665 666 667 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 659 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.
647 648 649 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 647 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 |
# File 'lib/proton_api/models/performance_calculator_request.rb', line 395 def valid? annualized_return_period_validator = EnumAttributeValidator.new('String', ['Y', 'Q', 'M', 'D']) return false unless annualized_return_period_validator.valid?(@annualized_return_period) return false if !@mean_percentile_monte_carlo.nil? && @mean_percentile_monte_carlo < 0 return false if !@min_percentile_monte_carlo.nil? && @min_percentile_monte_carlo < 0 return false if !@moving_average_n_day.nil? && @moving_average_n_day < 1 active_premium_period_validator = EnumAttributeValidator.new('String', ['Y', 'Q', 'M', 'D']) return false unless active_premium_period_validator.valid?(@active_premium_period) return false if @stat_name.nil? return false if !@n_day_returns.nil? && @n_day_returns < 1 period_type_validator = EnumAttributeValidator.new('String', ['Y', 'Q', 'M', 'D']) return false unless period_type_validator.valid?(@period_type) return false if !@n_rolling_max_drawdown.nil? && @n_rolling_max_drawdown < 1 return false if !@num_sim_monte_carlo.nil? && @num_sim_monte_carlo < 1 return false if !@n_path_monte_carlo.nil? && @n_path_monte_carlo < 1 return false if !@n_rolling_volatility.nil? && @n_rolling_volatility < 1 return false if !@max_percentile_monte_carlo.nil? && @max_percentile_monte_carlo < 0 true end |