lusid-sdk 2.1.390__py3-none-any.whl → 2.1.401__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.
Files changed (51) hide show
  1. lusid/__init__.py +18 -0
  2. lusid/api/portfolios_api.py +179 -0
  3. lusid/configuration.py +1 -1
  4. lusid/models/__init__.py +18 -0
  5. lusid/models/accumulation_event.py +3 -3
  6. lusid/models/amortisation_event.py +3 -3
  7. lusid/models/batch_upsert_portfolio_access_metadata_request.py +82 -0
  8. lusid/models/batch_upsert_portfolio_access_metadata_response.py +82 -0
  9. lusid/models/bond_coupon_event.py +3 -3
  10. lusid/models/bond_default_event.py +3 -3
  11. lusid/models/bond_principal_event.py +3 -3
  12. lusid/models/capital_distribution_event.py +3 -3
  13. lusid/models/cash_dividend_event.py +3 -3
  14. lusid/models/cash_flow_event.py +3 -3
  15. lusid/models/cds_credit_event.py +105 -0
  16. lusid/models/cdx_credit_event.py +114 -0
  17. lusid/models/close_event.py +3 -3
  18. lusid/models/credit_premium_cash_flow_event.py +102 -0
  19. lusid/models/dividend_option_event.py +3 -3
  20. lusid/models/dividend_reinvestment_event.py +3 -3
  21. lusid/models/exercise_event.py +3 -3
  22. lusid/models/expiry_event.py +3 -3
  23. lusid/models/future_expiry_event.py +3 -3
  24. lusid/models/fx_forward_settlement_event.py +13 -5
  25. lusid/models/holding_pricing_info.py +110 -0
  26. lusid/models/informational_error_event.py +3 -3
  27. lusid/models/informational_event.py +3 -3
  28. lusid/models/instrument_event.py +8 -5
  29. lusid/models/instrument_event_type.py +3 -0
  30. lusid/models/maturity_event.py +3 -3
  31. lusid/models/merger_event.py +3 -3
  32. lusid/models/metadata_key_value.py +86 -0
  33. lusid/models/metadata_key_value_response.py +86 -0
  34. lusid/models/open_event.py +3 -3
  35. lusid/models/pricing_context.py +8 -2
  36. lusid/models/raw_vendor_event.py +3 -3
  37. lusid/models/reset_event.py +3 -3
  38. lusid/models/reverse_stock_split_event.py +3 -3
  39. lusid/models/scrip_dividend_event.py +3 -3
  40. lusid/models/specific_holding_pricing_info.py +75 -0
  41. lusid/models/spin_off_event.py +3 -3
  42. lusid/models/staged_modification.py +8 -1
  43. lusid/models/stock_dividend_event.py +3 -3
  44. lusid/models/stock_split_event.py +3 -3
  45. lusid/models/swap_cash_flow_event.py +3 -3
  46. lusid/models/swap_principal_event.py +3 -3
  47. lusid/models/transition_event.py +3 -3
  48. lusid/models/trigger_event.py +3 -3
  49. {lusid_sdk-2.1.390.dist-info → lusid_sdk-2.1.401.dist-info}/METADATA +11 -1
  50. {lusid_sdk-2.1.390.dist-info → lusid_sdk-2.1.401.dist-info}/RECORD +51 -42
  51. {lusid_sdk-2.1.390.dist-info → lusid_sdk-2.1.401.dist-info}/WHEEL +0 -0
lusid/__init__.py CHANGED
@@ -159,6 +159,8 @@ from lusid.models.basket import Basket
159
159
  from lusid.models.basket_identifier import BasketIdentifier
160
160
  from lusid.models.batch_adjust_holdings_response import BatchAdjustHoldingsResponse
161
161
  from lusid.models.batch_upsert_instrument_properties_response import BatchUpsertInstrumentPropertiesResponse
162
+ from lusid.models.batch_upsert_portfolio_access_metadata_request import BatchUpsertPortfolioAccessMetadataRequest
163
+ from lusid.models.batch_upsert_portfolio_access_metadata_response import BatchUpsertPortfolioAccessMetadataResponse
162
164
  from lusid.models.batch_upsert_portfolio_transactions_response import BatchUpsertPortfolioTransactionsResponse
163
165
  from lusid.models.batch_upsert_property_definition_properties_response import BatchUpsertPropertyDefinitionPropertiesResponse
164
166
  from lusid.models.block import Block
@@ -206,9 +208,11 @@ from lusid.models.cash_flow_value_set import CashFlowValueSet
206
208
  from lusid.models.cash_ladder_record import CashLadderRecord
207
209
  from lusid.models.cash_offer_election import CashOfferElection
208
210
  from lusid.models.cash_perpetual import CashPerpetual
211
+ from lusid.models.cds_credit_event import CdsCreditEvent
209
212
  from lusid.models.cds_flow_conventions import CdsFlowConventions
210
213
  from lusid.models.cds_index import CdsIndex
211
214
  from lusid.models.cds_protection_detail_specification import CdsProtectionDetailSpecification
215
+ from lusid.models.cdx_credit_event import CdxCreditEvent
212
216
  from lusid.models.change import Change
213
217
  from lusid.models.change_history import ChangeHistory
214
218
  from lusid.models.change_history_action import ChangeHistoryAction
@@ -312,6 +316,7 @@ from lusid.models.create_trade_tickets_response import CreateTradeTicketsRespons
312
316
  from lusid.models.create_transaction_portfolio_request import CreateTransactionPortfolioRequest
313
317
  from lusid.models.create_unit_definition import CreateUnitDefinition
314
318
  from lusid.models.credit_default_swap import CreditDefaultSwap
319
+ from lusid.models.credit_premium_cash_flow_event import CreditPremiumCashFlowEvent
315
320
  from lusid.models.credit_rating import CreditRating
316
321
  from lusid.models.credit_spread_curve_data import CreditSpreadCurveData
317
322
  from lusid.models.credit_support_annex import CreditSupportAnnex
@@ -503,6 +508,7 @@ from lusid.models.holding_adjustment import HoldingAdjustment
503
508
  from lusid.models.holding_adjustment_with_date import HoldingAdjustmentWithDate
504
509
  from lusid.models.holding_context import HoldingContext
505
510
  from lusid.models.holding_contributor import HoldingContributor
511
+ from lusid.models.holding_pricing_info import HoldingPricingInfo
506
512
  from lusid.models.holdings_adjustment import HoldingsAdjustment
507
513
  from lusid.models.holdings_adjustment_header import HoldingsAdjustmentHeader
508
514
  from lusid.models.i_unit_definition_dto import IUnitDefinitionDto
@@ -594,6 +600,8 @@ from lusid.models.market_quote import MarketQuote
594
600
  from lusid.models.match_criterion import MatchCriterion
595
601
  from lusid.models.maturity_event import MaturityEvent
596
602
  from lusid.models.merger_event import MergerEvent
603
+ from lusid.models.metadata_key_value import MetadataKeyValue
604
+ from lusid.models.metadata_key_value_response import MetadataKeyValueResponse
597
605
  from lusid.models.metric_value import MetricValue
598
606
  from lusid.models.model_options import ModelOptions
599
607
  from lusid.models.model_options_type import ModelOptionsType
@@ -961,6 +969,7 @@ from lusid.models.sides_definition_request import SidesDefinitionRequest
961
969
  from lusid.models.simple_cash_flow_loan import SimpleCashFlowLoan
962
970
  from lusid.models.simple_instrument import SimpleInstrument
963
971
  from lusid.models.sort_order import SortOrder
972
+ from lusid.models.specific_holding_pricing_info import SpecificHoldingPricingInfo
964
973
  from lusid.models.spin_off_event import SpinOffEvent
965
974
  from lusid.models.staged_modification import StagedModification
966
975
  from lusid.models.staged_modification_decision import StagedModificationDecision
@@ -1300,6 +1309,8 @@ __all__ = [
1300
1309
  "BasketIdentifier",
1301
1310
  "BatchAdjustHoldingsResponse",
1302
1311
  "BatchUpsertInstrumentPropertiesResponse",
1312
+ "BatchUpsertPortfolioAccessMetadataRequest",
1313
+ "BatchUpsertPortfolioAccessMetadataResponse",
1303
1314
  "BatchUpsertPortfolioTransactionsResponse",
1304
1315
  "BatchUpsertPropertyDefinitionPropertiesResponse",
1305
1316
  "Block",
@@ -1347,9 +1358,11 @@ __all__ = [
1347
1358
  "CashLadderRecord",
1348
1359
  "CashOfferElection",
1349
1360
  "CashPerpetual",
1361
+ "CdsCreditEvent",
1350
1362
  "CdsFlowConventions",
1351
1363
  "CdsIndex",
1352
1364
  "CdsProtectionDetailSpecification",
1365
+ "CdxCreditEvent",
1353
1366
  "Change",
1354
1367
  "ChangeHistory",
1355
1368
  "ChangeHistoryAction",
@@ -1453,6 +1466,7 @@ __all__ = [
1453
1466
  "CreateTransactionPortfolioRequest",
1454
1467
  "CreateUnitDefinition",
1455
1468
  "CreditDefaultSwap",
1469
+ "CreditPremiumCashFlowEvent",
1456
1470
  "CreditRating",
1457
1471
  "CreditSpreadCurveData",
1458
1472
  "CreditSupportAnnex",
@@ -1644,6 +1658,7 @@ __all__ = [
1644
1658
  "HoldingAdjustmentWithDate",
1645
1659
  "HoldingContext",
1646
1660
  "HoldingContributor",
1661
+ "HoldingPricingInfo",
1647
1662
  "HoldingsAdjustment",
1648
1663
  "HoldingsAdjustmentHeader",
1649
1664
  "IUnitDefinitionDto",
@@ -1735,6 +1750,8 @@ __all__ = [
1735
1750
  "MatchCriterion",
1736
1751
  "MaturityEvent",
1737
1752
  "MergerEvent",
1753
+ "MetadataKeyValue",
1754
+ "MetadataKeyValueResponse",
1738
1755
  "MetricValue",
1739
1756
  "ModelOptions",
1740
1757
  "ModelOptionsType",
@@ -2102,6 +2119,7 @@ __all__ = [
2102
2119
  "SimpleCashFlowLoan",
2103
2120
  "SimpleInstrument",
2104
2121
  "SortOrder",
2122
+ "SpecificHoldingPricingInfo",
2105
2123
  "SpinOffEvent",
2106
2124
  "StagedModification",
2107
2125
  "StagedModificationDecision",
@@ -31,6 +31,8 @@ from lusid.models.access_metadata_value import AccessMetadataValue
31
31
  from lusid.models.aggregated_returns_dispersion_request import AggregatedReturnsDispersionRequest
32
32
  from lusid.models.aggregated_returns_request import AggregatedReturnsRequest
33
33
  from lusid.models.aggregated_returns_response import AggregatedReturnsResponse
34
+ from lusid.models.batch_upsert_portfolio_access_metadata_request import BatchUpsertPortfolioAccessMetadataRequest
35
+ from lusid.models.batch_upsert_portfolio_access_metadata_response import BatchUpsertPortfolioAccessMetadataResponse
34
36
  from lusid.models.composite_breakdown_request import CompositeBreakdownRequest
35
37
  from lusid.models.composite_breakdown_response import CompositeBreakdownResponse
36
38
  from lusid.models.composite_dispersion_response import CompositeDispersionResponse
@@ -77,6 +79,183 @@ class PortfoliosApi:
77
79
  api_client = ApiClient.get_default()
78
80
  self.api_client = api_client
79
81
 
82
+ @overload
83
+ async def batch_upsert_portfolio_access_metadata(self, batch_upsert_portfolio_access_metadata_request : Annotated[BatchUpsertPortfolioAccessMetadataRequest, Field(..., description="The Portfolio Access Metadata Rule to update or insert")], effective_at : Annotated[Optional[StrictStr], Field(description="The date this rule will effective from")] = None, effective_until : Annotated[Optional[datetime], Field(description="The effective date until which the Access Metadata is valid. If not supplied this will be valid indefinitely, or until the next 'effectiveAt' date of the Access Metadata")] = None, **kwargs) -> BatchUpsertPortfolioAccessMetadataResponse: # noqa: E501
84
+ ...
85
+
86
+ @overload
87
+ def batch_upsert_portfolio_access_metadata(self, batch_upsert_portfolio_access_metadata_request : Annotated[BatchUpsertPortfolioAccessMetadataRequest, Field(..., description="The Portfolio Access Metadata Rule to update or insert")], effective_at : Annotated[Optional[StrictStr], Field(description="The date this rule will effective from")] = None, effective_until : Annotated[Optional[datetime], Field(description="The effective date until which the Access Metadata is valid. If not supplied this will be valid indefinitely, or until the next 'effectiveAt' date of the Access Metadata")] = None, async_req: Optional[bool]=True, **kwargs) -> BatchUpsertPortfolioAccessMetadataResponse: # noqa: E501
88
+ ...
89
+
90
+ @validate_arguments
91
+ def batch_upsert_portfolio_access_metadata(self, batch_upsert_portfolio_access_metadata_request : Annotated[BatchUpsertPortfolioAccessMetadataRequest, Field(..., description="The Portfolio Access Metadata Rule to update or insert")], effective_at : Annotated[Optional[StrictStr], Field(description="The date this rule will effective from")] = None, effective_until : Annotated[Optional[datetime], Field(description="The effective date until which the Access Metadata is valid. If not supplied this will be valid indefinitely, or until the next 'effectiveAt' date of the Access Metadata")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[BatchUpsertPortfolioAccessMetadataResponse, Awaitable[BatchUpsertPortfolioAccessMetadataResponse]]: # noqa: E501
92
+ """[EXPERIMENTAL] BatchUpsertPortfolioAccessMetadata: Upsert multiple portfolio access metadata with different keys to multiple portfolios # noqa: E501
93
+
94
+ Update or insert multiple Portfolios Access Metadata Rule in multiple scopes. Items will be updated if it already exists and inserted if it does not. No other items will be affected The response will return the successfully updated or inserted Portfolio Access Metadata Rules or failure message if unsuccessful It is important to always check to verify success (or failure). Multiple rules for a metadataKey can exist with different effective at dates, when resources are accessed the rule that is active for the current time will be fetched # noqa: E501
95
+ This method makes a synchronous HTTP request by default. To make an
96
+ asynchronous HTTP request, please pass async_req=True
97
+
98
+ >>> thread = api.batch_upsert_portfolio_access_metadata(batch_upsert_portfolio_access_metadata_request, effective_at, effective_until, async_req=True)
99
+ >>> result = thread.get()
100
+
101
+ :param batch_upsert_portfolio_access_metadata_request: The Portfolio Access Metadata Rule to update or insert (required)
102
+ :type batch_upsert_portfolio_access_metadata_request: BatchUpsertPortfolioAccessMetadataRequest
103
+ :param effective_at: The date this rule will effective from
104
+ :type effective_at: str
105
+ :param effective_until: The effective date until which the Access Metadata is valid. If not supplied this will be valid indefinitely, or until the next 'effectiveAt' date of the Access Metadata
106
+ :type effective_until: datetime
107
+ :param async_req: Whether to execute the request asynchronously.
108
+ :type async_req: bool, optional
109
+ :param _request_timeout: timeout setting for this request.
110
+ If one number provided, it will be total request
111
+ timeout. It can also be a pair (tuple) of
112
+ (connection, read) timeouts.
113
+ :return: Returns the result object.
114
+ If the method is called asynchronously,
115
+ returns the request thread.
116
+ :rtype: BatchUpsertPortfolioAccessMetadataResponse
117
+ """
118
+ kwargs['_return_http_data_only'] = True
119
+ if '_preload_content' in kwargs:
120
+ message = "Error! Please call the batch_upsert_portfolio_access_metadata_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
121
+ raise ValueError(message)
122
+ if async_req is not None:
123
+ kwargs['async_req'] = async_req
124
+ return self.batch_upsert_portfolio_access_metadata_with_http_info(batch_upsert_portfolio_access_metadata_request, effective_at, effective_until, **kwargs) # noqa: E501
125
+
126
+ @validate_arguments
127
+ def batch_upsert_portfolio_access_metadata_with_http_info(self, batch_upsert_portfolio_access_metadata_request : Annotated[BatchUpsertPortfolioAccessMetadataRequest, Field(..., description="The Portfolio Access Metadata Rule to update or insert")], effective_at : Annotated[Optional[StrictStr], Field(description="The date this rule will effective from")] = None, effective_until : Annotated[Optional[datetime], Field(description="The effective date until which the Access Metadata is valid. If not supplied this will be valid indefinitely, or until the next 'effectiveAt' date of the Access Metadata")] = None, **kwargs) -> ApiResponse: # noqa: E501
128
+ """[EXPERIMENTAL] BatchUpsertPortfolioAccessMetadata: Upsert multiple portfolio access metadata with different keys to multiple portfolios # noqa: E501
129
+
130
+ Update or insert multiple Portfolios Access Metadata Rule in multiple scopes. Items will be updated if it already exists and inserted if it does not. No other items will be affected The response will return the successfully updated or inserted Portfolio Access Metadata Rules or failure message if unsuccessful It is important to always check to verify success (or failure). Multiple rules for a metadataKey can exist with different effective at dates, when resources are accessed the rule that is active for the current time will be fetched # noqa: E501
131
+ This method makes a synchronous HTTP request by default. To make an
132
+ asynchronous HTTP request, please pass async_req=True
133
+
134
+ >>> thread = api.batch_upsert_portfolio_access_metadata_with_http_info(batch_upsert_portfolio_access_metadata_request, effective_at, effective_until, async_req=True)
135
+ >>> result = thread.get()
136
+
137
+ :param batch_upsert_portfolio_access_metadata_request: The Portfolio Access Metadata Rule to update or insert (required)
138
+ :type batch_upsert_portfolio_access_metadata_request: BatchUpsertPortfolioAccessMetadataRequest
139
+ :param effective_at: The date this rule will effective from
140
+ :type effective_at: str
141
+ :param effective_until: The effective date until which the Access Metadata is valid. If not supplied this will be valid indefinitely, or until the next 'effectiveAt' date of the Access Metadata
142
+ :type effective_until: datetime
143
+ :param async_req: Whether to execute the request asynchronously.
144
+ :type async_req: bool, optional
145
+ :param _preload_content: if False, the ApiResponse.data will
146
+ be set to none and raw_data will store the
147
+ HTTP response body without reading/decoding.
148
+ Default is True.
149
+ :type _preload_content: bool, optional
150
+ :param _return_http_data_only: response data instead of ApiResponse
151
+ object with status code, headers, etc
152
+ :type _return_http_data_only: bool, optional
153
+ :param _request_timeout: timeout setting for this request. If one
154
+ number provided, it will be total request
155
+ timeout. It can also be a pair (tuple) of
156
+ (connection, read) timeouts.
157
+ :param _request_auth: set to override the auth_settings for an a single
158
+ request; this effectively ignores the authentication
159
+ in the spec for a single request.
160
+ :type _request_auth: dict, optional
161
+ :type _content_type: string, optional: force content-type for the request
162
+ :return: Returns the result object.
163
+ If the method is called asynchronously,
164
+ returns the request thread.
165
+ :rtype: tuple(BatchUpsertPortfolioAccessMetadataResponse, status_code(int), headers(HTTPHeaderDict))
166
+ """
167
+
168
+ _params = locals()
169
+
170
+ _all_params = [
171
+ 'batch_upsert_portfolio_access_metadata_request',
172
+ 'effective_at',
173
+ 'effective_until'
174
+ ]
175
+ _all_params.extend(
176
+ [
177
+ 'async_req',
178
+ '_return_http_data_only',
179
+ '_preload_content',
180
+ '_request_timeout',
181
+ '_request_auth',
182
+ '_content_type',
183
+ '_headers'
184
+ ]
185
+ )
186
+
187
+ # validate the arguments
188
+ for _key, _val in _params['kwargs'].items():
189
+ if _key not in _all_params:
190
+ raise ApiTypeError(
191
+ "Got an unexpected keyword argument '%s'"
192
+ " to method batch_upsert_portfolio_access_metadata" % _key
193
+ )
194
+ _params[_key] = _val
195
+ del _params['kwargs']
196
+
197
+ _collection_formats = {}
198
+
199
+ # process the path parameters
200
+ _path_params = {}
201
+
202
+ # process the query parameters
203
+ _query_params = []
204
+ if _params.get('effective_at') is not None: # noqa: E501
205
+ _query_params.append(('effectiveAt', _params['effective_at']))
206
+
207
+ if _params.get('effective_until') is not None: # noqa: E501
208
+ if isinstance(_params['effective_until'], datetime):
209
+ _query_params.append(('effectiveUntil', _params['effective_until'].strftime(self.api_client.configuration.datetime_format)))
210
+ else:
211
+ _query_params.append(('effectiveUntil', _params['effective_until']))
212
+
213
+ # process the header parameters
214
+ _header_params = dict(_params.get('_headers', {}))
215
+ # process the form parameters
216
+ _form_params = []
217
+ _files = {}
218
+ # process the body parameter
219
+ _body_params = None
220
+ if _params['batch_upsert_portfolio_access_metadata_request'] is not None:
221
+ _body_params = _params['batch_upsert_portfolio_access_metadata_request']
222
+
223
+ # set the HTTP header `Accept`
224
+ _header_params['Accept'] = self.api_client.select_header_accept(
225
+ ['text/plain', 'application/json', 'text/json']) # noqa: E501
226
+
227
+ # set the HTTP header `Content-Type`
228
+ _content_types_list = _params.get('_content_type',
229
+ self.api_client.select_header_content_type(
230
+ ['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']))
231
+ if _content_types_list:
232
+ _header_params['Content-Type'] = _content_types_list
233
+
234
+ # authentication setting
235
+ _auth_settings = ['oauth2'] # noqa: E501
236
+
237
+ _response_types_map = {
238
+ '200': "BatchUpsertPortfolioAccessMetadataResponse",
239
+ '400': "LusidValidationProblemDetails",
240
+ }
241
+
242
+ return self.api_client.call_api(
243
+ '/api/portfolios/metadata', 'PUT',
244
+ _path_params,
245
+ _query_params,
246
+ _header_params,
247
+ body=_body_params,
248
+ post_params=_form_params,
249
+ files=_files,
250
+ response_types_map=_response_types_map,
251
+ auth_settings=_auth_settings,
252
+ async_req=_params.get('async_req'),
253
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
254
+ _preload_content=_params.get('_preload_content', True),
255
+ _request_timeout=_params.get('_request_timeout'),
256
+ collection_formats=_collection_formats,
257
+ _request_auth=_params.get('_request_auth'))
258
+
80
259
  @overload
81
260
  async def delete_instrument_event_instruction(self, scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The scope of the portfolio.")], code : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The code of the portfolio. Together with the scope this uniquely identifies the portfolio.")], instrument_event_instruction_id : Annotated[StrictStr, Field(..., description="The id of the instruction to be deleted.")], portfolio_effective_at : Annotated[Optional[constr(strict=True, max_length=6000, min_length=0)], Field(description="The effective date at which the portfolio will be resolved. Defaults to current time if not specified.")] = None, **kwargs) -> DeletedEntityResponse: # noqa: E501
82
261
  ...
lusid/configuration.py CHANGED
@@ -382,7 +382,7 @@ class Configuration:
382
382
  return "Python SDK Debug Report:\n"\
383
383
  "OS: {env}\n"\
384
384
  "Python Version: {pyversion}\n"\
385
- "Version of the API: 0.11.6820\n"\
385
+ "Version of the API: 0.11.6831\n"\
386
386
  "SDK Package Version: {package_version}".\
387
387
  format(env=sys.platform, pyversion=sys.version, package_version=package_version)
388
388
 
lusid/models/__init__.py CHANGED
@@ -78,6 +78,8 @@ from lusid.models.basket import Basket
78
78
  from lusid.models.basket_identifier import BasketIdentifier
79
79
  from lusid.models.batch_adjust_holdings_response import BatchAdjustHoldingsResponse
80
80
  from lusid.models.batch_upsert_instrument_properties_response import BatchUpsertInstrumentPropertiesResponse
81
+ from lusid.models.batch_upsert_portfolio_access_metadata_request import BatchUpsertPortfolioAccessMetadataRequest
82
+ from lusid.models.batch_upsert_portfolio_access_metadata_response import BatchUpsertPortfolioAccessMetadataResponse
81
83
  from lusid.models.batch_upsert_portfolio_transactions_response import BatchUpsertPortfolioTransactionsResponse
82
84
  from lusid.models.batch_upsert_property_definition_properties_response import BatchUpsertPropertyDefinitionPropertiesResponse
83
85
  from lusid.models.block import Block
@@ -125,9 +127,11 @@ from lusid.models.cash_flow_value_set import CashFlowValueSet
125
127
  from lusid.models.cash_ladder_record import CashLadderRecord
126
128
  from lusid.models.cash_offer_election import CashOfferElection
127
129
  from lusid.models.cash_perpetual import CashPerpetual
130
+ from lusid.models.cds_credit_event import CdsCreditEvent
128
131
  from lusid.models.cds_flow_conventions import CdsFlowConventions
129
132
  from lusid.models.cds_index import CdsIndex
130
133
  from lusid.models.cds_protection_detail_specification import CdsProtectionDetailSpecification
134
+ from lusid.models.cdx_credit_event import CdxCreditEvent
131
135
  from lusid.models.change import Change
132
136
  from lusid.models.change_history import ChangeHistory
133
137
  from lusid.models.change_history_action import ChangeHistoryAction
@@ -231,6 +235,7 @@ from lusid.models.create_trade_tickets_response import CreateTradeTicketsRespons
231
235
  from lusid.models.create_transaction_portfolio_request import CreateTransactionPortfolioRequest
232
236
  from lusid.models.create_unit_definition import CreateUnitDefinition
233
237
  from lusid.models.credit_default_swap import CreditDefaultSwap
238
+ from lusid.models.credit_premium_cash_flow_event import CreditPremiumCashFlowEvent
234
239
  from lusid.models.credit_rating import CreditRating
235
240
  from lusid.models.credit_spread_curve_data import CreditSpreadCurveData
236
241
  from lusid.models.credit_support_annex import CreditSupportAnnex
@@ -422,6 +427,7 @@ from lusid.models.holding_adjustment import HoldingAdjustment
422
427
  from lusid.models.holding_adjustment_with_date import HoldingAdjustmentWithDate
423
428
  from lusid.models.holding_context import HoldingContext
424
429
  from lusid.models.holding_contributor import HoldingContributor
430
+ from lusid.models.holding_pricing_info import HoldingPricingInfo
425
431
  from lusid.models.holdings_adjustment import HoldingsAdjustment
426
432
  from lusid.models.holdings_adjustment_header import HoldingsAdjustmentHeader
427
433
  from lusid.models.i_unit_definition_dto import IUnitDefinitionDto
@@ -513,6 +519,8 @@ from lusid.models.market_quote import MarketQuote
513
519
  from lusid.models.match_criterion import MatchCriterion
514
520
  from lusid.models.maturity_event import MaturityEvent
515
521
  from lusid.models.merger_event import MergerEvent
522
+ from lusid.models.metadata_key_value import MetadataKeyValue
523
+ from lusid.models.metadata_key_value_response import MetadataKeyValueResponse
516
524
  from lusid.models.metric_value import MetricValue
517
525
  from lusid.models.model_options import ModelOptions
518
526
  from lusid.models.model_options_type import ModelOptionsType
@@ -880,6 +888,7 @@ from lusid.models.sides_definition_request import SidesDefinitionRequest
880
888
  from lusid.models.simple_cash_flow_loan import SimpleCashFlowLoan
881
889
  from lusid.models.simple_instrument import SimpleInstrument
882
890
  from lusid.models.sort_order import SortOrder
891
+ from lusid.models.specific_holding_pricing_info import SpecificHoldingPricingInfo
883
892
  from lusid.models.spin_off_event import SpinOffEvent
884
893
  from lusid.models.staged_modification import StagedModification
885
894
  from lusid.models.staged_modification_decision import StagedModificationDecision
@@ -1139,6 +1148,8 @@ __all__ = [
1139
1148
  "BasketIdentifier",
1140
1149
  "BatchAdjustHoldingsResponse",
1141
1150
  "BatchUpsertInstrumentPropertiesResponse",
1151
+ "BatchUpsertPortfolioAccessMetadataRequest",
1152
+ "BatchUpsertPortfolioAccessMetadataResponse",
1142
1153
  "BatchUpsertPortfolioTransactionsResponse",
1143
1154
  "BatchUpsertPropertyDefinitionPropertiesResponse",
1144
1155
  "Block",
@@ -1186,9 +1197,11 @@ __all__ = [
1186
1197
  "CashLadderRecord",
1187
1198
  "CashOfferElection",
1188
1199
  "CashPerpetual",
1200
+ "CdsCreditEvent",
1189
1201
  "CdsFlowConventions",
1190
1202
  "CdsIndex",
1191
1203
  "CdsProtectionDetailSpecification",
1204
+ "CdxCreditEvent",
1192
1205
  "Change",
1193
1206
  "ChangeHistory",
1194
1207
  "ChangeHistoryAction",
@@ -1292,6 +1305,7 @@ __all__ = [
1292
1305
  "CreateTransactionPortfolioRequest",
1293
1306
  "CreateUnitDefinition",
1294
1307
  "CreditDefaultSwap",
1308
+ "CreditPremiumCashFlowEvent",
1295
1309
  "CreditRating",
1296
1310
  "CreditSpreadCurveData",
1297
1311
  "CreditSupportAnnex",
@@ -1483,6 +1497,7 @@ __all__ = [
1483
1497
  "HoldingAdjustmentWithDate",
1484
1498
  "HoldingContext",
1485
1499
  "HoldingContributor",
1500
+ "HoldingPricingInfo",
1486
1501
  "HoldingsAdjustment",
1487
1502
  "HoldingsAdjustmentHeader",
1488
1503
  "IUnitDefinitionDto",
@@ -1574,6 +1589,8 @@ __all__ = [
1574
1589
  "MatchCriterion",
1575
1590
  "MaturityEvent",
1576
1591
  "MergerEvent",
1592
+ "MetadataKeyValue",
1593
+ "MetadataKeyValueResponse",
1577
1594
  "MetricValue",
1578
1595
  "ModelOptions",
1579
1596
  "ModelOptionsType",
@@ -1941,6 +1958,7 @@ __all__ = [
1941
1958
  "SimpleCashFlowLoan",
1942
1959
  "SimpleInstrument",
1943
1960
  "SortOrder",
1961
+ "SpecificHoldingPricingInfo",
1944
1962
  "SpinOffEvent",
1945
1963
  "StagedModification",
1946
1964
  "StagedModificationDecision",
@@ -31,15 +31,15 @@ class AccumulationEvent(InstrumentEvent):
31
31
  dividend_rate: Union[StrictFloat, StrictInt] = Field(..., alias="dividendRate", description="Dividend rate or payment rate as a percentage. i.e. 5% is written as 0.05")
32
32
  ex_date: datetime = Field(..., alias="exDate", description="The first business day on which the dividend is not owed to the buying party. Typically this is T-1 from the RecordDate.")
33
33
  payment_date: datetime = Field(..., alias="paymentDate", description="The date the company pays out dividends to shareholders.")
34
- instrument_event_type: StrictStr = Field(..., alias="instrumentEventType", description="The Type of Event. The available values are: TransitionEvent, InformationalEvent, OpenEvent, CloseEvent, StockSplitEvent, BondDefaultEvent, CashDividendEvent, AmortisationEvent, CashFlowEvent, ExerciseEvent, ResetEvent, TriggerEvent, RawVendorEvent, InformationalErrorEvent, BondCouponEvent, DividendReinvestmentEvent, AccumulationEvent, BondPrincipalEvent, DividendOptionEvent, MaturityEvent, FxForwardSettlementEvent, ExpiryEvent, ScripDividendEvent, StockDividendEvent, ReverseStockSplitEvent, CapitalDistributionEvent, SpinOffEvent, MergerEvent, FutureExpiryEvent, SwapCashFlowEvent, SwapPrincipalEvent")
34
+ instrument_event_type: StrictStr = Field(..., alias="instrumentEventType", description="The Type of Event. The available values are: TransitionEvent, InformationalEvent, OpenEvent, CloseEvent, StockSplitEvent, BondDefaultEvent, CashDividendEvent, AmortisationEvent, CashFlowEvent, ExerciseEvent, ResetEvent, TriggerEvent, RawVendorEvent, InformationalErrorEvent, BondCouponEvent, DividendReinvestmentEvent, AccumulationEvent, BondPrincipalEvent, DividendOptionEvent, MaturityEvent, FxForwardSettlementEvent, ExpiryEvent, ScripDividendEvent, StockDividendEvent, ReverseStockSplitEvent, CapitalDistributionEvent, SpinOffEvent, MergerEvent, FutureExpiryEvent, SwapCashFlowEvent, SwapPrincipalEvent, CreditPremiumCashFlowEvent, CdsCreditEvent, CdxCreditEvent")
35
35
  additional_properties: Dict[str, Any] = {}
36
36
  __properties = ["instrumentEventType", "announcementDate", "dividendCurrency", "dividendRate", "exDate", "paymentDate"]
37
37
 
38
38
  @validator('instrument_event_type')
39
39
  def instrument_event_type_validate_enum(cls, value):
40
40
  """Validates the enum"""
41
- if value not in ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent'):
42
- raise ValueError("must be one of enum values ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent')")
41
+ if value not in ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent'):
42
+ raise ValueError("must be one of enum values ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent')")
43
43
  return value
44
44
 
45
45
  class Config:
@@ -30,15 +30,15 @@ class AmortisationEvent(InstrumentEvent):
30
30
  dom_ccy: StrictStr = Field(..., alias="domCcy", description="Domestic currency of the originating instrument")
31
31
  pay_receive: constr(strict=True, min_length=1) = Field(..., alias="payReceive", description="Is this event in relation to the Pay or Receive leg")
32
32
  payment_date: datetime = Field(..., alias="paymentDate", description="The date the principal payment is to be made.")
33
- instrument_event_type: StrictStr = Field(..., alias="instrumentEventType", description="The Type of Event. The available values are: TransitionEvent, InformationalEvent, OpenEvent, CloseEvent, StockSplitEvent, BondDefaultEvent, CashDividendEvent, AmortisationEvent, CashFlowEvent, ExerciseEvent, ResetEvent, TriggerEvent, RawVendorEvent, InformationalErrorEvent, BondCouponEvent, DividendReinvestmentEvent, AccumulationEvent, BondPrincipalEvent, DividendOptionEvent, MaturityEvent, FxForwardSettlementEvent, ExpiryEvent, ScripDividendEvent, StockDividendEvent, ReverseStockSplitEvent, CapitalDistributionEvent, SpinOffEvent, MergerEvent, FutureExpiryEvent, SwapCashFlowEvent, SwapPrincipalEvent")
33
+ instrument_event_type: StrictStr = Field(..., alias="instrumentEventType", description="The Type of Event. The available values are: TransitionEvent, InformationalEvent, OpenEvent, CloseEvent, StockSplitEvent, BondDefaultEvent, CashDividendEvent, AmortisationEvent, CashFlowEvent, ExerciseEvent, ResetEvent, TriggerEvent, RawVendorEvent, InformationalErrorEvent, BondCouponEvent, DividendReinvestmentEvent, AccumulationEvent, BondPrincipalEvent, DividendOptionEvent, MaturityEvent, FxForwardSettlementEvent, ExpiryEvent, ScripDividendEvent, StockDividendEvent, ReverseStockSplitEvent, CapitalDistributionEvent, SpinOffEvent, MergerEvent, FutureExpiryEvent, SwapCashFlowEvent, SwapPrincipalEvent, CreditPremiumCashFlowEvent, CdsCreditEvent, CdxCreditEvent")
34
34
  additional_properties: Dict[str, Any] = {}
35
35
  __properties = ["instrumentEventType", "amountReduced", "domCcy", "payReceive", "paymentDate"]
36
36
 
37
37
  @validator('instrument_event_type')
38
38
  def instrument_event_type_validate_enum(cls, value):
39
39
  """Validates the enum"""
40
- if value not in ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent'):
41
- raise ValueError("must be one of enum values ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent')")
40
+ if value not in ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent'):
41
+ raise ValueError("must be one of enum values ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent', 'BondCouponEvent', 'DividendReinvestmentEvent', 'AccumulationEvent', 'BondPrincipalEvent', 'DividendOptionEvent', 'MaturityEvent', 'FxForwardSettlementEvent', 'ExpiryEvent', 'ScripDividendEvent', 'StockDividendEvent', 'ReverseStockSplitEvent', 'CapitalDistributionEvent', 'SpinOffEvent', 'MergerEvent', 'FutureExpiryEvent', 'SwapCashFlowEvent', 'SwapPrincipalEvent', 'CreditPremiumCashFlowEvent', 'CdsCreditEvent', 'CdxCreditEvent')")
42
42
  return value
43
43
 
44
44
  class Config:
@@ -0,0 +1,82 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LUSID API
5
+
6
+ FINBOURNE Technology # noqa: E501
7
+
8
+ Contact: info@finbourne.com
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+
21
+ from typing import Any, Dict
22
+ from pydantic.v1 import BaseModel, Field
23
+ from lusid.models.metadata_key_value import MetadataKeyValue
24
+
25
+ class BatchUpsertPortfolioAccessMetadataRequest(BaseModel):
26
+ """
27
+ BatchUpsertPortfolioAccessMetadataRequest
28
+ """
29
+ portfolios_with_metadata: Dict[str, MetadataKeyValue] = Field(..., alias="portfoliosWithMetadata", description="The set of portfolios with the access control metadata")
30
+ __properties = ["portfoliosWithMetadata"]
31
+
32
+ class Config:
33
+ """Pydantic configuration"""
34
+ allow_population_by_field_name = True
35
+ validate_assignment = True
36
+
37
+ def to_str(self) -> str:
38
+ """Returns the string representation of the model using alias"""
39
+ return pprint.pformat(self.dict(by_alias=True))
40
+
41
+ def to_json(self) -> str:
42
+ """Returns the JSON representation of the model using alias"""
43
+ return json.dumps(self.to_dict())
44
+
45
+ @classmethod
46
+ def from_json(cls, json_str: str) -> BatchUpsertPortfolioAccessMetadataRequest:
47
+ """Create an instance of BatchUpsertPortfolioAccessMetadataRequest from a JSON string"""
48
+ return cls.from_dict(json.loads(json_str))
49
+
50
+ def to_dict(self):
51
+ """Returns the dictionary representation of the model using alias"""
52
+ _dict = self.dict(by_alias=True,
53
+ exclude={
54
+ },
55
+ exclude_none=True)
56
+ # override the default output from pydantic by calling `to_dict()` of each value in portfolios_with_metadata (dict)
57
+ _field_dict = {}
58
+ if self.portfolios_with_metadata:
59
+ for _key in self.portfolios_with_metadata:
60
+ if self.portfolios_with_metadata[_key]:
61
+ _field_dict[_key] = self.portfolios_with_metadata[_key].to_dict()
62
+ _dict['portfoliosWithMetadata'] = _field_dict
63
+ return _dict
64
+
65
+ @classmethod
66
+ def from_dict(cls, obj: dict) -> BatchUpsertPortfolioAccessMetadataRequest:
67
+ """Create an instance of BatchUpsertPortfolioAccessMetadataRequest from a dict"""
68
+ if obj is None:
69
+ return None
70
+
71
+ if not isinstance(obj, dict):
72
+ return BatchUpsertPortfolioAccessMetadataRequest.parse_obj(obj)
73
+
74
+ _obj = BatchUpsertPortfolioAccessMetadataRequest.parse_obj({
75
+ "portfolios_with_metadata": dict(
76
+ (_k, MetadataKeyValue.from_dict(_v))
77
+ for _k, _v in obj.get("portfoliosWithMetadata").items()
78
+ )
79
+ if obj.get("portfoliosWithMetadata") is not None
80
+ else None
81
+ })
82
+ return _obj
@@ -0,0 +1,82 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LUSID API
5
+
6
+ FINBOURNE Technology # noqa: E501
7
+
8
+ Contact: info@finbourne.com
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+
21
+ from typing import Any, Dict
22
+ from pydantic.v1 import BaseModel, Field
23
+ from lusid.models.metadata_key_value_response import MetadataKeyValueResponse
24
+
25
+ class BatchUpsertPortfolioAccessMetadataResponse(BaseModel):
26
+ """
27
+ BatchUpsertPortfolioAccessMetadataResponse
28
+ """
29
+ portfolios_with_metadata: Dict[str, MetadataKeyValueResponse] = Field(..., alias="portfoliosWithMetadata", description="The set of portfolios with the access control metadata")
30
+ __properties = ["portfoliosWithMetadata"]
31
+
32
+ class Config:
33
+ """Pydantic configuration"""
34
+ allow_population_by_field_name = True
35
+ validate_assignment = True
36
+
37
+ def to_str(self) -> str:
38
+ """Returns the string representation of the model using alias"""
39
+ return pprint.pformat(self.dict(by_alias=True))
40
+
41
+ def to_json(self) -> str:
42
+ """Returns the JSON representation of the model using alias"""
43
+ return json.dumps(self.to_dict())
44
+
45
+ @classmethod
46
+ def from_json(cls, json_str: str) -> BatchUpsertPortfolioAccessMetadataResponse:
47
+ """Create an instance of BatchUpsertPortfolioAccessMetadataResponse from a JSON string"""
48
+ return cls.from_dict(json.loads(json_str))
49
+
50
+ def to_dict(self):
51
+ """Returns the dictionary representation of the model using alias"""
52
+ _dict = self.dict(by_alias=True,
53
+ exclude={
54
+ },
55
+ exclude_none=True)
56
+ # override the default output from pydantic by calling `to_dict()` of each value in portfolios_with_metadata (dict)
57
+ _field_dict = {}
58
+ if self.portfolios_with_metadata:
59
+ for _key in self.portfolios_with_metadata:
60
+ if self.portfolios_with_metadata[_key]:
61
+ _field_dict[_key] = self.portfolios_with_metadata[_key].to_dict()
62
+ _dict['portfoliosWithMetadata'] = _field_dict
63
+ return _dict
64
+
65
+ @classmethod
66
+ def from_dict(cls, obj: dict) -> BatchUpsertPortfolioAccessMetadataResponse:
67
+ """Create an instance of BatchUpsertPortfolioAccessMetadataResponse from a dict"""
68
+ if obj is None:
69
+ return None
70
+
71
+ if not isinstance(obj, dict):
72
+ return BatchUpsertPortfolioAccessMetadataResponse.parse_obj(obj)
73
+
74
+ _obj = BatchUpsertPortfolioAccessMetadataResponse.parse_obj({
75
+ "portfolios_with_metadata": dict(
76
+ (_k, MetadataKeyValueResponse.from_dict(_v))
77
+ for _k, _v in obj.get("portfoliosWithMetadata").items()
78
+ )
79
+ if obj.get("portfoliosWithMetadata") is not None
80
+ else None
81
+ })
82
+ return _obj