lusid-sdk 2.1.780__py3-none-any.whl → 2.1.782__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.
@@ -0,0 +1,121 @@
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.legal_entity import LegalEntity
24
+ from lusid.models.model_property import ModelProperty
25
+ from lusid.models.person import Person
26
+
27
+ class Investor(BaseModel):
28
+ """
29
+ Inner dto of an Investor Record on the LUSID API # noqa: E501
30
+ """
31
+ investor_type: Optional[StrictStr] = Field(None,alias="investorType", description="The type of the Investor")
32
+ investor_identifiers: Optional[Dict[str, ModelProperty]] = Field(None, alias="investorIdentifiers", description="The identifiers of the Investor")
33
+ entity_unique_id: Optional[StrictStr] = Field(None,alias="entityUniqueId", description="The unique Investor entity identifier")
34
+ person: Optional[Person] = None
35
+ legal_entity: Optional[LegalEntity] = Field(None, alias="legalEntity")
36
+ __properties = ["investorType", "investorIdentifiers", "entityUniqueId", "person", "legalEntity"]
37
+
38
+ class Config:
39
+ """Pydantic configuration"""
40
+ allow_population_by_field_name = True
41
+ validate_assignment = True
42
+
43
+ def __str__(self):
44
+ """For `print` and `pprint`"""
45
+ return pprint.pformat(self.dict(by_alias=False))
46
+
47
+ def __repr__(self):
48
+ """For `print` and `pprint`"""
49
+ return self.to_str()
50
+
51
+ def to_str(self) -> str:
52
+ """Returns the string representation of the model using alias"""
53
+ return pprint.pformat(self.dict(by_alias=True))
54
+
55
+ def to_json(self) -> str:
56
+ """Returns the JSON representation of the model using alias"""
57
+ return json.dumps(self.to_dict())
58
+
59
+ @classmethod
60
+ def from_json(cls, json_str: str) -> Investor:
61
+ """Create an instance of Investor from a JSON string"""
62
+ return cls.from_dict(json.loads(json_str))
63
+
64
+ def to_dict(self):
65
+ """Returns the dictionary representation of the model using alias"""
66
+ _dict = self.dict(by_alias=True,
67
+ exclude={
68
+ },
69
+ exclude_none=True)
70
+ # override the default output from pydantic by calling `to_dict()` of each value in investor_identifiers (dict)
71
+ _field_dict = {}
72
+ if self.investor_identifiers:
73
+ for _key in self.investor_identifiers:
74
+ if self.investor_identifiers[_key]:
75
+ _field_dict[_key] = self.investor_identifiers[_key].to_dict()
76
+ _dict['investorIdentifiers'] = _field_dict
77
+ # override the default output from pydantic by calling `to_dict()` of person
78
+ if self.person:
79
+ _dict['person'] = self.person.to_dict()
80
+ # override the default output from pydantic by calling `to_dict()` of legal_entity
81
+ if self.legal_entity:
82
+ _dict['legalEntity'] = self.legal_entity.to_dict()
83
+ # set to None if investor_type (nullable) is None
84
+ # and __fields_set__ contains the field
85
+ if self.investor_type is None and "investor_type" in self.__fields_set__:
86
+ _dict['investorType'] = None
87
+
88
+ # set to None if investor_identifiers (nullable) is None
89
+ # and __fields_set__ contains the field
90
+ if self.investor_identifiers is None and "investor_identifiers" in self.__fields_set__:
91
+ _dict['investorIdentifiers'] = None
92
+
93
+ # set to None if entity_unique_id (nullable) is None
94
+ # and __fields_set__ contains the field
95
+ if self.entity_unique_id is None and "entity_unique_id" in self.__fields_set__:
96
+ _dict['entityUniqueId'] = None
97
+
98
+ return _dict
99
+
100
+ @classmethod
101
+ def from_dict(cls, obj: dict) -> Investor:
102
+ """Create an instance of Investor from a dict"""
103
+ if obj is None:
104
+ return None
105
+
106
+ if not isinstance(obj, dict):
107
+ return Investor.parse_obj(obj)
108
+
109
+ _obj = Investor.parse_obj({
110
+ "investor_type": obj.get("investorType"),
111
+ "investor_identifiers": dict(
112
+ (_k, ModelProperty.from_dict(_v))
113
+ for _k, _v in obj.get("investorIdentifiers").items()
114
+ )
115
+ if obj.get("investorIdentifiers") is not None
116
+ else None,
117
+ "entity_unique_id": obj.get("entityUniqueId"),
118
+ "person": Person.from_dict(obj.get("person")) if obj.get("person") is not None else None,
119
+ "legal_entity": LegalEntity.from_dict(obj.get("legalEntity")) if obj.get("legalEntity") is not None else None
120
+ })
121
+ return _obj
@@ -0,0 +1,184 @@
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.investor import Investor
24
+ from lusid.models.link import Link
25
+ from lusid.models.model_property import ModelProperty
26
+ from lusid.models.relationship import Relationship
27
+ from lusid.models.version import Version
28
+
29
+ class InvestorRecord(BaseModel):
30
+ """
31
+ Representation of an Investor Record on the LUSID API # noqa: E501
32
+ """
33
+ lusid_investor_record_id: Optional[StrictStr] = Field(None,alias="lusidInvestorRecordId", description="The unique LUSID Investor Record Identifier of the Investor Record.")
34
+ display_name: Optional[StrictStr] = Field(None,alias="displayName", description="The display name of the Investor Record")
35
+ description: Optional[StrictStr] = Field(None,alias="description", description="The description of the Investor Record")
36
+ investor: Optional[Investor] = None
37
+ identifiers: Optional[Dict[str, ModelProperty]] = Field(None, description="Unique client-defined identifiers of the Investor Record.")
38
+ properties: Optional[Dict[str, ModelProperty]] = Field(None, description="A set of properties associated to the Investor Record.")
39
+ relationships: Optional[conlist(Relationship)] = Field(None, description="A set of relationships associated to the Investor Record.")
40
+ href: Optional[StrictStr] = Field(None,alias="href", description="The specific Uniform Resource Identifier (URI) for this resource at the requested effective and asAt datetime.")
41
+ version: Optional[Version] = None
42
+ links: Optional[conlist(Link)] = None
43
+ __properties = ["lusidInvestorRecordId", "displayName", "description", "investor", "identifiers", "properties", "relationships", "href", "version", "links"]
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) -> InvestorRecord:
68
+ """Create an instance of InvestorRecord 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 investor
78
+ if self.investor:
79
+ _dict['investor'] = self.investor.to_dict()
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 value in properties (dict)
88
+ _field_dict = {}
89
+ if self.properties:
90
+ for _key in self.properties:
91
+ if self.properties[_key]:
92
+ _field_dict[_key] = self.properties[_key].to_dict()
93
+ _dict['properties'] = _field_dict
94
+ # override the default output from pydantic by calling `to_dict()` of each item in relationships (list)
95
+ _items = []
96
+ if self.relationships:
97
+ for _item in self.relationships:
98
+ if _item:
99
+ _items.append(_item.to_dict())
100
+ _dict['relationships'] = _items
101
+ # override the default output from pydantic by calling `to_dict()` of version
102
+ if self.version:
103
+ _dict['version'] = self.version.to_dict()
104
+ # override the default output from pydantic by calling `to_dict()` of each item in links (list)
105
+ _items = []
106
+ if self.links:
107
+ for _item in self.links:
108
+ if _item:
109
+ _items.append(_item.to_dict())
110
+ _dict['links'] = _items
111
+ # set to None if lusid_investor_record_id (nullable) is None
112
+ # and __fields_set__ contains the field
113
+ if self.lusid_investor_record_id is None and "lusid_investor_record_id" in self.__fields_set__:
114
+ _dict['lusidInvestorRecordId'] = None
115
+
116
+ # set to None if display_name (nullable) is None
117
+ # and __fields_set__ contains the field
118
+ if self.display_name is None and "display_name" in self.__fields_set__:
119
+ _dict['displayName'] = None
120
+
121
+ # set to None if description (nullable) is None
122
+ # and __fields_set__ contains the field
123
+ if self.description is None and "description" in self.__fields_set__:
124
+ _dict['description'] = None
125
+
126
+ # set to None if identifiers (nullable) is None
127
+ # and __fields_set__ contains the field
128
+ if self.identifiers is None and "identifiers" in self.__fields_set__:
129
+ _dict['identifiers'] = None
130
+
131
+ # set to None if properties (nullable) is None
132
+ # and __fields_set__ contains the field
133
+ if self.properties is None and "properties" in self.__fields_set__:
134
+ _dict['properties'] = None
135
+
136
+ # set to None if relationships (nullable) is None
137
+ # and __fields_set__ contains the field
138
+ if self.relationships is None and "relationships" in self.__fields_set__:
139
+ _dict['relationships'] = None
140
+
141
+ # set to None if href (nullable) is None
142
+ # and __fields_set__ contains the field
143
+ if self.href is None and "href" in self.__fields_set__:
144
+ _dict['href'] = None
145
+
146
+ # set to None if links (nullable) is None
147
+ # and __fields_set__ contains the field
148
+ if self.links is None and "links" in self.__fields_set__:
149
+ _dict['links'] = None
150
+
151
+ return _dict
152
+
153
+ @classmethod
154
+ def from_dict(cls, obj: dict) -> InvestorRecord:
155
+ """Create an instance of InvestorRecord from a dict"""
156
+ if obj is None:
157
+ return None
158
+
159
+ if not isinstance(obj, dict):
160
+ return InvestorRecord.parse_obj(obj)
161
+
162
+ _obj = InvestorRecord.parse_obj({
163
+ "lusid_investor_record_id": obj.get("lusidInvestorRecordId"),
164
+ "display_name": obj.get("displayName"),
165
+ "description": obj.get("description"),
166
+ "investor": Investor.from_dict(obj.get("investor")) if obj.get("investor") is not None else None,
167
+ "identifiers": dict(
168
+ (_k, ModelProperty.from_dict(_v))
169
+ for _k, _v in obj.get("identifiers").items()
170
+ )
171
+ if obj.get("identifiers") is not None
172
+ else None,
173
+ "properties": dict(
174
+ (_k, ModelProperty.from_dict(_v))
175
+ for _k, _v in obj.get("properties").items()
176
+ )
177
+ if obj.get("properties") is not None
178
+ else None,
179
+ "relationships": [Relationship.from_dict(_item) for _item in obj.get("relationships")] if obj.get("relationships") is not None else None,
180
+ "href": obj.get("href"),
181
+ "version": Version.from_dict(obj.get("version")) if obj.get("version") is not None else None,
182
+ "links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
183
+ })
184
+ return _obj
@@ -0,0 +1,102 @@
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.model_property import ModelProperty
24
+
25
+ class UpsertInvestor(BaseModel):
26
+ """
27
+ Inner dto of an Investor Record on the LUSID API # noqa: E501
28
+ """
29
+ investor_type: Optional[StrictStr] = Field(None,alias="investorType", description="The type of the Investor")
30
+ investor_identifiers: Optional[Dict[str, ModelProperty]] = Field(None, alias="investorIdentifiers", description="The identifiers of the Investor")
31
+ __properties = ["investorType", "investorIdentifiers"]
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) -> UpsertInvestor:
56
+ """Create an instance of UpsertInvestor 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 investor_identifiers (dict)
66
+ _field_dict = {}
67
+ if self.investor_identifiers:
68
+ for _key in self.investor_identifiers:
69
+ if self.investor_identifiers[_key]:
70
+ _field_dict[_key] = self.investor_identifiers[_key].to_dict()
71
+ _dict['investorIdentifiers'] = _field_dict
72
+ # set to None if investor_type (nullable) is None
73
+ # and __fields_set__ contains the field
74
+ if self.investor_type is None and "investor_type" in self.__fields_set__:
75
+ _dict['investorType'] = None
76
+
77
+ # set to None if investor_identifiers (nullable) is None
78
+ # and __fields_set__ contains the field
79
+ if self.investor_identifiers is None and "investor_identifiers" in self.__fields_set__:
80
+ _dict['investorIdentifiers'] = None
81
+
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: dict) -> UpsertInvestor:
86
+ """Create an instance of UpsertInvestor from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return UpsertInvestor.parse_obj(obj)
92
+
93
+ _obj = UpsertInvestor.parse_obj({
94
+ "investor_type": obj.get("investorType"),
95
+ "investor_identifiers": dict(
96
+ (_k, ModelProperty.from_dict(_v))
97
+ for _k, _v in obj.get("investorIdentifiers").items()
98
+ )
99
+ if obj.get("investorIdentifiers") is not None
100
+ else None
101
+ })
102
+ return _obj
@@ -0,0 +1,124 @@
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
+ from lusid.models.model_property import ModelProperty
24
+ from lusid.models.upsert_investor import UpsertInvestor
25
+
26
+ class UpsertInvestorRecordRequest(BaseModel):
27
+ """
28
+ Request to create or update an investor record # noqa: E501
29
+ """
30
+ identifiers: Dict[str, ModelProperty] = Field(..., description="Unique client-defined identifiers of the Investor Record.")
31
+ properties: Optional[Dict[str, ModelProperty]] = Field(None, description="A set of properties associated to the Investor Record.")
32
+ display_name: StrictStr = Field(...,alias="displayName", description="The display name of the Investor Record")
33
+ description: Optional[StrictStr] = Field(None,alias="description", description="The description of the Investor Record")
34
+ investor: Optional[UpsertInvestor] = None
35
+ __properties = ["identifiers", "properties", "displayName", "description", "investor"]
36
+
37
+ class Config:
38
+ """Pydantic configuration"""
39
+ allow_population_by_field_name = True
40
+ validate_assignment = True
41
+
42
+ def __str__(self):
43
+ """For `print` and `pprint`"""
44
+ return pprint.pformat(self.dict(by_alias=False))
45
+
46
+ def __repr__(self):
47
+ """For `print` and `pprint`"""
48
+ return self.to_str()
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.dict(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ return json.dumps(self.to_dict())
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> UpsertInvestorRecordRequest:
60
+ """Create an instance of UpsertInvestorRecordRequest from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self):
64
+ """Returns the dictionary representation of the model using alias"""
65
+ _dict = self.dict(by_alias=True,
66
+ exclude={
67
+ },
68
+ exclude_none=True)
69
+ # override the default output from pydantic by calling `to_dict()` of each value in identifiers (dict)
70
+ _field_dict = {}
71
+ if self.identifiers:
72
+ for _key in self.identifiers:
73
+ if self.identifiers[_key]:
74
+ _field_dict[_key] = self.identifiers[_key].to_dict()
75
+ _dict['identifiers'] = _field_dict
76
+ # override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
77
+ _field_dict = {}
78
+ if self.properties:
79
+ for _key in self.properties:
80
+ if self.properties[_key]:
81
+ _field_dict[_key] = self.properties[_key].to_dict()
82
+ _dict['properties'] = _field_dict
83
+ # override the default output from pydantic by calling `to_dict()` of investor
84
+ if self.investor:
85
+ _dict['investor'] = self.investor.to_dict()
86
+ # set to None if properties (nullable) is None
87
+ # and __fields_set__ contains the field
88
+ if self.properties is None and "properties" in self.__fields_set__:
89
+ _dict['properties'] = None
90
+
91
+ # set to None if description (nullable) is None
92
+ # and __fields_set__ contains the field
93
+ if self.description is None and "description" in self.__fields_set__:
94
+ _dict['description'] = None
95
+
96
+ return _dict
97
+
98
+ @classmethod
99
+ def from_dict(cls, obj: dict) -> UpsertInvestorRecordRequest:
100
+ """Create an instance of UpsertInvestorRecordRequest from a dict"""
101
+ if obj is None:
102
+ return None
103
+
104
+ if not isinstance(obj, dict):
105
+ return UpsertInvestorRecordRequest.parse_obj(obj)
106
+
107
+ _obj = UpsertInvestorRecordRequest.parse_obj({
108
+ "identifiers": dict(
109
+ (_k, ModelProperty.from_dict(_v))
110
+ for _k, _v in obj.get("identifiers").items()
111
+ )
112
+ if obj.get("identifiers") is not None
113
+ else None,
114
+ "properties": dict(
115
+ (_k, ModelProperty.from_dict(_v))
116
+ for _k, _v in obj.get("properties").items()
117
+ )
118
+ if obj.get("properties") is not None
119
+ else None,
120
+ "display_name": obj.get("displayName"),
121
+ "description": obj.get("description"),
122
+ "investor": UpsertInvestor.from_dict(obj.get("investor")) if obj.get("investor") is not None else None
123
+ })
124
+ return _obj
@@ -0,0 +1,137 @@
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.error_detail import ErrorDetail
24
+ from lusid.models.investor_record import InvestorRecord
25
+ from lusid.models.link import Link
26
+
27
+ class UpsertInvestorRecordsResponse(BaseModel):
28
+ """
29
+ UpsertInvestorRecordsResponse
30
+ """
31
+ href: Optional[StrictStr] = Field(None,alias="href", description="The specific Uniform Resource Identifier (URI) for this resource at the requested effective and asAt datetime.")
32
+ values: Optional[Dict[str, InvestorRecord]] = Field(None, description="The investor records which have been successfully updated or created.")
33
+ failed: Optional[Dict[str, ErrorDetail]] = Field(None, description="The investor records that could not be updated or created or were left unchanged without error along with a reason for their failure.")
34
+ links: Optional[conlist(Link)] = None
35
+ __properties = ["href", "values", "failed", "links"]
36
+
37
+ class Config:
38
+ """Pydantic configuration"""
39
+ allow_population_by_field_name = True
40
+ validate_assignment = True
41
+
42
+ def __str__(self):
43
+ """For `print` and `pprint`"""
44
+ return pprint.pformat(self.dict(by_alias=False))
45
+
46
+ def __repr__(self):
47
+ """For `print` and `pprint`"""
48
+ return self.to_str()
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.dict(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ return json.dumps(self.to_dict())
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> UpsertInvestorRecordsResponse:
60
+ """Create an instance of UpsertInvestorRecordsResponse from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self):
64
+ """Returns the dictionary representation of the model using alias"""
65
+ _dict = self.dict(by_alias=True,
66
+ exclude={
67
+ },
68
+ exclude_none=True)
69
+ # override the default output from pydantic by calling `to_dict()` of each value in values (dict)
70
+ _field_dict = {}
71
+ if self.values:
72
+ for _key in self.values:
73
+ if self.values[_key]:
74
+ _field_dict[_key] = self.values[_key].to_dict()
75
+ _dict['values'] = _field_dict
76
+ # override the default output from pydantic by calling `to_dict()` of each value in failed (dict)
77
+ _field_dict = {}
78
+ if self.failed:
79
+ for _key in self.failed:
80
+ if self.failed[_key]:
81
+ _field_dict[_key] = self.failed[_key].to_dict()
82
+ _dict['failed'] = _field_dict
83
+ # override the default output from pydantic by calling `to_dict()` of each item in links (list)
84
+ _items = []
85
+ if self.links:
86
+ for _item in self.links:
87
+ if _item:
88
+ _items.append(_item.to_dict())
89
+ _dict['links'] = _items
90
+ # set to None if href (nullable) is None
91
+ # and __fields_set__ contains the field
92
+ if self.href is None and "href" in self.__fields_set__:
93
+ _dict['href'] = None
94
+
95
+ # set to None if values (nullable) is None
96
+ # and __fields_set__ contains the field
97
+ if self.values is None and "values" in self.__fields_set__:
98
+ _dict['values'] = None
99
+
100
+ # set to None if failed (nullable) is None
101
+ # and __fields_set__ contains the field
102
+ if self.failed is None and "failed" in self.__fields_set__:
103
+ _dict['failed'] = None
104
+
105
+ # set to None if links (nullable) is None
106
+ # and __fields_set__ contains the field
107
+ if self.links is None and "links" in self.__fields_set__:
108
+ _dict['links'] = None
109
+
110
+ return _dict
111
+
112
+ @classmethod
113
+ def from_dict(cls, obj: dict) -> UpsertInvestorRecordsResponse:
114
+ """Create an instance of UpsertInvestorRecordsResponse from a dict"""
115
+ if obj is None:
116
+ return None
117
+
118
+ if not isinstance(obj, dict):
119
+ return UpsertInvestorRecordsResponse.parse_obj(obj)
120
+
121
+ _obj = UpsertInvestorRecordsResponse.parse_obj({
122
+ "href": obj.get("href"),
123
+ "values": dict(
124
+ (_k, InvestorRecord.from_dict(_v))
125
+ for _k, _v in obj.get("values").items()
126
+ )
127
+ if obj.get("values") is not None
128
+ else None,
129
+ "failed": dict(
130
+ (_k, ErrorDetail.from_dict(_v))
131
+ for _k, _v in obj.get("failed").items()
132
+ )
133
+ if obj.get("failed") is not None
134
+ else None,
135
+ "links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
136
+ })
137
+ return _obj