lusid-sdk 2.1.242__py3-none-any.whl → 2.1.320__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 +66 -0
- lusid/api/__init__.py +2 -0
- lusid/api/compliance_api.py +191 -0
- lusid/api/entities_api.py +360 -0
- lusid/api/fee_types_api.py +143 -0
- lusid/api/fund_configurations_api.py +944 -0
- lusid/api/funds_api.py +1 -1
- lusid/api/order_management_api.py +479 -1
- lusid/api/scopes_api.py +38 -9
- lusid/configuration.py +1 -1
- lusid/extensions/configuration_loaders.py +9 -1
- lusid/models/__init__.py +64 -0
- lusid/models/accounting_method.py +3 -0
- lusid/models/accumulation_event.py +3 -3
- lusid/models/amortisation_event.py +3 -3
- 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/cancel_orders_response.py +153 -0
- lusid/models/cancel_placements_response.py +153 -0
- lusid/models/cancelled_order_result.py +73 -0
- lusid/models/cancelled_placement_result.py +83 -0
- lusid/models/capital_distribution_event.py +3 -3
- lusid/models/cash.py +93 -0
- 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/compliance_run_configuration.py +73 -0
- lusid/models/component_filter.py +85 -0
- lusid/models/component_rule.py +77 -0
- lusid/models/contract_for_difference.py +4 -2
- lusid/models/create_derived_transaction_portfolio_request.py +3 -3
- lusid/models/create_transaction_portfolio_request.py +3 -3
- lusid/models/dependency_source_filter.py +9 -2
- lusid/models/dividend_option_event.py +3 -3
- lusid/models/dividend_reinvestment_event.py +3 -3
- lusid/models/exercise_event.py +3 -3
- lusid/models/expiry_event.py +3 -3
- lusid/models/fee_transaction_template_specification.py +79 -0
- lusid/models/fund.py +6 -1
- lusid/models/fund_amount.py +69 -0
- lusid/models/fund_configuration.py +151 -0
- lusid/models/fund_configuration_properties.py +115 -0
- lusid/models/fund_configuration_request.py +136 -0
- lusid/models/fund_pnl_breakdown.py +110 -0
- lusid/models/fund_previous_nav.py +69 -0
- lusid/models/fund_request.py +6 -1
- lusid/models/fund_valuation_point_data.py +152 -0
- lusid/models/future_expiry_event.py +100 -0
- lusid/models/futures_contract_details.py +9 -2
- lusid/models/fx_forward_settlement_event.py +3 -3
- lusid/models/informational_error_event.py +3 -3
- lusid/models/informational_event.py +3 -3
- lusid/models/instrument_entity.py +146 -0
- lusid/models/instrument_event.py +6 -5
- lusid/models/instrument_event_type.py +1 -0
- lusid/models/lusid_instrument.py +3 -2
- lusid/models/market_data_key_rule.py +3 -3
- lusid/models/market_data_specific_rule.py +3 -3
- lusid/models/market_quote.py +3 -3
- lusid/models/maturity_event.py +3 -3
- lusid/models/merger_event.py +3 -3
- lusid/models/model_selection.py +3 -3
- lusid/models/open_event.py +3 -3
- lusid/models/paged_resource_list_of_fund_configuration.py +113 -0
- lusid/models/placement_update_request.py +116 -0
- lusid/models/portfolio.py +3 -3
- lusid/models/portfolio_details.py +3 -3
- lusid/models/portfolio_without_href.py +3 -3
- lusid/models/pre_trade_configuration.py +69 -0
- lusid/models/previous_fund_valuation_point_data.py +79 -0
- lusid/models/previous_nav.py +73 -0
- lusid/models/previous_share_class_breakdown.py +81 -0
- lusid/models/pricing_model.py +1 -0
- lusid/models/property_definition.py +7 -1
- lusid/models/property_definition_entity.py +146 -0
- lusid/models/quote_series_id.py +4 -20
- lusid/models/quote_type.py +3 -0
- lusid/models/raw_vendor_event.py +3 -3
- lusid/models/reset_event.py +3 -3
- lusid/models/reverse_stock_split_event.py +3 -3
- lusid/models/scrip_dividend_event.py +3 -3
- lusid/models/share_class_amount.py +73 -0
- lusid/models/share_class_breakdown.py +163 -0
- lusid/models/share_class_data.py +79 -0
- lusid/models/share_class_details.py +108 -0
- lusid/models/share_class_pnl_breakdown.py +110 -0
- lusid/models/spin_off_event.py +3 -3
- lusid/models/staged_modification.py +8 -1
- lusid/models/stock_dividend_event.py +3 -3
- lusid/models/stock_split_event.py +3 -3
- lusid/models/template_field.py +3 -1
- lusid/models/transaction_configuration_movement_data.py +2 -2
- lusid/models/transaction_configuration_movement_data_request.py +1 -1
- lusid/models/transaction_field_map.py +8 -3
- lusid/models/transaction_type_movement.py +2 -2
- lusid/models/transition_event.py +3 -3
- lusid/models/trigger_event.py +3 -3
- lusid/models/unitisation_data.py +73 -0
- lusid/models/update_placements_response.py +153 -0
- lusid/models/valuation_point_data_response.py +30 -9
- {lusid_sdk-2.1.242.dist-info → lusid_sdk-2.1.320.dist-info}/METADATA +53 -215
- {lusid_sdk-2.1.242.dist-info → lusid_sdk-2.1.320.dist-info}/RECORD +104 -71
- {lusid_sdk-2.1.242.dist-info → lusid_sdk-2.1.320.dist-info}/WHEEL +0 -0
@@ -0,0 +1,152 @@
|
|
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, StrictFloat, StrictInt
|
23
|
+
from lusid.models.fee_accrual import FeeAccrual
|
24
|
+
from lusid.models.fund_amount import FundAmount
|
25
|
+
from lusid.models.fund_pnl_breakdown import FundPnlBreakdown
|
26
|
+
from lusid.models.previous_fund_valuation_point_data import PreviousFundValuationPointData
|
27
|
+
from lusid.models.unitisation_data import UnitisationData
|
28
|
+
|
29
|
+
class FundValuationPointData(BaseModel):
|
30
|
+
"""
|
31
|
+
The Valuation Point Data for a Fund on a specified date. # noqa: E501
|
32
|
+
"""
|
33
|
+
back_out: Dict[str, FundAmount] = Field(..., alias="backOut", description="Bucket of detail for the Valuation Point where data points have been 'backed out'.")
|
34
|
+
dealing: Dict[str, FundAmount] = Field(..., description="Bucket of detail for any 'Dealing' that has occured inside the queried period.")
|
35
|
+
pn_l: FundPnlBreakdown = Field(..., alias="pnL")
|
36
|
+
gav: Union[StrictFloat, StrictInt] = Field(..., description="The Gross Asset Value of the Fund or Share Class at the Valuation Point. This is effectively a summation of all Trial balance entries linked to accounts of types 'Asset' and 'Liabilities'.")
|
37
|
+
fees: Dict[str, FeeAccrual] = Field(..., description="Bucket of detail for any 'Fees' that have been charged in the selected period.")
|
38
|
+
nav: Union[StrictFloat, StrictInt] = Field(..., description="The Net Asset Value of the Fund or Share Class at the Valuation Point. This represents the GAV with any fees applied in the period.")
|
39
|
+
unitisation: Optional[UnitisationData] = None
|
40
|
+
miscellaneous: Optional[Dict[str, FundAmount]] = 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).")
|
41
|
+
previous_valuation_point_data: Optional[PreviousFundValuationPointData] = Field(None, alias="previousValuationPointData")
|
42
|
+
__properties = ["backOut", "dealing", "pnL", "gav", "fees", "nav", "unitisation", "miscellaneous", "previousValuationPointData"]
|
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) -> FundValuationPointData:
|
59
|
+
"""Create an instance of FundValuationPointData 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
|
+
},
|
67
|
+
exclude_none=True)
|
68
|
+
# override the default output from pydantic by calling `to_dict()` of each value in back_out (dict)
|
69
|
+
_field_dict = {}
|
70
|
+
if self.back_out:
|
71
|
+
for _key in self.back_out:
|
72
|
+
if self.back_out[_key]:
|
73
|
+
_field_dict[_key] = self.back_out[_key].to_dict()
|
74
|
+
_dict['backOut'] = _field_dict
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of each value in dealing (dict)
|
76
|
+
_field_dict = {}
|
77
|
+
if self.dealing:
|
78
|
+
for _key in self.dealing:
|
79
|
+
if self.dealing[_key]:
|
80
|
+
_field_dict[_key] = self.dealing[_key].to_dict()
|
81
|
+
_dict['dealing'] = _field_dict
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of pn_l
|
83
|
+
if self.pn_l:
|
84
|
+
_dict['pnL'] = self.pn_l.to_dict()
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of each value in fees (dict)
|
86
|
+
_field_dict = {}
|
87
|
+
if self.fees:
|
88
|
+
for _key in self.fees:
|
89
|
+
if self.fees[_key]:
|
90
|
+
_field_dict[_key] = self.fees[_key].to_dict()
|
91
|
+
_dict['fees'] = _field_dict
|
92
|
+
# override the default output from pydantic by calling `to_dict()` of unitisation
|
93
|
+
if self.unitisation:
|
94
|
+
_dict['unitisation'] = self.unitisation.to_dict()
|
95
|
+
# override the default output from pydantic by calling `to_dict()` of each value in miscellaneous (dict)
|
96
|
+
_field_dict = {}
|
97
|
+
if self.miscellaneous:
|
98
|
+
for _key in self.miscellaneous:
|
99
|
+
if self.miscellaneous[_key]:
|
100
|
+
_field_dict[_key] = self.miscellaneous[_key].to_dict()
|
101
|
+
_dict['miscellaneous'] = _field_dict
|
102
|
+
# override the default output from pydantic by calling `to_dict()` of previous_valuation_point_data
|
103
|
+
if self.previous_valuation_point_data:
|
104
|
+
_dict['previousValuationPointData'] = self.previous_valuation_point_data.to_dict()
|
105
|
+
# set to None if miscellaneous (nullable) is None
|
106
|
+
# and __fields_set__ contains the field
|
107
|
+
if self.miscellaneous is None and "miscellaneous" in self.__fields_set__:
|
108
|
+
_dict['miscellaneous'] = None
|
109
|
+
|
110
|
+
return _dict
|
111
|
+
|
112
|
+
@classmethod
|
113
|
+
def from_dict(cls, obj: dict) -> FundValuationPointData:
|
114
|
+
"""Create an instance of FundValuationPointData from a dict"""
|
115
|
+
if obj is None:
|
116
|
+
return None
|
117
|
+
|
118
|
+
if not isinstance(obj, dict):
|
119
|
+
return FundValuationPointData.parse_obj(obj)
|
120
|
+
|
121
|
+
_obj = FundValuationPointData.parse_obj({
|
122
|
+
"back_out": dict(
|
123
|
+
(_k, FundAmount.from_dict(_v))
|
124
|
+
for _k, _v in obj.get("backOut").items()
|
125
|
+
)
|
126
|
+
if obj.get("backOut") is not None
|
127
|
+
else None,
|
128
|
+
"dealing": dict(
|
129
|
+
(_k, FundAmount.from_dict(_v))
|
130
|
+
for _k, _v in obj.get("dealing").items()
|
131
|
+
)
|
132
|
+
if obj.get("dealing") is not None
|
133
|
+
else None,
|
134
|
+
"pn_l": FundPnlBreakdown.from_dict(obj.get("pnL")) if obj.get("pnL") is not None else None,
|
135
|
+
"gav": obj.get("gav"),
|
136
|
+
"fees": dict(
|
137
|
+
(_k, FeeAccrual.from_dict(_v))
|
138
|
+
for _k, _v in obj.get("fees").items()
|
139
|
+
)
|
140
|
+
if obj.get("fees") is not None
|
141
|
+
else None,
|
142
|
+
"nav": obj.get("nav"),
|
143
|
+
"unitisation": UnitisationData.from_dict(obj.get("unitisation")) if obj.get("unitisation") is not None else None,
|
144
|
+
"miscellaneous": dict(
|
145
|
+
(_k, FundAmount.from_dict(_v))
|
146
|
+
for _k, _v in obj.get("miscellaneous").items()
|
147
|
+
)
|
148
|
+
if obj.get("miscellaneous") is not None
|
149
|
+
else None,
|
150
|
+
"previous_valuation_point_data": PreviousFundValuationPointData.from_dict(obj.get("previousValuationPointData")) if obj.get("previousValuationPointData") is not None else None
|
151
|
+
})
|
152
|
+
return _obj
|
@@ -0,0 +1,100 @@
|
|
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 FutureExpiryEvent(InstrumentEvent):
|
26
|
+
"""
|
27
|
+
Definition of a Future Expiry Event. This is an event that describes the expiry of a Future instrument. # noqa: E501
|
28
|
+
"""
|
29
|
+
expiry_date: datetime = Field(..., alias="expiryDate", description="Expiry date of the Future instrument.")
|
30
|
+
settlement_currency: StrictStr = Field(..., alias="settlementCurrency", description="Settlement currency of the Future instrument.")
|
31
|
+
notional_amount_per_unit: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="notionalAmountPerUnit", description="The notional amount of each unit in the Future instrument.")
|
32
|
+
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")
|
33
|
+
additional_properties: Dict[str, Any] = {}
|
34
|
+
__properties = ["instrumentEventType", "expiryDate", "settlementCurrency", "notionalAmountPerUnit"]
|
35
|
+
|
36
|
+
@validator('instrument_event_type')
|
37
|
+
def instrument_event_type_validate_enum(cls, value):
|
38
|
+
"""Validates the enum"""
|
39
|
+
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'):
|
40
|
+
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')")
|
41
|
+
return value
|
42
|
+
|
43
|
+
class Config:
|
44
|
+
"""Pydantic configuration"""
|
45
|
+
allow_population_by_field_name = True
|
46
|
+
validate_assignment = True
|
47
|
+
|
48
|
+
def to_str(self) -> str:
|
49
|
+
"""Returns the string representation of the model using alias"""
|
50
|
+
return pprint.pformat(self.dict(by_alias=True))
|
51
|
+
|
52
|
+
def to_json(self) -> str:
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
54
|
+
return json.dumps(self.to_dict())
|
55
|
+
|
56
|
+
@classmethod
|
57
|
+
def from_json(cls, json_str: str) -> FutureExpiryEvent:
|
58
|
+
"""Create an instance of FutureExpiryEvent from a JSON string"""
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
60
|
+
|
61
|
+
def to_dict(self):
|
62
|
+
"""Returns the dictionary representation of the model using alias"""
|
63
|
+
_dict = self.dict(by_alias=True,
|
64
|
+
exclude={
|
65
|
+
"additional_properties"
|
66
|
+
},
|
67
|
+
exclude_none=True)
|
68
|
+
# puts key-value pairs in additional_properties in the top level
|
69
|
+
if self.additional_properties is not None:
|
70
|
+
for _key, _value in self.additional_properties.items():
|
71
|
+
_dict[_key] = _value
|
72
|
+
|
73
|
+
# set to None if notional_amount_per_unit (nullable) is None
|
74
|
+
# and __fields_set__ contains the field
|
75
|
+
if self.notional_amount_per_unit is None and "notional_amount_per_unit" in self.__fields_set__:
|
76
|
+
_dict['notionalAmountPerUnit'] = None
|
77
|
+
|
78
|
+
return _dict
|
79
|
+
|
80
|
+
@classmethod
|
81
|
+
def from_dict(cls, obj: dict) -> FutureExpiryEvent:
|
82
|
+
"""Create an instance of FutureExpiryEvent from a dict"""
|
83
|
+
if obj is None:
|
84
|
+
return None
|
85
|
+
|
86
|
+
if not isinstance(obj, dict):
|
87
|
+
return FutureExpiryEvent.parse_obj(obj)
|
88
|
+
|
89
|
+
_obj = FutureExpiryEvent.parse_obj({
|
90
|
+
"instrument_event_type": obj.get("instrumentEventType"),
|
91
|
+
"expiry_date": obj.get("expiryDate"),
|
92
|
+
"settlement_currency": obj.get("settlementCurrency"),
|
93
|
+
"notional_amount_per_unit": obj.get("notionalAmountPerUnit")
|
94
|
+
})
|
95
|
+
# store additional fields in additional_properties
|
96
|
+
for _key in obj.keys():
|
97
|
+
if _key not in cls.__properties:
|
98
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
99
|
+
|
100
|
+
return _obj
|
@@ -39,7 +39,8 @@ class FuturesContractDetails(BaseModel):
|
|
39
39
|
ticker_step: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tickerStep", description="Minimal step size change in ticker.")
|
40
40
|
unit_value: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="unitValue", description="The value in the currency of a 1 unit change in the contract price.")
|
41
41
|
calendars: Optional[conlist(StrictStr)] = Field(None, description="Holiday calendars that apply to yield-to-price conversions (i.e. for BRL futures).")
|
42
|
-
|
42
|
+
delivery_type: Optional[StrictStr] = Field(None, alias="deliveryType", description="Delivery type to be used on settling the contract. Optional: Defaults to DeliveryType.Physical if not provided. Supported string (enumeration) values are: [Cash, Physical].")
|
43
|
+
__properties = ["domCcy", "fgnCcy", "assetClass", "contractCode", "contractMonth", "contractSize", "convention", "country", "description", "exchangeCode", "exchangeName", "tickerStep", "unitValue", "calendars", "deliveryType"]
|
43
44
|
|
44
45
|
class Config:
|
45
46
|
"""Pydantic configuration"""
|
@@ -100,6 +101,11 @@ class FuturesContractDetails(BaseModel):
|
|
100
101
|
if self.calendars is None and "calendars" in self.__fields_set__:
|
101
102
|
_dict['calendars'] = None
|
102
103
|
|
104
|
+
# set to None if delivery_type (nullable) is None
|
105
|
+
# and __fields_set__ contains the field
|
106
|
+
if self.delivery_type is None and "delivery_type" in self.__fields_set__:
|
107
|
+
_dict['deliveryType'] = None
|
108
|
+
|
103
109
|
return _dict
|
104
110
|
|
105
111
|
@classmethod
|
@@ -125,6 +131,7 @@ class FuturesContractDetails(BaseModel):
|
|
125
131
|
"exchange_name": obj.get("exchangeName"),
|
126
132
|
"ticker_step": obj.get("tickerStep"),
|
127
133
|
"unit_value": obj.get("unitValue"),
|
128
|
-
"calendars": obj.get("calendars")
|
134
|
+
"calendars": obj.get("calendars"),
|
135
|
+
"delivery_type": obj.get("deliveryType")
|
129
136
|
})
|
130
137
|
return _obj
|
@@ -37,15 +37,15 @@ class FxForwardSettlementEvent(InstrumentEvent):
|
|
37
37
|
cash_flow_per_unit: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="cashFlowPerUnit", description="Optional. Required if the event is an NDF (i.e. if IsNdf = true). CashFlow per unit. Paid in the SettlementCcy.")
|
38
38
|
domestic_to_foreign_rate: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="domesticToForeignRate", description="Domestic currency to foreign currency FX rate. Not required, only used to override quotes.")
|
39
39
|
domestic_to_settlement_rate: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="domesticToSettlementRate", description="Domestic currency to settlement currency FX rate Not required, only used to override quotes.")
|
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")
|
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")
|
41
41
|
additional_properties: Dict[str, Any] = {}
|
42
42
|
__properties = ["instrumentEventType", "maturityDate", "domAmountPerUnit", "domCcy", "fgnAmountPerUnit", "fgnCcy", "isNdf", "fixingDate", "settlementCcy", "cashFlowPerUnit", "domesticToForeignRate", "domesticToSettlementRate"]
|
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'):
|
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')")
|
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')")
|
49
49
|
return value
|
50
50
|
|
51
51
|
class Config:
|
@@ -29,15 +29,15 @@ class InformationalErrorEvent(InstrumentEvent):
|
|
29
29
|
error_detail: constr(strict=True, min_length=1) = Field(..., alias="errorDetail", description="The details of the error")
|
30
30
|
error_reason: constr(strict=True, min_length=1) = Field(..., alias="errorReason", description="The error reason")
|
31
31
|
effective_at: datetime = Field(..., alias="effectiveAt", description="The effective date of the evaulation")
|
32
|
-
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")
|
32
|
+
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")
|
33
33
|
additional_properties: Dict[str, Any] = {}
|
34
34
|
__properties = ["instrumentEventType", "errorDetail", "errorReason", "effectiveAt"]
|
35
35
|
|
36
36
|
@validator('instrument_event_type')
|
37
37
|
def instrument_event_type_validate_enum(cls, value):
|
38
38
|
"""Validates the enum"""
|
39
|
-
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'):
|
40
|
-
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
|
+
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'):
|
40
|
+
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')")
|
41
41
|
return value
|
42
42
|
|
43
43
|
class Config:
|
@@ -31,15 +31,15 @@ class InformationalEvent(InstrumentEvent):
|
|
31
31
|
anchor_date: datetime = Field(..., alias="anchorDate", description="In the case of a point event, the single date on which the event occurs. In the case of an event which is spread over a window, e.g. a barrier or American option, the start of that window.")
|
32
32
|
event_window_end: Optional[datetime] = Field(None, alias="eventWindowEnd", description="In the case of a point event this is identical to the anchor date. In the case of an event that is spread over a window, this is the end of that window.")
|
33
33
|
diagnostics: Optional[ResultValueDictionary] = None
|
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")
|
34
|
+
instrument_event_type: StrictStr = Field(..., alias="instrumentEventType", description="The Type of Event. The available values are: TransitionEvent, InformationalEvent, OpenEvent, CloseEvent, StockSplitEvent, BondDefaultEvent, CashDividendEvent, AmortisationEvent, CashFlowEvent, ExerciseEvent, ResetEvent, TriggerEvent, RawVendorEvent, InformationalErrorEvent, BondCouponEvent, DividendReinvestmentEvent, AccumulationEvent, BondPrincipalEvent, DividendOptionEvent, MaturityEvent, FxForwardSettlementEvent, ExpiryEvent, ScripDividendEvent, StockDividendEvent, ReverseStockSplitEvent, CapitalDistributionEvent, SpinOffEvent, MergerEvent, FutureExpiryEvent")
|
35
35
|
additional_properties: Dict[str, Any] = {}
|
36
36
|
__properties = ["instrumentEventType", "eventType", "anchorDate", "eventWindowEnd", "diagnostics"]
|
37
37
|
|
38
38
|
@validator('instrument_event_type')
|
39
39
|
def instrument_event_type_validate_enum(cls, value):
|
40
40
|
"""Validates the enum"""
|
41
|
-
if value not in ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent'):
|
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')")
|
41
|
+
if value not in ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent'):
|
42
|
+
raise ValueError("must be one of enum values ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent')")
|
43
43
|
return value
|
44
44
|
|
45
45
|
class Config:
|
@@ -0,0 +1,146 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
LUSID API
|
5
|
+
|
6
|
+
FINBOURNE Technology # noqa: E501
|
7
|
+
|
8
|
+
Contact: info@finbourne.com
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
"""
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from datetime import datetime
|
21
|
+
from typing import Any, Dict, List, Optional
|
22
|
+
from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, conlist, constr
|
23
|
+
from lusid.models.instrument import Instrument
|
24
|
+
from lusid.models.link import Link
|
25
|
+
|
26
|
+
class InstrumentEntity(BaseModel):
|
27
|
+
"""
|
28
|
+
A list of instruments. # noqa: E501
|
29
|
+
"""
|
30
|
+
href: StrictStr = Field(..., description="The specific Uniform Resource Identifier (URI) for this resource at the requested effective and asAt datetime.")
|
31
|
+
entity_unique_id: constr(strict=True, min_length=1) = Field(..., alias="entityUniqueId", description="The unique id of the entity.")
|
32
|
+
as_at_version_number: Optional[StrictInt] = Field(None, alias="asAtVersionNumber", description="The integer version number for the entity (the entity was created at version 1)")
|
33
|
+
status: constr(strict=True, min_length=1) = Field(..., description="The status of the entity at the current time.")
|
34
|
+
as_at_deleted: Optional[datetime] = Field(None, alias="asAtDeleted", description="The asAt datetime at which the entity was deleted.")
|
35
|
+
user_id_deleted: Optional[StrictStr] = Field(None, alias="userIdDeleted", description="The unique id of the user who deleted the entity.")
|
36
|
+
request_id_deleted: Optional[StrictStr] = Field(None, alias="requestIdDeleted", description="The unique request id of the command that deleted the entity.")
|
37
|
+
effective_at_created: Optional[datetime] = Field(None, alias="effectiveAtCreated", description="The EffectiveAt this Entity is created, if entity does not currently exist in EffectiveAt.")
|
38
|
+
prevailing_instrument: Optional[Instrument] = Field(None, alias="prevailingInstrument")
|
39
|
+
deleted_instrument: Optional[Instrument] = Field(None, alias="deletedInstrument")
|
40
|
+
previewed_status: Optional[StrictStr] = Field(None, alias="previewedStatus", description="The status of the previewed entity.")
|
41
|
+
previewed_instrument: Optional[Instrument] = Field(None, alias="previewedInstrument")
|
42
|
+
links: Optional[conlist(Link)] = None
|
43
|
+
__properties = ["href", "entityUniqueId", "asAtVersionNumber", "status", "asAtDeleted", "userIdDeleted", "requestIdDeleted", "effectiveAtCreated", "prevailingInstrument", "deletedInstrument", "previewedStatus", "previewedInstrument", "links"]
|
44
|
+
|
45
|
+
class Config:
|
46
|
+
"""Pydantic configuration"""
|
47
|
+
allow_population_by_field_name = True
|
48
|
+
validate_assignment = True
|
49
|
+
|
50
|
+
def to_str(self) -> str:
|
51
|
+
"""Returns the string representation of the model using alias"""
|
52
|
+
return pprint.pformat(self.dict(by_alias=True))
|
53
|
+
|
54
|
+
def to_json(self) -> str:
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
56
|
+
return json.dumps(self.to_dict())
|
57
|
+
|
58
|
+
@classmethod
|
59
|
+
def from_json(cls, json_str: str) -> InstrumentEntity:
|
60
|
+
"""Create an instance of InstrumentEntity from a JSON string"""
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
62
|
+
|
63
|
+
def to_dict(self):
|
64
|
+
"""Returns the dictionary representation of the model using alias"""
|
65
|
+
_dict = self.dict(by_alias=True,
|
66
|
+
exclude={
|
67
|
+
},
|
68
|
+
exclude_none=True)
|
69
|
+
# override the default output from pydantic by calling `to_dict()` of prevailing_instrument
|
70
|
+
if self.prevailing_instrument:
|
71
|
+
_dict['prevailingInstrument'] = self.prevailing_instrument.to_dict()
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of deleted_instrument
|
73
|
+
if self.deleted_instrument:
|
74
|
+
_dict['deletedInstrument'] = self.deleted_instrument.to_dict()
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of previewed_instrument
|
76
|
+
if self.previewed_instrument:
|
77
|
+
_dict['previewedInstrument'] = self.previewed_instrument.to_dict()
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of each item in links (list)
|
79
|
+
_items = []
|
80
|
+
if self.links:
|
81
|
+
for _item in self.links:
|
82
|
+
if _item:
|
83
|
+
_items.append(_item.to_dict())
|
84
|
+
_dict['links'] = _items
|
85
|
+
# set to None if as_at_version_number (nullable) is None
|
86
|
+
# and __fields_set__ contains the field
|
87
|
+
if self.as_at_version_number is None and "as_at_version_number" in self.__fields_set__:
|
88
|
+
_dict['asAtVersionNumber'] = None
|
89
|
+
|
90
|
+
# set to None if as_at_deleted (nullable) is None
|
91
|
+
# and __fields_set__ contains the field
|
92
|
+
if self.as_at_deleted is None and "as_at_deleted" in self.__fields_set__:
|
93
|
+
_dict['asAtDeleted'] = None
|
94
|
+
|
95
|
+
# set to None if user_id_deleted (nullable) is None
|
96
|
+
# and __fields_set__ contains the field
|
97
|
+
if self.user_id_deleted is None and "user_id_deleted" in self.__fields_set__:
|
98
|
+
_dict['userIdDeleted'] = None
|
99
|
+
|
100
|
+
# set to None if request_id_deleted (nullable) is None
|
101
|
+
# and __fields_set__ contains the field
|
102
|
+
if self.request_id_deleted is None and "request_id_deleted" in self.__fields_set__:
|
103
|
+
_dict['requestIdDeleted'] = None
|
104
|
+
|
105
|
+
# set to None if effective_at_created (nullable) is None
|
106
|
+
# and __fields_set__ contains the field
|
107
|
+
if self.effective_at_created is None and "effective_at_created" in self.__fields_set__:
|
108
|
+
_dict['effectiveAtCreated'] = None
|
109
|
+
|
110
|
+
# set to None if previewed_status (nullable) is None
|
111
|
+
# and __fields_set__ contains the field
|
112
|
+
if self.previewed_status is None and "previewed_status" in self.__fields_set__:
|
113
|
+
_dict['previewedStatus'] = None
|
114
|
+
|
115
|
+
# set to None if links (nullable) is None
|
116
|
+
# and __fields_set__ contains the field
|
117
|
+
if self.links is None and "links" in self.__fields_set__:
|
118
|
+
_dict['links'] = None
|
119
|
+
|
120
|
+
return _dict
|
121
|
+
|
122
|
+
@classmethod
|
123
|
+
def from_dict(cls, obj: dict) -> InstrumentEntity:
|
124
|
+
"""Create an instance of InstrumentEntity from a dict"""
|
125
|
+
if obj is None:
|
126
|
+
return None
|
127
|
+
|
128
|
+
if not isinstance(obj, dict):
|
129
|
+
return InstrumentEntity.parse_obj(obj)
|
130
|
+
|
131
|
+
_obj = InstrumentEntity.parse_obj({
|
132
|
+
"href": obj.get("href"),
|
133
|
+
"entity_unique_id": obj.get("entityUniqueId"),
|
134
|
+
"as_at_version_number": obj.get("asAtVersionNumber"),
|
135
|
+
"status": obj.get("status"),
|
136
|
+
"as_at_deleted": obj.get("asAtDeleted"),
|
137
|
+
"user_id_deleted": obj.get("userIdDeleted"),
|
138
|
+
"request_id_deleted": obj.get("requestIdDeleted"),
|
139
|
+
"effective_at_created": obj.get("effectiveAtCreated"),
|
140
|
+
"prevailing_instrument": Instrument.from_dict(obj.get("prevailingInstrument")) if obj.get("prevailingInstrument") is not None else None,
|
141
|
+
"deleted_instrument": Instrument.from_dict(obj.get("deletedInstrument")) if obj.get("deletedInstrument") is not None else None,
|
142
|
+
"previewed_status": obj.get("previewedStatus"),
|
143
|
+
"previewed_instrument": Instrument.from_dict(obj.get("previewedInstrument")) if obj.get("previewedInstrument") is not None else None,
|
144
|
+
"links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
|
145
|
+
})
|
146
|
+
return _obj
|
lusid/models/instrument_event.py
CHANGED
@@ -26,14 +26,14 @@ class InstrumentEvent(BaseModel):
|
|
26
26
|
"""
|
27
27
|
Base class for representing instrument events in LUSID, such as dividends, stock splits, and option exercises. This base class should not be directly instantiated; each supported InstrumentEventType has a corresponding inherited class. # noqa: E501
|
28
28
|
"""
|
29
|
-
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")
|
29
|
+
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")
|
30
30
|
__properties = ["instrumentEventType"]
|
31
31
|
|
32
32
|
@validator('instrument_event_type')
|
33
33
|
def instrument_event_type_validate_enum(cls, value):
|
34
34
|
"""Validates the enum"""
|
35
|
-
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'):
|
36
|
-
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')")
|
35
|
+
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'):
|
36
|
+
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')")
|
37
37
|
return value
|
38
38
|
|
39
39
|
class Config:
|
@@ -59,6 +59,7 @@ class InstrumentEvent(BaseModel):
|
|
59
59
|
'DividendReinvestmentEvent': 'DividendReinvestmentEvent',
|
60
60
|
'ExerciseEvent': 'ExerciseEvent',
|
61
61
|
'ExpiryEvent': 'ExpiryEvent',
|
62
|
+
'FutureExpiryEvent': 'FutureExpiryEvent',
|
62
63
|
'FxForwardSettlementEvent': 'FxForwardSettlementEvent',
|
63
64
|
'InformationalErrorEvent': 'InformationalErrorEvent',
|
64
65
|
'InformationalEvent': 'InformationalEvent',
|
@@ -94,7 +95,7 @@ class InstrumentEvent(BaseModel):
|
|
94
95
|
return json.dumps(self.to_dict())
|
95
96
|
|
96
97
|
@classmethod
|
97
|
-
def from_json(cls, json_str: str) -> Union(AccumulationEvent, AmortisationEvent, BondCouponEvent, BondDefaultEvent, BondPrincipalEvent, CapitalDistributionEvent, CashDividendEvent, CashFlowEvent, CloseEvent, DividendOptionEvent, DividendReinvestmentEvent, ExerciseEvent, ExpiryEvent, FxForwardSettlementEvent, InformationalErrorEvent, InformationalEvent, MaturityEvent, MergerEvent, OpenEvent, RawVendorEvent, ResetEvent, ReverseStockSplitEvent, ScripDividendEvent, SpinOffEvent, StockDividendEvent, StockSplitEvent, TransitionEvent, TriggerEvent):
|
98
|
+
def from_json(cls, json_str: str) -> Union(AccumulationEvent, AmortisationEvent, BondCouponEvent, BondDefaultEvent, BondPrincipalEvent, CapitalDistributionEvent, CashDividendEvent, CashFlowEvent, CloseEvent, DividendOptionEvent, DividendReinvestmentEvent, ExerciseEvent, ExpiryEvent, FutureExpiryEvent, FxForwardSettlementEvent, InformationalErrorEvent, InformationalEvent, MaturityEvent, MergerEvent, OpenEvent, RawVendorEvent, ResetEvent, ReverseStockSplitEvent, ScripDividendEvent, SpinOffEvent, StockDividendEvent, StockSplitEvent, TransitionEvent, TriggerEvent):
|
98
99
|
"""Create an instance of InstrumentEvent from a JSON string"""
|
99
100
|
return cls.from_dict(json.loads(json_str))
|
100
101
|
|
@@ -107,7 +108,7 @@ class InstrumentEvent(BaseModel):
|
|
107
108
|
return _dict
|
108
109
|
|
109
110
|
@classmethod
|
110
|
-
def from_dict(cls, obj: dict) -> Union(AccumulationEvent, AmortisationEvent, BondCouponEvent, BondDefaultEvent, BondPrincipalEvent, CapitalDistributionEvent, CashDividendEvent, CashFlowEvent, CloseEvent, DividendOptionEvent, DividendReinvestmentEvent, ExerciseEvent, ExpiryEvent, FxForwardSettlementEvent, InformationalErrorEvent, InformationalEvent, MaturityEvent, MergerEvent, OpenEvent, RawVendorEvent, ResetEvent, ReverseStockSplitEvent, ScripDividendEvent, SpinOffEvent, StockDividendEvent, StockSplitEvent, TransitionEvent, TriggerEvent):
|
111
|
+
def from_dict(cls, obj: dict) -> Union(AccumulationEvent, AmortisationEvent, BondCouponEvent, BondDefaultEvent, BondPrincipalEvent, CapitalDistributionEvent, CashDividendEvent, CashFlowEvent, CloseEvent, DividendOptionEvent, DividendReinvestmentEvent, ExerciseEvent, ExpiryEvent, FutureExpiryEvent, FxForwardSettlementEvent, InformationalErrorEvent, InformationalEvent, MaturityEvent, MergerEvent, OpenEvent, RawVendorEvent, ResetEvent, ReverseStockSplitEvent, ScripDividendEvent, SpinOffEvent, StockDividendEvent, StockSplitEvent, TransitionEvent, TriggerEvent):
|
111
112
|
"""Create an instance of InstrumentEvent from a dict"""
|
112
113
|
# look up the object type based on discriminator mapping
|
113
114
|
object_type = cls.get_discriminator_value(obj)
|
@@ -57,6 +57,7 @@ class InstrumentEventType(str, Enum):
|
|
57
57
|
CAPITALDISTRIBUTIONEVENT = 'CapitalDistributionEvent'
|
58
58
|
SPINOFFEVENT = 'SpinOffEvent'
|
59
59
|
MERGEREVENT = 'MergerEvent'
|
60
|
+
FUTUREEXPIRYEVENT = 'FutureExpiryEvent'
|
60
61
|
|
61
62
|
@classmethod
|
62
63
|
def from_json(cls, json_str: str) -> InstrumentEventType:
|
lusid/models/lusid_instrument.py
CHANGED
@@ -49,6 +49,7 @@ class LusidInstrument(BaseModel):
|
|
49
49
|
'Basket': 'Basket',
|
50
50
|
'Bond': 'Bond',
|
51
51
|
'CapFloor': 'CapFloor',
|
52
|
+
'Cash': 'Cash',
|
52
53
|
'CashPerpetual': 'CashPerpetual',
|
53
54
|
'CdsIndex': 'CdsIndex',
|
54
55
|
'ComplexBond': 'ComplexBond',
|
@@ -101,7 +102,7 @@ class LusidInstrument(BaseModel):
|
|
101
102
|
return json.dumps(self.to_dict())
|
102
103
|
|
103
104
|
@classmethod
|
104
|
-
def from_json(cls, json_str: str) -> Union(Basket, Bond, CapFloor, CashPerpetual, CdsIndex, ComplexBond, ContractForDifference, CreditDefaultSwap, Equity, EquityOption, EquitySwap, ExchangeTradedOption, ExoticInstrument, FlexibleLoan, ForwardRateAgreement, FundShareClass, Future, FxForward, FxOption, FxSwap, InflationLeg, InflationLinkedBond, InflationSwap, InstrumentLeg, InterestRateSwap, InterestRateSwaption, ReferenceInstrument, Repo, SimpleCashFlowLoan, SimpleInstrument, TermDeposit, TotalReturnSwap):
|
105
|
+
def from_json(cls, json_str: str) -> Union(Basket, Bond, CapFloor, Cash, CashPerpetual, CdsIndex, ComplexBond, ContractForDifference, CreditDefaultSwap, Equity, EquityOption, EquitySwap, ExchangeTradedOption, ExoticInstrument, FlexibleLoan, ForwardRateAgreement, FundShareClass, Future, FxForward, FxOption, FxSwap, InflationLeg, InflationLinkedBond, InflationSwap, InstrumentLeg, InterestRateSwap, InterestRateSwaption, ReferenceInstrument, Repo, SimpleCashFlowLoan, SimpleInstrument, TermDeposit, TotalReturnSwap):
|
105
106
|
"""Create an instance of LusidInstrument from a JSON string"""
|
106
107
|
return cls.from_dict(json.loads(json_str))
|
107
108
|
|
@@ -114,7 +115,7 @@ class LusidInstrument(BaseModel):
|
|
114
115
|
return _dict
|
115
116
|
|
116
117
|
@classmethod
|
117
|
-
def from_dict(cls, obj: dict) -> Union(Basket, Bond, CapFloor, CashPerpetual, CdsIndex, ComplexBond, ContractForDifference, CreditDefaultSwap, Equity, EquityOption, EquitySwap, ExchangeTradedOption, ExoticInstrument, FlexibleLoan, ForwardRateAgreement, FundShareClass, Future, FxForward, FxOption, FxSwap, InflationLeg, InflationLinkedBond, InflationSwap, InstrumentLeg, InterestRateSwap, InterestRateSwaption, ReferenceInstrument, Repo, SimpleCashFlowLoan, SimpleInstrument, TermDeposit, TotalReturnSwap):
|
118
|
+
def from_dict(cls, obj: dict) -> Union(Basket, Bond, CapFloor, Cash, CashPerpetual, CdsIndex, ComplexBond, ContractForDifference, CreditDefaultSwap, Equity, EquityOption, EquitySwap, ExchangeTradedOption, ExoticInstrument, FlexibleLoan, ForwardRateAgreement, FundShareClass, Future, FxForward, FxOption, FxSwap, InflationLeg, InflationLinkedBond, InflationSwap, InstrumentLeg, InterestRateSwap, InterestRateSwaption, ReferenceInstrument, Repo, SimpleCashFlowLoan, SimpleInstrument, TermDeposit, TotalReturnSwap):
|
118
119
|
"""Create an instance of LusidInstrument from a dict"""
|
119
120
|
# look up the object type based on discriminator mapping
|
120
121
|
object_type = cls.get_discriminator_value(obj)
|