lusid-sdk 2.1.322__py3-none-any.whl → 2.1.390__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.
- lusid/__init__.py +64 -0
- lusid/api/__init__.py +5 -1
- lusid/api/data_types_api.py +160 -0
- lusid/api/entities_api.py +172 -0
- lusid/api/funds_api.py +221 -8
- lusid/api/group_reconciliations_api.py +378 -0
- lusid/api/order_management_api.py +321 -0
- lusid/api/workspace_api.py +3433 -0
- lusid/configuration.py +16 -7
- lusid/models/__init__.py +60 -0
- lusid/models/accept_estimate_valuation_point_response.py +100 -0
- lusid/models/accumulation_event.py +3 -3
- lusid/models/action_id.py +1 -1
- lusid/models/amortisation_event.py +3 -3
- lusid/models/applicable_instrument_event.py +14 -2
- lusid/models/bond_coupon_event.py +3 -3
- lusid/models/bond_default_event.py +3 -3
- lusid/models/bond_principal_event.py +3 -3
- lusid/models/calendar.py +17 -2
- lusid/models/capital_distribution_event.py +3 -3
- lusid/models/cash_dividend_event.py +3 -3
- lusid/models/cash_flow_event.py +3 -3
- lusid/models/close_event.py +3 -3
- lusid/models/close_period_diary_entry_request.py +1 -1
- lusid/models/create_group_reconciliation_comparison_ruleset_request.py +97 -0
- lusid/models/custom_entity_definition.py +17 -2
- lusid/models/custom_entity_type.py +17 -2
- lusid/models/data_type.py +14 -8
- lusid/models/data_type_entity.py +131 -0
- lusid/models/diary_entry.py +1 -1
- lusid/models/diary_entry_request.py +1 -1
- lusid/models/dividend_option_event.py +3 -3
- lusid/models/dividend_reinvestment_event.py +3 -3
- lusid/models/entity_change_item.py +121 -0
- lusid/models/exercise_event.py +3 -3
- lusid/models/expiry_event.py +3 -3
- lusid/models/fee.py +1 -1
- lusid/models/fee_request.py +1 -1
- lusid/models/flow_conventions.py +1 -1
- lusid/models/fund_amount.py +1 -1
- lusid/models/fund_configuration.py +6 -6
- lusid/models/fund_configuration_request.py +6 -6
- lusid/models/fund_details.py +74 -0
- lusid/models/future_expiry_event.py +3 -3
- lusid/models/futures_contract_details.py +6 -1
- lusid/models/fx_forward_settlement_event.py +3 -3
- lusid/models/generated_event_diagnostics.py +75 -0
- lusid/models/group_reconciliation_aggregate_attribute_rule.py +84 -0
- lusid/models/group_reconciliation_aggregate_comparison_rule_operand.py +71 -0
- lusid/models/group_reconciliation_comparison_rule_string_value_map.py +73 -0
- lusid/models/group_reconciliation_comparison_rule_tolerance.py +71 -0
- lusid/models/group_reconciliation_comparison_ruleset.py +125 -0
- lusid/models/group_reconciliation_core_attribute_rule.py +95 -0
- lusid/models/group_reconciliation_core_comparison_rule_operand.py +71 -0
- lusid/models/index_convention.py +1 -1
- lusid/models/informational_error_event.py +3 -3
- lusid/models/informational_event.py +3 -3
- lusid/models/instrument_event.py +7 -5
- lusid/models/instrument_event_instruction.py +19 -4
- lusid/models/instrument_event_type.py +2 -0
- lusid/models/instrument_resolution_detail.py +19 -5
- lusid/models/journal_entry_line.py +5 -3
- lusid/models/maturity_event.py +3 -3
- lusid/models/merger_event.py +3 -3
- lusid/models/new_instrument.py +10 -2
- lusid/models/open_event.py +3 -3
- lusid/models/order_graph_block_order_detail.py +1 -1
- lusid/models/order_update_request.py +121 -0
- lusid/models/paged_resource_list_of_valuation_point_overview.py +113 -0
- lusid/models/paged_resource_list_of_workspace.py +113 -0
- lusid/models/paged_resource_list_of_workspace_item.py +113 -0
- lusid/models/person.py +17 -2
- lusid/models/placement_update_request.py +6 -1
- lusid/models/previous_nav.py +3 -3
- lusid/models/quote_access_metadata_rule_id.py +2 -2
- lusid/models/quote_series_id.py +2 -2
- lusid/models/raw_vendor_event.py +3 -3
- lusid/models/reset_event.py +3 -3
- lusid/models/resource_list_of_entity_change_item.py +113 -0
- lusid/models/reverse_stock_split_event.py +3 -3
- lusid/models/scrip_dividend_event.py +20 -6
- lusid/models/share_class_amount.py +7 -9
- lusid/models/share_class_breakdown.py +9 -18
- lusid/models/share_class_dealing_breakdown.py +96 -0
- lusid/models/share_class_details.py +5 -3
- lusid/models/spin_off_event.py +3 -3
- lusid/models/stock_dividend_event.py +3 -3
- lusid/models/stock_split_event.py +21 -7
- lusid/models/swap_cash_flow_event.py +97 -0
- lusid/models/swap_principal_event.py +97 -0
- lusid/models/transaction_diagnostics.py +71 -0
- lusid/models/transition_event.py +3 -3
- lusid/models/trigger_event.py +3 -3
- lusid/models/update_orders_response.py +153 -0
- lusid/models/valuation_point_data_response.py +22 -2
- lusid/models/valuation_point_overview.py +125 -0
- lusid/models/weighted_instrument.py +9 -2
- lusid/models/workspace.py +92 -0
- lusid/models/workspace_creation_request.py +78 -0
- lusid/models/workspace_item.py +105 -0
- lusid/models/workspace_item_creation_request.py +91 -0
- lusid/models/workspace_item_update_request.py +82 -0
- lusid/models/workspace_update_request.py +69 -0
- {lusid_sdk-2.1.322.dist-info → lusid_sdk-2.1.390.dist-info}/METADATA +58 -1
- {lusid_sdk-2.1.322.dist-info → lusid_sdk-2.1.390.dist-info}/RECORD +106 -74
- {lusid_sdk-2.1.322.dist-info → lusid_sdk-2.1.390.dist-info}/WHEEL +0 -0
@@ -18,16 +18,16 @@ import re # noqa: F401
|
|
18
18
|
import json
|
19
19
|
|
20
20
|
|
21
|
-
from typing import Any, Dict, Optional
|
22
|
-
from pydantic.v1 import BaseModel
|
23
|
-
from lusid.models.multi_currency_amounts import MultiCurrencyAmounts
|
21
|
+
from typing import Any, Dict, Optional, Union
|
22
|
+
from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt
|
24
23
|
|
25
24
|
class ShareClassAmount(BaseModel):
|
26
25
|
"""
|
27
26
|
ShareClassAmount
|
28
27
|
"""
|
29
|
-
|
30
|
-
|
28
|
+
fund_currency_amount: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="fundCurrencyAmount", description="The value of the amount in the fund currency.")
|
29
|
+
share_class_currency_amount: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="shareClassCurrencyAmount", description="The value of the amount in the share class currency.")
|
30
|
+
__properties = ["fundCurrencyAmount", "shareClassCurrencyAmount"]
|
31
31
|
|
32
32
|
class Config:
|
33
33
|
"""Pydantic configuration"""
|
@@ -53,9 +53,6 @@ class ShareClassAmount(BaseModel):
|
|
53
53
|
exclude={
|
54
54
|
},
|
55
55
|
exclude_none=True)
|
56
|
-
# override the default output from pydantic by calling `to_dict()` of value
|
57
|
-
if self.value:
|
58
|
-
_dict['value'] = self.value.to_dict()
|
59
56
|
return _dict
|
60
57
|
|
61
58
|
@classmethod
|
@@ -68,6 +65,7 @@ class ShareClassAmount(BaseModel):
|
|
68
65
|
return ShareClassAmount.parse_obj(obj)
|
69
66
|
|
70
67
|
_obj = ShareClassAmount.parse_obj({
|
71
|
-
"
|
68
|
+
"fund_currency_amount": obj.get("fundCurrencyAmount"),
|
69
|
+
"share_class_currency_amount": obj.get("shareClassCurrencyAmount")
|
72
70
|
})
|
73
71
|
return _obj
|
@@ -21,9 +21,9 @@ import json
|
|
21
21
|
from typing import Any, Dict, Optional, Union
|
22
22
|
from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt
|
23
23
|
from lusid.models.fee_accrual import FeeAccrual
|
24
|
-
from lusid.models.multi_currency_amounts import MultiCurrencyAmounts
|
25
24
|
from lusid.models.previous_share_class_breakdown import PreviousShareClassBreakdown
|
26
25
|
from lusid.models.share_class_amount import ShareClassAmount
|
26
|
+
from lusid.models.share_class_dealing_breakdown import ShareClassDealingBreakdown
|
27
27
|
from lusid.models.share_class_pnl_breakdown import ShareClassPnlBreakdown
|
28
28
|
from lusid.models.unitisation_data import UnitisationData
|
29
29
|
|
@@ -32,11 +32,11 @@ class ShareClassBreakdown(BaseModel):
|
|
32
32
|
The Valuation Point Data for a Share Class on a specified date. # noqa: E501
|
33
33
|
"""
|
34
34
|
back_out: Dict[str, ShareClassAmount] = Field(..., alias="backOut", description="Bucket of detail for the Valuation Point where data points have been 'backed out'.")
|
35
|
-
dealing:
|
35
|
+
dealing: ShareClassDealingBreakdown = Field(...)
|
36
36
|
pn_l: ShareClassPnlBreakdown = Field(..., alias="pnL")
|
37
|
-
gav:
|
37
|
+
gav: ShareClassAmount = Field(...)
|
38
38
|
fees: Dict[str, FeeAccrual] = Field(..., description="Bucket of detail for any 'Fees' that have been charged in the selected period.")
|
39
|
-
nav:
|
39
|
+
nav: ShareClassAmount = Field(...)
|
40
40
|
unitisation: Optional[UnitisationData] = None
|
41
41
|
miscellaneous: Optional[Dict[str, ShareClassAmount]] = Field(None, description="Not used directly by the LUSID engines but serves as a holding area for any custom derived data points that may be useful in, for example, fee calculations).")
|
42
42
|
share_class_to_fund_fx_rate: Union[StrictFloat, StrictInt] = Field(..., alias="shareClassToFundFxRate", description="The fx rate from the Share Class currency to the fund currency at this valuation point.")
|
@@ -75,13 +75,9 @@ class ShareClassBreakdown(BaseModel):
|
|
75
75
|
if self.back_out[_key]:
|
76
76
|
_field_dict[_key] = self.back_out[_key].to_dict()
|
77
77
|
_dict['backOut'] = _field_dict
|
78
|
-
# override the default output from pydantic by calling `to_dict()` of
|
79
|
-
_field_dict = {}
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of dealing
|
80
79
|
if self.dealing:
|
81
|
-
|
82
|
-
if self.dealing[_key]:
|
83
|
-
_field_dict[_key] = self.dealing[_key].to_dict()
|
84
|
-
_dict['dealing'] = _field_dict
|
80
|
+
_dict['dealing'] = self.dealing.to_dict()
|
85
81
|
# override the default output from pydantic by calling `to_dict()` of pn_l
|
86
82
|
if self.pn_l:
|
87
83
|
_dict['pnL'] = self.pn_l.to_dict()
|
@@ -134,21 +130,16 @@ class ShareClassBreakdown(BaseModel):
|
|
134
130
|
)
|
135
131
|
if obj.get("backOut") is not None
|
136
132
|
else None,
|
137
|
-
"dealing":
|
138
|
-
(_k, ShareClassAmount.from_dict(_v))
|
139
|
-
for _k, _v in obj.get("dealing").items()
|
140
|
-
)
|
141
|
-
if obj.get("dealing") is not None
|
142
|
-
else None,
|
133
|
+
"dealing": ShareClassDealingBreakdown.from_dict(obj.get("dealing")) if obj.get("dealing") is not None else None,
|
143
134
|
"pn_l": ShareClassPnlBreakdown.from_dict(obj.get("pnL")) if obj.get("pnL") is not None else None,
|
144
|
-
"gav":
|
135
|
+
"gav": ShareClassAmount.from_dict(obj.get("gav")) if obj.get("gav") is not None else None,
|
145
136
|
"fees": dict(
|
146
137
|
(_k, FeeAccrual.from_dict(_v))
|
147
138
|
for _k, _v in obj.get("fees").items()
|
148
139
|
)
|
149
140
|
if obj.get("fees") is not None
|
150
141
|
else None,
|
151
|
-
"nav":
|
142
|
+
"nav": ShareClassAmount.from_dict(obj.get("nav")) if obj.get("nav") is not None else None,
|
152
143
|
"unitisation": UnitisationData.from_dict(obj.get("unitisation")) if obj.get("unitisation") is not None else None,
|
153
144
|
"miscellaneous": dict(
|
154
145
|
(_k, ShareClassAmount.from_dict(_v))
|
@@ -0,0 +1,96 @@
|
|
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
|
22
|
+
from pydantic.v1 import BaseModel, Field
|
23
|
+
from lusid.models.share_class_amount import ShareClassAmount
|
24
|
+
|
25
|
+
class ShareClassDealingBreakdown(BaseModel):
|
26
|
+
"""
|
27
|
+
The breakdown of Dealing for a Share Class. # noqa: E501
|
28
|
+
"""
|
29
|
+
class_dealing: Dict[str, ShareClassAmount] = Field(..., alias="classDealing", description="Bucket of detail for any 'Dealing' specific to the share class that has occured inside the queried period.")
|
30
|
+
class_dealing_units: Dict[str, ShareClassAmount] = Field(..., alias="classDealingUnits", description="Bucket of detail for any 'Dealing' units specific to the share class that has occured inside the queried period.")
|
31
|
+
__properties = ["classDealing", "classDealingUnits"]
|
32
|
+
|
33
|
+
class Config:
|
34
|
+
"""Pydantic configuration"""
|
35
|
+
allow_population_by_field_name = True
|
36
|
+
validate_assignment = True
|
37
|
+
|
38
|
+
def to_str(self) -> str:
|
39
|
+
"""Returns the string representation of the model using alias"""
|
40
|
+
return pprint.pformat(self.dict(by_alias=True))
|
41
|
+
|
42
|
+
def to_json(self) -> str:
|
43
|
+
"""Returns the JSON representation of the model using alias"""
|
44
|
+
return json.dumps(self.to_dict())
|
45
|
+
|
46
|
+
@classmethod
|
47
|
+
def from_json(cls, json_str: str) -> ShareClassDealingBreakdown:
|
48
|
+
"""Create an instance of ShareClassDealingBreakdown from a JSON string"""
|
49
|
+
return cls.from_dict(json.loads(json_str))
|
50
|
+
|
51
|
+
def to_dict(self):
|
52
|
+
"""Returns the dictionary representation of the model using alias"""
|
53
|
+
_dict = self.dict(by_alias=True,
|
54
|
+
exclude={
|
55
|
+
},
|
56
|
+
exclude_none=True)
|
57
|
+
# override the default output from pydantic by calling `to_dict()` of each value in class_dealing (dict)
|
58
|
+
_field_dict = {}
|
59
|
+
if self.class_dealing:
|
60
|
+
for _key in self.class_dealing:
|
61
|
+
if self.class_dealing[_key]:
|
62
|
+
_field_dict[_key] = self.class_dealing[_key].to_dict()
|
63
|
+
_dict['classDealing'] = _field_dict
|
64
|
+
# override the default output from pydantic by calling `to_dict()` of each value in class_dealing_units (dict)
|
65
|
+
_field_dict = {}
|
66
|
+
if self.class_dealing_units:
|
67
|
+
for _key in self.class_dealing_units:
|
68
|
+
if self.class_dealing_units[_key]:
|
69
|
+
_field_dict[_key] = self.class_dealing_units[_key].to_dict()
|
70
|
+
_dict['classDealingUnits'] = _field_dict
|
71
|
+
return _dict
|
72
|
+
|
73
|
+
@classmethod
|
74
|
+
def from_dict(cls, obj: dict) -> ShareClassDealingBreakdown:
|
75
|
+
"""Create an instance of ShareClassDealingBreakdown from a dict"""
|
76
|
+
if obj is None:
|
77
|
+
return None
|
78
|
+
|
79
|
+
if not isinstance(obj, dict):
|
80
|
+
return ShareClassDealingBreakdown.parse_obj(obj)
|
81
|
+
|
82
|
+
_obj = ShareClassDealingBreakdown.parse_obj({
|
83
|
+
"class_dealing": dict(
|
84
|
+
(_k, ShareClassAmount.from_dict(_v))
|
85
|
+
for _k, _v in obj.get("classDealing").items()
|
86
|
+
)
|
87
|
+
if obj.get("classDealing") is not None
|
88
|
+
else None,
|
89
|
+
"class_dealing_units": dict(
|
90
|
+
(_k, ShareClassAmount.from_dict(_v))
|
91
|
+
for _k, _v in obj.get("classDealingUnits").items()
|
92
|
+
)
|
93
|
+
if obj.get("classDealingUnits") is not None
|
94
|
+
else None
|
95
|
+
})
|
96
|
+
return _obj
|
@@ -19,7 +19,7 @@ import json
|
|
19
19
|
|
20
20
|
|
21
21
|
from typing import Any, Dict, Optional
|
22
|
-
from pydantic.v1 import BaseModel, Field, StrictStr, constr, validator
|
22
|
+
from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, constr, validator
|
23
23
|
|
24
24
|
class ShareClassDetails(BaseModel):
|
25
25
|
"""
|
@@ -28,7 +28,8 @@ class ShareClassDetails(BaseModel):
|
|
28
28
|
lusid_instrument_id: Optional[constr(strict=True, max_length=64, min_length=1)] = Field(None, alias="lusidInstrumentId", description="LUSID's internal unique instrument identifier, resolved from the share class' instrument identifiers")
|
29
29
|
instrument_scope: Optional[constr(strict=True, max_length=64, min_length=1)] = Field(None, alias="instrumentScope", description="The scope in which the share class instrument lies.")
|
30
30
|
dom_currency: Optional[StrictStr] = Field(None, alias="domCurrency", description="The domestic currency of the share class instrument")
|
31
|
-
|
31
|
+
instrument_active: Optional[StrictBool] = Field(None, alias="instrumentActive", description="If the instrument of the share class is active.")
|
32
|
+
__properties = ["lusidInstrumentId", "instrumentScope", "domCurrency", "instrumentActive"]
|
32
33
|
|
33
34
|
@validator('lusid_instrument_id')
|
34
35
|
def lusid_instrument_id_validate_regular_expression(cls, value):
|
@@ -103,6 +104,7 @@ class ShareClassDetails(BaseModel):
|
|
103
104
|
_obj = ShareClassDetails.parse_obj({
|
104
105
|
"lusid_instrument_id": obj.get("lusidInstrumentId"),
|
105
106
|
"instrument_scope": obj.get("instrumentScope"),
|
106
|
-
"dom_currency": obj.get("domCurrency")
|
107
|
+
"dom_currency": obj.get("domCurrency"),
|
108
|
+
"instrument_active": obj.get("instrumentActive")
|
107
109
|
})
|
108
110
|
return _obj
|
lusid/models/spin_off_event.py
CHANGED
@@ -37,15 +37,15 @@ class SpinOffEvent(InstrumentEvent):
|
|
37
37
|
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.")
|
38
38
|
fractional_units_cash_price: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="fractionalUnitsCashPrice", description="Optional. Used in calculating cash-in-lieu of fractional shares.")
|
39
39
|
fractional_units_cash_currency: Optional[StrictStr] = Field(None, alias="fractionalUnitsCashCurrency", description="Optional. Used in calculating cash-in-lieu of fractional shares.")
|
40
|
-
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")
|
40
|
+
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")
|
41
41
|
additional_properties: Dict[str, Any] = {}
|
42
42
|
__properties = ["instrumentEventType", "announcementDate", "exDate", "recordDate", "paymentDate", "newInstrument", "unitsRatio", "costFactor", "fractionalUnitsCashPrice", "fractionalUnitsCashCurrency"]
|
43
43
|
|
44
44
|
@validator('instrument_event_type')
|
45
45
|
def instrument_event_type_validate_enum(cls, value):
|
46
46
|
"""Validates the enum"""
|
47
|
-
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'):
|
48
|
-
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')")
|
47
|
+
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'):
|
48
|
+
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')")
|
49
49
|
return value
|
50
50
|
|
51
51
|
class Config:
|
@@ -32,15 +32,15 @@ class StockDividendEvent(InstrumentEvent):
|
|
32
32
|
payment_date: datetime = Field(..., alias="paymentDate", description="The date the company pays out dividends to shareholders.")
|
33
33
|
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.")
|
34
34
|
units_ratio: UnitsRatio = Field(..., alias="unitsRatio")
|
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, FutureExpiryEvent")
|
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, FutureExpiryEvent, SwapCashFlowEvent, SwapPrincipalEvent")
|
36
36
|
additional_properties: Dict[str, Any] = {}
|
37
37
|
__properties = ["instrumentEventType", "announcementDate", "exDate", "paymentDate", "recordDate", "unitsRatio"]
|
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', 'MergerEvent', 'FutureExpiryEvent'):
|
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', 'FutureExpiryEvent')")
|
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', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent'):
|
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', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent')")
|
44
44
|
return value
|
45
45
|
|
46
46
|
class Config:
|
@@ -18,8 +18,8 @@ import re # noqa: F401
|
|
18
18
|
import json
|
19
19
|
|
20
20
|
from datetime import datetime
|
21
|
-
from typing import Any, Dict, Optional
|
22
|
-
from pydantic.v1 import Field, StrictStr, validator
|
21
|
+
from typing import Any, Dict, Optional, Union
|
22
|
+
from pydantic.v1 import Field, StrictFloat, StrictInt, StrictStr, validator
|
23
23
|
from lusid.models.instrument_event import InstrumentEvent
|
24
24
|
from lusid.models.units_ratio import UnitsRatio
|
25
25
|
|
@@ -32,15 +32,17 @@ class StockSplitEvent(InstrumentEvent):
|
|
32
32
|
units_ratio: UnitsRatio = Field(..., alias="unitsRatio")
|
33
33
|
record_date: Optional[datetime] = Field(None, alias="recordDate", description="Date you have to be the holder of record in order to receive the additional shares.")
|
34
34
|
announcement_date: Optional[datetime] = Field(None, alias="announcementDate", description="Date the stock split was announced.")
|
35
|
-
|
35
|
+
fractional_units_cash_price: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="fractionalUnitsCashPrice", description="The cash price per unit paid in lieu when fractional units can not be distributed.")
|
36
|
+
fractional_units_cash_currency: Optional[StrictStr] = Field(None, alias="fractionalUnitsCashCurrency", description="The currency of the cash paid in lieu of fractional units.")
|
37
|
+
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")
|
36
38
|
additional_properties: Dict[str, Any] = {}
|
37
|
-
__properties = ["instrumentEventType", "paymentDate", "exDate", "unitsRatio", "recordDate", "announcementDate"]
|
39
|
+
__properties = ["instrumentEventType", "paymentDate", "exDate", "unitsRatio", "recordDate", "announcementDate", "fractionalUnitsCashPrice", "fractionalUnitsCashCurrency"]
|
38
40
|
|
39
41
|
@validator('instrument_event_type')
|
40
42
|
def instrument_event_type_validate_enum(cls, value):
|
41
43
|
"""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', 'MergerEvent', 'FutureExpiryEvent'):
|
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', 'FutureExpiryEvent')")
|
44
|
+
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'):
|
45
|
+
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')")
|
44
46
|
return value
|
45
47
|
|
46
48
|
class Config:
|
@@ -86,6 +88,16 @@ class StockSplitEvent(InstrumentEvent):
|
|
86
88
|
if self.announcement_date is None and "announcement_date" in self.__fields_set__:
|
87
89
|
_dict['announcementDate'] = None
|
88
90
|
|
91
|
+
# set to None if fractional_units_cash_price (nullable) is None
|
92
|
+
# and __fields_set__ contains the field
|
93
|
+
if self.fractional_units_cash_price is None and "fractional_units_cash_price" in self.__fields_set__:
|
94
|
+
_dict['fractionalUnitsCashPrice'] = None
|
95
|
+
|
96
|
+
# set to None if fractional_units_cash_currency (nullable) is None
|
97
|
+
# and __fields_set__ contains the field
|
98
|
+
if self.fractional_units_cash_currency is None and "fractional_units_cash_currency" in self.__fields_set__:
|
99
|
+
_dict['fractionalUnitsCashCurrency'] = None
|
100
|
+
|
89
101
|
return _dict
|
90
102
|
|
91
103
|
@classmethod
|
@@ -103,7 +115,9 @@ class StockSplitEvent(InstrumentEvent):
|
|
103
115
|
"ex_date": obj.get("exDate"),
|
104
116
|
"units_ratio": UnitsRatio.from_dict(obj.get("unitsRatio")) if obj.get("unitsRatio") is not None else None,
|
105
117
|
"record_date": obj.get("recordDate"),
|
106
|
-
"announcement_date": obj.get("announcementDate")
|
118
|
+
"announcement_date": obj.get("announcementDate"),
|
119
|
+
"fractional_units_cash_price": obj.get("fractionalUnitsCashPrice"),
|
120
|
+
"fractional_units_cash_currency": obj.get("fractionalUnitsCashCurrency")
|
107
121
|
})
|
108
122
|
# store additional fields in additional_properties
|
109
123
|
for _key in obj.keys():
|
@@ -0,0 +1,97 @@
|
|
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 Field, StrictFloat, StrictInt, StrictStr, validator
|
23
|
+
from lusid.models.instrument_event import InstrumentEvent
|
24
|
+
|
25
|
+
class SwapCashFlowEvent(InstrumentEvent):
|
26
|
+
"""
|
27
|
+
Definition of a swap cash flow event. This event describes the cashflow generated from either an interest rate swap or inflation swap instrument. # noqa: E501
|
28
|
+
"""
|
29
|
+
ex_date: datetime = Field(..., alias="exDate", description="The ex-dividend date of the cashflow.")
|
30
|
+
payment_date: datetime = Field(..., alias="paymentDate", description="The payment date of the cashflow.")
|
31
|
+
currency: StrictStr = Field(..., description="The currency in which the cashflow is paid.")
|
32
|
+
cash_flow_per_unit: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="cashFlowPerUnit", description="The cashflow amount received for each unit of the instrument held on the ex date.")
|
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")
|
34
|
+
additional_properties: Dict[str, Any] = {}
|
35
|
+
__properties = ["instrumentEventType", "exDate", "paymentDate", "currency", "cashFlowPerUnit"]
|
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'):
|
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')")
|
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) -> SwapCashFlowEvent:
|
59
|
+
"""Create an instance of SwapCashFlowEvent 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
|
+
# puts key-value pairs in additional_properties in the top level
|
70
|
+
if self.additional_properties is not None:
|
71
|
+
for _key, _value in self.additional_properties.items():
|
72
|
+
_dict[_key] = _value
|
73
|
+
|
74
|
+
return _dict
|
75
|
+
|
76
|
+
@classmethod
|
77
|
+
def from_dict(cls, obj: dict) -> SwapCashFlowEvent:
|
78
|
+
"""Create an instance of SwapCashFlowEvent from a dict"""
|
79
|
+
if obj is None:
|
80
|
+
return None
|
81
|
+
|
82
|
+
if not isinstance(obj, dict):
|
83
|
+
return SwapCashFlowEvent.parse_obj(obj)
|
84
|
+
|
85
|
+
_obj = SwapCashFlowEvent.parse_obj({
|
86
|
+
"instrument_event_type": obj.get("instrumentEventType"),
|
87
|
+
"ex_date": obj.get("exDate"),
|
88
|
+
"payment_date": obj.get("paymentDate"),
|
89
|
+
"currency": obj.get("currency"),
|
90
|
+
"cash_flow_per_unit": obj.get("cashFlowPerUnit")
|
91
|
+
})
|
92
|
+
# store additional fields in additional_properties
|
93
|
+
for _key in obj.keys():
|
94
|
+
if _key not in cls.__properties:
|
95
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
96
|
+
|
97
|
+
return _obj
|
@@ -0,0 +1,97 @@
|
|
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 Field, StrictFloat, StrictInt, StrictStr, validator
|
23
|
+
from lusid.models.instrument_event import InstrumentEvent
|
24
|
+
|
25
|
+
class SwapPrincipalEvent(InstrumentEvent):
|
26
|
+
"""
|
27
|
+
Definition of a Swap Principal Event. This is an event that describes the occurence of a cashflow due to the principal payment. # noqa: E501
|
28
|
+
"""
|
29
|
+
ex_date: datetime = Field(..., alias="exDate", description="The entitlement date of the principal payment.")
|
30
|
+
payment_date: datetime = Field(..., alias="paymentDate", description="The payment date of the principal.")
|
31
|
+
currency: StrictStr = Field(..., description="The currency in which the principal is paid.")
|
32
|
+
principal_per_unit: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="principalPerUnit", description="The principal amount received for each unit of the instrument held on the ex date.")
|
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")
|
34
|
+
additional_properties: Dict[str, Any] = {}
|
35
|
+
__properties = ["instrumentEventType", "exDate", "paymentDate", "currency", "principalPerUnit"]
|
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'):
|
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')")
|
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) -> SwapPrincipalEvent:
|
59
|
+
"""Create an instance of SwapPrincipalEvent 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
|
+
# puts key-value pairs in additional_properties in the top level
|
70
|
+
if self.additional_properties is not None:
|
71
|
+
for _key, _value in self.additional_properties.items():
|
72
|
+
_dict[_key] = _value
|
73
|
+
|
74
|
+
return _dict
|
75
|
+
|
76
|
+
@classmethod
|
77
|
+
def from_dict(cls, obj: dict) -> SwapPrincipalEvent:
|
78
|
+
"""Create an instance of SwapPrincipalEvent from a dict"""
|
79
|
+
if obj is None:
|
80
|
+
return None
|
81
|
+
|
82
|
+
if not isinstance(obj, dict):
|
83
|
+
return SwapPrincipalEvent.parse_obj(obj)
|
84
|
+
|
85
|
+
_obj = SwapPrincipalEvent.parse_obj({
|
86
|
+
"instrument_event_type": obj.get("instrumentEventType"),
|
87
|
+
"ex_date": obj.get("exDate"),
|
88
|
+
"payment_date": obj.get("paymentDate"),
|
89
|
+
"currency": obj.get("currency"),
|
90
|
+
"principal_per_unit": obj.get("principalPerUnit")
|
91
|
+
})
|
92
|
+
# store additional fields in additional_properties
|
93
|
+
for _key in obj.keys():
|
94
|
+
if _key not in cls.__properties:
|
95
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
96
|
+
|
97
|
+
return _obj
|
@@ -0,0 +1,71 @@
|
|
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, List
|
22
|
+
from pydantic.v1 import BaseModel, Field, StrictStr, conlist, constr
|
23
|
+
|
24
|
+
class TransactionDiagnostics(BaseModel):
|
25
|
+
"""
|
26
|
+
Represents a set of diagnostics per transaction, where applicable. # noqa: E501
|
27
|
+
"""
|
28
|
+
transaction_display_name: constr(strict=True, min_length=1) = Field(..., alias="transactionDisplayName")
|
29
|
+
error_details: conlist(StrictStr) = Field(..., alias="errorDetails")
|
30
|
+
__properties = ["transactionDisplayName", "errorDetails"]
|
31
|
+
|
32
|
+
class Config:
|
33
|
+
"""Pydantic configuration"""
|
34
|
+
allow_population_by_field_name = True
|
35
|
+
validate_assignment = True
|
36
|
+
|
37
|
+
def to_str(self) -> str:
|
38
|
+
"""Returns the string representation of the model using alias"""
|
39
|
+
return pprint.pformat(self.dict(by_alias=True))
|
40
|
+
|
41
|
+
def to_json(self) -> str:
|
42
|
+
"""Returns the JSON representation of the model using alias"""
|
43
|
+
return json.dumps(self.to_dict())
|
44
|
+
|
45
|
+
@classmethod
|
46
|
+
def from_json(cls, json_str: str) -> TransactionDiagnostics:
|
47
|
+
"""Create an instance of TransactionDiagnostics from a JSON string"""
|
48
|
+
return cls.from_dict(json.loads(json_str))
|
49
|
+
|
50
|
+
def to_dict(self):
|
51
|
+
"""Returns the dictionary representation of the model using alias"""
|
52
|
+
_dict = self.dict(by_alias=True,
|
53
|
+
exclude={
|
54
|
+
},
|
55
|
+
exclude_none=True)
|
56
|
+
return _dict
|
57
|
+
|
58
|
+
@classmethod
|
59
|
+
def from_dict(cls, obj: dict) -> TransactionDiagnostics:
|
60
|
+
"""Create an instance of TransactionDiagnostics from a dict"""
|
61
|
+
if obj is None:
|
62
|
+
return None
|
63
|
+
|
64
|
+
if not isinstance(obj, dict):
|
65
|
+
return TransactionDiagnostics.parse_obj(obj)
|
66
|
+
|
67
|
+
_obj = TransactionDiagnostics.parse_obj({
|
68
|
+
"transaction_display_name": obj.get("transactionDisplayName"),
|
69
|
+
"error_details": obj.get("errorDetails")
|
70
|
+
})
|
71
|
+
return _obj
|