lusid-sdk 2.1.261__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.
Files changed (52) hide show
  1. lusid/__init__.py +38 -0
  2. lusid/api/compliance_api.py +191 -0
  3. lusid/api/funds_api.py +1 -1
  4. lusid/api/order_management_api.py +159 -0
  5. lusid/api/scopes_api.py +38 -9
  6. lusid/configuration.py +1 -1
  7. lusid/extensions/configuration_loaders.py +9 -1
  8. lusid/models/__init__.py +38 -0
  9. lusid/models/cancel_orders_response.py +153 -0
  10. lusid/models/cancelled_order_result.py +73 -0
  11. lusid/models/cash.py +93 -0
  12. lusid/models/compliance_run_configuration.py +73 -0
  13. lusid/models/component_filter.py +85 -0
  14. lusid/models/component_rule.py +13 -19
  15. lusid/models/contract_for_difference.py +4 -2
  16. lusid/models/fund.py +6 -1
  17. lusid/models/fund_amount.py +69 -0
  18. lusid/models/fund_configuration.py +16 -15
  19. lusid/models/fund_configuration_request.py +18 -12
  20. lusid/models/fund_pnl_breakdown.py +110 -0
  21. lusid/models/fund_previous_nav.py +69 -0
  22. lusid/models/fund_request.py +6 -1
  23. lusid/models/fund_valuation_point_data.py +152 -0
  24. lusid/models/futures_contract_details.py +9 -2
  25. lusid/models/lusid_instrument.py +3 -2
  26. lusid/models/market_data_key_rule.py +3 -3
  27. lusid/models/market_data_specific_rule.py +3 -3
  28. lusid/models/market_quote.py +3 -3
  29. lusid/models/model_selection.py +3 -3
  30. lusid/models/pre_trade_configuration.py +69 -0
  31. lusid/models/previous_fund_valuation_point_data.py +79 -0
  32. lusid/models/previous_nav.py +73 -0
  33. lusid/models/previous_share_class_breakdown.py +81 -0
  34. lusid/models/pricing_model.py +1 -0
  35. lusid/models/quote_series_id.py +4 -20
  36. lusid/models/quote_type.py +3 -0
  37. lusid/models/share_class_amount.py +73 -0
  38. lusid/models/share_class_breakdown.py +163 -0
  39. lusid/models/share_class_data.py +79 -0
  40. lusid/models/share_class_details.py +108 -0
  41. lusid/models/share_class_pnl_breakdown.py +110 -0
  42. lusid/models/staged_modification.py +8 -1
  43. lusid/models/template_field.py +3 -1
  44. lusid/models/transaction_configuration_movement_data.py +2 -2
  45. lusid/models/transaction_configuration_movement_data_request.py +1 -1
  46. lusid/models/transaction_field_map.py +1 -1
  47. lusid/models/transaction_type_movement.py +2 -2
  48. lusid/models/unitisation_data.py +73 -0
  49. lusid/models/valuation_point_data_response.py +30 -9
  50. {lusid_sdk-2.1.261.dist-info → lusid_sdk-2.1.320.dist-info}/METADATA +30 -215
  51. {lusid_sdk-2.1.261.dist-info → lusid_sdk-2.1.320.dist-info}/RECORD +52 -33
  52. {lusid_sdk-2.1.261.dist-info → lusid_sdk-2.1.320.dist-info}/WHEEL +0 -0
@@ -18,23 +18,16 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
 
21
- from typing import Any, Dict, Optional
22
- from pydantic.v1 import BaseModel, Field, StrictStr, constr, validator
21
+ from typing import Any, Dict, List, Optional
22
+ from pydantic.v1 import BaseModel, conlist
23
+ from lusid.models.component_filter import ComponentFilter
23
24
 
24
25
  class ComponentRule(BaseModel):
25
26
  """
26
27
  ComponentRule
27
28
  """
28
- match_criteria: constr(strict=True, max_length=16384, min_length=1) = Field(..., alias="matchCriteria")
29
- components: Optional[Dict[str, StrictStr]] = None
30
- __properties = ["matchCriteria", "components"]
31
-
32
- @validator('match_criteria')
33
- def match_criteria_validate_regular_expression(cls, value):
34
- """Validates the regular expression"""
35
- if not re.match(r"^[\s\S]*$", value):
36
- raise ValueError(r"must validate the regular expression /^[\s\S]*$/")
37
- return value
29
+ components: Optional[conlist(ComponentFilter)] = None
30
+ __properties = ["components"]
38
31
 
39
32
  class Config:
40
33
  """Pydantic configuration"""
@@ -60,11 +53,13 @@ class ComponentRule(BaseModel):
60
53
  exclude={
61
54
  },
62
55
  exclude_none=True)
63
- # set to None if components (nullable) is None
64
- # and __fields_set__ contains the field
65
- if self.components is None and "components" in self.__fields_set__:
66
- _dict['components'] = None
67
-
56
+ # override the default output from pydantic by calling `to_dict()` of each item in components (list)
57
+ _items = []
58
+ if self.components:
59
+ for _item in self.components:
60
+ if _item:
61
+ _items.append(_item.to_dict())
62
+ _dict['components'] = _items
68
63
  return _dict
69
64
 
70
65
  @classmethod
@@ -77,7 +72,6 @@ class ComponentRule(BaseModel):
77
72
  return ComponentRule.parse_obj(obj)
78
73
 
79
74
  _obj = ComponentRule.parse_obj({
80
- "match_criteria": obj.get("matchCriteria"),
81
- "components": obj.get("components")
75
+ "components": [ComponentFilter.from_dict(_item) for _item in obj.get("components")] if obj.get("components") is not None else None
82
76
  })
83
77
  return _obj
@@ -35,9 +35,10 @@ class ContractForDifference(LusidInstrument):
35
35
  type: constr(strict=True, min_length=1) = Field(..., description="The type of CFD. Supported string (enumeration) values are: [Cash, Futures].")
36
36
  underlying_ccy: StrictStr = Field(..., alias="underlyingCcy", description="The currency of the underlying")
37
37
  underlying_identifier: constr(strict=True, min_length=1) = Field(..., alias="underlyingIdentifier", description="External market codes and identifiers for the CFD, e.g. RIC. Supported string (enumeration) values are: [LusidInstrumentId, Isin, Sedol, Cusip, ClientInternal, Figi, RIC, QuotePermId, REDCode, BBGId, ICECode].")
38
+ lot_size: Optional[StrictInt] = Field(None, alias="lotSize", description="CFD LotSize, the minimum number of shares that can be bought or sold at once. Optional, if set must be non-negative, if not set defaults to 1.")
38
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")
39
40
  additional_properties: Dict[str, Any] = {}
40
- __properties = ["instrumentType", "startDate", "maturityDate", "code", "contractSize", "payCcy", "referenceRate", "type", "underlyingCcy", "underlyingIdentifier"]
41
+ __properties = ["instrumentType", "startDate", "maturityDate", "code", "contractSize", "payCcy", "referenceRate", "type", "underlyingCcy", "underlyingIdentifier", "lotSize"]
41
42
 
42
43
  @validator('instrument_type')
43
44
  def instrument_type_validate_enum(cls, value):
@@ -97,7 +98,8 @@ class ContractForDifference(LusidInstrument):
97
98
  "reference_rate": obj.get("referenceRate"),
98
99
  "type": obj.get("type"),
99
100
  "underlying_ccy": obj.get("underlyingCcy"),
100
- "underlying_identifier": obj.get("underlyingIdentifier")
101
+ "underlying_identifier": obj.get("underlyingIdentifier"),
102
+ "lot_size": obj.get("lotSize")
101
103
  })
102
104
  # store additional fields in additional_properties
103
105
  for _key in obj.keys():
lusid/models/fund.py CHANGED
@@ -35,6 +35,7 @@ class Fund(BaseModel):
35
35
  id: ResourceId = Field(...)
36
36
  display_name: Optional[constr(strict=True, max_length=256, min_length=1)] = Field(None, alias="displayName", description="The name of the Fund.")
37
37
  description: Optional[constr(strict=True, max_length=1024, min_length=0)] = Field(None, description="A description for the Fund.")
38
+ fund_configuration_id: Optional[ResourceId] = Field(None, alias="fundConfigurationId")
38
39
  abor_id: ResourceId = Field(..., alias="aborId")
39
40
  share_class_instruments: Optional[conlist(InstrumentResolutionDetail)] = Field(None, alias="shareClassInstruments", description="Details the user-provided instrument identifiers and the instrument resolved from them.")
40
41
  type: constr(strict=True, min_length=1) = Field(..., description="The type of fund; 'Standalone', 'Master' or 'Feeder'")
@@ -44,7 +45,7 @@ class Fund(BaseModel):
44
45
  properties: Optional[Dict[str, ModelProperty]] = Field(None, description="A set of properties for the Fund.")
45
46
  version: Optional[Version] = None
46
47
  links: Optional[conlist(Link)] = None
47
- __properties = ["href", "id", "displayName", "description", "aborId", "shareClassInstruments", "type", "inceptionDate", "decimalPlaces", "yearEndDate", "properties", "version", "links"]
48
+ __properties = ["href", "id", "displayName", "description", "fundConfigurationId", "aborId", "shareClassInstruments", "type", "inceptionDate", "decimalPlaces", "yearEndDate", "properties", "version", "links"]
48
49
 
49
50
  @validator('description')
50
51
  def description_validate_regular_expression(cls, value):
@@ -83,6 +84,9 @@ class Fund(BaseModel):
83
84
  # override the default output from pydantic by calling `to_dict()` of id
84
85
  if self.id:
85
86
  _dict['id'] = self.id.to_dict()
87
+ # override the default output from pydantic by calling `to_dict()` of fund_configuration_id
88
+ if self.fund_configuration_id:
89
+ _dict['fundConfigurationId'] = self.fund_configuration_id.to_dict()
86
90
  # override the default output from pydantic by calling `to_dict()` of abor_id
87
91
  if self.abor_id:
88
92
  _dict['aborId'] = self.abor_id.to_dict()
@@ -164,6 +168,7 @@ class Fund(BaseModel):
164
168
  "id": ResourceId.from_dict(obj.get("id")) if obj.get("id") is not None else None,
165
169
  "display_name": obj.get("displayName"),
166
170
  "description": obj.get("description"),
171
+ "fund_configuration_id": ResourceId.from_dict(obj.get("fundConfigurationId")) if obj.get("fundConfigurationId") is not None else None,
167
172
  "abor_id": ResourceId.from_dict(obj.get("aborId")) if obj.get("aborId") is not None else None,
168
173
  "share_class_instruments": [InstrumentResolutionDetail.from_dict(_item) for _item in obj.get("shareClassInstruments")] if obj.get("shareClassInstruments") is not None else None,
169
174
  "type": obj.get("type"),
@@ -0,0 +1,69 @@
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
+
24
+ class FundAmount(BaseModel):
25
+ """
26
+ FundAmount
27
+ """
28
+ value: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The value of the amount.")
29
+ __properties = ["value"]
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) -> FundAmount:
46
+ """Create an instance of FundAmount 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
+ return _dict
56
+
57
+ @classmethod
58
+ def from_dict(cls, obj: dict) -> FundAmount:
59
+ """Create an instance of FundAmount from a dict"""
60
+ if obj is None:
61
+ return None
62
+
63
+ if not isinstance(obj, dict):
64
+ return FundAmount.parse_obj(obj)
65
+
66
+ _obj = FundAmount.parse_obj({
67
+ "value": obj.get("value")
68
+ })
69
+ return _obj
@@ -34,11 +34,13 @@ class FundConfiguration(BaseModel):
34
34
  id: ResourceId = Field(...)
35
35
  display_name: Optional[StrictStr] = Field(None, alias="displayName", description="The name of the FundConfiguration.")
36
36
  description: Optional[StrictStr] = Field(None, description="A description for the FundConfiguration.")
37
- component_rules: Optional[conlist(ComponentRule)] = Field(None, alias="componentRules", description="The first matching rule decides the set of filters used.")
37
+ dealing_rule: Optional[ComponentRule] = Field(None, alias="dealingRule")
38
+ fund_pnl_rule: Optional[ComponentRule] = Field(None, alias="fundPnlRule")
39
+ back_out_rule: Optional[ComponentRule] = Field(None, alias="backOutRule")
38
40
  properties: Optional[Dict[str, ModelProperty]] = Field(None, description="A set of properties for the Fund Configuration.")
39
41
  version: Optional[Version] = None
40
42
  links: Optional[conlist(Link)] = None
41
- __properties = ["href", "id", "displayName", "description", "componentRules", "properties", "version", "links"]
43
+ __properties = ["href", "id", "displayName", "description", "dealingRule", "fundPnlRule", "backOutRule", "properties", "version", "links"]
42
44
 
43
45
  class Config:
44
46
  """Pydantic configuration"""
@@ -67,13 +69,15 @@ class FundConfiguration(BaseModel):
67
69
  # override the default output from pydantic by calling `to_dict()` of id
68
70
  if self.id:
69
71
  _dict['id'] = self.id.to_dict()
70
- # override the default output from pydantic by calling `to_dict()` of each item in component_rules (list)
71
- _items = []
72
- if self.component_rules:
73
- for _item in self.component_rules:
74
- if _item:
75
- _items.append(_item.to_dict())
76
- _dict['componentRules'] = _items
72
+ # override the default output from pydantic by calling `to_dict()` of dealing_rule
73
+ if self.dealing_rule:
74
+ _dict['dealingRule'] = self.dealing_rule.to_dict()
75
+ # override the default output from pydantic by calling `to_dict()` of fund_pnl_rule
76
+ if self.fund_pnl_rule:
77
+ _dict['fundPnlRule'] = self.fund_pnl_rule.to_dict()
78
+ # override the default output from pydantic by calling `to_dict()` of back_out_rule
79
+ if self.back_out_rule:
80
+ _dict['backOutRule'] = self.back_out_rule.to_dict()
77
81
  # override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
78
82
  _field_dict = {}
79
83
  if self.properties:
@@ -106,11 +110,6 @@ class FundConfiguration(BaseModel):
106
110
  if self.description is None and "description" in self.__fields_set__:
107
111
  _dict['description'] = None
108
112
 
109
- # set to None if component_rules (nullable) is None
110
- # and __fields_set__ contains the field
111
- if self.component_rules is None and "component_rules" in self.__fields_set__:
112
- _dict['componentRules'] = None
113
-
114
113
  # set to None if properties (nullable) is None
115
114
  # and __fields_set__ contains the field
116
115
  if self.properties is None and "properties" in self.__fields_set__:
@@ -137,7 +136,9 @@ class FundConfiguration(BaseModel):
137
136
  "id": ResourceId.from_dict(obj.get("id")) if obj.get("id") is not None else None,
138
137
  "display_name": obj.get("displayName"),
139
138
  "description": obj.get("description"),
140
- "component_rules": [ComponentRule.from_dict(_item) for _item in obj.get("componentRules")] if obj.get("componentRules") is not None else None,
139
+ "dealing_rule": ComponentRule.from_dict(obj.get("dealingRule")) if obj.get("dealingRule") is not None else None,
140
+ "fund_pnl_rule": ComponentRule.from_dict(obj.get("fundPnlRule")) if obj.get("fundPnlRule") is not None else None,
141
+ "back_out_rule": ComponentRule.from_dict(obj.get("backOutRule")) if obj.get("backOutRule") is not None else None,
141
142
  "properties": dict(
142
143
  (_k, ModelProperty.from_dict(_v))
143
144
  for _k, _v in obj.get("properties").items()
@@ -18,8 +18,8 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
 
21
- from typing import Any, Dict, List, Optional
22
- from pydantic.v1 import BaseModel, Field, conlist, constr, validator
21
+ from typing import Any, Dict, Optional
22
+ from pydantic.v1 import BaseModel, Field, constr, validator
23
23
  from lusid.models.component_rule import ComponentRule
24
24
  from lusid.models.model_property import ModelProperty
25
25
 
@@ -30,9 +30,11 @@ class FundConfigurationRequest(BaseModel):
30
30
  code: constr(strict=True, max_length=64, min_length=1) = Field(...)
31
31
  display_name: Optional[constr(strict=True, max_length=256, min_length=1)] = Field(None, alias="displayName", description="The name of the Fund.")
32
32
  description: Optional[constr(strict=True, max_length=1024, min_length=0)] = Field(None, description="A description for the Fund.")
33
- component_rules: conlist(ComponentRule) = Field(..., alias="componentRules")
33
+ dealing_rule: ComponentRule = Field(..., alias="dealingRule")
34
+ fund_pnl_rule: ComponentRule = Field(..., alias="fundPnlRule")
35
+ back_out_rule: ComponentRule = Field(..., alias="backOutRule")
34
36
  properties: Optional[Dict[str, ModelProperty]] = Field(None, description="A set of properties for the Fund Configuration.")
35
- __properties = ["code", "displayName", "description", "componentRules", "properties"]
37
+ __properties = ["code", "displayName", "description", "dealingRule", "fundPnlRule", "backOutRule", "properties"]
36
38
 
37
39
  @validator('code')
38
40
  def code_validate_regular_expression(cls, value):
@@ -75,13 +77,15 @@ class FundConfigurationRequest(BaseModel):
75
77
  exclude={
76
78
  },
77
79
  exclude_none=True)
78
- # override the default output from pydantic by calling `to_dict()` of each item in component_rules (list)
79
- _items = []
80
- if self.component_rules:
81
- for _item in self.component_rules:
82
- if _item:
83
- _items.append(_item.to_dict())
84
- _dict['componentRules'] = _items
80
+ # override the default output from pydantic by calling `to_dict()` of dealing_rule
81
+ if self.dealing_rule:
82
+ _dict['dealingRule'] = self.dealing_rule.to_dict()
83
+ # override the default output from pydantic by calling `to_dict()` of fund_pnl_rule
84
+ if self.fund_pnl_rule:
85
+ _dict['fundPnlRule'] = self.fund_pnl_rule.to_dict()
86
+ # override the default output from pydantic by calling `to_dict()` of back_out_rule
87
+ if self.back_out_rule:
88
+ _dict['backOutRule'] = self.back_out_rule.to_dict()
85
89
  # override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
86
90
  _field_dict = {}
87
91
  if self.properties:
@@ -119,7 +123,9 @@ class FundConfigurationRequest(BaseModel):
119
123
  "code": obj.get("code"),
120
124
  "display_name": obj.get("displayName"),
121
125
  "description": obj.get("description"),
122
- "component_rules": [ComponentRule.from_dict(_item) for _item in obj.get("componentRules")] if obj.get("componentRules") is not None else None,
126
+ "dealing_rule": ComponentRule.from_dict(obj.get("dealingRule")) if obj.get("dealingRule") is not None else None,
127
+ "fund_pnl_rule": ComponentRule.from_dict(obj.get("fundPnlRule")) if obj.get("fundPnlRule") is not None else None,
128
+ "back_out_rule": ComponentRule.from_dict(obj.get("backOutRule")) if obj.get("backOutRule") is not None else None,
123
129
  "properties": dict(
124
130
  (_k, ModelProperty.from_dict(_v))
125
131
  for _k, _v in obj.get("properties").items()
@@ -0,0 +1,110 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LUSID API
5
+
6
+ FINBOURNE Technology # noqa: E501
7
+
8
+ Contact: info@finbourne.com
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+
21
+ from typing import Any, Dict
22
+ from pydantic.v1 import BaseModel, Field
23
+ from lusid.models.fund_amount import FundAmount
24
+
25
+ class FundPnlBreakdown(BaseModel):
26
+ """
27
+ The breakdown of PnL for a Fund on a specified date. # noqa: E501
28
+ """
29
+ non_class_specific_pnl: Dict[str, FundAmount] = Field(..., alias="nonClassSpecificPnl", description="Bucket of detail for PnL within the queried period that is not specific to any share class.")
30
+ aggregated_class_pnl: Dict[str, FundAmount] = Field(..., alias="aggregatedClassPnl", description="Bucket of detail for the sum of class PnL across all share classes in a fund and within the queried period.")
31
+ total_pnl: Dict[str, FundAmount] = Field(..., alias="totalPnl", description="Bucket of detail for the sum of class PnL and PnL not specific to a class within the queried period.")
32
+ __properties = ["nonClassSpecificPnl", "aggregatedClassPnl", "totalPnl"]
33
+
34
+ class Config:
35
+ """Pydantic configuration"""
36
+ allow_population_by_field_name = True
37
+ validate_assignment = True
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.dict(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ return json.dumps(self.to_dict())
46
+
47
+ @classmethod
48
+ def from_json(cls, json_str: str) -> FundPnlBreakdown:
49
+ """Create an instance of FundPnlBreakdown from a JSON string"""
50
+ return cls.from_dict(json.loads(json_str))
51
+
52
+ def to_dict(self):
53
+ """Returns the dictionary representation of the model using alias"""
54
+ _dict = self.dict(by_alias=True,
55
+ exclude={
56
+ },
57
+ exclude_none=True)
58
+ # override the default output from pydantic by calling `to_dict()` of each value in non_class_specific_pnl (dict)
59
+ _field_dict = {}
60
+ if self.non_class_specific_pnl:
61
+ for _key in self.non_class_specific_pnl:
62
+ if self.non_class_specific_pnl[_key]:
63
+ _field_dict[_key] = self.non_class_specific_pnl[_key].to_dict()
64
+ _dict['nonClassSpecificPnl'] = _field_dict
65
+ # override the default output from pydantic by calling `to_dict()` of each value in aggregated_class_pnl (dict)
66
+ _field_dict = {}
67
+ if self.aggregated_class_pnl:
68
+ for _key in self.aggregated_class_pnl:
69
+ if self.aggregated_class_pnl[_key]:
70
+ _field_dict[_key] = self.aggregated_class_pnl[_key].to_dict()
71
+ _dict['aggregatedClassPnl'] = _field_dict
72
+ # override the default output from pydantic by calling `to_dict()` of each value in total_pnl (dict)
73
+ _field_dict = {}
74
+ if self.total_pnl:
75
+ for _key in self.total_pnl:
76
+ if self.total_pnl[_key]:
77
+ _field_dict[_key] = self.total_pnl[_key].to_dict()
78
+ _dict['totalPnl'] = _field_dict
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: dict) -> FundPnlBreakdown:
83
+ """Create an instance of FundPnlBreakdown from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return FundPnlBreakdown.parse_obj(obj)
89
+
90
+ _obj = FundPnlBreakdown.parse_obj({
91
+ "non_class_specific_pnl": dict(
92
+ (_k, FundAmount.from_dict(_v))
93
+ for _k, _v in obj.get("nonClassSpecificPnl").items()
94
+ )
95
+ if obj.get("nonClassSpecificPnl") is not None
96
+ else None,
97
+ "aggregated_class_pnl": dict(
98
+ (_k, FundAmount.from_dict(_v))
99
+ for _k, _v in obj.get("aggregatedClassPnl").items()
100
+ )
101
+ if obj.get("aggregatedClassPnl") is not None
102
+ else None,
103
+ "total_pnl": dict(
104
+ (_k, FundAmount.from_dict(_v))
105
+ for _k, _v in obj.get("totalPnl").items()
106
+ )
107
+ if obj.get("totalPnl") is not None
108
+ else None
109
+ })
110
+ return _obj
@@ -0,0 +1,69 @@
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
+
24
+ class FundPreviousNAV(BaseModel):
25
+ """
26
+ FundPreviousNAV
27
+ """
28
+ amount: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The amount of the previous NAV.")
29
+ __properties = ["amount"]
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) -> FundPreviousNAV:
46
+ """Create an instance of FundPreviousNAV 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
+ return _dict
56
+
57
+ @classmethod
58
+ def from_dict(cls, obj: dict) -> FundPreviousNAV:
59
+ """Create an instance of FundPreviousNAV from a dict"""
60
+ if obj is None:
61
+ return None
62
+
63
+ if not isinstance(obj, dict):
64
+ return FundPreviousNAV.parse_obj(obj)
65
+
66
+ _obj = FundPreviousNAV.parse_obj({
67
+ "amount": obj.get("amount")
68
+ })
69
+ return _obj
@@ -32,6 +32,7 @@ class FundRequest(BaseModel):
32
32
  code: constr(strict=True, max_length=64, min_length=1) = Field(..., description="The code given for the Fund.")
33
33
  display_name: Optional[constr(strict=True, max_length=256, min_length=1)] = Field(None, alias="displayName", description="The name of the Fund.")
34
34
  description: Optional[constr(strict=True, max_length=1024, min_length=0)] = Field(None, description="A description for the Fund.")
35
+ fund_configuration_id: Optional[ResourceId] = Field(None, alias="fundConfigurationId")
35
36
  abor_id: ResourceId = Field(..., alias="aborId")
36
37
  share_class_instrument_scopes: Optional[conlist(StrictStr, max_items=1)] = Field(None, alias="shareClassInstrumentScopes", description="The scopes in which the instruments lie, currently limited to one.")
37
38
  share_class_instruments: Optional[conlist(InstrumentResolutionDetail)] = Field(None, alias="shareClassInstruments", description="Details the user-provided instrument identifiers and the instrument resolved from them.")
@@ -40,7 +41,7 @@ class FundRequest(BaseModel):
40
41
  decimal_places: Optional[conint(strict=True, le=30, ge=0)] = Field(None, alias="decimalPlaces", description="Number of decimal places for reporting")
41
42
  year_end_date: DayMonth = Field(..., alias="yearEndDate")
42
43
  properties: Optional[Dict[str, ModelProperty]] = Field(None, description="A set of properties for the Fund.")
43
- __properties = ["code", "displayName", "description", "aborId", "shareClassInstrumentScopes", "shareClassInstruments", "type", "inceptionDate", "decimalPlaces", "yearEndDate", "properties"]
44
+ __properties = ["code", "displayName", "description", "fundConfigurationId", "aborId", "shareClassInstrumentScopes", "shareClassInstruments", "type", "inceptionDate", "decimalPlaces", "yearEndDate", "properties"]
44
45
 
45
46
  @validator('code')
46
47
  def code_validate_regular_expression(cls, value):
@@ -83,6 +84,9 @@ class FundRequest(BaseModel):
83
84
  exclude={
84
85
  },
85
86
  exclude_none=True)
87
+ # override the default output from pydantic by calling `to_dict()` of fund_configuration_id
88
+ if self.fund_configuration_id:
89
+ _dict['fundConfigurationId'] = self.fund_configuration_id.to_dict()
86
90
  # override the default output from pydantic by calling `to_dict()` of abor_id
87
91
  if self.abor_id:
88
92
  _dict['aborId'] = self.abor_id.to_dict()
@@ -148,6 +152,7 @@ class FundRequest(BaseModel):
148
152
  "code": obj.get("code"),
149
153
  "display_name": obj.get("displayName"),
150
154
  "description": obj.get("description"),
155
+ "fund_configuration_id": ResourceId.from_dict(obj.get("fundConfigurationId")) if obj.get("fundConfigurationId") is not None else None,
151
156
  "abor_id": ResourceId.from_dict(obj.get("aborId")) if obj.get("aborId") is not None else None,
152
157
  "share_class_instrument_scopes": obj.get("shareClassInstrumentScopes"),
153
158
  "share_class_instruments": [InstrumentResolutionDetail.from_dict(_item) for _item in obj.get("shareClassInstruments")] if obj.get("shareClassInstruments") is not None else None,