Skip to content

Commit

Permalink
Merge pull request #87 from N0-man/master
Browse files Browse the repository at this point in the history
Add missing fields to EquitySummaryByReportDateInBase
  • Loading branch information
csingley authored Nov 11, 2024
2 parents af6a0c6 + 27d364e commit 4e47134
Showing 1 changed file with 47 additions and 39 deletions.
86 changes: 47 additions & 39 deletions ibflex/Types.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class decorator. Class attributes are annotated with PEP 484 type hints.
"DebitCardActivity",
"SymbolSummary",
"AssetSummary",
"Order"
"Order",
]

import datetime
Expand All @@ -102,12 +102,12 @@ class decorator. Class attributes are annotated with PEP 484 type hints.

@dataclass(frozen=True)
class FlexElement:
""" Base class for data element types """
"""Base class for data element types"""


@dataclass(frozen=True)
class FlexQueryResponse(FlexElement):
""" Root element """
"""Root element"""

queryName: str
type: str
Expand All @@ -126,7 +126,7 @@ def __repr__(self):

@dataclass(frozen=True)
class FlexStatement(FlexElement):
""" Wrapped in <FlexStatements> """
"""Wrapped in <FlexStatements>"""

accountId: str
fromDate: datetime.date
Expand Down Expand Up @@ -215,7 +215,7 @@ def __repr__(self):

@dataclass(frozen=True)
class AccountInformation(FlexElement):
""" Child of <FlexStatement> """
"""Child of <FlexStatement>"""

accountId: Optional[str] = None
acctAlias: Optional[str] = None
Expand Down Expand Up @@ -256,7 +256,7 @@ class AccountInformation(FlexElement):

@dataclass(frozen=True)
class ChangeInNAV(FlexElement):
""" Child of <FlexStatement> """
"""Child of <FlexStatement>"""

accountId: Optional[str] = None
acctAlias: Optional[str] = None
Expand Down Expand Up @@ -319,7 +319,7 @@ class ChangeInNAV(FlexElement):

@dataclass(frozen=True)
class MTMPerformanceSummaryUnderlying(FlexElement):
""" Wrapped in <MTMPerformanceSummaryInBase> """
"""Wrapped in <MTMPerformanceSummaryInBase>"""

assetCategory: Optional[enums.AssetClass] = None
accountId: Optional[str] = None
Expand Down Expand Up @@ -368,11 +368,12 @@ class MTMPerformanceSummaryUnderlying(FlexElement):

@dataclass(frozen=True)
class EquitySummaryByReportDateInBase(FlexElement):
""" Wrapped in <EquitySummaryInBase> """
"""Wrapped in <EquitySummaryInBase>"""

accountId: Optional[str] = None
acctAlias: Optional[str] = None
model: Optional[str] = None
currency: Optional[str] = None
reportDate: Optional[datetime.date] = None
cash: Optional[decimal.Decimal] = None
cashLong: Optional[decimal.Decimal] = None
Expand Down Expand Up @@ -401,6 +402,7 @@ class EquitySummaryByReportDateInBase(FlexElement):
notes: Optional[decimal.Decimal] = None
notesLong: Optional[decimal.Decimal] = None
notesShort: Optional[decimal.Decimal] = None
incentiveCouponAccruals: Optional[decimal.Decimal] = None
interestAccruals: Optional[decimal.Decimal] = None
interestAccrualsLong: Optional[decimal.Decimal] = None
interestAccrualsShort: Optional[decimal.Decimal] = None
Expand All @@ -427,7 +429,10 @@ class EquitySummaryByReportDateInBase(FlexElement):
brokerFeesAccrualsComponent: Optional[decimal.Decimal] = None
brokerFeesAccrualsComponentLong: Optional[decimal.Decimal] = None
brokerFeesAccrualsComponentShort: Optional[decimal.Decimal] = None
eventContractInterestAccruals: Optional[decimal.Decimal] = None
marginFinancingChargeAccruals: Optional[decimal.Decimal] = None
cfdUnrealizedPl: Optional[decimal.Decimal] = None
insuredBankDepositRedemptionCashComponent: Optional[decimal.Decimal] = None
fdicInsuredBankSweepAccount: Optional[decimal.Decimal] = None
fdicInsuredBankSweepAccountLong: Optional[decimal.Decimal] = None
fdicInsuredBankSweepAccountShort: Optional[decimal.Decimal] = None
Expand All @@ -449,6 +454,7 @@ class EquitySummaryByReportDateInBase(FlexElement):
ipoSubscription: Optional[decimal.Decimal] = None
ipoSubscriptionLong: Optional[decimal.Decimal] = None
ipoSubscriptionShort: Optional[decimal.Decimal] = None
crypto: Optional[decimal.Decimal] = None
physDel: Optional[decimal.Decimal] = None
physDelLong: Optional[decimal.Decimal] = None
physDelShort: Optional[decimal.Decimal] = None
Expand All @@ -457,7 +463,7 @@ class EquitySummaryByReportDateInBase(FlexElement):

@dataclass(frozen=True)
class MTDYTDPerformanceSummaryUnderlying(FlexElement):
""" Wrapped in <MTDYTDPerformanceSummary> """
"""Wrapped in <MTDYTDPerformanceSummary>"""

assetCategory: Optional[enums.AssetClass] = None
accountId: Optional[str] = None
Expand Down Expand Up @@ -507,7 +513,7 @@ class MTDYTDPerformanceSummaryUnderlying(FlexElement):

@dataclass(frozen=True)
class CashReportCurrency(FlexElement):
""" Wrapped in <CashReport> """
"""Wrapped in <CashReport>"""

accountId: Optional[str] = None
currency: Optional[str] = None
Expand Down Expand Up @@ -808,7 +814,7 @@ class CashReportCurrency(FlexElement):

@dataclass(frozen=True)
class CFDCharge(FlexElement):
""" Wrapped in <CFDCharge> """
"""Wrapped in <CFDCharge>"""

assetCategory: Optional[enums.AssetClass] = None
accountId: Optional[str] = None
Expand Down Expand Up @@ -853,7 +859,7 @@ class CFDCharge(FlexElement):

@dataclass(frozen=True)
class StatementOfFundsLine(FlexElement):
""" Wrapped in <StmtFunds> """
"""Wrapped in <StmtFunds>"""

assetCategory: Optional[enums.AssetClass] = None
accountId: Optional[str] = None
Expand Down Expand Up @@ -916,7 +922,7 @@ class StatementOfFundsLine(FlexElement):

@dataclass(frozen=True)
class ChangeInPositionValue(FlexElement):
""" Wrapped in <ChangeInPositionValues> """
"""Wrapped in <ChangeInPositionValues>"""

assetCategory: Optional[enums.AssetClass] = None
currency: Optional[str] = None
Expand All @@ -939,7 +945,7 @@ class ChangeInPositionValue(FlexElement):

@dataclass(frozen=True)
class OpenPosition(FlexElement):
""" Wrapped in <OpenPositions> """
"""Wrapped in <OpenPositions>"""

side: Optional[enums.LongShort] = None
assetCategory: Optional[enums.AssetClass] = None
Expand Down Expand Up @@ -999,7 +1005,7 @@ class OpenPosition(FlexElement):

@dataclass(frozen=True)
class FxLot(FlexElement):
""" Wrapped in <FxLots>, which in turn is wrapped in <FxPositions> """
"""Wrapped in <FxLots>, which in turn is wrapped in <FxPositions>"""

assetCategory: Optional[enums.AssetClass] = None
accountId: Optional[str] = None
Expand All @@ -1022,7 +1028,7 @@ class FxLot(FlexElement):

@dataclass(frozen=True)
class Trade(FlexElement):
""" Wrapped in <Trades> """
"""Wrapped in <Trades>"""

transactionType: Optional[enums.TradeType] = None
openCloseIndicator: Optional[enums.OpenClose] = None
Expand Down Expand Up @@ -1120,7 +1126,8 @@ class Trade(FlexElement):

@dataclass(frozen=True)
class TransferLot(FlexElement):
""" Wrapped in <Transfers> """
"""Wrapped in <Transfers>"""

accountId: Optional[str] = None
currency: Optional[str] = None
fxRateToBase: Optional[decimal.Decimal] = None
Expand Down Expand Up @@ -1173,7 +1180,7 @@ class TransferLot(FlexElement):

@dataclass(frozen=True)
class Lot(FlexElement):
""" Wrapped in <Trades> """
"""Wrapped in <Trades>"""

transactionType: Optional[enums.TradeType] = None
openCloseIndicator: Optional[enums.OpenClose] = None
Expand Down Expand Up @@ -1271,7 +1278,7 @@ class Lot(FlexElement):

@dataclass(frozen=True)
class UnbundledCommissionDetail(FlexElement):
""" Wrapped in <UnbundledCommissionDetails> """
"""Wrapped in <UnbundledCommissionDetails>"""

buySell: Optional[enums.BuySell] = None
assetCategory: Optional[enums.AssetClass] = None
Expand Down Expand Up @@ -1319,7 +1326,7 @@ class UnbundledCommissionDetail(FlexElement):

@dataclass(frozen=True)
class SymbolSummary(FlexElement):
""" Wrapped in <TradeConfirms> """
"""Wrapped in <TradeConfirms>"""

accountId: Optional[str] = None
acctAlias: Optional[str] = None
Expand Down Expand Up @@ -1394,7 +1401,7 @@ class SymbolSummary(FlexElement):

@dataclass(frozen=True)
class AssetSummary(FlexElement):
""" Wrapped in <TradeConfirms> """
"""Wrapped in <TradeConfirms>"""

accountId: Optional[str] = None
acctAlias: Optional[str] = None
Expand Down Expand Up @@ -1503,7 +1510,7 @@ class AssetSummary(FlexElement):

@dataclass(frozen=True)
class Order(FlexElement):
""" Wrapped in <TradeConfirms> or <Trades>"""
"""Wrapped in <TradeConfirms> or <Trades>"""

accountId: Optional[str] = None
acctAlias: Optional[str] = None
Expand Down Expand Up @@ -1611,7 +1618,7 @@ class Order(FlexElement):

@dataclass(frozen=True)
class TradeConfirm(FlexElement):
""" Wrapped in <TradeConfirms> """
"""Wrapped in <TradeConfirms>"""

transactionType: Optional[enums.TradeType] = None
openCloseIndicator: Optional[enums.OpenClose] = None
Expand Down Expand Up @@ -1773,7 +1780,7 @@ class OptionEAE(FlexElement):

@dataclass(frozen=True)
class TradeTransfer(FlexElement):
""" Wrapped in <TradeTransfers> """
"""Wrapped in <TradeTransfers>"""

transactionType: Optional[enums.TradeType] = None
openCloseIndicator: Optional[enums.OpenClose] = None
Expand Down Expand Up @@ -1845,7 +1852,7 @@ class TradeTransfer(FlexElement):

@dataclass(frozen=True)
class InterestAccrualsCurrency(FlexElement):
""" Wrapped in <InterestAccruals> """
"""Wrapped in <InterestAccruals>"""

accountId: Optional[str] = None
currency: Optional[str] = None
Expand Down Expand Up @@ -1887,7 +1894,7 @@ class TierInterestDetail(FlexElement):

@dataclass(frozen=True)
class HardToBorrowDetail(FlexElement):
""" Wrapped in <HardToBorrowDetails> """
"""Wrapped in <HardToBorrowDetails>"""

assetCategory: Optional[enums.AssetClass] = None
accountId: Optional[str] = None
Expand Down Expand Up @@ -1926,7 +1933,7 @@ class HardToBorrowDetail(FlexElement):

@dataclass(frozen=True)
class SLBActivity(FlexElement):
""" Wrapped in <SLBActivities> """
"""Wrapped in <SLBActivities>"""

assetCategory: Optional[enums.AssetClass] = None
accountId: Optional[str] = None
Expand Down Expand Up @@ -1964,7 +1971,8 @@ class SLBActivity(FlexElement):

@dataclass(frozen=True)
class SLBFee:
""" Wrapped in <SLBFees> """
"""Wrapped in <SLBFees>"""

accountId: Optional[str] = None
acctAlias: Optional[str] = None
model: Optional[str] = None
Expand Down Expand Up @@ -2011,7 +2019,7 @@ class SLBFee:

@dataclass(frozen=True)
class Transfer(FlexElement):
""" Wrapped in <Transfers> """
"""Wrapped in <Transfers>"""

type: Optional[enums.TransferType] = None
direction: Optional[enums.InOut] = None
Expand Down Expand Up @@ -2069,7 +2077,7 @@ class Transfer(FlexElement):

@dataclass(frozen=True)
class UnsettledTransfer(FlexElement):
""" Wrapped in <UnsettledTransfers> """
"""Wrapped in <UnsettledTransfers>"""

direction: Optional[enums.ToFrom] = None
assetCategory: Optional[enums.AssetClass] = None
Expand Down Expand Up @@ -2097,7 +2105,7 @@ class UnsettledTransfer(FlexElement):

@dataclass(frozen=True)
class PriorPeriodPosition(FlexElement):
""" Wrapped in <PriorPeriodPositions> """
"""Wrapped in <PriorPeriodPositions>"""

assetCategory: Optional[enums.AssetClass] = None
accountId: Optional[str] = None
Expand Down Expand Up @@ -2131,7 +2139,7 @@ class PriorPeriodPosition(FlexElement):

@dataclass(frozen=True)
class CorporateAction(FlexElement):
""" Wrapped in <CorporateActions> """
"""Wrapped in <CorporateActions>"""

assetCategory: Optional[enums.AssetClass] = None
subCategory: Optional[str] = None
Expand Down Expand Up @@ -2185,7 +2193,7 @@ class CorporateAction(FlexElement):

@dataclass(frozen=True)
class FxTransaction(FlexElement):
""" Wrapped in <FxTransactions> """
"""Wrapped in <FxTransactions>"""

assetCategory: Optional[enums.AssetClass] = None
accountId: Optional[str] = None
Expand All @@ -2206,7 +2214,7 @@ class FxTransaction(FlexElement):

@dataclass(frozen=True)
class CashTransaction(FlexElement):
""" Wrapped in <CashTransactions> """
"""Wrapped in <CashTransactions>"""

type: Optional[enums.CashAction] = None
assetCategory: Optional[enums.AssetClass] = None
Expand Down Expand Up @@ -2255,7 +2263,7 @@ class CashTransaction(FlexElement):

@dataclass(frozen=True)
class DebitCardActivity(FlexElement):
""" Wrapped in <DebitCardActivities> """
"""Wrapped in <DebitCardActivities>"""

accountId: Optional[str] = None
acctAlias: Optional[str] = None
Expand All @@ -2274,7 +2282,7 @@ class DebitCardActivity(FlexElement):

@dataclass(frozen=True)
class ChangeInDividendAccrual(FlexElement):
""" Wrapped in <ChangeInDividendAccruals> """
"""Wrapped in <ChangeInDividendAccruals>"""

date: Optional[datetime.date] = None
assetCategory: Optional[enums.AssetClass] = None
Expand Down Expand Up @@ -2322,7 +2330,7 @@ class ChangeInDividendAccrual(FlexElement):

@dataclass(frozen=True)
class OpenDividendAccrual(FlexElement):
""" Wrapped in <OpenDividendAccruals> """
"""Wrapped in <OpenDividendAccruals>"""

assetCategory: Optional[enums.AssetClass] = None
currency: Optional[str] = None
Expand Down Expand Up @@ -2369,7 +2377,7 @@ class OpenDividendAccrual(FlexElement):

@dataclass(frozen=True)
class SecurityInfo(FlexElement):
""" Wrapped in <SecuritiesInfo> """
"""Wrapped in <SecuritiesInfo>"""

assetCategory: Optional[enums.AssetClass] = None
symbol: Optional[str] = None
Expand Down Expand Up @@ -2415,7 +2423,7 @@ class SecurityInfo(FlexElement):

@dataclass(frozen=True)
class ConversionRate(FlexElement):
""" Wrapped in <ConversionRates> """
"""Wrapped in <ConversionRates>"""

reportDate: Optional[datetime.date] = None
fromCurrency: Optional[str] = None
Expand Down

0 comments on commit 4e47134

Please sign in to comment.