lusid-sdk 2.1.599__py3-none-any.whl → 2.1.642__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. lusid/__init__.py +36 -0
  2. lusid/api/corporate_action_sources_api.py +6 -6
  3. lusid/api/entities_api.py +24 -24
  4. lusid/api/funds_api.py +438 -1
  5. lusid/api/order_management_api.py +16 -8
  6. lusid/api/staged_modifications_api.py +12 -12
  7. lusid/api/timelines_api.py +579 -3
  8. lusid/api/transaction_portfolios_api.py +183 -0
  9. lusid/api/workspace_api.py +96 -48
  10. lusid/configuration.py +1 -1
  11. lusid/models/__init__.py +36 -0
  12. lusid/models/accounted_transaction.py +88 -0
  13. lusid/models/accumulation_event.py +3 -3
  14. lusid/models/adjust_global_commitment_event.py +93 -0
  15. lusid/models/amortisation_event.py +3 -3
  16. lusid/models/basket.py +3 -3
  17. lusid/models/bond.py +11 -5
  18. lusid/models/bond_coupon_event.py +3 -3
  19. lusid/models/bond_default_event.py +3 -3
  20. lusid/models/bond_principal_event.py +3 -3
  21. lusid/models/bonus_issue_event.py +3 -3
  22. lusid/models/call_on_intermediate_securities_event.py +3 -3
  23. lusid/models/cancel_single_holding_adjustment_request.py +96 -0
  24. lusid/models/cap_floor.py +22 -7
  25. lusid/models/capital_distribution_event.py +3 -3
  26. lusid/models/cash.py +3 -3
  27. lusid/models/cash_dividend_event.py +3 -3
  28. lusid/models/cash_flow_event.py +3 -3
  29. lusid/models/cash_perpetual.py +3 -3
  30. lusid/models/cds_credit_event.py +3 -3
  31. lusid/models/cds_index.py +3 -3
  32. lusid/models/cdx_credit_event.py +3 -3
  33. lusid/models/close_event.py +3 -3
  34. lusid/models/closed_period.py +128 -0
  35. lusid/models/complete_portfolio.py +3 -3
  36. lusid/models/complex_bond.py +20 -7
  37. lusid/models/contract_details.py +101 -0
  38. lusid/models/contract_for_difference.py +3 -3
  39. lusid/models/contract_initialisation_event.py +99 -0
  40. lusid/models/create_closed_period_request.py +96 -0
  41. lusid/models/create_derived_property_definition_request.py +3 -3
  42. lusid/models/create_derived_transaction_portfolio_request.py +8 -2
  43. lusid/models/create_property_definition_request.py +3 -3
  44. lusid/models/credit_default_swap.py +3 -3
  45. lusid/models/credit_premium_cash_flow_event.py +3 -3
  46. lusid/models/dependency_source_filter.py +19 -4
  47. lusid/models/dividend_option_event.py +3 -3
  48. lusid/models/dividend_reinvestment_event.py +3 -3
  49. lusid/models/drawdown_event.py +99 -0
  50. lusid/models/early_redemption_event.py +3 -3
  51. lusid/models/eligibility_calculation.py +6 -4
  52. lusid/models/equity.py +3 -3
  53. lusid/models/equity_option.py +23 -7
  54. lusid/models/equity_swap.py +3 -3
  55. lusid/models/exchange_traded_option.py +12 -6
  56. lusid/models/exercise_event.py +3 -3
  57. lusid/models/exotic_instrument.py +3 -3
  58. lusid/models/expiry_event.py +3 -3
  59. lusid/models/fee_accrual.py +3 -1
  60. lusid/models/fixed_leg.py +3 -3
  61. lusid/models/flexible_deposit.py +105 -0
  62. lusid/models/flexible_loan.py +3 -3
  63. lusid/models/floating_leg.py +3 -3
  64. lusid/models/forward_rate_agreement.py +3 -3
  65. lusid/models/fund_share_class.py +3 -3
  66. lusid/models/funding_leg.py +3 -3
  67. lusid/models/future.py +19 -7
  68. lusid/models/future_expiry_event.py +3 -3
  69. lusid/models/future_mark_to_market_event.py +100 -0
  70. lusid/models/fx_forward.py +3 -3
  71. lusid/models/fx_forward_settlement_event.py +3 -3
  72. lusid/models/fx_option.py +3 -3
  73. lusid/models/fx_swap.py +3 -3
  74. lusid/models/group_reconciliation_summary.py +2 -2
  75. lusid/models/inflation_leg.py +3 -3
  76. lusid/models/inflation_linked_bond.py +11 -5
  77. lusid/models/inflation_swap.py +3 -3
  78. lusid/models/informational_error_event.py +3 -3
  79. lusid/models/informational_event.py +3 -3
  80. lusid/models/instrument_event.py +10 -5
  81. lusid/models/instrument_event_instruction.py +9 -2
  82. lusid/models/instrument_event_instruction_request.py +10 -3
  83. lusid/models/instrument_event_type.py +5 -0
  84. lusid/models/instrument_leg.py +3 -3
  85. lusid/models/instrument_type.py +1 -0
  86. lusid/models/interest_rate_swap.py +3 -3
  87. lusid/models/interest_rate_swaption.py +3 -3
  88. lusid/models/intermediate_securities_distribution_event.py +3 -3
  89. lusid/models/loan_facility.py +3 -3
  90. lusid/models/loan_interest_repayment_event.py +97 -0
  91. lusid/models/lusid_instrument.py +6 -5
  92. lusid/models/mark_to_market_conventions.py +74 -0
  93. lusid/models/market_data_key_rule.py +1 -1
  94. lusid/models/market_data_specific_rule.py +1 -1
  95. lusid/models/mastered_instrument.py +3 -3
  96. lusid/models/maturity_event.py +3 -3
  97. lusid/models/mbs_coupon_event.py +3 -3
  98. lusid/models/mbs_interest_deferral_event.py +3 -3
  99. lusid/models/mbs_interest_shortfall_event.py +3 -3
  100. lusid/models/mbs_principal_event.py +3 -3
  101. lusid/models/mbs_principal_write_off_event.py +3 -3
  102. lusid/models/merger_event.py +3 -3
  103. lusid/models/open_event.py +3 -3
  104. lusid/models/option_exercise_cash_event.py +3 -3
  105. lusid/models/option_exercise_physical_event.py +3 -3
  106. lusid/models/paged_resource_list_of_closed_period.py +113 -0
  107. lusid/models/pnl_journal_entry_line.py +95 -0
  108. lusid/models/portfolio.py +3 -3
  109. lusid/models/portfolio_id.py +80 -0
  110. lusid/models/portfolio_search_result.py +3 -3
  111. lusid/models/portfolio_type.py +1 -0
  112. lusid/models/portfolio_without_href.py +3 -3
  113. lusid/models/property_definition.py +3 -3
  114. lusid/models/property_definition_search_result.py +3 -3
  115. lusid/models/property_domain.py +1 -0
  116. lusid/models/protection_payout_cash_flow_event.py +3 -3
  117. lusid/models/raw_vendor_event.py +3 -3
  118. lusid/models/reference_instrument.py +3 -3
  119. lusid/models/repo.py +3 -3
  120. lusid/models/reset_event.py +3 -3
  121. lusid/models/reverse_stock_split_event.py +3 -3
  122. lusid/models/scrip_dividend_event.py +3 -3
  123. lusid/models/side_definition.py +8 -1
  124. lusid/models/side_definition_request.py +9 -2
  125. lusid/models/simple_cash_flow_loan.py +3 -3
  126. lusid/models/simple_instrument.py +3 -3
  127. lusid/models/spin_off_event.py +3 -3
  128. lusid/models/stock_dividend_event.py +3 -3
  129. lusid/models/stock_split_event.py +3 -3
  130. lusid/models/swap_cash_flow_event.py +3 -3
  131. lusid/models/swap_principal_event.py +3 -3
  132. lusid/models/tender_event.py +3 -3
  133. lusid/models/term_deposit.py +3 -3
  134. lusid/models/term_deposit_interest_event.py +3 -3
  135. lusid/models/term_deposit_principal_event.py +3 -3
  136. lusid/models/total_return_swap.py +3 -3
  137. lusid/models/trading_conventions.py +73 -0
  138. lusid/models/transition_event.py +3 -3
  139. lusid/models/trigger_event.py +3 -3
  140. lusid/models/valuation_point_resource_list_of_accounted_transaction.py +125 -0
  141. lusid/models/valuation_point_resource_list_of_pnl_journal_entry_line.py +125 -0
  142. lusid/models/workspace.py +1 -1
  143. lusid/models/workspace_creation_request.py +1 -1
  144. lusid/models/workspace_item.py +4 -2
  145. lusid/models/workspace_item_creation_request.py +11 -2
  146. {lusid_sdk-2.1.599.dist-info → lusid_sdk-2.1.642.dist-info}/METADATA +34 -10
  147. {lusid_sdk-2.1.599.dist-info → lusid_sdk-2.1.642.dist-info}/RECORD +148 -130
  148. {lusid_sdk-2.1.599.dist-info → lusid_sdk-2.1.642.dist-info}/WHEEL +0 -0
lusid/models/cds_index.py CHANGED
@@ -39,15 +39,15 @@ class CdsIndex(LusidInstrument):
39
39
  convention_name: Optional[FlowConventionName] = Field(None, alias="conventionName")
40
40
  notional: Union[StrictFloat, StrictInt] = Field(..., description="The notional quantity that applies to both the premium and protection legs.")
41
41
  additional_payments: Optional[conlist(AdditionalPayment)] = Field(None, alias="additionalPayments", description="Optional additional payments at a given date e.g. to level off an uneven swap. The dates must be distinct and either all payments are Pay or all payments are Receive.")
42
- instrument_type: StrictStr = Field(..., alias="instrumentType", description="The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashFlowsLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CapFloor, CashSettled, CdsIndex, Basket, FundingLeg, FxSwap, ForwardRateAgreement, SimpleInstrument, Repo, Equity, ExchangeTradedOption, ReferenceInstrument, ComplexBond, InflationLinkedBond, InflationSwap, SimpleCashFlowLoan, TotalReturnSwap, InflationLeg, FundShareClass, FlexibleLoan, UnsettledCash, Cash, MasteredInstrument, LoanFacility")
42
+ instrument_type: StrictStr = Field(..., alias="instrumentType", description="The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashFlowsLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CapFloor, CashSettled, CdsIndex, Basket, FundingLeg, FxSwap, ForwardRateAgreement, SimpleInstrument, Repo, Equity, ExchangeTradedOption, ReferenceInstrument, ComplexBond, InflationLinkedBond, InflationSwap, SimpleCashFlowLoan, TotalReturnSwap, InflationLeg, FundShareClass, FlexibleLoan, UnsettledCash, Cash, MasteredInstrument, LoanFacility, FlexibleDeposit")
43
43
  additional_properties: Dict[str, Any] = {}
44
44
  __properties = ["instrumentType", "startDate", "maturityDate", "flowConventions", "couponRate", "identifiers", "basket", "conventionName", "notional", "additionalPayments"]
45
45
 
46
46
  @validator('instrument_type')
47
47
  def instrument_type_validate_enum(cls, value):
48
48
  """Validates the enum"""
49
- if value not in ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility'):
50
- raise ValueError("must be one of enum values ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility')")
49
+ if value not in ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility', 'FlexibleDeposit'):
50
+ raise ValueError("must be one of enum values ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility', 'FlexibleDeposit')")
51
51
  return value
52
52
 
53
53
  class Config:
@@ -31,15 +31,15 @@ class CdxCreditEvent(InstrumentEvent):
31
31
  recovery_rate: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="recoveryRate", description="The fraction of the defaulted debt that can be recovered.")
32
32
  constituent_weight: Union[StrictFloat, StrictInt] = Field(..., alias="constituentWeight", description="The relative weight of the CDX constituent.")
33
33
  constituent_reference: Optional[StrictStr] = Field(None, alias="constituentReference", description="Reference value used to identify the CDX constituent.")
34
- instrument_event_type: StrictStr = Field(..., alias="instrumentEventType", description="The Type of Event. The available values are: TransitionEvent, InformationalEvent, OpenEvent, CloseEvent, StockSplitEvent, BondDefaultEvent, CashDividendEvent, AmortisationEvent, CashFlowEvent, ExerciseEvent, ResetEvent, TriggerEvent, RawVendorEvent, InformationalErrorEvent, BondCouponEvent, DividendReinvestmentEvent, AccumulationEvent, BondPrincipalEvent, DividendOptionEvent, MaturityEvent, FxForwardSettlementEvent, ExpiryEvent, ScripDividendEvent, StockDividendEvent, ReverseStockSplitEvent, CapitalDistributionEvent, SpinOffEvent, MergerEvent, FutureExpiryEvent, SwapCashFlowEvent, SwapPrincipalEvent, CreditPremiumCashFlowEvent, CdsCreditEvent, CdxCreditEvent, MbsCouponEvent, MbsPrincipalEvent, BonusIssueEvent, MbsPrincipalWriteOffEvent, MbsInterestDeferralEvent, MbsInterestShortfallEvent, TenderEvent, CallOnIntermediateSecuritiesEvent, IntermediateSecuritiesDistributionEvent, OptionExercisePhysicalEvent, OptionExerciseCashEvent, ProtectionPayoutCashFlowEvent, TermDepositInterestEvent, TermDepositPrincipalEvent, EarlyRedemptionEvent")
34
+ instrument_event_type: StrictStr = Field(..., alias="instrumentEventType", description="The Type of Event. The available values are: TransitionEvent, InformationalEvent, OpenEvent, CloseEvent, StockSplitEvent, BondDefaultEvent, CashDividendEvent, AmortisationEvent, CashFlowEvent, ExerciseEvent, ResetEvent, TriggerEvent, RawVendorEvent, InformationalErrorEvent, BondCouponEvent, DividendReinvestmentEvent, AccumulationEvent, BondPrincipalEvent, DividendOptionEvent, MaturityEvent, FxForwardSettlementEvent, ExpiryEvent, ScripDividendEvent, StockDividendEvent, ReverseStockSplitEvent, CapitalDistributionEvent, SpinOffEvent, MergerEvent, FutureExpiryEvent, SwapCashFlowEvent, SwapPrincipalEvent, CreditPremiumCashFlowEvent, CdsCreditEvent, CdxCreditEvent, MbsCouponEvent, MbsPrincipalEvent, BonusIssueEvent, MbsPrincipalWriteOffEvent, MbsInterestDeferralEvent, MbsInterestShortfallEvent, TenderEvent, CallOnIntermediateSecuritiesEvent, IntermediateSecuritiesDistributionEvent, OptionExercisePhysicalEvent, OptionExerciseCashEvent, ProtectionPayoutCashFlowEvent, TermDepositInterestEvent, TermDepositPrincipalEvent, EarlyRedemptionEvent, FutureMarkToMarketEvent, AdjustGlobalCommitmentEvent, ContractInitialisationEvent, DrawdownEvent, LoanInterestRepaymentEvent")
35
35
  additional_properties: Dict[str, Any] = {}
36
36
  __properties = ["instrumentEventType", "effectiveDate", "auctionDate", "recoveryRate", "constituentWeight", "constituentReference"]
37
37
 
38
38
  @validator('instrument_event_type')
39
39
  def instrument_event_type_validate_enum(cls, value):
40
40
  """Validates the enum"""
41
- if value not in ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent', 'TermDepositInterestEvent', 'TermDepositPrincipalEvent', 'EarlyRedemptionEvent'):
42
- raise ValueError("must be one of enum values ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent', 'TermDepositInterestEvent', 'TermDepositPrincipalEvent', 'EarlyRedemptionEvent')")
41
+ if value not in ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent', 'TermDepositInterestEvent', 'TermDepositPrincipalEvent', 'EarlyRedemptionEvent', 'FutureMarkToMarketEvent', 'AdjustGlobalCommitmentEvent', 'ContractInitialisationEvent', 'DrawdownEvent', 'LoanInterestRepaymentEvent'):
42
+ raise ValueError("must be one of enum values ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent', 'TermDepositInterestEvent', 'TermDepositPrincipalEvent', 'EarlyRedemptionEvent', 'FutureMarkToMarketEvent', 'AdjustGlobalCommitmentEvent', 'ContractInitialisationEvent', 'DrawdownEvent', 'LoanInterestRepaymentEvent')")
43
43
  return value
44
44
 
45
45
  class Config:
@@ -28,15 +28,15 @@ class CloseEvent(InstrumentEvent):
28
28
  """
29
29
  start_date: Optional[datetime] = Field(None, alias="startDate", description="The first date on which the instrument could close")
30
30
  end_date: Optional[datetime] = Field(None, alias="endDate", description="The last date on which the instrument could close")
31
- instrument_event_type: StrictStr = Field(..., alias="instrumentEventType", description="The Type of Event. The available values are: TransitionEvent, InformationalEvent, OpenEvent, CloseEvent, StockSplitEvent, BondDefaultEvent, CashDividendEvent, AmortisationEvent, CashFlowEvent, ExerciseEvent, ResetEvent, TriggerEvent, RawVendorEvent, InformationalErrorEvent, BondCouponEvent, DividendReinvestmentEvent, AccumulationEvent, BondPrincipalEvent, DividendOptionEvent, MaturityEvent, FxForwardSettlementEvent, ExpiryEvent, ScripDividendEvent, StockDividendEvent, ReverseStockSplitEvent, CapitalDistributionEvent, SpinOffEvent, MergerEvent, FutureExpiryEvent, SwapCashFlowEvent, SwapPrincipalEvent, CreditPremiumCashFlowEvent, CdsCreditEvent, CdxCreditEvent, MbsCouponEvent, MbsPrincipalEvent, BonusIssueEvent, MbsPrincipalWriteOffEvent, MbsInterestDeferralEvent, MbsInterestShortfallEvent, TenderEvent, CallOnIntermediateSecuritiesEvent, IntermediateSecuritiesDistributionEvent, OptionExercisePhysicalEvent, OptionExerciseCashEvent, ProtectionPayoutCashFlowEvent, TermDepositInterestEvent, TermDepositPrincipalEvent, EarlyRedemptionEvent")
31
+ instrument_event_type: StrictStr = Field(..., alias="instrumentEventType", description="The Type of Event. The available values are: TransitionEvent, InformationalEvent, OpenEvent, CloseEvent, StockSplitEvent, BondDefaultEvent, CashDividendEvent, AmortisationEvent, CashFlowEvent, ExerciseEvent, ResetEvent, TriggerEvent, RawVendorEvent, InformationalErrorEvent, BondCouponEvent, DividendReinvestmentEvent, AccumulationEvent, BondPrincipalEvent, DividendOptionEvent, MaturityEvent, FxForwardSettlementEvent, ExpiryEvent, ScripDividendEvent, StockDividendEvent, ReverseStockSplitEvent, CapitalDistributionEvent, SpinOffEvent, MergerEvent, FutureExpiryEvent, SwapCashFlowEvent, SwapPrincipalEvent, CreditPremiumCashFlowEvent, CdsCreditEvent, CdxCreditEvent, MbsCouponEvent, MbsPrincipalEvent, BonusIssueEvent, MbsPrincipalWriteOffEvent, MbsInterestDeferralEvent, MbsInterestShortfallEvent, TenderEvent, CallOnIntermediateSecuritiesEvent, IntermediateSecuritiesDistributionEvent, OptionExercisePhysicalEvent, OptionExerciseCashEvent, ProtectionPayoutCashFlowEvent, TermDepositInterestEvent, TermDepositPrincipalEvent, EarlyRedemptionEvent, FutureMarkToMarketEvent, AdjustGlobalCommitmentEvent, ContractInitialisationEvent, DrawdownEvent, LoanInterestRepaymentEvent")
32
32
  additional_properties: Dict[str, Any] = {}
33
33
  __properties = ["instrumentEventType", "startDate", "endDate"]
34
34
 
35
35
  @validator('instrument_event_type')
36
36
  def instrument_event_type_validate_enum(cls, value):
37
37
  """Validates the enum"""
38
- if value not in ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent', 'TermDepositInterestEvent', 'TermDepositPrincipalEvent', 'EarlyRedemptionEvent'):
39
- raise ValueError("must be one of enum values ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent', 'TermDepositInterestEvent', 'TermDepositPrincipalEvent', 'EarlyRedemptionEvent')")
38
+ if value not in ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent', 'TermDepositInterestEvent', 'TermDepositPrincipalEvent', 'EarlyRedemptionEvent', 'FutureMarkToMarketEvent', 'AdjustGlobalCommitmentEvent', 'ContractInitialisationEvent', 'DrawdownEvent', 'LoanInterestRepaymentEvent'):
39
+ raise ValueError("must be one of enum values ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent', 'TermDepositInterestEvent', 'TermDepositPrincipalEvent', 'EarlyRedemptionEvent', 'FutureMarkToMarketEvent', 'AdjustGlobalCommitmentEvent', 'ContractInitialisationEvent', 'DrawdownEvent', 'LoanInterestRepaymentEvent')")
40
40
  return value
41
41
 
42
42
  class Config:
@@ -0,0 +1,128 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LUSID API
5
+
6
+ FINBOURNE Technology # noqa: E501
7
+
8
+ Contact: info@finbourne.com
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from typing import Any, Dict, List, Optional
22
+ from pydantic.v1 import BaseModel, Field, StrictStr, conlist
23
+ from lusid.models.link import Link
24
+ from lusid.models.model_property import ModelProperty
25
+ from lusid.models.version import Version
26
+
27
+ class ClosedPeriod(BaseModel):
28
+ """
29
+ ClosedPeriod
30
+ """
31
+ closed_period_id: Optional[StrictStr] = Field(None, alias="closedPeriodId", description="The unique Id of the Closed Period. The ClosedPeriodId, together with the Timeline Scope and Code, uniquely identifies a Closed Period")
32
+ effective_start: Optional[datetime] = Field(None, alias="effectiveStart", description="The effective start of the Closed Period")
33
+ effective_end: Optional[datetime] = Field(None, alias="effectiveEnd", description="The effective end of the Closed Period")
34
+ as_at_closed: Optional[datetime] = Field(None, alias="asAtClosed", description="The asAt datetime the Closed Period was created")
35
+ properties: Optional[Dict[str, ModelProperty]] = Field(None, description="The Closed Periods properties. These will be from the 'ClosedPeriod' domain.")
36
+ version: Optional[Version] = None
37
+ href: Optional[StrictStr] = Field(None, description="The specific Uniform Resource Identifier (URI) for this resource at the requested asAt datetime.")
38
+ links: Optional[conlist(Link)] = None
39
+ __properties = ["closedPeriodId", "effectiveStart", "effectiveEnd", "asAtClosed", "properties", "version", "href", "links"]
40
+
41
+ class Config:
42
+ """Pydantic configuration"""
43
+ allow_population_by_field_name = True
44
+ validate_assignment = True
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.dict(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> ClosedPeriod:
56
+ """Create an instance of ClosedPeriod from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self):
60
+ """Returns the dictionary representation of the model using alias"""
61
+ _dict = self.dict(by_alias=True,
62
+ exclude={
63
+ },
64
+ exclude_none=True)
65
+ # override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
66
+ _field_dict = {}
67
+ if self.properties:
68
+ for _key in self.properties:
69
+ if self.properties[_key]:
70
+ _field_dict[_key] = self.properties[_key].to_dict()
71
+ _dict['properties'] = _field_dict
72
+ # override the default output from pydantic by calling `to_dict()` of version
73
+ if self.version:
74
+ _dict['version'] = self.version.to_dict()
75
+ # override the default output from pydantic by calling `to_dict()` of each item in links (list)
76
+ _items = []
77
+ if self.links:
78
+ for _item in self.links:
79
+ if _item:
80
+ _items.append(_item.to_dict())
81
+ _dict['links'] = _items
82
+ # set to None if closed_period_id (nullable) is None
83
+ # and __fields_set__ contains the field
84
+ if self.closed_period_id is None and "closed_period_id" in self.__fields_set__:
85
+ _dict['closedPeriodId'] = None
86
+
87
+ # set to None if properties (nullable) is None
88
+ # and __fields_set__ contains the field
89
+ if self.properties is None and "properties" in self.__fields_set__:
90
+ _dict['properties'] = None
91
+
92
+ # set to None if href (nullable) is None
93
+ # and __fields_set__ contains the field
94
+ if self.href is None and "href" in self.__fields_set__:
95
+ _dict['href'] = None
96
+
97
+ # set to None if links (nullable) is None
98
+ # and __fields_set__ contains the field
99
+ if self.links is None and "links" in self.__fields_set__:
100
+ _dict['links'] = None
101
+
102
+ return _dict
103
+
104
+ @classmethod
105
+ def from_dict(cls, obj: dict) -> ClosedPeriod:
106
+ """Create an instance of ClosedPeriod from a dict"""
107
+ if obj is None:
108
+ return None
109
+
110
+ if not isinstance(obj, dict):
111
+ return ClosedPeriod.parse_obj(obj)
112
+
113
+ _obj = ClosedPeriod.parse_obj({
114
+ "closed_period_id": obj.get("closedPeriodId"),
115
+ "effective_start": obj.get("effectiveStart"),
116
+ "effective_end": obj.get("effectiveEnd"),
117
+ "as_at_closed": obj.get("asAtClosed"),
118
+ "properties": dict(
119
+ (_k, ModelProperty.from_dict(_v))
120
+ for _k, _v in obj.get("properties").items()
121
+ )
122
+ if obj.get("properties") is not None
123
+ else None,
124
+ "version": Version.from_dict(obj.get("version")) if obj.get("version") is not None else None,
125
+ "href": obj.get("href"),
126
+ "links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
127
+ })
128
+ return _obj
@@ -36,7 +36,7 @@ class CompletePortfolio(BaseModel):
36
36
  created: Optional[datetime] = Field(None, description="The effective datetime at which the portfolio was created. No transactions or constituents can be added to the portfolio before this date.")
37
37
  parent_portfolio_id: Optional[ResourceId] = Field(None, alias="parentPortfolioId")
38
38
  is_derived: Optional[StrictBool] = Field(None, alias="isDerived", description="Whether or not this is a derived portfolio.")
39
- type: Optional[StrictStr] = Field(None, description="The type of the portfolio. The available values are: Transaction, Reference, DerivedTransaction")
39
+ type: Optional[StrictStr] = Field(None, description="The type of the portfolio. The available values are: Transaction, Reference, DerivedTransaction, SimplePosition")
40
40
  version: Version = Field(...)
41
41
  properties: Optional[conlist(ModelProperty)] = Field(None, description="The requested portfolio properties. These will be from the 'Portfolio' domain.")
42
42
  base_currency: Optional[StrictStr] = Field(None, alias="baseCurrency", description="If the portfolio is a transaction portfolio or derived transaction portfolio, this is the base currency of the portfolio.")
@@ -50,8 +50,8 @@ class CompletePortfolio(BaseModel):
50
50
  if value is None:
51
51
  return value
52
52
 
53
- if value not in ('Transaction', 'Reference', 'DerivedTransaction'):
54
- raise ValueError("must be one of enum values ('Transaction', 'Reference', 'DerivedTransaction')")
53
+ if value not in ('Transaction', 'Reference', 'DerivedTransaction', 'SimplePosition'):
54
+ raise ValueError("must be one of enum values ('Transaction', 'Reference', 'DerivedTransaction', 'SimplePosition')")
55
55
  return value
56
56
 
57
57
  class Config:
@@ -18,11 +18,12 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
 
21
- from typing import Any, Dict, List, Optional
22
- from pydantic.v1 import Field, StrictBool, StrictStr, conlist, constr, validator
21
+ from typing import Any, Dict, List, Optional, Union
22
+ from pydantic.v1 import Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist, constr, validator
23
23
  from lusid.models.lusid_instrument import LusidInstrument
24
24
  from lusid.models.rounding_convention import RoundingConvention
25
25
  from lusid.models.schedule import Schedule
26
+ from lusid.models.trading_conventions import TradingConventions
26
27
 
27
28
  class ComplexBond(LusidInstrument):
28
29
  """
@@ -31,18 +32,20 @@ class ComplexBond(LusidInstrument):
31
32
  identifiers: Optional[Dict[str, StrictStr]] = Field(None, description="External market codes and identifiers for the bond, e.g. ISIN.")
32
33
  calculation_type: Optional[constr(strict=True, max_length=50, min_length=0)] = Field(None, alias="calculationType", description="The calculation type applied to the bond coupon amount. This is required for bonds that have a particular type of computing the period coupon, such as simple compounding, irregular coupons etc. The default CalculationType is `Standard`, which returns a coupon amount equal to Principal * Coupon Rate / Coupon Frequency. Coupon Frequency is 12M / Payment Frequency. Payment Frequency can be 1M, 3M, 6M, 12M etc. So Coupon Frequency can be 12, 4, 2, 1 respectively. Supported string (enumeration) values are: [Standard, DayCountCoupon, NoCalculationFloater, BrazilFixedCoupon, StandardWithCappedAccruedInterest].")
33
34
  schedules: Optional[conlist(Schedule)] = Field(None, description="schedules.")
35
+ original_issue_price: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="originalIssuePrice", description="The price the complex bond was issued at. This is to be entered as a percentage of par, for example a value of 98.5 would represent 98.5%.")
34
36
  rounding_conventions: Optional[conlist(RoundingConvention)] = Field(None, alias="roundingConventions", description="Rounding conventions for analytics, if any.")
35
37
  asset_backed: Optional[StrictBool] = Field(None, alias="assetBacked", description="If this flag is set to true, then the outstanding notional and principal repayments will be calculated based on pool factors in the quote store. Usually AssetBacked bonds also require a RollConvention setting of within the FlowConventions any given rates schedule (to ensure payment dates always happen on the same day of the month) and US Agency MBSs with Pay Delay features also require their rates schedules to include an ExDividendConfiguration to drive the lag between interest accrual and payment.")
36
38
  asset_pool_identifier: Optional[constr(strict=True, max_length=50, min_length=0)] = Field(None, alias="assetPoolIdentifier", description="Identifier used to retrieve pool factor information about this bond from the quote store. This is typically the bond's ISIN, but can also be ClientInternal. Please ensure you align the MarketDataKeyRule with the correct Quote (Quote.ClientInternal.* or Quote.Isin.*)")
37
- instrument_type: StrictStr = Field(..., alias="instrumentType", description="The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashFlowsLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CapFloor, CashSettled, CdsIndex, Basket, FundingLeg, FxSwap, ForwardRateAgreement, SimpleInstrument, Repo, Equity, ExchangeTradedOption, ReferenceInstrument, ComplexBond, InflationLinkedBond, InflationSwap, SimpleCashFlowLoan, TotalReturnSwap, InflationLeg, FundShareClass, FlexibleLoan, UnsettledCash, Cash, MasteredInstrument, LoanFacility")
39
+ trading_conventions: Optional[TradingConventions] = Field(None, alias="tradingConventions")
40
+ instrument_type: StrictStr = Field(..., alias="instrumentType", description="The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashFlowsLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CapFloor, CashSettled, CdsIndex, Basket, FundingLeg, FxSwap, ForwardRateAgreement, SimpleInstrument, Repo, Equity, ExchangeTradedOption, ReferenceInstrument, ComplexBond, InflationLinkedBond, InflationSwap, SimpleCashFlowLoan, TotalReturnSwap, InflationLeg, FundShareClass, FlexibleLoan, UnsettledCash, Cash, MasteredInstrument, LoanFacility, FlexibleDeposit")
38
41
  additional_properties: Dict[str, Any] = {}
39
- __properties = ["instrumentType", "identifiers", "calculationType", "schedules", "roundingConventions", "assetBacked", "assetPoolIdentifier"]
42
+ __properties = ["instrumentType", "identifiers", "calculationType", "schedules", "originalIssuePrice", "roundingConventions", "assetBacked", "assetPoolIdentifier", "tradingConventions"]
40
43
 
41
44
  @validator('instrument_type')
42
45
  def instrument_type_validate_enum(cls, value):
43
46
  """Validates the enum"""
44
- if value not in ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility'):
45
- raise ValueError("must be one of enum values ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility')")
47
+ if value not in ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility', 'FlexibleDeposit'):
48
+ raise ValueError("must be one of enum values ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility', 'FlexibleDeposit')")
46
49
  return value
47
50
 
48
51
  class Config:
@@ -84,6 +87,9 @@ class ComplexBond(LusidInstrument):
84
87
  if _item:
85
88
  _items.append(_item.to_dict())
86
89
  _dict['roundingConventions'] = _items
90
+ # override the default output from pydantic by calling `to_dict()` of trading_conventions
91
+ if self.trading_conventions:
92
+ _dict['tradingConventions'] = self.trading_conventions.to_dict()
87
93
  # puts key-value pairs in additional_properties in the top level
88
94
  if self.additional_properties is not None:
89
95
  for _key, _value in self.additional_properties.items():
@@ -104,6 +110,11 @@ class ComplexBond(LusidInstrument):
104
110
  if self.schedules is None and "schedules" in self.__fields_set__:
105
111
  _dict['schedules'] = None
106
112
 
113
+ # set to None if original_issue_price (nullable) is None
114
+ # and __fields_set__ contains the field
115
+ if self.original_issue_price is None and "original_issue_price" in self.__fields_set__:
116
+ _dict['originalIssuePrice'] = None
117
+
107
118
  # set to None if rounding_conventions (nullable) is None
108
119
  # and __fields_set__ contains the field
109
120
  if self.rounding_conventions is None and "rounding_conventions" in self.__fields_set__:
@@ -135,9 +146,11 @@ class ComplexBond(LusidInstrument):
135
146
  "identifiers": obj.get("identifiers"),
136
147
  "calculation_type": obj.get("calculationType"),
137
148
  "schedules": [Schedule.from_dict(_item) for _item in obj.get("schedules")] if obj.get("schedules") is not None else None,
149
+ "original_issue_price": obj.get("originalIssuePrice"),
138
150
  "rounding_conventions": [RoundingConvention.from_dict(_item) for _item in obj.get("roundingConventions")] if obj.get("roundingConventions") is not None else None,
139
151
  "asset_backed": obj.get("assetBacked"),
140
- "asset_pool_identifier": obj.get("assetPoolIdentifier")
152
+ "asset_pool_identifier": obj.get("assetPoolIdentifier"),
153
+ "trading_conventions": TradingConventions.from_dict(obj.get("tradingConventions")) if obj.get("tradingConventions") is not None else None
141
154
  })
142
155
  # store additional fields in additional_properties
143
156
  for _key in obj.keys():
@@ -0,0 +1,101 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LUSID API
5
+
6
+ FINBOURNE Technology # noqa: E501
7
+
8
+ Contact: info@finbourne.com
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+
21
+ from typing import Any, Dict, Optional
22
+ from pydantic.v1 import BaseModel, Field, StrictStr
23
+
24
+ class ContractDetails(BaseModel):
25
+ """
26
+ Set of identifiers of an existing FlexibleLoan contract. # noqa: E501
27
+ """
28
+ identifiers: Dict[str, StrictStr] = Field(..., description="Unique instrument identifiers.")
29
+ lusid_instrument_id: Optional[StrictStr] = Field(None, alias="lusidInstrumentId", description="LUSID's internal unique instrument identifier - readonly field, resolved from the instrument identifiers.")
30
+ instrument_scope: Optional[StrictStr] = Field(None, alias="instrumentScope", description="The scope in which the FlexibleLoan instrument lies - readonly field, resolved from the instrument identifiers.")
31
+ instrument_name: Optional[StrictStr] = Field(None, alias="instrumentName", description="The name of the FlexibleLoan instrument - readonly field, resolved from the instrument identifiers.")
32
+ dom_ccy: Optional[StrictStr] = Field(None, alias="domCcy", description="The domestic currency of the instrument - readonly field, resolved from the instrument identifiers.")
33
+ __properties = ["identifiers", "lusidInstrumentId", "instrumentScope", "instrumentName", "domCcy"]
34
+
35
+ class Config:
36
+ """Pydantic configuration"""
37
+ allow_population_by_field_name = True
38
+ validate_assignment = True
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.dict(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> ContractDetails:
50
+ """Create an instance of ContractDetails from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self):
54
+ """Returns the dictionary representation of the model using alias"""
55
+ _dict = self.dict(by_alias=True,
56
+ exclude={
57
+ "lusid_instrument_id",
58
+ "instrument_scope",
59
+ "instrument_name",
60
+ "dom_ccy",
61
+ },
62
+ exclude_none=True)
63
+ # set to None if lusid_instrument_id (nullable) is None
64
+ # and __fields_set__ contains the field
65
+ if self.lusid_instrument_id is None and "lusid_instrument_id" in self.__fields_set__:
66
+ _dict['lusidInstrumentId'] = None
67
+
68
+ # set to None if instrument_scope (nullable) is None
69
+ # and __fields_set__ contains the field
70
+ if self.instrument_scope is None and "instrument_scope" in self.__fields_set__:
71
+ _dict['instrumentScope'] = None
72
+
73
+ # set to None if instrument_name (nullable) is None
74
+ # and __fields_set__ contains the field
75
+ if self.instrument_name is None and "instrument_name" in self.__fields_set__:
76
+ _dict['instrumentName'] = None
77
+
78
+ # set to None if dom_ccy (nullable) is None
79
+ # and __fields_set__ contains the field
80
+ if self.dom_ccy is None and "dom_ccy" in self.__fields_set__:
81
+ _dict['domCcy'] = None
82
+
83
+ return _dict
84
+
85
+ @classmethod
86
+ def from_dict(cls, obj: dict) -> ContractDetails:
87
+ """Create an instance of ContractDetails from a dict"""
88
+ if obj is None:
89
+ return None
90
+
91
+ if not isinstance(obj, dict):
92
+ return ContractDetails.parse_obj(obj)
93
+
94
+ _obj = ContractDetails.parse_obj({
95
+ "identifiers": obj.get("identifiers"),
96
+ "lusid_instrument_id": obj.get("lusidInstrumentId"),
97
+ "instrument_scope": obj.get("instrumentScope"),
98
+ "instrument_name": obj.get("instrumentName"),
99
+ "dom_ccy": obj.get("domCcy")
100
+ })
101
+ return _obj
@@ -36,15 +36,15 @@ class ContractForDifference(LusidInstrument):
36
36
  underlying_ccy: StrictStr = Field(..., alias="underlyingCcy", description="The currency of the underlying")
37
37
  underlying_identifier: constr(strict=True, min_length=1) = Field(..., alias="underlyingIdentifier", description="External market codes and identifiers for the CFD, e.g. RIC. Supported string (enumeration) values are: [LusidInstrumentId, Isin, Sedol, Cusip, ClientInternal, Figi, RIC, QuotePermId, REDCode, BBGId, ICECode].")
38
38
  lot_size: Optional[StrictInt] = Field(None, alias="lotSize", description="CFD LotSize, the minimum number of shares that can be bought or sold at once. Optional, if set must be non-negative, if not set defaults to 1.")
39
- instrument_type: StrictStr = Field(..., alias="instrumentType", description="The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashFlowsLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CapFloor, CashSettled, CdsIndex, Basket, FundingLeg, FxSwap, ForwardRateAgreement, SimpleInstrument, Repo, Equity, ExchangeTradedOption, ReferenceInstrument, ComplexBond, InflationLinkedBond, InflationSwap, SimpleCashFlowLoan, TotalReturnSwap, InflationLeg, FundShareClass, FlexibleLoan, UnsettledCash, Cash, MasteredInstrument, LoanFacility")
39
+ instrument_type: StrictStr = Field(..., alias="instrumentType", description="The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashFlowsLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CapFloor, CashSettled, CdsIndex, Basket, FundingLeg, FxSwap, ForwardRateAgreement, SimpleInstrument, Repo, Equity, ExchangeTradedOption, ReferenceInstrument, ComplexBond, InflationLinkedBond, InflationSwap, SimpleCashFlowLoan, TotalReturnSwap, InflationLeg, FundShareClass, FlexibleLoan, UnsettledCash, Cash, MasteredInstrument, LoanFacility, FlexibleDeposit")
40
40
  additional_properties: Dict[str, Any] = {}
41
41
  __properties = ["instrumentType", "startDate", "maturityDate", "code", "contractSize", "payCcy", "referenceRate", "type", "underlyingCcy", "underlyingIdentifier", "lotSize"]
42
42
 
43
43
  @validator('instrument_type')
44
44
  def instrument_type_validate_enum(cls, value):
45
45
  """Validates the enum"""
46
- if value not in ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility'):
47
- raise ValueError("must be one of enum values ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility')")
46
+ if value not in ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility', 'FlexibleDeposit'):
47
+ raise ValueError("must be one of enum values ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility', 'FlexibleDeposit')")
48
48
  return value
49
49
 
50
50
  class Config:
@@ -0,0 +1,99 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LUSID API
5
+
6
+ FINBOURNE Technology # noqa: E501
7
+
8
+ Contact: info@finbourne.com
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from typing import Any, Dict, Union
22
+ from pydantic.v1 import Field, StrictFloat, StrictInt, StrictStr, validator
23
+ from lusid.models.contract_details import ContractDetails
24
+ from lusid.models.instrument_event import InstrumentEvent
25
+
26
+ class ContractInitialisationEvent(InstrumentEvent):
27
+ """
28
+ Event to initialise a contract with a given limit against a LoanFacility. # noqa: E501
29
+ """
30
+ limit: Union[StrictFloat, StrictInt] = Field(..., description="Limit of this contract. Must be positive.")
31
+ var_date: datetime = Field(..., alias="date", description="Initialisation date of the contract.")
32
+ contract_details: ContractDetails = Field(..., alias="contractDetails")
33
+ instrument_event_type: StrictStr = Field(..., alias="instrumentEventType", description="The Type of Event. The available values are: TransitionEvent, InformationalEvent, OpenEvent, CloseEvent, StockSplitEvent, BondDefaultEvent, CashDividendEvent, AmortisationEvent, CashFlowEvent, ExerciseEvent, ResetEvent, TriggerEvent, RawVendorEvent, InformationalErrorEvent, BondCouponEvent, DividendReinvestmentEvent, AccumulationEvent, BondPrincipalEvent, DividendOptionEvent, MaturityEvent, FxForwardSettlementEvent, ExpiryEvent, ScripDividendEvent, StockDividendEvent, ReverseStockSplitEvent, CapitalDistributionEvent, SpinOffEvent, MergerEvent, FutureExpiryEvent, SwapCashFlowEvent, SwapPrincipalEvent, CreditPremiumCashFlowEvent, CdsCreditEvent, CdxCreditEvent, MbsCouponEvent, MbsPrincipalEvent, BonusIssueEvent, MbsPrincipalWriteOffEvent, MbsInterestDeferralEvent, MbsInterestShortfallEvent, TenderEvent, CallOnIntermediateSecuritiesEvent, IntermediateSecuritiesDistributionEvent, OptionExercisePhysicalEvent, OptionExerciseCashEvent, ProtectionPayoutCashFlowEvent, TermDepositInterestEvent, TermDepositPrincipalEvent, EarlyRedemptionEvent, FutureMarkToMarketEvent, AdjustGlobalCommitmentEvent, ContractInitialisationEvent, DrawdownEvent, LoanInterestRepaymentEvent")
34
+ additional_properties: Dict[str, Any] = {}
35
+ __properties = ["instrumentEventType", "limit", "date", "contractDetails"]
36
+
37
+ @validator('instrument_event_type')
38
+ def instrument_event_type_validate_enum(cls, value):
39
+ """Validates the enum"""
40
+ if value not in ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent', 'TermDepositInterestEvent', 'TermDepositPrincipalEvent', 'EarlyRedemptionEvent', 'FutureMarkToMarketEvent', 'AdjustGlobalCommitmentEvent', 'ContractInitialisationEvent', 'DrawdownEvent', 'LoanInterestRepaymentEvent'):
41
+ raise ValueError("must be one of enum values ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent', 'TermDepositInterestEvent', 'TermDepositPrincipalEvent', 'EarlyRedemptionEvent', 'FutureMarkToMarketEvent', 'AdjustGlobalCommitmentEvent', 'ContractInitialisationEvent', 'DrawdownEvent', 'LoanInterestRepaymentEvent')")
42
+ return value
43
+
44
+ class Config:
45
+ """Pydantic configuration"""
46
+ allow_population_by_field_name = True
47
+ validate_assignment = True
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.dict(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> ContractInitialisationEvent:
59
+ """Create an instance of ContractInitialisationEvent from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self):
63
+ """Returns the dictionary representation of the model using alias"""
64
+ _dict = self.dict(by_alias=True,
65
+ exclude={
66
+ "additional_properties"
67
+ },
68
+ exclude_none=True)
69
+ # override the default output from pydantic by calling `to_dict()` of contract_details
70
+ if self.contract_details:
71
+ _dict['contractDetails'] = self.contract_details.to_dict()
72
+ # puts key-value pairs in additional_properties in the top level
73
+ if self.additional_properties is not None:
74
+ for _key, _value in self.additional_properties.items():
75
+ _dict[_key] = _value
76
+
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: dict) -> ContractInitialisationEvent:
81
+ """Create an instance of ContractInitialisationEvent from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return ContractInitialisationEvent.parse_obj(obj)
87
+
88
+ _obj = ContractInitialisationEvent.parse_obj({
89
+ "instrument_event_type": obj.get("instrumentEventType"),
90
+ "limit": obj.get("limit"),
91
+ "var_date": obj.get("date"),
92
+ "contract_details": ContractDetails.from_dict(obj.get("contractDetails")) if obj.get("contractDetails") is not None else None
93
+ })
94
+ # store additional fields in additional_properties
95
+ for _key in obj.keys():
96
+ if _key not in cls.__properties:
97
+ _obj.additional_properties[_key] = obj.get(_key)
98
+
99
+ return _obj