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

@@ -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
@@ -0,0 +1,97 @@
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, Optional
22
+ from pydantic.v1 import BaseModel, Field, StrictStr
23
+
24
+ class StagedModificationDecision(BaseModel):
25
+ """
26
+ StagedModificationDecision
27
+ """
28
+ as_at: Optional[datetime] = Field(None, alias="asAt", description="Time the decision request is made.")
29
+ user_id: Optional[StrictStr] = Field(None, alias="userId", description="ID of user that approved the request.")
30
+ request_id: Optional[StrictStr] = Field(None, alias="requestId", description="ID of user that made the request.")
31
+ decision: Optional[StrictStr] = Field(None, description="The decision on the requested staged modification, can be 'Approve' or 'Reject'.")
32
+ comment: Optional[StrictStr] = Field(None, description="Comment on decision.")
33
+ __properties = ["asAt", "userId", "requestId", "decision", "comment"]
34
+
35
+ class Config:
36
+ """Pydantic configuration"""
37
+ allow_population_by_field_name = True
38
+ validate_assignment = True
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.dict(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> StagedModificationDecision:
50
+ """Create an instance of StagedModificationDecision from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self):
54
+ """Returns the dictionary representation of the model using alias"""
55
+ _dict = self.dict(by_alias=True,
56
+ exclude={
57
+ },
58
+ exclude_none=True)
59
+ # set to None if user_id (nullable) is None
60
+ # and __fields_set__ contains the field
61
+ if self.user_id is None and "user_id" in self.__fields_set__:
62
+ _dict['userId'] = None
63
+
64
+ # set to None if request_id (nullable) is None
65
+ # and __fields_set__ contains the field
66
+ if self.request_id is None and "request_id" in self.__fields_set__:
67
+ _dict['requestId'] = None
68
+
69
+ # set to None if decision (nullable) is None
70
+ # and __fields_set__ contains the field
71
+ if self.decision is None and "decision" in self.__fields_set__:
72
+ _dict['decision'] = None
73
+
74
+ # set to None if comment (nullable) is None
75
+ # and __fields_set__ contains the field
76
+ if self.comment is None and "comment" in self.__fields_set__:
77
+ _dict['comment'] = None
78
+
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: dict) -> StagedModificationDecision:
83
+ """Create an instance of StagedModificationDecision from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return StagedModificationDecision.parse_obj(obj)
89
+
90
+ _obj = StagedModificationDecision.parse_obj({
91
+ "as_at": obj.get("asAt"),
92
+ "user_id": obj.get("userId"),
93
+ "request_id": obj.get("requestId"),
94
+ "decision": obj.get("decision"),
95
+ "comment": obj.get("comment")
96
+ })
97
+ return _obj
@@ -0,0 +1,71 @@
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 BaseModel, Field, constr
23
+
24
+ class StagedModificationDecisionRequest(BaseModel):
25
+ """
26
+ StagedModificationDecisionRequest
27
+ """
28
+ decision: constr(strict=True, min_length=1) = Field(..., description="The decision on the requested staged modification, can be 'Approve' or 'Reject'.")
29
+ comment: constr(strict=True, max_length=256, min_length=1) = Field(..., description="Comment on decision.")
30
+ __properties = ["decision", "comment"]
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) -> StagedModificationDecisionRequest:
47
+ """Create an instance of StagedModificationDecisionRequest 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
+ return _dict
57
+
58
+ @classmethod
59
+ def from_dict(cls, obj: dict) -> StagedModificationDecisionRequest:
60
+ """Create an instance of StagedModificationDecisionRequest from a dict"""
61
+ if obj is None:
62
+ return None
63
+
64
+ if not isinstance(obj, dict):
65
+ return StagedModificationDecisionRequest.parse_obj(obj)
66
+
67
+ _obj = StagedModificationDecisionRequest.parse_obj({
68
+ "decision": obj.get("decision"),
69
+ "comment": obj.get("comment")
70
+ })
71
+ return _obj
@@ -0,0 +1,71 @@
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, Optional
22
+ from pydantic.v1 import BaseModel, Field
23
+
24
+ class StagedModificationEffectiveRange(BaseModel):
25
+ """
26
+ StagedModificationEffectiveRange
27
+ """
28
+ from_date: Optional[datetime] = Field(None, alias="fromDate", description="Time the decision request is made.")
29
+ until_date: Optional[datetime] = Field(None, alias="untilDate", description="ID of user that approved the request.")
30
+ __properties = ["fromDate", "untilDate"]
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) -> StagedModificationEffectiveRange:
47
+ """Create an instance of StagedModificationEffectiveRange 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
+ return _dict
57
+
58
+ @classmethod
59
+ def from_dict(cls, obj: dict) -> StagedModificationEffectiveRange:
60
+ """Create an instance of StagedModificationEffectiveRange from a dict"""
61
+ if obj is None:
62
+ return None
63
+
64
+ if not isinstance(obj, dict):
65
+ return StagedModificationEffectiveRange.parse_obj(obj)
66
+
67
+ _obj = StagedModificationEffectiveRange.parse_obj({
68
+ "from_date": obj.get("fromDate"),
69
+ "until_date": obj.get("untilDate")
70
+ })
71
+ return _obj
@@ -0,0 +1,85 @@
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 BaseModel, Field, StrictBool, StrictInt, StrictStr
23
+
24
+ class StagedModificationStagingRule(BaseModel):
25
+ """
26
+ StagedModificationStagingRule
27
+ """
28
+ staging_rule_set_id: Optional[StrictStr] = Field(None, alias="stagingRuleSetId", description="System generated unique id for the staging rule set.")
29
+ rule_id: Optional[StrictStr] = Field(None, alias="ruleId", description="The ID of the staging rule.")
30
+ required_approvals: Optional[StrictInt] = Field(None, alias="requiredApprovals", description="The number of approvals required. If left blank, one approval is needed.")
31
+ current_user_can_decide: Optional[StrictBool] = Field(None, alias="currentUserCanDecide", description="True or False indicating whether the current user can make a decision on the staged modification.")
32
+ __properties = ["stagingRuleSetId", "ruleId", "requiredApprovals", "currentUserCanDecide"]
33
+
34
+ class Config:
35
+ """Pydantic configuration"""
36
+ allow_population_by_field_name = True
37
+ validate_assignment = True
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.dict(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ return json.dumps(self.to_dict())
46
+
47
+ @classmethod
48
+ def from_json(cls, json_str: str) -> StagedModificationStagingRule:
49
+ """Create an instance of StagedModificationStagingRule from a JSON string"""
50
+ return cls.from_dict(json.loads(json_str))
51
+
52
+ def to_dict(self):
53
+ """Returns the dictionary representation of the model using alias"""
54
+ _dict = self.dict(by_alias=True,
55
+ exclude={
56
+ },
57
+ exclude_none=True)
58
+ # set to None if staging_rule_set_id (nullable) is None
59
+ # and __fields_set__ contains the field
60
+ if self.staging_rule_set_id is None and "staging_rule_set_id" in self.__fields_set__:
61
+ _dict['stagingRuleSetId'] = None
62
+
63
+ # set to None if rule_id (nullable) is None
64
+ # and __fields_set__ contains the field
65
+ if self.rule_id is None and "rule_id" in self.__fields_set__:
66
+ _dict['ruleId'] = None
67
+
68
+ return _dict
69
+
70
+ @classmethod
71
+ def from_dict(cls, obj: dict) -> StagedModificationStagingRule:
72
+ """Create an instance of StagedModificationStagingRule from a dict"""
73
+ if obj is None:
74
+ return None
75
+
76
+ if not isinstance(obj, dict):
77
+ return StagedModificationStagingRule.parse_obj(obj)
78
+
79
+ _obj = StagedModificationStagingRule.parse_obj({
80
+ "staging_rule_set_id": obj.get("stagingRuleSetId"),
81
+ "rule_id": obj.get("ruleId"),
82
+ "required_approvals": obj.get("requiredApprovals"),
83
+ "current_user_can_decide": obj.get("currentUserCanDecide")
84
+ })
85
+ return _obj
@@ -0,0 +1,88 @@
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 BaseModel, Field, StrictStr
23
+
24
+ class StagedModificationsEntityHrefs(BaseModel):
25
+ """
26
+ StagedModificationsEntityHrefs
27
+ """
28
+ when_staged: Optional[StrictStr] = Field(None, alias="whenStaged", description="The specific Uniform Resource Identifier (URI) for the staged modification change at the time when the change was requested.")
29
+ preview: Optional[StrictStr] = Field(None, description="The specific Uniform Resource Identifier (URI) for the preview of staged modification change once applied.")
30
+ latest: Optional[StrictStr] = Field(None, description="The specific Uniform Resource Identifier (URI) for the staged modification at latest time.")
31
+ __properties = ["whenStaged", "preview", "latest"]
32
+
33
+ class Config:
34
+ """Pydantic configuration"""
35
+ allow_population_by_field_name = True
36
+ validate_assignment = True
37
+
38
+ def to_str(self) -> str:
39
+ """Returns the string representation of the model using alias"""
40
+ return pprint.pformat(self.dict(by_alias=True))
41
+
42
+ def to_json(self) -> str:
43
+ """Returns the JSON representation of the model using alias"""
44
+ return json.dumps(self.to_dict())
45
+
46
+ @classmethod
47
+ def from_json(cls, json_str: str) -> StagedModificationsEntityHrefs:
48
+ """Create an instance of StagedModificationsEntityHrefs from a JSON string"""
49
+ return cls.from_dict(json.loads(json_str))
50
+
51
+ def to_dict(self):
52
+ """Returns the dictionary representation of the model using alias"""
53
+ _dict = self.dict(by_alias=True,
54
+ exclude={
55
+ },
56
+ exclude_none=True)
57
+ # set to None if when_staged (nullable) is None
58
+ # and __fields_set__ contains the field
59
+ if self.when_staged is None and "when_staged" in self.__fields_set__:
60
+ _dict['whenStaged'] = None
61
+
62
+ # set to None if preview (nullable) is None
63
+ # and __fields_set__ contains the field
64
+ if self.preview is None and "preview" in self.__fields_set__:
65
+ _dict['preview'] = None
66
+
67
+ # set to None if latest (nullable) is None
68
+ # and __fields_set__ contains the field
69
+ if self.latest is None and "latest" in self.__fields_set__:
70
+ _dict['latest'] = None
71
+
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: dict) -> StagedModificationsEntityHrefs:
76
+ """Create an instance of StagedModificationsEntityHrefs from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return StagedModificationsEntityHrefs.parse_obj(obj)
82
+
83
+ _obj = StagedModificationsEntityHrefs.parse_obj({
84
+ "when_staged": obj.get("whenStaged"),
85
+ "preview": obj.get("preview"),
86
+ "latest": obj.get("latest")
87
+ })
88
+ return _obj
@@ -0,0 +1,78 @@
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 StagedModificationsInfo(BaseModel):
25
+ """
26
+ The staged modifications metadata. # noqa: E501
27
+ """
28
+ count_pending: StrictInt = Field(..., alias="countPending", description="The number of staged modifications for the entity with a status of Pending for the requested asAt.")
29
+ href_pending: StrictStr = Field(..., alias="hrefPending", description="Link to the list staged modifications endpoint, filtered by entityType, entityUniqueId and status (= Pending).")
30
+ ids_previewed: Optional[conlist(StrictStr)] = Field(None, alias="idsPreviewed", description="An array of the ids of any StagedModifications being previewed.")
31
+ __properties = ["countPending", "hrefPending", "idsPreviewed"]
32
+
33
+ class Config:
34
+ """Pydantic configuration"""
35
+ allow_population_by_field_name = True
36
+ validate_assignment = True
37
+
38
+ def to_str(self) -> str:
39
+ """Returns the string representation of the model using alias"""
40
+ return pprint.pformat(self.dict(by_alias=True))
41
+
42
+ def to_json(self) -> str:
43
+ """Returns the JSON representation of the model using alias"""
44
+ return json.dumps(self.to_dict())
45
+
46
+ @classmethod
47
+ def from_json(cls, json_str: str) -> StagedModificationsInfo:
48
+ """Create an instance of StagedModificationsInfo from a JSON string"""
49
+ return cls.from_dict(json.loads(json_str))
50
+
51
+ def to_dict(self):
52
+ """Returns the dictionary representation of the model using alias"""
53
+ _dict = self.dict(by_alias=True,
54
+ exclude={
55
+ },
56
+ exclude_none=True)
57
+ # set to None if ids_previewed (nullable) is None
58
+ # and __fields_set__ contains the field
59
+ if self.ids_previewed is None and "ids_previewed" in self.__fields_set__:
60
+ _dict['idsPreviewed'] = None
61
+
62
+ return _dict
63
+
64
+ @classmethod
65
+ def from_dict(cls, obj: dict) -> StagedModificationsInfo:
66
+ """Create an instance of StagedModificationsInfo from a dict"""
67
+ if obj is None:
68
+ return None
69
+
70
+ if not isinstance(obj, dict):
71
+ return StagedModificationsInfo.parse_obj(obj)
72
+
73
+ _obj = StagedModificationsInfo.parse_obj({
74
+ "count_pending": obj.get("countPending"),
75
+ "href_pending": obj.get("hrefPending"),
76
+ "ids_previewed": obj.get("idsPreviewed")
77
+ })
78
+ return _obj