lusid-sdk 2.1.149__py3-none-any.whl → 2.1.191__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.

Potentially problematic release.


This version of lusid-sdk might be problematic. Click here for more details.

Files changed (72) hide show
  1. lusid/__init__.py +14 -0
  2. lusid/api/amortisation_rule_sets_api.py +1 -1
  3. lusid/api/chart_of_accounts_api.py +365 -0
  4. lusid/api/entities_api.py +18 -9
  5. lusid/api/fee_types_api.py +1 -1
  6. lusid/api/funds_api.py +259 -76
  7. lusid/api/relations_api.py +1 -1
  8. lusid/configuration.py +1 -1
  9. lusid/models/__init__.py +14 -0
  10. lusid/models/accumulation_event.py +3 -3
  11. lusid/models/amortisation_event.py +3 -3
  12. lusid/models/applicable_instrument_event.py +9 -4
  13. lusid/models/bond_conversion_entry.py +75 -0
  14. lusid/models/bond_conversion_schedule.py +130 -0
  15. lusid/models/bond_coupon_event.py +3 -3
  16. lusid/models/bond_default_event.py +3 -3
  17. lusid/models/bond_principal_event.py +3 -3
  18. lusid/models/capital_distribution_event.py +3 -3
  19. lusid/models/cash_and_security_offer_election.py +90 -0
  20. lusid/models/cash_dividend_event.py +3 -3
  21. lusid/models/cash_flow_event.py +3 -3
  22. lusid/models/cash_offer_election.py +77 -0
  23. lusid/models/close_event.py +3 -3
  24. lusid/models/create_derived_property_definition_request.py +3 -3
  25. lusid/models/create_property_definition_request.py +3 -3
  26. lusid/models/dividend_option_event.py +3 -3
  27. lusid/models/dividend_reinvestment_event.py +3 -3
  28. lusid/models/exercise_event.py +3 -3
  29. lusid/models/expiry_event.py +3 -3
  30. lusid/models/fee.py +3 -3
  31. lusid/models/fee_accrual.py +4 -2
  32. lusid/models/fee_properties.py +115 -0
  33. lusid/models/fee_request.py +3 -3
  34. lusid/models/fixed_schedule.py +3 -3
  35. lusid/models/float_schedule.py +8 -6
  36. lusid/models/fx_forward_settlement_event.py +3 -3
  37. lusid/models/fx_linked_notional_schedule.py +3 -3
  38. lusid/models/fx_rate_schedule.py +3 -3
  39. lusid/models/group_filter_step.py +2 -11
  40. lusid/models/informational_error_event.py +3 -3
  41. lusid/models/informational_event.py +3 -3
  42. lusid/models/instrument_event.py +6 -5
  43. lusid/models/instrument_event_type.py +1 -0
  44. lusid/models/journal_entry_lines_query_parameters.py +1 -1
  45. lusid/models/maturity_event.py +3 -3
  46. lusid/models/merger_event.py +172 -0
  47. lusid/models/open_event.py +3 -3
  48. lusid/models/optionality_schedule.py +3 -3
  49. lusid/models/portfolio_entity.py +13 -1
  50. lusid/models/portfolio_properties.py +7 -1
  51. lusid/models/property_definition.py +3 -3
  52. lusid/models/property_definition_search_result.py +3 -3
  53. lusid/models/property_domain.py +1 -0
  54. lusid/models/raw_vendor_event.py +3 -3
  55. lusid/models/reset_event.py +3 -3
  56. lusid/models/reverse_stock_split_event.py +3 -3
  57. lusid/models/schedule.py +6 -5
  58. lusid/models/schedule_type.py +1 -0
  59. lusid/models/scrip_dividend_event.py +3 -3
  60. lusid/models/security_offer_election.py +79 -0
  61. lusid/models/spin_off_event.py +3 -3
  62. lusid/models/step_schedule.py +3 -3
  63. lusid/models/stock_dividend_event.py +3 -3
  64. lusid/models/stock_split_event.py +3 -3
  65. lusid/models/transaction_type_calculation.py +11 -3
  66. lusid/models/transition_event.py +3 -3
  67. lusid/models/trial_balance_query_parameters.py +1 -1
  68. lusid/models/trigger_event.py +3 -3
  69. lusid/models/upsert_valuation_point_request.py +2 -15
  70. {lusid_sdk-2.1.149.dist-info → lusid_sdk-2.1.191.dist-info}/METADATA +17 -7
  71. {lusid_sdk-2.1.149.dist-info → lusid_sdk-2.1.191.dist-info}/RECORD +72 -65
  72. {lusid_sdk-2.1.149.dist-info → lusid_sdk-2.1.191.dist-info}/WHEEL +0 -0
@@ -210,7 +210,7 @@ class RelationsApi:
210
210
  _auth_settings = ['oauth2'] # noqa: E501
211
211
 
212
212
  _response_types_map = {
213
- '200': "CompleteRelation",
213
+ '201': "CompleteRelation",
214
214
  '400': "LusidValidationProblemDetails",
215
215
  }
216
216
 
lusid/configuration.py CHANGED
@@ -373,7 +373,7 @@ class Configuration:
373
373
  return "Python SDK Debug Report:\n"\
374
374
  "OS: {env}\n"\
375
375
  "Python Version: {pyversion}\n"\
376
- "Version of the API: 0.11.6583\n"\
376
+ "Version of the API: 0.11.6625\n"\
377
377
  "SDK Package Version: {package_version}".\
378
378
  format(env=sys.platform, pyversion=sys.version, package_version=package_version)
379
379
 
lusid/models/__init__.py CHANGED
@@ -88,6 +88,8 @@ from lusid.models.block_request import BlockRequest
88
88
  from lusid.models.block_set_request import BlockSetRequest
89
89
  from lusid.models.blocked_order_request import BlockedOrderRequest
90
90
  from lusid.models.bond import Bond
91
+ from lusid.models.bond_conversion_entry import BondConversionEntry
92
+ from lusid.models.bond_conversion_schedule import BondConversionSchedule
91
93
  from lusid.models.bond_coupon_event import BondCouponEvent
92
94
  from lusid.models.bond_default_event import BondDefaultEvent
93
95
  from lusid.models.bond_principal_event import BondPrincipalEvent
@@ -106,6 +108,7 @@ from lusid.models.calendar_date import CalendarDate
106
108
  from lusid.models.calendar_dependency import CalendarDependency
107
109
  from lusid.models.cap_floor import CapFloor
108
110
  from lusid.models.capital_distribution_event import CapitalDistributionEvent
111
+ from lusid.models.cash_and_security_offer_election import CashAndSecurityOfferElection
109
112
  from lusid.models.cash_dependency import CashDependency
110
113
  from lusid.models.cash_dividend_event import CashDividendEvent
111
114
  from lusid.models.cash_election import CashElection
@@ -114,6 +117,7 @@ from lusid.models.cash_flow_lineage import CashFlowLineage
114
117
  from lusid.models.cash_flow_value import CashFlowValue
115
118
  from lusid.models.cash_flow_value_set import CashFlowValueSet
116
119
  from lusid.models.cash_ladder_record import CashLadderRecord
120
+ from lusid.models.cash_offer_election import CashOfferElection
117
121
  from lusid.models.cash_perpetual import CashPerpetual
118
122
  from lusid.models.cds_flow_conventions import CdsFlowConventions
119
123
  from lusid.models.cds_index import CdsIndex
@@ -308,6 +312,7 @@ from lusid.models.expanded_group import ExpandedGroup
308
312
  from lusid.models.expiry_event import ExpiryEvent
309
313
  from lusid.models.fee import Fee
310
314
  from lusid.models.fee_accrual import FeeAccrual
315
+ from lusid.models.fee_properties import FeeProperties
311
316
  from lusid.models.fee_request import FeeRequest
312
317
  from lusid.models.fee_rule import FeeRule
313
318
  from lusid.models.fee_rule_upsert_request import FeeRuleUpsertRequest
@@ -475,6 +480,7 @@ from lusid.models.market_options import MarketOptions
475
480
  from lusid.models.market_quote import MarketQuote
476
481
  from lusid.models.match_criterion import MatchCriterion
477
482
  from lusid.models.maturity_event import MaturityEvent
483
+ from lusid.models.merger_event import MergerEvent
478
484
  from lusid.models.metric_value import MetricValue
479
485
  from lusid.models.model_options import ModelOptions
480
486
  from lusid.models.model_options_type import ModelOptionsType
@@ -803,6 +809,7 @@ from lusid.models.scope_definition import ScopeDefinition
803
809
  from lusid.models.scrip_dividend_event import ScripDividendEvent
804
810
  from lusid.models.script_map_reference import ScriptMapReference
805
811
  from lusid.models.security_election import SecurityElection
812
+ from lusid.models.security_offer_election import SecurityOfferElection
806
813
  from lusid.models.sequence_definition import SequenceDefinition
807
814
  from lusid.models.set_amortisation_rules_request import SetAmortisationRulesRequest
808
815
  from lusid.models.set_legal_entity_identifiers_request import SetLegalEntityIdentifiersRequest
@@ -1076,6 +1083,8 @@ __all__ = [
1076
1083
  "BlockSetRequest",
1077
1084
  "BlockedOrderRequest",
1078
1085
  "Bond",
1086
+ "BondConversionEntry",
1087
+ "BondConversionSchedule",
1079
1088
  "BondCouponEvent",
1080
1089
  "BondDefaultEvent",
1081
1090
  "BondPrincipalEvent",
@@ -1094,6 +1103,7 @@ __all__ = [
1094
1103
  "CalendarDependency",
1095
1104
  "CapFloor",
1096
1105
  "CapitalDistributionEvent",
1106
+ "CashAndSecurityOfferElection",
1097
1107
  "CashDependency",
1098
1108
  "CashDividendEvent",
1099
1109
  "CashElection",
@@ -1102,6 +1112,7 @@ __all__ = [
1102
1112
  "CashFlowValue",
1103
1113
  "CashFlowValueSet",
1104
1114
  "CashLadderRecord",
1115
+ "CashOfferElection",
1105
1116
  "CashPerpetual",
1106
1117
  "CdsFlowConventions",
1107
1118
  "CdsIndex",
@@ -1296,6 +1307,7 @@ __all__ = [
1296
1307
  "ExpiryEvent",
1297
1308
  "Fee",
1298
1309
  "FeeAccrual",
1310
+ "FeeProperties",
1299
1311
  "FeeRequest",
1300
1312
  "FeeRule",
1301
1313
  "FeeRuleUpsertRequest",
@@ -1463,6 +1475,7 @@ __all__ = [
1463
1475
  "MarketQuote",
1464
1476
  "MatchCriterion",
1465
1477
  "MaturityEvent",
1478
+ "MergerEvent",
1466
1479
  "MetricValue",
1467
1480
  "ModelOptions",
1468
1481
  "ModelOptionsType",
@@ -1791,6 +1804,7 @@ __all__ = [
1791
1804
  "ScripDividendEvent",
1792
1805
  "ScriptMapReference",
1793
1806
  "SecurityElection",
1807
+ "SecurityOfferElection",
1794
1808
  "SequenceDefinition",
1795
1809
  "SetAmortisationRulesRequest",
1796
1810
  "SetLegalEntityIdentifiersRequest",
@@ -31,15 +31,15 @@ class AccumulationEvent(InstrumentEvent):
31
31
  dividend_rate: Union[StrictFloat, StrictInt] = Field(..., alias="dividendRate", description="Dividend rate or payment rate as a percentage. i.e. 5% is written as 0.05")
32
32
  ex_date: datetime = Field(..., alias="exDate", description="The first business day on which the dividend is not owed to the buying party. Typically this is T-1 from the RecordDate.")
33
33
  payment_date: datetime = Field(..., alias="paymentDate", description="The date the company pays out dividends to shareholders.")
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")
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")
35
35
  additional_properties: Dict[str, Any] = {}
36
36
  __properties = ["instrumentEventType", "announcementDate", "dividendCurrency", "dividendRate", "exDate", "paymentDate"]
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'):
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')")
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'):
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')")
43
43
  return value
44
44
 
45
45
  class Config:
@@ -30,15 +30,15 @@ class AmortisationEvent(InstrumentEvent):
30
30
  dom_ccy: StrictStr = Field(..., alias="domCcy", description="Domestic currency of the originating instrument")
31
31
  pay_receive: constr(strict=True, min_length=1) = Field(..., alias="payReceive", description="Is this event in relation to the Pay or Receive leg")
32
32
  payment_date: datetime = Field(..., alias="paymentDate", description="The date the principal payment is to be made.")
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")
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")
34
34
  additional_properties: Dict[str, Any] = {}
35
35
  __properties = ["instrumentEventType", "amountReduced", "domCcy", "payReceive", "paymentDate"]
36
36
 
37
37
  @validator('instrument_event_type')
38
38
  def instrument_event_type_validate_enum(cls, value):
39
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'):
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')")
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'):
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')")
42
42
  return value
43
43
 
44
44
  class Config:
@@ -18,7 +18,7 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
 
21
- from typing import Any, Dict, List
21
+ from typing import Any, Dict, List, Optional
22
22
  from pydantic.v1 import BaseModel, Field, StrictInt, conlist, constr
23
23
  from lusid.models.instrument_event_holder import InstrumentEventHolder
24
24
  from lusid.models.resource_id import ResourceId
@@ -35,10 +35,10 @@ class ApplicableInstrumentEvent(BaseModel):
35
35
  instrument_type: constr(strict=True, min_length=1) = Field(..., alias="instrumentType")
36
36
  instrument_event_type: constr(strict=True, min_length=1) = Field(..., alias="instrumentEventType")
37
37
  instrument_event_id: constr(strict=True, min_length=1) = Field(..., alias="instrumentEventId")
38
- generated_event: InstrumentEventHolder = Field(..., alias="generatedEvent")
39
- loaded_event: InstrumentEventHolder = Field(..., alias="loadedEvent")
38
+ generated_event: Optional[InstrumentEventHolder] = Field(None, alias="generatedEvent")
39
+ loaded_event: Optional[InstrumentEventHolder] = Field(None, alias="loadedEvent")
40
40
  applied_instrument_event_instruction_id: constr(strict=True, min_length=1) = Field(..., alias="appliedInstrumentEventInstructionId")
41
- transactions: conlist(Transaction) = Field(...)
41
+ transactions: Optional[conlist(Transaction)] = None
42
42
  __properties = ["portfolioId", "holdingId", "lusidInstrumentId", "instrumentScope", "instrumentType", "instrumentEventType", "instrumentEventId", "generatedEvent", "loadedEvent", "appliedInstrumentEventInstructionId", "transactions"]
43
43
 
44
44
  class Config:
@@ -81,6 +81,11 @@ class ApplicableInstrumentEvent(BaseModel):
81
81
  if _item:
82
82
  _items.append(_item.to_dict())
83
83
  _dict['transactions'] = _items
84
+ # set to None if transactions (nullable) is None
85
+ # and __fields_set__ contains the field
86
+ if self.transactions is None and "transactions" in self.__fields_set__:
87
+ _dict['transactions'] = None
88
+
84
89
  return _dict
85
90
 
86
91
  @classmethod
@@ -0,0 +1,75 @@
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, Optional, Union
22
+ from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt
23
+
24
+ class BondConversionEntry(BaseModel):
25
+ """
26
+ Information required to specify a conversion event for a convertible bond. # noqa: E501
27
+ """
28
+ var_date: Optional[datetime] = Field(None, alias="date", description="The date at which the bond can be converted")
29
+ denomination: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The number of shares to be issued on conversion will be equal to the denomination of the bond divided by the conversion price. Two (and only two) entries out of (Price, Ratio, Denomination) must be provided. So, to allow one entry out of the three to not be provided, we make all the three nullable defaulting to zero and during validation we check if there is exactly one of the three equal to zero.")
30
+ price: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The conversion price Two (and only two) entries out of (Price, Ratio, Denomination) must be provided. So, to allow one entry out of the three to not be provided, we make all the three nullable defaulting to zero and during validation we check if there is exactly one of the three equal to zero.")
31
+ ratio: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The number of common shares received at the time of conversion for each convertible bond Two (and only two) entries out of (Price, Ratio, Denomination) must be provided. So, to allow one entry out of the three to not be provided, we make all the three nullable defaulting to zero and during validation we check if there is exactly one of the three equal to zero.")
32
+ __properties = ["date", "denomination", "price", "ratio"]
33
+
34
+ class Config:
35
+ """Pydantic configuration"""
36
+ allow_population_by_field_name = True
37
+ validate_assignment = True
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.dict(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ return json.dumps(self.to_dict())
46
+
47
+ @classmethod
48
+ def from_json(cls, json_str: str) -> BondConversionEntry:
49
+ """Create an instance of BondConversionEntry from a JSON string"""
50
+ return cls.from_dict(json.loads(json_str))
51
+
52
+ def to_dict(self):
53
+ """Returns the dictionary representation of the model using alias"""
54
+ _dict = self.dict(by_alias=True,
55
+ exclude={
56
+ },
57
+ exclude_none=True)
58
+ return _dict
59
+
60
+ @classmethod
61
+ def from_dict(cls, obj: dict) -> BondConversionEntry:
62
+ """Create an instance of BondConversionEntry from a dict"""
63
+ if obj is None:
64
+ return None
65
+
66
+ if not isinstance(obj, dict):
67
+ return BondConversionEntry.parse_obj(obj)
68
+
69
+ _obj = BondConversionEntry.parse_obj({
70
+ "var_date": obj.get("date"),
71
+ "denomination": obj.get("denomination"),
72
+ "price": obj.get("price"),
73
+ "ratio": obj.get("ratio")
74
+ })
75
+ return _obj
@@ -0,0 +1,130 @@
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 Field, StrictBool, StrictStr, conlist, constr, validator
23
+ from lusid.models.bond_conversion_entry import BondConversionEntry
24
+ from lusid.models.schedule import Schedule
25
+
26
+ class BondConversionSchedule(Schedule):
27
+ """
28
+ A BondConversionSchedule object represents a class containing the information required for the creation of convertible features in a ComplexBond # noqa: E501
29
+ """
30
+ identifiers: Optional[Dict[str, StrictStr]] = Field(None, description="The market identifier(s) of the share that the bond converts to. The instrument will not fail validation if no identifier is supplied.")
31
+ bond_conversion_entries: Optional[conlist(BondConversionEntry)] = Field(None, alias="bondConversionEntries", description="The dates at which the bond may be converted and associated information required about the conversion.")
32
+ conversion_trigger: constr(strict=True, max_length=50, min_length=0) = Field(..., alias="conversionTrigger", description="Corporate event that triggers a conversion Supported string (enumeration) values are: [NextEquityFinancing, IpoConversion, KnownDates, SoftCall].")
33
+ delivery_type: Optional[constr(strict=True, max_length=50, min_length=0)] = Field(None, alias="deliveryType", description="Is a conversion made into cash or into shares? Supported string (enumeration) values are: [Cash, Physical].")
34
+ exercise_type: constr(strict=True, max_length=50, min_length=0) = Field(..., alias="exerciseType", description="The exercise type of the conversion schedule (American or European). For American type, the bond is convertible from a given exercise date until the next date in the schedule, or until it matures. For European type, the bond is only convertible on the given exercise date. Supported string (enumeration) values are: [European, Bermudan, American].")
35
+ includes_accrued: Optional[StrictBool] = Field(None, alias="includesAccrued", description="Set this to true if a accrued interest is included in the conversion. Defaults to true.")
36
+ mandatory_conversion: Optional[StrictBool] = Field(None, alias="mandatoryConversion", description="Set this to true if a conversion is mandatory if the trigger occurs. Defaults to false.")
37
+ notification_period_end: Optional[datetime] = Field(None, alias="notificationPeriodEnd", description="The last day in the notification period for the conversion of the bond")
38
+ notification_period_start: Optional[datetime] = Field(None, alias="notificationPeriodStart", description="The first day in the notification period for the conversion of the bond")
39
+ schedule_type: StrictStr = Field(..., alias="scheduleType", description="The available values are: FixedSchedule, FloatSchedule, OptionalitySchedule, StepSchedule, Exercise, FxRateSchedule, FxLinkedNotionalSchedule, BondConversionSchedule, Invalid")
40
+ additional_properties: Dict[str, Any] = {}
41
+ __properties = ["scheduleType", "identifiers", "bondConversionEntries", "conversionTrigger", "deliveryType", "exerciseType", "includesAccrued", "mandatoryConversion", "notificationPeriodEnd", "notificationPeriodStart"]
42
+
43
+ @validator('schedule_type')
44
+ def schedule_type_validate_enum(cls, value):
45
+ """Validates the enum"""
46
+ if value not in ('FixedSchedule', 'FloatSchedule', 'OptionalitySchedule', 'StepSchedule', 'Exercise', 'FxRateSchedule', 'FxLinkedNotionalSchedule', 'BondConversionSchedule', 'Invalid'):
47
+ raise ValueError("must be one of enum values ('FixedSchedule', 'FloatSchedule', 'OptionalitySchedule', 'StepSchedule', 'Exercise', 'FxRateSchedule', 'FxLinkedNotionalSchedule', 'BondConversionSchedule', 'Invalid')")
48
+ return value
49
+
50
+ class Config:
51
+ """Pydantic configuration"""
52
+ allow_population_by_field_name = True
53
+ validate_assignment = True
54
+
55
+ def to_str(self) -> str:
56
+ """Returns the string representation of the model using alias"""
57
+ return pprint.pformat(self.dict(by_alias=True))
58
+
59
+ def to_json(self) -> str:
60
+ """Returns the JSON representation of the model using alias"""
61
+ return json.dumps(self.to_dict())
62
+
63
+ @classmethod
64
+ def from_json(cls, json_str: str) -> BondConversionSchedule:
65
+ """Create an instance of BondConversionSchedule from a JSON string"""
66
+ return cls.from_dict(json.loads(json_str))
67
+
68
+ def to_dict(self):
69
+ """Returns the dictionary representation of the model using alias"""
70
+ _dict = self.dict(by_alias=True,
71
+ exclude={
72
+ "additional_properties"
73
+ },
74
+ exclude_none=True)
75
+ # override the default output from pydantic by calling `to_dict()` of each item in bond_conversion_entries (list)
76
+ _items = []
77
+ if self.bond_conversion_entries:
78
+ for _item in self.bond_conversion_entries:
79
+ if _item:
80
+ _items.append(_item.to_dict())
81
+ _dict['bondConversionEntries'] = _items
82
+ # puts key-value pairs in additional_properties in the top level
83
+ if self.additional_properties is not None:
84
+ for _key, _value in self.additional_properties.items():
85
+ _dict[_key] = _value
86
+
87
+ # set to None if identifiers (nullable) is None
88
+ # and __fields_set__ contains the field
89
+ if self.identifiers is None and "identifiers" in self.__fields_set__:
90
+ _dict['identifiers'] = None
91
+
92
+ # set to None if bond_conversion_entries (nullable) is None
93
+ # and __fields_set__ contains the field
94
+ if self.bond_conversion_entries is None and "bond_conversion_entries" in self.__fields_set__:
95
+ _dict['bondConversionEntries'] = None
96
+
97
+ # set to None if delivery_type (nullable) is None
98
+ # and __fields_set__ contains the field
99
+ if self.delivery_type is None and "delivery_type" in self.__fields_set__:
100
+ _dict['deliveryType'] = None
101
+
102
+ return _dict
103
+
104
+ @classmethod
105
+ def from_dict(cls, obj: dict) -> BondConversionSchedule:
106
+ """Create an instance of BondConversionSchedule from a dict"""
107
+ if obj is None:
108
+ return None
109
+
110
+ if not isinstance(obj, dict):
111
+ return BondConversionSchedule.parse_obj(obj)
112
+
113
+ _obj = BondConversionSchedule.parse_obj({
114
+ "schedule_type": obj.get("scheduleType"),
115
+ "identifiers": obj.get("identifiers"),
116
+ "bond_conversion_entries": [BondConversionEntry.from_dict(_item) for _item in obj.get("bondConversionEntries")] if obj.get("bondConversionEntries") is not None else None,
117
+ "conversion_trigger": obj.get("conversionTrigger"),
118
+ "delivery_type": obj.get("deliveryType"),
119
+ "exercise_type": obj.get("exerciseType"),
120
+ "includes_accrued": obj.get("includesAccrued"),
121
+ "mandatory_conversion": obj.get("mandatoryConversion"),
122
+ "notification_period_end": obj.get("notificationPeriodEnd"),
123
+ "notification_period_start": obj.get("notificationPeriodStart")
124
+ })
125
+ # store additional fields in additional_properties
126
+ for _key in obj.keys():
127
+ if _key not in cls.__properties:
128
+ _obj.additional_properties[_key] = obj.get(_key)
129
+
130
+ return _obj
@@ -30,15 +30,15 @@ class BondCouponEvent(InstrumentEvent):
30
30
  payment_date: datetime = Field(..., alias="paymentDate", description="Payment date of the coupon payment")
31
31
  currency: StrictStr = Field(..., description="Currency of the coupon payment")
32
32
  coupon_per_unit: Union[StrictFloat, StrictInt] = Field(..., alias="couponPerUnit", description="CouponRate*Principal")
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")
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")
34
34
  additional_properties: Dict[str, Any] = {}
35
35
  __properties = ["instrumentEventType", "exDate", "paymentDate", "currency", "couponPerUnit"]
36
36
 
37
37
  @validator('instrument_event_type')
38
38
  def instrument_event_type_validate_enum(cls, value):
39
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'):
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')")
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'):
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')")
42
42
  return value
43
43
 
44
44
  class Config:
@@ -27,15 +27,15 @@ class BondDefaultEvent(InstrumentEvent):
27
27
  Indicates when an issuer has defaulted on an obligation due to technical default, missed payments, or bankruptcy filing. # noqa: E501
28
28
  """
29
29
  effective_date: datetime = Field(..., alias="effectiveDate", description="The date the bond default occurred.")
30
- 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")
30
+ 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")
31
31
  additional_properties: Dict[str, Any] = {}
32
32
  __properties = ["instrumentEventType", "effectiveDate"]
33
33
 
34
34
  @validator('instrument_event_type')
35
35
  def instrument_event_type_validate_enum(cls, value):
36
36
  """Validates the enum"""
37
- 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'):
38
- 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')")
37
+ 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'):
38
+ 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')")
39
39
  return value
40
40
 
41
41
  class Config:
@@ -30,15 +30,15 @@ class BondPrincipalEvent(InstrumentEvent):
30
30
  ex_date: datetime = Field(..., alias="exDate", description="Ex-Dividend date of the principal payment")
31
31
  payment_date: datetime = Field(..., alias="paymentDate", description="Payment date of the principal payment")
32
32
  principal_per_unit: Union[StrictFloat, StrictInt] = Field(..., alias="principalPerUnit", description="Principal per unit")
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")
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")
34
34
  additional_properties: Dict[str, Any] = {}
35
35
  __properties = ["instrumentEventType", "currency", "exDate", "paymentDate", "principalPerUnit"]
36
36
 
37
37
  @validator('instrument_event_type')
38
38
  def instrument_event_type_validate_enum(cls, value):
39
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'):
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')")
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'):
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')")
42
42
  return value
43
43
 
44
44
  class Config:
@@ -32,15 +32,15 @@ class CapitalDistributionEvent(InstrumentEvent):
32
32
  ex_date: datetime = Field(..., alias="exDate", description="The first business day on which the dividend is not owed to the buying party.")
33
33
  payment_date: datetime = Field(..., alias="paymentDate", description="The date the company begins distributing the dividend.")
34
34
  record_date: Optional[datetime] = Field(None, alias="recordDate", description="Date you have to be the holder of record in order to participate in the tender.")
35
- 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")
35
+ 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")
36
36
  additional_properties: Dict[str, Any] = {}
37
37
  __properties = ["instrumentEventType", "announcementDate", "cashElections", "exDate", "paymentDate", "recordDate"]
38
38
 
39
39
  @validator('instrument_event_type')
40
40
  def instrument_event_type_validate_enum(cls, value):
41
41
  """Validates the enum"""
42
- 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'):
43
- 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')")
42
+ 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'):
43
+ 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')")
44
44
  return value
45
45
 
46
46
  class Config:
@@ -0,0 +1,90 @@
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, Union
22
+ from pydantic.v1 import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, constr
23
+ from lusid.models.units_ratio import UnitsRatio
24
+
25
+ class CashAndSecurityOfferElection(BaseModel):
26
+ """
27
+ # noqa: E501
28
+ """
29
+ cash_offer_currency: StrictStr = Field(..., alias="cashOfferCurrency", description="Currency of the cash offer")
30
+ cash_offer_price: Union[StrictFloat, StrictInt] = Field(..., alias="cashOfferPrice", description="Price per share of the cash offer")
31
+ cost_factor: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="costFactor", description="Optional. The fraction of cost that is transferred from the existing shares to the new shares.")
32
+ election_key: constr(strict=True, min_length=1) = Field(..., alias="electionKey", description="Unique key associated to this election.")
33
+ is_chosen: Optional[StrictBool] = Field(None, alias="isChosen", description="Is this the election that has been explicitly chosen from multiple options.")
34
+ is_default: Optional[StrictBool] = Field(None, alias="isDefault", description="Is this election automatically applied in the absence of an election having been made. May only be true for one election if multiple are provided.")
35
+ units_ratio: UnitsRatio = Field(..., alias="unitsRatio")
36
+ __properties = ["cashOfferCurrency", "cashOfferPrice", "costFactor", "electionKey", "isChosen", "isDefault", "unitsRatio"]
37
+
38
+ class Config:
39
+ """Pydantic configuration"""
40
+ allow_population_by_field_name = True
41
+ validate_assignment = True
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.dict(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> CashAndSecurityOfferElection:
53
+ """Create an instance of CashAndSecurityOfferElection from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self):
57
+ """Returns the dictionary representation of the model using alias"""
58
+ _dict = self.dict(by_alias=True,
59
+ exclude={
60
+ },
61
+ exclude_none=True)
62
+ # override the default output from pydantic by calling `to_dict()` of units_ratio
63
+ if self.units_ratio:
64
+ _dict['unitsRatio'] = self.units_ratio.to_dict()
65
+ # set to None if cost_factor (nullable) is None
66
+ # and __fields_set__ contains the field
67
+ if self.cost_factor is None and "cost_factor" in self.__fields_set__:
68
+ _dict['costFactor'] = None
69
+
70
+ return _dict
71
+
72
+ @classmethod
73
+ def from_dict(cls, obj: dict) -> CashAndSecurityOfferElection:
74
+ """Create an instance of CashAndSecurityOfferElection from a dict"""
75
+ if obj is None:
76
+ return None
77
+
78
+ if not isinstance(obj, dict):
79
+ return CashAndSecurityOfferElection.parse_obj(obj)
80
+
81
+ _obj = CashAndSecurityOfferElection.parse_obj({
82
+ "cash_offer_currency": obj.get("cashOfferCurrency"),
83
+ "cash_offer_price": obj.get("cashOfferPrice"),
84
+ "cost_factor": obj.get("costFactor"),
85
+ "election_key": obj.get("electionKey"),
86
+ "is_chosen": obj.get("isChosen"),
87
+ "is_default": obj.get("isDefault"),
88
+ "units_ratio": UnitsRatio.from_dict(obj.get("unitsRatio")) if obj.get("unitsRatio") is not None else None
89
+ })
90
+ return _obj