lusid-sdk 2.1.405__py3-none-any.whl → 2.1.537__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.
- lusid/__init__.py +142 -8
- lusid/api/__init__.py +2 -2
- lusid/api/abor_api.py +126 -133
- lusid/api/abor_configuration_api.py +46 -45
- lusid/api/address_key_definition_api.py +28 -27
- lusid/api/aggregation_api.py +37 -36
- lusid/api/allocations_api.py +39 -38
- lusid/api/amortisation_rule_sets_api.py +55 -54
- lusid/api/application_metadata_api.py +28 -27
- lusid/api/blocks_api.py +37 -36
- lusid/api/calendars_api.py +469 -111
- lusid/api/chart_of_accounts_api.py +454 -279
- lusid/api/complex_market_data_api.py +37 -36
- lusid/api/compliance_api.py +136 -135
- lusid/api/configuration_recipe_api.py +100 -99
- lusid/api/conventions_api.py +109 -108
- lusid/api/corporate_action_sources_api.py +82 -81
- lusid/api/counterparties_api.py +73 -72
- lusid/api/custom_entities_api.py +102 -101
- lusid/api/custom_entity_definitions_api.py +37 -36
- lusid/api/custom_entity_types_api.py +37 -36
- lusid/api/cut_label_definitions_api.py +46 -45
- lusid/api/data_types_api.py +248 -72
- lusid/api/derived_transaction_portfolios_api.py +19 -18
- lusid/api/entities_api.py +431 -46
- lusid/api/executions_api.py +37 -36
- lusid/api/fee_types_api.py +55 -54
- lusid/api/{fund_configurations_api.py → fund_configuration_api.py} +222 -46
- lusid/api/funds_api.py +337 -162
- lusid/api/group_reconciliations_api.py +2182 -63
- lusid/api/instrument_event_types_api.py +64 -63
- lusid/api/instrument_events_api.py +46 -45
- lusid/api/instruments_api.py +374 -186
- lusid/api/legacy_compliance_api.py +73 -72
- lusid/api/legal_entities_api.py +167 -166
- lusid/api/order_graph_api.py +32 -31
- lusid/api/order_instructions_api.py +37 -36
- lusid/api/order_management_api.py +251 -90
- lusid/api/orders_api.py +37 -36
- lusid/api/packages_api.py +37 -36
- lusid/api/participations_api.py +37 -36
- lusid/api/persons_api.py +163 -162
- lusid/api/placements_api.py +37 -36
- lusid/api/portfolio_groups_api.py +235 -234
- lusid/api/portfolios_api.py +307 -309
- lusid/api/property_definitions_api.py +100 -99
- lusid/api/queryable_keys_api.py +10 -9
- lusid/api/quotes_api.py +82 -81
- lusid/api/reconciliations_api.py +136 -135
- lusid/api/reference_lists_api.py +39 -38
- lusid/api/reference_portfolio_api.py +213 -36
- lusid/api/relation_definitions_api.py +28 -27
- lusid/api/relations_api.py +19 -18
- lusid/api/relationship_definitions_api.py +46 -45
- lusid/api/relationships_api.py +19 -18
- lusid/api/schemas_api.py +37 -36
- lusid/api/scopes_api.py +19 -18
- lusid/api/scripted_translation_api.py +73 -72
- lusid/api/search_api.py +37 -36
- lusid/api/sequences_api.py +37 -36
- lusid/api/staged_modifications_api.py +37 -36
- lusid/api/staging_rule_set_api.py +46 -45
- lusid/api/structured_result_data_api.py +82 -81
- lusid/api/system_configuration_api.py +64 -63
- lusid/api/tax_rule_sets_api.py +46 -45
- lusid/api/transaction_configuration_api.py +100 -99
- lusid/api/transaction_fees_api.py +46 -45
- lusid/api/transaction_portfolios_api.py +771 -328
- lusid/api/translation_api.py +19 -18
- lusid/api/workspace_api.py +181 -180
- lusid/api_client.py +26 -17
- lusid/configuration.py +87 -2
- lusid/extensions/api_client.py +25 -17
- lusid/extensions/api_client_factory.py +14 -5
- lusid/extensions/api_configuration.py +50 -1
- lusid/extensions/configuration_loaders.py +39 -11
- lusid/extensions/configuration_options.py +67 -0
- lusid/extensions/rest.py +78 -26
- lusid/extensions/retry.py +109 -37
- lusid/models/__init__.py +140 -6
- lusid/models/access_metadata_value.py +1 -1
- lusid/models/accounting_method.py +7 -0
- lusid/models/accumulation_event.py +3 -3
- lusid/models/address_key_list.py +3 -3
- lusid/models/amortisation_event.py +3 -3
- lusid/models/amount.py +69 -0
- lusid/models/applicable_instrument_event.py +7 -2
- lusid/models/asset_leg.py +1 -1
- lusid/models/basket.py +3 -3
- lusid/models/batch_update_user_review_for_comparison_result_request.py +81 -0
- lusid/models/batch_update_user_review_for_comparison_result_response.py +146 -0
- lusid/models/batch_upsert_dates_for_calendar_response.py +146 -0
- lusid/models/batch_upsert_portfolio_access_metadata_request.py +27 -17
- lusid/models/batch_upsert_portfolio_access_metadata_response.py +56 -16
- lusid/models/{metadata_key_value.py → batch_upsert_portfolio_access_metadata_response_item.py} +15 -9
- lusid/models/bond.py +3 -3
- lusid/models/bond_coupon_event.py +10 -5
- lusid/models/bond_default_event.py +3 -3
- lusid/models/bond_principal_event.py +10 -5
- lusid/models/bonus_issue_event.py +166 -0
- lusid/models/{component_rule.py → break_code_source.py} +17 -21
- lusid/models/call_on_intermediate_securities_event.py +139 -0
- lusid/models/cancel_order_and_move_remaining_result.py +84 -0
- lusid/models/cancel_orders_and_move_remaining_request.py +83 -0
- lusid/models/cancel_orders_and_move_remaining_response.py +153 -0
- lusid/models/cap_floor.py +3 -3
- lusid/models/capital_distribution_event.py +3 -3
- lusid/models/cash.py +3 -3
- lusid/models/cash_dividend_event.py +3 -3
- lusid/models/cash_flow_event.py +3 -3
- lusid/models/cash_perpetual.py +3 -3
- lusid/models/cds_credit_event.py +6 -6
- lusid/models/cds_index.py +3 -3
- lusid/models/cdx_credit_event.py +6 -6
- lusid/models/change_interval.py +123 -0
- lusid/models/change_interval_with_order_management_detail.py +3 -3
- lusid/models/close_event.py +3 -3
- lusid/models/comparison_attribute_value_pair.py +71 -0
- lusid/models/complex_bond.py +3 -3
- lusid/models/component_transaction.py +10 -3
- lusid/models/contract_for_difference.py +3 -3
- lusid/models/create_derived_transaction_portfolio_request.py +3 -3
- lusid/models/create_group_reconciliation_definition_request.py +113 -0
- lusid/models/create_staging_rule_set_request.py +1 -6
- lusid/models/create_transaction_portfolio_request.py +3 -3
- lusid/models/credit_default_swap.py +3 -3
- lusid/models/credit_premium_cash_flow_event.py +3 -3
- lusid/models/custodian_account_request.py +1 -1
- lusid/models/custom_entity_entity.py +146 -0
- lusid/models/custom_entity_response.py +7 -1
- lusid/models/decimal_list.py +3 -3
- lusid/models/delete_instrument_properties_response.py +7 -1
- lusid/models/delete_instrument_response.py +7 -1
- lusid/models/delete_instruments_response.py +22 -1
- lusid/models/deleted_entity_response.py +7 -1
- lusid/models/diary_entry_request.py +10 -1
- lusid/models/dividend_option_event.py +3 -3
- lusid/models/dividend_reinvestment_event.py +9 -4
- lusid/models/effective_range.py +71 -0
- lusid/models/equity.py +3 -3
- lusid/models/equity_option.py +22 -7
- lusid/models/equity_swap.py +3 -3
- lusid/models/exchange_traded_option.py +3 -3
- lusid/models/exchange_traded_option_contract_details.py +1 -1
- lusid/models/exercise_event.py +3 -3
- lusid/models/exotic_instrument.py +3 -3
- lusid/models/expiry_event.py +3 -3
- lusid/models/fee.py +17 -10
- lusid/models/fee_request.py +20 -13
- lusid/models/fee_type.py +4 -4
- lusid/models/fee_type_request.py +3 -3
- lusid/models/fixed_leg.py +3 -3
- lusid/models/fixed_schedule.py +3 -3
- lusid/models/flexible_loan.py +3 -3
- lusid/models/float_schedule.py +4 -4
- lusid/models/floating_leg.py +3 -3
- lusid/models/flow_conventions.py +7 -1
- lusid/models/forward_rate_agreement.py +3 -3
- lusid/models/fund_configuration.py +44 -17
- lusid/models/fund_configuration_request.py +31 -19
- lusid/models/fund_id_list.py +99 -0
- lusid/models/fund_share_class.py +23 -8
- lusid/models/funding_leg.py +3 -3
- lusid/models/future.py +3 -3
- lusid/models/future_expiry_event.py +3 -3
- lusid/models/fx_forward.py +3 -3
- lusid/models/fx_forward_settlement_event.py +3 -3
- lusid/models/fx_option.py +3 -3
- lusid/models/fx_swap.py +3 -3
- lusid/models/group_reconciliation_aggregate_attribute_rule.py +2 -2
- lusid/models/group_reconciliation_aggregate_attribute_values.py +86 -0
- lusid/models/group_reconciliation_aggregate_comparison_rule_operand.py +1 -1
- lusid/models/group_reconciliation_comparison_result.py +148 -0
- lusid/models/group_reconciliation_core_attribute_values.py +86 -0
- lusid/models/group_reconciliation_core_comparison_rule_operand.py +1 -1
- lusid/models/group_reconciliation_date_pair.py +81 -0
- lusid/models/group_reconciliation_dates.py +78 -0
- lusid/models/group_reconciliation_definition.py +136 -0
- lusid/models/group_reconciliation_definition_comparison_ruleset_ids.py +83 -0
- lusid/models/group_reconciliation_definition_currencies.py +71 -0
- lusid/models/group_reconciliation_definition_portfolio_entity_ids.py +86 -0
- lusid/models/group_reconciliation_definition_recipe_ids.py +78 -0
- lusid/models/group_reconciliation_instance_id.py +71 -0
- lusid/models/group_reconciliation_result_statuses.py +89 -0
- lusid/models/group_reconciliation_result_types.py +96 -0
- lusid/models/group_reconciliation_review_statuses.py +96 -0
- lusid/models/group_reconciliation_run_details.py +76 -0
- lusid/models/group_reconciliation_run_request.py +75 -0
- lusid/models/{metadata_key_value_response.py → group_reconciliation_run_response.py} +20 -29
- lusid/models/group_reconciliation_summary.py +121 -0
- lusid/models/group_reconciliation_user_review.py +112 -0
- lusid/models/group_reconciliation_user_review_add.py +88 -0
- lusid/models/group_reconciliation_user_review_break_code.py +80 -0
- lusid/models/group_reconciliation_user_review_comment.py +80 -0
- lusid/models/group_reconciliation_user_review_match_key.py +80 -0
- lusid/models/group_reconciliation_user_review_remove.py +88 -0
- lusid/models/holding_contributor.py +11 -4
- lusid/models/holding_ids_request.py +69 -0
- lusid/models/inflation_leg.py +3 -3
- lusid/models/inflation_linked_bond.py +3 -3
- lusid/models/inflation_swap.py +3 -3
- lusid/models/informational_error_event.py +3 -3
- lusid/models/informational_event.py +3 -3
- lusid/models/instrument.py +7 -1
- lusid/models/instrument_definition.py +8 -2
- lusid/models/instrument_event.py +17 -5
- lusid/models/instrument_event_holder.py +9 -1
- lusid/models/instrument_event_type.py +12 -0
- lusid/models/instrument_leg.py +3 -3
- lusid/models/instrument_list.py +3 -3
- lusid/models/instrument_type.py +2 -0
- lusid/models/interest_rate_swap.py +3 -3
- lusid/models/interest_rate_swaption.py +3 -3
- lusid/models/intermediate_securities_distribution_event.py +140 -0
- lusid/models/lapse_election.py +73 -0
- lusid/models/loan_facility.py +97 -0
- lusid/models/lusid_instrument.py +7 -5
- lusid/models/market_data_key_rule.py +5 -3
- lusid/models/market_data_specific_rule.py +5 -3
- lusid/models/mastered_instrument.py +139 -0
- lusid/models/maturity_event.py +3 -3
- lusid/models/mbs_coupon_event.py +102 -0
- lusid/models/mbs_interest_deferral_event.py +102 -0
- lusid/models/mbs_interest_shortfall_event.py +102 -0
- lusid/models/mbs_principal_event.py +102 -0
- lusid/models/mbs_principal_write_off_event.py +102 -0
- lusid/models/merger_event.py +22 -22
- lusid/models/new_instrument.py +1 -1
- lusid/models/open_event.py +3 -3
- lusid/models/option_exercise_cash_event.py +144 -0
- lusid/models/option_exercise_election.py +73 -0
- lusid/models/option_exercise_physical_event.py +149 -0
- lusid/models/output_transaction.py +9 -2
- lusid/models/paged_resource_list_of_group_reconciliation_comparison_result.py +113 -0
- lusid/models/paged_resource_list_of_group_reconciliation_comparison_ruleset.py +113 -0
- lusid/models/paged_resource_list_of_group_reconciliation_definition.py +113 -0
- lusid/models/portfolio.py +3 -3
- lusid/models/portfolio_details.py +3 -3
- lusid/models/portfolio_group_id_list.py +3 -3
- lusid/models/portfolio_id_list.py +3 -3
- lusid/models/portfolio_without_href.py +3 -3
- lusid/models/pricing_options.py +8 -2
- lusid/models/property_list.py +3 -3
- lusid/models/protection_payout_cash_flow_event.py +102 -0
- lusid/models/raw_vendor_event.py +3 -3
- lusid/models/reference_instrument.py +3 -3
- lusid/models/reference_list.py +6 -5
- lusid/models/reference_list_type.py +1 -0
- lusid/models/repo.py +3 -3
- lusid/models/reset_event.py +3 -3
- lusid/models/resource_list_of_change_interval.py +113 -0
- lusid/models/resource_list_of_output_transaction.py +113 -0
- lusid/models/return_zero_pv_options.py +69 -0
- lusid/models/reverse_stock_split_event.py +21 -7
- lusid/models/scrip_dividend_event.py +3 -3
- lusid/models/settlement_cycle.py +79 -0
- lusid/models/share_class_dealing_breakdown.py +3 -2
- lusid/models/share_class_details.py +18 -1
- lusid/models/simple_cash_flow_loan.py +3 -3
- lusid/models/simple_instrument.py +3 -3
- lusid/models/simple_rounding_convention.py +76 -0
- lusid/models/spin_off_event.py +3 -3
- lusid/models/staged_modification_effective_range.py +2 -2
- lusid/models/stock_dividend_event.py +20 -6
- lusid/models/stock_split_event.py +3 -3
- lusid/models/string_list.py +3 -3
- lusid/models/swap_cash_flow_event.py +3 -3
- lusid/models/swap_principal_event.py +3 -3
- lusid/models/target_tax_lot.py +23 -2
- lusid/models/target_tax_lot_request.py +23 -2
- lusid/models/tender_event.py +172 -0
- lusid/models/term_deposit.py +3 -3
- lusid/models/total_return_swap.py +4 -4
- lusid/models/transaction.py +9 -2
- lusid/models/transaction_date_windows.py +85 -0
- lusid/models/transaction_price.py +3 -3
- lusid/models/transaction_price_type.py +2 -0
- lusid/models/transaction_request.py +9 -2
- lusid/models/transition_event.py +3 -3
- lusid/models/trigger_event.py +3 -3
- lusid/models/update_fee_type_request.py +4 -4
- lusid/models/update_group_reconciliation_comparison_ruleset_request.py +91 -0
- lusid/models/update_group_reconciliation_definition_request.py +107 -0
- lusid/models/update_reference_data_request.py +87 -0
- lusid/models/update_staging_rule_set_request.py +1 -6
- lusid/models/upsert_custom_entities_response.py +20 -1
- lusid/models/upsert_reference_portfolio_constituent_properties_request.py +84 -0
- lusid/models/upsert_reference_portfolio_constituent_properties_response.py +115 -0
- lusid/models/valuation_point_data_query_parameters.py +3 -3
- lusid/models/valuation_point_data_response.py +8 -13
- lusid/rest.py +70 -20
- {lusid_sdk-2.1.405.dist-info → lusid_sdk-2.1.537.dist-info}/METADATA +118 -26
- {lusid_sdk-2.1.405.dist-info → lusid_sdk-2.1.537.dist-info}/RECORD +294 -226
- {lusid_sdk-2.1.405.dist-info → lusid_sdk-2.1.537.dist-info}/WHEEL +0 -0
@@ -18,16 +18,20 @@ import re # noqa: F401
|
|
18
18
|
import json
|
19
19
|
|
20
20
|
|
21
|
-
from typing import Any, Dict
|
22
|
-
from pydantic.v1 import BaseModel, Field
|
23
|
-
from lusid.models.
|
21
|
+
from typing import Any, Dict, List, Optional
|
22
|
+
from pydantic.v1 import BaseModel, Field, conlist
|
23
|
+
from lusid.models.batch_upsert_portfolio_access_metadata_response_item import BatchUpsertPortfolioAccessMetadataResponseItem
|
24
|
+
from lusid.models.error_detail import ErrorDetail
|
25
|
+
from lusid.models.link import Link
|
24
26
|
|
25
27
|
class BatchUpsertPortfolioAccessMetadataResponse(BaseModel):
|
26
28
|
"""
|
27
29
|
BatchUpsertPortfolioAccessMetadataResponse
|
28
30
|
"""
|
29
|
-
|
30
|
-
|
31
|
+
values: Optional[Dict[str, BatchUpsertPortfolioAccessMetadataResponseItem]] = Field(None, description="The items have been successfully updated or created.")
|
32
|
+
failed: Optional[Dict[str, ErrorDetail]] = Field(None, description="The items that could not be updated or created along with a reason for their failure.")
|
33
|
+
links: Optional[conlist(Link)] = None
|
34
|
+
__properties = ["values", "failed", "links"]
|
31
35
|
|
32
36
|
class Config:
|
33
37
|
"""Pydantic configuration"""
|
@@ -53,13 +57,42 @@ class BatchUpsertPortfolioAccessMetadataResponse(BaseModel):
|
|
53
57
|
exclude={
|
54
58
|
},
|
55
59
|
exclude_none=True)
|
56
|
-
# override the default output from pydantic by calling `to_dict()` of each value in
|
60
|
+
# override the default output from pydantic by calling `to_dict()` of each value in values (dict)
|
57
61
|
_field_dict = {}
|
58
|
-
if self.
|
59
|
-
for _key in self.
|
60
|
-
if self.
|
61
|
-
_field_dict[_key] = self.
|
62
|
-
_dict['
|
62
|
+
if self.values:
|
63
|
+
for _key in self.values:
|
64
|
+
if self.values[_key]:
|
65
|
+
_field_dict[_key] = self.values[_key].to_dict()
|
66
|
+
_dict['values'] = _field_dict
|
67
|
+
# override the default output from pydantic by calling `to_dict()` of each value in failed (dict)
|
68
|
+
_field_dict = {}
|
69
|
+
if self.failed:
|
70
|
+
for _key in self.failed:
|
71
|
+
if self.failed[_key]:
|
72
|
+
_field_dict[_key] = self.failed[_key].to_dict()
|
73
|
+
_dict['failed'] = _field_dict
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each item in links (list)
|
75
|
+
_items = []
|
76
|
+
if self.links:
|
77
|
+
for _item in self.links:
|
78
|
+
if _item:
|
79
|
+
_items.append(_item.to_dict())
|
80
|
+
_dict['links'] = _items
|
81
|
+
# set to None if values (nullable) is None
|
82
|
+
# and __fields_set__ contains the field
|
83
|
+
if self.values is None and "values" in self.__fields_set__:
|
84
|
+
_dict['values'] = None
|
85
|
+
|
86
|
+
# set to None if failed (nullable) is None
|
87
|
+
# and __fields_set__ contains the field
|
88
|
+
if self.failed is None and "failed" in self.__fields_set__:
|
89
|
+
_dict['failed'] = None
|
90
|
+
|
91
|
+
# set to None if links (nullable) is None
|
92
|
+
# and __fields_set__ contains the field
|
93
|
+
if self.links is None and "links" in self.__fields_set__:
|
94
|
+
_dict['links'] = None
|
95
|
+
|
63
96
|
return _dict
|
64
97
|
|
65
98
|
@classmethod
|
@@ -72,11 +105,18 @@ class BatchUpsertPortfolioAccessMetadataResponse(BaseModel):
|
|
72
105
|
return BatchUpsertPortfolioAccessMetadataResponse.parse_obj(obj)
|
73
106
|
|
74
107
|
_obj = BatchUpsertPortfolioAccessMetadataResponse.parse_obj({
|
75
|
-
"
|
76
|
-
(_k,
|
77
|
-
for _k, _v in obj.get("
|
108
|
+
"values": dict(
|
109
|
+
(_k, BatchUpsertPortfolioAccessMetadataResponseItem.from_dict(_v))
|
110
|
+
for _k, _v in obj.get("values").items()
|
111
|
+
)
|
112
|
+
if obj.get("values") is not None
|
113
|
+
else None,
|
114
|
+
"failed": dict(
|
115
|
+
(_k, ErrorDetail.from_dict(_v))
|
116
|
+
for _k, _v in obj.get("failed").items()
|
78
117
|
)
|
79
|
-
if obj.get("
|
80
|
-
else None
|
118
|
+
if obj.get("failed") is not None
|
119
|
+
else None,
|
120
|
+
"links": [Link.from_dict(_item) for _item in obj.get("links")] if obj.get("links") is not None else None
|
81
121
|
})
|
82
122
|
return _obj
|
lusid/models/{metadata_key_value.py → batch_upsert_portfolio_access_metadata_response_item.py}
RENAMED
@@ -21,13 +21,15 @@ import json
|
|
21
21
|
from typing import Any, Dict, List
|
22
22
|
from pydantic.v1 import BaseModel, Field, conlist
|
23
23
|
from lusid.models.access_metadata_value import AccessMetadataValue
|
24
|
+
from lusid.models.resource_id import ResourceId
|
24
25
|
|
25
|
-
class
|
26
|
+
class BatchUpsertPortfolioAccessMetadataResponseItem(BaseModel):
|
26
27
|
"""
|
27
|
-
|
28
|
+
BatchUpsertPortfolioAccessMetadataResponseItem
|
28
29
|
"""
|
30
|
+
portfolio_id: ResourceId = Field(..., alias="portfolioId")
|
29
31
|
metadata: Dict[str, conlist(AccessMetadataValue)] = Field(...)
|
30
|
-
__properties = ["metadata"]
|
32
|
+
__properties = ["portfolioId", "metadata"]
|
31
33
|
|
32
34
|
class Config:
|
33
35
|
"""Pydantic configuration"""
|
@@ -43,8 +45,8 @@ class MetadataKeyValue(BaseModel):
|
|
43
45
|
return json.dumps(self.to_dict())
|
44
46
|
|
45
47
|
@classmethod
|
46
|
-
def from_json(cls, json_str: str) ->
|
47
|
-
"""Create an instance of
|
48
|
+
def from_json(cls, json_str: str) -> BatchUpsertPortfolioAccessMetadataResponseItem:
|
49
|
+
"""Create an instance of BatchUpsertPortfolioAccessMetadataResponseItem from a JSON string"""
|
48
50
|
return cls.from_dict(json.loads(json_str))
|
49
51
|
|
50
52
|
def to_dict(self):
|
@@ -53,6 +55,9 @@ class MetadataKeyValue(BaseModel):
|
|
53
55
|
exclude={
|
54
56
|
},
|
55
57
|
exclude_none=True)
|
58
|
+
# override the default output from pydantic by calling `to_dict()` of portfolio_id
|
59
|
+
if self.portfolio_id:
|
60
|
+
_dict['portfolioId'] = self.portfolio_id.to_dict()
|
56
61
|
# override the default output from pydantic by calling `to_dict()` of each value in metadata (dict of array)
|
57
62
|
_field_dict_of_array = {}
|
58
63
|
if self.metadata:
|
@@ -65,15 +70,16 @@ class MetadataKeyValue(BaseModel):
|
|
65
70
|
return _dict
|
66
71
|
|
67
72
|
@classmethod
|
68
|
-
def from_dict(cls, obj: dict) ->
|
69
|
-
"""Create an instance of
|
73
|
+
def from_dict(cls, obj: dict) -> BatchUpsertPortfolioAccessMetadataResponseItem:
|
74
|
+
"""Create an instance of BatchUpsertPortfolioAccessMetadataResponseItem from a dict"""
|
70
75
|
if obj is None:
|
71
76
|
return None
|
72
77
|
|
73
78
|
if not isinstance(obj, dict):
|
74
|
-
return
|
79
|
+
return BatchUpsertPortfolioAccessMetadataResponseItem.parse_obj(obj)
|
75
80
|
|
76
|
-
_obj =
|
81
|
+
_obj = BatchUpsertPortfolioAccessMetadataResponseItem.parse_obj({
|
82
|
+
"portfolio_id": ResourceId.from_dict(obj.get("portfolioId")) if obj.get("portfolioId") is not None else None,
|
77
83
|
"metadata": dict(
|
78
84
|
(_k,
|
79
85
|
[AccessMetadataValue.from_dict(_item) for _item in _v]
|
lusid/models/bond.py
CHANGED
@@ -43,15 +43,15 @@ class Bond(LusidInstrument):
|
|
43
43
|
rounding_conventions: Optional[conlist(RoundingConvention)] = Field(None, alias="roundingConventions", description="Rounding conventions for analytics, if any.")
|
44
44
|
ex_dividend_configuration: Optional[ExDividendConfiguration] = Field(None, alias="exDividendConfiguration")
|
45
45
|
original_issue_price: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="originalIssuePrice", description="The price the bond was issued at. This is to be entered as a percentage of par, for example a value of 98.5 would represent 98.5%.")
|
46
|
-
instrument_type: StrictStr = Field(..., alias="instrumentType", description="The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashFlowsLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CapFloor, CashSettled, CdsIndex, Basket, FundingLeg, FxSwap, ForwardRateAgreement, SimpleInstrument, Repo, Equity, ExchangeTradedOption, ReferenceInstrument, ComplexBond, InflationLinkedBond, InflationSwap, SimpleCashFlowLoan, TotalReturnSwap, InflationLeg, FundShareClass, FlexibleLoan, UnsettledCash, Cash")
|
46
|
+
instrument_type: StrictStr = Field(..., alias="instrumentType", description="The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashFlowsLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CapFloor, CashSettled, CdsIndex, Basket, FundingLeg, FxSwap, ForwardRateAgreement, SimpleInstrument, Repo, Equity, ExchangeTradedOption, ReferenceInstrument, ComplexBond, InflationLinkedBond, InflationSwap, SimpleCashFlowLoan, TotalReturnSwap, InflationLeg, FundShareClass, FlexibleLoan, UnsettledCash, Cash, MasteredInstrument, LoanFacility")
|
47
47
|
additional_properties: Dict[str, Any] = {}
|
48
48
|
__properties = ["instrumentType", "startDate", "maturityDate", "domCcy", "flowConventions", "principal", "couponRate", "identifiers", "exDividendDays", "initialCouponDate", "firstCouponPayDate", "calculationType", "roundingConventions", "exDividendConfiguration", "originalIssuePrice"]
|
49
49
|
|
50
50
|
@validator('instrument_type')
|
51
51
|
def instrument_type_validate_enum(cls, value):
|
52
52
|
"""Validates the enum"""
|
53
|
-
if value not in ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash'):
|
54
|
-
raise ValueError("must be one of enum values ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash')")
|
53
|
+
if value not in ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility'):
|
54
|
+
raise ValueError("must be one of enum values ('QuotedSecurity', 'InterestRateSwap', 'FxForward', 'Future', 'ExoticInstrument', 'FxOption', 'CreditDefaultSwap', 'InterestRateSwaption', 'Bond', 'EquityOption', 'FixedLeg', 'FloatingLeg', 'BespokeCashFlowsLeg', 'Unknown', 'TermDeposit', 'ContractForDifference', 'EquitySwap', 'CashPerpetual', 'CapFloor', 'CashSettled', 'CdsIndex', 'Basket', 'FundingLeg', 'FxSwap', 'ForwardRateAgreement', 'SimpleInstrument', 'Repo', 'Equity', 'ExchangeTradedOption', 'ReferenceInstrument', 'ComplexBond', 'InflationLinkedBond', 'InflationSwap', 'SimpleCashFlowLoan', 'TotalReturnSwap', 'InflationLeg', 'FundShareClass', 'FlexibleLoan', 'UnsettledCash', 'Cash', 'MasteredInstrument', 'LoanFacility')")
|
55
55
|
return value
|
56
56
|
|
57
57
|
class Config:
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
18
18
|
import json
|
19
19
|
|
20
20
|
from datetime import datetime
|
21
|
-
from typing import Any, Dict, Union
|
21
|
+
from typing import Any, Dict, Optional, Union
|
22
22
|
from pydantic.v1 import Field, StrictFloat, StrictInt, StrictStr, validator
|
23
23
|
from lusid.models.instrument_event import InstrumentEvent
|
24
24
|
|
@@ -29,16 +29,16 @@ class BondCouponEvent(InstrumentEvent):
|
|
29
29
|
ex_date: datetime = Field(..., alias="exDate", description="Ex-Dividend date of the coupon payment")
|
30
30
|
payment_date: datetime = Field(..., alias="paymentDate", description="Payment date of the coupon payment")
|
31
31
|
currency: StrictStr = Field(..., description="Currency of the coupon payment")
|
32
|
-
coupon_per_unit: Union[StrictFloat, StrictInt] = Field(
|
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")
|
32
|
+
coupon_per_unit: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="couponPerUnit", description="CouponRate*Principal")
|
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, MbsCouponEvent, MbsPrincipalEvent, BonusIssueEvent, MbsPrincipalWriteOffEvent, MbsInterestDeferralEvent, MbsInterestShortfallEvent, TenderEvent, CallOnIntermediateSecuritiesEvent, IntermediateSecuritiesDistributionEvent, OptionExercisePhysicalEvent, OptionExerciseCashEvent, ProtectionPayoutCashFlowEvent")
|
34
34
|
additional_properties: Dict[str, Any] = {}
|
35
35
|
__properties = ["instrumentEventType", "exDate", "paymentDate", "currency", "couponPerUnit"]
|
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', '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')")
|
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', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent'):
|
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', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent')")
|
42
42
|
return value
|
43
43
|
|
44
44
|
class Config:
|
@@ -71,6 +71,11 @@ class BondCouponEvent(InstrumentEvent):
|
|
71
71
|
for _key, _value in self.additional_properties.items():
|
72
72
|
_dict[_key] = _value
|
73
73
|
|
74
|
+
# set to None if coupon_per_unit (nullable) is None
|
75
|
+
# and __fields_set__ contains the field
|
76
|
+
if self.coupon_per_unit is None and "coupon_per_unit" in self.__fields_set__:
|
77
|
+
_dict['couponPerUnit'] = None
|
78
|
+
|
74
79
|
return _dict
|
75
80
|
|
76
81
|
@classmethod
|
@@ -27,15 +27,15 @@ class BondDefaultEvent(InstrumentEvent):
|
|
27
27
|
Indicates when an issuer has defaulted on an obligation due to technical default, missed payments, or bankruptcy filing. # noqa: E501
|
28
28
|
"""
|
29
29
|
effective_date: datetime = Field(..., alias="effectiveDate", description="The date the bond default occurred.")
|
30
|
-
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")
|
30
|
+
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, MbsCouponEvent, MbsPrincipalEvent, BonusIssueEvent, MbsPrincipalWriteOffEvent, MbsInterestDeferralEvent, MbsInterestShortfallEvent, TenderEvent, CallOnIntermediateSecuritiesEvent, IntermediateSecuritiesDistributionEvent, OptionExercisePhysicalEvent, OptionExerciseCashEvent, ProtectionPayoutCashFlowEvent")
|
31
31
|
additional_properties: Dict[str, Any] = {}
|
32
32
|
__properties = ["instrumentEventType", "effectiveDate"]
|
33
33
|
|
34
34
|
@validator('instrument_event_type')
|
35
35
|
def instrument_event_type_validate_enum(cls, value):
|
36
36
|
"""Validates the enum"""
|
37
|
-
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'):
|
38
|
-
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')")
|
37
|
+
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', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent'):
|
38
|
+
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', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent')")
|
39
39
|
return value
|
40
40
|
|
41
41
|
class Config:
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
18
18
|
import json
|
19
19
|
|
20
20
|
from datetime import datetime
|
21
|
-
from typing import Any, Dict, Union
|
21
|
+
from typing import Any, Dict, Optional, Union
|
22
22
|
from pydantic.v1 import Field, StrictFloat, StrictInt, StrictStr, validator
|
23
23
|
from lusid.models.instrument_event import InstrumentEvent
|
24
24
|
|
@@ -29,16 +29,16 @@ class BondPrincipalEvent(InstrumentEvent):
|
|
29
29
|
currency: StrictStr = Field(..., description="Currency of the principal payment")
|
30
30
|
ex_date: datetime = Field(..., alias="exDate", description="Ex-Dividend date of the principal payment")
|
31
31
|
payment_date: datetime = Field(..., alias="paymentDate", description="Payment date of the principal payment")
|
32
|
-
principal_per_unit: Union[StrictFloat, StrictInt] = Field(
|
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")
|
32
|
+
principal_per_unit: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="principalPerUnit", description="Principal per unit")
|
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, MbsCouponEvent, MbsPrincipalEvent, BonusIssueEvent, MbsPrincipalWriteOffEvent, MbsInterestDeferralEvent, MbsInterestShortfallEvent, TenderEvent, CallOnIntermediateSecuritiesEvent, IntermediateSecuritiesDistributionEvent, OptionExercisePhysicalEvent, OptionExerciseCashEvent, ProtectionPayoutCashFlowEvent")
|
34
34
|
additional_properties: Dict[str, Any] = {}
|
35
35
|
__properties = ["instrumentEventType", "currency", "exDate", "paymentDate", "principalPerUnit"]
|
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', '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')")
|
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', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent'):
|
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', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent')")
|
42
42
|
return value
|
43
43
|
|
44
44
|
class Config:
|
@@ -71,6 +71,11 @@ class BondPrincipalEvent(InstrumentEvent):
|
|
71
71
|
for _key, _value in self.additional_properties.items():
|
72
72
|
_dict[_key] = _value
|
73
73
|
|
74
|
+
# set to None if principal_per_unit (nullable) is None
|
75
|
+
# and __fields_set__ contains the field
|
76
|
+
if self.principal_per_unit is None and "principal_per_unit" in self.__fields_set__:
|
77
|
+
_dict['principalPerUnit'] = None
|
78
|
+
|
74
79
|
return _dict
|
75
80
|
|
76
81
|
@classmethod
|
@@ -0,0 +1,166 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
LUSID API
|
5
|
+
|
6
|
+
FINBOURNE Technology # noqa: E501
|
7
|
+
|
8
|
+
Contact: info@finbourne.com
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
"""
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from datetime import datetime
|
21
|
+
from typing import Any, Dict, List, Optional, Union
|
22
|
+
from pydantic.v1 import Field, StrictFloat, StrictInt, StrictStr, conlist, validator
|
23
|
+
from lusid.models.cash_offer_election import CashOfferElection
|
24
|
+
from lusid.models.instrument_event import InstrumentEvent
|
25
|
+
from lusid.models.lapse_election import LapseElection
|
26
|
+
from lusid.models.security_offer_election import SecurityOfferElection
|
27
|
+
|
28
|
+
class BonusIssueEvent(InstrumentEvent):
|
29
|
+
"""
|
30
|
+
Representation of a Bonus Issue corporate action. # noqa: E501
|
31
|
+
"""
|
32
|
+
announcement_date: Optional[datetime] = Field(None, alias="announcementDate", description="The date the Bonus Issue is announced.")
|
33
|
+
ex_date: datetime = Field(..., alias="exDate", description="The ex-date of the Bonus Issue.")
|
34
|
+
record_date: Optional[datetime] = Field(None, alias="recordDate", description="The record date of the Bonus Issue.")
|
35
|
+
payment_date: datetime = Field(..., alias="paymentDate", description="The date the Bonus Issue is executed.")
|
36
|
+
fractional_units_cash_price: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="fractionalUnitsCashPrice", description="Optional. Used in calculating cash-in-lieu of fractional shares.")
|
37
|
+
fractional_units_cash_currency: Optional[StrictStr] = Field(None, alias="fractionalUnitsCashCurrency", description="Optional. Used in calculating cash-in-lieu of fractional shares.")
|
38
|
+
security_offer_elections: Optional[conlist(SecurityOfferElection)] = Field(None, alias="securityOfferElections", description="Possible SecurityElections for this Bonus Issue event, if any.")
|
39
|
+
cash_offer_elections: Optional[conlist(CashOfferElection)] = Field(None, alias="cashOfferElections", description="Possible CashOfferElections for this Bonus Issue event, if any.")
|
40
|
+
lapse_elections: Optional[conlist(LapseElection)] = Field(None, alias="lapseElections", description="Possible LapseElections for this Bonus Issue event, if any.")
|
41
|
+
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, MbsCouponEvent, MbsPrincipalEvent, BonusIssueEvent, MbsPrincipalWriteOffEvent, MbsInterestDeferralEvent, MbsInterestShortfallEvent, TenderEvent, CallOnIntermediateSecuritiesEvent, IntermediateSecuritiesDistributionEvent, OptionExercisePhysicalEvent, OptionExerciseCashEvent, ProtectionPayoutCashFlowEvent")
|
42
|
+
additional_properties: Dict[str, Any] = {}
|
43
|
+
__properties = ["instrumentEventType", "announcementDate", "exDate", "recordDate", "paymentDate", "fractionalUnitsCashPrice", "fractionalUnitsCashCurrency", "securityOfferElections", "cashOfferElections", "lapseElections"]
|
44
|
+
|
45
|
+
@validator('instrument_event_type')
|
46
|
+
def instrument_event_type_validate_enum(cls, value):
|
47
|
+
"""Validates the enum"""
|
48
|
+
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', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent'):
|
49
|
+
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', 'MbsCouponEvent', 'MbsPrincipalEvent', 'BonusIssueEvent', 'MbsPrincipalWriteOffEvent', 'MbsInterestDeferralEvent', 'MbsInterestShortfallEvent', 'TenderEvent', 'CallOnIntermediateSecuritiesEvent', 'IntermediateSecuritiesDistributionEvent', 'OptionExercisePhysicalEvent', 'OptionExerciseCashEvent', 'ProtectionPayoutCashFlowEvent')")
|
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) -> BonusIssueEvent:
|
67
|
+
"""Create an instance of BonusIssueEvent 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
|
+
"additional_properties"
|
75
|
+
},
|
76
|
+
exclude_none=True)
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of each item in security_offer_elections (list)
|
78
|
+
_items = []
|
79
|
+
if self.security_offer_elections:
|
80
|
+
for _item in self.security_offer_elections:
|
81
|
+
if _item:
|
82
|
+
_items.append(_item.to_dict())
|
83
|
+
_dict['securityOfferElections'] = _items
|
84
|
+
# override the default output from pydantic by calling `to_dict()` of each item in cash_offer_elections (list)
|
85
|
+
_items = []
|
86
|
+
if self.cash_offer_elections:
|
87
|
+
for _item in self.cash_offer_elections:
|
88
|
+
if _item:
|
89
|
+
_items.append(_item.to_dict())
|
90
|
+
_dict['cashOfferElections'] = _items
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of each item in lapse_elections (list)
|
92
|
+
_items = []
|
93
|
+
if self.lapse_elections:
|
94
|
+
for _item in self.lapse_elections:
|
95
|
+
if _item:
|
96
|
+
_items.append(_item.to_dict())
|
97
|
+
_dict['lapseElections'] = _items
|
98
|
+
# puts key-value pairs in additional_properties in the top level
|
99
|
+
if self.additional_properties is not None:
|
100
|
+
for _key, _value in self.additional_properties.items():
|
101
|
+
_dict[_key] = _value
|
102
|
+
|
103
|
+
# set to None if announcement_date (nullable) is None
|
104
|
+
# and __fields_set__ contains the field
|
105
|
+
if self.announcement_date is None and "announcement_date" in self.__fields_set__:
|
106
|
+
_dict['announcementDate'] = None
|
107
|
+
|
108
|
+
# set to None if record_date (nullable) is None
|
109
|
+
# and __fields_set__ contains the field
|
110
|
+
if self.record_date is None and "record_date" in self.__fields_set__:
|
111
|
+
_dict['recordDate'] = None
|
112
|
+
|
113
|
+
# set to None if fractional_units_cash_price (nullable) is None
|
114
|
+
# and __fields_set__ contains the field
|
115
|
+
if self.fractional_units_cash_price is None and "fractional_units_cash_price" in self.__fields_set__:
|
116
|
+
_dict['fractionalUnitsCashPrice'] = None
|
117
|
+
|
118
|
+
# set to None if fractional_units_cash_currency (nullable) is None
|
119
|
+
# and __fields_set__ contains the field
|
120
|
+
if self.fractional_units_cash_currency is None and "fractional_units_cash_currency" in self.__fields_set__:
|
121
|
+
_dict['fractionalUnitsCashCurrency'] = None
|
122
|
+
|
123
|
+
# set to None if security_offer_elections (nullable) is None
|
124
|
+
# and __fields_set__ contains the field
|
125
|
+
if self.security_offer_elections is None and "security_offer_elections" in self.__fields_set__:
|
126
|
+
_dict['securityOfferElections'] = None
|
127
|
+
|
128
|
+
# set to None if cash_offer_elections (nullable) is None
|
129
|
+
# and __fields_set__ contains the field
|
130
|
+
if self.cash_offer_elections is None and "cash_offer_elections" in self.__fields_set__:
|
131
|
+
_dict['cashOfferElections'] = None
|
132
|
+
|
133
|
+
# set to None if lapse_elections (nullable) is None
|
134
|
+
# and __fields_set__ contains the field
|
135
|
+
if self.lapse_elections is None and "lapse_elections" in self.__fields_set__:
|
136
|
+
_dict['lapseElections'] = None
|
137
|
+
|
138
|
+
return _dict
|
139
|
+
|
140
|
+
@classmethod
|
141
|
+
def from_dict(cls, obj: dict) -> BonusIssueEvent:
|
142
|
+
"""Create an instance of BonusIssueEvent from a dict"""
|
143
|
+
if obj is None:
|
144
|
+
return None
|
145
|
+
|
146
|
+
if not isinstance(obj, dict):
|
147
|
+
return BonusIssueEvent.parse_obj(obj)
|
148
|
+
|
149
|
+
_obj = BonusIssueEvent.parse_obj({
|
150
|
+
"instrument_event_type": obj.get("instrumentEventType"),
|
151
|
+
"announcement_date": obj.get("announcementDate"),
|
152
|
+
"ex_date": obj.get("exDate"),
|
153
|
+
"record_date": obj.get("recordDate"),
|
154
|
+
"payment_date": obj.get("paymentDate"),
|
155
|
+
"fractional_units_cash_price": obj.get("fractionalUnitsCashPrice"),
|
156
|
+
"fractional_units_cash_currency": obj.get("fractionalUnitsCashCurrency"),
|
157
|
+
"security_offer_elections": [SecurityOfferElection.from_dict(_item) for _item in obj.get("securityOfferElections")] if obj.get("securityOfferElections") is not None else None,
|
158
|
+
"cash_offer_elections": [CashOfferElection.from_dict(_item) for _item in obj.get("cashOfferElections")] if obj.get("cashOfferElections") is not None else None,
|
159
|
+
"lapse_elections": [LapseElection.from_dict(_item) for _item in obj.get("lapseElections")] if obj.get("lapseElections") is not None else None
|
160
|
+
})
|
161
|
+
# store additional fields in additional_properties
|
162
|
+
for _key in obj.keys():
|
163
|
+
if _key not in cls.__properties:
|
164
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
165
|
+
|
166
|
+
return _obj
|
@@ -18,16 +18,16 @@ import re # noqa: F401
|
|
18
18
|
import json
|
19
19
|
|
20
20
|
|
21
|
-
from typing import Any, Dict
|
22
|
-
from pydantic.v1 import BaseModel,
|
23
|
-
from lusid.models.
|
21
|
+
from typing import Any, Dict
|
22
|
+
from pydantic.v1 import BaseModel, Field
|
23
|
+
from lusid.models.resource_id import ResourceId
|
24
24
|
|
25
|
-
class
|
25
|
+
class BreakCodeSource(BaseModel):
|
26
26
|
"""
|
27
|
-
|
27
|
+
BreakCodeSource
|
28
28
|
"""
|
29
|
-
|
30
|
-
__properties = ["
|
29
|
+
data_type_id: ResourceId = Field(..., alias="dataTypeId")
|
30
|
+
__properties = ["dataTypeId"]
|
31
31
|
|
32
32
|
class Config:
|
33
33
|
"""Pydantic configuration"""
|
@@ -43,8 +43,8 @@ class ComponentRule(BaseModel):
|
|
43
43
|
return json.dumps(self.to_dict())
|
44
44
|
|
45
45
|
@classmethod
|
46
|
-
def from_json(cls, json_str: str) ->
|
47
|
-
"""Create an instance of
|
46
|
+
def from_json(cls, json_str: str) -> BreakCodeSource:
|
47
|
+
"""Create an instance of BreakCodeSource from a JSON string"""
|
48
48
|
return cls.from_dict(json.loads(json_str))
|
49
49
|
|
50
50
|
def to_dict(self):
|
@@ -53,25 +53,21 @@ class ComponentRule(BaseModel):
|
|
53
53
|
exclude={
|
54
54
|
},
|
55
55
|
exclude_none=True)
|
56
|
-
# override the default output from pydantic by calling `to_dict()` of
|
57
|
-
|
58
|
-
|
59
|
-
for _item in self.components:
|
60
|
-
if _item:
|
61
|
-
_items.append(_item.to_dict())
|
62
|
-
_dict['components'] = _items
|
56
|
+
# override the default output from pydantic by calling `to_dict()` of data_type_id
|
57
|
+
if self.data_type_id:
|
58
|
+
_dict['dataTypeId'] = self.data_type_id.to_dict()
|
63
59
|
return _dict
|
64
60
|
|
65
61
|
@classmethod
|
66
|
-
def from_dict(cls, obj: dict) ->
|
67
|
-
"""Create an instance of
|
62
|
+
def from_dict(cls, obj: dict) -> BreakCodeSource:
|
63
|
+
"""Create an instance of BreakCodeSource from a dict"""
|
68
64
|
if obj is None:
|
69
65
|
return None
|
70
66
|
|
71
67
|
if not isinstance(obj, dict):
|
72
|
-
return
|
68
|
+
return BreakCodeSource.parse_obj(obj)
|
73
69
|
|
74
|
-
_obj =
|
75
|
-
"
|
70
|
+
_obj = BreakCodeSource.parse_obj({
|
71
|
+
"data_type_id": ResourceId.from_dict(obj.get("dataTypeId")) if obj.get("dataTypeId") is not None else None
|
76
72
|
})
|
77
73
|
return _obj
|