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

Files changed (47) hide show
  1. lusid/__init__.py +40 -0
  2. lusid/api/__init__.py +2 -0
  3. lusid/api/amortisation_rule_sets_api.py +175 -0
  4. lusid/api/compliance_api.py +502 -0
  5. lusid/api/fee_types_api.py +909 -0
  6. lusid/api/instrument_events_api.py +189 -0
  7. lusid/api/portfolio_groups_api.py +16 -8
  8. lusid/api/portfolios_api.py +212 -0
  9. lusid/api/transaction_portfolios_api.py +32 -16
  10. lusid/configuration.py +1 -1
  11. lusid/models/__init__.py +38 -0
  12. lusid/models/amortisation_rule_set.py +7 -11
  13. lusid/models/applicable_instrument_event.py +106 -0
  14. lusid/models/compliance_rule_template.py +153 -0
  15. lusid/models/compliance_step_request.py +76 -0
  16. lusid/models/compliance_step_type_request.py +42 -0
  17. lusid/models/compliance_template_variation_dto.py +112 -0
  18. lusid/models/compliance_template_variation_request.py +112 -0
  19. lusid/models/create_compliance_template_request.py +95 -0
  20. lusid/models/create_derived_property_definition_request.py +3 -3
  21. lusid/models/create_property_definition_request.py +3 -3
  22. lusid/models/diary_entry_request.py +1 -1
  23. lusid/models/fee_accrual.py +83 -0
  24. lusid/models/fee_type.py +115 -0
  25. lusid/models/fee_type_request.py +105 -0
  26. lusid/models/flow_conventions.py +1 -1
  27. lusid/models/operation.py +2 -2
  28. lusid/models/paged_resource_list_of_fee_type.py +113 -0
  29. lusid/models/paged_resource_list_of_instrument_event_instruction.py +113 -0
  30. lusid/models/portfolio_entity_id.py +2 -18
  31. lusid/models/portfolio_holding.py +19 -4
  32. lusid/models/property_definition.py +3 -3
  33. lusid/models/property_definition_search_result.py +3 -3
  34. lusid/models/property_domain.py +1 -0
  35. lusid/models/query_applicable_instrument_events_request.py +89 -0
  36. lusid/models/quote_access_metadata_rule_id.py +1 -1
  37. lusid/models/quote_series_id.py +1 -1
  38. lusid/models/resource_list_of_applicable_instrument_event.py +113 -0
  39. lusid/models/rules_interval.py +83 -0
  40. lusid/models/set_amortisation_rules_request.py +73 -0
  41. lusid/models/settlement_schedule.py +78 -0
  42. lusid/models/update_compliance_template_request.py +95 -0
  43. lusid/models/update_fee_type_request.py +96 -0
  44. lusid/models/valuation_point_data_response.py +15 -2
  45. {lusid_sdk-2.1.110.dist-info → lusid_sdk-2.1.131.dist-info}/METADATA +34 -4
  46. {lusid_sdk-2.1.110.dist-info → lusid_sdk-2.1.131.dist-info}/RECORD +47 -27
  47. {lusid_sdk-2.1.110.dist-info → lusid_sdk-2.1.131.dist-info}/WHEEL +0 -0
@@ -0,0 +1,83 @@
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, Union
22
+ from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt, StrictStr
23
+
24
+ class FeeAccrual(BaseModel):
25
+ """
26
+ FeeAccrual
27
+ """
28
+ name: Optional[StrictStr] = None
29
+ calculation_base: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="calculationBase")
30
+ amount: Optional[Union[StrictFloat, StrictInt]] = None
31
+ previous_accrual: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="previousAccrual")
32
+ total_accrual: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="totalAccrual")
33
+ __properties = ["name", "calculationBase", "amount", "previousAccrual", "totalAccrual"]
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) -> FeeAccrual:
50
+ """Create an instance of FeeAccrual 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
+ "total_accrual",
58
+ },
59
+ exclude_none=True)
60
+ # set to None if name (nullable) is None
61
+ # and __fields_set__ contains the field
62
+ if self.name is None and "name" in self.__fields_set__:
63
+ _dict['name'] = None
64
+
65
+ return _dict
66
+
67
+ @classmethod
68
+ def from_dict(cls, obj: dict) -> FeeAccrual:
69
+ """Create an instance of FeeAccrual from a dict"""
70
+ if obj is None:
71
+ return None
72
+
73
+ if not isinstance(obj, dict):
74
+ return FeeAccrual.parse_obj(obj)
75
+
76
+ _obj = FeeAccrual.parse_obj({
77
+ "name": obj.get("name"),
78
+ "calculation_base": obj.get("calculationBase"),
79
+ "amount": obj.get("amount"),
80
+ "previous_accrual": obj.get("previousAccrual"),
81
+ "total_accrual": obj.get("totalAccrual")
82
+ })
83
+ return _obj
@@ -0,0 +1,115 @@
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, constr
23
+ from lusid.models.component_transaction import ComponentTransaction
24
+ from lusid.models.link import Link
25
+ from lusid.models.resource_id import ResourceId
26
+ from lusid.models.version import Version
27
+
28
+ class FeeType(BaseModel):
29
+ """
30
+ FeeType
31
+ """
32
+ href: Optional[StrictStr] = Field(None, description="The specific Uniform Resource Identifier (URI) for this resource at the requested effective and asAt datetime.")
33
+ id: ResourceId = Field(...)
34
+ name: constr(strict=True, min_length=1) = Field(..., description="The name of the fee type.")
35
+ description: constr(strict=True, min_length=1) = Field(..., description="The description of the fee type.")
36
+ component_transactions: conlist(ComponentTransaction) = Field(..., alias="componentTransactions", description="A set of component transactions that relate to the fee type.")
37
+ version: Optional[Version] = None
38
+ links: Optional[conlist(Link)] = None
39
+ __properties = ["href", "id", "name", "description", "componentTransactions", "version", "links"]
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) -> FeeType:
56
+ """Create an instance of FeeType from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self):
60
+ """Returns the dictionary representation of the model using alias"""
61
+ _dict = self.dict(by_alias=True,
62
+ exclude={
63
+ },
64
+ exclude_none=True)
65
+ # override the default output from pydantic by calling `to_dict()` of id
66
+ if self.id:
67
+ _dict['id'] = self.id.to_dict()
68
+ # override the default output from pydantic by calling `to_dict()` of each item in component_transactions (list)
69
+ _items = []
70
+ if self.component_transactions:
71
+ for _item in self.component_transactions:
72
+ if _item:
73
+ _items.append(_item.to_dict())
74
+ _dict['componentTransactions'] = _items
75
+ # override the default output from pydantic by calling `to_dict()` of version
76
+ if self.version:
77
+ _dict['version'] = self.version.to_dict()
78
+ # override the default output from pydantic by calling `to_dict()` of each item in links (list)
79
+ _items = []
80
+ if self.links:
81
+ for _item in self.links:
82
+ if _item:
83
+ _items.append(_item.to_dict())
84
+ _dict['links'] = _items
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) -> FeeType:
99
+ """Create an instance of FeeType from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return FeeType.parse_obj(obj)
105
+
106
+ _obj = FeeType.parse_obj({
107
+ "href": obj.get("href"),
108
+ "id": ResourceId.from_dict(obj.get("id")) if obj.get("id") is not None else None,
109
+ "name": obj.get("name"),
110
+ "description": obj.get("description"),
111
+ "component_transactions": [ComponentTransaction.from_dict(_item) for _item in obj.get("componentTransactions")] if obj.get("componentTransactions") is not None else None,
112
+ "version": Version.from_dict(obj.get("version")) if obj.get("version") is not None else None,
113
+ "links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
114
+ })
115
+ 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, List, Optional
22
+ from pydantic.v1 import BaseModel, Field, conlist, constr, validator
23
+ from lusid.models.component_transaction import ComponentTransaction
24
+
25
+ class FeeTypeRequest(BaseModel):
26
+ """
27
+ FeeTypeRequest
28
+ """
29
+ code: constr(strict=True, max_length=64, min_length=1) = Field(...)
30
+ name: constr(strict=True, max_length=256, min_length=1) = Field(..., description="The name of the fee type.")
31
+ description: Optional[constr(strict=True, max_length=1024, min_length=0)] = Field(None, description="The description of the fee type.")
32
+ component_transactions: conlist(ComponentTransaction, max_items=1000) = Field(..., alias="componentTransactions", description="A set of component transactions that relate to the fee type to be created.")
33
+ __properties = ["code", "name", "description", "componentTransactions"]
34
+
35
+ @validator('code')
36
+ def code_validate_regular_expression(cls, value):
37
+ """Validates the regular expression"""
38
+ if not re.match(r"^[a-zA-Z0-9\-_]+$", value):
39
+ raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9\-_]+$/")
40
+ return value
41
+
42
+ @validator('description')
43
+ def description_validate_regular_expression(cls, value):
44
+ """Validates the regular expression"""
45
+ if value is None:
46
+ return value
47
+
48
+ if not re.match(r"^[\s\S]*$", value):
49
+ raise ValueError(r"must validate the regular expression /^[\s\S]*$/")
50
+ return value
51
+
52
+ class Config:
53
+ """Pydantic configuration"""
54
+ allow_population_by_field_name = True
55
+ validate_assignment = True
56
+
57
+ def to_str(self) -> str:
58
+ """Returns the string representation of the model using alias"""
59
+ return pprint.pformat(self.dict(by_alias=True))
60
+
61
+ def to_json(self) -> str:
62
+ """Returns the JSON representation of the model using alias"""
63
+ return json.dumps(self.to_dict())
64
+
65
+ @classmethod
66
+ def from_json(cls, json_str: str) -> FeeTypeRequest:
67
+ """Create an instance of FeeTypeRequest from a JSON string"""
68
+ return cls.from_dict(json.loads(json_str))
69
+
70
+ def to_dict(self):
71
+ """Returns the dictionary representation of the model using alias"""
72
+ _dict = self.dict(by_alias=True,
73
+ exclude={
74
+ },
75
+ exclude_none=True)
76
+ # override the default output from pydantic by calling `to_dict()` of each item in component_transactions (list)
77
+ _items = []
78
+ if self.component_transactions:
79
+ for _item in self.component_transactions:
80
+ if _item:
81
+ _items.append(_item.to_dict())
82
+ _dict['componentTransactions'] = _items
83
+ # set to None if description (nullable) is None
84
+ # and __fields_set__ contains the field
85
+ if self.description is None and "description" in self.__fields_set__:
86
+ _dict['description'] = None
87
+
88
+ return _dict
89
+
90
+ @classmethod
91
+ def from_dict(cls, obj: dict) -> FeeTypeRequest:
92
+ """Create an instance of FeeTypeRequest from a dict"""
93
+ if obj is None:
94
+ return None
95
+
96
+ if not isinstance(obj, dict):
97
+ return FeeTypeRequest.parse_obj(obj)
98
+
99
+ _obj = FeeTypeRequest.parse_obj({
100
+ "code": obj.get("code"),
101
+ "name": obj.get("name"),
102
+ "description": obj.get("description"),
103
+ "component_transactions": [ComponentTransaction.from_dict(_item) for _item in obj.get("componentTransactions")] if obj.get("componentTransactions") is not None else None
104
+ })
105
+ return _obj
@@ -28,7 +28,7 @@ class FlowConventions(BaseModel):
28
28
  currency: StrictStr = Field(..., description="Currency of the flow convention.")
29
29
  payment_frequency: constr(strict=True, max_length=50, min_length=0) = Field(..., alias="paymentFrequency", description="When generating a multiperiod flow, or when the maturity of the flow is not given but the start date is, the tenor is the time-step from the anchor-date to the nominal maturity of the flow prior to any adjustment. For more information on tenors, see [knowledge base article KA-02097](https://support.lusid.com/knowledgebase/article/KA-02097)")
30
30
  day_count_convention: constr(strict=True, max_length=50, min_length=0) = Field(..., alias="dayCountConvention", description="when calculating the fraction of a year between two dates, what convention is used to represent the number of days in a year and difference between them. For more information on day counts, see [knowledge base article KA-01798](https://support.lusid.com/knowledgebase/article/KA-01798) Supported string (enumeration) values are: [Actual360, Act360, MoneyMarket, Actual365, Act365, Thirty360, ThirtyU360, Bond, ThirtyE360, EuroBond, ActualActual, ActAct, ActActIsda, ActActIsma, ActActIcma, OneOne, Act364, Act365F, Act365L, Act365_25, Act252, Bus252, NL360, NL365, ActActAFB, Act365Cad, ThirtyActIsda, Thirty365Isda, ThirtyEActIsda, ThirtyE360Isda, ThirtyE365Isda, ThirtyU360EOM].")
31
- roll_convention: constr(strict=True, max_length=50, min_length=0) = Field(..., alias="rollConvention", description="For backward compatibility, this can either specify a business day convention or a roll convention. If the business day convention is provided using the BusinessDayConvention property, this must be a valid roll convention. When used as a roll convention: The conventions specifying the rule used to generate dates in a schedule. Supported string (enumeration) values are: [None, EndOfMonth, IMM, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]. When in backward compatible mode: Supported string (enumeration) values are: [NoAdjustment, None, Previous, P, Following, F, ModifiedPrevious, MP, ModifiedFollowing, MF, HalfMonthModifiedFollowing].")
31
+ roll_convention: constr(strict=True, max_length=50, min_length=0) = Field(..., alias="rollConvention", description="For backward compatibility, this can either specify a business day convention or a roll convention. If the business day convention is provided using the BusinessDayConvention property, this must be a valid roll convention. When used as a roll convention: The conventions specifying the rule used to generate dates in a schedule. Supported string (enumeration) values are: [None, EndOfMonth, IMM, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, FirstMonday, FirstWednesday, FirstThursday, ThirdWednesday]. When in backward compatible mode: Supported string (enumeration) values are: [NoAdjustment, None, Previous, P, Following, F, ModifiedPrevious, MP, ModifiedFollowing, MF, HalfMonthModifiedFollowing].")
32
32
  payment_calendars: conlist(StrictStr) = Field(..., alias="paymentCalendars", description="An array of strings denoting holiday calendars that apply to generation of payment schedules.")
33
33
  reset_calendars: conlist(StrictStr) = Field(..., alias="resetCalendars", description="An array of strings denoting holiday calendars that apply to generation of reset schedules.")
34
34
  settle_days: Optional[StrictInt] = Field(None, alias="settleDays", description="DEPRECATED Number of Good Business Days between the trade date and the effective or settlement date of the instrument. This field is now deprecated and not picked up in schedule generation or adjustment to bond accrual start date. Defaulted to 0 if not set.")
lusid/models/operation.py CHANGED
@@ -19,14 +19,14 @@ import json
19
19
 
20
20
 
21
21
  from typing import Any, Dict, Optional
22
- from pydantic.v1 import BaseModel, Field, constr
22
+ from pydantic.v1 import BaseModel, Field, StrictStr, constr
23
23
 
24
24
  class Operation(BaseModel):
25
25
  """
26
26
  Operation
27
27
  """
28
28
  value: Optional[Any] = None
29
- path: constr(strict=True, max_length=6000, min_length=0) = Field(...)
29
+ path: StrictStr = Field(...)
30
30
  op: constr(strict=True, min_length=1) = Field(...)
31
31
  var_from: Optional[constr(strict=True, max_length=6000, min_length=0)] = Field(None, alias="from")
32
32
  __properties = ["value", "path", "op", "from"]
@@ -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.fee_type import FeeType
24
+ from lusid.models.link import Link
25
+
26
+ class PagedResourceListOfFeeType(BaseModel):
27
+ """
28
+ PagedResourceListOfFeeType
29
+ """
30
+ next_page: Optional[StrictStr] = Field(None, alias="nextPage")
31
+ previous_page: Optional[StrictStr] = Field(None, alias="previousPage")
32
+ values: conlist(FeeType) = 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) -> PagedResourceListOfFeeType:
52
+ """Create an instance of PagedResourceListOfFeeType 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) -> PagedResourceListOfFeeType:
99
+ """Create an instance of PagedResourceListOfFeeType from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return PagedResourceListOfFeeType.parse_obj(obj)
105
+
106
+ _obj = PagedResourceListOfFeeType.parse_obj({
107
+ "next_page": obj.get("nextPage"),
108
+ "previous_page": obj.get("previousPage"),
109
+ "values": [FeeType.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.instrument_event_instruction import InstrumentEventInstruction
24
+ from lusid.models.link import Link
25
+
26
+ class PagedResourceListOfInstrumentEventInstruction(BaseModel):
27
+ """
28
+ PagedResourceListOfInstrumentEventInstruction
29
+ """
30
+ next_page: Optional[StrictStr] = Field(None, alias="nextPage")
31
+ previous_page: Optional[StrictStr] = Field(None, alias="previousPage")
32
+ values: conlist(InstrumentEventInstruction) = 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) -> PagedResourceListOfInstrumentEventInstruction:
52
+ """Create an instance of PagedResourceListOfInstrumentEventInstruction 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) -> PagedResourceListOfInstrumentEventInstruction:
99
+ """Create an instance of PagedResourceListOfInstrumentEventInstruction from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return PagedResourceListOfInstrumentEventInstruction.parse_obj(obj)
105
+
106
+ _obj = PagedResourceListOfInstrumentEventInstruction.parse_obj({
107
+ "next_page": obj.get("nextPage"),
108
+ "previous_page": obj.get("previousPage"),
109
+ "values": [InstrumentEventInstruction.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
@@ -25,17 +25,14 @@ class PortfolioEntityId(BaseModel):
25
25
  """
26
26
  Specification of a portfolio or portfolio group id, its scope and which it is. # noqa: E501
27
27
  """
28
- scope: Optional[constr(strict=True, max_length=256, min_length=1)] = Field(None, description="The scope within which the portfolio or portfolio group lives.")
29
- code: Optional[constr(strict=True, max_length=256, min_length=1)] = Field(None, description="Portfolio name or code.")
28
+ scope: constr(strict=True, max_length=256, min_length=1) = Field(..., description="The scope within which the portfolio or portfolio group lives.")
29
+ code: constr(strict=True, max_length=256, min_length=1) = Field(..., description="Portfolio name or code.")
30
30
  portfolio_entity_type: Optional[constr(strict=True, max_length=128, min_length=0)] = Field(None, alias="portfolioEntityType", description="String identifier for portfolio e.g. \"SinglePortfolio\" and \"GroupPortfolio\". If not specified, it is assumed to be a single portfolio.")
31
31
  __properties = ["scope", "code", "portfolioEntityType"]
32
32
 
33
33
  @validator('scope')
34
34
  def scope_validate_regular_expression(cls, value):
35
35
  """Validates the regular expression"""
36
- if value is None:
37
- return value
38
-
39
36
  if not re.match(r"^[a-zA-Z0-9\-_]+$", value):
40
37
  raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9\-_]+$/")
41
38
  return value
@@ -43,9 +40,6 @@ class PortfolioEntityId(BaseModel):
43
40
  @validator('code')
44
41
  def code_validate_regular_expression(cls, value):
45
42
  """Validates the regular expression"""
46
- if value is None:
47
- return value
48
-
49
43
  if not re.match(r"^[a-zA-Z0-9\-_]+$", value):
50
44
  raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9\-_]+$/")
51
45
  return value
@@ -74,16 +68,6 @@ class PortfolioEntityId(BaseModel):
74
68
  exclude={
75
69
  },
76
70
  exclude_none=True)
77
- # set to None if scope (nullable) is None
78
- # and __fields_set__ contains the field
79
- if self.scope is None and "scope" in self.__fields_set__:
80
- _dict['scope'] = None
81
-
82
- # set to None if code (nullable) is None
83
- # and __fields_set__ contains the field
84
- if self.code is None and "code" in self.__fields_set__:
85
- _dict['code'] = None
86
-
87
71
  # set to None if portfolio_entity_type (nullable) is None
88
72
  # and __fields_set__ contains the field
89
73
  if self.portfolio_entity_type is None and "portfolio_entity_type" in self.__fields_set__:
@@ -18,11 +18,12 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
 
21
- from typing import Any, Dict, Optional, Union
22
- from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr
21
+ from typing import Any, Dict, List, Optional, Union
22
+ from pydantic.v1 import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist, constr
23
23
  from lusid.models.currency_and_amount import CurrencyAndAmount
24
24
  from lusid.models.model_property import ModelProperty
25
25
  from lusid.models.perpetual_property import PerpetualProperty
26
+ from lusid.models.settlement_schedule import SettlementSchedule
26
27
  from lusid.models.transaction import Transaction
27
28
 
28
29
  class PortfolioHolding(BaseModel):
@@ -47,7 +48,8 @@ class PortfolioHolding(BaseModel):
47
48
  amortised_cost_portfolio_ccy: Optional[CurrencyAndAmount] = Field(None, alias="amortisedCostPortfolioCcy")
48
49
  variation_margin: Optional[CurrencyAndAmount] = Field(None, alias="variationMargin")
49
50
  variation_margin_portfolio_ccy: Optional[CurrencyAndAmount] = Field(None, alias="variationMarginPortfolioCcy")
50
- __properties = ["instrumentScope", "instrumentUid", "subHoldingKeys", "properties", "holdingType", "units", "settledUnits", "cost", "costPortfolioCcy", "transaction", "currency", "holdingTypeName", "holdingId", "notionalCost", "amortisedCost", "amortisedCostPortfolioCcy", "variationMargin", "variationMarginPortfolioCcy"]
51
+ settlement_schedule: Optional[conlist(SettlementSchedule)] = Field(None, alias="settlementSchedule", description="Where no. of days ahead has been specified, future dated settlements will be captured here.")
52
+ __properties = ["instrumentScope", "instrumentUid", "subHoldingKeys", "properties", "holdingType", "units", "settledUnits", "cost", "costPortfolioCcy", "transaction", "currency", "holdingTypeName", "holdingId", "notionalCost", "amortisedCost", "amortisedCostPortfolioCcy", "variationMargin", "variationMarginPortfolioCcy", "settlementSchedule"]
51
53
 
52
54
  class Config:
53
55
  """Pydantic configuration"""
@@ -111,6 +113,13 @@ class PortfolioHolding(BaseModel):
111
113
  # override the default output from pydantic by calling `to_dict()` of variation_margin_portfolio_ccy
112
114
  if self.variation_margin_portfolio_ccy:
113
115
  _dict['variationMarginPortfolioCcy'] = self.variation_margin_portfolio_ccy.to_dict()
116
+ # override the default output from pydantic by calling `to_dict()` of each item in settlement_schedule (list)
117
+ _items = []
118
+ if self.settlement_schedule:
119
+ for _item in self.settlement_schedule:
120
+ if _item:
121
+ _items.append(_item.to_dict())
122
+ _dict['settlementSchedule'] = _items
114
123
  # set to None if instrument_scope (nullable) is None
115
124
  # and __fields_set__ contains the field
116
125
  if self.instrument_scope is None and "instrument_scope" in self.__fields_set__:
@@ -141,6 +150,11 @@ class PortfolioHolding(BaseModel):
141
150
  if self.holding_id is None and "holding_id" in self.__fields_set__:
142
151
  _dict['holdingId'] = None
143
152
 
153
+ # set to None if settlement_schedule (nullable) is None
154
+ # and __fields_set__ contains the field
155
+ if self.settlement_schedule is None and "settlement_schedule" in self.__fields_set__:
156
+ _dict['settlementSchedule'] = None
157
+
144
158
  return _dict
145
159
 
146
160
  @classmethod
@@ -180,6 +194,7 @@ class PortfolioHolding(BaseModel):
180
194
  "amortised_cost": CurrencyAndAmount.from_dict(obj.get("amortisedCost")) if obj.get("amortisedCost") is not None else None,
181
195
  "amortised_cost_portfolio_ccy": CurrencyAndAmount.from_dict(obj.get("amortisedCostPortfolioCcy")) if obj.get("amortisedCostPortfolioCcy") is not None else None,
182
196
  "variation_margin": CurrencyAndAmount.from_dict(obj.get("variationMargin")) if obj.get("variationMargin") is not None else None,
183
- "variation_margin_portfolio_ccy": CurrencyAndAmount.from_dict(obj.get("variationMarginPortfolioCcy")) if obj.get("variationMarginPortfolioCcy") is not None else None
197
+ "variation_margin_portfolio_ccy": CurrencyAndAmount.from_dict(obj.get("variationMarginPortfolioCcy")) if obj.get("variationMarginPortfolioCcy") is not None else None,
198
+ "settlement_schedule": [SettlementSchedule.from_dict(_item) for _item in obj.get("settlementSchedule")] if obj.get("settlementSchedule") is not None else None
184
199
  })
185
200
  return _obj