lusid-sdk 2.1.76__py3-none-any.whl → 2.1.79__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 CHANGED
@@ -656,6 +656,7 @@ from lusid.models.portfolio import Portfolio
656
656
  from lusid.models.portfolio_cash_flow import PortfolioCashFlow
657
657
  from lusid.models.portfolio_cash_ladder import PortfolioCashLadder
658
658
  from lusid.models.portfolio_details import PortfolioDetails
659
+ from lusid.models.portfolio_entity import PortfolioEntity
659
660
  from lusid.models.portfolio_entity_id import PortfolioEntityId
660
661
  from lusid.models.portfolio_group import PortfolioGroup
661
662
  from lusid.models.portfolio_group_id_compliance_parameter import PortfolioGroupIdComplianceParameter
@@ -674,6 +675,7 @@ from lusid.models.portfolio_return_breakdown import PortfolioReturnBreakdown
674
675
  from lusid.models.portfolio_search_result import PortfolioSearchResult
675
676
  from lusid.models.portfolio_trade_ticket import PortfolioTradeTicket
676
677
  from lusid.models.portfolio_type import PortfolioType
678
+ from lusid.models.portfolio_without_href import PortfolioWithoutHref
677
679
  from lusid.models.portfolios_reconciliation_request import PortfoliosReconciliationRequest
678
680
  from lusid.models.posting_module_details import PostingModuleDetails
679
681
  from lusid.models.posting_module_request import PostingModuleRequest
@@ -1671,6 +1673,7 @@ __all__ = [
1671
1673
  "PortfolioCashFlow",
1672
1674
  "PortfolioCashLadder",
1673
1675
  "PortfolioDetails",
1676
+ "PortfolioEntity",
1674
1677
  "PortfolioEntityId",
1675
1678
  "PortfolioGroup",
1676
1679
  "PortfolioGroupIdComplianceParameter",
@@ -1689,6 +1692,7 @@ __all__ = [
1689
1692
  "PortfolioSearchResult",
1690
1693
  "PortfolioTradeTicket",
1691
1694
  "PortfolioType",
1695
+ "PortfolioWithoutHref",
1692
1696
  "PortfoliosReconciliationRequest",
1693
1697
  "PostingModuleDetails",
1694
1698
  "PostingModuleRequest",
lusid/api/entities_api.py CHANGED
@@ -22,10 +22,11 @@ from typing import overload, Optional, Union, Awaitable
22
22
  from typing_extensions import Annotated
23
23
  from datetime import datetime
24
24
 
25
- from pydantic.v1 import Field, constr, validator
25
+ from pydantic.v1 import Field, StrictStr, constr, validator
26
26
 
27
27
  from typing import Optional
28
28
 
29
+ from lusid.models.portfolio_entity import PortfolioEntity
29
30
  from lusid.models.resource_list_of_change import ResourceListOfChange
30
31
 
31
32
  from lusid.api_client import ApiClient
@@ -48,6 +49,176 @@ class EntitiesApi:
48
49
  api_client = ApiClient.get_default()
49
50
  self.api_client = api_client
50
51
 
52
+ @overload
53
+ async def get_portfolio_by_entity_unique_id(self, entity_unique_id : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The universally unique identifier of the portfolio definition.")], effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which to retrieve the portfolio definition. Defaults to the current LUSID system datetime if not specified.")] = None, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the portfolio definition. Defaults to returning the latest version of the portfolio definition if not specified.")] = None, **kwargs) -> PortfolioEntity: # noqa: E501
54
+ ...
55
+
56
+ @overload
57
+ def get_portfolio_by_entity_unique_id(self, entity_unique_id : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The universally unique identifier of the portfolio definition.")], effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which to retrieve the portfolio definition. Defaults to the current LUSID system datetime if not specified.")] = None, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the portfolio definition. Defaults to returning the latest version of the portfolio definition if not specified.")] = None, async_req: Optional[bool]=True, **kwargs) -> PortfolioEntity: # noqa: E501
58
+ ...
59
+
60
+ @validate_arguments
61
+ def get_portfolio_by_entity_unique_id(self, entity_unique_id : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The universally unique identifier of the portfolio definition.")], effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which to retrieve the portfolio definition. Defaults to the current LUSID system datetime if not specified.")] = None, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the portfolio definition. Defaults to returning the latest version of the portfolio definition if not specified.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[PortfolioEntity, Awaitable[PortfolioEntity]]: # noqa: E501
62
+ """[EXPERIMENTAL] GetPortfolioByEntityUniqueId: Get portfolio by EntityUniqueId # noqa: E501
63
+
64
+ Retrieve the definition of a particular portfolio. If the portfolio is deleted, this will return the state of the portfolio immediately prior to deletion. # noqa: E501
65
+ This method makes a synchronous HTTP request by default. To make an
66
+ asynchronous HTTP request, please pass async_req=True
67
+
68
+ >>> thread = api.get_portfolio_by_entity_unique_id(entity_unique_id, effective_at, as_at, async_req=True)
69
+ >>> result = thread.get()
70
+
71
+ :param entity_unique_id: The universally unique identifier of the portfolio definition. (required)
72
+ :type entity_unique_id: str
73
+ :param effective_at: The effective datetime or cut label at which to retrieve the portfolio definition. Defaults to the current LUSID system datetime if not specified.
74
+ :type effective_at: str
75
+ :param as_at: The asAt datetime at which to retrieve the portfolio definition. Defaults to returning the latest version of the portfolio definition if not specified.
76
+ :type as_at: datetime
77
+ :param async_req: Whether to execute the request asynchronously.
78
+ :type async_req: bool, optional
79
+ :param _request_timeout: timeout setting for this request.
80
+ If one number provided, it will be total request
81
+ timeout. It can also be a pair (tuple) of
82
+ (connection, read) timeouts.
83
+ :return: Returns the result object.
84
+ If the method is called asynchronously,
85
+ returns the request thread.
86
+ :rtype: PortfolioEntity
87
+ """
88
+ kwargs['_return_http_data_only'] = True
89
+ if '_preload_content' in kwargs:
90
+ message = "Error! Please call the get_portfolio_by_entity_unique_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
91
+ raise ValueError(message)
92
+ if async_req is not None:
93
+ kwargs['async_req'] = async_req
94
+ return self.get_portfolio_by_entity_unique_id_with_http_info(entity_unique_id, effective_at, as_at, **kwargs) # noqa: E501
95
+
96
+ @validate_arguments
97
+ def get_portfolio_by_entity_unique_id_with_http_info(self, entity_unique_id : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The universally unique identifier of the portfolio definition.")], effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which to retrieve the portfolio definition. Defaults to the current LUSID system datetime if not specified.")] = None, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the portfolio definition. Defaults to returning the latest version of the portfolio definition if not specified.")] = None, **kwargs) -> ApiResponse: # noqa: E501
98
+ """[EXPERIMENTAL] GetPortfolioByEntityUniqueId: Get portfolio by EntityUniqueId # noqa: E501
99
+
100
+ Retrieve the definition of a particular portfolio. If the portfolio is deleted, this will return the state of the portfolio immediately prior to deletion. # noqa: E501
101
+ This method makes a synchronous HTTP request by default. To make an
102
+ asynchronous HTTP request, please pass async_req=True
103
+
104
+ >>> thread = api.get_portfolio_by_entity_unique_id_with_http_info(entity_unique_id, effective_at, as_at, async_req=True)
105
+ >>> result = thread.get()
106
+
107
+ :param entity_unique_id: The universally unique identifier of the portfolio definition. (required)
108
+ :type entity_unique_id: str
109
+ :param effective_at: The effective datetime or cut label at which to retrieve the portfolio definition. Defaults to the current LUSID system datetime if not specified.
110
+ :type effective_at: str
111
+ :param as_at: The asAt datetime at which to retrieve the portfolio definition. Defaults to returning the latest version of the portfolio definition if not specified.
112
+ :type as_at: datetime
113
+ :param async_req: Whether to execute the request asynchronously.
114
+ :type async_req: bool, optional
115
+ :param _preload_content: if False, the ApiResponse.data will
116
+ be set to none and raw_data will store the
117
+ HTTP response body without reading/decoding.
118
+ Default is True.
119
+ :type _preload_content: bool, optional
120
+ :param _return_http_data_only: response data instead of ApiResponse
121
+ object with status code, headers, etc
122
+ :type _return_http_data_only: bool, optional
123
+ :param _request_timeout: timeout setting for this request. If one
124
+ number provided, it will be total request
125
+ timeout. It can also be a pair (tuple) of
126
+ (connection, read) timeouts.
127
+ :param _request_auth: set to override the auth_settings for an a single
128
+ request; this effectively ignores the authentication
129
+ in the spec for a single request.
130
+ :type _request_auth: dict, optional
131
+ :type _content_type: string, optional: force content-type for the request
132
+ :return: Returns the result object.
133
+ If the method is called asynchronously,
134
+ returns the request thread.
135
+ :rtype: tuple(PortfolioEntity, status_code(int), headers(HTTPHeaderDict))
136
+ """
137
+
138
+ _params = locals()
139
+
140
+ _all_params = [
141
+ 'entity_unique_id',
142
+ 'effective_at',
143
+ 'as_at'
144
+ ]
145
+ _all_params.extend(
146
+ [
147
+ 'async_req',
148
+ '_return_http_data_only',
149
+ '_preload_content',
150
+ '_request_timeout',
151
+ '_request_auth',
152
+ '_content_type',
153
+ '_headers'
154
+ ]
155
+ )
156
+
157
+ # validate the arguments
158
+ for _key, _val in _params['kwargs'].items():
159
+ if _key not in _all_params:
160
+ raise ApiTypeError(
161
+ "Got an unexpected keyword argument '%s'"
162
+ " to method get_portfolio_by_entity_unique_id" % _key
163
+ )
164
+ _params[_key] = _val
165
+ del _params['kwargs']
166
+
167
+ _collection_formats = {}
168
+
169
+ # process the path parameters
170
+ _path_params = {}
171
+ if _params['entity_unique_id']:
172
+ _path_params['entityUniqueId'] = _params['entity_unique_id']
173
+
174
+
175
+ # process the query parameters
176
+ _query_params = []
177
+ if _params.get('effective_at') is not None: # noqa: E501
178
+ _query_params.append(('effectiveAt', _params['effective_at']))
179
+
180
+ if _params.get('as_at') is not None: # noqa: E501
181
+ if isinstance(_params['as_at'], datetime):
182
+ _query_params.append(('asAt', _params['as_at'].strftime(self.api_client.configuration.datetime_format)))
183
+ else:
184
+ _query_params.append(('asAt', _params['as_at']))
185
+
186
+ # process the header parameters
187
+ _header_params = dict(_params.get('_headers', {}))
188
+ # process the form parameters
189
+ _form_params = []
190
+ _files = {}
191
+ # process the body parameter
192
+ _body_params = None
193
+ # set the HTTP header `Accept`
194
+ _header_params['Accept'] = self.api_client.select_header_accept(
195
+ ['text/plain', 'application/json', 'text/json']) # noqa: E501
196
+
197
+ # authentication setting
198
+ _auth_settings = ['oauth2'] # noqa: E501
199
+
200
+ _response_types_map = {
201
+ '200': "PortfolioEntity",
202
+ '400': "LusidValidationProblemDetails",
203
+ }
204
+
205
+ return self.api_client.call_api(
206
+ '/api/entities/portfolios/{entityUniqueId}', 'GET',
207
+ _path_params,
208
+ _query_params,
209
+ _header_params,
210
+ body=_body_params,
211
+ post_params=_form_params,
212
+ files=_files,
213
+ response_types_map=_response_types_map,
214
+ auth_settings=_auth_settings,
215
+ async_req=_params.get('async_req'),
216
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
217
+ _preload_content=_params.get('_preload_content', True),
218
+ _request_timeout=_params.get('_request_timeout'),
219
+ collection_formats=_collection_formats,
220
+ _request_auth=_params.get('_request_auth'))
221
+
51
222
  @overload
52
223
  async def get_portfolio_changes(self, scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The scope")], effective_at : Annotated[constr(strict=True, max_length=256, min_length=0), Field(..., description="The effective date of the origin.")], as_at : Annotated[Optional[datetime], Field(description="The as-at date of the origin.")] = None, **kwargs) -> ResourceListOfChange: # noqa: E501
53
224
  ...
lusid/configuration.py CHANGED
@@ -373,7 +373,7 @@ class Configuration:
373
373
  return "Python SDK Debug Report:\n"\
374
374
  "OS: {env}\n"\
375
375
  "Python Version: {pyversion}\n"\
376
- "Version of the API: 0.11.6510\n"\
376
+ "Version of the API: 0.11.6513\n"\
377
377
  "SDK Package Version: {package_version}".\
378
378
  format(env=sys.platform, pyversion=sys.version, package_version=package_version)
379
379
 
lusid/models/__init__.py CHANGED
@@ -580,6 +580,7 @@ from lusid.models.portfolio import Portfolio
580
580
  from lusid.models.portfolio_cash_flow import PortfolioCashFlow
581
581
  from lusid.models.portfolio_cash_ladder import PortfolioCashLadder
582
582
  from lusid.models.portfolio_details import PortfolioDetails
583
+ from lusid.models.portfolio_entity import PortfolioEntity
583
584
  from lusid.models.portfolio_entity_id import PortfolioEntityId
584
585
  from lusid.models.portfolio_group import PortfolioGroup
585
586
  from lusid.models.portfolio_group_id_compliance_parameter import PortfolioGroupIdComplianceParameter
@@ -598,6 +599,7 @@ from lusid.models.portfolio_return_breakdown import PortfolioReturnBreakdown
598
599
  from lusid.models.portfolio_search_result import PortfolioSearchResult
599
600
  from lusid.models.portfolio_trade_ticket import PortfolioTradeTicket
600
601
  from lusid.models.portfolio_type import PortfolioType
602
+ from lusid.models.portfolio_without_href import PortfolioWithoutHref
601
603
  from lusid.models.portfolios_reconciliation_request import PortfoliosReconciliationRequest
602
604
  from lusid.models.posting_module_details import PostingModuleDetails
603
605
  from lusid.models.posting_module_request import PostingModuleRequest
@@ -1521,6 +1523,7 @@ __all__ = [
1521
1523
  "PortfolioCashFlow",
1522
1524
  "PortfolioCashLadder",
1523
1525
  "PortfolioDetails",
1526
+ "PortfolioEntity",
1524
1527
  "PortfolioEntityId",
1525
1528
  "PortfolioGroup",
1526
1529
  "PortfolioGroupIdComplianceParameter",
@@ -1539,6 +1542,7 @@ __all__ = [
1539
1542
  "PortfolioSearchResult",
1540
1543
  "PortfolioTradeTicket",
1541
1544
  "PortfolioType",
1545
+ "PortfolioWithoutHref",
1542
1546
  "PortfoliosReconciliationRequest",
1543
1547
  "PostingModuleDetails",
1544
1548
  "PostingModuleRequest",
@@ -0,0 +1,99 @@
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.link import Link
24
+ from lusid.models.portfolio_without_href import PortfolioWithoutHref
25
+
26
+ class PortfolioEntity(BaseModel):
27
+ """
28
+ A list of portfolios. # noqa: E501
29
+ """
30
+ href: StrictStr = Field(..., description="The specific Uniform Resource Identifier (URI) for this resource at the requested effective and asAt datetime.")
31
+ entity_unique_id: constr(strict=True, min_length=1) = Field(..., alias="entityUniqueId", description="The unique id of the entity")
32
+ status: constr(strict=True, min_length=1) = Field(..., description="The status of the entity at the current time")
33
+ prevailing_portfolio: Optional[PortfolioWithoutHref] = Field(None, alias="prevailingPortfolio")
34
+ deleted_portfolio: Optional[PortfolioWithoutHref] = Field(None, alias="deletedPortfolio")
35
+ links: Optional[conlist(Link)] = None
36
+ __properties = ["href", "entityUniqueId", "status", "prevailingPortfolio", "deletedPortfolio", "links"]
37
+
38
+ class Config:
39
+ """Pydantic configuration"""
40
+ allow_population_by_field_name = True
41
+ validate_assignment = True
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.dict(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> PortfolioEntity:
53
+ """Create an instance of PortfolioEntity from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self):
57
+ """Returns the dictionary representation of the model using alias"""
58
+ _dict = self.dict(by_alias=True,
59
+ exclude={
60
+ },
61
+ exclude_none=True)
62
+ # override the default output from pydantic by calling `to_dict()` of prevailing_portfolio
63
+ if self.prevailing_portfolio:
64
+ _dict['prevailingPortfolio'] = self.prevailing_portfolio.to_dict()
65
+ # override the default output from pydantic by calling `to_dict()` of deleted_portfolio
66
+ if self.deleted_portfolio:
67
+ _dict['deletedPortfolio'] = self.deleted_portfolio.to_dict()
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 links (nullable) is None
76
+ # and __fields_set__ contains the field
77
+ if self.links is None and "links" in self.__fields_set__:
78
+ _dict['links'] = None
79
+
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: dict) -> PortfolioEntity:
84
+ """Create an instance of PortfolioEntity from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return PortfolioEntity.parse_obj(obj)
90
+
91
+ _obj = PortfolioEntity.parse_obj({
92
+ "href": obj.get("href"),
93
+ "entity_unique_id": obj.get("entityUniqueId"),
94
+ "status": obj.get("status"),
95
+ "prevailing_portfolio": PortfolioWithoutHref.from_dict(obj.get("prevailingPortfolio")) if obj.get("prevailingPortfolio") is not None else None,
96
+ "deleted_portfolio": PortfolioWithoutHref.from_dict(obj.get("deletedPortfolio")) if obj.get("deletedPortfolio") is not None else None,
97
+ "links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
98
+ })
99
+ return _obj
@@ -0,0 +1,214 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LUSID API
5
+
6
+ FINBOURNE Technology # noqa: E501
7
+
8
+ Contact: info@finbourne.com
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from typing import Any, Dict, List, Optional
22
+ from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, conlist, constr, validator
23
+ from lusid.models.instrument_event_configuration import InstrumentEventConfiguration
24
+ from lusid.models.link import Link
25
+ from lusid.models.model_property import ModelProperty
26
+ from lusid.models.relationship import Relationship
27
+ from lusid.models.resource_id import ResourceId
28
+ from lusid.models.version import Version
29
+
30
+ class PortfolioWithoutHref(BaseModel):
31
+ """
32
+ A list of portfolios. # noqa: E501
33
+ """
34
+ id: ResourceId = Field(...)
35
+ type: StrictStr = Field(..., description="The type of the portfolio. The available values are: Transaction, Reference, DerivedTransaction")
36
+ display_name: constr(strict=True, min_length=1) = Field(..., alias="displayName", description="The name of the portfolio.")
37
+ description: Optional[StrictStr] = Field(None, description="The long form description of the portfolio.")
38
+ created: datetime = Field(..., description="The effective datetime at which the portfolio was created. No transactions or constituents can be added to the portfolio before this date.")
39
+ parent_portfolio_id: Optional[ResourceId] = Field(None, alias="parentPortfolioId")
40
+ version: Optional[Version] = None
41
+ is_derived: Optional[StrictBool] = Field(None, alias="isDerived", description="Whether or not this is a derived portfolio.")
42
+ base_currency: Optional[StrictStr] = Field(None, alias="baseCurrency", description="The base currency of the portfolio.")
43
+ properties: Optional[Dict[str, ModelProperty]] = Field(None, description="The requested portfolio properties. These will be from the 'Portfolio' domain.")
44
+ relationships: Optional[conlist(Relationship)] = Field(None, description="A set of relationships associated to the portfolio.")
45
+ instrument_scopes: Optional[conlist(StrictStr)] = Field(None, alias="instrumentScopes", description="The instrument scope resolution strategy of this portfolio.")
46
+ accounting_method: Optional[StrictStr] = Field(None, alias="accountingMethod", description=". The available values are: Default, AverageCost, FirstInFirstOut, LastInFirstOut, HighestCostFirst, LowestCostFirst")
47
+ amortisation_method: Optional[StrictStr] = Field(None, alias="amortisationMethod", description="The amortisation method used by the portfolio for the calculation. The available values are: NoAmortisation, StraightLine, EffectiveYield, StraightLineSettlementDate, EffectiveYieldSettlementDate")
48
+ transaction_type_scope: Optional[StrictStr] = Field(None, alias="transactionTypeScope", description="The scope of the transaction types.")
49
+ cash_gain_loss_calculation_date: Optional[StrictStr] = Field(None, alias="cashGainLossCalculationDate", description="The scope of the transaction types.")
50
+ instrument_event_configuration: Optional[InstrumentEventConfiguration] = Field(None, alias="instrumentEventConfiguration")
51
+ amortisation_rule_set_id: Optional[ResourceId] = Field(None, alias="amortisationRuleSetId")
52
+ links: Optional[conlist(Link)] = None
53
+ __properties = ["id", "type", "displayName", "description", "created", "parentPortfolioId", "version", "isDerived", "baseCurrency", "properties", "relationships", "instrumentScopes", "accountingMethod", "amortisationMethod", "transactionTypeScope", "cashGainLossCalculationDate", "instrumentEventConfiguration", "amortisationRuleSetId", "links"]
54
+
55
+ @validator('type')
56
+ def type_validate_enum(cls, value):
57
+ """Validates the enum"""
58
+ if value not in ('Transaction', 'Reference', 'DerivedTransaction'):
59
+ raise ValueError("must be one of enum values ('Transaction', 'Reference', 'DerivedTransaction')")
60
+ return value
61
+
62
+ @validator('accounting_method')
63
+ def accounting_method_validate_enum(cls, value):
64
+ """Validates the enum"""
65
+ if value is None:
66
+ return value
67
+
68
+ if value not in ('Default', 'AverageCost', 'FirstInFirstOut', 'LastInFirstOut', 'HighestCostFirst', 'LowestCostFirst'):
69
+ raise ValueError("must be one of enum values ('Default', 'AverageCost', 'FirstInFirstOut', 'LastInFirstOut', 'HighestCostFirst', 'LowestCostFirst')")
70
+ return value
71
+
72
+ class Config:
73
+ """Pydantic configuration"""
74
+ allow_population_by_field_name = True
75
+ validate_assignment = True
76
+
77
+ def to_str(self) -> str:
78
+ """Returns the string representation of the model using alias"""
79
+ return pprint.pformat(self.dict(by_alias=True))
80
+
81
+ def to_json(self) -> str:
82
+ """Returns the JSON representation of the model using alias"""
83
+ return json.dumps(self.to_dict())
84
+
85
+ @classmethod
86
+ def from_json(cls, json_str: str) -> PortfolioWithoutHref:
87
+ """Create an instance of PortfolioWithoutHref from a JSON string"""
88
+ return cls.from_dict(json.loads(json_str))
89
+
90
+ def to_dict(self):
91
+ """Returns the dictionary representation of the model using alias"""
92
+ _dict = self.dict(by_alias=True,
93
+ exclude={
94
+ },
95
+ exclude_none=True)
96
+ # override the default output from pydantic by calling `to_dict()` of id
97
+ if self.id:
98
+ _dict['id'] = self.id.to_dict()
99
+ # override the default output from pydantic by calling `to_dict()` of parent_portfolio_id
100
+ if self.parent_portfolio_id:
101
+ _dict['parentPortfolioId'] = self.parent_portfolio_id.to_dict()
102
+ # override the default output from pydantic by calling `to_dict()` of version
103
+ if self.version:
104
+ _dict['version'] = self.version.to_dict()
105
+ # override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
106
+ _field_dict = {}
107
+ if self.properties:
108
+ for _key in self.properties:
109
+ if self.properties[_key]:
110
+ _field_dict[_key] = self.properties[_key].to_dict()
111
+ _dict['properties'] = _field_dict
112
+ # override the default output from pydantic by calling `to_dict()` of each item in relationships (list)
113
+ _items = []
114
+ if self.relationships:
115
+ for _item in self.relationships:
116
+ if _item:
117
+ _items.append(_item.to_dict())
118
+ _dict['relationships'] = _items
119
+ # override the default output from pydantic by calling `to_dict()` of instrument_event_configuration
120
+ if self.instrument_event_configuration:
121
+ _dict['instrumentEventConfiguration'] = self.instrument_event_configuration.to_dict()
122
+ # override the default output from pydantic by calling `to_dict()` of amortisation_rule_set_id
123
+ if self.amortisation_rule_set_id:
124
+ _dict['amortisationRuleSetId'] = self.amortisation_rule_set_id.to_dict()
125
+ # override the default output from pydantic by calling `to_dict()` of each item in links (list)
126
+ _items = []
127
+ if self.links:
128
+ for _item in self.links:
129
+ if _item:
130
+ _items.append(_item.to_dict())
131
+ _dict['links'] = _items
132
+ # set to None if description (nullable) is None
133
+ # and __fields_set__ contains the field
134
+ if self.description is None and "description" in self.__fields_set__:
135
+ _dict['description'] = None
136
+
137
+ # set to None if base_currency (nullable) is None
138
+ # and __fields_set__ contains the field
139
+ if self.base_currency is None and "base_currency" in self.__fields_set__:
140
+ _dict['baseCurrency'] = None
141
+
142
+ # set to None if properties (nullable) is None
143
+ # and __fields_set__ contains the field
144
+ if self.properties is None and "properties" in self.__fields_set__:
145
+ _dict['properties'] = None
146
+
147
+ # set to None if relationships (nullable) is None
148
+ # and __fields_set__ contains the field
149
+ if self.relationships is None and "relationships" in self.__fields_set__:
150
+ _dict['relationships'] = None
151
+
152
+ # set to None if instrument_scopes (nullable) is None
153
+ # and __fields_set__ contains the field
154
+ if self.instrument_scopes is None and "instrument_scopes" in self.__fields_set__:
155
+ _dict['instrumentScopes'] = None
156
+
157
+ # set to None if amortisation_method (nullable) is None
158
+ # and __fields_set__ contains the field
159
+ if self.amortisation_method is None and "amortisation_method" in self.__fields_set__:
160
+ _dict['amortisationMethod'] = None
161
+
162
+ # set to None if transaction_type_scope (nullable) is None
163
+ # and __fields_set__ contains the field
164
+ if self.transaction_type_scope is None and "transaction_type_scope" in self.__fields_set__:
165
+ _dict['transactionTypeScope'] = None
166
+
167
+ # set to None if cash_gain_loss_calculation_date (nullable) is None
168
+ # and __fields_set__ contains the field
169
+ if self.cash_gain_loss_calculation_date is None and "cash_gain_loss_calculation_date" in self.__fields_set__:
170
+ _dict['cashGainLossCalculationDate'] = None
171
+
172
+ # set to None if links (nullable) is None
173
+ # and __fields_set__ contains the field
174
+ if self.links is None and "links" in self.__fields_set__:
175
+ _dict['links'] = None
176
+
177
+ return _dict
178
+
179
+ @classmethod
180
+ def from_dict(cls, obj: dict) -> PortfolioWithoutHref:
181
+ """Create an instance of PortfolioWithoutHref from a dict"""
182
+ if obj is None:
183
+ return None
184
+
185
+ if not isinstance(obj, dict):
186
+ return PortfolioWithoutHref.parse_obj(obj)
187
+
188
+ _obj = PortfolioWithoutHref.parse_obj({
189
+ "id": ResourceId.from_dict(obj.get("id")) if obj.get("id") is not None else None,
190
+ "type": obj.get("type"),
191
+ "display_name": obj.get("displayName"),
192
+ "description": obj.get("description"),
193
+ "created": obj.get("created"),
194
+ "parent_portfolio_id": ResourceId.from_dict(obj.get("parentPortfolioId")) if obj.get("parentPortfolioId") is not None else None,
195
+ "version": Version.from_dict(obj.get("version")) if obj.get("version") is not None else None,
196
+ "is_derived": obj.get("isDerived"),
197
+ "base_currency": obj.get("baseCurrency"),
198
+ "properties": dict(
199
+ (_k, ModelProperty.from_dict(_v))
200
+ for _k, _v in obj.get("properties").items()
201
+ )
202
+ if obj.get("properties") is not None
203
+ else None,
204
+ "relationships": [Relationship.from_dict(_item) for _item in obj.get("relationships")] if obj.get("relationships") is not None else None,
205
+ "instrument_scopes": obj.get("instrumentScopes"),
206
+ "accounting_method": obj.get("accountingMethod"),
207
+ "amortisation_method": obj.get("amortisationMethod"),
208
+ "transaction_type_scope": obj.get("transactionTypeScope"),
209
+ "cash_gain_loss_calculation_date": obj.get("cashGainLossCalculationDate"),
210
+ "instrument_event_configuration": InstrumentEventConfiguration.from_dict(obj.get("instrumentEventConfiguration")) if obj.get("instrumentEventConfiguration") is not None else None,
211
+ "amortisation_rule_set_id": ResourceId.from_dict(obj.get("amortisationRuleSetId")) if obj.get("amortisationRuleSetId") is not None else None,
212
+ "links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
213
+ })
214
+ return _obj
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lusid-sdk
3
- Version: 2.1.76
3
+ Version: 2.1.79
4
4
  Summary: LUSID API
5
5
  Home-page: https://github.com/finbourne/lusid-sdk-python
6
6
  License: MIT
@@ -29,8 +29,8 @@ FINBOURNE Technology
29
29
 
30
30
  This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
31
31
 
32
- - API version: 0.11.6510
33
- - Package version: 2.1.76
32
+ - API version: 0.11.6513
33
+ - Package version: 2.1.79
34
34
  - Build package: org.openapitools.codegen.languages.PythonClientCodegen
35
35
  For more information, please visit [https://www.finbourne.com](https://www.finbourne.com)
36
36
 
@@ -388,6 +388,7 @@ Class | Method | HTTP request | Description
388
388
  *DataTypesApi* | [**update_reference_values**](docs/DataTypesApi.md#update_reference_values) | **PUT** /api/datatypes/{scope}/{code}/referencedatavalues | [EARLY ACCESS] UpdateReferenceValues: Update reference data on a data type
389
389
  *DerivedTransactionPortfoliosApi* | [**create_derived_portfolio**](docs/DerivedTransactionPortfoliosApi.md#create_derived_portfolio) | **POST** /api/derivedtransactionportfolios/{scope} | CreateDerivedPortfolio: Create derived portfolio
390
390
  *DerivedTransactionPortfoliosApi* | [**delete_derived_portfolio_details**](docs/DerivedTransactionPortfoliosApi.md#delete_derived_portfolio_details) | **DELETE** /api/derivedtransactionportfolios/{scope}/{code}/details | [EARLY ACCESS] DeleteDerivedPortfolioDetails: Delete derived portfolio details
391
+ *EntitiesApi* | [**get_portfolio_by_entity_unique_id**](docs/EntitiesApi.md#get_portfolio_by_entity_unique_id) | **GET** /api/entities/portfolios/{entityUniqueId} | [EXPERIMENTAL] GetPortfolioByEntityUniqueId: Get portfolio by EntityUniqueId
391
392
  *EntitiesApi* | [**get_portfolio_changes**](docs/EntitiesApi.md#get_portfolio_changes) | **GET** /api/entities/changes/portfolios | [EARLY ACCESS] GetPortfolioChanges: Get the next change to each portfolio in a scope.
392
393
  *ExecutionsApi* | [**delete_execution**](docs/ExecutionsApi.md#delete_execution) | **DELETE** /api/executions/{scope}/{code} | [EARLY ACCESS] DeleteExecution: Delete execution
393
394
  *ExecutionsApi* | [**get_execution**](docs/ExecutionsApi.md#get_execution) | **GET** /api/executions/{scope}/{code} | [EARLY ACCESS] GetExecution: Get Execution
@@ -1286,6 +1287,7 @@ Class | Method | HTTP request | Description
1286
1287
  - [PortfolioCashFlow](docs/PortfolioCashFlow.md)
1287
1288
  - [PortfolioCashLadder](docs/PortfolioCashLadder.md)
1288
1289
  - [PortfolioDetails](docs/PortfolioDetails.md)
1290
+ - [PortfolioEntity](docs/PortfolioEntity.md)
1289
1291
  - [PortfolioEntityId](docs/PortfolioEntityId.md)
1290
1292
  - [PortfolioGroup](docs/PortfolioGroup.md)
1291
1293
  - [PortfolioGroupIdComplianceParameter](docs/PortfolioGroupIdComplianceParameter.md)
@@ -1304,6 +1306,7 @@ Class | Method | HTTP request | Description
1304
1306
  - [PortfolioSearchResult](docs/PortfolioSearchResult.md)
1305
1307
  - [PortfolioTradeTicket](docs/PortfolioTradeTicket.md)
1306
1308
  - [PortfolioType](docs/PortfolioType.md)
1309
+ - [PortfolioWithoutHref](docs/PortfolioWithoutHref.md)
1307
1310
  - [PortfoliosReconciliationRequest](docs/PortfoliosReconciliationRequest.md)
1308
1311
  - [PostingModuleDetails](docs/PostingModuleDetails.md)
1309
1312
  - [PostingModuleRequest](docs/PostingModuleRequest.md)
@@ -1,4 +1,4 @@
1
- lusid/__init__.py,sha256=vyCbMHXsoRh7Jr8FpQE4B5KJe4S4AKnQyNME0VCejUQ,104213
1
+ lusid/__init__.py,sha256=3msvYKjDM372wPD0un3osWkbs7dqchF_oHbV9vtKRPU,104391
2
2
  lusid/api/__init__.py,sha256=jdU3SmYCzfXVHFVThKX_tCGad2-l4-5Qql1cN864mCs,5388
3
3
  lusid/api/abor_api.py,sha256=AvgsHuWE7qRSYJhKveBE2htSjHpqqS0VNJrysAfwME0,159655
4
4
  lusid/api/abor_configuration_api.py,sha256=G2bKPtMYOZ2GhUrg-nPJtCa9XIZdZYK7oafcbJWDMP8,64033
@@ -22,7 +22,7 @@ lusid/api/custom_entity_types_api.py,sha256=fLeAZaJ9Gdkfkr_UVDuqueiIxuN_5ri80dvq
22
22
  lusid/api/cut_label_definitions_api.py,sha256=7sroMqRhrOXdJlHQJ6f4NbqDRwOh7ewfY2yHGopZ7KM,47049
23
23
  lusid/api/data_types_api.py,sha256=OiQL4CRxwWd06DovdcLZbOqPx4AfbwYQ9yXYtaRqWWc,77801
24
24
  lusid/api/derived_transaction_portfolios_api.py,sha256=cKv5mKNmTiuHzWGwupwcSBibj3Ncwv88GiEJSqmAbCY,20227
25
- lusid/api/entities_api.py,sha256=biaI4yyTTSbvQUYyuBtgbyE4X6Yz-_T5BWn4Vvk3GJU,10443
25
+ lusid/api/entities_api.py,sha256=vifw_Rks1x7e2f0gKLfjVe2wQyuxQw8TAKZ3rEgyjRI,21368
26
26
  lusid/api/executions_api.py,sha256=84zjdPPCPB-aBjM5ntqTcEJa_kSqBSqdtqh47b0a_UY,44435
27
27
  lusid/api/funds_api.py,sha256=s2xo4yrQeNs06nvCeDCedD7T2aB-XW8nO-ftAPG4kEk,122388
28
28
  lusid/api/instrument_event_types_api.py,sha256=shwiW-AatQw-mEwD-TS1d8M2AtV62gqvfF3utyIqe0Y,81546
@@ -65,7 +65,7 @@ lusid/api/transaction_portfolios_api.py,sha256=q6AoYasxV3LQDossmM2BdJSo3arh526yU
65
65
  lusid/api/translation_api.py,sha256=xTAaKEW96JTDIZBXCjxSguCa7Gz4oVd5jdObUE2egwo,20092
66
66
  lusid/api_client.py,sha256=dF6l9RAsdxdQjf6Qn4ny6LB-QXlJmsscWiozCvyyBFA,30709
67
67
  lusid/api_response.py,sha256=uCehWdXXDnAO2HAHGKe0SgpQ_mJiGDbcu-BHDF3n_IM,852
68
- lusid/configuration.py,sha256=nbkfC--SdA3Wm9ABWr_lHE3kCdQqDE3Cv3QJYfy-u-w,14404
68
+ lusid/configuration.py,sha256=IcFp9W22OY4G6RZy_a06K6lQSNBSbqfiNJvlJaE25oE,14404
69
69
  lusid/exceptions.py,sha256=HIQwgmQrszLlcVCLaqex8dO0laVuejUyOMz7U2ZWJ6s,5326
70
70
  lusid/extensions/__init__.py,sha256=DeUuQP7yTcklJH7LT-bw9wQhKEggcs1KwQbPbFcOlhw,560
71
71
  lusid/extensions/api_client.py,sha256=Ob06urm4Em3MLzgP_geyeeGsPCkU225msW_1kpIeABM,30567
@@ -78,7 +78,7 @@ lusid/extensions/rest.py,sha256=tjVCu-cRrYcjp-ttB975vebPKtBNyBWaeoAdO3QXG2I,1269
78
78
  lusid/extensions/retry.py,sha256=orBJ1uF1iT1IncjWX1iGHVqsCgTh0SBe9rtiV_sPnwk,11564
79
79
  lusid/extensions/socket_keep_alive.py,sha256=NGlqsv-E25IjJOLGZhXZY6kUdx51nEF8qCQyVdzayRk,1653
80
80
  lusid/extensions/tcp_keep_alive_connector.py,sha256=zaGtUsygRsxB1_4B3x39K3ILwztdhMLDv5bFZV7zmGE,3877
81
- lusid/models/__init__.py,sha256=zUPSjlKQgrwjHQWZq_AjuxxSEM0jG4wsuBNqzr1Hzrs,97868
81
+ lusid/models/__init__.py,sha256=-aka6TFbJLjlDCaSerPsRDBWp1LayHcx2Hh55rh_QLU,98046
82
82
  lusid/models/a2_b_breakdown.py,sha256=Txi12EIQw3mH6NM-25QkOnHSQc3BVAWrP7yl9bZswSY,2947
83
83
  lusid/models/a2_b_category.py,sha256=k6NPAACi0CUjKyhdQac4obQSrPmp2PXD6lkAtCnyEFM,2725
84
84
  lusid/models/a2_b_data_record.py,sha256=zKGS2P4fzNpzdcGJiSIpkY4P3d_jAcawYfyuPCDeQgk,9737
@@ -645,6 +645,7 @@ lusid/models/portfolio.py,sha256=LqGIRKBYS8kQbmmhiz8gzwPLRuRfnQIZjFtuQ-CV-gY,121
645
645
  lusid/models/portfolio_cash_flow.py,sha256=Apnb2tfP3bJrBjhH69OLwiAOvn7lApH791owxr1wC8A,8997
646
646
  lusid/models/portfolio_cash_ladder.py,sha256=cZHdUI-PZuLYXlQDxcA9zCTRPX_cHZy0-qHng9bRggU,5462
647
647
  lusid/models/portfolio_details.py,sha256=NABbe06Xp0cl54_HwYeUsko51op7oFVlMqCENEaQVWs,9198
648
+ lusid/models/portfolio_entity.py,sha256=szi3ONOxWOl4ROODhWpCE6crCZeEBG8TtCHq6ERBl7A,4105
648
649
  lusid/models/portfolio_entity_id.py,sha256=Q6Y2BocHtfoMiSWaJJqoidwPeQeaDtM_A2Qi9ufesXk,3941
649
650
  lusid/models/portfolio_group.py,sha256=pt4ZLAFaXINyx9d8BQ9zZAlj9lIWAzVVWsQpty2PgZA,7106
650
651
  lusid/models/portfolio_group_id_compliance_parameter.py,sha256=EKTEIf0siRNSh4j7CHdl_QOgsDPBMKff3KJ6DP8rX7I,5521
@@ -663,6 +664,7 @@ lusid/models/portfolio_return_breakdown.py,sha256=PGCCidYWkdSSzNJmZeZIEuYQBgozeF
663
664
  lusid/models/portfolio_search_result.py,sha256=xMxRykRsaUoDbwtk7oFYqJeGeTEpR1BaZ8sw-4zRQJY,6669
664
665
  lusid/models/portfolio_trade_ticket.py,sha256=29sx0JwS49GzDI65hh4YvLN1rgBGBPDOTxfJHIgtzPg,2780
665
666
  lusid/models/portfolio_type.py,sha256=FU88oStdLwCnAk2xAWMUtJiaLbwWJKBi-rE1ZkZTs8g,712
667
+ lusid/models/portfolio_without_href.py,sha256=8rnY2y1oLQuTROF4ztdXg6eq3aUHnDpUSVOQtZp8cOM,11809
666
668
  lusid/models/portfolios_reconciliation_request.py,sha256=NlI1pOGr08bwob0a4FZRRZiS6DylKDpZJA8cw7dgRsc,3001
667
669
  lusid/models/posting_module_details.py,sha256=YtjckonotvLC-UwLecW2G12FVxlww-VkyEU4q-urvsA,3310
668
670
  lusid/models/posting_module_request.py,sha256=x6aq23t1GtSpg60mAe3gXTRBjgIkOVqUp4qRb3tLFDs,4473
@@ -1019,6 +1021,6 @@ lusid/models/weighted_instruments.py,sha256=1y_y_vw4-LPsbkQx4FOzWdZc5fJnzhVkf1D3
1019
1021
  lusid/models/yield_curve_data.py,sha256=SbxvdJ4-GWK9kpMdw4Fnxc7_kvIMwgsRsd_31UJn7nw,6330
1020
1022
  lusid/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1021
1023
  lusid/rest.py,sha256=TNUzQ3yLNT2L053EdR7R0vNzQh2J3TlYD1T56Dye0W0,10138
1022
- lusid_sdk-2.1.76.dist-info/METADATA,sha256=Hia5SL11tXwyl7T8NPriNyPuRfXhvM-Jy8w0-Lb1g-A,180159
1023
- lusid_sdk-2.1.76.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1024
- lusid_sdk-2.1.76.dist-info/RECORD,,
1024
+ lusid_sdk-2.1.79.dist-info/METADATA,sha256=3_aiqvwzxM7J0oXH6rRshkaB0XwEHalz3R5HCm8YiX4,180503
1025
+ lusid_sdk-2.1.79.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1026
+ lusid_sdk-2.1.79.dist-info/RECORD,,