lusid-sdk 2.1.86__py3-none-any.whl → 2.1.90__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.

Potentially problematic release.


This version of lusid-sdk might be problematic. Click here for more details.

lusid/configuration.py CHANGED
@@ -373,7 +373,7 @@ class Configuration:
373
373
  return "Python SDK Debug Report:\n"\
374
374
  "OS: {env}\n"\
375
375
  "Python Version: {pyversion}\n"\
376
- "Version of the API: 0.11.6521\n"\
376
+ "Version of the API: 0.11.6525\n"\
377
377
  "SDK Package Version: {package_version}".\
378
378
  format(env=sys.platform, pyversion=sys.version, package_version=package_version)
379
379
 
lusid/models/__init__.py CHANGED
@@ -557,6 +557,8 @@ from lusid.models.paged_resource_list_of_reconciliation import PagedResourceList
557
557
  from lusid.models.paged_resource_list_of_reference_list_response import PagedResourceListOfReferenceListResponse
558
558
  from lusid.models.paged_resource_list_of_relationship_definition import PagedResourceListOfRelationshipDefinition
559
559
  from lusid.models.paged_resource_list_of_sequence_definition import PagedResourceListOfSequenceDefinition
560
+ from lusid.models.paged_resource_list_of_staged_modification import PagedResourceListOfStagedModification
561
+ from lusid.models.paged_resource_list_of_staged_modifications_requested_change_interval import PagedResourceListOfStagedModificationsRequestedChangeInterval
560
562
  from lusid.models.paged_resource_list_of_staging_rule_set import PagedResourceListOfStagingRuleSet
561
563
  from lusid.models.paged_resource_list_of_transaction_template import PagedResourceListOfTransactionTemplate
562
564
  from lusid.models.paged_resource_list_of_transaction_template_specification import PagedResourceListOfTransactionTemplateSpecification
@@ -679,6 +681,7 @@ from lusid.models.relationship import Relationship
679
681
  from lusid.models.relationship_definition import RelationshipDefinition
680
682
  from lusid.models.relative_date_offset import RelativeDateOffset
681
683
  from lusid.models.repo import Repo
684
+ from lusid.models.requested_changes import RequestedChanges
682
685
  from lusid.models.reset_event import ResetEvent
683
686
  from lusid.models.resource_id import ResourceId
684
687
  from lusid.models.resource_list_of_access_controlled_resource import ResourceListOfAccessControlledResource
@@ -787,6 +790,14 @@ from lusid.models.sides_definition_request import SidesDefinitionRequest
787
790
  from lusid.models.simple_cash_flow_loan import SimpleCashFlowLoan
788
791
  from lusid.models.simple_instrument import SimpleInstrument
789
792
  from lusid.models.sort_order import SortOrder
793
+ from lusid.models.staged_modification import StagedModification
794
+ from lusid.models.staged_modification_decision import StagedModificationDecision
795
+ from lusid.models.staged_modification_decision_request import StagedModificationDecisionRequest
796
+ from lusid.models.staged_modification_effective_range import StagedModificationEffectiveRange
797
+ from lusid.models.staged_modification_staging_rule import StagedModificationStagingRule
798
+ from lusid.models.staged_modifications_entity_hrefs import StagedModificationsEntityHrefs
799
+ from lusid.models.staged_modifications_info import StagedModificationsInfo
800
+ from lusid.models.staged_modifications_requested_change_interval import StagedModificationsRequestedChangeInterval
790
801
  from lusid.models.staging_rule import StagingRule
791
802
  from lusid.models.staging_rule_approval_criteria import StagingRuleApprovalCriteria
792
803
  from lusid.models.staging_rule_match_criteria import StagingRuleMatchCriteria
@@ -1500,6 +1511,8 @@ __all__ = [
1500
1511
  "PagedResourceListOfReferenceListResponse",
1501
1512
  "PagedResourceListOfRelationshipDefinition",
1502
1513
  "PagedResourceListOfSequenceDefinition",
1514
+ "PagedResourceListOfStagedModification",
1515
+ "PagedResourceListOfStagedModificationsRequestedChangeInterval",
1503
1516
  "PagedResourceListOfStagingRuleSet",
1504
1517
  "PagedResourceListOfTransactionTemplate",
1505
1518
  "PagedResourceListOfTransactionTemplateSpecification",
@@ -1622,6 +1635,7 @@ __all__ = [
1622
1635
  "RelationshipDefinition",
1623
1636
  "RelativeDateOffset",
1624
1637
  "Repo",
1638
+ "RequestedChanges",
1625
1639
  "ResetEvent",
1626
1640
  "ResourceId",
1627
1641
  "ResourceListOfAccessControlledResource",
@@ -1730,6 +1744,14 @@ __all__ = [
1730
1744
  "SimpleCashFlowLoan",
1731
1745
  "SimpleInstrument",
1732
1746
  "SortOrder",
1747
+ "StagedModification",
1748
+ "StagedModificationDecision",
1749
+ "StagedModificationDecisionRequest",
1750
+ "StagedModificationEffectiveRange",
1751
+ "StagedModificationStagingRule",
1752
+ "StagedModificationsEntityHrefs",
1753
+ "StagedModificationsInfo",
1754
+ "StagedModificationsRequestedChangeInterval",
1733
1755
  "StagingRule",
1734
1756
  "StagingRuleApprovalCriteria",
1735
1757
  "StagingRuleMatchCriteria",
@@ -0,0 +1,113 @@
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 BaseModel, Field, StrictStr, conlist
23
+ from lusid.models.link import Link
24
+ from lusid.models.staged_modification import StagedModification
25
+
26
+ class PagedResourceListOfStagedModification(BaseModel):
27
+ """
28
+ PagedResourceListOfStagedModification
29
+ """
30
+ next_page: Optional[StrictStr] = Field(None, alias="nextPage")
31
+ previous_page: Optional[StrictStr] = Field(None, alias="previousPage")
32
+ values: conlist(StagedModification) = Field(...)
33
+ href: Optional[StrictStr] = None
34
+ links: Optional[conlist(Link)] = None
35
+ __properties = ["nextPage", "previousPage", "values", "href", "links"]
36
+
37
+ class Config:
38
+ """Pydantic configuration"""
39
+ allow_population_by_field_name = True
40
+ validate_assignment = True
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.dict(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> PagedResourceListOfStagedModification:
52
+ """Create an instance of PagedResourceListOfStagedModification from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self):
56
+ """Returns the dictionary representation of the model using alias"""
57
+ _dict = self.dict(by_alias=True,
58
+ exclude={
59
+ },
60
+ exclude_none=True)
61
+ # override the default output from pydantic by calling `to_dict()` of each item in values (list)
62
+ _items = []
63
+ if self.values:
64
+ for _item in self.values:
65
+ if _item:
66
+ _items.append(_item.to_dict())
67
+ _dict['values'] = _items
68
+ # override the default output from pydantic by calling `to_dict()` of each item in links (list)
69
+ _items = []
70
+ if self.links:
71
+ for _item in self.links:
72
+ if _item:
73
+ _items.append(_item.to_dict())
74
+ _dict['links'] = _items
75
+ # set to None if next_page (nullable) is None
76
+ # and __fields_set__ contains the field
77
+ if self.next_page is None and "next_page" in self.__fields_set__:
78
+ _dict['nextPage'] = None
79
+
80
+ # set to None if previous_page (nullable) is None
81
+ # and __fields_set__ contains the field
82
+ if self.previous_page is None and "previous_page" in self.__fields_set__:
83
+ _dict['previousPage'] = None
84
+
85
+ # set to None if href (nullable) is None
86
+ # and __fields_set__ contains the field
87
+ if self.href is None and "href" in self.__fields_set__:
88
+ _dict['href'] = None
89
+
90
+ # set to None if links (nullable) is None
91
+ # and __fields_set__ contains the field
92
+ if self.links is None and "links" in self.__fields_set__:
93
+ _dict['links'] = None
94
+
95
+ return _dict
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: dict) -> PagedResourceListOfStagedModification:
99
+ """Create an instance of PagedResourceListOfStagedModification from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return PagedResourceListOfStagedModification.parse_obj(obj)
105
+
106
+ _obj = PagedResourceListOfStagedModification.parse_obj({
107
+ "next_page": obj.get("nextPage"),
108
+ "previous_page": obj.get("previousPage"),
109
+ "values": [StagedModification.from_dict(_item) for _item in obj.get("values")] if obj.get("values") is not None else None,
110
+ "href": obj.get("href"),
111
+ "links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
112
+ })
113
+ return _obj
@@ -0,0 +1,113 @@
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 BaseModel, Field, StrictStr, conlist
23
+ from lusid.models.link import Link
24
+ from lusid.models.staged_modifications_requested_change_interval import StagedModificationsRequestedChangeInterval
25
+
26
+ class PagedResourceListOfStagedModificationsRequestedChangeInterval(BaseModel):
27
+ """
28
+ PagedResourceListOfStagedModificationsRequestedChangeInterval
29
+ """
30
+ next_page: Optional[StrictStr] = Field(None, alias="nextPage")
31
+ previous_page: Optional[StrictStr] = Field(None, alias="previousPage")
32
+ values: conlist(StagedModificationsRequestedChangeInterval) = Field(...)
33
+ href: Optional[StrictStr] = None
34
+ links: Optional[conlist(Link)] = None
35
+ __properties = ["nextPage", "previousPage", "values", "href", "links"]
36
+
37
+ class Config:
38
+ """Pydantic configuration"""
39
+ allow_population_by_field_name = True
40
+ validate_assignment = True
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.dict(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> PagedResourceListOfStagedModificationsRequestedChangeInterval:
52
+ """Create an instance of PagedResourceListOfStagedModificationsRequestedChangeInterval from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self):
56
+ """Returns the dictionary representation of the model using alias"""
57
+ _dict = self.dict(by_alias=True,
58
+ exclude={
59
+ },
60
+ exclude_none=True)
61
+ # override the default output from pydantic by calling `to_dict()` of each item in values (list)
62
+ _items = []
63
+ if self.values:
64
+ for _item in self.values:
65
+ if _item:
66
+ _items.append(_item.to_dict())
67
+ _dict['values'] = _items
68
+ # override the default output from pydantic by calling `to_dict()` of each item in links (list)
69
+ _items = []
70
+ if self.links:
71
+ for _item in self.links:
72
+ if _item:
73
+ _items.append(_item.to_dict())
74
+ _dict['links'] = _items
75
+ # set to None if next_page (nullable) is None
76
+ # and __fields_set__ contains the field
77
+ if self.next_page is None and "next_page" in self.__fields_set__:
78
+ _dict['nextPage'] = None
79
+
80
+ # set to None if previous_page (nullable) is None
81
+ # and __fields_set__ contains the field
82
+ if self.previous_page is None and "previous_page" in self.__fields_set__:
83
+ _dict['previousPage'] = None
84
+
85
+ # set to None if href (nullable) is None
86
+ # and __fields_set__ contains the field
87
+ if self.href is None and "href" in self.__fields_set__:
88
+ _dict['href'] = None
89
+
90
+ # set to None if links (nullable) is None
91
+ # and __fields_set__ contains the field
92
+ if self.links is None and "links" in self.__fields_set__:
93
+ _dict['links'] = None
94
+
95
+ return _dict
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: dict) -> PagedResourceListOfStagedModificationsRequestedChangeInterval:
99
+ """Create an instance of PagedResourceListOfStagedModificationsRequestedChangeInterval from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return PagedResourceListOfStagedModificationsRequestedChangeInterval.parse_obj(obj)
105
+
106
+ _obj = PagedResourceListOfStagedModificationsRequestedChangeInterval.parse_obj({
107
+ "next_page": obj.get("nextPage"),
108
+ "previous_page": obj.get("previousPage"),
109
+ "values": [StagedModificationsRequestedChangeInterval.from_dict(_item) for _item in obj.get("values")] if obj.get("values") is not None else None,
110
+ "href": obj.get("href"),
111
+ "links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
112
+ })
113
+ return _obj
lusid/models/portfolio.py CHANGED
@@ -25,6 +25,7 @@ from lusid.models.link import Link
25
25
  from lusid.models.model_property import ModelProperty
26
26
  from lusid.models.relationship import Relationship
27
27
  from lusid.models.resource_id import ResourceId
28
+ from lusid.models.staged_modifications_info import StagedModificationsInfo
28
29
  from lusid.models.version import Version
29
30
 
30
31
  class Portfolio(BaseModel):
@@ -39,6 +40,7 @@ class Portfolio(BaseModel):
39
40
  created: datetime = Field(..., description="The effective datetime at which the portfolio was created. No transactions or constituents can be added to the portfolio before this date.")
40
41
  parent_portfolio_id: Optional[ResourceId] = Field(None, alias="parentPortfolioId")
41
42
  version: Optional[Version] = None
43
+ staged_modifications: Optional[StagedModificationsInfo] = Field(None, alias="stagedModifications")
42
44
  is_derived: Optional[StrictBool] = Field(None, alias="isDerived", description="Whether or not this is a derived portfolio.")
43
45
  base_currency: Optional[StrictStr] = Field(None, alias="baseCurrency", description="The base currency of the portfolio.")
44
46
  properties: Optional[Dict[str, ModelProperty]] = Field(None, description="The requested portfolio properties. These will be from the 'Portfolio' domain.")
@@ -51,7 +53,7 @@ class Portfolio(BaseModel):
51
53
  instrument_event_configuration: Optional[InstrumentEventConfiguration] = Field(None, alias="instrumentEventConfiguration")
52
54
  amortisation_rule_set_id: Optional[ResourceId] = Field(None, alias="amortisationRuleSetId")
53
55
  links: Optional[conlist(Link)] = None
54
- __properties = ["href", "id", "type", "displayName", "description", "created", "parentPortfolioId", "version", "isDerived", "baseCurrency", "properties", "relationships", "instrumentScopes", "accountingMethod", "amortisationMethod", "transactionTypeScope", "cashGainLossCalculationDate", "instrumentEventConfiguration", "amortisationRuleSetId", "links"]
56
+ __properties = ["href", "id", "type", "displayName", "description", "created", "parentPortfolioId", "version", "stagedModifications", "isDerived", "baseCurrency", "properties", "relationships", "instrumentScopes", "accountingMethod", "amortisationMethod", "transactionTypeScope", "cashGainLossCalculationDate", "instrumentEventConfiguration", "amortisationRuleSetId", "links"]
55
57
 
56
58
  @validator('type')
57
59
  def type_validate_enum(cls, value):
@@ -103,6 +105,9 @@ class Portfolio(BaseModel):
103
105
  # override the default output from pydantic by calling `to_dict()` of version
104
106
  if self.version:
105
107
  _dict['version'] = self.version.to_dict()
108
+ # override the default output from pydantic by calling `to_dict()` of staged_modifications
109
+ if self.staged_modifications:
110
+ _dict['stagedModifications'] = self.staged_modifications.to_dict()
106
111
  # override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
107
112
  _field_dict = {}
108
113
  if self.properties:
@@ -200,6 +205,7 @@ class Portfolio(BaseModel):
200
205
  "created": obj.get("created"),
201
206
  "parent_portfolio_id": ResourceId.from_dict(obj.get("parentPortfolioId")) if obj.get("parentPortfolioId") is not None else None,
202
207
  "version": Version.from_dict(obj.get("version")) if obj.get("version") is not None else None,
208
+ "staged_modifications": StagedModificationsInfo.from_dict(obj.get("stagedModifications")) if obj.get("stagedModifications") is not None else None,
203
209
  "is_derived": obj.get("isDerived"),
204
210
  "base_currency": obj.get("baseCurrency"),
205
211
  "properties": dict(
@@ -25,6 +25,7 @@ from lusid.models.link import Link
25
25
  from lusid.models.model_property import ModelProperty
26
26
  from lusid.models.relationship import Relationship
27
27
  from lusid.models.resource_id import ResourceId
28
+ from lusid.models.staged_modifications_info import StagedModificationsInfo
28
29
  from lusid.models.version import Version
29
30
 
30
31
  class PortfolioWithoutHref(BaseModel):
@@ -38,6 +39,7 @@ class PortfolioWithoutHref(BaseModel):
38
39
  created: datetime = Field(..., description="The effective datetime at which the portfolio was created. No transactions or constituents can be added to the portfolio before this date.")
39
40
  parent_portfolio_id: Optional[ResourceId] = Field(None, alias="parentPortfolioId")
40
41
  version: Optional[Version] = None
42
+ staged_modifications: Optional[StagedModificationsInfo] = Field(None, alias="stagedModifications")
41
43
  is_derived: Optional[StrictBool] = Field(None, alias="isDerived", description="Whether or not this is a derived portfolio.")
42
44
  base_currency: Optional[StrictStr] = Field(None, alias="baseCurrency", description="The base currency of the portfolio.")
43
45
  properties: Optional[Dict[str, ModelProperty]] = Field(None, description="The requested portfolio properties. These will be from the 'Portfolio' domain.")
@@ -50,7 +52,7 @@ class PortfolioWithoutHref(BaseModel):
50
52
  instrument_event_configuration: Optional[InstrumentEventConfiguration] = Field(None, alias="instrumentEventConfiguration")
51
53
  amortisation_rule_set_id: Optional[ResourceId] = Field(None, alias="amortisationRuleSetId")
52
54
  links: Optional[conlist(Link)] = None
53
- __properties = ["id", "type", "displayName", "description", "created", "parentPortfolioId", "version", "isDerived", "baseCurrency", "properties", "relationships", "instrumentScopes", "accountingMethod", "amortisationMethod", "transactionTypeScope", "cashGainLossCalculationDate", "instrumentEventConfiguration", "amortisationRuleSetId", "links"]
55
+ __properties = ["id", "type", "displayName", "description", "created", "parentPortfolioId", "version", "stagedModifications", "isDerived", "baseCurrency", "properties", "relationships", "instrumentScopes", "accountingMethod", "amortisationMethod", "transactionTypeScope", "cashGainLossCalculationDate", "instrumentEventConfiguration", "amortisationRuleSetId", "links"]
54
56
 
55
57
  @validator('type')
56
58
  def type_validate_enum(cls, value):
@@ -102,6 +104,9 @@ class PortfolioWithoutHref(BaseModel):
102
104
  # override the default output from pydantic by calling `to_dict()` of version
103
105
  if self.version:
104
106
  _dict['version'] = self.version.to_dict()
107
+ # override the default output from pydantic by calling `to_dict()` of staged_modifications
108
+ if self.staged_modifications:
109
+ _dict['stagedModifications'] = self.staged_modifications.to_dict()
105
110
  # override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
106
111
  _field_dict = {}
107
112
  if self.properties:
@@ -193,6 +198,7 @@ class PortfolioWithoutHref(BaseModel):
193
198
  "created": obj.get("created"),
194
199
  "parent_portfolio_id": ResourceId.from_dict(obj.get("parentPortfolioId")) if obj.get("parentPortfolioId") is not None else None,
195
200
  "version": Version.from_dict(obj.get("version")) if obj.get("version") is not None else None,
201
+ "staged_modifications": StagedModificationsInfo.from_dict(obj.get("stagedModifications")) if obj.get("stagedModifications") is not None else None,
196
202
  "is_derived": obj.get("isDerived"),
197
203
  "base_currency": obj.get("baseCurrency"),
198
204
  "properties": dict(
@@ -0,0 +1,76 @@
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 BaseModel, Field, StrictInt, StrictStr, conlist
23
+
24
+ class RequestedChanges(BaseModel):
25
+ """
26
+ RequestedChanges
27
+ """
28
+ attribute_count: Optional[StrictInt] = Field(None, alias="attributeCount", description="Number of attributes staged change applies to")
29
+ attribute_names: Optional[conlist(StrictStr)] = Field(None, alias="attributeNames", description="Names of the attributes the staged change applies to.")
30
+ __properties = ["attributeCount", "attributeNames"]
31
+
32
+ class Config:
33
+ """Pydantic configuration"""
34
+ allow_population_by_field_name = True
35
+ validate_assignment = True
36
+
37
+ def to_str(self) -> str:
38
+ """Returns the string representation of the model using alias"""
39
+ return pprint.pformat(self.dict(by_alias=True))
40
+
41
+ def to_json(self) -> str:
42
+ """Returns the JSON representation of the model using alias"""
43
+ return json.dumps(self.to_dict())
44
+
45
+ @classmethod
46
+ def from_json(cls, json_str: str) -> RequestedChanges:
47
+ """Create an instance of RequestedChanges from a JSON string"""
48
+ return cls.from_dict(json.loads(json_str))
49
+
50
+ def to_dict(self):
51
+ """Returns the dictionary representation of the model using alias"""
52
+ _dict = self.dict(by_alias=True,
53
+ exclude={
54
+ },
55
+ exclude_none=True)
56
+ # set to None if attribute_names (nullable) is None
57
+ # and __fields_set__ contains the field
58
+ if self.attribute_names is None and "attribute_names" in self.__fields_set__:
59
+ _dict['attributeNames'] = None
60
+
61
+ return _dict
62
+
63
+ @classmethod
64
+ def from_dict(cls, obj: dict) -> RequestedChanges:
65
+ """Create an instance of RequestedChanges from a dict"""
66
+ if obj is None:
67
+ return None
68
+
69
+ if not isinstance(obj, dict):
70
+ return RequestedChanges.parse_obj(obj)
71
+
72
+ _obj = RequestedChanges.parse_obj({
73
+ "attribute_count": obj.get("attributeCount"),
74
+ "attribute_names": obj.get("attributeNames")
75
+ })
76
+ return _obj
@@ -0,0 +1,160 @@
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 BaseModel, Field, StrictInt, StrictStr, conlist
23
+ from lusid.models.requested_changes import RequestedChanges
24
+ from lusid.models.staged_modification_decision import StagedModificationDecision
25
+ from lusid.models.staged_modification_staging_rule import StagedModificationStagingRule
26
+ from lusid.models.staged_modifications_entity_hrefs import StagedModificationsEntityHrefs
27
+
28
+ class StagedModification(BaseModel):
29
+ """
30
+ StagedModification
31
+ """
32
+ id: Optional[StrictStr] = Field(None, description="The unique Id for the staged modification")
33
+ as_at_staged: Optional[datetime] = Field(None, alias="asAtStaged", description="Time at which the modification was staged.")
34
+ user_id_staged: Optional[StrictStr] = Field(None, alias="userIdStaged", description="Id of the user who created the stage modification request.")
35
+ requested_id_staged: Optional[StrictStr] = Field(None, alias="requestedIdStaged", description="The Request Id that initiated this staged modification.")
36
+ action: Optional[StrictStr] = Field(None, description="Type of action of the staged modification, either create, update or delete.")
37
+ staging_rule: Optional[StagedModificationStagingRule] = Field(None, alias="stagingRule")
38
+ decisions: Optional[conlist(StagedModificationDecision)] = Field(None, description="Object containing information relating to the decision on the staged modification.")
39
+ decisions_count: Optional[StrictInt] = Field(None, alias="decisionsCount", description="Number of decisions made.")
40
+ status: Optional[StrictStr] = Field(None, description="The status of the staged modification.")
41
+ entity_type: Optional[StrictStr] = Field(None, alias="entityType", description="The type of the entity that the staged modification applies to.")
42
+ scope: Optional[StrictStr] = Field(None, description="The scope of the entity that this staged modification applies to.")
43
+ entity_unique_id: Optional[StrictStr] = Field(None, alias="entityUniqueId", description="The unique Id of the entity the staged modification applies to.")
44
+ requested_changes: Optional[RequestedChanges] = Field(None, alias="requestedChanges")
45
+ entity_hrefs: Optional[StagedModificationsEntityHrefs] = Field(None, alias="entityHrefs")
46
+ __properties = ["id", "asAtStaged", "userIdStaged", "requestedIdStaged", "action", "stagingRule", "decisions", "decisionsCount", "status", "entityType", "scope", "entityUniqueId", "requestedChanges", "entityHrefs"]
47
+
48
+ class Config:
49
+ """Pydantic configuration"""
50
+ allow_population_by_field_name = True
51
+ validate_assignment = True
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) -> StagedModification:
63
+ """Create an instance of StagedModification 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 staging_rule
73
+ if self.staging_rule:
74
+ _dict['stagingRule'] = self.staging_rule.to_dict()
75
+ # override the default output from pydantic by calling `to_dict()` of each item in decisions (list)
76
+ _items = []
77
+ if self.decisions:
78
+ for _item in self.decisions:
79
+ if _item:
80
+ _items.append(_item.to_dict())
81
+ _dict['decisions'] = _items
82
+ # override the default output from pydantic by calling `to_dict()` of requested_changes
83
+ if self.requested_changes:
84
+ _dict['requestedChanges'] = self.requested_changes.to_dict()
85
+ # override the default output from pydantic by calling `to_dict()` of entity_hrefs
86
+ if self.entity_hrefs:
87
+ _dict['entityHrefs'] = self.entity_hrefs.to_dict()
88
+ # set to None if id (nullable) is None
89
+ # and __fields_set__ contains the field
90
+ if self.id is None and "id" in self.__fields_set__:
91
+ _dict['id'] = None
92
+
93
+ # set to None if user_id_staged (nullable) is None
94
+ # and __fields_set__ contains the field
95
+ if self.user_id_staged is None and "user_id_staged" in self.__fields_set__:
96
+ _dict['userIdStaged'] = None
97
+
98
+ # set to None if requested_id_staged (nullable) is None
99
+ # and __fields_set__ contains the field
100
+ if self.requested_id_staged is None and "requested_id_staged" in self.__fields_set__:
101
+ _dict['requestedIdStaged'] = None
102
+
103
+ # set to None if action (nullable) is None
104
+ # and __fields_set__ contains the field
105
+ if self.action is None and "action" in self.__fields_set__:
106
+ _dict['action'] = None
107
+
108
+ # set to None if decisions (nullable) is None
109
+ # and __fields_set__ contains the field
110
+ if self.decisions is None and "decisions" in self.__fields_set__:
111
+ _dict['decisions'] = None
112
+
113
+ # set to None if status (nullable) is None
114
+ # and __fields_set__ contains the field
115
+ if self.status is None and "status" in self.__fields_set__:
116
+ _dict['status'] = None
117
+
118
+ # set to None if entity_type (nullable) is None
119
+ # and __fields_set__ contains the field
120
+ if self.entity_type is None and "entity_type" in self.__fields_set__:
121
+ _dict['entityType'] = None
122
+
123
+ # set to None if scope (nullable) is None
124
+ # and __fields_set__ contains the field
125
+ if self.scope is None and "scope" in self.__fields_set__:
126
+ _dict['scope'] = None
127
+
128
+ # set to None if entity_unique_id (nullable) is None
129
+ # and __fields_set__ contains the field
130
+ if self.entity_unique_id is None and "entity_unique_id" in self.__fields_set__:
131
+ _dict['entityUniqueId'] = None
132
+
133
+ return _dict
134
+
135
+ @classmethod
136
+ def from_dict(cls, obj: dict) -> StagedModification:
137
+ """Create an instance of StagedModification from a dict"""
138
+ if obj is None:
139
+ return None
140
+
141
+ if not isinstance(obj, dict):
142
+ return StagedModification.parse_obj(obj)
143
+
144
+ _obj = StagedModification.parse_obj({
145
+ "id": obj.get("id"),
146
+ "as_at_staged": obj.get("asAtStaged"),
147
+ "user_id_staged": obj.get("userIdStaged"),
148
+ "requested_id_staged": obj.get("requestedIdStaged"),
149
+ "action": obj.get("action"),
150
+ "staging_rule": StagedModificationStagingRule.from_dict(obj.get("stagingRule")) if obj.get("stagingRule") is not None else None,
151
+ "decisions": [StagedModificationDecision.from_dict(_item) for _item in obj.get("decisions")] if obj.get("decisions") is not None else None,
152
+ "decisions_count": obj.get("decisionsCount"),
153
+ "status": obj.get("status"),
154
+ "entity_type": obj.get("entityType"),
155
+ "scope": obj.get("scope"),
156
+ "entity_unique_id": obj.get("entityUniqueId"),
157
+ "requested_changes": RequestedChanges.from_dict(obj.get("requestedChanges")) if obj.get("requestedChanges") is not None else None,
158
+ "entity_hrefs": StagedModificationsEntityHrefs.from_dict(obj.get("entityHrefs")) if obj.get("entityHrefs") is not None else None
159
+ })
160
+ return _obj