Source code for sdk.lusid.models.dutch_auction_event

# coding: utf-8

"""
    LUSID API

    FINBOURNE Technology  # noqa: E501

    Contact: info@finbourne.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""


from __future__ import annotations
import pprint
import re  # noqa: F401
import json


from typing import List, Dict, Optional, Any, Union, TYPE_CHECKING
from typing_extensions import Annotated
from pydantic.v1 import BaseModel, StrictStr, StrictInt, StrictBool, StrictFloat, StrictBytes, Field, validator, ValidationError, conlist, constr
from datetime import datetime
from lusid.models.cash_and_security_offer_election import CashAndSecurityOfferElection
from lusid.models.instrument_event import InstrumentEvent
from lusid.models.lapse_election import LapseElection
from lusid.models.new_instrument import NewInstrument
from lusid.models.security_offer_election import SecurityOfferElection
from lusid.models.tender_offer_election import TenderOfferElection

[docs] class DutchAuctionEvent(InstrumentEvent): """ Dutch Auction Event (DTCH) — a voluntary corporate action with price-discovery, proration, and per-holder bid audit. Tri-modal: CASH (uniform clearing-price cash buyback via TenderOfferElection), SECU (clean security-for-security exchange via SecurityOfferElection), or CASE (security exchange with signed per-unit cash settlement via CashAndSecurityOfferElection). # noqa: E501 """ payment_date: Optional[datetime] = Field(default=None, description="Settlement date for both the security and cash legs of the auction.", alias="paymentDate") market_deadline_date: Optional[datetime] = Field(default=None, description="Issuer or acquirer instruction deadline.", alias="marketDeadlineDate") currency: StrictStr = Field(...,alias="currency", description="Event settlement currency (ISO 4217).") tender_offer_elections: Optional[List[TenderOfferElection]] = Field(default=None, description="List of possible TenderOfferElections for this event. Populated on the CASH path (Count == 1); empty on the SECU and CASE paths.", alias="tenderOfferElections") security_offer_elections: Optional[List[SecurityOfferElection]] = Field(default=None, description="List of possible SecurityOfferElections for this event. Populated on the SECU path (Count == 1); empty on the CASH and CASE paths.", alias="securityOfferElections") cash_and_security_offer_elections: Optional[List[CashAndSecurityOfferElection]] = Field(default=None, description="List of possible CashAndSecurityOfferElections for this event. Populated on the CASE path (Count == 1); empty on the CASH and SECU paths.", alias="cashAndSecurityOfferElections") lapse_elections: Optional[List[LapseElection]] = Field(default=None, description="List of possible LapseElections for this event. Required on all three paths (Count == 1). Allows the holder to opt out of the offer (NOAC).", alias="lapseElections") response_deadline_date: Optional[datetime] = Field(default=None, description="Account-servicer response deadline. Defaults to MarketDeadlineDate when not supplied. When provided, must be on or before MarketDeadlineDate.", alias="responseDeadlineDate") early_response_deadline: Optional[datetime] = Field(default=None, description="Early-participation deadline. When provided, must be on or before ResponseDeadlineDate.", alias="earlyResponseDeadline") ex_date: Optional[datetime] = Field(default=None, description="The ex date of the event. Optional; carried for cross-event consistency.", alias="exDate") record_date: Optional[datetime] = Field(default=None, description="The record date of the event. Optional and not required by AMI-SeCo for DTCH (the event is instruction-driven via QINS, not record-date-driven).", alias="recordDate") announcement_date: Optional[datetime] = Field(default=None, description="Public announcement date of the auction. Optional.", alias="announcementDate") target_quantity: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Total quantity of securities sought by the issuer or acquirer. Optional.", alias="targetQuantity") proration_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Proportional adjustment applied to the security and cash legs on all paths. Must be in (0, 1].", alias="prorationRate") new_instrument: Optional[NewInstrument] = Field(default=None, alias="newInstrument") fractional_units_cash_price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Cash-in-lieu price per fractional unit on the SECU and CASE paths. Null indicates round-down disposition of fractional remainders. Distinct from the CASE path's main cash settlement (which lives on CashAndSecurityOfferElection).", alias="fractionalUnitsCashPrice") fractional_units_cash_currency: Optional[StrictStr] = Field(None,alias="fractionalUnitsCashCurrency", description="Currency of the cash-in-lieu paid on fractional remainders on the SECU and CASE paths. Required when FractionalUnitsCashPrice is non-null.") bid_price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Per-holder bid price submitted at instruction time. Audit-only; no calculation impact.", alias="bidPrice") instrument_event_type: StrictStr = Field(...,alias="instrumentEventType", description="The Type of Event. Available 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, TermDepositInterestEvent, TermDepositPrincipalEvent, EarlyRedemptionEvent, FutureMarkToMarketEvent, AdjustGlobalCommitmentEvent, ContractInitialisationEvent, DrawdownEvent, LoanInterestRepaymentEvent, UpdateDepositAmountEvent, LoanPrincipalRepaymentEvent, DepositInterestPaymentEvent, DepositCloseEvent, LoanFacilityContractRolloverEvent, RepurchaseOfferEvent, RepoPartialClosureEvent, RepoCashFlowEvent, FlexibleRepoInterestPaymentEvent, FlexibleRepoCashFlowEvent, FlexibleRepoCollateralEvent, ConversionEvent, FlexibleRepoPartialClosureEvent, FlexibleRepoFullClosureEvent, CapletFloorletCashFlowEvent, EarlyCloseOutEvent, DepositRollEvent, ConsentEvent, DrawingEvent, CapitalGainsDistributionEvent, ExchangeOfferEvent, DutchAuctionEvent, WorthlessEvent.") additional_properties: Dict[str, Any] = {} __properties = ["instrumentEventType", "paymentDate", "marketDeadlineDate", "currency", "tenderOfferElections", "securityOfferElections", "cashAndSecurityOfferElections", "lapseElections", "responseDeadlineDate", "earlyResponseDeadline", "exDate", "recordDate", "announcementDate", "targetQuantity", "prorationRate", "newInstrument", "fractionalUnitsCashPrice", "fractionalUnitsCashCurrency", "bidPrice"]
[docs] @validator('instrument_event_type') def instrument_event_type_validate_enum(cls, value): """Validates the enum""" # Finbourne have removed enum validation on all models, except for this use case: # Workflow and notification application SDK use the property name 'type' as the discriminator on a number of classes. # During instantiation, the value of 'type' is checked against the enum values, # check it's a class that uses the 'type' property as a discriminator # list of classes can be found by searching for 'actual_instance: Union[' in the generated code if 'DutchAuctionEvent' not in [ # For notification application classes 'AmazonSqsNotificationType', 'AmazonSqsNotificationTypeResponse', 'AmazonSqsPrincipalAuthNotificationType', 'AmazonSqsPrincipalAuthNotificationTypeResponse', 'AzureServiceBusTypeResponse', 'AzureServiceBusNotificationType', 'EmailNotificationType', 'EmailNotificationTypeResponse', 'SmsNotificationType', 'SmsNotificationTypeResponse', 'WebhookNotificationType', 'WebhookNotificationTypeResponse', # For workflow application classes 'CreateChildTasksAction', 'RunWorkerAction', 'TriggerParentTaskAction', 'CreateChildTasksActionResponse', 'RunWorkerActionResponse', 'TriggerChildTasksAction', 'TriggerChildTasksActionResponse', 'TriggerParentTaskActionResponse', 'CreateNewTaskActivity', 'UpdateMatchingTasksActivity', 'CreateNewTaskActivityResponse', 'UpdateMatchingTasksActivityResponse', 'Fail', 'GroupReconciliation', 'HealthCheck', 'LuminesceView', 'SchedulerJob', 'Sleep', 'FailResponse', 'GroupReconciliationResponse', 'HealthCheckResponse', 'LuminesceViewResponse', 'SchedulerJobResponse', 'SleepResponse', 'Library', 'LibraryResponse', 'DayRegularity', 'RelativeMonthRegularity', 'SpecificMonthRegularity', 'WeekRegularity', 'YearRegularity', 'LusidEntityDataQualityCheck', 'LusidEntityDataQualityCheckResponse', 'TriggerChildTasksActionResponse']: return value # Only validate the 'type' property of the class if "instrument_event_type" != "type": return value 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', 'TermDepositInterestEvent', 'TermDepositPrincipalEvent', 'EarlyRedemptionEvent', 'FutureMarkToMarketEvent', 'AdjustGlobalCommitmentEvent', 'ContractInitialisationEvent', 'DrawdownEvent', 'LoanInterestRepaymentEvent', 'UpdateDepositAmountEvent', 'LoanPrincipalRepaymentEvent', 'DepositInterestPaymentEvent', 'DepositCloseEvent', 'LoanFacilityContractRolloverEvent', 'RepurchaseOfferEvent', 'RepoPartialClosureEvent', 'RepoCashFlowEvent', 'FlexibleRepoInterestPaymentEvent', 'FlexibleRepoCashFlowEvent', 'FlexibleRepoCollateralEvent', 'ConversionEvent', 'FlexibleRepoPartialClosureEvent', 'FlexibleRepoFullClosureEvent', 'CapletFloorletCashFlowEvent', 'EarlyCloseOutEvent', 'DepositRollEvent', 'ConsentEvent', 'DrawingEvent', 'CapitalGainsDistributionEvent', 'ExchangeOfferEvent', 'DutchAuctionEvent', 'WorthlessEvent']: 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', 'TermDepositInterestEvent', 'TermDepositPrincipalEvent', 'EarlyRedemptionEvent', 'FutureMarkToMarketEvent', 'AdjustGlobalCommitmentEvent', 'ContractInitialisationEvent', 'DrawdownEvent', 'LoanInterestRepaymentEvent', 'UpdateDepositAmountEvent', 'LoanPrincipalRepaymentEvent', 'DepositInterestPaymentEvent', 'DepositCloseEvent', 'LoanFacilityContractRolloverEvent', 'RepurchaseOfferEvent', 'RepoPartialClosureEvent', 'RepoCashFlowEvent', 'FlexibleRepoInterestPaymentEvent', 'FlexibleRepoCashFlowEvent', 'FlexibleRepoCollateralEvent', 'ConversionEvent', 'FlexibleRepoPartialClosureEvent', 'FlexibleRepoFullClosureEvent', 'CapletFloorletCashFlowEvent', 'EarlyCloseOutEvent', 'DepositRollEvent', 'ConsentEvent', 'DrawingEvent', 'CapitalGainsDistributionEvent', 'ExchangeOfferEvent', 'DutchAuctionEvent', 'WorthlessEvent')") return value
[docs] class Config: """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True
def __str__(self): """For `print` and `pprint`""" return pprint.pformat(self.dict(by_alias=False)) def __repr__(self): """For `print` and `pprint`""" return self.to_str()
[docs] def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.dict(by_alias=True))
[docs] def to_json(self) -> str: """Returns the JSON representation of the model using alias""" return json.dumps(self.to_dict())
[docs] @classmethod def from_json(cls, json_str: str) -> DutchAuctionEvent: """Create an instance of DutchAuctionEvent from a JSON string""" return cls.from_dict(json.loads(json_str))
[docs] def to_dict(self): """Returns the dictionary representation of the model using alias""" _dict = self.dict(by_alias=True, exclude={ "additional_properties" }, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in tender_offer_elections (list) _items = [] if self.tender_offer_elections: for _item in self.tender_offer_elections: if _item: _items.append(_item.to_dict()) _dict['tenderOfferElections'] = _items # override the default output from pydantic by calling `to_dict()` of each item in security_offer_elections (list) _items = [] if self.security_offer_elections: for _item in self.security_offer_elections: if _item: _items.append(_item.to_dict()) _dict['securityOfferElections'] = _items # override the default output from pydantic by calling `to_dict()` of each item in cash_and_security_offer_elections (list) _items = [] if self.cash_and_security_offer_elections: for _item in self.cash_and_security_offer_elections: if _item: _items.append(_item.to_dict()) _dict['cashAndSecurityOfferElections'] = _items # override the default output from pydantic by calling `to_dict()` of each item in lapse_elections (list) _items = [] if self.lapse_elections: for _item in self.lapse_elections: if _item: _items.append(_item.to_dict()) _dict['lapseElections'] = _items # override the default output from pydantic by calling `to_dict()` of new_instrument if self.new_instrument: _dict['newInstrument'] = self.new_instrument.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): _dict[_key] = _value # set to None if tender_offer_elections (nullable) is None # and __fields_set__ contains the field if self.tender_offer_elections is None and "tender_offer_elections" in self.__fields_set__: _dict['tenderOfferElections'] = None # set to None if security_offer_elections (nullable) is None # and __fields_set__ contains the field if self.security_offer_elections is None and "security_offer_elections" in self.__fields_set__: _dict['securityOfferElections'] = None # set to None if cash_and_security_offer_elections (nullable) is None # and __fields_set__ contains the field if self.cash_and_security_offer_elections is None and "cash_and_security_offer_elections" in self.__fields_set__: _dict['cashAndSecurityOfferElections'] = None # set to None if lapse_elections (nullable) is None # and __fields_set__ contains the field if self.lapse_elections is None and "lapse_elections" in self.__fields_set__: _dict['lapseElections'] = None # set to None if response_deadline_date (nullable) is None # and __fields_set__ contains the field if self.response_deadline_date is None and "response_deadline_date" in self.__fields_set__: _dict['responseDeadlineDate'] = None # set to None if early_response_deadline (nullable) is None # and __fields_set__ contains the field if self.early_response_deadline is None and "early_response_deadline" in self.__fields_set__: _dict['earlyResponseDeadline'] = None # set to None if ex_date (nullable) is None # and __fields_set__ contains the field if self.ex_date is None and "ex_date" in self.__fields_set__: _dict['exDate'] = None # set to None if record_date (nullable) is None # and __fields_set__ contains the field if self.record_date is None and "record_date" in self.__fields_set__: _dict['recordDate'] = None # set to None if announcement_date (nullable) is None # and __fields_set__ contains the field if self.announcement_date is None and "announcement_date" in self.__fields_set__: _dict['announcementDate'] = None # set to None if target_quantity (nullable) is None # and __fields_set__ contains the field if self.target_quantity is None and "target_quantity" in self.__fields_set__: _dict['targetQuantity'] = None # set to None if fractional_units_cash_price (nullable) is None # and __fields_set__ contains the field if self.fractional_units_cash_price is None and "fractional_units_cash_price" in self.__fields_set__: _dict['fractionalUnitsCashPrice'] = None # set to None if fractional_units_cash_currency (nullable) is None # and __fields_set__ contains the field if self.fractional_units_cash_currency is None and "fractional_units_cash_currency" in self.__fields_set__: _dict['fractionalUnitsCashCurrency'] = None # set to None if bid_price (nullable) is None # and __fields_set__ contains the field if self.bid_price is None and "bid_price" in self.__fields_set__: _dict['bidPrice'] = None return _dict
[docs] @classmethod def from_dict(cls, obj: dict) -> DutchAuctionEvent: """Create an instance of DutchAuctionEvent from a dict""" if obj is None: return None if not isinstance(obj, dict): return DutchAuctionEvent.parse_obj(obj) _obj = DutchAuctionEvent.parse_obj({ "instrument_event_type": obj.get("instrumentEventType"), "payment_date": obj.get("paymentDate"), "market_deadline_date": obj.get("marketDeadlineDate"), "currency": obj.get("currency"), "tender_offer_elections": [TenderOfferElection.from_dict(_item) for _item in obj.get("tenderOfferElections")] if obj.get("tenderOfferElections") is not None else None, "security_offer_elections": [SecurityOfferElection.from_dict(_item) for _item in obj.get("securityOfferElections")] if obj.get("securityOfferElections") is not None else None, "cash_and_security_offer_elections": [CashAndSecurityOfferElection.from_dict(_item) for _item in obj.get("cashAndSecurityOfferElections")] if obj.get("cashAndSecurityOfferElections") is not None else None, "lapse_elections": [LapseElection.from_dict(_item) for _item in obj.get("lapseElections")] if obj.get("lapseElections") is not None else None, "response_deadline_date": obj.get("responseDeadlineDate"), "early_response_deadline": obj.get("earlyResponseDeadline"), "ex_date": obj.get("exDate"), "record_date": obj.get("recordDate"), "announcement_date": obj.get("announcementDate"), "target_quantity": obj.get("targetQuantity"), "proration_rate": obj.get("prorationRate"), "new_instrument": NewInstrument.from_dict(obj.get("newInstrument")) if obj.get("newInstrument") is not None else None, "fractional_units_cash_price": obj.get("fractionalUnitsCashPrice"), "fractional_units_cash_currency": obj.get("fractionalUnitsCashCurrency"), "bid_price": obj.get("bidPrice") }) # store additional fields in additional_properties for _key in obj.keys(): if _key not in cls.__properties: _obj.additional_properties[_key] = obj.get(_key) return _obj
DutchAuctionEvent.update_forward_refs()