Class: FdxV660Api::InvestmentTransactionEntity
- Inherits:
-
Transaction
- Object
- CoreLibrary::BaseModel
- BaseModel
- Transaction
- FdxV660Api::InvestmentTransactionEntity
- Defined in:
- lib/fdx_v660_api/models/investment_transaction_entity.rb
Overview
Specific transaction information
Instance Attribute Summary collapse
-
#accrued_interest ⇒ Float
Accrued interest.
-
#commission ⇒ Float
Transaction commission.
-
#confirmation_number ⇒ String
Confirmation number of the transaction.
-
#digital_units ⇒ String
Full precision unit number, unlimited digits after decimal point.
-
#face_value ⇒ Float
Cash value for bonds.
-
#fees ⇒ Float
Fees applied to the trade.
-
#fractional_cash ⇒ Float
Cash for fractional units (used for stock splits).
-
#gain ⇒ Float
For sales.
-
#income_type ⇒ IncomeType2
Type of investment income.
-
#inv401k_source ⇒ Investment401KSourceType2
Source of money.
-
#load ⇒ Float
Load on the transaction.
-
#loan_id ⇒ String
For 401k accounts only.
-
#loan_interest ⇒ Float
How much loan pre-payment is interest.
-
#loan_principal ⇒ Float
How much loan pre-payment is principal.
-
#markup ⇒ Float
Portion of unit price that is attributed to the dealer markup.
-
#new_units ⇒ Float
Number of shares after split.
-
#old_units ⇒ Float
Number of shares before split.
-
#payroll_date ⇒ Date
The date for the 401k transaction was obtained in payroll.
-
#penalty ⇒ Float
Indicates amount withheld due to a penalty.
-
#position_type ⇒ PositionType1
LONG, SHORT.
-
#price ⇒ Float
Unit purchase price.
-
#prior_year_contrib ⇒ TrueClass | FalseClass
Indicates this buy was made using prior year's contribution.
-
#running_balance ⇒ Float
Running balance of the position.
-
#security_id ⇒ String
Unique identifier of security.
-
#security_id_type ⇒ SecurityIdType1
CINS, CMC, CME, CUSIP, ISIN, ITSA, NASDAQ, SEDOL, SICC, VALOR, WKN.
-
#security_type ⇒ InvestmentAssetType1
The type of an investment account asset in this transaction.
-
#settlement_timestamp ⇒ DateTime
When the trade settled.
-
#shares ⇒ Float
Required for stock, mutual funds.
-
#split_ratio_denominator ⇒ Float
Split ratio denominator.
-
#split_ratio_numerator ⇒ Float
Split ratio numerator.
-
#state_withholding ⇒ Float
State tax withholding.
-
#sub_account_fund ⇒ SubAccountType2
From which account money came in.
-
#sub_account_sec ⇒ SubAccountType1
Sub-account security Type.
-
#symbol ⇒ String
Ticker symbol.
-
#tax_exempt ⇒ TrueClass | FalseClass
Tax-exempt transaction.
-
#taxes ⇒ Float
Taxes on the trade.
-
#transaction_reason ⇒ TransactionReason2
Reason for this transaction; CALL (the debt was called), SELL (the debt was sold), MATURITY (the debt reached maturity).
-
#transaction_type ⇒ InvestmentTransactionType2
The type of the transaction on the investment account.
-
#transfer_action ⇒ InvestmentTransferActionDirection2
Transfer direction.
-
#unit_price ⇒ Float
Price per commonly-quoted unit.
-
#unit_type ⇒ UnitType1
SHARES, CURRENCY.
-
#units ⇒ Float
For security-based actions other than stock splits, quantity.
-
#withholding ⇒ Float
Federal tax withholding.
Attributes inherited from Transaction
#account_category, #account_id, #amount, #card_number_display, #category, #category_code, #category_type, #debit_credit_memo, #description, #fi_attributes, #foreign_amount, #foreign_currency, #image_ids, #line_item, #links, #memo, #posted_timestamp, #reference, #reference_transaction_id, #remittance, #reward, #rewards, #status, #sub_category, #transaction_id, #transaction_payee, #transaction_timestamp
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(transaction_type: SKIP, shares: SKIP, face_value: SKIP, price: SKIP, security_id: SKIP, security_id_type: SKIP, security_type: SKIP, symbol: SKIP, markup: SKIP, commission: SKIP, taxes: SKIP, fees: SKIP, load: SKIP, inv401k_source: SKIP, confirmation_number: SKIP, fractional_cash: SKIP, income_type: SKIP, old_units: SKIP, split_ratio_numerator: SKIP, split_ratio_denominator: SKIP, new_units: SKIP, sub_account_sec: SKIP, sub_account_fund: SKIP, loan_id: SKIP, loan_principal: SKIP, loan_interest: SKIP, payroll_date: SKIP, prior_year_contrib: SKIP, withholding: SKIP, tax_exempt: SKIP, gain: SKIP, state_withholding: SKIP, penalty: SKIP, running_balance: SKIP, unit_price: SKIP, units: SKIP, unit_type: SKIP, transaction_reason: SKIP, accrued_interest: SKIP, transfer_action: SKIP, position_type: SKIP, digital_units: SKIP, settlement_timestamp: SKIP, account_id: SKIP, transaction_id: SKIP, posted_timestamp: SKIP, transaction_timestamp: SKIP, description: SKIP, transaction_payee: SKIP, debit_credit_memo: SKIP, status: SKIP, amount: SKIP, reward: SKIP, rewards: SKIP, fi_attributes: SKIP, links: SKIP, account_category: 'Investment Transaction entity', reference_transaction_id: SKIP, card_number_display: SKIP, memo: SKIP, category: SKIP, sub_category: SKIP, category_code: SKIP, category_type: SKIP, reference: SKIP, remittance: SKIP, foreign_amount: SKIP, foreign_currency: SKIP, image_ids: SKIP, line_item: SKIP, additional_properties: nil) ⇒ InvestmentTransactionEntity
constructor
A new instance of InvestmentTransactionEntity.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_settlement_timestamp ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from Transaction
discriminators, #to_custom_posted_timestamp, #to_custom_transaction_timestamp
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(transaction_type: SKIP, shares: SKIP, face_value: SKIP, price: SKIP, security_id: SKIP, security_id_type: SKIP, security_type: SKIP, symbol: SKIP, markup: SKIP, commission: SKIP, taxes: SKIP, fees: SKIP, load: SKIP, inv401k_source: SKIP, confirmation_number: SKIP, fractional_cash: SKIP, income_type: SKIP, old_units: SKIP, split_ratio_numerator: SKIP, split_ratio_denominator: SKIP, new_units: SKIP, sub_account_sec: SKIP, sub_account_fund: SKIP, loan_id: SKIP, loan_principal: SKIP, loan_interest: SKIP, payroll_date: SKIP, prior_year_contrib: SKIP, withholding: SKIP, tax_exempt: SKIP, gain: SKIP, state_withholding: SKIP, penalty: SKIP, running_balance: SKIP, unit_price: SKIP, units: SKIP, unit_type: SKIP, transaction_reason: SKIP, accrued_interest: SKIP, transfer_action: SKIP, position_type: SKIP, digital_units: SKIP, settlement_timestamp: SKIP, account_id: SKIP, transaction_id: SKIP, posted_timestamp: SKIP, transaction_timestamp: SKIP, description: SKIP, transaction_payee: SKIP, debit_credit_memo: SKIP, status: SKIP, amount: SKIP, reward: SKIP, rewards: SKIP, fi_attributes: SKIP, links: SKIP, account_category: 'Investment Transaction entity', reference_transaction_id: SKIP, card_number_display: SKIP, memo: SKIP, category: SKIP, sub_category: SKIP, category_code: SKIP, category_type: SKIP, reference: SKIP, remittance: SKIP, foreign_amount: SKIP, foreign_currency: SKIP, image_ids: SKIP, line_item: SKIP, additional_properties: nil) ⇒ InvestmentTransactionEntity
Returns a new instance of InvestmentTransactionEntity.
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 372 373 374 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 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 300 def initialize(transaction_type: SKIP, shares: SKIP, face_value: SKIP, price: SKIP, security_id: SKIP, security_id_type: SKIP, security_type: SKIP, symbol: SKIP, markup: SKIP, commission: SKIP, taxes: SKIP, fees: SKIP, load: SKIP, inv401k_source: SKIP, confirmation_number: SKIP, fractional_cash: SKIP, income_type: SKIP, old_units: SKIP, split_ratio_numerator: SKIP, split_ratio_denominator: SKIP, new_units: SKIP, sub_account_sec: SKIP, sub_account_fund: SKIP, loan_id: SKIP, loan_principal: SKIP, loan_interest: SKIP, payroll_date: SKIP, prior_year_contrib: SKIP, withholding: SKIP, tax_exempt: SKIP, gain: SKIP, state_withholding: SKIP, penalty: SKIP, running_balance: SKIP, unit_price: SKIP, units: SKIP, unit_type: SKIP, transaction_reason: SKIP, accrued_interest: SKIP, transfer_action: SKIP, position_type: SKIP, digital_units: SKIP, settlement_timestamp: SKIP, account_id: SKIP, transaction_id: SKIP, posted_timestamp: SKIP, transaction_timestamp: SKIP, description: SKIP, transaction_payee: SKIP, debit_credit_memo: SKIP, status: SKIP, amount: SKIP, reward: SKIP, rewards: SKIP, fi_attributes: SKIP, links: SKIP, account_category: 'Investment Transaction entity', reference_transaction_id: SKIP, card_number_display: SKIP, memo: SKIP, category: SKIP, sub_category: SKIP, category_code: SKIP, category_type: SKIP, reference: SKIP, remittance: SKIP, foreign_amount: SKIP, foreign_currency: SKIP, image_ids: SKIP, line_item: SKIP, additional_properties: nil) @transaction_type = transaction_type unless transaction_type == SKIP @shares = shares unless shares == SKIP @face_value = face_value unless face_value == SKIP @price = price unless price == SKIP @security_id = security_id unless security_id == SKIP @security_id_type = security_id_type unless security_id_type == SKIP @security_type = security_type unless security_type == SKIP @symbol = symbol unless symbol == SKIP @markup = markup unless markup == SKIP @commission = commission unless commission == SKIP @taxes = taxes unless taxes == SKIP @fees = fees unless fees == SKIP @load = load unless load == SKIP @inv401k_source = inv401k_source unless inv401k_source == SKIP @confirmation_number = confirmation_number unless confirmation_number == SKIP @fractional_cash = fractional_cash unless fractional_cash == SKIP @income_type = income_type unless income_type == SKIP @old_units = old_units unless old_units == SKIP @split_ratio_numerator = split_ratio_numerator unless split_ratio_numerator == SKIP @split_ratio_denominator = split_ratio_denominator unless split_ratio_denominator == SKIP @new_units = new_units unless new_units == SKIP @sub_account_sec = sub_account_sec unless sub_account_sec == SKIP @sub_account_fund = sub_account_fund unless sub_account_fund == SKIP @loan_id = loan_id unless loan_id == SKIP @loan_principal = loan_principal unless loan_principal == SKIP @loan_interest = loan_interest unless loan_interest == SKIP @payroll_date = payroll_date unless payroll_date == SKIP @prior_year_contrib = prior_year_contrib unless prior_year_contrib == SKIP @withholding = withholding unless withholding == SKIP @tax_exempt = tax_exempt unless tax_exempt == SKIP @gain = gain unless gain == SKIP @state_withholding = state_withholding unless state_withholding == SKIP @penalty = penalty unless penalty == SKIP @running_balance = running_balance unless running_balance == SKIP @unit_price = unit_price unless unit_price == SKIP @units = units unless units == SKIP @unit_type = unit_type unless unit_type == SKIP @transaction_reason = transaction_reason unless transaction_reason == SKIP @accrued_interest = accrued_interest unless accrued_interest == SKIP @transfer_action = transfer_action unless transfer_action == SKIP @position_type = position_type unless position_type == SKIP @digital_units = digital_units unless digital_units == SKIP @settlement_timestamp = unless == SKIP @additional_properties = additional_properties # Call the constructor of the base class super(account_id: account_id, transaction_id: transaction_id, posted_timestamp: , transaction_timestamp: , description: description, transaction_payee: transaction_payee, debit_credit_memo: debit_credit_memo, status: status, amount: amount, reward: reward, rewards: rewards, fi_attributes: fi_attributes, links: links, account_category: account_category, reference_transaction_id: reference_transaction_id, card_number_display: card_number_display, memo: memo, category: category, sub_category: sub_category, category_code: category_code, category_type: category_type, reference: reference, remittance: remittance, foreign_amount: foreign_amount, foreign_currency: foreign_currency, image_ids: image_ids, line_item: line_item, additional_properties: additional_properties) end |
Instance Attribute Details
#accrued_interest ⇒ Float
Accrued interest
176 177 178 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 176 def accrued_interest @accrued_interest end |
#commission ⇒ Float
Transaction commission
52 53 54 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 52 def commission @commission end |
#confirmation_number ⇒ String
Confirmation number of the transaction
73 74 75 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 73 def confirmation_number @confirmation_number end |
#digital_units ⇒ String
Full precision unit number, unlimited digits after decimal point
188 189 190 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 188 def digital_units @digital_units end |
#face_value ⇒ Float
Cash value for bonds
23 24 25 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 23 def face_value @face_value end |
#fees ⇒ Float
Fees applied to the trade
60 61 62 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 60 def fees @fees end |
#fractional_cash ⇒ Float
Cash for fractional units (used for stock splits)
77 78 79 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 77 def fractional_cash @fractional_cash end |
#gain ⇒ Float
For sales
139 140 141 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 139 def gain @gain end |
#income_type ⇒ IncomeType2
Type of investment income. One of CGLONG (capital gains-long term), CGSHORT (capital gains-short term), MISC
82 83 84 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 82 def income_type @income_type end |
#inv401k_source ⇒ Investment401KSourceType2
Source of money. One of PRETAX, AFTERTAX, MATCH, PROFITSHARING, ROLLOVER, OTHERVEST, OTHERNONVEST
69 70 71 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 69 def inv401k_source @inv401k_source end |
#load ⇒ Float
Load on the transaction
64 65 66 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 64 def load @load end |
#loan_id ⇒ String
For 401k accounts only. This indicates the transaction was due to a loan or a loan repayment
111 112 113 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 111 def loan_id @loan_id end |
#loan_interest ⇒ Float
How much loan pre-payment is interest
119 120 121 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 119 def loan_interest @loan_interest end |
#loan_principal ⇒ Float
How much loan pre-payment is principal
115 116 117 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 115 def loan_principal @loan_principal end |
#markup ⇒ Float
Portion of unit price that is attributed to the dealer markup
48 49 50 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 48 def markup @markup end |
#new_units ⇒ Float
Number of shares after split
98 99 100 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 98 def new_units @new_units end |
#old_units ⇒ Float
Number of shares before split
86 87 88 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 86 def old_units @old_units end |
#payroll_date ⇒ Date
The date for the 401k transaction was obtained in payroll
123 124 125 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 123 def payroll_date @payroll_date end |
#penalty ⇒ Float
Indicates amount withheld due to a penalty
147 148 149 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 147 def penalty @penalty end |
#position_type ⇒ PositionType1
LONG, SHORT
184 185 186 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 184 def position_type @position_type end |
#price ⇒ Float
Unit purchase price
27 28 29 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 27 def price @price end |
#prior_year_contrib ⇒ TrueClass | FalseClass
Indicates this buy was made using prior year's contribution
127 128 129 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 127 def prior_year_contrib @prior_year_contrib end |
#running_balance ⇒ Float
Running balance of the position
151 152 153 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 151 def running_balance @running_balance end |
#security_id ⇒ String
Unique identifier of security
31 32 33 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 31 def security_id @security_id end |
#security_id_type ⇒ SecurityIdType1
CINS, CMC, CME, CUSIP, ISIN, ITSA, NASDAQ, SEDOL, SICC, VALOR, WKN
35 36 37 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 35 def security_id_type @security_id_type end |
#security_type ⇒ InvestmentAssetType1
The type of an investment account asset in this transaction. ANNUITY, BOND, CD, DEBT, DIGITALASSET, MUTUALFUND, OPTION, OTHER, STOCK, SWEEP
40 41 42 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 40 def security_type @security_type end |
#settlement_timestamp ⇒ DateTime
When the trade settled
192 193 194 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 192 def @settlement_timestamp end |
#shares ⇒ Float
Required for stock, mutual funds. Number of shares (with decimals). Negative numbers indicate securities are being removed from the account
19 20 21 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 19 def shares @shares end |
#split_ratio_denominator ⇒ Float
Split ratio denominator
94 95 96 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 94 def split_ratio_denominator @split_ratio_denominator end |
#split_ratio_numerator ⇒ Float
Split ratio numerator
90 91 92 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 90 def split_ratio_numerator @split_ratio_numerator end |
#state_withholding ⇒ Float
State tax withholding
143 144 145 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 143 def state_withholding @state_withholding end |
#sub_account_fund ⇒ SubAccountType2
From which account money came in. One of CASH, MARGIN, SHORT, OTHER
106 107 108 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 106 def sub_account_fund @sub_account_fund end |
#sub_account_sec ⇒ SubAccountType1
Sub-account security Type. One of CASH, MARGIN, SHORT, OTHER
102 103 104 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 102 def sub_account_sec @sub_account_sec end |
#symbol ⇒ String
Ticker symbol
44 45 46 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 44 def symbol @symbol end |
#tax_exempt ⇒ TrueClass | FalseClass
Tax-exempt transaction
135 136 137 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 135 def tax_exempt @tax_exempt end |
#taxes ⇒ Float
Taxes on the trade
56 57 58 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 56 def taxes @taxes end |
#transaction_reason ⇒ TransactionReason2
Reason for this transaction; CALL (the debt was called), SELL (the debt was sold), MATURITY (the debt reached maturity)
172 173 174 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 172 def transaction_reason @transaction_reason end |
#transaction_type ⇒ InvestmentTransactionType2
The type of the transaction on the investment account
14 15 16 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 14 def transaction_type @transaction_type end |
#transfer_action ⇒ InvestmentTransferActionDirection2
Transfer direction
180 181 182 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 180 def transfer_action @transfer_action end |
#unit_price ⇒ Float
Price per commonly-quoted unit. Share price for stocks, mutual funds, and others. Percentage of par for bonds. Per share (not contract) for options. Does not include markup or markdown
157 158 159 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 157 def unit_price @unit_price end |
#unit_type ⇒ UnitType1
SHARES, CURRENCY
167 168 169 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 167 def unit_type @unit_type end |
#units ⇒ Float
For security-based actions other than stock splits, quantity. Shares for stocks, mutual funds, and others. Face value for bonds. Contracts for options
163 164 165 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 163 def units @units end |
#withholding ⇒ Float
Federal tax withholding
131 132 133 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 131 def withholding @withholding end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 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 572 573 574 575 576 577 578 579 580 581 582 583 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 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 406 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. transaction_type = hash.key?('transactionType') ? hash['transactionType'] : SKIP shares = hash.key?('shares') ? hash['shares'] : SKIP face_value = hash.key?('faceValue') ? hash['faceValue'] : SKIP price = hash.key?('price') ? hash['price'] : SKIP security_id = hash.key?('securityId') ? hash['securityId'] : SKIP security_id_type = hash.key?('securityIdType') ? hash['securityIdType'] : SKIP security_type = hash.key?('securityType') ? hash['securityType'] : SKIP symbol = hash.key?('symbol') ? hash['symbol'] : SKIP markup = hash.key?('markup') ? hash['markup'] : SKIP commission = hash.key?('commission') ? hash['commission'] : SKIP taxes = hash.key?('taxes') ? hash['taxes'] : SKIP fees = hash.key?('fees') ? hash['fees'] : SKIP load = hash.key?('load') ? hash['load'] : SKIP inv401k_source = hash.key?('inv401kSource') ? hash['inv401kSource'] : SKIP confirmation_number = hash.key?('confirmationNumber') ? hash['confirmationNumber'] : SKIP fractional_cash = hash.key?('fractionalCash') ? hash['fractionalCash'] : SKIP income_type = hash.key?('incomeType') ? hash['incomeType'] : SKIP old_units = hash.key?('oldUnits') ? hash['oldUnits'] : SKIP split_ratio_numerator = hash.key?('splitRatioNumerator') ? hash['splitRatioNumerator'] : SKIP split_ratio_denominator = hash.key?('splitRatioDenominator') ? hash['splitRatioDenominator'] : SKIP new_units = hash.key?('newUnits') ? hash['newUnits'] : SKIP sub_account_sec = hash.key?('subAccountSec') ? hash['subAccountSec'] : SKIP sub_account_fund = hash.key?('subAccountFund') ? hash['subAccountFund'] : SKIP loan_id = hash.key?('loanId') ? hash['loanId'] : SKIP loan_principal = hash.key?('loanPrincipal') ? hash['loanPrincipal'] : SKIP loan_interest = hash.key?('loanInterest') ? hash['loanInterest'] : SKIP payroll_date = hash.key?('payrollDate') ? hash['payrollDate'] : SKIP prior_year_contrib = hash.key?('priorYearContrib') ? hash['priorYearContrib'] : SKIP withholding = hash.key?('withholding') ? hash['withholding'] : SKIP tax_exempt = hash.key?('taxExempt') ? hash['taxExempt'] : SKIP gain = hash.key?('gain') ? hash['gain'] : SKIP state_withholding = hash.key?('stateWithholding') ? hash['stateWithholding'] : SKIP penalty = hash.key?('penalty') ? hash['penalty'] : SKIP running_balance = hash.key?('runningBalance') ? hash['runningBalance'] : SKIP unit_price = hash.key?('unitPrice') ? hash['unitPrice'] : SKIP units = hash.key?('units') ? hash['units'] : SKIP unit_type = hash.key?('unitType') ? hash['unitType'] : SKIP transaction_reason = hash.key?('transactionReason') ? hash['transactionReason'] : SKIP accrued_interest = hash.key?('accruedInterest') ? hash['accruedInterest'] : SKIP transfer_action = hash.key?('transferAction') ? hash['transferAction'] : SKIP position_type = hash.key?('positionType') ? hash['positionType'] : SKIP digital_units = hash.key?('digitalUnits') ? hash['digitalUnits'] : SKIP = if hash.key?('settlementTimestamp') (DateTimeHelper.from_rfc3339(hash['settlementTimestamp']) if hash['settlementTimestamp']) else SKIP end account_id = hash.key?('accountId') ? hash['accountId'] : SKIP transaction_id = hash.key?('transactionId') ? hash['transactionId'] : SKIP = if hash.key?('postedTimestamp') (DateTimeHelper.from_rfc3339(hash['postedTimestamp']) if hash['postedTimestamp']) else SKIP end = if hash.key?('transactionTimestamp') (DateTimeHelper.from_rfc3339(hash['transactionTimestamp']) if hash['transactionTimestamp']) else SKIP end description = hash.key?('description') ? hash['description'] : SKIP transaction_payee = TransactionPayeeEntity3.from_hash(hash['transactionPayee']) if hash['transactionPayee'] debit_credit_memo = hash.key?('debitCreditMemo') ? hash['debitCreditMemo'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP amount = hash.key?('amount') ? hash['amount'] : SKIP reward = TransactionRewardEntity.from_hash(hash['reward']) if hash['reward'] # Parameter is an array, so we need to iterate through it rewards = nil unless hash['rewards'].nil? rewards = [] hash['rewards'].each do |structure| rewards << (TransactionRewardEntity.from_hash(structure) if structure) end end rewards = SKIP unless hash.key?('rewards') # Parameter is an array, so we need to iterate through it fi_attributes = nil unless hash['fiAttributes'].nil? fi_attributes = [] hash['fiAttributes'].each do |structure| fi_attributes << (FiAttributeEntity.from_hash(structure) if structure) end end fi_attributes = SKIP unless hash.key?('fiAttributes') # Parameter is an array, so we need to iterate through it links = nil unless hash['links'].nil? links = [] hash['links'].each do |structure| links << (HateoasLink.from_hash(structure) if structure) end end links = SKIP unless hash.key?('links') account_category = hash['accountCategory'] ||= 'Investment Transaction entity' reference_transaction_id = hash.key?('referenceTransactionId') ? hash['referenceTransactionId'] : SKIP card_number_display = hash.key?('cardNumberDisplay') ? hash['cardNumberDisplay'] : SKIP memo = hash.key?('memo') ? hash['memo'] : SKIP category = hash.key?('category') ? hash['category'] : SKIP sub_category = hash.key?('subCategory') ? hash['subCategory'] : SKIP category_code = hash.key?('categoryCode') ? hash['categoryCode'] : SKIP category_type = hash.key?('categoryType') ? hash['categoryType'] : SKIP reference = hash.key?('reference') ? hash['reference'] : SKIP remittance = Remittance2.from_hash(hash['remittance']) if hash['remittance'] foreign_amount = hash.key?('foreignAmount') ? hash['foreignAmount'] : SKIP foreign_currency = hash.key?('foreignCurrency') ? hash['foreignCurrency'] : SKIP image_ids = hash.key?('imageIds') ? hash['imageIds'] : SKIP # Parameter is an array, so we need to iterate through it line_item = nil unless hash['lineItem'].nil? line_item = [] hash['lineItem'].each do |structure| line_item << (LineItemEntity.from_hash(structure) if structure) end end line_item = SKIP unless hash.key?('lineItem') # 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. InvestmentTransactionEntity.new(transaction_type: transaction_type, shares: shares, face_value: face_value, price: price, security_id: security_id, security_id_type: security_id_type, security_type: security_type, symbol: symbol, markup: markup, commission: commission, taxes: taxes, fees: fees, load: load, inv401k_source: inv401k_source, confirmation_number: confirmation_number, fractional_cash: fractional_cash, income_type: income_type, old_units: old_units, split_ratio_numerator: split_ratio_numerator, split_ratio_denominator: split_ratio_denominator, new_units: new_units, sub_account_sec: sub_account_sec, sub_account_fund: sub_account_fund, loan_id: loan_id, loan_principal: loan_principal, loan_interest: loan_interest, payroll_date: payroll_date, prior_year_contrib: prior_year_contrib, withholding: withholding, tax_exempt: tax_exempt, gain: gain, state_withholding: state_withholding, penalty: penalty, running_balance: running_balance, unit_price: unit_price, units: units, unit_type: unit_type, transaction_reason: transaction_reason, accrued_interest: accrued_interest, transfer_action: transfer_action, position_type: position_type, digital_units: digital_units, settlement_timestamp: , account_id: account_id, transaction_id: transaction_id, posted_timestamp: , transaction_timestamp: , description: description, transaction_payee: transaction_payee, debit_credit_memo: debit_credit_memo, status: status, amount: amount, reward: reward, rewards: rewards, fi_attributes: fi_attributes, links: links, account_category: account_category, reference_transaction_id: reference_transaction_id, card_number_display: card_number_display, memo: memo, category: category, sub_category: sub_category, category_code: category_code, category_type: category_type, reference: reference, remittance: remittance, foreign_amount: foreign_amount, foreign_currency: foreign_currency, image_ids: image_ids, line_item: line_item, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
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 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 195 def self.names @_hash = {} if @_hash.nil? @_hash['transaction_type'] = 'transactionType' @_hash['shares'] = 'shares' @_hash['face_value'] = 'faceValue' @_hash['price'] = 'price' @_hash['security_id'] = 'securityId' @_hash['security_id_type'] = 'securityIdType' @_hash['security_type'] = 'securityType' @_hash['symbol'] = 'symbol' @_hash['markup'] = 'markup' @_hash['commission'] = 'commission' @_hash['taxes'] = 'taxes' @_hash['fees'] = 'fees' @_hash['load'] = 'load' @_hash['inv401k_source'] = 'inv401kSource' @_hash['confirmation_number'] = 'confirmationNumber' @_hash['fractional_cash'] = 'fractionalCash' @_hash['income_type'] = 'incomeType' @_hash['old_units'] = 'oldUnits' @_hash['split_ratio_numerator'] = 'splitRatioNumerator' @_hash['split_ratio_denominator'] = 'splitRatioDenominator' @_hash['new_units'] = 'newUnits' @_hash['sub_account_sec'] = 'subAccountSec' @_hash['sub_account_fund'] = 'subAccountFund' @_hash['loan_id'] = 'loanId' @_hash['loan_principal'] = 'loanPrincipal' @_hash['loan_interest'] = 'loanInterest' @_hash['payroll_date'] = 'payrollDate' @_hash['prior_year_contrib'] = 'priorYearContrib' @_hash['withholding'] = 'withholding' @_hash['tax_exempt'] = 'taxExempt' @_hash['gain'] = 'gain' @_hash['state_withholding'] = 'stateWithholding' @_hash['penalty'] = 'penalty' @_hash['running_balance'] = 'runningBalance' @_hash['unit_price'] = 'unitPrice' @_hash['units'] = 'units' @_hash['unit_type'] = 'unitType' @_hash['transaction_reason'] = 'transactionReason' @_hash['accrued_interest'] = 'accruedInterest' @_hash['transfer_action'] = 'transferAction' @_hash['position_type'] = 'positionType' @_hash['digital_units'] = 'digitalUnits' @_hash['settlement_timestamp'] = 'settlementTimestamp' @_hash = super().merge(@_hash) @_hash end |
.nullables ⇒ Object
An array for nullable fields
295 296 297 298 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 295 def self.nullables _arr = [] (_arr << super()).flatten! end |
.optionals ⇒ Object
An array for optional fields
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 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 245 def self.optionals _arr = %w[ transaction_type shares face_value price security_id security_id_type security_type symbol markup commission taxes fees load inv401k_source confirmation_number fractional_cash income_type old_units split_ratio_numerator split_ratio_denominator new_units sub_account_sec sub_account_fund loan_id loan_principal loan_interest payroll_date prior_year_contrib withholding tax_exempt gain state_withholding penalty running_balance unit_price units unit_type transaction_reason accrued_interest transfer_action position_type digital_units settlement_timestamp ] (_arr << super()).flatten! end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
636 637 638 639 640 641 642 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 636 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.
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 669 def inspect class_name = self.class.name.split('::').last super_string = super().inspect.sub(/^<[^ ]+ /, '').sub(/>$/, '') "<#{class_name} #{super_string}, transaction_type: #{@transaction_type.inspect}, shares:"\ " #{@shares.inspect}, face_value: #{@face_value.inspect}, price: #{@price.inspect},"\ " security_id: #{@security_id.inspect}, security_id_type: #{@security_id_type.inspect},"\ " security_type: #{@security_type.inspect}, symbol: #{@symbol.inspect}, markup:"\ " #{@markup.inspect}, commission: #{@commission.inspect}, taxes: #{@taxes.inspect}, fees:"\ " #{@fees.inspect}, load: #{@load.inspect}, inv401k_source: #{@inv401k_source.inspect},"\ " confirmation_number: #{@confirmation_number.inspect}, fractional_cash:"\ " #{@fractional_cash.inspect}, income_type: #{@income_type.inspect}, old_units:"\ " #{@old_units.inspect}, split_ratio_numerator: #{@split_ratio_numerator.inspect},"\ " split_ratio_denominator: #{@split_ratio_denominator.inspect}, new_units:"\ " #{@new_units.inspect}, sub_account_sec: #{@sub_account_sec.inspect}, sub_account_fund:"\ " #{@sub_account_fund.inspect}, loan_id: #{@loan_id.inspect}, loan_principal:"\ " #{@loan_principal.inspect}, loan_interest: #{@loan_interest.inspect}, payroll_date:"\ " #{@payroll_date.inspect}, prior_year_contrib: #{@prior_year_contrib.inspect}, withholding:"\ " #{@withholding.inspect}, tax_exempt: #{@tax_exempt.inspect}, gain: #{@gain.inspect},"\ " state_withholding: #{@state_withholding.inspect}, penalty: #{@penalty.inspect},"\ " running_balance: #{@running_balance.inspect}, unit_price: #{@unit_price.inspect}, units:"\ " #{@units.inspect}, unit_type: #{@unit_type.inspect}, transaction_reason:"\ " #{@transaction_reason.inspect}, accrued_interest: #{@accrued_interest.inspect},"\ " transfer_action: #{@transfer_action.inspect}, position_type: #{@position_type.inspect},"\ " digital_units: #{@digital_units.inspect}, settlement_timestamp:"\ " #{@settlement_timestamp.inspect}>" end |
#to_custom_settlement_timestamp ⇒ Object
630 631 632 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 630 def DateTimeHelper.to_rfc3339() end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 |
# File 'lib/fdx_v660_api/models/investment_transaction_entity.rb', line 645 def to_s class_name = self.class.name.split('::').last super_string = super().sub(/^<[^ ]+ /, '').sub(/>$/, '') "<#{class_name} #{super_string}, transaction_type: #{@transaction_type}, shares:"\ " #{@shares}, face_value: #{@face_value}, price: #{@price}, security_id: #{@security_id},"\ " security_id_type: #{@security_id_type}, security_type: #{@security_type}, symbol:"\ " #{@symbol}, markup: #{@markup}, commission: #{@commission}, taxes: #{@taxes}, fees:"\ " #{@fees}, load: #{@load}, inv401k_source: #{@inv401k_source}, confirmation_number:"\ " #{@confirmation_number}, fractional_cash: #{@fractional_cash}, income_type:"\ " #{@income_type}, old_units: #{@old_units}, split_ratio_numerator:"\ " #{@split_ratio_numerator}, split_ratio_denominator: #{@split_ratio_denominator},"\ " new_units: #{@new_units}, sub_account_sec: #{@sub_account_sec}, sub_account_fund:"\ " #{@sub_account_fund}, loan_id: #{@loan_id}, loan_principal: #{@loan_principal},"\ " loan_interest: #{@loan_interest}, payroll_date: #{@payroll_date}, prior_year_contrib:"\ " #{@prior_year_contrib}, withholding: #{@withholding}, tax_exempt: #{@tax_exempt}, gain:"\ " #{@gain}, state_withholding: #{@state_withholding}, penalty: #{@penalty}, running_balance:"\ " #{@running_balance}, unit_price: #{@unit_price}, units: #{@units}, unit_type:"\ " #{@unit_type}, transaction_reason: #{@transaction_reason}, accrued_interest:"\ " #{@accrued_interest}, transfer_action: #{@transfer_action}, position_type:"\ " #{@position_type}, digital_units: #{@digital_units}, settlement_timestamp:"\ " #{@settlement_timestamp}>" end |