lusid-sdk 2.1.608__py3-none-any.whl → 2.1.610__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 +14 -0
- lusid/api/__init__.py +2 -0
- lusid/api/risk_model_factor_sets_api.py +902 -0
- lusid/configuration.py +1 -1
- lusid/models/__init__.py +12 -0
- lusid/models/bond.py +8 -2
- lusid/models/complex_bond.py +8 -2
- lusid/models/create_risk_model_factor_set_request.py +75 -0
- lusid/models/exchange_traded_option.py +9 -3
- lusid/models/future.py +15 -3
- lusid/models/inflation_linked_bond.py +8 -2
- lusid/models/mark_to_market_conventions.py +74 -0
- lusid/models/market_data_key_rule.py +1 -1
- lusid/models/market_data_specific_rule.py +1 -1
- lusid/models/paged_resource_list_of_risk_model_factor_set.py +113 -0
- lusid/models/risk_model_factor_set.py +103 -0
- lusid/models/trading_conventions.py +73 -0
- lusid/models/update_risk_model_factor_set_request.py +69 -0
- {lusid_sdk-2.1.608.dist-info → lusid_sdk-2.1.610.dist-info}/METADATA +12 -1
- {lusid_sdk-2.1.608.dist-info → lusid_sdk-2.1.610.dist-info}/RECORD +21 -14
- {lusid_sdk-2.1.608.dist-info → lusid_sdk-2.1.610.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.7121\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/__init__.py
CHANGED
@@ -246,6 +246,7 @@ from lusid.models.create_relation_definition_request import CreateRelationDefini
|
|
246
246
|
from lusid.models.create_relation_request import CreateRelationRequest
|
247
247
|
from lusid.models.create_relationship_definition_request import CreateRelationshipDefinitionRequest
|
248
248
|
from lusid.models.create_relationship_request import CreateRelationshipRequest
|
249
|
+
from lusid.models.create_risk_model_factor_set_request import CreateRiskModelFactorSetRequest
|
249
250
|
from lusid.models.create_sequence_request import CreateSequenceRequest
|
250
251
|
from lusid.models.create_staging_rule_set_request import CreateStagingRuleSetRequest
|
251
252
|
from lusid.models.create_tax_rule_set_request import CreateTaxRuleSetRequest
|
@@ -560,6 +561,7 @@ from lusid.models.lusid_validation_problem_details import LusidValidationProblem
|
|
560
561
|
from lusid.models.mapped_string import MappedString
|
561
562
|
from lusid.models.mapping import Mapping
|
562
563
|
from lusid.models.mapping_rule import MappingRule
|
564
|
+
from lusid.models.mark_to_market_conventions import MarkToMarketConventions
|
563
565
|
from lusid.models.market_context import MarketContext
|
564
566
|
from lusid.models.market_context_suppliers import MarketContextSuppliers
|
565
567
|
from lusid.models.market_data_key_rule import MarketDataKeyRule
|
@@ -695,6 +697,7 @@ from lusid.models.paged_resource_list_of_property_definition_search_result impor
|
|
695
697
|
from lusid.models.paged_resource_list_of_reconciliation import PagedResourceListOfReconciliation
|
696
698
|
from lusid.models.paged_resource_list_of_reference_list_response import PagedResourceListOfReferenceListResponse
|
697
699
|
from lusid.models.paged_resource_list_of_relationship_definition import PagedResourceListOfRelationshipDefinition
|
700
|
+
from lusid.models.paged_resource_list_of_risk_model_factor_set import PagedResourceListOfRiskModelFactorSet
|
698
701
|
from lusid.models.paged_resource_list_of_sequence_definition import PagedResourceListOfSequenceDefinition
|
699
702
|
from lusid.models.paged_resource_list_of_staged_modification import PagedResourceListOfStagedModification
|
700
703
|
from lusid.models.paged_resource_list_of_staged_modifications_requested_change_interval import PagedResourceListOfStagedModificationsRequestedChangeInterval
|
@@ -921,6 +924,7 @@ from lusid.models.result_value_string import ResultValueString
|
|
921
924
|
from lusid.models.result_value_type import ResultValueType
|
922
925
|
from lusid.models.return_zero_pv_options import ReturnZeroPvOptions
|
923
926
|
from lusid.models.reverse_stock_split_event import ReverseStockSplitEvent
|
927
|
+
from lusid.models.risk_model_factor_set import RiskModelFactorSet
|
924
928
|
from lusid.models.rounding_configuration import RoundingConfiguration
|
925
929
|
from lusid.models.rounding_configuration_component import RoundingConfigurationComponent
|
926
930
|
from lusid.models.rounding_convention import RoundingConvention
|
@@ -1001,6 +1005,7 @@ from lusid.models.total_return_swap import TotalReturnSwap
|
|
1001
1005
|
from lusid.models.touch import Touch
|
1002
1006
|
from lusid.models.trade_ticket import TradeTicket
|
1003
1007
|
from lusid.models.trade_ticket_type import TradeTicketType
|
1008
|
+
from lusid.models.trading_conventions import TradingConventions
|
1004
1009
|
from lusid.models.transaction import Transaction
|
1005
1010
|
from lusid.models.transaction_configuration_data import TransactionConfigurationData
|
1006
1011
|
from lusid.models.transaction_configuration_data_request import TransactionConfigurationDataRequest
|
@@ -1078,6 +1083,7 @@ from lusid.models.update_property_definition_request import UpdatePropertyDefini
|
|
1078
1083
|
from lusid.models.update_reconciliation_request import UpdateReconciliationRequest
|
1079
1084
|
from lusid.models.update_reference_data_request import UpdateReferenceDataRequest
|
1080
1085
|
from lusid.models.update_relationship_definition_request import UpdateRelationshipDefinitionRequest
|
1086
|
+
from lusid.models.update_risk_model_factor_set_request import UpdateRiskModelFactorSetRequest
|
1081
1087
|
from lusid.models.update_staging_rule_set_request import UpdateStagingRuleSetRequest
|
1082
1088
|
from lusid.models.update_tax_rule_set_request import UpdateTaxRuleSetRequest
|
1083
1089
|
from lusid.models.update_timeline_request import UpdateTimelineRequest
|
@@ -1402,6 +1408,7 @@ __all__ = [
|
|
1402
1408
|
"CreateRelationRequest",
|
1403
1409
|
"CreateRelationshipDefinitionRequest",
|
1404
1410
|
"CreateRelationshipRequest",
|
1411
|
+
"CreateRiskModelFactorSetRequest",
|
1405
1412
|
"CreateSequenceRequest",
|
1406
1413
|
"CreateStagingRuleSetRequest",
|
1407
1414
|
"CreateTaxRuleSetRequest",
|
@@ -1716,6 +1723,7 @@ __all__ = [
|
|
1716
1723
|
"MappedString",
|
1717
1724
|
"Mapping",
|
1718
1725
|
"MappingRule",
|
1726
|
+
"MarkToMarketConventions",
|
1719
1727
|
"MarketContext",
|
1720
1728
|
"MarketContextSuppliers",
|
1721
1729
|
"MarketDataKeyRule",
|
@@ -1851,6 +1859,7 @@ __all__ = [
|
|
1851
1859
|
"PagedResourceListOfReconciliation",
|
1852
1860
|
"PagedResourceListOfReferenceListResponse",
|
1853
1861
|
"PagedResourceListOfRelationshipDefinition",
|
1862
|
+
"PagedResourceListOfRiskModelFactorSet",
|
1854
1863
|
"PagedResourceListOfSequenceDefinition",
|
1855
1864
|
"PagedResourceListOfStagedModification",
|
1856
1865
|
"PagedResourceListOfStagedModificationsRequestedChangeInterval",
|
@@ -2077,6 +2086,7 @@ __all__ = [
|
|
2077
2086
|
"ResultValueType",
|
2078
2087
|
"ReturnZeroPvOptions",
|
2079
2088
|
"ReverseStockSplitEvent",
|
2089
|
+
"RiskModelFactorSet",
|
2080
2090
|
"RoundingConfiguration",
|
2081
2091
|
"RoundingConfigurationComponent",
|
2082
2092
|
"RoundingConvention",
|
@@ -2157,6 +2167,7 @@ __all__ = [
|
|
2157
2167
|
"Touch",
|
2158
2168
|
"TradeTicket",
|
2159
2169
|
"TradeTicketType",
|
2170
|
+
"TradingConventions",
|
2160
2171
|
"Transaction",
|
2161
2172
|
"TransactionConfigurationData",
|
2162
2173
|
"TransactionConfigurationDataRequest",
|
@@ -2234,6 +2245,7 @@ __all__ = [
|
|
2234
2245
|
"UpdateReconciliationRequest",
|
2235
2246
|
"UpdateReferenceDataRequest",
|
2236
2247
|
"UpdateRelationshipDefinitionRequest",
|
2248
|
+
"UpdateRiskModelFactorSetRequest",
|
2237
2249
|
"UpdateStagingRuleSetRequest",
|
2238
2250
|
"UpdateTaxRuleSetRequest",
|
2239
2251
|
"UpdateTimelineRequest",
|
lusid/models/bond.py
CHANGED
@@ -24,6 +24,7 @@ from lusid.models.ex_dividend_configuration import ExDividendConfiguration
|
|
24
24
|
from lusid.models.flow_conventions import FlowConventions
|
25
25
|
from lusid.models.lusid_instrument import LusidInstrument
|
26
26
|
from lusid.models.rounding_convention import RoundingConvention
|
27
|
+
from lusid.models.trading_conventions import TradingConventions
|
27
28
|
|
28
29
|
class Bond(LusidInstrument):
|
29
30
|
"""
|
@@ -43,9 +44,10 @@ class Bond(LusidInstrument):
|
|
43
44
|
rounding_conventions: Optional[conlist(RoundingConvention)] = Field(None, alias="roundingConventions", description="Rounding conventions for analytics, if any.")
|
44
45
|
ex_dividend_configuration: Optional[ExDividendConfiguration] = Field(None, alias="exDividendConfiguration")
|
45
46
|
original_issue_price: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="originalIssuePrice", description="The price the bond was issued at. This is to be entered as a percentage of par, for example a value of 98.5 would represent 98.5%.")
|
47
|
+
trading_conventions: Optional[TradingConventions] = Field(None, alias="tradingConventions")
|
46
48
|
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")
|
47
49
|
additional_properties: Dict[str, Any] = {}
|
48
|
-
__properties = ["instrumentType", "startDate", "maturityDate", "domCcy", "flowConventions", "principal", "couponRate", "identifiers", "exDividendDays", "initialCouponDate", "firstCouponPayDate", "calculationType", "roundingConventions", "exDividendConfiguration", "originalIssuePrice"]
|
50
|
+
__properties = ["instrumentType", "startDate", "maturityDate", "domCcy", "flowConventions", "principal", "couponRate", "identifiers", "exDividendDays", "initialCouponDate", "firstCouponPayDate", "calculationType", "roundingConventions", "exDividendConfiguration", "originalIssuePrice", "tradingConventions"]
|
49
51
|
|
50
52
|
@validator('instrument_type')
|
51
53
|
def instrument_type_validate_enum(cls, value):
|
@@ -92,6 +94,9 @@ class Bond(LusidInstrument):
|
|
92
94
|
# override the default output from pydantic by calling `to_dict()` of ex_dividend_configuration
|
93
95
|
if self.ex_dividend_configuration:
|
94
96
|
_dict['exDividendConfiguration'] = self.ex_dividend_configuration.to_dict()
|
97
|
+
# override the default output from pydantic by calling `to_dict()` of trading_conventions
|
98
|
+
if self.trading_conventions:
|
99
|
+
_dict['tradingConventions'] = self.trading_conventions.to_dict()
|
95
100
|
# puts key-value pairs in additional_properties in the top level
|
96
101
|
if self.additional_properties is not None:
|
97
102
|
for _key, _value in self.additional_properties.items():
|
@@ -158,7 +163,8 @@ class Bond(LusidInstrument):
|
|
158
163
|
"calculation_type": obj.get("calculationType"),
|
159
164
|
"rounding_conventions": [RoundingConvention.from_dict(_item) for _item in obj.get("roundingConventions")] if obj.get("roundingConventions") is not None else None,
|
160
165
|
"ex_dividend_configuration": ExDividendConfiguration.from_dict(obj.get("exDividendConfiguration")) if obj.get("exDividendConfiguration") is not None else None,
|
161
|
-
"original_issue_price": obj.get("originalIssuePrice")
|
166
|
+
"original_issue_price": obj.get("originalIssuePrice"),
|
167
|
+
"trading_conventions": TradingConventions.from_dict(obj.get("tradingConventions")) if obj.get("tradingConventions") is not None else None
|
162
168
|
})
|
163
169
|
# store additional fields in additional_properties
|
164
170
|
for _key in obj.keys():
|
lusid/models/complex_bond.py
CHANGED
@@ -23,6 +23,7 @@ from pydantic.v1 import Field, StrictBool, StrictStr, conlist, constr, validator
|
|
23
23
|
from lusid.models.lusid_instrument import LusidInstrument
|
24
24
|
from lusid.models.rounding_convention import RoundingConvention
|
25
25
|
from lusid.models.schedule import Schedule
|
26
|
+
from lusid.models.trading_conventions import TradingConventions
|
26
27
|
|
27
28
|
class ComplexBond(LusidInstrument):
|
28
29
|
"""
|
@@ -34,9 +35,10 @@ class ComplexBond(LusidInstrument):
|
|
34
35
|
rounding_conventions: Optional[conlist(RoundingConvention)] = Field(None, alias="roundingConventions", description="Rounding conventions for analytics, if any.")
|
35
36
|
asset_backed: Optional[StrictBool] = Field(None, alias="assetBacked", description="If this flag is set to true, then the outstanding notional and principal repayments will be calculated based on pool factors in the quote store. Usually AssetBacked bonds also require a RollConvention setting of within the FlowConventions any given rates schedule (to ensure payment dates always happen on the same day of the month) and US Agency MBSs with Pay Delay features also require their rates schedules to include an ExDividendConfiguration to drive the lag between interest accrual and payment.")
|
36
37
|
asset_pool_identifier: Optional[constr(strict=True, max_length=50, min_length=0)] = Field(None, alias="assetPoolIdentifier", description="Identifier used to retrieve pool factor information about this bond from the quote store. This is typically the bond's ISIN, but can also be ClientInternal. Please ensure you align the MarketDataKeyRule with the correct Quote (Quote.ClientInternal.* or Quote.Isin.*)")
|
38
|
+
trading_conventions: Optional[TradingConventions] = Field(None, alias="tradingConventions")
|
37
39
|
instrument_type: StrictStr = Field(..., alias="instrumentType", description="The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashFlowsLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CapFloor, CashSettled, CdsIndex, Basket, FundingLeg, FxSwap, ForwardRateAgreement, SimpleInstrument, Repo, Equity, ExchangeTradedOption, ReferenceInstrument, ComplexBond, InflationLinkedBond, InflationSwap, SimpleCashFlowLoan, TotalReturnSwap, InflationLeg, FundShareClass, FlexibleLoan, UnsettledCash, Cash, MasteredInstrument, LoanFacility, FlexibleDeposit")
|
38
40
|
additional_properties: Dict[str, Any] = {}
|
39
|
-
__properties = ["instrumentType", "identifiers", "calculationType", "schedules", "roundingConventions", "assetBacked", "assetPoolIdentifier"]
|
41
|
+
__properties = ["instrumentType", "identifiers", "calculationType", "schedules", "roundingConventions", "assetBacked", "assetPoolIdentifier", "tradingConventions"]
|
40
42
|
|
41
43
|
@validator('instrument_type')
|
42
44
|
def instrument_type_validate_enum(cls, value):
|
@@ -84,6 +86,9 @@ class ComplexBond(LusidInstrument):
|
|
84
86
|
if _item:
|
85
87
|
_items.append(_item.to_dict())
|
86
88
|
_dict['roundingConventions'] = _items
|
89
|
+
# override the default output from pydantic by calling `to_dict()` of trading_conventions
|
90
|
+
if self.trading_conventions:
|
91
|
+
_dict['tradingConventions'] = self.trading_conventions.to_dict()
|
87
92
|
# puts key-value pairs in additional_properties in the top level
|
88
93
|
if self.additional_properties is not None:
|
89
94
|
for _key, _value in self.additional_properties.items():
|
@@ -137,7 +142,8 @@ class ComplexBond(LusidInstrument):
|
|
137
142
|
"schedules": [Schedule.from_dict(_item) for _item in obj.get("schedules")] if obj.get("schedules") is not None else None,
|
138
143
|
"rounding_conventions": [RoundingConvention.from_dict(_item) for _item in obj.get("roundingConventions")] if obj.get("roundingConventions") is not None else None,
|
139
144
|
"asset_backed": obj.get("assetBacked"),
|
140
|
-
"asset_pool_identifier": obj.get("assetPoolIdentifier")
|
145
|
+
"asset_pool_identifier": obj.get("assetPoolIdentifier"),
|
146
|
+
"trading_conventions": TradingConventions.from_dict(obj.get("tradingConventions")) if obj.get("tradingConventions") is not None else None
|
141
147
|
})
|
142
148
|
# store additional fields in additional_properties
|
143
149
|
for _key in obj.keys():
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
LUSID API
|
5
|
+
|
6
|
+
FINBOURNE Technology # noqa: E501
|
7
|
+
|
8
|
+
Contact: info@finbourne.com
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
"""
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
|
21
|
+
from typing import Any, Dict, Optional
|
22
|
+
from pydantic.v1 import BaseModel, Field, constr
|
23
|
+
from lusid.models.resource_id import ResourceId
|
24
|
+
|
25
|
+
class CreateRiskModelFactorSetRequest(BaseModel):
|
26
|
+
"""
|
27
|
+
CreateRiskModelFactorSetRequest
|
28
|
+
"""
|
29
|
+
id: Optional[ResourceId] = None
|
30
|
+
display_name: constr(strict=True, max_length=256, min_length=1) = Field(..., alias="displayName", description="Factor Set name.")
|
31
|
+
__properties = ["id", "displayName"]
|
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) -> CreateRiskModelFactorSetRequest:
|
48
|
+
"""Create an instance of CreateRiskModelFactorSetRequest 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 id
|
58
|
+
if self.id:
|
59
|
+
_dict['id'] = self.id.to_dict()
|
60
|
+
return _dict
|
61
|
+
|
62
|
+
@classmethod
|
63
|
+
def from_dict(cls, obj: dict) -> CreateRiskModelFactorSetRequest:
|
64
|
+
"""Create an instance of CreateRiskModelFactorSetRequest from a dict"""
|
65
|
+
if obj is None:
|
66
|
+
return None
|
67
|
+
|
68
|
+
if not isinstance(obj, dict):
|
69
|
+
return CreateRiskModelFactorSetRequest.parse_obj(obj)
|
70
|
+
|
71
|
+
_obj = CreateRiskModelFactorSetRequest.parse_obj({
|
72
|
+
"id": ResourceId.from_dict(obj.get("id")) if obj.get("id") is not None else None,
|
73
|
+
"display_name": obj.get("displayName")
|
74
|
+
})
|
75
|
+
return _obj
|
@@ -18,10 +18,11 @@ import re # noqa: F401
|
|
18
18
|
import json
|
19
19
|
|
20
20
|
from datetime import datetime
|
21
|
-
from typing import Any, Dict, Union
|
21
|
+
from typing import Any, Dict, Optional, Union
|
22
22
|
from pydantic.v1 import Field, StrictFloat, StrictInt, StrictStr, validator
|
23
23
|
from lusid.models.exchange_traded_option_contract_details import ExchangeTradedOptionContractDetails
|
24
24
|
from lusid.models.lusid_instrument import LusidInstrument
|
25
|
+
from lusid.models.trading_conventions import TradingConventions
|
25
26
|
|
26
27
|
class ExchangeTradedOption(LusidInstrument):
|
27
28
|
"""
|
@@ -31,9 +32,10 @@ class ExchangeTradedOption(LusidInstrument):
|
|
31
32
|
contract_details: ExchangeTradedOptionContractDetails = Field(..., alias="contractDetails")
|
32
33
|
contracts: Union[StrictFloat, StrictInt] = Field(..., description="The number of contracts held.")
|
33
34
|
ref_spot_price: Union[StrictFloat, StrictInt] = Field(..., alias="refSpotPrice", description="The reference spot price for the option at which the contract was entered into.")
|
35
|
+
trading_conventions: Optional[TradingConventions] = Field(None, alias="tradingConventions")
|
34
36
|
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")
|
35
37
|
additional_properties: Dict[str, Any] = {}
|
36
|
-
__properties = ["instrumentType", "startDate", "contractDetails", "contracts", "refSpotPrice"]
|
38
|
+
__properties = ["instrumentType", "startDate", "contractDetails", "contracts", "refSpotPrice", "tradingConventions"]
|
37
39
|
|
38
40
|
@validator('instrument_type')
|
39
41
|
def instrument_type_validate_enum(cls, value):
|
@@ -70,6 +72,9 @@ class ExchangeTradedOption(LusidInstrument):
|
|
70
72
|
# override the default output from pydantic by calling `to_dict()` of contract_details
|
71
73
|
if self.contract_details:
|
72
74
|
_dict['contractDetails'] = self.contract_details.to_dict()
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of trading_conventions
|
76
|
+
if self.trading_conventions:
|
77
|
+
_dict['tradingConventions'] = self.trading_conventions.to_dict()
|
73
78
|
# puts key-value pairs in additional_properties in the top level
|
74
79
|
if self.additional_properties is not None:
|
75
80
|
for _key, _value in self.additional_properties.items():
|
@@ -91,7 +96,8 @@ class ExchangeTradedOption(LusidInstrument):
|
|
91
96
|
"start_date": obj.get("startDate"),
|
92
97
|
"contract_details": ExchangeTradedOptionContractDetails.from_dict(obj.get("contractDetails")) if obj.get("contractDetails") is not None else None,
|
93
98
|
"contracts": obj.get("contracts"),
|
94
|
-
"ref_spot_price": obj.get("refSpotPrice")
|
99
|
+
"ref_spot_price": obj.get("refSpotPrice"),
|
100
|
+
"trading_conventions": TradingConventions.from_dict(obj.get("tradingConventions")) if obj.get("tradingConventions") is not None else None
|
95
101
|
})
|
96
102
|
# store additional fields in additional_properties
|
97
103
|
for _key in obj.keys():
|
lusid/models/future.py
CHANGED
@@ -22,6 +22,8 @@ from typing import Any, Dict, Optional, Union
|
|
22
22
|
from pydantic.v1 import Field, StrictFloat, StrictInt, StrictStr, constr, validator
|
23
23
|
from lusid.models.futures_contract_details import FuturesContractDetails
|
24
24
|
from lusid.models.lusid_instrument import LusidInstrument
|
25
|
+
from lusid.models.mark_to_market_conventions import MarkToMarketConventions
|
26
|
+
from lusid.models.trading_conventions import TradingConventions
|
25
27
|
|
26
28
|
class Future(LusidInstrument):
|
27
29
|
"""
|
@@ -32,12 +34,14 @@ class Future(LusidInstrument):
|
|
32
34
|
identifiers: Dict[str, StrictStr] = Field(..., description="External market codes and identifiers for the bond, e.g. ISIN.")
|
33
35
|
contract_details: FuturesContractDetails = Field(..., alias="contractDetails")
|
34
36
|
contracts: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The number of contracts held.")
|
37
|
+
mark_to_market_conventions: Optional[MarkToMarketConventions] = Field(None, alias="markToMarketConventions")
|
35
38
|
ref_spot_price: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="refSpotPrice", description="The reference spot price for the future at which the contract was entered into.")
|
36
39
|
underlying: Optional[LusidInstrument] = None
|
37
|
-
calculation_type: Optional[constr(strict=True, max_length=32, min_length=0)] = Field(None, alias="calculationType", description="Calculation type for some Future instruments which have non-standard methodology. Optional, if not set defaults as follows: - If ExchangeCode is \"ASX\" and ContractCode is \"IR\" or \"BB\" set to ASX_BankBills - If ExchangeCode is \"ASX\" and ContractCode is \"YT\" set to ASX_3Year - If ExchangeCode is \"ASX\" and ContractCode is \"VT\" set to ASX_5Year - If ExchangeCode is \"ASX\" and ContractCode is \"XT\" set to ASX_10Year - If ExchangeCode is \"ASX\" and ContractCode is \"LT\" set to ASX_20Year - otherwise set to Standard
|
40
|
+
calculation_type: Optional[constr(strict=True, max_length=32, min_length=0)] = Field(None, alias="calculationType", description="Calculation type for some Future instruments which have non-standard methodology. Optional, if not set defaults as follows: - If ExchangeCode is \"ASX\" and ContractCode is \"IR\" or \"BB\" set to ASX_BankBills - If ExchangeCode is \"ASX\" and ContractCode is \"YT\" set to ASX_3Year - If ExchangeCode is \"ASX\" and ContractCode is \"VT\" set to ASX_5Year - If ExchangeCode is \"ASX\" and ContractCode is \"XT\" set to ASX_10Year - If ExchangeCode is \"ASX\" and ContractCode is \"LT\" set to ASX_20Year - otherwise set to Standard Specific calculation types for bond and interest rate futures are: - [Standard] The default calculation type, which does not fit into any of the categories below. - [ASX_BankBills] Used for AUD and NZD futures “IR” and “BB” on ASX. 90D Bank Bills. - [ASX_3Year] Used for “YT” on ASX. 3YR semi-annual bond (6 coupons) @ 6%. - [ASX_5Year] Used for “VT” on ASX. 5yr semi-annual bond (10 coupons) @ 2%. - [ASX_10Year] Used for “XT” on ASX. 10yr semi-annual bond (20 coupons) @ 6%. - [ASX_20Year] Used for “LT” on ASX. 20yr semi-annual bond (40 coupons) @ 4%. - [B3_DI1] Used for “DI1” on B3. Average of 1D interbank deposit rates. - For futures with this calculation type, quote values are expected to be specified as a percentage. For example, a quoted rate of 13.205% should be specified as a quote of 13.205 with a face value of 100. Supported string (enumeration) values are: [Standard, ASX_BankBills, ASX_3Year, ASX_5Year, ASX_10Year, ASX_20Year, B3_DI1].")
|
41
|
+
trading_conventions: Optional[TradingConventions] = Field(None, alias="tradingConventions")
|
38
42
|
instrument_type: StrictStr = Field(..., alias="instrumentType", description="The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashFlowsLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CapFloor, CashSettled, CdsIndex, Basket, FundingLeg, FxSwap, ForwardRateAgreement, SimpleInstrument, Repo, Equity, ExchangeTradedOption, ReferenceInstrument, ComplexBond, InflationLinkedBond, InflationSwap, SimpleCashFlowLoan, TotalReturnSwap, InflationLeg, FundShareClass, FlexibleLoan, UnsettledCash, Cash, MasteredInstrument, LoanFacility, FlexibleDeposit")
|
39
43
|
additional_properties: Dict[str, Any] = {}
|
40
|
-
__properties = ["instrumentType", "startDate", "maturityDate", "identifiers", "contractDetails", "contracts", "refSpotPrice", "underlying", "calculationType"]
|
44
|
+
__properties = ["instrumentType", "startDate", "maturityDate", "identifiers", "contractDetails", "contracts", "markToMarketConventions", "refSpotPrice", "underlying", "calculationType", "tradingConventions"]
|
41
45
|
|
42
46
|
@validator('instrument_type')
|
43
47
|
def instrument_type_validate_enum(cls, value):
|
@@ -74,9 +78,15 @@ class Future(LusidInstrument):
|
|
74
78
|
# override the default output from pydantic by calling `to_dict()` of contract_details
|
75
79
|
if self.contract_details:
|
76
80
|
_dict['contractDetails'] = self.contract_details.to_dict()
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of mark_to_market_conventions
|
82
|
+
if self.mark_to_market_conventions:
|
83
|
+
_dict['markToMarketConventions'] = self.mark_to_market_conventions.to_dict()
|
77
84
|
# override the default output from pydantic by calling `to_dict()` of underlying
|
78
85
|
if self.underlying:
|
79
86
|
_dict['underlying'] = self.underlying.to_dict()
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of trading_conventions
|
88
|
+
if self.trading_conventions:
|
89
|
+
_dict['tradingConventions'] = self.trading_conventions.to_dict()
|
80
90
|
# puts key-value pairs in additional_properties in the top level
|
81
91
|
if self.additional_properties is not None:
|
82
92
|
for _key, _value in self.additional_properties.items():
|
@@ -105,9 +115,11 @@ class Future(LusidInstrument):
|
|
105
115
|
"identifiers": obj.get("identifiers"),
|
106
116
|
"contract_details": FuturesContractDetails.from_dict(obj.get("contractDetails")) if obj.get("contractDetails") is not None else None,
|
107
117
|
"contracts": obj.get("contracts"),
|
118
|
+
"mark_to_market_conventions": MarkToMarketConventions.from_dict(obj.get("markToMarketConventions")) if obj.get("markToMarketConventions") is not None else None,
|
108
119
|
"ref_spot_price": obj.get("refSpotPrice"),
|
109
120
|
"underlying": LusidInstrument.from_dict(obj.get("underlying")) if obj.get("underlying") is not None else None,
|
110
|
-
"calculation_type": obj.get("calculationType")
|
121
|
+
"calculation_type": obj.get("calculationType"),
|
122
|
+
"trading_conventions": TradingConventions.from_dict(obj.get("tradingConventions")) if obj.get("tradingConventions") is not None else None
|
111
123
|
})
|
112
124
|
# store additional fields in additional_properties
|
113
125
|
for _key in obj.keys():
|
@@ -24,6 +24,7 @@ from lusid.models.flow_conventions import FlowConventions
|
|
24
24
|
from lusid.models.inflation_index_conventions import InflationIndexConventions
|
25
25
|
from lusid.models.lusid_instrument import LusidInstrument
|
26
26
|
from lusid.models.rounding_convention import RoundingConvention
|
27
|
+
from lusid.models.trading_conventions import TradingConventions
|
27
28
|
|
28
29
|
class InflationLinkedBond(LusidInstrument):
|
29
30
|
"""
|
@@ -44,9 +45,10 @@ class InflationLinkedBond(LusidInstrument):
|
|
44
45
|
principal_protection: Optional[StrictBool] = Field(None, alias="principalProtection", description="If true then the principal is protected in that the redemption amount will be at least the face value (Principal). This is typically set to true for inflation linked bonds issued by the United States and France (for example). This is typically set to false for inflation linked bonds issued by the United Kingdom (post 2005). For other sovereigns this can vary from issue to issue. If not set this property defaults to true. This is sometimes referred to as Deflation protection or an inflation floor of 0%.")
|
45
46
|
stub_type: Optional[StrictStr] = Field(None, alias="stubType", description="StubType. Most Inflation linked bonds have a ShortFront stub type so this is the default, however in some cases with a long front stub LongFront should be selected. StubType Both is not supported for InflationLinkedBonds. Supported string (enumeration) values are: [ShortFront, ShortBack, LongBack, LongFront, Both].")
|
46
47
|
rounding_conventions: Optional[conlist(RoundingConvention)] = Field(None, alias="roundingConventions", description="Rounding conventions for analytics, if any.")
|
48
|
+
trading_conventions: Optional[TradingConventions] = Field(None, alias="tradingConventions")
|
47
49
|
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")
|
48
50
|
additional_properties: Dict[str, Any] = {}
|
49
|
-
__properties = ["instrumentType", "startDate", "maturityDate", "flowConventions", "inflationIndexConventions", "couponRate", "identifiers", "baseCPI", "baseCPIDate", "calculationType", "exDividendDays", "indexPrecision", "principal", "principalProtection", "stubType", "roundingConventions"]
|
51
|
+
__properties = ["instrumentType", "startDate", "maturityDate", "flowConventions", "inflationIndexConventions", "couponRate", "identifiers", "baseCPI", "baseCPIDate", "calculationType", "exDividendDays", "indexPrecision", "principal", "principalProtection", "stubType", "roundingConventions", "tradingConventions"]
|
50
52
|
|
51
53
|
@validator('instrument_type')
|
52
54
|
def instrument_type_validate_enum(cls, value):
|
@@ -93,6 +95,9 @@ class InflationLinkedBond(LusidInstrument):
|
|
93
95
|
if _item:
|
94
96
|
_items.append(_item.to_dict())
|
95
97
|
_dict['roundingConventions'] = _items
|
98
|
+
# override the default output from pydantic by calling `to_dict()` of trading_conventions
|
99
|
+
if self.trading_conventions:
|
100
|
+
_dict['tradingConventions'] = self.trading_conventions.to_dict()
|
96
101
|
# puts key-value pairs in additional_properties in the top level
|
97
102
|
if self.additional_properties is not None:
|
98
103
|
for _key, _value in self.additional_properties.items():
|
@@ -160,7 +165,8 @@ class InflationLinkedBond(LusidInstrument):
|
|
160
165
|
"principal": obj.get("principal"),
|
161
166
|
"principal_protection": obj.get("principalProtection"),
|
162
167
|
"stub_type": obj.get("stubType"),
|
163
|
-
"rounding_conventions": [RoundingConvention.from_dict(_item) for _item in obj.get("roundingConventions")] if obj.get("roundingConventions") is not None else None
|
168
|
+
"rounding_conventions": [RoundingConvention.from_dict(_item) for _item in obj.get("roundingConventions")] if obj.get("roundingConventions") is not None else None,
|
169
|
+
"trading_conventions": TradingConventions.from_dict(obj.get("tradingConventions")) if obj.get("tradingConventions") is not None else None
|
164
170
|
})
|
165
171
|
# store additional fields in additional_properties
|
166
172
|
for _key in obj.keys():
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
LUSID API
|
5
|
+
|
6
|
+
FINBOURNE Technology # noqa: E501
|
7
|
+
|
8
|
+
Contact: info@finbourne.com
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
"""
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
|
21
|
+
from typing import Any, Dict, Optional
|
22
|
+
from pydantic.v1 import BaseModel, Field, constr
|
23
|
+
|
24
|
+
class MarkToMarketConventions(BaseModel):
|
25
|
+
"""
|
26
|
+
A set of conventions for mark to market. Mark to market is a method that values financial instruments based on current market prices, reflecting their current value, rather than historical cost. # noqa: E501
|
27
|
+
"""
|
28
|
+
calendar_code: Optional[constr(strict=True, max_length=50, min_length=0)] = Field(None, alias="calendarCode", description="The calendar to use when generating mark to market cashflows and events.")
|
29
|
+
__properties = ["calendarCode"]
|
30
|
+
|
31
|
+
class Config:
|
32
|
+
"""Pydantic configuration"""
|
33
|
+
allow_population_by_field_name = True
|
34
|
+
validate_assignment = True
|
35
|
+
|
36
|
+
def to_str(self) -> str:
|
37
|
+
"""Returns the string representation of the model using alias"""
|
38
|
+
return pprint.pformat(self.dict(by_alias=True))
|
39
|
+
|
40
|
+
def to_json(self) -> str:
|
41
|
+
"""Returns the JSON representation of the model using alias"""
|
42
|
+
return json.dumps(self.to_dict())
|
43
|
+
|
44
|
+
@classmethod
|
45
|
+
def from_json(cls, json_str: str) -> MarkToMarketConventions:
|
46
|
+
"""Create an instance of MarkToMarketConventions from a JSON string"""
|
47
|
+
return cls.from_dict(json.loads(json_str))
|
48
|
+
|
49
|
+
def to_dict(self):
|
50
|
+
"""Returns the dictionary representation of the model using alias"""
|
51
|
+
_dict = self.dict(by_alias=True,
|
52
|
+
exclude={
|
53
|
+
},
|
54
|
+
exclude_none=True)
|
55
|
+
# set to None if calendar_code (nullable) is None
|
56
|
+
# and __fields_set__ contains the field
|
57
|
+
if self.calendar_code is None and "calendar_code" in self.__fields_set__:
|
58
|
+
_dict['calendarCode'] = None
|
59
|
+
|
60
|
+
return _dict
|
61
|
+
|
62
|
+
@classmethod
|
63
|
+
def from_dict(cls, obj: dict) -> MarkToMarketConventions:
|
64
|
+
"""Create an instance of MarkToMarketConventions from a dict"""
|
65
|
+
if obj is None:
|
66
|
+
return None
|
67
|
+
|
68
|
+
if not isinstance(obj, dict):
|
69
|
+
return MarkToMarketConventions.parse_obj(obj)
|
70
|
+
|
71
|
+
_obj = MarkToMarketConventions.parse_obj({
|
72
|
+
"calendar_code": obj.get("calendarCode")
|
73
|
+
})
|
74
|
+
return _obj
|
@@ -31,7 +31,7 @@ class MarketDataKeyRule(BaseModel):
|
|
31
31
|
quote_type: StrictStr = Field(..., alias="quoteType", description="The available values are: Price, Spread, Rate, LogNormalVol, NormalVol, ParSpread, IsdaSpread, Upfront, Index, Ratio, Delta, PoolFactor, InflationAssumption, DirtyPrice, PrincipalWriteOff, InterestDeferred, InterestShortfall")
|
32
32
|
field: Optional[constr(strict=True, max_length=32, min_length=0)] = Field(None, description="The conceptual qualification for the field, typically 'bid', 'mid' (default), or 'ask', but can also be 'open', 'close', etc. When resolving quotes from LUSID's database, only quotes whose Field is identical to the Field specified here will be accepted as market data. When resolving data from an external supplier, the Field must be one of a defined set for the given supplier. Note: Applies to the retrieval of quotes only. Has no impact on the resolution of complex market data.")
|
33
33
|
quote_interval: Optional[constr(strict=True, max_length=16, min_length=0)] = Field(None, alias="quoteInterval", description="Shorthand for the time interval used to select market data. This must be a dot-separated string nominating a start and end date, for example '5D.0D' to look back 5 days from today (0 days ago). The syntax is <i>int</i><i>char</i>.<i>int</i><i>char</i>, where <i>char</i> is one of D(ay), Bd(business day), W(eek), M(onth) or Y(ear). Business days are calculated using the calendars specified on the Valuation Request. If no calendar is provided in the request, then it will default to only skipping weekends. For example, if the valuation date is a Monday, then a quote interval of \"1Bd\" would behave as \"3D\", looking back to the Friday. Data with effectiveAt on the weekend will still be found in that window.")
|
34
|
-
as_at: Optional[datetime] = Field(None, alias="asAt", description="
|
34
|
+
as_at: Optional[datetime] = Field(None, alias="asAt", description="Deprecated field which no longer has any effect on market data resolution.")
|
35
35
|
price_source: Optional[constr(strict=True, max_length=256, min_length=0)] = Field(None, alias="priceSource", description="The source of the quote. For a given provider/supplier of market data there may be an additional qualifier, e.g. the exchange or bank that provided the quote")
|
36
36
|
mask: Optional[constr(strict=True, max_length=256, min_length=0)] = Field(None, description="Allows for partial or complete override of the market asset resolved for a dependency Either a named override or a dot separated string (A.B.C.D.*). e.g. for Rates curve 'EUR.*' will replace the resolve MarketAsset 'GBP/12M', 'GBP/3M' with the EUR equivalent, if there are no wildcards in the mask, the mask is taken as the MarketAsset for any dependency matching the rule.")
|
37
37
|
source_system: Optional[constr(strict=True, max_length=256, min_length=0)] = Field(None, alias="sourceSystem", description="If set, this parameter will seek an external source of market data. Optional and, if omitted, will default to \"Lusid\". This means that data will be retrieved from the LUSID Quote Store and LUSID Complex Market Data Store. This can be set to \"MarketDataOverrides\" if Supplier is set to \"Client\".")
|
@@ -32,7 +32,7 @@ class MarketDataSpecificRule(BaseModel):
|
|
32
32
|
quote_type: StrictStr = Field(..., alias="quoteType", description="The available values are: Price, Spread, Rate, LogNormalVol, NormalVol, ParSpread, IsdaSpread, Upfront, Index, Ratio, Delta, PoolFactor, InflationAssumption, DirtyPrice, PrincipalWriteOff, InterestDeferred, InterestShortfall")
|
33
33
|
field: constr(strict=True, max_length=32, min_length=0) = Field(..., description="The conceptual qualification for the field, such as bid, mid, or ask. The field must be one of a defined set for the given supplier, in the same way as it is for the Finbourne.WebApi.Interface.Dto.Quotes.QuoteSeriesId")
|
34
34
|
quote_interval: Optional[constr(strict=True, max_length=16, min_length=0)] = Field(None, alias="quoteInterval", description="Shorthand for the time interval used to select market data. This must be a dot-separated string nominating a start and end date, for example '5D.0D' to look back 5 days from today (0 days ago). The syntax is <i>int</i><i>char</i>.<i>int</i><i>char</i>, where <i>char</i> is one of D(ay), W(eek), M(onth) or Y(ear).")
|
35
|
-
as_at: Optional[datetime] = Field(None, alias="asAt", description="
|
35
|
+
as_at: Optional[datetime] = Field(None, alias="asAt", description="Deprecated field which no longer has any effect on market data resolution.")
|
36
36
|
price_source: Optional[constr(strict=True, max_length=256, min_length=0)] = Field(None, alias="priceSource", description="The source of the quote. For a given provider/supplier of market data there may be an additional qualifier, e.g. the exchange or bank that provided the quote")
|
37
37
|
mask: Optional[constr(strict=True, max_length=256, min_length=0)] = Field(None, description="Allows for partial or complete override of the market asset resolved for a dependency Either a named override or a dot separated string (A.B.C.D.*). e.g. for Rates curve 'EUR.*' will replace the resolve MarketAsset 'GBP/12M', 'GBP/3M' with the EUR equivalent, if there are no wildcards in the mask, the mask is taken as the MarketAsset for any dependency matching the rule.")
|
38
38
|
dependency_source_filter: DependencySourceFilter = Field(..., alias="dependencySourceFilter")
|
@@ -0,0 +1,113 @@
|
|
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, Optional
|
22
|
+
from pydantic.v1 import BaseModel, Field, StrictStr, conlist
|
23
|
+
from lusid.models.link import Link
|
24
|
+
from lusid.models.risk_model_factor_set import RiskModelFactorSet
|
25
|
+
|
26
|
+
class PagedResourceListOfRiskModelFactorSet(BaseModel):
|
27
|
+
"""
|
28
|
+
PagedResourceListOfRiskModelFactorSet
|
29
|
+
"""
|
30
|
+
next_page: Optional[StrictStr] = Field(None, alias="nextPage")
|
31
|
+
previous_page: Optional[StrictStr] = Field(None, alias="previousPage")
|
32
|
+
values: conlist(RiskModelFactorSet) = Field(...)
|
33
|
+
href: Optional[StrictStr] = None
|
34
|
+
links: Optional[conlist(Link)] = None
|
35
|
+
__properties = ["nextPage", "previousPage", "values", "href", "links"]
|
36
|
+
|
37
|
+
class Config:
|
38
|
+
"""Pydantic configuration"""
|
39
|
+
allow_population_by_field_name = True
|
40
|
+
validate_assignment = True
|
41
|
+
|
42
|
+
def to_str(self) -> str:
|
43
|
+
"""Returns the string representation of the model using alias"""
|
44
|
+
return pprint.pformat(self.dict(by_alias=True))
|
45
|
+
|
46
|
+
def to_json(self) -> str:
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
48
|
+
return json.dumps(self.to_dict())
|
49
|
+
|
50
|
+
@classmethod
|
51
|
+
def from_json(cls, json_str: str) -> PagedResourceListOfRiskModelFactorSet:
|
52
|
+
"""Create an instance of PagedResourceListOfRiskModelFactorSet from a JSON string"""
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
54
|
+
|
55
|
+
def to_dict(self):
|
56
|
+
"""Returns the dictionary representation of the model using alias"""
|
57
|
+
_dict = self.dict(by_alias=True,
|
58
|
+
exclude={
|
59
|
+
},
|
60
|
+
exclude_none=True)
|
61
|
+
# override the default output from pydantic by calling `to_dict()` of each item in values (list)
|
62
|
+
_items = []
|
63
|
+
if self.values:
|
64
|
+
for _item in self.values:
|
65
|
+
if _item:
|
66
|
+
_items.append(_item.to_dict())
|
67
|
+
_dict['values'] = _items
|
68
|
+
# override the default output from pydantic by calling `to_dict()` of each item in links (list)
|
69
|
+
_items = []
|
70
|
+
if self.links:
|
71
|
+
for _item in self.links:
|
72
|
+
if _item:
|
73
|
+
_items.append(_item.to_dict())
|
74
|
+
_dict['links'] = _items
|
75
|
+
# set to None if next_page (nullable) is None
|
76
|
+
# and __fields_set__ contains the field
|
77
|
+
if self.next_page is None and "next_page" in self.__fields_set__:
|
78
|
+
_dict['nextPage'] = None
|
79
|
+
|
80
|
+
# set to None if previous_page (nullable) is None
|
81
|
+
# and __fields_set__ contains the field
|
82
|
+
if self.previous_page is None and "previous_page" in self.__fields_set__:
|
83
|
+
_dict['previousPage'] = None
|
84
|
+
|
85
|
+
# set to None if href (nullable) is None
|
86
|
+
# and __fields_set__ contains the field
|
87
|
+
if self.href is None and "href" in self.__fields_set__:
|
88
|
+
_dict['href'] = None
|
89
|
+
|
90
|
+
# set to None if links (nullable) is None
|
91
|
+
# and __fields_set__ contains the field
|
92
|
+
if self.links is None and "links" in self.__fields_set__:
|
93
|
+
_dict['links'] = None
|
94
|
+
|
95
|
+
return _dict
|
96
|
+
|
97
|
+
@classmethod
|
98
|
+
def from_dict(cls, obj: dict) -> PagedResourceListOfRiskModelFactorSet:
|
99
|
+
"""Create an instance of PagedResourceListOfRiskModelFactorSet from a dict"""
|
100
|
+
if obj is None:
|
101
|
+
return None
|
102
|
+
|
103
|
+
if not isinstance(obj, dict):
|
104
|
+
return PagedResourceListOfRiskModelFactorSet.parse_obj(obj)
|
105
|
+
|
106
|
+
_obj = PagedResourceListOfRiskModelFactorSet.parse_obj({
|
107
|
+
"next_page": obj.get("nextPage"),
|
108
|
+
"previous_page": obj.get("previousPage"),
|
109
|
+
"values": [RiskModelFactorSet.from_dict(_item) for _item in obj.get("values")] if obj.get("values") is not None else None,
|
110
|
+
"href": obj.get("href"),
|
111
|
+
"links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
|
112
|
+
})
|
113
|
+
return _obj
|