lusid-sdk 2.1.886__py3-none-any.whl → 2.1.888__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.
@@ -71,7 +71,7 @@ class CustomDataModelsApi:
71
71
 
72
72
  @validate_arguments
73
73
  def batch_amend(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, MembershipAmendmentRequest], Field(..., description="The payload describing the amendments to make for the given Custom Data Model.")], async_req: Optional[bool]=None, **kwargs) -> Union[BatchAmendCustomDataModelMembershipResponse, Awaitable[BatchAmendCustomDataModelMembershipResponse]]: # noqa: E501
74
- """[INTERNAL] BatchAmend: Batch amend Custom Data Models # noqa: E501
74
+ """[EXPERIMENTAL] BatchAmend: Batch amend entities Custom Data Model membership. # noqa: E501
75
75
 
76
76
  Add/Remove entities to/from a Custom Data Model in a single operation. Each amendment request must be keyed by a unique correlation ID. This id is ephemeral and is not stored by LUSID. It serves only as a way to easily identify each amendment in the response. Note: If using partial failure modes, then it is important to check the response body for failures as any failures will still return a 200 status code. # noqa: E501
77
77
  This method makes a synchronous HTTP request by default. To make an
@@ -104,7 +104,7 @@ class CustomDataModelsApi:
104
104
 
105
105
  @validate_arguments
106
106
  def batch_amend_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, MembershipAmendmentRequest], Field(..., description="The payload describing the amendments to make for the given Custom Data Model.")], **kwargs) -> ApiResponse: # noqa: E501
107
- """[INTERNAL] BatchAmend: Batch amend Custom Data Models # noqa: E501
107
+ """[EXPERIMENTAL] BatchAmend: Batch amend entities Custom Data Model membership. # noqa: E501
108
108
 
109
109
  Add/Remove entities to/from a Custom Data Model in a single operation. Each amendment request must be keyed by a unique correlation ID. This id is ephemeral and is not stored by LUSID. It serves only as a way to easily identify each amendment in the response. Note: If using partial failure modes, then it is important to check the response body for failures as any failures will still return a 200 status code. # noqa: E501
110
110
  This method makes a synchronous HTTP request by default. To make an
lusid/api/funds_api.py CHANGED
@@ -4369,7 +4369,7 @@ class FundsApi:
4369
4369
  def patch_fund(self, scope : Annotated[StrictStr, Field(..., description="The scope of the Fund.")], code : Annotated[StrictStr, Field(..., description="The code of the Fund. Together with the scope this uniquely identifies the Fund.")], operation : Annotated[conlist(Operation), Field(..., description="The json patch document. For more information see: https://datatracker.ietf.org/doc/html/rfc6902.")], async_req: Optional[bool]=None, **kwargs) -> Union[Fund, Awaitable[Fund]]: # noqa: E501
4370
4370
  """[EXPERIMENTAL] PatchFund: Patch a Fund. # noqa: E501
4371
4371
 
4372
- Update fields on a Fund. The behaviour is defined by the JSON Patch specification. Currently supported fields are: DisplayName, Description, FundConfigurationId, AborId, ShareClassInstrumentScopes, ShareClassInstruments, Type, InceptionDate, DecimalPlaces, YearEndDate. # noqa: E501
4372
+ Update fields on a Fund. The behaviour is defined by the JSON Patch specification. Currently supported fields are: DisplayName, Description, BaseCurrency, PortfolioIds, FundConfigurationId, ShareClassInstrumentScopes, ShareClassInstruments, Type, InceptionDate, DecimalPlaces, PrimaryNavType, AdditionalNavTypes, AborId, YearEndDate. # noqa: E501
4373
4373
  This method makes a synchronous HTTP request by default. To make an
4374
4374
  asynchronous HTTP request, please pass async_req=True
4375
4375
 
@@ -4404,7 +4404,7 @@ class FundsApi:
4404
4404
  def patch_fund_with_http_info(self, scope : Annotated[StrictStr, Field(..., description="The scope of the Fund.")], code : Annotated[StrictStr, Field(..., description="The code of the Fund. Together with the scope this uniquely identifies the Fund.")], operation : Annotated[conlist(Operation), Field(..., description="The json patch document. For more information see: https://datatracker.ietf.org/doc/html/rfc6902.")], **kwargs) -> ApiResponse: # noqa: E501
4405
4405
  """[EXPERIMENTAL] PatchFund: Patch a Fund. # noqa: E501
4406
4406
 
4407
- Update fields on a Fund. The behaviour is defined by the JSON Patch specification. Currently supported fields are: DisplayName, Description, FundConfigurationId, AborId, ShareClassInstrumentScopes, ShareClassInstruments, Type, InceptionDate, DecimalPlaces, YearEndDate. # noqa: E501
4407
+ Update fields on a Fund. The behaviour is defined by the JSON Patch specification. Currently supported fields are: DisplayName, Description, BaseCurrency, PortfolioIds, FundConfigurationId, ShareClassInstrumentScopes, ShareClassInstruments, Type, InceptionDate, DecimalPlaces, PrimaryNavType, AdditionalNavTypes, AborId, YearEndDate. # noqa: E501
4408
4408
  This method makes a synchronous HTTP request by default. To make an
4409
4409
  asynchronous HTTP request, please pass async_req=True
4410
4410
 
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.8093\n"\
448
+ "Version of the API: 0.11.8105\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
@@ -171,6 +171,10 @@ from lusid.models.change_item import ChangeItem
171
171
  from lusid.models.chart_of_accounts import ChartOfAccounts
172
172
  from lusid.models.chart_of_accounts_properties import ChartOfAccountsProperties
173
173
  from lusid.models.chart_of_accounts_request import ChartOfAccountsRequest
174
+ from lusid.models.check_definition import CheckDefinition
175
+ from lusid.models.check_definition_dataset_schema import CheckDefinitionDatasetSchema
176
+ from lusid.models.check_definition_rule import CheckDefinitionRule
177
+ from lusid.models.check_definition_rule_set import CheckDefinitionRuleSet
174
178
  from lusid.models.check_step import CheckStep
175
179
  from lusid.models.check_step_request import CheckStepRequest
176
180
  from lusid.models.cleardown_module_details import CleardownModuleDetails
@@ -247,6 +251,7 @@ from lusid.models.counterparty_signatory import CounterpartySignatory
247
251
  from lusid.models.create_address_key_definition_request import CreateAddressKeyDefinitionRequest
248
252
  from lusid.models.create_amortisation_rule_set_request import CreateAmortisationRuleSetRequest
249
253
  from lusid.models.create_calendar_request import CreateCalendarRequest
254
+ from lusid.models.create_check_definition_request import CreateCheckDefinitionRequest
250
255
  from lusid.models.create_closed_period_request import CreateClosedPeriodRequest
251
256
  from lusid.models.create_compliance_template_request import CreateComplianceTemplateRequest
252
257
  from lusid.models.create_corporate_action_source_request import CreateCorporateActionSourceRequest
@@ -717,6 +722,7 @@ from lusid.models.paged_resource_list_of_amortisation_rule_set import PagedResou
717
722
  from lusid.models.paged_resource_list_of_block import PagedResourceListOfBlock
718
723
  from lusid.models.paged_resource_list_of_calendar import PagedResourceListOfCalendar
719
724
  from lusid.models.paged_resource_list_of_chart_of_accounts import PagedResourceListOfChartOfAccounts
725
+ from lusid.models.paged_resource_list_of_check_definition import PagedResourceListOfCheckDefinition
720
726
  from lusid.models.paged_resource_list_of_cleardown_module_response import PagedResourceListOfCleardownModuleResponse
721
727
  from lusid.models.paged_resource_list_of_cleardown_module_rule import PagedResourceListOfCleardownModuleRule
722
728
  from lusid.models.paged_resource_list_of_closed_period import PagedResourceListOfClosedPeriod
@@ -1159,6 +1165,7 @@ from lusid.models.units_ratio import UnitsRatio
1159
1165
  from lusid.models.unmatched_holding_method import UnmatchedHoldingMethod
1160
1166
  from lusid.models.update_amortisation_rule_set_details_request import UpdateAmortisationRuleSetDetailsRequest
1161
1167
  from lusid.models.update_calendar_request import UpdateCalendarRequest
1168
+ from lusid.models.update_check_definition_request import UpdateCheckDefinitionRequest
1162
1169
  from lusid.models.update_compliance_template_request import UpdateComplianceTemplateRequest
1163
1170
  from lusid.models.update_custom_data_model_request import UpdateCustomDataModelRequest
1164
1171
  from lusid.models.update_custom_entity_definition_request import UpdateCustomEntityDefinitionRequest
@@ -1438,6 +1445,10 @@ __all__ = [
1438
1445
  "ChartOfAccounts",
1439
1446
  "ChartOfAccountsProperties",
1440
1447
  "ChartOfAccountsRequest",
1448
+ "CheckDefinition",
1449
+ "CheckDefinitionDatasetSchema",
1450
+ "CheckDefinitionRule",
1451
+ "CheckDefinitionRuleSet",
1441
1452
  "CheckStep",
1442
1453
  "CheckStepRequest",
1443
1454
  "CleardownModuleDetails",
@@ -1514,6 +1525,7 @@ __all__ = [
1514
1525
  "CreateAddressKeyDefinitionRequest",
1515
1526
  "CreateAmortisationRuleSetRequest",
1516
1527
  "CreateCalendarRequest",
1528
+ "CreateCheckDefinitionRequest",
1517
1529
  "CreateClosedPeriodRequest",
1518
1530
  "CreateComplianceTemplateRequest",
1519
1531
  "CreateCorporateActionSourceRequest",
@@ -1984,6 +1996,7 @@ __all__ = [
1984
1996
  "PagedResourceListOfBlock",
1985
1997
  "PagedResourceListOfCalendar",
1986
1998
  "PagedResourceListOfChartOfAccounts",
1999
+ "PagedResourceListOfCheckDefinition",
1987
2000
  "PagedResourceListOfCleardownModuleResponse",
1988
2001
  "PagedResourceListOfCleardownModuleRule",
1989
2002
  "PagedResourceListOfClosedPeriod",
@@ -2426,6 +2439,7 @@ __all__ = [
2426
2439
  "UnmatchedHoldingMethod",
2427
2440
  "UpdateAmortisationRuleSetDetailsRequest",
2428
2441
  "UpdateCalendarRequest",
2442
+ "UpdateCheckDefinitionRequest",
2429
2443
  "UpdateComplianceTemplateRequest",
2430
2444
  "UpdateCustomDataModelRequest",
2431
2445
  "UpdateCustomEntityDefinitionRequest",
@@ -0,0 +1,164 @@
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, constr, validator
23
+ from lusid.models.check_definition_dataset_schema import CheckDefinitionDatasetSchema
24
+ from lusid.models.check_definition_rule_set import CheckDefinitionRuleSet
25
+ from lusid.models.link import Link
26
+ from lusid.models.model_property import ModelProperty
27
+ from lusid.models.resource_id import ResourceId
28
+ from lusid.models.version import Version
29
+
30
+ class CheckDefinition(BaseModel):
31
+ """
32
+ CheckDefinition
33
+ """
34
+ id: ResourceId = Field(...)
35
+ display_name: Optional[StrictStr] = Field(None,alias="displayName", description="The name of the Check Definition.")
36
+ description: Optional[StrictStr] = Field(None,alias="description", description="A description for the Check Definition.")
37
+ dataset_schema: Optional[CheckDefinitionDatasetSchema] = Field(None, alias="datasetSchema")
38
+ rule_sets: Optional[conlist(CheckDefinitionRuleSet)] = Field(None, alias="ruleSets", description="A collection of rule sets for the Check Definition.")
39
+ href: Optional[StrictStr] = Field(None,alias="href", description="The specific Uniform Resource Identifier (URI) for this resource at the requested effective and asAt datetime.")
40
+ version: Optional[Version] = None
41
+ properties: Optional[Dict[str, ModelProperty]] = Field(None, description="A set of properties for the Check Definition.")
42
+ links: Optional[conlist(Link)] = None
43
+ __properties = ["id", "displayName", "description", "datasetSchema", "ruleSets", "href", "version", "properties", "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) -> CheckDefinition:
68
+ """Create an instance of CheckDefinition 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 id
78
+ if self.id:
79
+ _dict['id'] = self.id.to_dict()
80
+ # override the default output from pydantic by calling `to_dict()` of dataset_schema
81
+ if self.dataset_schema:
82
+ _dict['datasetSchema'] = self.dataset_schema.to_dict()
83
+ # override the default output from pydantic by calling `to_dict()` of each item in rule_sets (list)
84
+ _items = []
85
+ if self.rule_sets:
86
+ for _item in self.rule_sets:
87
+ if _item:
88
+ _items.append(_item.to_dict())
89
+ _dict['ruleSets'] = _items
90
+ # override the default output from pydantic by calling `to_dict()` of version
91
+ if self.version:
92
+ _dict['version'] = self.version.to_dict()
93
+ # override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
94
+ _field_dict = {}
95
+ if self.properties:
96
+ for _key in self.properties:
97
+ if self.properties[_key]:
98
+ _field_dict[_key] = self.properties[_key].to_dict()
99
+ _dict['properties'] = _field_dict
100
+ # override the default output from pydantic by calling `to_dict()` of each item in links (list)
101
+ _items = []
102
+ if self.links:
103
+ for _item in self.links:
104
+ if _item:
105
+ _items.append(_item.to_dict())
106
+ _dict['links'] = _items
107
+ # set to None if display_name (nullable) is None
108
+ # and __fields_set__ contains the field
109
+ if self.display_name is None and "display_name" in self.__fields_set__:
110
+ _dict['displayName'] = None
111
+
112
+ # set to None if description (nullable) is None
113
+ # and __fields_set__ contains the field
114
+ if self.description is None and "description" in self.__fields_set__:
115
+ _dict['description'] = None
116
+
117
+ # set to None if rule_sets (nullable) is None
118
+ # and __fields_set__ contains the field
119
+ if self.rule_sets is None and "rule_sets" in self.__fields_set__:
120
+ _dict['ruleSets'] = None
121
+
122
+ # set to None if href (nullable) is None
123
+ # and __fields_set__ contains the field
124
+ if self.href is None and "href" in self.__fields_set__:
125
+ _dict['href'] = None
126
+
127
+ # set to None if properties (nullable) is None
128
+ # and __fields_set__ contains the field
129
+ if self.properties is None and "properties" in self.__fields_set__:
130
+ _dict['properties'] = None
131
+
132
+ # set to None if links (nullable) is None
133
+ # and __fields_set__ contains the field
134
+ if self.links is None and "links" in self.__fields_set__:
135
+ _dict['links'] = None
136
+
137
+ return _dict
138
+
139
+ @classmethod
140
+ def from_dict(cls, obj: dict) -> CheckDefinition:
141
+ """Create an instance of CheckDefinition from a dict"""
142
+ if obj is None:
143
+ return None
144
+
145
+ if not isinstance(obj, dict):
146
+ return CheckDefinition.parse_obj(obj)
147
+
148
+ _obj = CheckDefinition.parse_obj({
149
+ "id": ResourceId.from_dict(obj.get("id")) if obj.get("id") is not None else None,
150
+ "display_name": obj.get("displayName"),
151
+ "description": obj.get("description"),
152
+ "dataset_schema": CheckDefinitionDatasetSchema.from_dict(obj.get("datasetSchema")) if obj.get("datasetSchema") is not None else None,
153
+ "rule_sets": [CheckDefinitionRuleSet.from_dict(_item) for _item in obj.get("ruleSets")] if obj.get("ruleSets") is not None else None,
154
+ "href": obj.get("href"),
155
+ "version": Version.from_dict(obj.get("version")) if obj.get("version") is not None else None,
156
+ "properties": dict(
157
+ (_k, ModelProperty.from_dict(_v))
158
+ for _k, _v in obj.get("properties").items()
159
+ )
160
+ if obj.get("properties") is not None
161
+ else None,
162
+ "links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
163
+ })
164
+ return _obj
@@ -0,0 +1,89 @@
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
23
+
24
+ class CheckDefinitionDatasetSchema(BaseModel):
25
+ """
26
+ CheckDefinitionDatasetSchema
27
+ """
28
+ type: Optional[StrictStr] = Field(None,alias="type", description="The type of dataset schema that the Check Definition applies to")
29
+ entity_type: Optional[StrictStr] = Field(None,alias="entityType", description="The type of entity that the dataset schema applies to, e.g. Instrument, Transaction, etc.")
30
+ __properties = ["type", "entityType"]
31
+
32
+ class Config:
33
+ """Pydantic configuration"""
34
+ allow_population_by_field_name = True
35
+ validate_assignment = True
36
+
37
+ def __str__(self):
38
+ """For `print` and `pprint`"""
39
+ return pprint.pformat(self.dict(by_alias=False))
40
+
41
+ def __repr__(self):
42
+ """For `print` and `pprint`"""
43
+ return self.to_str()
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.dict(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> CheckDefinitionDatasetSchema:
55
+ """Create an instance of CheckDefinitionDatasetSchema from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self):
59
+ """Returns the dictionary representation of the model using alias"""
60
+ _dict = self.dict(by_alias=True,
61
+ exclude={
62
+ },
63
+ exclude_none=True)
64
+ # set to None if type (nullable) is None
65
+ # and __fields_set__ contains the field
66
+ if self.type is None and "type" in self.__fields_set__:
67
+ _dict['type'] = None
68
+
69
+ # set to None if entity_type (nullable) is None
70
+ # and __fields_set__ contains the field
71
+ if self.entity_type is None and "entity_type" in self.__fields_set__:
72
+ _dict['entityType'] = None
73
+
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: dict) -> CheckDefinitionDatasetSchema:
78
+ """Create an instance of CheckDefinitionDatasetSchema from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return CheckDefinitionDatasetSchema.parse_obj(obj)
84
+
85
+ _obj = CheckDefinitionDatasetSchema.parse_obj({
86
+ "type": obj.get("type"),
87
+ "entity_type": obj.get("entityType")
88
+ })
89
+ return _obj
@@ -0,0 +1,105 @@
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, StrictInt, constr, validator
23
+
24
+ class CheckDefinitionRule(BaseModel):
25
+ """
26
+ CheckDefinitionRule
27
+ """
28
+ rule_key: Optional[StrictStr] = Field(None,alias="ruleKey", description="The key of the Rule.")
29
+ display_name: Optional[StrictStr] = Field(None,alias="displayName", description="The name of the Rule.")
30
+ description: Optional[StrictStr] = Field(None,alias="description", description="A description for the Rule.")
31
+ rule_formula: Optional[StrictStr] = Field(None,alias="ruleFormula", description="The formula for the rule.")
32
+ severity: Optional[StrictInt] = Field(None, description="Severity of the rule if formaula is not satisfied.")
33
+ __properties = ["ruleKey", "displayName", "description", "ruleFormula", "severity"]
34
+
35
+ class Config:
36
+ """Pydantic configuration"""
37
+ allow_population_by_field_name = True
38
+ validate_assignment = True
39
+
40
+ def __str__(self):
41
+ """For `print` and `pprint`"""
42
+ return pprint.pformat(self.dict(by_alias=False))
43
+
44
+ def __repr__(self):
45
+ """For `print` and `pprint`"""
46
+ return self.to_str()
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.dict(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ return json.dumps(self.to_dict())
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> CheckDefinitionRule:
58
+ """Create an instance of CheckDefinitionRule from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self):
62
+ """Returns the dictionary representation of the model using alias"""
63
+ _dict = self.dict(by_alias=True,
64
+ exclude={
65
+ },
66
+ exclude_none=True)
67
+ # set to None if rule_key (nullable) is None
68
+ # and __fields_set__ contains the field
69
+ if self.rule_key is None and "rule_key" in self.__fields_set__:
70
+ _dict['ruleKey'] = None
71
+
72
+ # set to None if display_name (nullable) is None
73
+ # and __fields_set__ contains the field
74
+ if self.display_name is None and "display_name" in self.__fields_set__:
75
+ _dict['displayName'] = None
76
+
77
+ # set to None if description (nullable) is None
78
+ # and __fields_set__ contains the field
79
+ if self.description is None and "description" in self.__fields_set__:
80
+ _dict['description'] = None
81
+
82
+ # set to None if rule_formula (nullable) is None
83
+ # and __fields_set__ contains the field
84
+ if self.rule_formula is None and "rule_formula" in self.__fields_set__:
85
+ _dict['ruleFormula'] = None
86
+
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: dict) -> CheckDefinitionRule:
91
+ """Create an instance of CheckDefinitionRule from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return CheckDefinitionRule.parse_obj(obj)
97
+
98
+ _obj = CheckDefinitionRule.parse_obj({
99
+ "rule_key": obj.get("ruleKey"),
100
+ "display_name": obj.get("displayName"),
101
+ "description": obj.get("description"),
102
+ "rule_formula": obj.get("ruleFormula"),
103
+ "severity": obj.get("severity")
104
+ })
105
+ return _obj
@@ -0,0 +1,118 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LUSID API
5
+
6
+ FINBOURNE Technology # noqa: E501
7
+
8
+ Contact: info@finbourne.com
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+
21
+ from typing import Any, Dict, List, Optional
22
+ from pydantic.v1 import StrictStr, Field, BaseModel, Field, conlist, constr, validator
23
+ from lusid.models.check_definition_rule import CheckDefinitionRule
24
+
25
+ class CheckDefinitionRuleSet(BaseModel):
26
+ """
27
+ CheckDefinitionRuleSet
28
+ """
29
+ rule_set_key: Optional[StrictStr] = Field(None,alias="ruleSetKey", description="The Key of the Rule Set.")
30
+ display_name: Optional[StrictStr] = Field(None,alias="displayName", description="The name of the Rule Set.")
31
+ description: Optional[StrictStr] = Field(None,alias="description", description="A description for the Rule Set.")
32
+ rule_set_filter: Optional[StrictStr] = Field(None,alias="ruleSetFilter", description="A filter for the Rule Set to filter entity instances the rule set applies to.")
33
+ rules: Optional[conlist(CheckDefinitionRule)] = Field(None, description="A collection of rules for the Rule Set.")
34
+ __properties = ["ruleSetKey", "displayName", "description", "ruleSetFilter", "rules"]
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) -> CheckDefinitionRuleSet:
59
+ """Create an instance of CheckDefinitionRuleSet 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 item in rules (list)
69
+ _items = []
70
+ if self.rules:
71
+ for _item in self.rules:
72
+ if _item:
73
+ _items.append(_item.to_dict())
74
+ _dict['rules'] = _items
75
+ # set to None if rule_set_key (nullable) is None
76
+ # and __fields_set__ contains the field
77
+ if self.rule_set_key is None and "rule_set_key" in self.__fields_set__:
78
+ _dict['ruleSetKey'] = None
79
+
80
+ # set to None if display_name (nullable) is None
81
+ # and __fields_set__ contains the field
82
+ if self.display_name is None and "display_name" in self.__fields_set__:
83
+ _dict['displayName'] = None
84
+
85
+ # set to None if description (nullable) is None
86
+ # and __fields_set__ contains the field
87
+ if self.description is None and "description" in self.__fields_set__:
88
+ _dict['description'] = None
89
+
90
+ # set to None if rule_set_filter (nullable) is None
91
+ # and __fields_set__ contains the field
92
+ if self.rule_set_filter is None and "rule_set_filter" in self.__fields_set__:
93
+ _dict['ruleSetFilter'] = None
94
+
95
+ # set to None if rules (nullable) is None
96
+ # and __fields_set__ contains the field
97
+ if self.rules is None and "rules" in self.__fields_set__:
98
+ _dict['rules'] = None
99
+
100
+ return _dict
101
+
102
+ @classmethod
103
+ def from_dict(cls, obj: dict) -> CheckDefinitionRuleSet:
104
+ """Create an instance of CheckDefinitionRuleSet from a dict"""
105
+ if obj is None:
106
+ return None
107
+
108
+ if not isinstance(obj, dict):
109
+ return CheckDefinitionRuleSet.parse_obj(obj)
110
+
111
+ _obj = CheckDefinitionRuleSet.parse_obj({
112
+ "rule_set_key": obj.get("ruleSetKey"),
113
+ "display_name": obj.get("displayName"),
114
+ "description": obj.get("description"),
115
+ "rule_set_filter": obj.get("ruleSetFilter"),
116
+ "rules": [CheckDefinitionRule.from_dict(_item) for _item in obj.get("rules")] if obj.get("rules") is not None else None
117
+ })
118
+ return _obj