lusid-sdk 2.1.850__py3-none-any.whl → 2.1.853__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 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.7962\n"\
448
+ "Version of the API: 0.11.7967\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
@@ -415,6 +415,7 @@ from lusid.models.fund_amount import FundAmount
415
415
  from lusid.models.fund_configuration import FundConfiguration
416
416
  from lusid.models.fund_configuration_properties import FundConfigurationProperties
417
417
  from lusid.models.fund_configuration_request import FundConfigurationRequest
418
+ from lusid.models.fund_definition_request import FundDefinitionRequest
418
419
  from lusid.models.fund_details import FundDetails
419
420
  from lusid.models.fund_id_list import FundIdList
420
421
  from lusid.models.fund_journal_entry_line import FundJournalEntryLine
@@ -634,6 +635,7 @@ from lusid.models.move_orders_to_different_blocks_request import MoveOrdersToDif
634
635
  from lusid.models.moved_order_to_different_block_response import MovedOrderToDifferentBlockResponse
635
636
  from lusid.models.movement_type import MovementType
636
637
  from lusid.models.multi_currency_amounts import MultiCurrencyAmounts
638
+ from lusid.models.nav_type_definition import NavTypeDefinition
637
639
  from lusid.models.new_instrument import NewInstrument
638
640
  from lusid.models.next_value_in_sequence_response import NextValueInSequenceResponse
639
641
  from lusid.models.numeric_comparison_type import NumericComparisonType
@@ -781,6 +783,7 @@ from lusid.models.portfolio_cash_ladder import PortfolioCashLadder
781
783
  from lusid.models.portfolio_details import PortfolioDetails
782
784
  from lusid.models.portfolio_entity import PortfolioEntity
783
785
  from lusid.models.portfolio_entity_id import PortfolioEntityId
786
+ from lusid.models.portfolio_entity_id_with_details import PortfolioEntityIdWithDetails
784
787
  from lusid.models.portfolio_group import PortfolioGroup
785
788
  from lusid.models.portfolio_group_id_compliance_parameter import PortfolioGroupIdComplianceParameter
786
789
  from lusid.models.portfolio_group_id_list import PortfolioGroupIdList
@@ -1651,6 +1654,7 @@ __all__ = [
1651
1654
  "FundConfiguration",
1652
1655
  "FundConfigurationProperties",
1653
1656
  "FundConfigurationRequest",
1657
+ "FundDefinitionRequest",
1654
1658
  "FundDetails",
1655
1659
  "FundIdList",
1656
1660
  "FundJournalEntryLine",
@@ -1870,6 +1874,7 @@ __all__ = [
1870
1874
  "MovedOrderToDifferentBlockResponse",
1871
1875
  "MovementType",
1872
1876
  "MultiCurrencyAmounts",
1877
+ "NavTypeDefinition",
1873
1878
  "NewInstrument",
1874
1879
  "NextValueInSequenceResponse",
1875
1880
  "NumericComparisonType",
@@ -2017,6 +2022,7 @@ __all__ = [
2017
2022
  "PortfolioDetails",
2018
2023
  "PortfolioEntity",
2019
2024
  "PortfolioEntityId",
2025
+ "PortfolioEntityIdWithDetails",
2020
2026
  "PortfolioGroup",
2021
2027
  "PortfolioGroupIdComplianceParameter",
2022
2028
  "PortfolioGroupIdList",
lusid/models/fund.py CHANGED
@@ -24,6 +24,8 @@ from lusid.models.day_month import DayMonth
24
24
  from lusid.models.instrument_resolution_detail import InstrumentResolutionDetail
25
25
  from lusid.models.link import Link
26
26
  from lusid.models.model_property import ModelProperty
27
+ from lusid.models.nav_type_definition import NavTypeDefinition
28
+ from lusid.models.portfolio_entity_id_with_details import PortfolioEntityIdWithDetails
27
29
  from lusid.models.resource_id import ResourceId
28
30
  from lusid.models.version import Version
29
31
 
@@ -35,17 +37,21 @@ class Fund(BaseModel):
35
37
  id: ResourceId = Field(...)
36
38
  display_name: Optional[StrictStr] = Field(None,alias="displayName", description="The name of the Fund.")
37
39
  description: Optional[StrictStr] = Field(None,alias="description", description="A description for the Fund.")
40
+ base_currency: Optional[StrictStr] = Field(None,alias="baseCurrency", description="The base currency of the Fund in ISO 4217 currency code format. All portfolios must be of a matching base currency.")
41
+ portfolio_ids: Optional[conlist(PortfolioEntityIdWithDetails)] = Field(None, alias="portfolioIds", description="A list of the portfolios on the fund, which are part of the Fund. Note: These must all have the same base currency, which must also much the Fund Base Currency.")
38
42
  fund_configuration_id: Optional[ResourceId] = Field(None, alias="fundConfigurationId")
39
- abor_id: ResourceId = Field(..., alias="aborId")
43
+ abor_id: Optional[ResourceId] = Field(None, alias="aborId")
40
44
  share_class_instruments: Optional[conlist(InstrumentResolutionDetail)] = Field(None, alias="shareClassInstruments", description="Details the user-provided instrument identifiers and the instrument resolved from them.")
41
45
  type: StrictStr = Field(...,alias="type", description="The type of fund; 'Standalone', 'Master' or 'Feeder'")
42
46
  inception_date: datetime = Field(..., alias="inceptionDate", description="Inception date of the Fund")
43
47
  decimal_places: Optional[conint(strict=True)] = Field(None, alias="decimalPlaces", description="Number of decimal places for reporting")
44
- year_end_date: DayMonth = Field(..., alias="yearEndDate")
48
+ year_end_date: Optional[DayMonth] = Field(None, alias="yearEndDate")
49
+ primary_nav_type: Optional[NavTypeDefinition] = Field(None, alias="primaryNavType")
50
+ additional_nav_types: Optional[conlist(NavTypeDefinition)] = Field(None, alias="additionalNavTypes", description="The definitions for any additional NAVs on the Fund.")
45
51
  properties: Optional[Dict[str, ModelProperty]] = Field(None, description="A set of properties for the Fund.")
46
52
  version: Optional[Version] = None
47
53
  links: Optional[conlist(Link)] = None
48
- __properties = ["href", "id", "displayName", "description", "fundConfigurationId", "aborId", "shareClassInstruments", "type", "inceptionDate", "decimalPlaces", "yearEndDate", "properties", "version", "links"]
54
+ __properties = ["href", "id", "displayName", "description", "baseCurrency", "portfolioIds", "fundConfigurationId", "aborId", "shareClassInstruments", "type", "inceptionDate", "decimalPlaces", "yearEndDate", "primaryNavType", "additionalNavTypes", "properties", "version", "links"]
49
55
 
50
56
  class Config:
51
57
  """Pydantic configuration"""
@@ -82,6 +88,13 @@ class Fund(BaseModel):
82
88
  # override the default output from pydantic by calling `to_dict()` of id
83
89
  if self.id:
84
90
  _dict['id'] = self.id.to_dict()
91
+ # override the default output from pydantic by calling `to_dict()` of each item in portfolio_ids (list)
92
+ _items = []
93
+ if self.portfolio_ids:
94
+ for _item in self.portfolio_ids:
95
+ if _item:
96
+ _items.append(_item.to_dict())
97
+ _dict['portfolioIds'] = _items
85
98
  # override the default output from pydantic by calling `to_dict()` of fund_configuration_id
86
99
  if self.fund_configuration_id:
87
100
  _dict['fundConfigurationId'] = self.fund_configuration_id.to_dict()
@@ -98,6 +111,16 @@ class Fund(BaseModel):
98
111
  # override the default output from pydantic by calling `to_dict()` of year_end_date
99
112
  if self.year_end_date:
100
113
  _dict['yearEndDate'] = self.year_end_date.to_dict()
114
+ # override the default output from pydantic by calling `to_dict()` of primary_nav_type
115
+ if self.primary_nav_type:
116
+ _dict['primaryNavType'] = self.primary_nav_type.to_dict()
117
+ # override the default output from pydantic by calling `to_dict()` of each item in additional_nav_types (list)
118
+ _items = []
119
+ if self.additional_nav_types:
120
+ for _item in self.additional_nav_types:
121
+ if _item:
122
+ _items.append(_item.to_dict())
123
+ _dict['additionalNavTypes'] = _items
101
124
  # override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
102
125
  _field_dict = {}
103
126
  if self.properties:
@@ -130,6 +153,16 @@ class Fund(BaseModel):
130
153
  if self.description is None and "description" in self.__fields_set__:
131
154
  _dict['description'] = None
132
155
 
156
+ # set to None if base_currency (nullable) is None
157
+ # and __fields_set__ contains the field
158
+ if self.base_currency is None and "base_currency" in self.__fields_set__:
159
+ _dict['baseCurrency'] = None
160
+
161
+ # set to None if portfolio_ids (nullable) is None
162
+ # and __fields_set__ contains the field
163
+ if self.portfolio_ids is None and "portfolio_ids" in self.__fields_set__:
164
+ _dict['portfolioIds'] = None
165
+
133
166
  # set to None if share_class_instruments (nullable) is None
134
167
  # and __fields_set__ contains the field
135
168
  if self.share_class_instruments is None and "share_class_instruments" in self.__fields_set__:
@@ -140,6 +173,11 @@ class Fund(BaseModel):
140
173
  if self.decimal_places is None and "decimal_places" in self.__fields_set__:
141
174
  _dict['decimalPlaces'] = None
142
175
 
176
+ # set to None if additional_nav_types (nullable) is None
177
+ # and __fields_set__ contains the field
178
+ if self.additional_nav_types is None and "additional_nav_types" in self.__fields_set__:
179
+ _dict['additionalNavTypes'] = None
180
+
143
181
  # set to None if properties (nullable) is None
144
182
  # and __fields_set__ contains the field
145
183
  if self.properties is None and "properties" in self.__fields_set__:
@@ -166,6 +204,8 @@ class Fund(BaseModel):
166
204
  "id": ResourceId.from_dict(obj.get("id")) if obj.get("id") is not None else None,
167
205
  "display_name": obj.get("displayName"),
168
206
  "description": obj.get("description"),
207
+ "base_currency": obj.get("baseCurrency"),
208
+ "portfolio_ids": [PortfolioEntityIdWithDetails.from_dict(_item) for _item in obj.get("portfolioIds")] if obj.get("portfolioIds") is not None else None,
169
209
  "fund_configuration_id": ResourceId.from_dict(obj.get("fundConfigurationId")) if obj.get("fundConfigurationId") is not None else None,
170
210
  "abor_id": ResourceId.from_dict(obj.get("aborId")) if obj.get("aborId") is not None else None,
171
211
  "share_class_instruments": [InstrumentResolutionDetail.from_dict(_item) for _item in obj.get("shareClassInstruments")] if obj.get("shareClassInstruments") is not None else None,
@@ -173,6 +213,8 @@ class Fund(BaseModel):
173
213
  "inception_date": obj.get("inceptionDate"),
174
214
  "decimal_places": obj.get("decimalPlaces"),
175
215
  "year_end_date": DayMonth.from_dict(obj.get("yearEndDate")) if obj.get("yearEndDate") is not None else None,
216
+ "primary_nav_type": NavTypeDefinition.from_dict(obj.get("primaryNavType")) if obj.get("primaryNavType") is not None else None,
217
+ "additional_nav_types": [NavTypeDefinition.from_dict(_item) for _item in obj.get("additionalNavTypes")] if obj.get("additionalNavTypes") is not None else None,
176
218
  "properties": dict(
177
219
  (_k, ModelProperty.from_dict(_v))
178
220
  for _k, _v in obj.get("properties").items()
@@ -0,0 +1,182 @@
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 StrictStr, Field, BaseModel, Field, StrictStr, conint, conlist, constr, validator
23
+ from lusid.models.instrument_resolution_detail import InstrumentResolutionDetail
24
+ from lusid.models.model_property import ModelProperty
25
+ from lusid.models.nav_type_definition import NavTypeDefinition
26
+ from lusid.models.portfolio_entity_id import PortfolioEntityId
27
+ from lusid.models.resource_id import ResourceId
28
+
29
+ class FundDefinitionRequest(BaseModel):
30
+ """
31
+ The request used to create a Fund. # noqa: E501
32
+ """
33
+ code: StrictStr = Field(...,alias="code", description="The code given for the Fund.")
34
+ display_name: Optional[StrictStr] = Field(None,alias="displayName", description="The name of the Fund.")
35
+ description: Optional[StrictStr] = Field(None,alias="description", description="A description for the Fund.")
36
+ base_currency: StrictStr = Field(...,alias="baseCurrency", description="The base currency of the Fund in ISO 4217 currency code format. All portfolios must be of a matching base currency.")
37
+ portfolio_ids: conlist(PortfolioEntityId) = Field(..., alias="portfolioIds", description="A list of the Portfolio IDs associated with the fund, which are part of the Fund. Note: These must all have the same base currency, which must also much the Fund Base Currency.")
38
+ fund_configuration_id: ResourceId = Field(..., alias="fundConfigurationId")
39
+ share_class_instrument_scopes: Optional[conlist(StrictStr)] = Field(None, alias="shareClassInstrumentScopes", description="The scopes in which the instruments lie, currently limited to one.")
40
+ share_class_instruments: Optional[conlist(InstrumentResolutionDetail)] = Field(None, alias="shareClassInstruments", description="Details the user-provided instrument identifiers and the instrument resolved from them.")
41
+ type: StrictStr = Field(...,alias="type", description="The type of fund; 'Standalone', 'Master' or 'Feeder'")
42
+ inception_date: datetime = Field(..., alias="inceptionDate", description="Inception date of the Fund")
43
+ decimal_places: Optional[conint(strict=True)] = Field(None, alias="decimalPlaces", description="Number of decimal places for reporting")
44
+ primary_nav_type: NavTypeDefinition = Field(..., alias="primaryNavType")
45
+ additional_nav_types: Optional[conlist(NavTypeDefinition)] = Field(None, alias="additionalNavTypes", description="The definitions for any additional NAVs on the Fund.")
46
+ properties: Optional[Dict[str, ModelProperty]] = Field(None, description="A set of properties for the Fund.")
47
+ __properties = ["code", "displayName", "description", "baseCurrency", "portfolioIds", "fundConfigurationId", "shareClassInstrumentScopes", "shareClassInstruments", "type", "inceptionDate", "decimalPlaces", "primaryNavType", "additionalNavTypes", "properties"]
48
+
49
+ class Config:
50
+ """Pydantic configuration"""
51
+ allow_population_by_field_name = True
52
+ validate_assignment = True
53
+
54
+ def __str__(self):
55
+ """For `print` and `pprint`"""
56
+ return pprint.pformat(self.dict(by_alias=False))
57
+
58
+ def __repr__(self):
59
+ """For `print` and `pprint`"""
60
+ return self.to_str()
61
+
62
+ def to_str(self) -> str:
63
+ """Returns the string representation of the model using alias"""
64
+ return pprint.pformat(self.dict(by_alias=True))
65
+
66
+ def to_json(self) -> str:
67
+ """Returns the JSON representation of the model using alias"""
68
+ return json.dumps(self.to_dict())
69
+
70
+ @classmethod
71
+ def from_json(cls, json_str: str) -> FundDefinitionRequest:
72
+ """Create an instance of FundDefinitionRequest from a JSON string"""
73
+ return cls.from_dict(json.loads(json_str))
74
+
75
+ def to_dict(self):
76
+ """Returns the dictionary representation of the model using alias"""
77
+ _dict = self.dict(by_alias=True,
78
+ exclude={
79
+ },
80
+ exclude_none=True)
81
+ # override the default output from pydantic by calling `to_dict()` of each item in portfolio_ids (list)
82
+ _items = []
83
+ if self.portfolio_ids:
84
+ for _item in self.portfolio_ids:
85
+ if _item:
86
+ _items.append(_item.to_dict())
87
+ _dict['portfolioIds'] = _items
88
+ # override the default output from pydantic by calling `to_dict()` of fund_configuration_id
89
+ if self.fund_configuration_id:
90
+ _dict['fundConfigurationId'] = self.fund_configuration_id.to_dict()
91
+ # override the default output from pydantic by calling `to_dict()` of each item in share_class_instruments (list)
92
+ _items = []
93
+ if self.share_class_instruments:
94
+ for _item in self.share_class_instruments:
95
+ if _item:
96
+ _items.append(_item.to_dict())
97
+ _dict['shareClassInstruments'] = _items
98
+ # override the default output from pydantic by calling `to_dict()` of primary_nav_type
99
+ if self.primary_nav_type:
100
+ _dict['primaryNavType'] = self.primary_nav_type.to_dict()
101
+ # override the default output from pydantic by calling `to_dict()` of each item in additional_nav_types (list)
102
+ _items = []
103
+ if self.additional_nav_types:
104
+ for _item in self.additional_nav_types:
105
+ if _item:
106
+ _items.append(_item.to_dict())
107
+ _dict['additionalNavTypes'] = _items
108
+ # override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
109
+ _field_dict = {}
110
+ if self.properties:
111
+ for _key in self.properties:
112
+ if self.properties[_key]:
113
+ _field_dict[_key] = self.properties[_key].to_dict()
114
+ _dict['properties'] = _field_dict
115
+ # set to None if display_name (nullable) is None
116
+ # and __fields_set__ contains the field
117
+ if self.display_name is None and "display_name" in self.__fields_set__:
118
+ _dict['displayName'] = None
119
+
120
+ # set to None if description (nullable) is None
121
+ # and __fields_set__ contains the field
122
+ if self.description is None and "description" in self.__fields_set__:
123
+ _dict['description'] = None
124
+
125
+ # set to None if share_class_instrument_scopes (nullable) is None
126
+ # and __fields_set__ contains the field
127
+ if self.share_class_instrument_scopes is None and "share_class_instrument_scopes" in self.__fields_set__:
128
+ _dict['shareClassInstrumentScopes'] = None
129
+
130
+ # set to None if share_class_instruments (nullable) is None
131
+ # and __fields_set__ contains the field
132
+ if self.share_class_instruments is None and "share_class_instruments" in self.__fields_set__:
133
+ _dict['shareClassInstruments'] = None
134
+
135
+ # set to None if decimal_places (nullable) is None
136
+ # and __fields_set__ contains the field
137
+ if self.decimal_places is None and "decimal_places" in self.__fields_set__:
138
+ _dict['decimalPlaces'] = None
139
+
140
+ # set to None if additional_nav_types (nullable) is None
141
+ # and __fields_set__ contains the field
142
+ if self.additional_nav_types is None and "additional_nav_types" in self.__fields_set__:
143
+ _dict['additionalNavTypes'] = None
144
+
145
+ # set to None if properties (nullable) is None
146
+ # and __fields_set__ contains the field
147
+ if self.properties is None and "properties" in self.__fields_set__:
148
+ _dict['properties'] = None
149
+
150
+ return _dict
151
+
152
+ @classmethod
153
+ def from_dict(cls, obj: dict) -> FundDefinitionRequest:
154
+ """Create an instance of FundDefinitionRequest from a dict"""
155
+ if obj is None:
156
+ return None
157
+
158
+ if not isinstance(obj, dict):
159
+ return FundDefinitionRequest.parse_obj(obj)
160
+
161
+ _obj = FundDefinitionRequest.parse_obj({
162
+ "code": obj.get("code"),
163
+ "display_name": obj.get("displayName"),
164
+ "description": obj.get("description"),
165
+ "base_currency": obj.get("baseCurrency"),
166
+ "portfolio_ids": [PortfolioEntityId.from_dict(_item) for _item in obj.get("portfolioIds")] if obj.get("portfolioIds") is not None else None,
167
+ "fund_configuration_id": ResourceId.from_dict(obj.get("fundConfigurationId")) if obj.get("fundConfigurationId") is not None else None,
168
+ "share_class_instrument_scopes": obj.get("shareClassInstrumentScopes"),
169
+ "share_class_instruments": [InstrumentResolutionDetail.from_dict(_item) for _item in obj.get("shareClassInstruments")] if obj.get("shareClassInstruments") is not None else None,
170
+ "type": obj.get("type"),
171
+ "inception_date": obj.get("inceptionDate"),
172
+ "decimal_places": obj.get("decimalPlaces"),
173
+ "primary_nav_type": NavTypeDefinition.from_dict(obj.get("primaryNavType")) if obj.get("primaryNavType") is not None else None,
174
+ "additional_nav_types": [NavTypeDefinition.from_dict(_item) for _item in obj.get("additionalNavTypes")] if obj.get("additionalNavTypes") is not None else None,
175
+ "properties": dict(
176
+ (_k, ModelProperty.from_dict(_v))
177
+ for _k, _v in obj.get("properties").items()
178
+ )
179
+ if obj.get("properties") is not None
180
+ else None
181
+ })
182
+ return _obj
@@ -0,0 +1,158 @@
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 StrictStr, Field, BaseModel, Field, StrictStr, conlist, constr, validator
23
+ from lusid.models.resource_id import ResourceId
24
+
25
+ class NavTypeDefinition(BaseModel):
26
+ """
27
+ NavTypeDefinition
28
+ """
29
+ code: Optional[StrictStr] = Field(None,alias="code")
30
+ display_name: Optional[StrictStr] = Field(None,alias="displayName")
31
+ description: Optional[StrictStr] = Field(None,alias="description")
32
+ valuation_recipe_id: ResourceId = Field(..., alias="valuationRecipeId")
33
+ holding_recipe_id: ResourceId = Field(..., alias="holdingRecipeId")
34
+ accounting_method: StrictStr = Field(...,alias="accountingMethod")
35
+ sub_holding_keys: Optional[conlist(StrictStr)] = Field(None, alias="subHoldingKeys", description="Set of unique holding identifiers, e.g. trader, desk, strategy.")
36
+ instrument_scopes: Optional[conlist(StrictStr)] = Field(None, alias="instrumentScopes", description="The resolution strategy used to resolve instruments of transactions/holdings upserted to the portfolios.")
37
+ amortisation_method: StrictStr = Field(...,alias="amortisationMethod")
38
+ transaction_type_scope: Optional[StrictStr] = Field(None,alias="transactionTypeScope")
39
+ cash_gain_loss_calculation_date: Optional[StrictStr] = Field(None,alias="cashGainLossCalculationDate")
40
+ chart_of_accounts_id: ResourceId = Field(..., alias="chartOfAccountsId")
41
+ posting_module_codes: Optional[conlist(StrictStr)] = Field(None, alias="postingModuleCodes")
42
+ cleardown_module_codes: Optional[conlist(StrictStr)] = Field(None, alias="cleardownModuleCodes")
43
+ __properties = ["code", "displayName", "description", "valuationRecipeId", "holdingRecipeId", "accountingMethod", "subHoldingKeys", "instrumentScopes", "amortisationMethod", "transactionTypeScope", "cashGainLossCalculationDate", "chartOfAccountsId", "postingModuleCodes", "cleardownModuleCodes"]
44
+
45
+ class Config:
46
+ """Pydantic configuration"""
47
+ allow_population_by_field_name = True
48
+ validate_assignment = True
49
+
50
+ def __str__(self):
51
+ """For `print` and `pprint`"""
52
+ return pprint.pformat(self.dict(by_alias=False))
53
+
54
+ def __repr__(self):
55
+ """For `print` and `pprint`"""
56
+ return self.to_str()
57
+
58
+ def to_str(self) -> str:
59
+ """Returns the string representation of the model using alias"""
60
+ return pprint.pformat(self.dict(by_alias=True))
61
+
62
+ def to_json(self) -> str:
63
+ """Returns the JSON representation of the model using alias"""
64
+ return json.dumps(self.to_dict())
65
+
66
+ @classmethod
67
+ def from_json(cls, json_str: str) -> NavTypeDefinition:
68
+ """Create an instance of NavTypeDefinition from a JSON string"""
69
+ return cls.from_dict(json.loads(json_str))
70
+
71
+ def to_dict(self):
72
+ """Returns the dictionary representation of the model using alias"""
73
+ _dict = self.dict(by_alias=True,
74
+ exclude={
75
+ },
76
+ exclude_none=True)
77
+ # override the default output from pydantic by calling `to_dict()` of valuation_recipe_id
78
+ if self.valuation_recipe_id:
79
+ _dict['valuationRecipeId'] = self.valuation_recipe_id.to_dict()
80
+ # override the default output from pydantic by calling `to_dict()` of holding_recipe_id
81
+ if self.holding_recipe_id:
82
+ _dict['holdingRecipeId'] = self.holding_recipe_id.to_dict()
83
+ # override the default output from pydantic by calling `to_dict()` of chart_of_accounts_id
84
+ if self.chart_of_accounts_id:
85
+ _dict['chartOfAccountsId'] = self.chart_of_accounts_id.to_dict()
86
+ # set to None if code (nullable) is None
87
+ # and __fields_set__ contains the field
88
+ if self.code is None and "code" in self.__fields_set__:
89
+ _dict['code'] = None
90
+
91
+ # set to None if display_name (nullable) is None
92
+ # and __fields_set__ contains the field
93
+ if self.display_name is None and "display_name" in self.__fields_set__:
94
+ _dict['displayName'] = None
95
+
96
+ # set to None if description (nullable) is None
97
+ # and __fields_set__ contains the field
98
+ if self.description is None and "description" in self.__fields_set__:
99
+ _dict['description'] = None
100
+
101
+ # set to None if sub_holding_keys (nullable) is None
102
+ # and __fields_set__ contains the field
103
+ if self.sub_holding_keys is None and "sub_holding_keys" in self.__fields_set__:
104
+ _dict['subHoldingKeys'] = None
105
+
106
+ # set to None if instrument_scopes (nullable) is None
107
+ # and __fields_set__ contains the field
108
+ if self.instrument_scopes is None and "instrument_scopes" in self.__fields_set__:
109
+ _dict['instrumentScopes'] = None
110
+
111
+ # set to None if transaction_type_scope (nullable) is None
112
+ # and __fields_set__ contains the field
113
+ if self.transaction_type_scope is None and "transaction_type_scope" in self.__fields_set__:
114
+ _dict['transactionTypeScope'] = None
115
+
116
+ # set to None if cash_gain_loss_calculation_date (nullable) is None
117
+ # and __fields_set__ contains the field
118
+ if self.cash_gain_loss_calculation_date is None and "cash_gain_loss_calculation_date" in self.__fields_set__:
119
+ _dict['cashGainLossCalculationDate'] = None
120
+
121
+ # set to None if posting_module_codes (nullable) is None
122
+ # and __fields_set__ contains the field
123
+ if self.posting_module_codes is None and "posting_module_codes" in self.__fields_set__:
124
+ _dict['postingModuleCodes'] = None
125
+
126
+ # set to None if cleardown_module_codes (nullable) is None
127
+ # and __fields_set__ contains the field
128
+ if self.cleardown_module_codes is None and "cleardown_module_codes" in self.__fields_set__:
129
+ _dict['cleardownModuleCodes'] = None
130
+
131
+ return _dict
132
+
133
+ @classmethod
134
+ def from_dict(cls, obj: dict) -> NavTypeDefinition:
135
+ """Create an instance of NavTypeDefinition from a dict"""
136
+ if obj is None:
137
+ return None
138
+
139
+ if not isinstance(obj, dict):
140
+ return NavTypeDefinition.parse_obj(obj)
141
+
142
+ _obj = NavTypeDefinition.parse_obj({
143
+ "code": obj.get("code"),
144
+ "display_name": obj.get("displayName"),
145
+ "description": obj.get("description"),
146
+ "valuation_recipe_id": ResourceId.from_dict(obj.get("valuationRecipeId")) if obj.get("valuationRecipeId") is not None else None,
147
+ "holding_recipe_id": ResourceId.from_dict(obj.get("holdingRecipeId")) if obj.get("holdingRecipeId") is not None else None,
148
+ "accounting_method": obj.get("accountingMethod"),
149
+ "sub_holding_keys": obj.get("subHoldingKeys"),
150
+ "instrument_scopes": obj.get("instrumentScopes"),
151
+ "amortisation_method": obj.get("amortisationMethod"),
152
+ "transaction_type_scope": obj.get("transactionTypeScope"),
153
+ "cash_gain_loss_calculation_date": obj.get("cashGainLossCalculationDate"),
154
+ "chart_of_accounts_id": ResourceId.from_dict(obj.get("chartOfAccountsId")) if obj.get("chartOfAccountsId") is not None else None,
155
+ "posting_module_codes": obj.get("postingModuleCodes"),
156
+ "cleardown_module_codes": obj.get("cleardownModuleCodes")
157
+ })
158
+ 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
+
21
+ from typing import Any, Dict, Optional
22
+ from pydantic.v1 import StrictStr, Field, BaseModel, Field, constr, validator
23
+
24
+ class PortfolioEntityIdWithDetails(BaseModel):
25
+ """
26
+ PortfolioEntityIdWithDetails
27
+ """
28
+ display_name: Optional[StrictStr] = Field(None,alias="displayName")
29
+ description: Optional[StrictStr] = Field(None,alias="description")
30
+ scope: StrictStr = Field(...,alias="scope", description="The scope within which the portfolio or portfolio group lives.")
31
+ code: StrictStr = Field(...,alias="code", description="Portfolio name or code.")
32
+ portfolio_entity_type: Optional[StrictStr] = Field(None,alias="portfolioEntityType", description="String identifier for portfolio e.g. \"SinglePortfolio\" and \"GroupPortfolio\". If not specified, it is assumed to be a single portfolio.")
33
+ __properties = ["displayName", "description", "scope", "code", "portfolioEntityType"]
34
+
35
+ class Config:
36
+ """Pydantic configuration"""
37
+ allow_population_by_field_name = True
38
+ validate_assignment = True
39
+
40
+ def __str__(self):
41
+ """For `print` and `pprint`"""
42
+ return pprint.pformat(self.dict(by_alias=False))
43
+
44
+ def __repr__(self):
45
+ """For `print` and `pprint`"""
46
+ return self.to_str()
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) -> PortfolioEntityIdWithDetails:
58
+ """Create an instance of PortfolioEntityIdWithDetails 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
+ },
66
+ exclude_none=True)
67
+ # set to None if display_name (nullable) is None
68
+ # and __fields_set__ contains the field
69
+ if self.display_name is None and "display_name" in self.__fields_set__:
70
+ _dict['displayName'] = None
71
+
72
+ # set to None if description (nullable) is None
73
+ # and __fields_set__ contains the field
74
+ if self.description is None and "description" in self.__fields_set__:
75
+ _dict['description'] = None
76
+
77
+ # set to None if portfolio_entity_type (nullable) is None
78
+ # and __fields_set__ contains the field
79
+ if self.portfolio_entity_type is None and "portfolio_entity_type" in self.__fields_set__:
80
+ _dict['portfolioEntityType'] = None
81
+
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: dict) -> PortfolioEntityIdWithDetails:
86
+ """Create an instance of PortfolioEntityIdWithDetails from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return PortfolioEntityIdWithDetails.parse_obj(obj)
92
+
93
+ _obj = PortfolioEntityIdWithDetails.parse_obj({
94
+ "display_name": obj.get("displayName"),
95
+ "description": obj.get("description"),
96
+ "scope": obj.get("scope"),
97
+ "code": obj.get("code"),
98
+ "portfolio_entity_type": obj.get("portfolioEntityType")
99
+ })
100
+ return _obj
@@ -18,7 +18,7 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
 
21
- from typing import Any, Dict
21
+ from typing import Any, Dict, Optional
22
22
  from pydantic.v1 import StrictStr, Field, BaseModel, Field
23
23
  from lusid.models.date_or_diary_entry import DateOrDiaryEntry
24
24
 
@@ -26,8 +26,9 @@ class ValuationPointDataQueryParameters(BaseModel):
26
26
  """
27
27
  The parameters used in getting the ValuationPointData. # noqa: E501
28
28
  """
29
+ start: Optional[DateOrDiaryEntry] = None
29
30
  end: DateOrDiaryEntry = Field(...)
30
- __properties = ["end"]
31
+ __properties = ["start", "end"]
31
32
 
32
33
  class Config:
33
34
  """Pydantic configuration"""
@@ -61,6 +62,9 @@ class ValuationPointDataQueryParameters(BaseModel):
61
62
  exclude={
62
63
  },
63
64
  exclude_none=True)
65
+ # override the default output from pydantic by calling `to_dict()` of start
66
+ if self.start:
67
+ _dict['start'] = self.start.to_dict()
64
68
  # override the default output from pydantic by calling `to_dict()` of end
65
69
  if self.end:
66
70
  _dict['end'] = self.end.to_dict()
@@ -76,6 +80,7 @@ class ValuationPointDataQueryParameters(BaseModel):
76
80
  return ValuationPointDataQueryParameters.parse_obj(obj)
77
81
 
78
82
  _obj = ValuationPointDataQueryParameters.parse_obj({
83
+ "start": DateOrDiaryEntry.from_dict(obj.get("start")) if obj.get("start") is not None else None,
79
84
  "end": DateOrDiaryEntry.from_dict(obj.get("end")) if obj.get("end") is not None else None
80
85
  })
81
86
  return _obj