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 CHANGED
@@ -51,6 +51,7 @@ from lusid.api.identifier_definitions_api import IdentifierDefinitionsApi
51
51
  from lusid.api.instrument_event_types_api import InstrumentEventTypesApi
52
52
  from lusid.api.instrument_events_api import InstrumentEventsApi
53
53
  from lusid.api.instruments_api import InstrumentsApi
54
+ from lusid.api.investment_accounts_api import InvestmentAccountsApi
54
55
  from lusid.api.investor_records_api import InvestorRecordsApi
55
56
  from lusid.api.legacy_compliance_api import LegacyComplianceApi
56
57
  from lusid.api.legal_entities_api import LegalEntitiesApi
@@ -118,6 +119,8 @@ from lusid.models.access_controlled_resource import AccessControlledResource
118
119
  from lusid.models.access_metadata_operation import AccessMetadataOperation
119
120
  from lusid.models.access_metadata_value import AccessMetadataValue
120
121
  from lusid.models.account import Account
122
+ from lusid.models.account_holder import AccountHolder
123
+ from lusid.models.account_holder_identifier import AccountHolderIdentifier
121
124
  from lusid.models.account_properties import AccountProperties
122
125
  from lusid.models.accounted_transaction import AccountedTransaction
123
126
  from lusid.models.accounting_method import AccountingMethod
@@ -656,6 +659,9 @@ from lusid.models.interest_rate_swaption import InterestRateSwaption
656
659
  from lusid.models.intermediate_compliance_step import IntermediateComplianceStep
657
660
  from lusid.models.intermediate_compliance_step_request import IntermediateComplianceStepRequest
658
661
  from lusid.models.intermediate_securities_distribution_event import IntermediateSecuritiesDistributionEvent
662
+ from lusid.models.investment_account import InvestmentAccount
663
+ from lusid.models.investment_portfolio import InvestmentPortfolio
664
+ from lusid.models.investment_portfolio_identifier import InvestmentPortfolioIdentifier
659
665
  from lusid.models.investor import Investor
660
666
  from lusid.models.investor_identifier import InvestorIdentifier
661
667
  from lusid.models.investor_record import InvestorRecord
@@ -1268,6 +1274,8 @@ from lusid.models.upsert_instrument_events_response import UpsertInstrumentEvent
1268
1274
  from lusid.models.upsert_instrument_properties_response import UpsertInstrumentPropertiesResponse
1269
1275
  from lusid.models.upsert_instrument_property_request import UpsertInstrumentPropertyRequest
1270
1276
  from lusid.models.upsert_instruments_response import UpsertInstrumentsResponse
1277
+ from lusid.models.upsert_investment_account_request import UpsertInvestmentAccountRequest
1278
+ from lusid.models.upsert_investment_accounts_response import UpsertInvestmentAccountsResponse
1271
1279
  from lusid.models.upsert_investor_record_request import UpsertInvestorRecordRequest
1272
1280
  from lusid.models.upsert_investor_records_response import UpsertInvestorRecordsResponse
1273
1281
  from lusid.models.upsert_legal_entities_response import UpsertLegalEntitiesResponse
@@ -1389,6 +1397,7 @@ __all__ = [
1389
1397
  "InstrumentEventTypesApi",
1390
1398
  "InstrumentEventsApi",
1391
1399
  "InstrumentsApi",
1400
+ "InvestmentAccountsApi",
1392
1401
  "InvestorRecordsApi",
1393
1402
  "LegacyComplianceApi",
1394
1403
  "LegalEntitiesApi",
@@ -1446,6 +1455,8 @@ __all__ = [
1446
1455
  "AccessMetadataOperation",
1447
1456
  "AccessMetadataValue",
1448
1457
  "Account",
1458
+ "AccountHolder",
1459
+ "AccountHolderIdentifier",
1449
1460
  "AccountProperties",
1450
1461
  "AccountedTransaction",
1451
1462
  "AccountingMethod",
@@ -1984,6 +1995,9 @@ __all__ = [
1984
1995
  "IntermediateComplianceStep",
1985
1996
  "IntermediateComplianceStepRequest",
1986
1997
  "IntermediateSecuritiesDistributionEvent",
1998
+ "InvestmentAccount",
1999
+ "InvestmentPortfolio",
2000
+ "InvestmentPortfolioIdentifier",
1987
2001
  "Investor",
1988
2002
  "InvestorIdentifier",
1989
2003
  "InvestorRecord",
@@ -2596,6 +2610,8 @@ __all__ = [
2596
2610
  "UpsertInstrumentPropertiesResponse",
2597
2611
  "UpsertInstrumentPropertyRequest",
2598
2612
  "UpsertInstrumentsResponse",
2613
+ "UpsertInvestmentAccountRequest",
2614
+ "UpsertInvestmentAccountsResponse",
2599
2615
  "UpsertInvestorRecordRequest",
2600
2616
  "UpsertInvestorRecordsResponse",
2601
2617
  "UpsertLegalEntitiesResponse",
lusid/api/__init__.py CHANGED
@@ -35,6 +35,7 @@ from lusid.api.identifier_definitions_api import IdentifierDefinitionsApi
35
35
  from lusid.api.instrument_event_types_api import InstrumentEventTypesApi
36
36
  from lusid.api.instrument_events_api import InstrumentEventsApi
37
37
  from lusid.api.instruments_api import InstrumentsApi
38
+ from lusid.api.investment_accounts_api import InvestmentAccountsApi
38
39
  from lusid.api.investor_records_api import InvestorRecordsApi
39
40
  from lusid.api.legacy_compliance_api import LegacyComplianceApi
40
41
  from lusid.api.legal_entities_api import LegalEntitiesApi
@@ -113,6 +114,7 @@ __all__ = [
113
114
  "InstrumentEventTypesApi",
114
115
  "InstrumentEventsApi",
115
116
  "InstrumentsApi",
117
+ "InvestmentAccountsApi",
116
118
  "InvestorRecordsApi",
117
119
  "LegacyComplianceApi",
118
120
  "LegalEntitiesApi",
@@ -0,0 +1,220 @@
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
+ import re # noqa: F401
16
+ import io
17
+ import warnings
18
+
19
+ from pydantic.v1 import validate_arguments, ValidationError
20
+ from typing import overload, Optional, Union, Awaitable
21
+
22
+ from typing_extensions import Annotated
23
+ from pydantic.v1 import Field, constr
24
+
25
+ from typing import Dict
26
+
27
+ from lusid.models.upsert_investment_account_request import UpsertInvestmentAccountRequest
28
+ from lusid.models.upsert_investment_accounts_response import UpsertInvestmentAccountsResponse
29
+
30
+ from lusid.api_client import ApiClient
31
+ from lusid.api_response import ApiResponse
32
+ from lusid.exceptions import ( # noqa: F401
33
+ ApiTypeError,
34
+ ApiValueError
35
+ )
36
+ from lusid.extensions.configuration_options import ConfigurationOptions
37
+
38
+ # ensure templated type usages are imported
39
+ from pydantic.v1 import Field, StrictStr
40
+ from typing import Optional
41
+ from typing_extensions import Annotated
42
+
43
+ class InvestmentAccountsApi:
44
+ """NOTE: This class is auto generated by OpenAPI Generator
45
+ Ref: https://openapi-generator.tech
46
+
47
+ Do not edit the class manually.
48
+ """
49
+
50
+ def __init__(self, api_client=None) -> None:
51
+ if api_client is None:
52
+ api_client = ApiClient.get_default()
53
+ self.api_client = api_client
54
+
55
+
56
+ @overload
57
+ async def upsert_investment_accounts(self, success_mode : Annotated[StrictStr, Field(..., description="Whether the batch request should fail Atomically or in a Partial fashion - Allowed Values: Atomic, Partial")], request_body : Annotated[Dict[str, UpsertInvestmentAccountRequest], Field(..., description="A collection of requests to create or update Investment Accounts.")], **kwargs) -> UpsertInvestmentAccountsResponse: # noqa: E501
58
+ ...
59
+
60
+ @overload
61
+ def upsert_investment_accounts(self, success_mode : Annotated[StrictStr, Field(..., description="Whether the batch request should fail Atomically or in a Partial fashion - Allowed Values: Atomic, Partial")], request_body : Annotated[Dict[str, UpsertInvestmentAccountRequest], Field(..., description="A collection of requests to create or update Investment Accounts.")], async_req: Optional[bool]=True, **kwargs) -> UpsertInvestmentAccountsResponse: # noqa: E501
62
+ ...
63
+
64
+ @validate_arguments
65
+ def upsert_investment_accounts(self, success_mode : Annotated[StrictStr, Field(..., description="Whether the batch request should fail Atomically or in a Partial fashion - Allowed Values: Atomic, Partial")], request_body : Annotated[Dict[str, UpsertInvestmentAccountRequest], Field(..., description="A collection of requests to create or update Investment Accounts.")], async_req: Optional[bool]=None, **kwargs) -> Union[UpsertInvestmentAccountsResponse, Awaitable[UpsertInvestmentAccountsResponse]]: # noqa: E501
66
+ """[EARLY ACCESS] UpsertInvestmentAccounts: Upsert Investment Accounts # noqa: E501
67
+
68
+ Creates or updates a collection of Investment Accounts # noqa: E501
69
+ This method makes a synchronous HTTP request by default. To make an
70
+ asynchronous HTTP request, please pass async_req=True
71
+
72
+ >>> thread = api.upsert_investment_accounts(success_mode, request_body, async_req=True)
73
+ >>> result = thread.get()
74
+
75
+ :param success_mode: Whether the batch request should fail Atomically or in a Partial fashion - Allowed Values: Atomic, Partial (required)
76
+ :type success_mode: str
77
+ :param request_body: A collection of requests to create or update Investment Accounts. (required)
78
+ :type request_body: Dict[str, UpsertInvestmentAccountRequest]
79
+ :param async_req: Whether to execute the request asynchronously.
80
+ :type async_req: bool, optional
81
+ :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
82
+ :param opts: Configuration options for this request
83
+ :type opts: ConfigurationOptions, optional
84
+ :return: Returns the result object.
85
+ If the method is called asynchronously,
86
+ returns the request thread.
87
+ :rtype: UpsertInvestmentAccountsResponse
88
+ """
89
+ kwargs['_return_http_data_only'] = True
90
+ if '_preload_content' in kwargs:
91
+ message = "Error! Please call the upsert_investment_accounts_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
92
+ raise ValueError(message)
93
+ if async_req is not None:
94
+ kwargs['async_req'] = async_req
95
+ return self.upsert_investment_accounts_with_http_info(success_mode, request_body, **kwargs) # noqa: E501
96
+
97
+ @validate_arguments
98
+ def upsert_investment_accounts_with_http_info(self, success_mode : Annotated[StrictStr, Field(..., description="Whether the batch request should fail Atomically or in a Partial fashion - Allowed Values: Atomic, Partial")], request_body : Annotated[Dict[str, UpsertInvestmentAccountRequest], Field(..., description="A collection of requests to create or update Investment Accounts.")], **kwargs) -> ApiResponse: # noqa: E501
99
+ """[EARLY ACCESS] UpsertInvestmentAccounts: Upsert Investment Accounts # noqa: E501
100
+
101
+ Creates or updates a collection of Investment Accounts # noqa: E501
102
+ This method makes a synchronous HTTP request by default. To make an
103
+ asynchronous HTTP request, please pass async_req=True
104
+
105
+ >>> thread = api.upsert_investment_accounts_with_http_info(success_mode, request_body, async_req=True)
106
+ >>> result = thread.get()
107
+
108
+ :param success_mode: Whether the batch request should fail Atomically or in a Partial fashion - Allowed Values: Atomic, Partial (required)
109
+ :type success_mode: str
110
+ :param request_body: A collection of requests to create or update Investment Accounts. (required)
111
+ :type request_body: Dict[str, UpsertInvestmentAccountRequest]
112
+ :param async_req: Whether to execute the request asynchronously.
113
+ :type async_req: bool, optional
114
+ :param _preload_content: if False, the ApiResponse.data will
115
+ be set to none and raw_data will store the
116
+ HTTP response body without reading/decoding.
117
+ Default is True.
118
+ :type _preload_content: bool, optional
119
+ :param _return_http_data_only: response data instead of ApiResponse
120
+ object with status code, headers, etc
121
+ :type _return_http_data_only: bool, optional
122
+ :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
123
+ :param opts: Configuration options for this request
124
+ :type opts: ConfigurationOptions, optional
125
+ :param _request_auth: set to override the auth_settings for an a single
126
+ request; this effectively ignores the authentication
127
+ in the spec for a single request.
128
+ :type _request_auth: dict, optional
129
+ :type _content_type: string, optional: force content-type for the request
130
+ :return: Returns the result object.
131
+ If the method is called asynchronously,
132
+ returns the request thread.
133
+ :rtype: tuple(UpsertInvestmentAccountsResponse, status_code(int), headers(HTTPHeaderDict))
134
+ """
135
+
136
+ _params = locals()
137
+
138
+ _all_params = [
139
+ 'success_mode',
140
+ 'request_body'
141
+ ]
142
+ _all_params.extend(
143
+ [
144
+ 'async_req',
145
+ '_return_http_data_only',
146
+ '_preload_content',
147
+ '_request_timeout',
148
+ '_request_auth',
149
+ '_content_type',
150
+ '_headers',
151
+ 'opts'
152
+ ]
153
+ )
154
+
155
+ # validate the arguments
156
+ for _key, _val in _params['kwargs'].items():
157
+ if _key not in _all_params:
158
+ raise ApiTypeError(
159
+ "Got an unexpected keyword argument '%s'"
160
+ " to method upsert_investment_accounts" % _key
161
+ )
162
+ _params[_key] = _val
163
+ del _params['kwargs']
164
+
165
+ _collection_formats = {}
166
+
167
+ # process the path parameters
168
+ _path_params = {}
169
+
170
+ # process the query parameters
171
+ _query_params = []
172
+ if _params.get('success_mode') is not None: # noqa: E501
173
+ _query_params.append(('successMode', _params['success_mode']))
174
+
175
+ # process the header parameters
176
+ _header_params = dict(_params.get('_headers', {}))
177
+ # process the form parameters
178
+ _form_params = []
179
+ _files = {}
180
+ # process the body parameter
181
+ _body_params = None
182
+ if _params['request_body'] is not None:
183
+ _body_params = _params['request_body']
184
+
185
+ # set the HTTP header `Accept`
186
+ _header_params['Accept'] = self.api_client.select_header_accept(
187
+ ['text/plain', 'application/json', 'text/json']) # noqa: E501
188
+
189
+ # set the HTTP header `Content-Type`
190
+ _content_types_list = _params.get('_content_type',
191
+ self.api_client.select_header_content_type(
192
+ ['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']))
193
+ if _content_types_list:
194
+ _header_params['Content-Type'] = _content_types_list
195
+
196
+ # authentication setting
197
+ _auth_settings = ['oauth2'] # noqa: E501
198
+
199
+ _response_types_map = {
200
+ '201': "UpsertInvestmentAccountsResponse",
201
+ '400': "LusidValidationProblemDetails",
202
+ }
203
+
204
+ return self.api_client.call_api(
205
+ '/api/investmentaccounts/$batchUpsert', 'POST',
206
+ _path_params,
207
+ _query_params,
208
+ _header_params,
209
+ body=_body_params,
210
+ post_params=_form_params,
211
+ files=_files,
212
+ response_types_map=_response_types_map,
213
+ auth_settings=_auth_settings,
214
+ async_req=_params.get('async_req'),
215
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
216
+ _preload_content=_params.get('_preload_content', True),
217
+ _request_timeout=_params.get('_request_timeout'),
218
+ opts=_params.get('opts'),
219
+ collection_formats=_collection_formats,
220
+ _request_auth=_params.get('_request_auth'))
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.7985\n"\
448
+ "Version of the API: 0.11.8000\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
@@ -30,6 +30,8 @@ from lusid.models.access_controlled_resource import AccessControlledResource
30
30
  from lusid.models.access_metadata_operation import AccessMetadataOperation
31
31
  from lusid.models.access_metadata_value import AccessMetadataValue
32
32
  from lusid.models.account import Account
33
+ from lusid.models.account_holder import AccountHolder
34
+ from lusid.models.account_holder_identifier import AccountHolderIdentifier
33
35
  from lusid.models.account_properties import AccountProperties
34
36
  from lusid.models.accounted_transaction import AccountedTransaction
35
37
  from lusid.models.accounting_method import AccountingMethod
@@ -568,6 +570,9 @@ from lusid.models.interest_rate_swaption import InterestRateSwaption
568
570
  from lusid.models.intermediate_compliance_step import IntermediateComplianceStep
569
571
  from lusid.models.intermediate_compliance_step_request import IntermediateComplianceStepRequest
570
572
  from lusid.models.intermediate_securities_distribution_event import IntermediateSecuritiesDistributionEvent
573
+ from lusid.models.investment_account import InvestmentAccount
574
+ from lusid.models.investment_portfolio import InvestmentPortfolio
575
+ from lusid.models.investment_portfolio_identifier import InvestmentPortfolioIdentifier
571
576
  from lusid.models.investor import Investor
572
577
  from lusid.models.investor_identifier import InvestorIdentifier
573
578
  from lusid.models.investor_record import InvestorRecord
@@ -1180,6 +1185,8 @@ from lusid.models.upsert_instrument_events_response import UpsertInstrumentEvent
1180
1185
  from lusid.models.upsert_instrument_properties_response import UpsertInstrumentPropertiesResponse
1181
1186
  from lusid.models.upsert_instrument_property_request import UpsertInstrumentPropertyRequest
1182
1187
  from lusid.models.upsert_instruments_response import UpsertInstrumentsResponse
1188
+ from lusid.models.upsert_investment_account_request import UpsertInvestmentAccountRequest
1189
+ from lusid.models.upsert_investment_accounts_response import UpsertInvestmentAccountsResponse
1183
1190
  from lusid.models.upsert_investor_record_request import UpsertInvestorRecordRequest
1184
1191
  from lusid.models.upsert_investor_records_response import UpsertInvestorRecordsResponse
1185
1192
  from lusid.models.upsert_legal_entities_response import UpsertLegalEntitiesResponse
@@ -1271,6 +1278,8 @@ __all__ = [
1271
1278
  "AccessMetadataOperation",
1272
1279
  "AccessMetadataValue",
1273
1280
  "Account",
1281
+ "AccountHolder",
1282
+ "AccountHolderIdentifier",
1274
1283
  "AccountProperties",
1275
1284
  "AccountedTransaction",
1276
1285
  "AccountingMethod",
@@ -1809,6 +1818,9 @@ __all__ = [
1809
1818
  "IntermediateComplianceStep",
1810
1819
  "IntermediateComplianceStepRequest",
1811
1820
  "IntermediateSecuritiesDistributionEvent",
1821
+ "InvestmentAccount",
1822
+ "InvestmentPortfolio",
1823
+ "InvestmentPortfolioIdentifier",
1812
1824
  "Investor",
1813
1825
  "InvestorIdentifier",
1814
1826
  "InvestorRecord",
@@ -2421,6 +2433,8 @@ __all__ = [
2421
2433
  "UpsertInstrumentPropertiesResponse",
2422
2434
  "UpsertInstrumentPropertyRequest",
2423
2435
  "UpsertInstrumentsResponse",
2436
+ "UpsertInvestmentAccountRequest",
2437
+ "UpsertInvestmentAccountsResponse",
2424
2438
  "UpsertInvestorRecordRequest",
2425
2439
  "UpsertInvestorRecordsResponse",
2426
2440
  "UpsertLegalEntitiesResponse",
@@ -0,0 +1,115 @@
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.investor_record import InvestorRecord
24
+ from lusid.models.model_property import ModelProperty
25
+
26
+ class AccountHolder(BaseModel):
27
+ """
28
+ An Account Holder of an Investment Account. # noqa: E501
29
+ """
30
+ key: Optional[StrictStr] = Field(None,alias="key", description="A client-defined key used to identify the Account Holder, unique within the Investment Account")
31
+ identifiers: Optional[Dict[str, ModelProperty]] = Field(None, description="Single Account Holder identifier that should target the desired Investor Record.")
32
+ entity_unique_id: Optional[StrictStr] = Field(None,alias="entityUniqueId", description="The unique InvestorRecord entity identifier")
33
+ investor_record: Optional[InvestorRecord] = Field(None, alias="investorRecord")
34
+ __properties = ["key", "identifiers", "entityUniqueId", "investorRecord"]
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) -> AccountHolder:
59
+ """Create an instance of AccountHolder 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 each value in identifiers (dict)
69
+ _field_dict = {}
70
+ if self.identifiers:
71
+ for _key in self.identifiers:
72
+ if self.identifiers[_key]:
73
+ _field_dict[_key] = self.identifiers[_key].to_dict()
74
+ _dict['identifiers'] = _field_dict
75
+ # override the default output from pydantic by calling `to_dict()` of investor_record
76
+ if self.investor_record:
77
+ _dict['investorRecord'] = self.investor_record.to_dict()
78
+ # set to None if key (nullable) is None
79
+ # and __fields_set__ contains the field
80
+ if self.key is None and "key" in self.__fields_set__:
81
+ _dict['key'] = None
82
+
83
+ # set to None if identifiers (nullable) is None
84
+ # and __fields_set__ contains the field
85
+ if self.identifiers is None and "identifiers" in self.__fields_set__:
86
+ _dict['identifiers'] = None
87
+
88
+ # set to None if entity_unique_id (nullable) is None
89
+ # and __fields_set__ contains the field
90
+ if self.entity_unique_id is None and "entity_unique_id" in self.__fields_set__:
91
+ _dict['entityUniqueId'] = None
92
+
93
+ return _dict
94
+
95
+ @classmethod
96
+ def from_dict(cls, obj: dict) -> AccountHolder:
97
+ """Create an instance of AccountHolder from a dict"""
98
+ if obj is None:
99
+ return None
100
+
101
+ if not isinstance(obj, dict):
102
+ return AccountHolder.parse_obj(obj)
103
+
104
+ _obj = AccountHolder.parse_obj({
105
+ "key": obj.get("key"),
106
+ "identifiers": dict(
107
+ (_k, ModelProperty.from_dict(_v))
108
+ for _k, _v in obj.get("identifiers").items()
109
+ )
110
+ if obj.get("identifiers") is not None
111
+ else None,
112
+ "entity_unique_id": obj.get("entityUniqueId"),
113
+ "investor_record": InvestorRecord.from_dict(obj.get("investorRecord")) if obj.get("investorRecord") is not None else None
114
+ })
115
+ return _obj
@@ -0,0 +1,92 @@
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
+ from lusid.models.model_property import ModelProperty
24
+
25
+ class AccountHolderIdentifier(BaseModel):
26
+ """
27
+ AccountHolderIdentifier
28
+ """
29
+ key: StrictStr = Field(...,alias="key", description="A client-defined key used to identify the Account Holder, unique within the Investment Account")
30
+ identifiers: Dict[str, ModelProperty] = Field(..., description="Single Account Holder identifier that should target the desired Investor Record.")
31
+ __properties = ["key", "identifiers"]
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) -> AccountHolderIdentifier:
56
+ """Create an instance of AccountHolderIdentifier 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
+ # override the default output from pydantic by calling `to_dict()` of each value in identifiers (dict)
66
+ _field_dict = {}
67
+ if self.identifiers:
68
+ for _key in self.identifiers:
69
+ if self.identifiers[_key]:
70
+ _field_dict[_key] = self.identifiers[_key].to_dict()
71
+ _dict['identifiers'] = _field_dict
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: dict) -> AccountHolderIdentifier:
76
+ """Create an instance of AccountHolderIdentifier from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return AccountHolderIdentifier.parse_obj(obj)
82
+
83
+ _obj = AccountHolderIdentifier.parse_obj({
84
+ "key": obj.get("key"),
85
+ "identifiers": dict(
86
+ (_k, ModelProperty.from_dict(_v))
87
+ for _k, _v in obj.get("identifiers").items()
88
+ )
89
+ if obj.get("identifiers") is not None
90
+ else None
91
+ })
92
+ return _obj