Class: NucleusApi::AccountPortfolioRebalanceRequest
- Inherits:
-
Object
- Object
- NucleusApi::AccountPortfolioRebalanceRequest
- Defined in:
- lib/nucleus_api/models/account_portfolio_rebalance_request.rb
Overview
AccountPortfolioRebalanceRequest Object
Instance Attribute Summary collapse
-
#buy_threshold ⇒ Object
buyThreshold.
-
#buy_transaction_code_id ⇒ Object
buyTransactionCodeId.
-
#cash_portfolio_id ⇒ Object
cashPortfolioId.
-
#cash_sec_id ⇒ Object
cashSecId.
-
#client_id ⇒ Object
clientId.
-
#commit_orders ⇒ Object
commitOrders.
-
#non_fractional ⇒ Object
nonFractional.
-
#port_threshold ⇒ Object
portThreshold.
-
#restrictions_on ⇒ Object
restrictionsOn.
-
#sell_threshold ⇒ Object
sellThreshold.
-
#sell_transaction_code_id ⇒ Object
sellTransactionCodeId.
-
#tenant_id ⇒ Object
tenantId.
-
#use_cash_available ⇒ Object
useCashAvailable.
-
#use_strategic ⇒ Object
useStrategic.
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
Outputs non-array value in the form of 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 = {}) ⇒ AccountPortfolioRebalanceRequest
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
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ AccountPortfolioRebalanceRequest
Initializes the object
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 137 138 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 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 102 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?(:'buy_threshold') self.buy_threshold = attributes[:'buy_threshold'] end if attributes.has_key?(:'buy_transaction_code_id') self.buy_transaction_code_id = attributes[:'buy_transaction_code_id'] end if attributes.has_key?(:'cash_portfolio_id') self.cash_portfolio_id = attributes[:'cash_portfolio_id'] end if attributes.has_key?(:'cash_sec_id') self.cash_sec_id = attributes[:'cash_sec_id'] end if attributes.has_key?(:'client_id') self.client_id = attributes[:'client_id'] end if attributes.has_key?(:'commit_orders') self.commit_orders = attributes[:'commit_orders'] end if attributes.has_key?(:'non_fractional') self.non_fractional = attributes[:'non_fractional'] end if attributes.has_key?(:'port_threshold') self.port_threshold = attributes[:'port_threshold'] end if attributes.has_key?(:'restrictions_on') self.restrictions_on = attributes[:'restrictions_on'] end if attributes.has_key?(:'sell_threshold') self.sell_threshold = attributes[:'sell_threshold'] end if attributes.has_key?(:'sell_transaction_code_id') self.sell_transaction_code_id = attributes[:'sell_transaction_code_id'] end if attributes.has_key?(:'tenant_id') self.tenant_id = attributes[:'tenant_id'] end if attributes.has_key?(:'use_cash_available') self.use_cash_available = attributes[:'use_cash_available'] end if attributes.has_key?(:'use_strategic') self.use_strategic = attributes[:'use_strategic'] end end |
Instance Attribute Details
#buy_threshold ⇒ Object
buyThreshold
19 20 21 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 19 def buy_threshold @buy_threshold end |
#buy_transaction_code_id ⇒ Object
buyTransactionCodeId
22 23 24 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 22 def buy_transaction_code_id @buy_transaction_code_id end |
#cash_portfolio_id ⇒ Object
cashPortfolioId
25 26 27 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 25 def cash_portfolio_id @cash_portfolio_id end |
#cash_sec_id ⇒ Object
cashSecId
28 29 30 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 28 def cash_sec_id @cash_sec_id end |
#client_id ⇒ Object
clientId
31 32 33 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 31 def client_id @client_id end |
#commit_orders ⇒ Object
commitOrders
34 35 36 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 34 def commit_orders @commit_orders end |
#non_fractional ⇒ Object
nonFractional
37 38 39 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 37 def non_fractional @non_fractional end |
#port_threshold ⇒ Object
portThreshold
40 41 42 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 40 def port_threshold @port_threshold end |
#restrictions_on ⇒ Object
restrictionsOn
43 44 45 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 43 def restrictions_on @restrictions_on end |
#sell_threshold ⇒ Object
sellThreshold
46 47 48 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 46 def sell_threshold @sell_threshold end |
#sell_transaction_code_id ⇒ Object
sellTransactionCodeId
49 50 51 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 49 def sell_transaction_code_id @sell_transaction_code_id end |
#tenant_id ⇒ Object
tenantId
52 53 54 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 52 def tenant_id @tenant_id end |
#use_cash_available ⇒ Object
useCashAvailable
55 56 57 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 55 def use_cash_available @use_cash_available end |
#use_strategic ⇒ Object
useStrategic
58 59 60 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 58 def use_strategic @use_strategic end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 61 def self.attribute_map { :'buy_threshold' => :'buy_threshold', :'buy_transaction_code_id' => :'buy_transaction_code_id', :'cash_portfolio_id' => :'cash_portfolio_id', :'cash_sec_id' => :'cash_sec_id', :'client_id' => :'client_id', :'commit_orders' => :'commit_orders', :'non_fractional' => :'non_fractional', :'port_threshold' => :'port_threshold', :'restrictions_on' => :'restrictions_on', :'sell_threshold' => :'sell_threshold', :'sell_transaction_code_id' => :'sell_transaction_code_id', :'tenant_id' => :'tenant_id', :'use_cash_available' => :'use_cash_available', :'use_strategic' => :'use_strategic' } end |
.swagger_types ⇒ Object
Attribute type mapping.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 81 def self.swagger_types { :'buy_threshold' => :'Float', :'buy_transaction_code_id' => :'String', :'cash_portfolio_id' => :'String', :'cash_sec_id' => :'String', :'client_id' => :'String', :'commit_orders' => :'BOOLEAN', :'non_fractional' => :'BOOLEAN', :'port_threshold' => :'Float', :'restrictions_on' => :'BOOLEAN', :'sell_threshold' => :'Float', :'sell_transaction_code_id' => :'String', :'tenant_id' => :'String', :'use_cash_available' => :'BOOLEAN', :'use_strategic' => :'BOOLEAN' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 180 def ==(o) return true if self.equal?(o) self.class == o.class && buy_threshold == o.buy_threshold && buy_transaction_code_id == o.buy_transaction_code_id && cash_portfolio_id == o.cash_portfolio_id && cash_sec_id == o.cash_sec_id && client_id == o.client_id && commit_orders == o.commit_orders && non_fractional == o.non_fractional && port_threshold == o.port_threshold && restrictions_on == o.restrictions_on && sell_threshold == o.sell_threshold && sell_transaction_code_id == o.sell_transaction_code_id && tenant_id == o.tenant_id && use_cash_available == o.use_cash_available && use_strategic == o.use_strategic end |
#_deserialize(type, value) ⇒ Object
Returns Deserialized data.
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 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 233 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 = NucleusApi.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 299 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
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 214 def build_from_hash(attributes) 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
201 202 203 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 201 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
207 208 209 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 207 def hash [buy_threshold, buy_transaction_code_id, cash_portfolio_id, cash_sec_id, client_id, commit_orders, non_fractional, port_threshold, restrictions_on, sell_threshold, sell_transaction_code_id, tenant_id, use_cash_available, use_strategic].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
167 168 169 170 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 167 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
280 281 282 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 280 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
286 287 288 289 290 291 292 293 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 286 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
274 275 276 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 274 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
174 175 176 |
# File 'lib/nucleus_api/models/account_portfolio_rebalance_request.rb', line 174 def valid? true end |