lusid-sdk 2.1.131__py3-none-any.whl → 2.1.142__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/__init__.py +21 -0
- lusid/api/aggregation_api.py +2 -2
- lusid/api/allocations_api.py +2 -2
- lusid/api/calendars_api.py +6 -6
- lusid/api/complex_market_data_api.py +2 -2
- lusid/api/custom_entities_api.py +6 -6
- lusid/api/entities_api.py +2 -2
- lusid/api/executions_api.py +4 -4
- lusid/api/funds_api.py +1148 -198
- lusid/api/instrument_events_api.py +2 -2
- lusid/api/instruments_api.py +4 -4
- lusid/api/legal_entities_api.py +20 -20
- lusid/api/orders_api.py +4 -4
- lusid/api/portfolio_groups_api.py +4 -4
- lusid/api/portfolios_api.py +16 -16
- lusid/api/property_definitions_api.py +2 -2
- lusid/api/quotes_api.py +2 -2
- lusid/api/relationships_api.py +2 -2
- lusid/api/structured_result_data_api.py +6 -6
- lusid/api/transaction_portfolios_api.py +6 -6
- lusid/configuration.py +1 -1
- lusid/extensions/__init__.py +2 -0
- lusid/extensions/configuration_loaders.py +68 -5
- lusid/extensions/file_access_token.py +42 -0
- lusid/models/__init__.py +18 -0
- lusid/models/access_metadata_operation.py +3 -3
- lusid/models/applicable_instrument_event.py +3 -1
- lusid/models/branch_step_request.py +91 -0
- lusid/models/check_step_request.py +91 -0
- lusid/models/compliance_step_request.py +41 -19
- lusid/models/compliance_step_type_request.py +0 -1
- lusid/models/deleted_entity_response.py +15 -1
- lusid/models/fee.py +217 -0
- lusid/models/fee_request.py +163 -0
- lusid/models/filter_step_request.py +91 -0
- lusid/models/group_by_step_request.py +91 -0
- lusid/models/group_filter_step_request.py +91 -0
- lusid/models/instrument_event_configuration.py +1 -1
- lusid/models/intermediate_compliance_step_request.py +91 -0
- lusid/models/operation_type.py +1 -0
- lusid/models/paged_resource_list_of_fee.py +113 -0
- lusid/models/staged_modifications_requested_change_interval.py +11 -14
- {lusid_sdk-2.1.131.dist-info → lusid_sdk-2.1.142.dist-info}/METADATA +63 -49
- {lusid_sdk-2.1.131.dist-info → lusid_sdk-2.1.142.dist-info}/RECORD +45 -35
- {lusid_sdk-2.1.131.dist-info → lusid_sdk-2.1.142.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
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 Field, StrictStr, constr, validator
|
|
23
|
+
from lusid.models.compliance_step_request import ComplianceStepRequest
|
|
24
|
+
|
|
25
|
+
class CheckStepRequest(ComplianceStepRequest):
|
|
26
|
+
"""
|
|
27
|
+
CheckStepRequest
|
|
28
|
+
"""
|
|
29
|
+
label: constr(strict=True, max_length=64, min_length=1) = Field(..., description="The label of the compliance step")
|
|
30
|
+
compliance_step_type_request: StrictStr = Field(..., alias="complianceStepTypeRequest", description=". The available values are: FilterStepRequest, GroupByStepRequest, GroupFilterStepRequest, BranchStepRequest, CheckStepRequest")
|
|
31
|
+
additional_properties: Dict[str, Any] = {}
|
|
32
|
+
__properties = ["complianceStepTypeRequest", "label"]
|
|
33
|
+
|
|
34
|
+
@validator('compliance_step_type_request')
|
|
35
|
+
def compliance_step_type_request_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in ('FilterStepRequest', 'GroupByStepRequest', 'GroupFilterStepRequest', 'BranchStepRequest', 'CheckStepRequest'):
|
|
38
|
+
raise ValueError("must be one of enum values ('FilterStepRequest', 'GroupByStepRequest', 'GroupFilterStepRequest', 'BranchStepRequest', 'CheckStepRequest')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
class Config:
|
|
42
|
+
"""Pydantic configuration"""
|
|
43
|
+
allow_population_by_field_name = True
|
|
44
|
+
validate_assignment = True
|
|
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) -> CheckStepRequest:
|
|
56
|
+
"""Create an instance of CheckStepRequest 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
|
+
"additional_properties"
|
|
64
|
+
},
|
|
65
|
+
exclude_none=True)
|
|
66
|
+
# puts key-value pairs in additional_properties in the top level
|
|
67
|
+
if self.additional_properties is not None:
|
|
68
|
+
for _key, _value in self.additional_properties.items():
|
|
69
|
+
_dict[_key] = _value
|
|
70
|
+
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: dict) -> CheckStepRequest:
|
|
75
|
+
"""Create an instance of CheckStepRequest from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return CheckStepRequest.parse_obj(obj)
|
|
81
|
+
|
|
82
|
+
_obj = CheckStepRequest.parse_obj({
|
|
83
|
+
"compliance_step_type_request": obj.get("complianceStepTypeRequest"),
|
|
84
|
+
"label": obj.get("label")
|
|
85
|
+
})
|
|
86
|
+
# store additional fields in additional_properties
|
|
87
|
+
for _key in obj.keys():
|
|
88
|
+
if _key not in cls.__properties:
|
|
89
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
90
|
+
|
|
91
|
+
return _obj
|
|
@@ -18,21 +18,22 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
from typing import Any, Dict
|
|
21
|
+
from typing import Any, Dict, Union
|
|
22
22
|
from pydantic.v1 import BaseModel, Field, StrictStr, validator
|
|
23
|
+
import lusid.models
|
|
23
24
|
|
|
24
25
|
class ComplianceStepRequest(BaseModel):
|
|
25
26
|
"""
|
|
26
27
|
ComplianceStepRequest
|
|
27
28
|
"""
|
|
28
|
-
|
|
29
|
-
__properties = ["
|
|
29
|
+
compliance_step_type_request: StrictStr = Field(..., alias="complianceStepTypeRequest", description=". The available values are: FilterStepRequest, GroupByStepRequest, GroupFilterStepRequest, BranchStepRequest, CheckStepRequest")
|
|
30
|
+
__properties = ["complianceStepTypeRequest"]
|
|
30
31
|
|
|
31
|
-
@validator('
|
|
32
|
-
def
|
|
32
|
+
@validator('compliance_step_type_request')
|
|
33
|
+
def compliance_step_type_request_validate_enum(cls, value):
|
|
33
34
|
"""Validates the enum"""
|
|
34
|
-
if value not in ('FilterStepRequest', 'GroupByStepRequest', 'GroupFilterStepRequest', 'BranchStepRequest', '
|
|
35
|
-
raise ValueError("must be one of enum values ('FilterStepRequest', 'GroupByStepRequest', 'GroupFilterStepRequest', 'BranchStepRequest', '
|
|
35
|
+
if value not in ('FilterStepRequest', 'GroupByStepRequest', 'GroupFilterStepRequest', 'BranchStepRequest', 'CheckStepRequest'):
|
|
36
|
+
raise ValueError("must be one of enum values ('FilterStepRequest', 'GroupByStepRequest', 'GroupFilterStepRequest', 'BranchStepRequest', 'CheckStepRequest')")
|
|
36
37
|
return value
|
|
37
38
|
|
|
38
39
|
class Config:
|
|
@@ -40,6 +41,28 @@ class ComplianceStepRequest(BaseModel):
|
|
|
40
41
|
allow_population_by_field_name = True
|
|
41
42
|
validate_assignment = True
|
|
42
43
|
|
|
44
|
+
# JSON field name that stores the object type
|
|
45
|
+
__discriminator_property_name = 'complianceStepTypeRequest'
|
|
46
|
+
|
|
47
|
+
# discriminator mappings
|
|
48
|
+
__discriminator_value_class_map = {
|
|
49
|
+
'BranchStepRequest': 'BranchStepRequest',
|
|
50
|
+
'CheckStepRequest': 'CheckStepRequest',
|
|
51
|
+
'FilterStepRequest': 'FilterStepRequest',
|
|
52
|
+
'GroupByStepRequest': 'GroupByStepRequest',
|
|
53
|
+
'GroupFilterStepRequest': 'GroupFilterStepRequest',
|
|
54
|
+
'IntermediateComplianceStepRequest': 'IntermediateComplianceStepRequest'
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def get_discriminator_value(cls, obj: dict) -> str:
|
|
59
|
+
"""Returns the discriminator value (object type) of the data"""
|
|
60
|
+
discriminator_value = obj[cls.__discriminator_property_name]
|
|
61
|
+
if discriminator_value:
|
|
62
|
+
return cls.__discriminator_value_class_map.get(discriminator_value)
|
|
63
|
+
else:
|
|
64
|
+
return None
|
|
65
|
+
|
|
43
66
|
def to_str(self) -> str:
|
|
44
67
|
"""Returns the string representation of the model using alias"""
|
|
45
68
|
return pprint.pformat(self.dict(by_alias=True))
|
|
@@ -49,7 +72,7 @@ class ComplianceStepRequest(BaseModel):
|
|
|
49
72
|
return json.dumps(self.to_dict())
|
|
50
73
|
|
|
51
74
|
@classmethod
|
|
52
|
-
def from_json(cls, json_str: str) ->
|
|
75
|
+
def from_json(cls, json_str: str) -> Union(BranchStepRequest, CheckStepRequest, FilterStepRequest, GroupByStepRequest, GroupFilterStepRequest, IntermediateComplianceStepRequest):
|
|
53
76
|
"""Create an instance of ComplianceStepRequest from a JSON string"""
|
|
54
77
|
return cls.from_dict(json.loads(json_str))
|
|
55
78
|
|
|
@@ -62,15 +85,14 @@ class ComplianceStepRequest(BaseModel):
|
|
|
62
85
|
return _dict
|
|
63
86
|
|
|
64
87
|
@classmethod
|
|
65
|
-
def from_dict(cls, obj: dict) ->
|
|
88
|
+
def from_dict(cls, obj: dict) -> Union(BranchStepRequest, CheckStepRequest, FilterStepRequest, GroupByStepRequest, GroupFilterStepRequest, IntermediateComplianceStepRequest):
|
|
66
89
|
"""Create an instance of ComplianceStepRequest from a dict"""
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return _obj
|
|
90
|
+
# look up the object type based on discriminator mapping
|
|
91
|
+
object_type = cls.get_discriminator_value(obj)
|
|
92
|
+
if object_type:
|
|
93
|
+
klass = getattr(lusid.models, object_type)
|
|
94
|
+
return klass.from_dict(obj)
|
|
95
|
+
else:
|
|
96
|
+
raise ValueError("ComplianceStepRequest failed to lookup discriminator value from " +
|
|
97
|
+
json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name +
|
|
98
|
+
", mapping: " + json.dumps(cls.__discriminator_value_class_map))
|
|
@@ -33,7 +33,6 @@ class ComplianceStepTypeRequest(str, Enum):
|
|
|
33
33
|
GROUPBYSTEPREQUEST = 'GroupByStepRequest'
|
|
34
34
|
GROUPFILTERSTEPREQUEST = 'GroupFilterStepRequest'
|
|
35
35
|
BRANCHSTEPREQUEST = 'BranchStepRequest'
|
|
36
|
-
RECOMBINESTEPREQUEST = 'RecombineStepRequest'
|
|
37
36
|
CHECKSTEPREQUEST = 'CheckStepRequest'
|
|
38
37
|
|
|
39
38
|
@classmethod
|
|
@@ -29,8 +29,10 @@ class DeletedEntityResponse(BaseModel):
|
|
|
29
29
|
href: Optional[StrictStr] = Field(None, description="The specific Uniform Resource Identifier (URI) for this resource at the requested effective and asAt datetime.")
|
|
30
30
|
effective_from: Optional[datetime] = Field(None, alias="effectiveFrom", description="The effective datetime at which the deletion became valid. May be null in the case where multiple date times are applicable.")
|
|
31
31
|
as_at: datetime = Field(..., alias="asAt", description="The asAt datetime at which the deletion was committed to LUSID.")
|
|
32
|
+
entity_type: Optional[StrictStr] = Field(None, alias="entityType", description="The type of the entity that the deleted response applies to.")
|
|
33
|
+
entity_unique_id: Optional[StrictStr] = Field(None, alias="entityUniqueId", description="The unique Id of the entity that the deleted response applies to.")
|
|
32
34
|
links: Optional[conlist(Link)] = None
|
|
33
|
-
__properties = ["href", "effectiveFrom", "asAt", "links"]
|
|
35
|
+
__properties = ["href", "effectiveFrom", "asAt", "entityType", "entityUniqueId", "links"]
|
|
34
36
|
|
|
35
37
|
class Config:
|
|
36
38
|
"""Pydantic configuration"""
|
|
@@ -73,6 +75,16 @@ class DeletedEntityResponse(BaseModel):
|
|
|
73
75
|
if self.effective_from is None and "effective_from" in self.__fields_set__:
|
|
74
76
|
_dict['effectiveFrom'] = None
|
|
75
77
|
|
|
78
|
+
# set to None if entity_type (nullable) is None
|
|
79
|
+
# and __fields_set__ contains the field
|
|
80
|
+
if self.entity_type is None and "entity_type" in self.__fields_set__:
|
|
81
|
+
_dict['entityType'] = None
|
|
82
|
+
|
|
83
|
+
# set to None if entity_unique_id (nullable) is None
|
|
84
|
+
# and __fields_set__ contains the field
|
|
85
|
+
if self.entity_unique_id is None and "entity_unique_id" in self.__fields_set__:
|
|
86
|
+
_dict['entityUniqueId'] = None
|
|
87
|
+
|
|
76
88
|
# set to None if links (nullable) is None
|
|
77
89
|
# and __fields_set__ contains the field
|
|
78
90
|
if self.links is None and "links" in self.__fields_set__:
|
|
@@ -93,6 +105,8 @@ class DeletedEntityResponse(BaseModel):
|
|
|
93
105
|
"href": obj.get("href"),
|
|
94
106
|
"effective_from": obj.get("effectiveFrom"),
|
|
95
107
|
"as_at": obj.get("asAt"),
|
|
108
|
+
"entity_type": obj.get("entityType"),
|
|
109
|
+
"entity_unique_id": obj.get("entityUniqueId"),
|
|
96
110
|
"links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
|
|
97
111
|
})
|
|
98
112
|
return _obj
|
lusid/models/fee.py
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
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, Union
|
|
22
|
+
from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist, constr, validator
|
|
23
|
+
from lusid.models.day_month import DayMonth
|
|
24
|
+
from lusid.models.link import Link
|
|
25
|
+
from lusid.models.model_property import ModelProperty
|
|
26
|
+
from lusid.models.resource_id import ResourceId
|
|
27
|
+
from lusid.models.version import Version
|
|
28
|
+
|
|
29
|
+
class Fee(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
Fee
|
|
32
|
+
"""
|
|
33
|
+
href: Optional[StrictStr] = Field(None, description="The specific Uniform Resource Identifier (URI) for this resource at the requested effective and asAt datetime.")
|
|
34
|
+
fee_code: Optional[constr(strict=True, max_length=64, min_length=1)] = Field(None, alias="feeCode", description="The code of the Fee.")
|
|
35
|
+
fee_type: ResourceId = Field(..., alias="feeType")
|
|
36
|
+
name: constr(strict=True, max_length=50, min_length=0) = Field(..., description="The name of the Fee.")
|
|
37
|
+
description: Optional[constr(strict=True, max_length=1024, min_length=0)] = Field(None, description="A description for the Fee.")
|
|
38
|
+
origin: Optional[constr(strict=True, max_length=512, min_length=1)] = Field(None, description="The origin or source of the Fee accrual.")
|
|
39
|
+
calculation_base: Optional[constr(strict=True, max_length=1024, min_length=0)] = Field(None, alias="calculationBase", description="The calculation base for the Fee that is calculated using a percentage.")
|
|
40
|
+
accrual_currency: constr(strict=True, max_length=3, min_length=0) = Field(..., alias="accrualCurrency", description="The accrual currency.")
|
|
41
|
+
treatment: constr(strict=True, min_length=1) = Field(..., description="The accrual period of the Fee; 'Monthly' or 'Daily'.")
|
|
42
|
+
total_annual_accrual_amount: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="totalAnnualAccrualAmount", description="The total accrued amount for the Fee.")
|
|
43
|
+
fee_rate_percentage: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="feeRatePercentage", description="The fee rate percentage.")
|
|
44
|
+
monthly_accrual: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="monthlyAccrual", description="The monthly accrual amount.")
|
|
45
|
+
daily_accrual: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="dailyAccrual", description="The daily accrual amount.")
|
|
46
|
+
payable_frequency: constr(strict=True, min_length=1) = Field(..., alias="payableFrequency", description="The payable frequency for the Fee; 'Annually', 'Quarterly' or 'Monthly'.")
|
|
47
|
+
business_day_convention: constr(strict=True, min_length=1) = Field(..., alias="businessDayConvention", description="The business day convention to use for Fee calculations on weekends.")
|
|
48
|
+
start_date: datetime = Field(..., alias="startDate", description="The start date of the Fee.")
|
|
49
|
+
end_date: Optional[datetime] = Field(None, alias="endDate", description="The end date of the Fee.")
|
|
50
|
+
anchor_date: Optional[DayMonth] = Field(None, alias="anchorDate")
|
|
51
|
+
properties: Optional[Dict[str, ModelProperty]] = Field(None, description="The Fee properties. These will be from the 'Fee' domain.")
|
|
52
|
+
version: Optional[Version] = None
|
|
53
|
+
links: Optional[conlist(Link)] = None
|
|
54
|
+
__properties = ["href", "feeCode", "feeType", "name", "description", "origin", "calculationBase", "accrualCurrency", "treatment", "totalAnnualAccrualAmount", "feeRatePercentage", "monthlyAccrual", "dailyAccrual", "payableFrequency", "businessDayConvention", "startDate", "endDate", "anchorDate", "properties", "version", "links"]
|
|
55
|
+
|
|
56
|
+
@validator('fee_code')
|
|
57
|
+
def fee_code_validate_regular_expression(cls, value):
|
|
58
|
+
"""Validates the regular expression"""
|
|
59
|
+
if value is None:
|
|
60
|
+
return value
|
|
61
|
+
|
|
62
|
+
if not re.match(r"^[a-zA-Z0-9\-_]+$", value):
|
|
63
|
+
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9\-_]+$/")
|
|
64
|
+
return value
|
|
65
|
+
|
|
66
|
+
@validator('description')
|
|
67
|
+
def description_validate_regular_expression(cls, value):
|
|
68
|
+
"""Validates the regular expression"""
|
|
69
|
+
if value is None:
|
|
70
|
+
return value
|
|
71
|
+
|
|
72
|
+
if not re.match(r"^[\s\S]*$", value):
|
|
73
|
+
raise ValueError(r"must validate the regular expression /^[\s\S]*$/")
|
|
74
|
+
return value
|
|
75
|
+
|
|
76
|
+
class Config:
|
|
77
|
+
"""Pydantic configuration"""
|
|
78
|
+
allow_population_by_field_name = True
|
|
79
|
+
validate_assignment = True
|
|
80
|
+
|
|
81
|
+
def to_str(self) -> str:
|
|
82
|
+
"""Returns the string representation of the model using alias"""
|
|
83
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
84
|
+
|
|
85
|
+
def to_json(self) -> str:
|
|
86
|
+
"""Returns the JSON representation of the model using alias"""
|
|
87
|
+
return json.dumps(self.to_dict())
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_json(cls, json_str: str) -> Fee:
|
|
91
|
+
"""Create an instance of Fee from a JSON string"""
|
|
92
|
+
return cls.from_dict(json.loads(json_str))
|
|
93
|
+
|
|
94
|
+
def to_dict(self):
|
|
95
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
96
|
+
_dict = self.dict(by_alias=True,
|
|
97
|
+
exclude={
|
|
98
|
+
},
|
|
99
|
+
exclude_none=True)
|
|
100
|
+
# override the default output from pydantic by calling `to_dict()` of fee_type
|
|
101
|
+
if self.fee_type:
|
|
102
|
+
_dict['feeType'] = self.fee_type.to_dict()
|
|
103
|
+
# override the default output from pydantic by calling `to_dict()` of anchor_date
|
|
104
|
+
if self.anchor_date:
|
|
105
|
+
_dict['anchorDate'] = self.anchor_date.to_dict()
|
|
106
|
+
# override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
|
|
107
|
+
_field_dict = {}
|
|
108
|
+
if self.properties:
|
|
109
|
+
for _key in self.properties:
|
|
110
|
+
if self.properties[_key]:
|
|
111
|
+
_field_dict[_key] = self.properties[_key].to_dict()
|
|
112
|
+
_dict['properties'] = _field_dict
|
|
113
|
+
# override the default output from pydantic by calling `to_dict()` of version
|
|
114
|
+
if self.version:
|
|
115
|
+
_dict['version'] = self.version.to_dict()
|
|
116
|
+
# override the default output from pydantic by calling `to_dict()` of each item in links (list)
|
|
117
|
+
_items = []
|
|
118
|
+
if self.links:
|
|
119
|
+
for _item in self.links:
|
|
120
|
+
if _item:
|
|
121
|
+
_items.append(_item.to_dict())
|
|
122
|
+
_dict['links'] = _items
|
|
123
|
+
# set to None if href (nullable) is None
|
|
124
|
+
# and __fields_set__ contains the field
|
|
125
|
+
if self.href is None and "href" in self.__fields_set__:
|
|
126
|
+
_dict['href'] = None
|
|
127
|
+
|
|
128
|
+
# set to None if fee_code (nullable) is None
|
|
129
|
+
# and __fields_set__ contains the field
|
|
130
|
+
if self.fee_code is None and "fee_code" in self.__fields_set__:
|
|
131
|
+
_dict['feeCode'] = None
|
|
132
|
+
|
|
133
|
+
# set to None if description (nullable) is None
|
|
134
|
+
# and __fields_set__ contains the field
|
|
135
|
+
if self.description is None and "description" in self.__fields_set__:
|
|
136
|
+
_dict['description'] = None
|
|
137
|
+
|
|
138
|
+
# set to None if origin (nullable) is None
|
|
139
|
+
# and __fields_set__ contains the field
|
|
140
|
+
if self.origin is None and "origin" in self.__fields_set__:
|
|
141
|
+
_dict['origin'] = None
|
|
142
|
+
|
|
143
|
+
# set to None if calculation_base (nullable) is None
|
|
144
|
+
# and __fields_set__ contains the field
|
|
145
|
+
if self.calculation_base is None and "calculation_base" in self.__fields_set__:
|
|
146
|
+
_dict['calculationBase'] = None
|
|
147
|
+
|
|
148
|
+
# set to None if total_annual_accrual_amount (nullable) is None
|
|
149
|
+
# and __fields_set__ contains the field
|
|
150
|
+
if self.total_annual_accrual_amount is None and "total_annual_accrual_amount" in self.__fields_set__:
|
|
151
|
+
_dict['totalAnnualAccrualAmount'] = None
|
|
152
|
+
|
|
153
|
+
# set to None if fee_rate_percentage (nullable) is None
|
|
154
|
+
# and __fields_set__ contains the field
|
|
155
|
+
if self.fee_rate_percentage is None and "fee_rate_percentage" in self.__fields_set__:
|
|
156
|
+
_dict['feeRatePercentage'] = None
|
|
157
|
+
|
|
158
|
+
# set to None if monthly_accrual (nullable) is None
|
|
159
|
+
# and __fields_set__ contains the field
|
|
160
|
+
if self.monthly_accrual is None and "monthly_accrual" in self.__fields_set__:
|
|
161
|
+
_dict['monthlyAccrual'] = None
|
|
162
|
+
|
|
163
|
+
# set to None if daily_accrual (nullable) is None
|
|
164
|
+
# and __fields_set__ contains the field
|
|
165
|
+
if self.daily_accrual is None and "daily_accrual" in self.__fields_set__:
|
|
166
|
+
_dict['dailyAccrual'] = None
|
|
167
|
+
|
|
168
|
+
# set to None if properties (nullable) is None
|
|
169
|
+
# and __fields_set__ contains the field
|
|
170
|
+
if self.properties is None and "properties" in self.__fields_set__:
|
|
171
|
+
_dict['properties'] = None
|
|
172
|
+
|
|
173
|
+
# set to None if links (nullable) is None
|
|
174
|
+
# and __fields_set__ contains the field
|
|
175
|
+
if self.links is None and "links" in self.__fields_set__:
|
|
176
|
+
_dict['links'] = None
|
|
177
|
+
|
|
178
|
+
return _dict
|
|
179
|
+
|
|
180
|
+
@classmethod
|
|
181
|
+
def from_dict(cls, obj: dict) -> Fee:
|
|
182
|
+
"""Create an instance of Fee from a dict"""
|
|
183
|
+
if obj is None:
|
|
184
|
+
return None
|
|
185
|
+
|
|
186
|
+
if not isinstance(obj, dict):
|
|
187
|
+
return Fee.parse_obj(obj)
|
|
188
|
+
|
|
189
|
+
_obj = Fee.parse_obj({
|
|
190
|
+
"href": obj.get("href"),
|
|
191
|
+
"fee_code": obj.get("feeCode"),
|
|
192
|
+
"fee_type": ResourceId.from_dict(obj.get("feeType")) if obj.get("feeType") is not None else None,
|
|
193
|
+
"name": obj.get("name"),
|
|
194
|
+
"description": obj.get("description"),
|
|
195
|
+
"origin": obj.get("origin"),
|
|
196
|
+
"calculation_base": obj.get("calculationBase"),
|
|
197
|
+
"accrual_currency": obj.get("accrualCurrency"),
|
|
198
|
+
"treatment": obj.get("treatment"),
|
|
199
|
+
"total_annual_accrual_amount": obj.get("totalAnnualAccrualAmount"),
|
|
200
|
+
"fee_rate_percentage": obj.get("feeRatePercentage"),
|
|
201
|
+
"monthly_accrual": obj.get("monthlyAccrual"),
|
|
202
|
+
"daily_accrual": obj.get("dailyAccrual"),
|
|
203
|
+
"payable_frequency": obj.get("payableFrequency"),
|
|
204
|
+
"business_day_convention": obj.get("businessDayConvention"),
|
|
205
|
+
"start_date": obj.get("startDate"),
|
|
206
|
+
"end_date": obj.get("endDate"),
|
|
207
|
+
"anchor_date": DayMonth.from_dict(obj.get("anchorDate")) if obj.get("anchorDate") is not None else None,
|
|
208
|
+
"properties": dict(
|
|
209
|
+
(_k, ModelProperty.from_dict(_v))
|
|
210
|
+
for _k, _v in obj.get("properties").items()
|
|
211
|
+
)
|
|
212
|
+
if obj.get("properties") is not None
|
|
213
|
+
else None,
|
|
214
|
+
"version": Version.from_dict(obj.get("version")) if obj.get("version") is not None else None,
|
|
215
|
+
"links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
|
|
216
|
+
})
|
|
217
|
+
return _obj
|
|
@@ -0,0 +1,163 @@
|
|
|
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, Union
|
|
22
|
+
from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt, constr, validator
|
|
23
|
+
from lusid.models.day_month import DayMonth
|
|
24
|
+
from lusid.models.model_property import ModelProperty
|
|
25
|
+
from lusid.models.resource_id import ResourceId
|
|
26
|
+
|
|
27
|
+
class FeeRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
FeeRequest
|
|
30
|
+
"""
|
|
31
|
+
fee_type: ResourceId = Field(..., alias="feeType")
|
|
32
|
+
name: constr(strict=True, max_length=256, min_length=1) = Field(..., description="The name of the Fee.")
|
|
33
|
+
description: Optional[constr(strict=True, max_length=1024, min_length=0)] = Field(None, description="A description for the Fee.")
|
|
34
|
+
origin: Optional[constr(strict=True, max_length=512, min_length=1)] = Field(None, description="The origin or source of the Fee accrual.")
|
|
35
|
+
calculation_base: Optional[constr(strict=True, max_length=1024, min_length=0)] = Field(None, alias="calculationBase", description="The calculation base for the Fee that is calculated using a percentage.")
|
|
36
|
+
accrual_currency: constr(strict=True, max_length=3, min_length=0) = Field(..., alias="accrualCurrency", description="The accrual currency.")
|
|
37
|
+
treatment: constr(strict=True, min_length=1) = Field(..., description="The accrual period of the Fee; 'Monthly' or 'Daily'.")
|
|
38
|
+
total_annual_accrual_amount: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="totalAnnualAccrualAmount", description="The total accrued amount for the Fee.")
|
|
39
|
+
fee_rate_percentage: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="feeRatePercentage", description="The fee rate percentage.")
|
|
40
|
+
payable_frequency: constr(strict=True, min_length=1) = Field(..., alias="payableFrequency", description="The payable frequency for the Fee; 'Annually', 'Quarterly' or 'Monthly'.")
|
|
41
|
+
business_day_convention: constr(strict=True, min_length=1) = Field(..., alias="businessDayConvention", description="The business day convention to use for Fee calculations on weekends.")
|
|
42
|
+
start_date: datetime = Field(..., alias="startDate", description="The start date of the Fee.")
|
|
43
|
+
end_date: Optional[datetime] = Field(None, alias="endDate", description="The end date of the Fee.")
|
|
44
|
+
anchor_date: Optional[DayMonth] = Field(None, alias="anchorDate")
|
|
45
|
+
properties: Optional[Dict[str, ModelProperty]] = Field(None, description="The Fee properties. These will be from the 'Fee' domain.")
|
|
46
|
+
__properties = ["feeType", "name", "description", "origin", "calculationBase", "accrualCurrency", "treatment", "totalAnnualAccrualAmount", "feeRatePercentage", "payableFrequency", "businessDayConvention", "startDate", "endDate", "anchorDate", "properties"]
|
|
47
|
+
|
|
48
|
+
@validator('description')
|
|
49
|
+
def description_validate_regular_expression(cls, value):
|
|
50
|
+
"""Validates the regular expression"""
|
|
51
|
+
if value is None:
|
|
52
|
+
return value
|
|
53
|
+
|
|
54
|
+
if not re.match(r"^[\s\S]*$", value):
|
|
55
|
+
raise ValueError(r"must validate the regular expression /^[\s\S]*$/")
|
|
56
|
+
return value
|
|
57
|
+
|
|
58
|
+
class Config:
|
|
59
|
+
"""Pydantic configuration"""
|
|
60
|
+
allow_population_by_field_name = True
|
|
61
|
+
validate_assignment = True
|
|
62
|
+
|
|
63
|
+
def to_str(self) -> str:
|
|
64
|
+
"""Returns the string representation of the model using alias"""
|
|
65
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
66
|
+
|
|
67
|
+
def to_json(self) -> str:
|
|
68
|
+
"""Returns the JSON representation of the model using alias"""
|
|
69
|
+
return json.dumps(self.to_dict())
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def from_json(cls, json_str: str) -> FeeRequest:
|
|
73
|
+
"""Create an instance of FeeRequest from a JSON string"""
|
|
74
|
+
return cls.from_dict(json.loads(json_str))
|
|
75
|
+
|
|
76
|
+
def to_dict(self):
|
|
77
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
78
|
+
_dict = self.dict(by_alias=True,
|
|
79
|
+
exclude={
|
|
80
|
+
},
|
|
81
|
+
exclude_none=True)
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of fee_type
|
|
83
|
+
if self.fee_type:
|
|
84
|
+
_dict['feeType'] = self.fee_type.to_dict()
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of anchor_date
|
|
86
|
+
if self.anchor_date:
|
|
87
|
+
_dict['anchorDate'] = self.anchor_date.to_dict()
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
|
|
89
|
+
_field_dict = {}
|
|
90
|
+
if self.properties:
|
|
91
|
+
for _key in self.properties:
|
|
92
|
+
if self.properties[_key]:
|
|
93
|
+
_field_dict[_key] = self.properties[_key].to_dict()
|
|
94
|
+
_dict['properties'] = _field_dict
|
|
95
|
+
# set to None if description (nullable) is None
|
|
96
|
+
# and __fields_set__ contains the field
|
|
97
|
+
if self.description is None and "description" in self.__fields_set__:
|
|
98
|
+
_dict['description'] = None
|
|
99
|
+
|
|
100
|
+
# set to None if origin (nullable) is None
|
|
101
|
+
# and __fields_set__ contains the field
|
|
102
|
+
if self.origin is None and "origin" in self.__fields_set__:
|
|
103
|
+
_dict['origin'] = None
|
|
104
|
+
|
|
105
|
+
# set to None if calculation_base (nullable) is None
|
|
106
|
+
# and __fields_set__ contains the field
|
|
107
|
+
if self.calculation_base is None and "calculation_base" in self.__fields_set__:
|
|
108
|
+
_dict['calculationBase'] = None
|
|
109
|
+
|
|
110
|
+
# set to None if total_annual_accrual_amount (nullable) is None
|
|
111
|
+
# and __fields_set__ contains the field
|
|
112
|
+
if self.total_annual_accrual_amount is None and "total_annual_accrual_amount" in self.__fields_set__:
|
|
113
|
+
_dict['totalAnnualAccrualAmount'] = None
|
|
114
|
+
|
|
115
|
+
# set to None if fee_rate_percentage (nullable) is None
|
|
116
|
+
# and __fields_set__ contains the field
|
|
117
|
+
if self.fee_rate_percentage is None and "fee_rate_percentage" in self.__fields_set__:
|
|
118
|
+
_dict['feeRatePercentage'] = None
|
|
119
|
+
|
|
120
|
+
# set to None if end_date (nullable) is None
|
|
121
|
+
# and __fields_set__ contains the field
|
|
122
|
+
if self.end_date is None and "end_date" in self.__fields_set__:
|
|
123
|
+
_dict['endDate'] = None
|
|
124
|
+
|
|
125
|
+
# set to None if properties (nullable) is None
|
|
126
|
+
# and __fields_set__ contains the field
|
|
127
|
+
if self.properties is None and "properties" in self.__fields_set__:
|
|
128
|
+
_dict['properties'] = None
|
|
129
|
+
|
|
130
|
+
return _dict
|
|
131
|
+
|
|
132
|
+
@classmethod
|
|
133
|
+
def from_dict(cls, obj: dict) -> FeeRequest:
|
|
134
|
+
"""Create an instance of FeeRequest from a dict"""
|
|
135
|
+
if obj is None:
|
|
136
|
+
return None
|
|
137
|
+
|
|
138
|
+
if not isinstance(obj, dict):
|
|
139
|
+
return FeeRequest.parse_obj(obj)
|
|
140
|
+
|
|
141
|
+
_obj = FeeRequest.parse_obj({
|
|
142
|
+
"fee_type": ResourceId.from_dict(obj.get("feeType")) if obj.get("feeType") is not None else None,
|
|
143
|
+
"name": obj.get("name"),
|
|
144
|
+
"description": obj.get("description"),
|
|
145
|
+
"origin": obj.get("origin"),
|
|
146
|
+
"calculation_base": obj.get("calculationBase"),
|
|
147
|
+
"accrual_currency": obj.get("accrualCurrency"),
|
|
148
|
+
"treatment": obj.get("treatment"),
|
|
149
|
+
"total_annual_accrual_amount": obj.get("totalAnnualAccrualAmount"),
|
|
150
|
+
"fee_rate_percentage": obj.get("feeRatePercentage"),
|
|
151
|
+
"payable_frequency": obj.get("payableFrequency"),
|
|
152
|
+
"business_day_convention": obj.get("businessDayConvention"),
|
|
153
|
+
"start_date": obj.get("startDate"),
|
|
154
|
+
"end_date": obj.get("endDate"),
|
|
155
|
+
"anchor_date": DayMonth.from_dict(obj.get("anchorDate")) if obj.get("anchorDate") 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
|
+
})
|
|
163
|
+
return _obj
|