lusid-sdk 2.1.677__py3-none-any.whl → 2.1.679__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/configuration.py +1 -1
- lusid/models/loan_facility.py +16 -4
- lusid/models/transaction_type_property_mapping.py +19 -2
- {lusid_sdk-2.1.677.dist-info → lusid_sdk-2.1.679.dist-info}/METADATA +1 -1
- {lusid_sdk-2.1.677.dist-info → lusid_sdk-2.1.679.dist-info}/RECORD +6 -6
- {lusid_sdk-2.1.677.dist-info → lusid_sdk-2.1.679.dist-info}/WHEEL +0 -0
lusid/configuration.py
CHANGED
@@ -445,7 +445,7 @@ class Configuration:
|
|
445
445
|
return "Python SDK Debug Report:\n"\
|
446
446
|
"OS: {env}\n"\
|
447
447
|
"Python Version: {pyversion}\n"\
|
448
|
-
"Version of the API: 0.11.
|
448
|
+
"Version of the API: 0.11.7291\n"\
|
449
449
|
"SDK Package Version: {package_version}".\
|
450
450
|
format(env=sys.platform, pyversion=sys.version, package_version=package_version)
|
451
451
|
|
lusid/models/loan_facility.py
CHANGED
@@ -18,9 +18,10 @@ import re # noqa: F401
|
|
18
18
|
import json
|
19
19
|
|
20
20
|
from datetime import datetime
|
21
|
-
from typing import Any, Dict
|
22
|
-
from pydantic.v1 import Field, StrictStr, validator
|
21
|
+
from typing import Any, Dict, List
|
22
|
+
from pydantic.v1 import Field, StrictStr, conlist, constr, validator
|
23
23
|
from lusid.models.lusid_instrument import LusidInstrument
|
24
|
+
from lusid.models.schedule import Schedule
|
24
25
|
|
25
26
|
class LoanFacility(LusidInstrument):
|
26
27
|
"""
|
@@ -29,9 +30,11 @@ class LoanFacility(LusidInstrument):
|
|
29
30
|
start_date: datetime = Field(..., alias="startDate", description="The start date of the instrument. This is normally synonymous with the trade-date.")
|
30
31
|
maturity_date: datetime = Field(..., alias="maturityDate", description="The final maturity date of the instrument. This means the last date on which the instruments makes a payment of any amount. For the avoidance of doubt, that is not necessarily prior to its last sensitivity date for the purposes of risk; e.g. instruments such as Constant Maturity Swaps (CMS) often have sensitivities to rates that may well be observed or set prior to the maturity date, but refer to a termination date beyond it.")
|
31
32
|
dom_ccy: StrictStr = Field(..., alias="domCcy", description="The domestic currency of the instrument.")
|
33
|
+
loan_type: constr(strict=True, min_length=1) = Field(..., alias="loanType", description="LoanType for this facility. The facility can either be a revolving or a term loan. Supported string (enumeration) values are: [Revolver, TermLoan].")
|
34
|
+
schedules: conlist(Schedule) = Field(..., description="Repayment schedules for the loan.")
|
32
35
|
instrument_type: StrictStr = Field(..., alias="instrumentType", description="The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashFlowsLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CapFloor, CashSettled, CdsIndex, Basket, FundingLeg, FxSwap, ForwardRateAgreement, SimpleInstrument, Repo, Equity, ExchangeTradedOption, ReferenceInstrument, ComplexBond, InflationLinkedBond, InflationSwap, SimpleCashFlowLoan, TotalReturnSwap, InflationLeg, FundShareClass, FlexibleLoan, UnsettledCash, Cash, MasteredInstrument, LoanFacility, FlexibleDeposit")
|
33
36
|
additional_properties: Dict[str, Any] = {}
|
34
|
-
__properties = ["instrumentType", "startDate", "maturityDate", "domCcy"]
|
37
|
+
__properties = ["instrumentType", "startDate", "maturityDate", "domCcy", "loanType", "schedules"]
|
35
38
|
|
36
39
|
@validator('instrument_type')
|
37
40
|
def instrument_type_validate_enum(cls, value):
|
@@ -73,6 +76,13 @@ class LoanFacility(LusidInstrument):
|
|
73
76
|
"additional_properties"
|
74
77
|
},
|
75
78
|
exclude_none=True)
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of each item in schedules (list)
|
80
|
+
_items = []
|
81
|
+
if self.schedules:
|
82
|
+
for _item in self.schedules:
|
83
|
+
if _item:
|
84
|
+
_items.append(_item.to_dict())
|
85
|
+
_dict['schedules'] = _items
|
76
86
|
# puts key-value pairs in additional_properties in the top level
|
77
87
|
if self.additional_properties is not None:
|
78
88
|
for _key, _value in self.additional_properties.items():
|
@@ -93,7 +103,9 @@ class LoanFacility(LusidInstrument):
|
|
93
103
|
"instrument_type": obj.get("instrumentType"),
|
94
104
|
"start_date": obj.get("startDate"),
|
95
105
|
"maturity_date": obj.get("maturityDate"),
|
96
|
-
"dom_ccy": obj.get("domCcy")
|
106
|
+
"dom_ccy": obj.get("domCcy"),
|
107
|
+
"loan_type": obj.get("loanType"),
|
108
|
+
"schedules": [Schedule.from_dict(_item) for _item in obj.get("schedules")] if obj.get("schedules") is not None else None
|
97
109
|
})
|
98
110
|
# store additional fields in additional_properties
|
99
111
|
for _key in obj.keys():
|
@@ -28,7 +28,8 @@ class TransactionTypePropertyMapping(BaseModel):
|
|
28
28
|
property_key: StrictStr = Field(..., alias="propertyKey", description="The key that uniquely identifies the property. It has the format {domain}/{scope}/{code}")
|
29
29
|
map_from: Optional[StrictStr] = Field(None, alias="mapFrom", description="The Property Key of the Property to map from")
|
30
30
|
set_to: Optional[constr(strict=True, max_length=512, min_length=0)] = Field(None, alias="setTo", description="A pointer to the Property being mapped from")
|
31
|
-
|
31
|
+
template_from: Optional[constr(strict=True, max_length=512, min_length=1)] = Field(None, alias="templateFrom", description="The template that defines how the property value is constructed from transaction, instrument and portfolio details.")
|
32
|
+
__properties = ["propertyKey", "mapFrom", "setTo", "templateFrom"]
|
32
33
|
|
33
34
|
@validator('set_to')
|
34
35
|
def set_to_validate_regular_expression(cls, value):
|
@@ -40,6 +41,16 @@ class TransactionTypePropertyMapping(BaseModel):
|
|
40
41
|
raise ValueError(r"must validate the regular expression /^[\s\S]*$/")
|
41
42
|
return value
|
42
43
|
|
44
|
+
@validator('template_from')
|
45
|
+
def template_from_validate_regular_expression(cls, value):
|
46
|
+
"""Validates the regular expression"""
|
47
|
+
if value is None:
|
48
|
+
return value
|
49
|
+
|
50
|
+
if not re.match(r"^[\s\S]*$", value):
|
51
|
+
raise ValueError(r"must validate the regular expression /^[\s\S]*$/")
|
52
|
+
return value
|
53
|
+
|
43
54
|
class Config:
|
44
55
|
"""Pydantic configuration"""
|
45
56
|
allow_population_by_field_name = True
|
@@ -82,6 +93,11 @@ class TransactionTypePropertyMapping(BaseModel):
|
|
82
93
|
if self.set_to is None and "set_to" in self.__fields_set__:
|
83
94
|
_dict['setTo'] = None
|
84
95
|
|
96
|
+
# set to None if template_from (nullable) is None
|
97
|
+
# and __fields_set__ contains the field
|
98
|
+
if self.template_from is None and "template_from" in self.__fields_set__:
|
99
|
+
_dict['templateFrom'] = None
|
100
|
+
|
85
101
|
return _dict
|
86
102
|
|
87
103
|
@classmethod
|
@@ -96,6 +112,7 @@ class TransactionTypePropertyMapping(BaseModel):
|
|
96
112
|
_obj = TransactionTypePropertyMapping.parse_obj({
|
97
113
|
"property_key": obj.get("propertyKey"),
|
98
114
|
"map_from": obj.get("mapFrom"),
|
99
|
-
"set_to": obj.get("setTo")
|
115
|
+
"set_to": obj.get("setTo"),
|
116
|
+
"template_from": obj.get("templateFrom")
|
100
117
|
})
|
101
118
|
return _obj
|
@@ -71,7 +71,7 @@ lusid/api/translation_api.py,sha256=nIyuLncCvVC5k2d7Nm32zR8AQ1dkrVm1OThkmELY_OM,
|
|
71
71
|
lusid/api/workspace_api.py,sha256=Yox1q7TDY-_O3HF-N8g5kGuNgp4unWvlSZmRZ6MNZO0,196701
|
72
72
|
lusid/api_client.py,sha256=ewMTmf9SRurY8pYnUx9jy24RdldPCOa4US38pnrVxjA,31140
|
73
73
|
lusid/api_response.py,sha256=6-gnhty6lu8MMAERt3_kTVD7UxQgWFfcjgpcq6iN5IU,855
|
74
|
-
lusid/configuration.py,sha256=
|
74
|
+
lusid/configuration.py,sha256=d0v9-BMTU00EIwYfH-tXmL5iy-MTFflDCbDtHo3hlRA,17972
|
75
75
|
lusid/exceptions.py,sha256=HIQwgmQrszLlcVCLaqex8dO0laVuejUyOMz7U2ZWJ6s,5326
|
76
76
|
lusid/extensions/__init__.py,sha256=dzDHEzpn-9smd2-_UMWQzeyX6Ha4jGf6fnqx7qxKxNI,630
|
77
77
|
lusid/extensions/api_client.py,sha256=GzygWg_h603QK1QS2HvAijuE2R1TnvoF6-Yg0CeM3ug,30943
|
@@ -626,7 +626,7 @@ lusid/models/link.py,sha256=VFgfjebDV-GeFukJsVZljcv9FXYj5c2b1x1Xc2ERv7I,2462
|
|
626
626
|
lusid/models/list_aggregation_reconciliation.py,sha256=yHkO9sqn9dFMC9hb_5ei1SH59ZkINwSs43722JD1TFE,3558
|
627
627
|
lusid/models/list_aggregation_response.py,sha256=dInlTbNsb_wV19nKDRKRf2T_QU9MtKvflHvSVY2H3XA,5625
|
628
628
|
lusid/models/list_complex_market_data_with_meta_data_response.py,sha256=lgKBJUqrpjtKEXWgvTCn8b8q-6R1NiabSqoUKBVPzw4,3814
|
629
|
-
lusid/models/loan_facility.py,sha256=
|
629
|
+
lusid/models/loan_facility.py,sha256=HNJdbmzo6fGI3XG4X_GBvCKRSRDGxFwMmYb8_VTjrvE,7476
|
630
630
|
lusid/models/loan_interest_repayment_event.py,sha256=0T4j-BaaX_sRbxv2czD84s-Zzro7tpzSrUEe6aZ2vQw,7589
|
631
631
|
lusid/models/loan_period.py,sha256=_etbhg_IaojuEys0N0rxwAAzO6bDCA1JHLiOAqkiunY,2364
|
632
632
|
lusid/models/lock_period_diary_entry_request.py,sha256=NC5mK4AXFMVYyFilhiL5iHqMc0NLWPjaiUpJsa41sCg,3511
|
@@ -1117,7 +1117,7 @@ lusid/models/transaction_type_alias.py,sha256=Xd19reVzCbLEBRRjo-ARwknMkU39klaDXG
|
|
1117
1117
|
lusid/models/transaction_type_calculation.py,sha256=FSdp_1MWqcawYvlogm6Gic5GwtvMdxx24od1fvcNfM4,3059
|
1118
1118
|
lusid/models/transaction_type_details.py,sha256=iITPcL3WqNZINrbGnLZzzy76trnVCTHCoCIXVI6hCQc,2773
|
1119
1119
|
lusid/models/transaction_type_movement.py,sha256=cqcFFVI4JIZXM3m4bv1tjz-vdgpNThnhAVYdUIj-T_Y,8908
|
1120
|
-
lusid/models/transaction_type_property_mapping.py,sha256=
|
1120
|
+
lusid/models/transaction_type_property_mapping.py,sha256=1nZi-coT5D8BmvVEjvaeIYrdBsm3xz8s3l2EXkoEuNE,4352
|
1121
1121
|
lusid/models/transaction_type_request.py,sha256=LY3jBExh3dBYHba6rsQSQtPpW9UoL5d5168L107wyjs,5334
|
1122
1122
|
lusid/models/transactions_reconciliations_response.py,sha256=QIoqf354n-YarzHnlFZepF8iOsufoRT2msxdgur6PBw,3296
|
1123
1123
|
lusid/models/transition_event.py,sha256=TGAwzLpLLOnciOoz7RveEl-27YhjlF8__yLcgKxjzeI,9066
|
@@ -1254,6 +1254,6 @@ lusid/models/workspace_update_request.py,sha256=5N7j21uF9XV75Sl3oJbsSOKT5PrQEx3y
|
|
1254
1254
|
lusid/models/yield_curve_data.py,sha256=vtOzY4t2lgHJUWcna9dEKnuZ_tinolyb8IAFPB23DZ0,6543
|
1255
1255
|
lusid/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1256
1256
|
lusid/rest.py,sha256=HQT__5LQEMu6_1sLKvYj-DI4FH1DJXBIPYfZCTTyrY4,13431
|
1257
|
-
lusid_sdk-2.1.
|
1258
|
-
lusid_sdk-2.1.
|
1259
|
-
lusid_sdk-2.1.
|
1257
|
+
lusid_sdk-2.1.679.dist-info/METADATA,sha256=VqdPhegxcIZTpvWoZW7J_u2K_0oWZeCsXsoYyW7c9aI,213719
|
1258
|
+
lusid_sdk-2.1.679.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
1259
|
+
lusid_sdk-2.1.679.dist-info/RECORD,,
|
File without changes
|