Class: FdxV660Api::OpenOrderEntity
- Defined in:
- lib/fdx_v660_api/models/open_order_entity.rb
Overview
An open investment transaction order
Instance Attribute Summary collapse
-
#description ⇒ String
Description of order.
-
#inv401k_source ⇒ Investment401KSourceType1
For 401(k) accounts, source of money for this order.
-
#limit_price ⇒ Float
Limit price.
-
#order_date ⇒ Date
Order date.
-
#order_duration ⇒ OrderDuration2
This order is good for DAY, GOODTILLCANCEL, IMMEDIATE.
-
#order_id ⇒ String
Long-term persistent identity of the order.
-
#order_type ⇒ OrderType2
Type of order.
-
#security_id ⇒ String
Unique identifier of security.
-
#security_id_type ⇒ SecurityIdType1
CINS, CMC, CME, CUSIP, ISIN, ITSA, NASDAQ, SEDOL, SICC, VALOR, WKN.
-
#stop_price ⇒ Float
Stop price.
-
#sub_account ⇒ SubAccountType4
CASH, MARGIN, SHORT, OTHER.
-
#symbol ⇒ String
Market symbol.
-
#unit_price ⇒ Float
Unit price.
-
#unit_type ⇒ UnitType3
Type of unit.
-
#units ⇒ Float
Number of units (shares or bonds etc.).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(order_id: SKIP, security_id: SKIP, security_id_type: SKIP, symbol: SKIP, description: SKIP, units: SKIP, order_type: SKIP, order_date: SKIP, unit_price: SKIP, unit_type: SKIP, order_duration: SKIP, sub_account: SKIP, limit_price: SKIP, stop_price: SKIP, inv401k_source: SKIP, additional_properties: nil) ⇒ OpenOrderEntity
constructor
A new instance of OpenOrderEntity.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(order_id: SKIP, security_id: SKIP, security_id_type: SKIP, symbol: SKIP, description: SKIP, units: SKIP, order_type: SKIP, order_date: SKIP, unit_price: SKIP, unit_type: SKIP, order_duration: SKIP, sub_account: SKIP, limit_price: SKIP, stop_price: SKIP, inv401k_source: SKIP, additional_properties: nil) ⇒ OpenOrderEntity
Returns a new instance of OpenOrderEntity.
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 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 122 def initialize(order_id: SKIP, security_id: SKIP, security_id_type: SKIP, symbol: SKIP, description: SKIP, units: SKIP, order_type: SKIP, order_date: SKIP, unit_price: SKIP, unit_type: SKIP, order_duration: SKIP, sub_account: SKIP, limit_price: SKIP, stop_price: SKIP, inv401k_source: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @order_id = order_id unless order_id == SKIP @security_id = security_id unless security_id == SKIP @security_id_type = security_id_type unless security_id_type == SKIP @symbol = symbol unless symbol == SKIP @description = description unless description == SKIP @units = units unless units == SKIP @order_type = order_type unless order_type == SKIP @order_date = order_date unless order_date == SKIP @unit_price = unit_price unless unit_price == SKIP @unit_type = unit_type unless unit_type == SKIP @order_duration = order_duration unless order_duration == SKIP @sub_account = sub_account unless sub_account == SKIP @limit_price = limit_price unless limit_price == SKIP @stop_price = stop_price unless stop_price == SKIP @inv401k_source = inv401k_source unless inv401k_source == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#description ⇒ String
Description of order
30 31 32 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 30 def description @description end |
#inv401k_source ⇒ Investment401KSourceType1
For 401(k) accounts, source of money for this order. PRETAX, AFTERTAX, MATCH, PROFITSHARING, ROLLOVER, OTHERVEST, OTHERNONVEST. Default if not present is OTHERNONVEST
73 74 75 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 73 def inv401k_source @inv401k_source end |
#limit_price ⇒ Float
Limit price
63 64 65 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 63 def limit_price @limit_price end |
#order_date ⇒ Date
Order date
43 44 45 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 43 def order_date @order_date end |
#order_duration ⇒ OrderDuration2
This order is good for DAY, GOODTILLCANCEL, IMMEDIATE
55 56 57 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 55 def order_duration @order_duration end |
#order_id ⇒ String
Long-term persistent identity of the order. Id for this order transaction
14 15 16 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 14 def order_id @order_id end |
#order_type ⇒ OrderType2
Type of order. One of BUY, SELL, BUYTOCOVER, BUYTOOPEN, SELLTOCOVER, SELLTOOPEN, SELLSHORT, SELLCLOSE
39 40 41 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 39 def order_type @order_type end |
#security_id ⇒ String
Unique identifier of security
18 19 20 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 18 def security_id @security_id end |
#security_id_type ⇒ SecurityIdType1
CINS, CMC, CME, CUSIP, ISIN, ITSA, NASDAQ, SEDOL, SICC, VALOR, WKN
22 23 24 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 22 def security_id_type @security_id_type end |
#stop_price ⇒ Float
Stop price
67 68 69 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 67 def stop_price @stop_price end |
#sub_account ⇒ SubAccountType4
CASH, MARGIN, SHORT, OTHER
59 60 61 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 59 def sub_account @sub_account end |
#symbol ⇒ String
Market symbol
26 27 28 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 26 def symbol @symbol end |
#unit_price ⇒ Float
Unit price
47 48 49 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 47 def unit_price @unit_price end |
#unit_type ⇒ UnitType3
Type of unit. One of SHARES, CURRENCY
51 52 53 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 51 def unit_type @unit_type end |
#units ⇒ Float
Number of units (shares or bonds etc.)
34 35 36 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 34 def units @units end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
150 151 152 153 154 155 156 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 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 150 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. order_id = hash.key?('orderId') ? hash['orderId'] : SKIP security_id = hash.key?('securityId') ? hash['securityId'] : SKIP security_id_type = hash.key?('securityIdType') ? hash['securityIdType'] : SKIP symbol = hash.key?('symbol') ? hash['symbol'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP units = hash.key?('units') ? hash['units'] : SKIP order_type = hash.key?('orderType') ? hash['orderType'] : SKIP order_date = hash.key?('orderDate') ? hash['orderDate'] : SKIP unit_price = hash.key?('unitPrice') ? hash['unitPrice'] : SKIP unit_type = hash.key?('unitType') ? hash['unitType'] : SKIP order_duration = hash.key?('orderDuration') ? hash['orderDuration'] : SKIP sub_account = hash.key?('subAccount') ? hash['subAccount'] : SKIP limit_price = hash.key?('limitPrice') ? hash['limitPrice'] : SKIP stop_price = hash.key?('stopPrice') ? hash['stopPrice'] : SKIP inv401k_source = hash.key?('inv401kSource') ? hash['inv401kSource'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. OpenOrderEntity.new(order_id: order_id, security_id: security_id, security_id_type: security_id_type, symbol: symbol, description: description, units: units, order_type: order_type, order_date: order_date, unit_price: unit_price, unit_type: unit_type, order_duration: order_duration, sub_account: sub_account, limit_price: limit_price, stop_price: stop_price, inv401k_source: inv401k_source, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 76 def self.names @_hash = {} if @_hash.nil? @_hash['order_id'] = 'orderId' @_hash['security_id'] = 'securityId' @_hash['security_id_type'] = 'securityIdType' @_hash['symbol'] = 'symbol' @_hash['description'] = 'description' @_hash['units'] = 'units' @_hash['order_type'] = 'orderType' @_hash['order_date'] = 'orderDate' @_hash['unit_price'] = 'unitPrice' @_hash['unit_type'] = 'unitType' @_hash['order_duration'] = 'orderDuration' @_hash['sub_account'] = 'subAccount' @_hash['limit_price'] = 'limitPrice' @_hash['stop_price'] = 'stopPrice' @_hash['inv401k_source'] = 'inv401kSource' @_hash end |
.nullables ⇒ Object
An array for nullable fields
118 119 120 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 118 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 97 def self.optionals %w[ order_id security_id security_id_type symbol description units order_type order_date unit_price unit_type order_duration sub_account limit_price stop_price inv401k_source ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
199 200 201 202 203 204 205 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 199 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 219 def inspect class_name = self.class.name.split('::').last "<#{class_name} order_id: #{@order_id.inspect}, security_id: #{@security_id.inspect},"\ " security_id_type: #{@security_id_type.inspect}, symbol: #{@symbol.inspect}, description:"\ " #{@description.inspect}, units: #{@units.inspect}, order_type: #{@order_type.inspect},"\ " order_date: #{@order_date.inspect}, unit_price: #{@unit_price.inspect}, unit_type:"\ " #{@unit_type.inspect}, order_duration: #{@order_duration.inspect}, sub_account:"\ " #{@sub_account.inspect}, limit_price: #{@limit_price.inspect}, stop_price:"\ " #{@stop_price.inspect}, inv401k_source: #{@inv401k_source.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
208 209 210 211 212 213 214 215 216 |
# File 'lib/fdx_v660_api/models/open_order_entity.rb', line 208 def to_s class_name = self.class.name.split('::').last "<#{class_name} order_id: #{@order_id}, security_id: #{@security_id}, security_id_type:"\ " #{@security_id_type}, symbol: #{@symbol}, description: #{@description}, units: #{@units},"\ " order_type: #{@order_type}, order_date: #{@order_date}, unit_price: #{@unit_price},"\ " unit_type: #{@unit_type}, order_duration: #{@order_duration}, sub_account:"\ " #{@sub_account}, limit_price: #{@limit_price}, stop_price: #{@stop_price}, inv401k_source:"\ " #{@inv401k_source}, additional_properties: #{@additional_properties}>" end |