lusid-sdk 2.1.856__py3-none-any.whl → 2.1.858__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 +16 -0
- lusid/api/__init__.py +2 -0
- lusid/api/investment_accounts_api.py +220 -0
- lusid/configuration.py +1 -1
- lusid/models/__init__.py +14 -0
- lusid/models/account_holder.py +115 -0
- lusid/models/account_holder_identifier.py +92 -0
- lusid/models/investment_account.py +215 -0
- lusid/models/investment_portfolio.py +109 -0
- lusid/models/investment_portfolio_identifier.py +81 -0
- lusid/models/upsert_investment_account_request.py +150 -0
- lusid/models/upsert_investment_accounts_response.py +137 -0
- {lusid_sdk-2.1.856.dist-info → lusid_sdk-2.1.858.dist-info}/METADATA +9 -1
- {lusid_sdk-2.1.856.dist-info → lusid_sdk-2.1.858.dist-info}/RECORD +15 -7
- {lusid_sdk-2.1.856.dist-info → lusid_sdk-2.1.858.dist-info}/WHEEL +0 -0
@@ -0,0 +1,215 @@
|
|
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
|
23
|
+
from lusid.models.account_holder import AccountHolder
|
24
|
+
from lusid.models.investment_portfolio import InvestmentPortfolio
|
25
|
+
from lusid.models.link import Link
|
26
|
+
from lusid.models.model_property import ModelProperty
|
27
|
+
from lusid.models.relationship import Relationship
|
28
|
+
from lusid.models.version import Version
|
29
|
+
|
30
|
+
class InvestmentAccount(BaseModel):
|
31
|
+
"""
|
32
|
+
Representation of an Investment Account on the LUSID API # noqa: E501
|
33
|
+
"""
|
34
|
+
lusid_investment_account_id: Optional[StrictStr] = Field(None,alias="lusidInvestmentAccountId", description="The unique LUSID Investment Account Identifier of the Investment Account.")
|
35
|
+
display_name: Optional[StrictStr] = Field(None,alias="displayName", description="The display name of the Investment Account")
|
36
|
+
description: Optional[StrictStr] = Field(None,alias="description", description="The description of the Investment Account")
|
37
|
+
identifiers: Optional[Dict[str, ModelProperty]] = Field(None, description="Unique client-defined identifiers of the Investment Account.")
|
38
|
+
account_type: Optional[StrictStr] = Field(None,alias="accountType", description="The type of the of the Investment Account.")
|
39
|
+
account_holders: Optional[conlist(AccountHolder)] = Field(None, alias="accountHolders", description="The Account Holders of the Investment Account.")
|
40
|
+
investment_portfolios: Optional[conlist(InvestmentPortfolio)] = Field(None, alias="investmentPortfolios", description="The Investment Portfolios of the Investment Account.")
|
41
|
+
properties: Optional[Dict[str, ModelProperty]] = Field(None, description="A set of properties associated to the Investment Account.")
|
42
|
+
relationships: Optional[conlist(Relationship)] = Field(None, description="A set of relationships associated to the Investment Account.")
|
43
|
+
href: Optional[StrictStr] = Field(None,alias="href", description="The specific Uniform Resource Identifier (URI) for this resource at the requested effective and asAt datetime.")
|
44
|
+
version: Optional[Version] = None
|
45
|
+
links: Optional[conlist(Link)] = None
|
46
|
+
__properties = ["lusidInvestmentAccountId", "displayName", "description", "identifiers", "accountType", "accountHolders", "investmentPortfolios", "properties", "relationships", "href", "version", "links"]
|
47
|
+
|
48
|
+
class Config:
|
49
|
+
"""Pydantic configuration"""
|
50
|
+
allow_population_by_field_name = True
|
51
|
+
validate_assignment = True
|
52
|
+
|
53
|
+
def __str__(self):
|
54
|
+
"""For `print` and `pprint`"""
|
55
|
+
return pprint.pformat(self.dict(by_alias=False))
|
56
|
+
|
57
|
+
def __repr__(self):
|
58
|
+
"""For `print` and `pprint`"""
|
59
|
+
return self.to_str()
|
60
|
+
|
61
|
+
def to_str(self) -> str:
|
62
|
+
"""Returns the string representation of the model using alias"""
|
63
|
+
return pprint.pformat(self.dict(by_alias=True))
|
64
|
+
|
65
|
+
def to_json(self) -> str:
|
66
|
+
"""Returns the JSON representation of the model using alias"""
|
67
|
+
return json.dumps(self.to_dict())
|
68
|
+
|
69
|
+
@classmethod
|
70
|
+
def from_json(cls, json_str: str) -> InvestmentAccount:
|
71
|
+
"""Create an instance of InvestmentAccount from a JSON string"""
|
72
|
+
return cls.from_dict(json.loads(json_str))
|
73
|
+
|
74
|
+
def to_dict(self):
|
75
|
+
"""Returns the dictionary representation of the model using alias"""
|
76
|
+
_dict = self.dict(by_alias=True,
|
77
|
+
exclude={
|
78
|
+
},
|
79
|
+
exclude_none=True)
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of each value in identifiers (dict)
|
81
|
+
_field_dict = {}
|
82
|
+
if self.identifiers:
|
83
|
+
for _key in self.identifiers:
|
84
|
+
if self.identifiers[_key]:
|
85
|
+
_field_dict[_key] = self.identifiers[_key].to_dict()
|
86
|
+
_dict['identifiers'] = _field_dict
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of each item in account_holders (list)
|
88
|
+
_items = []
|
89
|
+
if self.account_holders:
|
90
|
+
for _item in self.account_holders:
|
91
|
+
if _item:
|
92
|
+
_items.append(_item.to_dict())
|
93
|
+
_dict['accountHolders'] = _items
|
94
|
+
# override the default output from pydantic by calling `to_dict()` of each item in investment_portfolios (list)
|
95
|
+
_items = []
|
96
|
+
if self.investment_portfolios:
|
97
|
+
for _item in self.investment_portfolios:
|
98
|
+
if _item:
|
99
|
+
_items.append(_item.to_dict())
|
100
|
+
_dict['investmentPortfolios'] = _items
|
101
|
+
# override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
|
102
|
+
_field_dict = {}
|
103
|
+
if self.properties:
|
104
|
+
for _key in self.properties:
|
105
|
+
if self.properties[_key]:
|
106
|
+
_field_dict[_key] = self.properties[_key].to_dict()
|
107
|
+
_dict['properties'] = _field_dict
|
108
|
+
# override the default output from pydantic by calling `to_dict()` of each item in relationships (list)
|
109
|
+
_items = []
|
110
|
+
if self.relationships:
|
111
|
+
for _item in self.relationships:
|
112
|
+
if _item:
|
113
|
+
_items.append(_item.to_dict())
|
114
|
+
_dict['relationships'] = _items
|
115
|
+
# override the default output from pydantic by calling `to_dict()` of version
|
116
|
+
if self.version:
|
117
|
+
_dict['version'] = self.version.to_dict()
|
118
|
+
# override the default output from pydantic by calling `to_dict()` of each item in links (list)
|
119
|
+
_items = []
|
120
|
+
if self.links:
|
121
|
+
for _item in self.links:
|
122
|
+
if _item:
|
123
|
+
_items.append(_item.to_dict())
|
124
|
+
_dict['links'] = _items
|
125
|
+
# set to None if lusid_investment_account_id (nullable) is None
|
126
|
+
# and __fields_set__ contains the field
|
127
|
+
if self.lusid_investment_account_id is None and "lusid_investment_account_id" in self.__fields_set__:
|
128
|
+
_dict['lusidInvestmentAccountId'] = None
|
129
|
+
|
130
|
+
# set to None if display_name (nullable) is None
|
131
|
+
# and __fields_set__ contains the field
|
132
|
+
if self.display_name is None and "display_name" in self.__fields_set__:
|
133
|
+
_dict['displayName'] = None
|
134
|
+
|
135
|
+
# set to None if description (nullable) is None
|
136
|
+
# and __fields_set__ contains the field
|
137
|
+
if self.description is None and "description" in self.__fields_set__:
|
138
|
+
_dict['description'] = None
|
139
|
+
|
140
|
+
# set to None if identifiers (nullable) is None
|
141
|
+
# and __fields_set__ contains the field
|
142
|
+
if self.identifiers is None and "identifiers" in self.__fields_set__:
|
143
|
+
_dict['identifiers'] = None
|
144
|
+
|
145
|
+
# set to None if account_type (nullable) is None
|
146
|
+
# and __fields_set__ contains the field
|
147
|
+
if self.account_type is None and "account_type" in self.__fields_set__:
|
148
|
+
_dict['accountType'] = None
|
149
|
+
|
150
|
+
# set to None if account_holders (nullable) is None
|
151
|
+
# and __fields_set__ contains the field
|
152
|
+
if self.account_holders is None and "account_holders" in self.__fields_set__:
|
153
|
+
_dict['accountHolders'] = None
|
154
|
+
|
155
|
+
# set to None if investment_portfolios (nullable) is None
|
156
|
+
# and __fields_set__ contains the field
|
157
|
+
if self.investment_portfolios is None and "investment_portfolios" in self.__fields_set__:
|
158
|
+
_dict['investmentPortfolios'] = None
|
159
|
+
|
160
|
+
# set to None if properties (nullable) is None
|
161
|
+
# and __fields_set__ contains the field
|
162
|
+
if self.properties is None and "properties" in self.__fields_set__:
|
163
|
+
_dict['properties'] = None
|
164
|
+
|
165
|
+
# set to None if relationships (nullable) is None
|
166
|
+
# and __fields_set__ contains the field
|
167
|
+
if self.relationships is None and "relationships" in self.__fields_set__:
|
168
|
+
_dict['relationships'] = None
|
169
|
+
|
170
|
+
# set to None if href (nullable) is None
|
171
|
+
# and __fields_set__ contains the field
|
172
|
+
if self.href is None and "href" in self.__fields_set__:
|
173
|
+
_dict['href'] = None
|
174
|
+
|
175
|
+
# set to None if links (nullable) is None
|
176
|
+
# and __fields_set__ contains the field
|
177
|
+
if self.links is None and "links" in self.__fields_set__:
|
178
|
+
_dict['links'] = None
|
179
|
+
|
180
|
+
return _dict
|
181
|
+
|
182
|
+
@classmethod
|
183
|
+
def from_dict(cls, obj: dict) -> InvestmentAccount:
|
184
|
+
"""Create an instance of InvestmentAccount from a dict"""
|
185
|
+
if obj is None:
|
186
|
+
return None
|
187
|
+
|
188
|
+
if not isinstance(obj, dict):
|
189
|
+
return InvestmentAccount.parse_obj(obj)
|
190
|
+
|
191
|
+
_obj = InvestmentAccount.parse_obj({
|
192
|
+
"lusid_investment_account_id": obj.get("lusidInvestmentAccountId"),
|
193
|
+
"display_name": obj.get("displayName"),
|
194
|
+
"description": obj.get("description"),
|
195
|
+
"identifiers": dict(
|
196
|
+
(_k, ModelProperty.from_dict(_v))
|
197
|
+
for _k, _v in obj.get("identifiers").items()
|
198
|
+
)
|
199
|
+
if obj.get("identifiers") is not None
|
200
|
+
else None,
|
201
|
+
"account_type": obj.get("accountType"),
|
202
|
+
"account_holders": [AccountHolder.from_dict(_item) for _item in obj.get("accountHolders")] if obj.get("accountHolders") is not None else None,
|
203
|
+
"investment_portfolios": [InvestmentPortfolio.from_dict(_item) for _item in obj.get("investmentPortfolios")] if obj.get("investmentPortfolios") is not None else None,
|
204
|
+
"properties": dict(
|
205
|
+
(_k, ModelProperty.from_dict(_v))
|
206
|
+
for _k, _v in obj.get("properties").items()
|
207
|
+
)
|
208
|
+
if obj.get("properties") is not None
|
209
|
+
else None,
|
210
|
+
"relationships": [Relationship.from_dict(_item) for _item in obj.get("relationships")] if obj.get("relationships") is not None else None,
|
211
|
+
"href": obj.get("href"),
|
212
|
+
"version": Version.from_dict(obj.get("version")) if obj.get("version") is not None else None,
|
213
|
+
"links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
|
214
|
+
})
|
215
|
+
return _obj
|
@@ -0,0 +1,109 @@
|
|
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, StrictStr
|
23
|
+
from lusid.models.portfolio_without_href import PortfolioWithoutHref
|
24
|
+
|
25
|
+
class InvestmentPortfolio(BaseModel):
|
26
|
+
"""
|
27
|
+
An Investment Portfolio of an Investment Account. # noqa: E501
|
28
|
+
"""
|
29
|
+
key: Optional[StrictStr] = Field(None,alias="key", description="A client-defined key used to identify the Investment Portfolio, unique within the Investment Account")
|
30
|
+
scope: Optional[StrictStr] = Field(None,alias="scope", description="The scope of the Investment Portfolio")
|
31
|
+
code: Optional[StrictStr] = Field(None,alias="code", description="The code of the Investment Portfolio")
|
32
|
+
entity_unique_id: Optional[StrictStr] = Field(None,alias="entityUniqueId", description="The unique Portfolio entity identifier")
|
33
|
+
portfolio: Optional[PortfolioWithoutHref] = None
|
34
|
+
__properties = ["key", "scope", "code", "entityUniqueId", "portfolio"]
|
35
|
+
|
36
|
+
class Config:
|
37
|
+
"""Pydantic configuration"""
|
38
|
+
allow_population_by_field_name = True
|
39
|
+
validate_assignment = True
|
40
|
+
|
41
|
+
def __str__(self):
|
42
|
+
"""For `print` and `pprint`"""
|
43
|
+
return pprint.pformat(self.dict(by_alias=False))
|
44
|
+
|
45
|
+
def __repr__(self):
|
46
|
+
"""For `print` and `pprint`"""
|
47
|
+
return self.to_str()
|
48
|
+
|
49
|
+
def to_str(self) -> str:
|
50
|
+
"""Returns the string representation of the model using alias"""
|
51
|
+
return pprint.pformat(self.dict(by_alias=True))
|
52
|
+
|
53
|
+
def to_json(self) -> str:
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
55
|
+
return json.dumps(self.to_dict())
|
56
|
+
|
57
|
+
@classmethod
|
58
|
+
def from_json(cls, json_str: str) -> InvestmentPortfolio:
|
59
|
+
"""Create an instance of InvestmentPortfolio from a JSON string"""
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
61
|
+
|
62
|
+
def to_dict(self):
|
63
|
+
"""Returns the dictionary representation of the model using alias"""
|
64
|
+
_dict = self.dict(by_alias=True,
|
65
|
+
exclude={
|
66
|
+
},
|
67
|
+
exclude_none=True)
|
68
|
+
# override the default output from pydantic by calling `to_dict()` of portfolio
|
69
|
+
if self.portfolio:
|
70
|
+
_dict['portfolio'] = self.portfolio.to_dict()
|
71
|
+
# set to None if key (nullable) is None
|
72
|
+
# and __fields_set__ contains the field
|
73
|
+
if self.key is None and "key" in self.__fields_set__:
|
74
|
+
_dict['key'] = None
|
75
|
+
|
76
|
+
# set to None if scope (nullable) is None
|
77
|
+
# and __fields_set__ contains the field
|
78
|
+
if self.scope is None and "scope" in self.__fields_set__:
|
79
|
+
_dict['scope'] = None
|
80
|
+
|
81
|
+
# set to None if code (nullable) is None
|
82
|
+
# and __fields_set__ contains the field
|
83
|
+
if self.code is None and "code" in self.__fields_set__:
|
84
|
+
_dict['code'] = None
|
85
|
+
|
86
|
+
# set to None if entity_unique_id (nullable) is None
|
87
|
+
# and __fields_set__ contains the field
|
88
|
+
if self.entity_unique_id is None and "entity_unique_id" in self.__fields_set__:
|
89
|
+
_dict['entityUniqueId'] = None
|
90
|
+
|
91
|
+
return _dict
|
92
|
+
|
93
|
+
@classmethod
|
94
|
+
def from_dict(cls, obj: dict) -> InvestmentPortfolio:
|
95
|
+
"""Create an instance of InvestmentPortfolio from a dict"""
|
96
|
+
if obj is None:
|
97
|
+
return None
|
98
|
+
|
99
|
+
if not isinstance(obj, dict):
|
100
|
+
return InvestmentPortfolio.parse_obj(obj)
|
101
|
+
|
102
|
+
_obj = InvestmentPortfolio.parse_obj({
|
103
|
+
"key": obj.get("key"),
|
104
|
+
"scope": obj.get("scope"),
|
105
|
+
"code": obj.get("code"),
|
106
|
+
"entity_unique_id": obj.get("entityUniqueId"),
|
107
|
+
"portfolio": PortfolioWithoutHref.from_dict(obj.get("portfolio")) if obj.get("portfolio") is not None else None
|
108
|
+
})
|
109
|
+
return _obj
|
@@ -0,0 +1,81 @@
|
|
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 StrictStr, Field, BaseModel, Field, constr, validator
|
23
|
+
|
24
|
+
class InvestmentPortfolioIdentifier(BaseModel):
|
25
|
+
"""
|
26
|
+
InvestmentPortfolioIdentifier
|
27
|
+
"""
|
28
|
+
key: StrictStr = Field(...,alias="key", description="A client-defined key used to identify the Investment Portfolio, unique within the Investment Account")
|
29
|
+
portfolio_scope: StrictStr = Field(...,alias="portfolioScope", description="The scope of the Investment Portfolio.")
|
30
|
+
portfolio_code: StrictStr = Field(...,alias="portfolioCode", description="The code of the Investment Portfolio.")
|
31
|
+
__properties = ["key", "portfolioScope", "portfolioCode"]
|
32
|
+
|
33
|
+
class Config:
|
34
|
+
"""Pydantic configuration"""
|
35
|
+
allow_population_by_field_name = True
|
36
|
+
validate_assignment = True
|
37
|
+
|
38
|
+
def __str__(self):
|
39
|
+
"""For `print` and `pprint`"""
|
40
|
+
return pprint.pformat(self.dict(by_alias=False))
|
41
|
+
|
42
|
+
def __repr__(self):
|
43
|
+
"""For `print` and `pprint`"""
|
44
|
+
return self.to_str()
|
45
|
+
|
46
|
+
def to_str(self) -> str:
|
47
|
+
"""Returns the string representation of the model using alias"""
|
48
|
+
return pprint.pformat(self.dict(by_alias=True))
|
49
|
+
|
50
|
+
def to_json(self) -> str:
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
52
|
+
return json.dumps(self.to_dict())
|
53
|
+
|
54
|
+
@classmethod
|
55
|
+
def from_json(cls, json_str: str) -> InvestmentPortfolioIdentifier:
|
56
|
+
"""Create an instance of InvestmentPortfolioIdentifier from a JSON string"""
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
58
|
+
|
59
|
+
def to_dict(self):
|
60
|
+
"""Returns the dictionary representation of the model using alias"""
|
61
|
+
_dict = self.dict(by_alias=True,
|
62
|
+
exclude={
|
63
|
+
},
|
64
|
+
exclude_none=True)
|
65
|
+
return _dict
|
66
|
+
|
67
|
+
@classmethod
|
68
|
+
def from_dict(cls, obj: dict) -> InvestmentPortfolioIdentifier:
|
69
|
+
"""Create an instance of InvestmentPortfolioIdentifier from a dict"""
|
70
|
+
if obj is None:
|
71
|
+
return None
|
72
|
+
|
73
|
+
if not isinstance(obj, dict):
|
74
|
+
return InvestmentPortfolioIdentifier.parse_obj(obj)
|
75
|
+
|
76
|
+
_obj = InvestmentPortfolioIdentifier.parse_obj({
|
77
|
+
"key": obj.get("key"),
|
78
|
+
"portfolio_scope": obj.get("portfolioScope"),
|
79
|
+
"portfolio_code": obj.get("portfolioCode")
|
80
|
+
})
|
81
|
+
return _obj
|
@@ -0,0 +1,150 @@
|
|
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, conlist, constr, validator
|
23
|
+
from lusid.models.account_holder_identifier import AccountHolderIdentifier
|
24
|
+
from lusid.models.investment_portfolio_identifier import InvestmentPortfolioIdentifier
|
25
|
+
from lusid.models.model_property import ModelProperty
|
26
|
+
|
27
|
+
class UpsertInvestmentAccountRequest(BaseModel):
|
28
|
+
"""
|
29
|
+
Request to create or update an investor record # noqa: E501
|
30
|
+
"""
|
31
|
+
identifiers: Dict[str, ModelProperty] = Field(..., description="Unique client-defined identifiers of the Investment Account.")
|
32
|
+
properties: Optional[Dict[str, ModelProperty]] = Field(None, description="A set of properties associated to the Investment Account.")
|
33
|
+
display_name: StrictStr = Field(...,alias="displayName", description="The display name of the Investment Account")
|
34
|
+
description: Optional[StrictStr] = Field(None,alias="description", description="The description of the Investment Account")
|
35
|
+
account_type: StrictStr = Field(...,alias="accountType", description="The type of the of the Investment Account.")
|
36
|
+
account_holders: Optional[conlist(AccountHolderIdentifier)] = Field(None, alias="accountHolders", description="The identification of the account holders associated with this investment account")
|
37
|
+
investment_portfolios: Optional[conlist(InvestmentPortfolioIdentifier)] = Field(None, alias="investmentPortfolios", description="The identification of the investment portfolios associated with this investment account")
|
38
|
+
__properties = ["identifiers", "properties", "displayName", "description", "accountType", "accountHolders", "investmentPortfolios"]
|
39
|
+
|
40
|
+
class Config:
|
41
|
+
"""Pydantic configuration"""
|
42
|
+
allow_population_by_field_name = True
|
43
|
+
validate_assignment = True
|
44
|
+
|
45
|
+
def __str__(self):
|
46
|
+
"""For `print` and `pprint`"""
|
47
|
+
return pprint.pformat(self.dict(by_alias=False))
|
48
|
+
|
49
|
+
def __repr__(self):
|
50
|
+
"""For `print` and `pprint`"""
|
51
|
+
return self.to_str()
|
52
|
+
|
53
|
+
def to_str(self) -> str:
|
54
|
+
"""Returns the string representation of the model using alias"""
|
55
|
+
return pprint.pformat(self.dict(by_alias=True))
|
56
|
+
|
57
|
+
def to_json(self) -> str:
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
59
|
+
return json.dumps(self.to_dict())
|
60
|
+
|
61
|
+
@classmethod
|
62
|
+
def from_json(cls, json_str: str) -> UpsertInvestmentAccountRequest:
|
63
|
+
"""Create an instance of UpsertInvestmentAccountRequest from a JSON string"""
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
65
|
+
|
66
|
+
def to_dict(self):
|
67
|
+
"""Returns the dictionary representation of the model using alias"""
|
68
|
+
_dict = self.dict(by_alias=True,
|
69
|
+
exclude={
|
70
|
+
},
|
71
|
+
exclude_none=True)
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of each value in identifiers (dict)
|
73
|
+
_field_dict = {}
|
74
|
+
if self.identifiers:
|
75
|
+
for _key in self.identifiers:
|
76
|
+
if self.identifiers[_key]:
|
77
|
+
_field_dict[_key] = self.identifiers[_key].to_dict()
|
78
|
+
_dict['identifiers'] = _field_dict
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
|
80
|
+
_field_dict = {}
|
81
|
+
if self.properties:
|
82
|
+
for _key in self.properties:
|
83
|
+
if self.properties[_key]:
|
84
|
+
_field_dict[_key] = self.properties[_key].to_dict()
|
85
|
+
_dict['properties'] = _field_dict
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of each item in account_holders (list)
|
87
|
+
_items = []
|
88
|
+
if self.account_holders:
|
89
|
+
for _item in self.account_holders:
|
90
|
+
if _item:
|
91
|
+
_items.append(_item.to_dict())
|
92
|
+
_dict['accountHolders'] = _items
|
93
|
+
# override the default output from pydantic by calling `to_dict()` of each item in investment_portfolios (list)
|
94
|
+
_items = []
|
95
|
+
if self.investment_portfolios:
|
96
|
+
for _item in self.investment_portfolios:
|
97
|
+
if _item:
|
98
|
+
_items.append(_item.to_dict())
|
99
|
+
_dict['investmentPortfolios'] = _items
|
100
|
+
# set to None if properties (nullable) is None
|
101
|
+
# and __fields_set__ contains the field
|
102
|
+
if self.properties is None and "properties" in self.__fields_set__:
|
103
|
+
_dict['properties'] = None
|
104
|
+
|
105
|
+
# set to None if description (nullable) is None
|
106
|
+
# and __fields_set__ contains the field
|
107
|
+
if self.description is None and "description" in self.__fields_set__:
|
108
|
+
_dict['description'] = None
|
109
|
+
|
110
|
+
# set to None if account_holders (nullable) is None
|
111
|
+
# and __fields_set__ contains the field
|
112
|
+
if self.account_holders is None and "account_holders" in self.__fields_set__:
|
113
|
+
_dict['accountHolders'] = None
|
114
|
+
|
115
|
+
# set to None if investment_portfolios (nullable) is None
|
116
|
+
# and __fields_set__ contains the field
|
117
|
+
if self.investment_portfolios is None and "investment_portfolios" in self.__fields_set__:
|
118
|
+
_dict['investmentPortfolios'] = None
|
119
|
+
|
120
|
+
return _dict
|
121
|
+
|
122
|
+
@classmethod
|
123
|
+
def from_dict(cls, obj: dict) -> UpsertInvestmentAccountRequest:
|
124
|
+
"""Create an instance of UpsertInvestmentAccountRequest from a dict"""
|
125
|
+
if obj is None:
|
126
|
+
return None
|
127
|
+
|
128
|
+
if not isinstance(obj, dict):
|
129
|
+
return UpsertInvestmentAccountRequest.parse_obj(obj)
|
130
|
+
|
131
|
+
_obj = UpsertInvestmentAccountRequest.parse_obj({
|
132
|
+
"identifiers": dict(
|
133
|
+
(_k, ModelProperty.from_dict(_v))
|
134
|
+
for _k, _v in obj.get("identifiers").items()
|
135
|
+
)
|
136
|
+
if obj.get("identifiers") is not None
|
137
|
+
else None,
|
138
|
+
"properties": dict(
|
139
|
+
(_k, ModelProperty.from_dict(_v))
|
140
|
+
for _k, _v in obj.get("properties").items()
|
141
|
+
)
|
142
|
+
if obj.get("properties") is not None
|
143
|
+
else None,
|
144
|
+
"display_name": obj.get("displayName"),
|
145
|
+
"description": obj.get("description"),
|
146
|
+
"account_type": obj.get("accountType"),
|
147
|
+
"account_holders": [AccountHolderIdentifier.from_dict(_item) for _item in obj.get("accountHolders")] if obj.get("accountHolders") is not None else None,
|
148
|
+
"investment_portfolios": [InvestmentPortfolioIdentifier.from_dict(_item) for _item in obj.get("investmentPortfolios")] if obj.get("investmentPortfolios") is not None else None
|
149
|
+
})
|
150
|
+
return _obj
|