lusid-sdk 2.0.50b0__py3-none-any.whl → 2.0.470__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of lusid-sdk might be problematic. Click here for more details.
- lusid/__init__.py +1117 -14
- lusid/api/__init__.py +69 -0
- lusid/api/abor_api.py +513 -179
- lusid/api/abor_configuration_api.py +25 -24
- lusid/api/allocations_api.py +12 -20
- lusid/api/blocks_api.py +6 -6
- lusid/api/calendars_api.py +16 -24
- lusid/api/chart_of_accounts_api.py +1745 -441
- lusid/api/compliance_api.py +71 -62
- lusid/api/configuration_recipe_api.py +1198 -56
- lusid/api/corporate_action_sources_api.py +8 -8
- lusid/api/custom_entities_api.py +6 -6
- lusid/api/cut_label_definitions_api.py +9 -17
- lusid/api/data_types_api.py +16 -32
- lusid/api/executions_api.py +6 -6
- lusid/api/funds_api.py +1119 -0
- lusid/api/instrument_event_types_api.py +1287 -0
- lusid/api/instruments_api.py +12 -20
- lusid/api/legacy_compliance_api.py +12 -12
- lusid/api/legal_entities_api.py +12 -12
- lusid/api/order_graph_api.py +12 -12
- lusid/api/order_instructions_api.py +6 -6
- lusid/api/order_management_api.py +495 -14
- lusid/api/orders_api.py +16 -24
- lusid/api/packages_api.py +6 -6
- lusid/api/persons_api.py +16 -24
- lusid/api/placements_api.py +12 -12
- lusid/api/portfolio_groups_api.py +6 -6
- lusid/api/portfolios_api.py +23 -39
- lusid/api/property_definitions_api.py +205 -0
- lusid/api/queryable_keys_api.py +211 -0
- lusid/api/quotes_api.py +20 -36
- lusid/api/reconciliations_api.py +410 -1978
- lusid/api/schemas_api.py +7 -15
- lusid/api/scopes_api.py +151 -0
- lusid/api/scripted_translation_api.py +30 -28
- lusid/api/staging_rule_set_api.py +885 -0
- lusid/api/transaction_configuration_api.py +22 -22
- lusid/api/transaction_portfolios_api.py +282 -577
- lusid/api_client.py +5 -3
- lusid/configuration.py +1 -1
- lusid/extensions/__init__.py +10 -7
- lusid/extensions/api_client.py +3 -1
- lusid/extensions/api_client_factory.py +156 -45
- lusid/extensions/api_configuration.py +124 -15
- lusid/extensions/configuration_loaders.py +2 -4
- lusid/extensions/proxy_config.py +8 -5
- lusid/extensions/socket_keep_alive.py +14 -15
- lusid/extensions/tcp_keep_alive_connector.py +93 -46
- lusid/models/__init__.py +1028 -13
- lusid/models/abor.py +9 -2
- lusid/models/abor_configuration.py +8 -8
- lusid/models/abor_configuration_request.py +9 -9
- lusid/models/abor_request.py +1 -1
- lusid/models/account.py +6 -1
- lusid/models/accumulation_event.py +104 -0
- lusid/models/address_key_compliance_parameter.py +5 -12
- lusid/models/address_key_list_compliance_parameter.py +3 -3
- lusid/models/address_key_option_definition.py +3 -1
- lusid/models/amortisation_event.py +4 -6
- lusid/models/{underlying_leg.py → asset_leg.py} +15 -15
- lusid/models/basket.py +3 -3
- lusid/models/block_and_order_id_request.py +78 -0
- lusid/models/block_and_orders.py +83 -0
- lusid/models/block_and_orders_create_request.py +77 -0
- lusid/models/block_and_orders_request.py +134 -0
- lusid/models/blocked_order_request.py +130 -0
- lusid/models/bond.py +13 -6
- lusid/models/bond_coupon_event.py +97 -0
- lusid/models/bond_default_event.py +8 -18
- lusid/models/bond_principal_event.py +97 -0
- lusid/models/book_transactions_request.py +97 -0
- lusid/models/bool_compliance_parameter.py +3 -3
- lusid/models/bool_list_compliance_parameter.py +3 -3
- lusid/models/branch_step.py +101 -0
- lusid/models/cap_floor.py +3 -3
- lusid/models/cash_dividend_event.py +32 -10
- lusid/models/cash_election.py +91 -0
- lusid/models/cash_flow_event.py +5 -7
- lusid/models/cash_perpetual.py +3 -3
- lusid/models/cds_flow_conventions.py +1 -1
- lusid/models/cds_index.py +4 -4
- lusid/models/check_step.py +110 -0
- lusid/models/cleardown_module_details.py +95 -0
- lusid/models/cleardown_module_request.py +117 -0
- lusid/models/cleardown_module_response.py +139 -0
- lusid/models/cleardown_module_rule.py +94 -0
- lusid/models/{reconciliation_run_break.py → cleardown_module_rules_updated_response.py} +30 -36
- lusid/models/close_event.py +3 -3
- lusid/models/close_period_diary_entry_request.py +149 -0
- lusid/models/complete_portfolio.py +8 -1
- lusid/models/complex_bond.py +4 -4
- lusid/models/complex_market_data.py +6 -5
- lusid/models/compliance_parameter.py +8 -5
- lusid/models/compliance_parameter_type.py +3 -0
- lusid/models/compliance_rule_breakdown.py +16 -8
- lusid/models/compliance_rule_breakdown_request.py +12 -4
- lusid/models/compliance_rule_result_v2.py +85 -0
- lusid/models/compliance_step.py +99 -0
- lusid/models/compliance_step_type.py +42 -0
- lusid/models/compliance_summary_rule_result.py +12 -15
- lusid/models/compliance_summary_rule_result_request.py +12 -15
- lusid/models/compliance_template_variation.py +12 -2
- lusid/models/component_transaction.py +92 -0
- lusid/models/composite_dispersion.py +30 -5
- lusid/models/compounding.py +4 -4
- lusid/models/configuration_recipe.py +10 -19
- lusid/models/constant_volatility_surface.py +102 -0
- lusid/models/contract_for_difference.py +3 -3
- lusid/models/create_derived_property_definition_request.py +3 -3
- lusid/models/create_derived_transaction_portfolio_request.py +10 -3
- lusid/models/create_property_definition_request.py +12 -5
- lusid/models/create_staging_rule_set_request.py +91 -0
- lusid/models/create_trade_tickets_response.py +87 -0
- lusid/models/create_transaction_portfolio_request.py +16 -3
- lusid/models/credit_default_swap.py +4 -4
- lusid/models/credit_spread_curve_data.py +4 -4
- lusid/models/custom_entity_definition.py +8 -2
- lusid/models/custom_entity_type.py +8 -2
- lusid/models/cut_label_definition.py +7 -1
- lusid/models/data_type.py +7 -1
- lusid/models/data_type_summary.py +8 -2
- lusid/models/date_time_compliance_parameter.py +3 -3
- lusid/models/date_time_list_compliance_parameter.py +3 -3
- lusid/models/{upsert_reconciliation_run_request.py → day_month.py} +15 -15
- lusid/models/decimal_compliance_parameter.py +3 -3
- lusid/models/decimal_list_compliance_parameter.py +3 -3
- lusid/models/dialect.py +9 -3
- lusid/models/diary_entry.py +1 -1
- lusid/models/diary_entry_request.py +1 -1
- lusid/models/discount_factor_curve_data.py +3 -3
- lusid/models/dividend_option_event.py +129 -0
- lusid/models/dividend_reinvestment_event.py +124 -0
- lusid/models/election_specification.py +73 -0
- lusid/models/eligibility_calculation.py +71 -0
- lusid/models/empty_model_options.py +3 -3
- lusid/models/equity.py +8 -6
- lusid/models/equity_curve_by_prices_data.py +3 -3
- lusid/models/equity_model_options.py +3 -3
- lusid/models/equity_option.py +3 -3
- lusid/models/equity_swap.py +4 -4
- lusid/models/equity_vol_surface_data.py +3 -3
- lusid/models/exchange_traded_option.py +3 -3
- lusid/models/exercise_event.py +5 -7
- lusid/models/exotic_instrument.py +3 -3
- lusid/models/expiry_event.py +91 -0
- lusid/models/filter_predicate_compliance_parameter.py +91 -0
- lusid/models/filter_step.py +101 -0
- lusid/models/fixed_leg.py +3 -3
- lusid/models/fixed_schedule.py +4 -9
- lusid/models/flexible_loan.py +105 -0
- lusid/models/float_schedule.py +20 -12
- lusid/models/floating_leg.py +3 -3
- lusid/models/flow_convention_name.py +1 -1
- lusid/models/flow_conventions.py +1 -1
- lusid/models/forward_rate_agreement.py +3 -3
- lusid/models/from_recipe.py +81 -0
- lusid/models/fund.py +182 -0
- lusid/models/fund_properties.py +115 -0
- lusid/models/fund_request.py +165 -0
- lusid/models/fund_share_class.py +99 -0
- lusid/models/funding_leg.py +3 -3
- lusid/models/funding_leg_options.py +3 -3
- lusid/models/future.py +3 -3
- lusid/models/fx_conventions.py +73 -0
- lusid/models/fx_forward.py +8 -6
- lusid/models/fx_forward_curve_by_quote_reference.py +4 -4
- lusid/models/fx_forward_curve_data.py +3 -3
- lusid/models/fx_forward_model_options.py +3 -3
- lusid/models/fx_forward_pips_curve_data.py +3 -3
- lusid/models/fx_forward_settlement_event.py +136 -0
- lusid/models/fx_forward_tenor_curve_data.py +4 -4
- lusid/models/fx_forward_tenor_pips_curve_data.py +4 -4
- lusid/models/fx_linked_notional_schedule.py +108 -0
- lusid/models/fx_option.py +3 -3
- lusid/models/fx_rate_schedule.py +3 -3
- lusid/models/fx_swap.py +4 -4
- lusid/models/fx_vol_surface_data.py +3 -3
- lusid/models/{reconciliation_run.py → get_recipe_composer_response.py} +15 -15
- lusid/models/group_by_selector_compliance_parameter.py +91 -0
- lusid/models/group_by_step.py +101 -0
- lusid/models/group_filter_predicate_compliance_parameter.py +91 -0
- lusid/models/group_filter_step.py +110 -0
- lusid/models/group_of_market_data_key_rules.py +79 -0
- lusid/models/index_convention.py +1 -1
- lusid/models/index_model_options.py +3 -3
- lusid/models/inflation_index_conventions.py +2 -2
- lusid/models/inflation_leg.py +3 -3
- lusid/models/inflation_linked_bond.py +3 -3
- lusid/models/inflation_swap.py +4 -4
- lusid/models/informational_error_event.py +3 -3
- lusid/models/informational_event.py +4 -6
- lusid/models/instrument_event.py +13 -5
- lusid/models/instrument_event_configuration.py +74 -0
- lusid/models/instrument_event_holder.py +12 -3
- lusid/models/instrument_event_type.py +8 -0
- lusid/models/instrument_leg.py +3 -3
- lusid/models/instrument_list_compliance_parameter.py +3 -3
- lusid/models/instrument_payment_diary_leg.py +5 -3
- lusid/models/instrument_resolution_detail.py +105 -0
- lusid/models/instrument_type.py +2 -0
- lusid/models/interest_rate_swap.py +4 -4
- lusid/models/interest_rate_swaption.py +3 -3
- lusid/models/intermediate_compliance_step.py +110 -0
- lusid/models/ir_vol_cube_data.py +3 -3
- lusid/models/journal_entry_line.py +34 -3
- lusid/models/journal_entry_lines_query_parameters.py +1 -1
- lusid/models/label_value_set.py +1 -1
- lusid/models/leg_definition.py +16 -3
- lusid/models/lineage_member.py +87 -0
- lusid/models/lock_period_diary_entry_request.py +91 -0
- lusid/models/lusid_instrument.py +7 -5
- lusid/models/lusid_trade_ticket.py +8 -1
- lusid/models/market_context.py +17 -2
- lusid/models/market_data_type.py +1 -0
- lusid/models/maturity_event.py +91 -0
- lusid/models/model_options.py +5 -6
- lusid/models/model_options_type.py +0 -1
- lusid/models/model_selection.py +3 -3
- lusid/models/move_orders_to_different_blocks_request.py +77 -0
- lusid/models/moved_order_to_different_block_response.py +85 -0
- lusid/models/movement_type.py +2 -0
- lusid/models/multi_currency_amounts.py +71 -0
- lusid/models/opaque_market_data.py +3 -3
- lusid/models/opaque_model_options.py +3 -3
- lusid/models/open_event.py +3 -3
- lusid/models/optionality_schedule.py +3 -3
- lusid/models/order_graph_block.py +4 -2
- lusid/models/order_graph_block_order_detail.py +16 -2
- lusid/models/output_transaction.py +9 -2
- lusid/models/paged_resource_list_of_cleardown_module_response.py +113 -0
- lusid/models/{paged_resource_list_of_reconciliation_run_break.py → paged_resource_list_of_cleardown_module_rule.py} +11 -11
- lusid/models/{paged_resource_list_of_reconciliation_run.py → paged_resource_list_of_fund.py} +11 -11
- lusid/models/paged_resource_list_of_property_definition.py +113 -0
- lusid/models/paged_resource_list_of_staging_rule_set.py +113 -0
- lusid/models/paged_resource_list_of_transaction_template.py +113 -0
- lusid/models/paged_resource_list_of_transaction_template_specification.py +113 -0
- lusid/models/participation_request.py +3 -9
- lusid/models/performance_returns_metric.py +1 -1
- lusid/models/period_diary_entries_reopened_response.py +104 -0
- lusid/models/place_blocks_request.py +77 -0
- lusid/models/portfolio.py +15 -2
- lusid/models/portfolio_details.py +15 -2
- lusid/models/portfolio_group_id_compliance_parameter.py +3 -3
- lusid/models/portfolio_group_id_list_compliance_parameter.py +3 -3
- lusid/models/portfolio_holding.py +27 -2
- lusid/models/portfolio_id_compliance_parameter.py +3 -3
- lusid/models/portfolio_id_list_compliance_parameter.py +3 -3
- lusid/models/posting_module_rule.py +29 -4
- lusid/models/pricing_model.py +2 -1
- lusid/models/property_definition.py +17 -4
- lusid/models/property_definition_search_result.py +3 -3
- lusid/models/property_domain.py +3 -0
- lusid/models/property_key_compliance_parameter.py +3 -3
- lusid/models/property_key_list_compliance_parameter.py +3 -3
- lusid/models/queryable_key.py +124 -0
- lusid/models/raw_vendor_event.py +5 -7
- lusid/models/re_open_period_diary_entry_request.py +84 -0
- lusid/models/recipe_block.py +87 -0
- lusid/models/recipe_composer.py +100 -0
- lusid/models/{reconciliation_break_id.py → recipe_value.py} +22 -23
- lusid/models/recombine_step.py +101 -0
- lusid/models/reference_instrument.py +3 -3
- lusid/models/relative_date_offset.py +71 -0
- lusid/models/repo.py +3 -3
- lusid/models/reset_event.py +4 -6
- lusid/models/resource_list_of_block_and_orders.py +113 -0
- lusid/models/resource_list_of_get_recipe_composer_response.py +113 -0
- lusid/models/resource_list_of_moved_order_to_different_block_response.py +113 -0
- lusid/models/resource_list_of_queryable_key.py +113 -0
- lusid/models/schedule.py +6 -5
- lusid/models/schedule_type.py +1 -0
- lusid/models/script_map_reference.py +94 -0
- lusid/models/security_election.py +86 -0
- lusid/models/set_share_class_instruments_request.py +79 -0
- lusid/models/side_definition.py +1 -8
- lusid/models/sides_definition_request.py +1 -8
- lusid/models/simple_cash_flow_loan.py +3 -3
- lusid/models/simple_instrument.py +3 -3
- lusid/models/staging_rule.py +90 -0
- lusid/models/staging_rule_approval_criteria.py +81 -0
- lusid/models/staging_rule_match_criteria.py +95 -0
- lusid/models/staging_rule_set.py +103 -0
- lusid/models/step_schedule.py +3 -3
- lusid/models/stock_split_event.py +3 -3
- lusid/models/string_compliance_parameter.py +3 -3
- lusid/models/string_list_compliance_parameter.py +3 -3
- lusid/models/template_field.py +77 -0
- lusid/models/term_deposit.py +3 -3
- lusid/models/total_return_swap.py +16 -16
- lusid/models/transaction_configuration_movement_data.py +3 -3
- lusid/models/transaction_configuration_movement_data_request.py +3 -3
- lusid/models/transaction_currency_and_amount.py +81 -0
- lusid/models/transaction_field_map.py +97 -0
- lusid/models/transaction_price.py +3 -3
- lusid/models/transaction_price_and_type.py +81 -0
- lusid/models/transaction_price_type.py +1 -0
- lusid/models/transaction_property_map.py +80 -0
- lusid/models/transaction_template.py +100 -0
- lusid/models/transaction_template_request.py +79 -0
- lusid/models/transaction_template_specification.py +99 -0
- lusid/models/transaction_type_alias.py +0 -7
- lusid/models/transaction_type_calculation.py +1 -1
- lusid/models/transition_event.py +3 -3
- lusid/models/translation_context.py +75 -0
- lusid/models/translation_script.py +9 -3
- lusid/models/trial_balance.py +46 -11
- lusid/models/trial_balance_query_parameters.py +15 -6
- lusid/models/trigger_event.py +3 -3
- lusid/models/units_ratio.py +71 -0
- lusid/models/update_staging_rule_set_request.py +91 -0
- lusid/models/{compliance_run_summary.py → upsert_compliance_run_summary_result.py} +8 -8
- lusid/models/upsert_dialect_request.py +79 -0
- lusid/models/upsert_instrument_event_request.py +12 -3
- lusid/models/upsert_quote_request.py +1 -1
- lusid/models/upsert_recipe_composer_request.py +73 -0
- lusid/models/upsert_recipe_request.py +3 -9
- lusid/models/upsert_translation_script_request.py +75 -0
- lusid/models/valuation_schedule.py +10 -3
- lusid/models/weighted_instrument.py +13 -2
- lusid/models/weighted_instrument_in_line_lookup_identifiers.py +89 -0
- lusid/models/yield_curve_data.py +3 -3
- lusid/rest.py +1 -1
- {lusid_sdk-2.0.50b0.dist-info → lusid_sdk-2.0.470.dist-info}/METADATA +245 -48
- {lusid_sdk-2.0.50b0.dist-info → lusid_sdk-2.0.470.dist-info}/RECORD +326 -235
- {lusid_sdk-2.0.50b0.dist-info → lusid_sdk-2.0.470.dist-info}/WHEEL +1 -1
- lusid/extensions/api_client_builder.py +0 -138
- lusid/models/configuration_recipe_snippet.py +0 -139
- lusid/models/je_lines_query_parameters.py +0 -105
- lusid/models/look_up_pricing_model_options.py +0 -93
- lusid/models/reconciliation_run_id.py +0 -85
- lusid/models/upsert_reconciliation_break_request.py +0 -98
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
LUSID API
|
|
5
|
+
|
|
6
|
+
FINBOURNE Technology # noqa: E501
|
|
7
|
+
|
|
8
|
+
Contact: info@finbourne.com
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
from typing import Any, Dict, List
|
|
22
|
+
from pydantic import BaseModel, Field, conlist
|
|
23
|
+
from lusid.models.block import Block
|
|
24
|
+
from lusid.models.order import Order
|
|
25
|
+
|
|
26
|
+
class BlockAndOrders(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
BlockAndOrders
|
|
29
|
+
"""
|
|
30
|
+
block: Block = Field(...)
|
|
31
|
+
orders: conlist(Order) = Field(...)
|
|
32
|
+
__properties = ["block", "orders"]
|
|
33
|
+
|
|
34
|
+
class Config:
|
|
35
|
+
"""Pydantic configuration"""
|
|
36
|
+
allow_population_by_field_name = True
|
|
37
|
+
validate_assignment = True
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
return json.dumps(self.to_dict())
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_json(cls, json_str: str) -> BlockAndOrders:
|
|
49
|
+
"""Create an instance of BlockAndOrders from a JSON string"""
|
|
50
|
+
return cls.from_dict(json.loads(json_str))
|
|
51
|
+
|
|
52
|
+
def to_dict(self):
|
|
53
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
54
|
+
_dict = self.dict(by_alias=True,
|
|
55
|
+
exclude={
|
|
56
|
+
},
|
|
57
|
+
exclude_none=True)
|
|
58
|
+
# override the default output from pydantic by calling `to_dict()` of block
|
|
59
|
+
if self.block:
|
|
60
|
+
_dict['block'] = self.block.to_dict()
|
|
61
|
+
# override the default output from pydantic by calling `to_dict()` of each item in orders (list)
|
|
62
|
+
_items = []
|
|
63
|
+
if self.orders:
|
|
64
|
+
for _item in self.orders:
|
|
65
|
+
if _item:
|
|
66
|
+
_items.append(_item.to_dict())
|
|
67
|
+
_dict['orders'] = _items
|
|
68
|
+
return _dict
|
|
69
|
+
|
|
70
|
+
@classmethod
|
|
71
|
+
def from_dict(cls, obj: dict) -> BlockAndOrders:
|
|
72
|
+
"""Create an instance of BlockAndOrders from a dict"""
|
|
73
|
+
if obj is None:
|
|
74
|
+
return None
|
|
75
|
+
|
|
76
|
+
if not isinstance(obj, dict):
|
|
77
|
+
return BlockAndOrders.parse_obj(obj)
|
|
78
|
+
|
|
79
|
+
_obj = BlockAndOrders.parse_obj({
|
|
80
|
+
"block": Block.from_dict(obj.get("block")) if obj.get("block") is not None else None,
|
|
81
|
+
"orders": [Order.from_dict(_item) for _item in obj.get("orders")] if obj.get("orders") is not None else None
|
|
82
|
+
})
|
|
83
|
+
return _obj
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
LUSID API
|
|
5
|
+
|
|
6
|
+
FINBOURNE Technology # noqa: E501
|
|
7
|
+
|
|
8
|
+
Contact: info@finbourne.com
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
from typing import Any, Dict, List
|
|
22
|
+
from pydantic import BaseModel, Field, conlist
|
|
23
|
+
from lusid.models.block_and_orders_request import BlockAndOrdersRequest
|
|
24
|
+
|
|
25
|
+
class BlockAndOrdersCreateRequest(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
BlockAndOrdersCreateRequest
|
|
28
|
+
"""
|
|
29
|
+
requests: conlist(BlockAndOrdersRequest, max_items=100, min_items=1) = Field(..., description="A collection of BlockAndOrdersRequest.")
|
|
30
|
+
__properties = ["requests"]
|
|
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) -> BlockAndOrdersCreateRequest:
|
|
47
|
+
"""Create an instance of BlockAndOrdersCreateRequest 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 item in requests (list)
|
|
57
|
+
_items = []
|
|
58
|
+
if self.requests:
|
|
59
|
+
for _item in self.requests:
|
|
60
|
+
if _item:
|
|
61
|
+
_items.append(_item.to_dict())
|
|
62
|
+
_dict['requests'] = _items
|
|
63
|
+
return _dict
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_dict(cls, obj: dict) -> BlockAndOrdersCreateRequest:
|
|
67
|
+
"""Create an instance of BlockAndOrdersCreateRequest from a dict"""
|
|
68
|
+
if obj is None:
|
|
69
|
+
return None
|
|
70
|
+
|
|
71
|
+
if not isinstance(obj, dict):
|
|
72
|
+
return BlockAndOrdersCreateRequest.parse_obj(obj)
|
|
73
|
+
|
|
74
|
+
_obj = BlockAndOrdersCreateRequest.parse_obj({
|
|
75
|
+
"requests": [BlockAndOrdersRequest.from_dict(_item) for _item in obj.get("requests")] if obj.get("requests") is not None else None
|
|
76
|
+
})
|
|
77
|
+
return _obj
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
LUSID API
|
|
5
|
+
|
|
6
|
+
FINBOURNE Technology # noqa: E501
|
|
7
|
+
|
|
8
|
+
Contact: info@finbourne.com
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from typing import Any, Dict, List, Optional
|
|
22
|
+
from pydantic import BaseModel, Field, StrictStr, conlist, constr
|
|
23
|
+
from lusid.models.blocked_order_request import BlockedOrderRequest
|
|
24
|
+
from lusid.models.currency_and_amount import CurrencyAndAmount
|
|
25
|
+
from lusid.models.perpetual_property import PerpetualProperty
|
|
26
|
+
from lusid.models.resource_id import ResourceId
|
|
27
|
+
|
|
28
|
+
class BlockAndOrdersRequest(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
BlockAndOrdersRequest
|
|
31
|
+
"""
|
|
32
|
+
block_id: ResourceId = Field(..., alias="blockId")
|
|
33
|
+
orders: conlist(BlockedOrderRequest) = Field(..., description="An order which belongs to a block. Fields common to both entities (such as instrument) should be derived from the block.")
|
|
34
|
+
block_properties: Optional[Dict[str, PerpetualProperty]] = Field(None, alias="blockProperties", description="Client-defined properties associated with this block.")
|
|
35
|
+
instrument_identifiers: Dict[str, StrictStr] = Field(..., alias="instrumentIdentifiers", description="The instrument ordered.")
|
|
36
|
+
side: constr(strict=True, min_length=1) = Field(..., description="The client's representation of the block's side (buy, sell, short, etc)")
|
|
37
|
+
type: Optional[StrictStr] = Field(None, description="The block order's type (examples: Limit, Market, ...)")
|
|
38
|
+
time_in_force: Optional[StrictStr] = Field(None, alias="timeInForce", description="The block orders' time in force (examples: Day, GoodTilCancel, ...)")
|
|
39
|
+
var_date: Optional[datetime] = Field(None, alias="date", description="The date on which the block was made")
|
|
40
|
+
limit_price: Optional[CurrencyAndAmount] = Field(None, alias="limitPrice")
|
|
41
|
+
stop_price: Optional[CurrencyAndAmount] = Field(None, alias="stopPrice")
|
|
42
|
+
__properties = ["blockId", "orders", "blockProperties", "instrumentIdentifiers", "side", "type", "timeInForce", "date", "limitPrice", "stopPrice"]
|
|
43
|
+
|
|
44
|
+
class Config:
|
|
45
|
+
"""Pydantic configuration"""
|
|
46
|
+
allow_population_by_field_name = True
|
|
47
|
+
validate_assignment = True
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> BlockAndOrdersRequest:
|
|
59
|
+
"""Create an instance of BlockAndOrdersRequest from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self):
|
|
63
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
64
|
+
_dict = self.dict(by_alias=True,
|
|
65
|
+
exclude={
|
|
66
|
+
},
|
|
67
|
+
exclude_none=True)
|
|
68
|
+
# override the default output from pydantic by calling `to_dict()` of block_id
|
|
69
|
+
if self.block_id:
|
|
70
|
+
_dict['blockId'] = self.block_id.to_dict()
|
|
71
|
+
# override the default output from pydantic by calling `to_dict()` of each item in orders (list)
|
|
72
|
+
_items = []
|
|
73
|
+
if self.orders:
|
|
74
|
+
for _item in self.orders:
|
|
75
|
+
if _item:
|
|
76
|
+
_items.append(_item.to_dict())
|
|
77
|
+
_dict['orders'] = _items
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of each value in block_properties (dict)
|
|
79
|
+
_field_dict = {}
|
|
80
|
+
if self.block_properties:
|
|
81
|
+
for _key in self.block_properties:
|
|
82
|
+
if self.block_properties[_key]:
|
|
83
|
+
_field_dict[_key] = self.block_properties[_key].to_dict()
|
|
84
|
+
_dict['blockProperties'] = _field_dict
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of limit_price
|
|
86
|
+
if self.limit_price:
|
|
87
|
+
_dict['limitPrice'] = self.limit_price.to_dict()
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of stop_price
|
|
89
|
+
if self.stop_price:
|
|
90
|
+
_dict['stopPrice'] = self.stop_price.to_dict()
|
|
91
|
+
# set to None if block_properties (nullable) is None
|
|
92
|
+
# and __fields_set__ contains the field
|
|
93
|
+
if self.block_properties is None and "block_properties" in self.__fields_set__:
|
|
94
|
+
_dict['blockProperties'] = None
|
|
95
|
+
|
|
96
|
+
# set to None if type (nullable) is None
|
|
97
|
+
# and __fields_set__ contains the field
|
|
98
|
+
if self.type is None and "type" in self.__fields_set__:
|
|
99
|
+
_dict['type'] = None
|
|
100
|
+
|
|
101
|
+
# set to None if time_in_force (nullable) is None
|
|
102
|
+
# and __fields_set__ contains the field
|
|
103
|
+
if self.time_in_force is None and "time_in_force" in self.__fields_set__:
|
|
104
|
+
_dict['timeInForce'] = None
|
|
105
|
+
|
|
106
|
+
return _dict
|
|
107
|
+
|
|
108
|
+
@classmethod
|
|
109
|
+
def from_dict(cls, obj: dict) -> BlockAndOrdersRequest:
|
|
110
|
+
"""Create an instance of BlockAndOrdersRequest from a dict"""
|
|
111
|
+
if obj is None:
|
|
112
|
+
return None
|
|
113
|
+
|
|
114
|
+
if not isinstance(obj, dict):
|
|
115
|
+
return BlockAndOrdersRequest.parse_obj(obj)
|
|
116
|
+
|
|
117
|
+
_obj = BlockAndOrdersRequest.parse_obj({
|
|
118
|
+
"block_id": ResourceId.from_dict(obj.get("blockId")) if obj.get("blockId") is not None else None,
|
|
119
|
+
"orders": [BlockedOrderRequest.from_dict(_item) for _item in obj.get("orders")] if obj.get("orders") is not None else None,
|
|
120
|
+
"block_properties": dict(
|
|
121
|
+
(_k, PerpetualProperty.from_dict(_v))
|
|
122
|
+
for _k, _v in obj.get("blockProperties").items()
|
|
123
|
+
)
|
|
124
|
+
if obj.get("blockProperties") is not None
|
|
125
|
+
else None,
|
|
126
|
+
"instrument_identifiers": obj.get("instrumentIdentifiers"),
|
|
127
|
+
"side": obj.get("side"),
|
|
128
|
+
"type": obj.get("type"),
|
|
129
|
+
"time_in_force": obj.get("timeInForce"),
|
|
130
|
+
"var_date": obj.get("date"),
|
|
131
|
+
"limit_price": CurrencyAndAmount.from_dict(obj.get("limitPrice")) if obj.get("limitPrice") is not None else None,
|
|
132
|
+
"stop_price": CurrencyAndAmount.from_dict(obj.get("stopPrice")) if obj.get("stopPrice") is not None else None
|
|
133
|
+
})
|
|
134
|
+
return _obj
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
LUSID API
|
|
5
|
+
|
|
6
|
+
FINBOURNE Technology # noqa: E501
|
|
7
|
+
|
|
8
|
+
Contact: info@finbourne.com
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from typing import Any, Dict, Optional, Union
|
|
22
|
+
from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr
|
|
23
|
+
from lusid.models.currency_and_amount import CurrencyAndAmount
|
|
24
|
+
from lusid.models.perpetual_property import PerpetualProperty
|
|
25
|
+
from lusid.models.resource_id import ResourceId
|
|
26
|
+
|
|
27
|
+
class BlockedOrderRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
BlockedOrderRequest
|
|
30
|
+
"""
|
|
31
|
+
properties: Optional[Dict[str, PerpetualProperty]] = Field(None, description="Client-defined properties associated with this order.")
|
|
32
|
+
quantity: Union[StrictFloat, StrictInt] = Field(..., description="The quantity of given instrument ordered.")
|
|
33
|
+
order_book_id: Optional[ResourceId] = Field(None, alias="orderBookId")
|
|
34
|
+
portfolio_id: Optional[ResourceId] = Field(None, alias="portfolioId")
|
|
35
|
+
id: ResourceId = Field(...)
|
|
36
|
+
state: Optional[StrictStr] = Field(None, description="The order's state (examples: New, PartiallyFilled, ...)")
|
|
37
|
+
var_date: Optional[datetime] = Field(None, alias="date", description="The date on which the order was made")
|
|
38
|
+
price: Optional[CurrencyAndAmount] = None
|
|
39
|
+
order_instruction: Optional[ResourceId] = Field(None, alias="orderInstruction")
|
|
40
|
+
package: Optional[ResourceId] = None
|
|
41
|
+
__properties = ["properties", "quantity", "orderBookId", "portfolioId", "id", "state", "date", "price", "orderInstruction", "package"]
|
|
42
|
+
|
|
43
|
+
class Config:
|
|
44
|
+
"""Pydantic configuration"""
|
|
45
|
+
allow_population_by_field_name = True
|
|
46
|
+
validate_assignment = True
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
return json.dumps(self.to_dict())
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> BlockedOrderRequest:
|
|
58
|
+
"""Create an instance of BlockedOrderRequest from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self):
|
|
62
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
63
|
+
_dict = self.dict(by_alias=True,
|
|
64
|
+
exclude={
|
|
65
|
+
},
|
|
66
|
+
exclude_none=True)
|
|
67
|
+
# override the default output from pydantic by calling `to_dict()` of each value in properties (dict)
|
|
68
|
+
_field_dict = {}
|
|
69
|
+
if self.properties:
|
|
70
|
+
for _key in self.properties:
|
|
71
|
+
if self.properties[_key]:
|
|
72
|
+
_field_dict[_key] = self.properties[_key].to_dict()
|
|
73
|
+
_dict['properties'] = _field_dict
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of order_book_id
|
|
75
|
+
if self.order_book_id:
|
|
76
|
+
_dict['orderBookId'] = self.order_book_id.to_dict()
|
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of portfolio_id
|
|
78
|
+
if self.portfolio_id:
|
|
79
|
+
_dict['portfolioId'] = self.portfolio_id.to_dict()
|
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of id
|
|
81
|
+
if self.id:
|
|
82
|
+
_dict['id'] = self.id.to_dict()
|
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of price
|
|
84
|
+
if self.price:
|
|
85
|
+
_dict['price'] = self.price.to_dict()
|
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of order_instruction
|
|
87
|
+
if self.order_instruction:
|
|
88
|
+
_dict['orderInstruction'] = self.order_instruction.to_dict()
|
|
89
|
+
# override the default output from pydantic by calling `to_dict()` of package
|
|
90
|
+
if self.package:
|
|
91
|
+
_dict['package'] = self.package.to_dict()
|
|
92
|
+
# set to None if properties (nullable) is None
|
|
93
|
+
# and __fields_set__ contains the field
|
|
94
|
+
if self.properties is None and "properties" in self.__fields_set__:
|
|
95
|
+
_dict['properties'] = None
|
|
96
|
+
|
|
97
|
+
# set to None if state (nullable) is None
|
|
98
|
+
# and __fields_set__ contains the field
|
|
99
|
+
if self.state is None and "state" in self.__fields_set__:
|
|
100
|
+
_dict['state'] = None
|
|
101
|
+
|
|
102
|
+
return _dict
|
|
103
|
+
|
|
104
|
+
@classmethod
|
|
105
|
+
def from_dict(cls, obj: dict) -> BlockedOrderRequest:
|
|
106
|
+
"""Create an instance of BlockedOrderRequest from a dict"""
|
|
107
|
+
if obj is None:
|
|
108
|
+
return None
|
|
109
|
+
|
|
110
|
+
if not isinstance(obj, dict):
|
|
111
|
+
return BlockedOrderRequest.parse_obj(obj)
|
|
112
|
+
|
|
113
|
+
_obj = BlockedOrderRequest.parse_obj({
|
|
114
|
+
"properties": dict(
|
|
115
|
+
(_k, PerpetualProperty.from_dict(_v))
|
|
116
|
+
for _k, _v in obj.get("properties").items()
|
|
117
|
+
)
|
|
118
|
+
if obj.get("properties") is not None
|
|
119
|
+
else None,
|
|
120
|
+
"quantity": obj.get("quantity"),
|
|
121
|
+
"order_book_id": ResourceId.from_dict(obj.get("orderBookId")) if obj.get("orderBookId") is not None else None,
|
|
122
|
+
"portfolio_id": ResourceId.from_dict(obj.get("portfolioId")) if obj.get("portfolioId") is not None else None,
|
|
123
|
+
"id": ResourceId.from_dict(obj.get("id")) if obj.get("id") is not None else None,
|
|
124
|
+
"state": obj.get("state"),
|
|
125
|
+
"var_date": obj.get("date"),
|
|
126
|
+
"price": CurrencyAndAmount.from_dict(obj.get("price")) if obj.get("price") is not None else None,
|
|
127
|
+
"order_instruction": ResourceId.from_dict(obj.get("orderInstruction")) if obj.get("orderInstruction") is not None else None,
|
|
128
|
+
"package": ResourceId.from_dict(obj.get("package")) if obj.get("package") is not None else None
|
|
129
|
+
})
|
|
130
|
+
return _obj
|
lusid/models/bond.py
CHANGED
|
@@ -37,20 +37,21 @@ class Bond(LusidInstrument):
|
|
|
37
37
|
coupon_rate: Union[StrictFloat, StrictInt] = Field(..., alias="couponRate", description="Simple coupon rate.")
|
|
38
38
|
identifiers: Optional[Dict[str, StrictStr]] = Field(None, description="External market codes and identifiers for the bond, e.g. ISIN.")
|
|
39
39
|
ex_dividend_days: Optional[StrictInt] = Field(None, alias="exDividendDays", description="Optional. Number of calendar days in the ex-dividend period. If the settlement date falls in the ex-dividend period then the coupon paid is zero and the accrued interest is negative. If set, this must be a non-negative number. If not set, or set to 0, then there is no ex-dividend period. NOTE: This field is deprecated. If you wish to set the ExDividendDays on a bond, please use the ExDividendConfiguration.")
|
|
40
|
-
initial_coupon_date: Optional[datetime] = Field(None, alias="initialCouponDate", description="Optional. If set, this is the date at which the bond begins to accrue interest,
|
|
40
|
+
initial_coupon_date: Optional[datetime] = Field(None, alias="initialCouponDate", description="Optional and to be DEPRECATED. If set, this is the date at which the bond begins to accrue interest. Instead, this information should be entered in the field StartDate.")
|
|
41
41
|
first_coupon_pay_date: Optional[datetime] = Field(None, alias="firstCouponPayDate", description="The date that the first coupon of the bond is paid. This is required for bonds that have a long first coupon or short first coupon. The first coupon pay date is used as an anchor to compare with the start date and determine if this is a long/short coupon period.")
|
|
42
42
|
calculation_type: Optional[StrictStr] = Field(None, alias="calculationType", description="The calculation type applied to the bond coupon amount. This is required for bonds that have a particular type of computing the period coupon, such as simple compounding, irregular coupons etc. The default CalculationType is `Standard`, which returns a coupon amount equal to Principal * Coupon Rate / Coupon Frequency. Coupon Frequency is 12M / Payment Frequency. Payment Frequency can be 1M, 3M, 6M, 12M etc. So Coupon Frequency can be 12, 4, 2, 1 respectively. Supported string (enumeration) values are: [Standard, DayCountCoupon, NoCalculationFloater, BrazilFixedCoupon].")
|
|
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")
|
|
46
47
|
additional_properties: Dict[str, Any] = {}
|
|
47
|
-
__properties = ["instrumentType", "startDate", "maturityDate", "domCcy", "flowConventions", "principal", "couponRate", "identifiers", "exDividendDays", "initialCouponDate", "firstCouponPayDate", "calculationType", "roundingConventions", "exDividendConfiguration"]
|
|
48
|
+
__properties = ["instrumentType", "startDate", "maturityDate", "domCcy", "flowConventions", "principal", "couponRate", "identifiers", "exDividendDays", "initialCouponDate", "firstCouponPayDate", "calculationType", "roundingConventions", "exDividendConfiguration", "originalIssuePrice"]
|
|
48
49
|
|
|
49
50
|
@validator('instrument_type')
|
|
50
51
|
def instrument_type_validate_enum(cls, value):
|
|
51
52
|
"""Validates the enum"""
|
|
52
|
-
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'):
|
|
53
|
-
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')")
|
|
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'):
|
|
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')")
|
|
54
55
|
return value
|
|
55
56
|
|
|
56
57
|
class Config:
|
|
@@ -126,6 +127,11 @@ class Bond(LusidInstrument):
|
|
|
126
127
|
if self.rounding_conventions is None and "rounding_conventions" in self.__fields_set__:
|
|
127
128
|
_dict['roundingConventions'] = None
|
|
128
129
|
|
|
130
|
+
# set to None if original_issue_price (nullable) is None
|
|
131
|
+
# and __fields_set__ contains the field
|
|
132
|
+
if self.original_issue_price is None and "original_issue_price" in self.__fields_set__:
|
|
133
|
+
_dict['originalIssuePrice'] = None
|
|
134
|
+
|
|
129
135
|
return _dict
|
|
130
136
|
|
|
131
137
|
@classmethod
|
|
@@ -151,7 +157,8 @@ class Bond(LusidInstrument):
|
|
|
151
157
|
"first_coupon_pay_date": obj.get("firstCouponPayDate"),
|
|
152
158
|
"calculation_type": obj.get("calculationType"),
|
|
153
159
|
"rounding_conventions": [RoundingConvention.from_dict(_item) for _item in obj.get("roundingConventions")] if obj.get("roundingConventions") is not None else None,
|
|
154
|
-
"ex_dividend_configuration": ExDividendConfiguration.from_dict(obj.get("exDividendConfiguration")) if obj.get("exDividendConfiguration") is not None else None
|
|
160
|
+
"ex_dividend_configuration": ExDividendConfiguration.from_dict(obj.get("exDividendConfiguration")) if obj.get("exDividendConfiguration") is not None else None,
|
|
161
|
+
"original_issue_price": obj.get("originalIssuePrice")
|
|
155
162
|
})
|
|
156
163
|
# store additional fields in additional_properties
|
|
157
164
|
for _key in obj.keys():
|
|
@@ -0,0 +1,97 @@
|
|
|
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, Union
|
|
22
|
+
from pydantic import Field, StrictFloat, StrictInt, StrictStr, validator
|
|
23
|
+
from lusid.models.instrument_event import InstrumentEvent
|
|
24
|
+
|
|
25
|
+
class BondCouponEvent(InstrumentEvent):
|
|
26
|
+
"""
|
|
27
|
+
Definition of a Bond Coupon Event This is an event that describes the occurence of a cashflow due to a fixed rate bond coupon payment. # noqa: E501
|
|
28
|
+
"""
|
|
29
|
+
ex_date: datetime = Field(..., alias="exDate", description="Ex-Dividend date of the coupon payment")
|
|
30
|
+
payment_date: datetime = Field(..., alias="paymentDate", description="Payment date of the coupon payment")
|
|
31
|
+
currency: StrictStr = Field(..., description="Currency of the coupon payment")
|
|
32
|
+
coupon_per_unit: Union[StrictFloat, StrictInt] = Field(..., 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")
|
|
34
|
+
additional_properties: Dict[str, Any] = {}
|
|
35
|
+
__properties = ["instrumentEventType", "exDate", "paymentDate", "currency", "couponPerUnit"]
|
|
36
|
+
|
|
37
|
+
@validator('instrument_event_type')
|
|
38
|
+
def instrument_event_type_validate_enum(cls, value):
|
|
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'):
|
|
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')")
|
|
42
|
+
return value
|
|
43
|
+
|
|
44
|
+
class Config:
|
|
45
|
+
"""Pydantic configuration"""
|
|
46
|
+
allow_population_by_field_name = True
|
|
47
|
+
validate_assignment = True
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> BondCouponEvent:
|
|
59
|
+
"""Create an instance of BondCouponEvent from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self):
|
|
63
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
64
|
+
_dict = self.dict(by_alias=True,
|
|
65
|
+
exclude={
|
|
66
|
+
"additional_properties"
|
|
67
|
+
},
|
|
68
|
+
exclude_none=True)
|
|
69
|
+
# puts key-value pairs in additional_properties in the top level
|
|
70
|
+
if self.additional_properties is not None:
|
|
71
|
+
for _key, _value in self.additional_properties.items():
|
|
72
|
+
_dict[_key] = _value
|
|
73
|
+
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: dict) -> BondCouponEvent:
|
|
78
|
+
"""Create an instance of BondCouponEvent from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return BondCouponEvent.parse_obj(obj)
|
|
84
|
+
|
|
85
|
+
_obj = BondCouponEvent.parse_obj({
|
|
86
|
+
"instrument_event_type": obj.get("instrumentEventType"),
|
|
87
|
+
"ex_date": obj.get("exDate"),
|
|
88
|
+
"payment_date": obj.get("paymentDate"),
|
|
89
|
+
"currency": obj.get("currency"),
|
|
90
|
+
"coupon_per_unit": obj.get("couponPerUnit")
|
|
91
|
+
})
|
|
92
|
+
# store additional fields in additional_properties
|
|
93
|
+
for _key in obj.keys():
|
|
94
|
+
if _key not in cls.__properties:
|
|
95
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
96
|
+
|
|
97
|
+
return _obj
|
|
@@ -18,29 +18,24 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from typing import Any, Dict
|
|
22
|
-
from pydantic import Field,
|
|
21
|
+
from typing import Any, Dict
|
|
22
|
+
from pydantic import Field, StrictStr, validator
|
|
23
23
|
from lusid.models.instrument_event import InstrumentEvent
|
|
24
24
|
|
|
25
25
|
class BondDefaultEvent(InstrumentEvent):
|
|
26
26
|
"""
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
default_status: constr(strict=True, min_length=1) = Field(..., alias="defaultStatus", description="The status of the bond default (i.e., technical or default) Supported string (enumeration) values are: [Technical, Default].")
|
|
32
|
-
default_type: constr(strict=True, min_length=1) = Field(..., alias="defaultType", description="The type of the default. (coupon payment, principal payment, covenant ...) Supported string (enumeration) values are: [CouponPayment, CouponAndPrincipalPayment, PrincipalPayment, Covenant, Bankruptcy, BuyBackOption].")
|
|
33
|
-
grace_end_date: datetime = Field(..., alias="graceEndDate", description="Date the grace period for making coupon payment ends.")
|
|
34
|
-
payment_date: datetime = Field(..., alias="paymentDate", description="The date the coupon payment was missed.")
|
|
35
|
-
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")
|
|
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")
|
|
36
31
|
additional_properties: Dict[str, Any] = {}
|
|
37
|
-
__properties = ["instrumentEventType", "
|
|
32
|
+
__properties = ["instrumentEventType", "effectiveDate"]
|
|
38
33
|
|
|
39
34
|
@validator('instrument_event_type')
|
|
40
35
|
def instrument_event_type_validate_enum(cls, value):
|
|
41
36
|
"""Validates the enum"""
|
|
42
|
-
if value not in ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent'):
|
|
43
|
-
raise ValueError("must be one of enum values ('TransitionEvent', 'InformationalEvent', 'OpenEvent', 'CloseEvent', 'StockSplitEvent', 'BondDefaultEvent', 'CashDividendEvent', 'AmortisationEvent', 'CashFlowEvent', 'ExerciseEvent', 'ResetEvent', 'TriggerEvent', 'RawVendorEvent', 'InformationalErrorEvent')")
|
|
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'):
|
|
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')")
|
|
44
39
|
return value
|
|
45
40
|
|
|
46
41
|
class Config:
|
|
@@ -86,12 +81,7 @@ class BondDefaultEvent(InstrumentEvent):
|
|
|
86
81
|
|
|
87
82
|
_obj = BondDefaultEvent.parse_obj({
|
|
88
83
|
"instrument_event_type": obj.get("instrumentEventType"),
|
|
89
|
-
"
|
|
90
|
-
"coupon_paid_date": obj.get("couponPaidDate"),
|
|
91
|
-
"default_status": obj.get("defaultStatus"),
|
|
92
|
-
"default_type": obj.get("defaultType"),
|
|
93
|
-
"grace_end_date": obj.get("graceEndDate"),
|
|
94
|
-
"payment_date": obj.get("paymentDate")
|
|
84
|
+
"effective_date": obj.get("effectiveDate")
|
|
95
85
|
})
|
|
96
86
|
# store additional fields in additional_properties
|
|
97
87
|
for _key in obj.keys():
|