module Data.FpML.V53.IRD
( module Data.FpML.V53.IRD
, module Data.FpML.V53.Asset
) where
import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))
import Text.XML.HaXml.Schema.Schema as Schema
import Text.XML.HaXml.OneOfN
import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd
import Data.FpML.V53.Asset
data BondReference = BondReference
{ bondRef_bond :: Maybe Bond
, bondRef_conditionPrecedentBond :: Maybe Xsd.Boolean
, bondRef_discrepancyClause :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType BondReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return BondReference
`apply` optional (elementBond)
`apply` optional (parseSchemaType "conditionPrecedentBond")
`apply` optional (parseSchemaType "discrepancyClause")
schemaTypeToXML s x@BondReference{} =
toXMLElement s []
[ maybe [] (elementToXMLBond) $ bondRef_bond x
, maybe [] (schemaTypeToXML "conditionPrecedentBond") $ bondRef_conditionPrecedentBond x
, maybe [] (schemaTypeToXML "discrepancyClause") $ bondRef_discrepancyClause x
]
data BulletPayment = BulletPayment
{ bulletPayment_ID :: Maybe Xsd.ID
, bulletPayment_primaryAssetClass :: Maybe AssetClass
, bulletPayment_secondaryAssetClass :: [AssetClass]
, bulletPayment_productType :: [ProductType]
, bulletPayment_productId :: [ProductId]
, bulletPayment_payment :: Maybe Payment
}
deriving (Eq,Show)
instance SchemaType BulletPayment where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (BulletPayment a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "payment")
schemaTypeToXML s x@BulletPayment{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ bulletPayment_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ bulletPayment_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ bulletPayment_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ bulletPayment_productType x
, concatMap (schemaTypeToXML "productId") $ bulletPayment_productId x
, maybe [] (schemaTypeToXML "payment") $ bulletPayment_payment x
]
instance Extension BulletPayment Product where
supertype v = Product_BulletPayment v
data Calculation = Calculation
{ calculation_choice0 :: OneOf2 Notional FxLinkedNotionalSchedule
, calculation_choice1 :: OneOf2 (Schedule,(Maybe (FutureValueAmount))) Rate
, calculation_dayCountFraction :: DayCountFraction
, calculation_discounting :: Maybe Discounting
, calculation_compoundingMethod :: Maybe CompoundingMethodEnum
}
deriving (Eq,Show)
instance SchemaType Calculation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Calculation
`apply` oneOf' [ ("Notional", fmap OneOf2 (parseSchemaType "notionalSchedule"))
, ("FxLinkedNotionalSchedule", fmap TwoOf2 (parseSchemaType "fxLinkedNotionalSchedule"))
]
`apply` oneOf' [ ("Schedule Maybe FutureValueAmount", fmap OneOf2 (return (,) `apply` parseSchemaType "fixedRateSchedule"
`apply` optional (parseSchemaType "futureValueNotional")))
, ("Rate", fmap TwoOf2 (elementRateCalculation))
]
`apply` parseSchemaType "dayCountFraction"
`apply` optional (parseSchemaType "discounting")
`apply` optional (parseSchemaType "compoundingMethod")
schemaTypeToXML s x@Calculation{} =
toXMLElement s []
[ foldOneOf2 (schemaTypeToXML "notionalSchedule")
(schemaTypeToXML "fxLinkedNotionalSchedule")
$ calculation_choice0 x
, foldOneOf2 (\ (a,b) -> concat [ schemaTypeToXML "fixedRateSchedule" a
, maybe [] (schemaTypeToXML "futureValueNotional") b
])
(elementToXMLRateCalculation)
$ calculation_choice1 x
, schemaTypeToXML "dayCountFraction" $ calculation_dayCountFraction x
, maybe [] (schemaTypeToXML "discounting") $ calculation_discounting x
, maybe [] (schemaTypeToXML "compoundingMethod") $ calculation_compoundingMethod x
]
data CalculationPeriod = CalculationPeriod
{ calcPeriod_ID :: Maybe Xsd.ID
, calcPeriod_unadjustedStartDate :: Maybe Xsd.Date
, calcPeriod_unadjustedEndDate :: Maybe Xsd.Date
, calcPeriod_adjustedStartDate :: Maybe Xsd.Date
, calcPeriod_adjustedEndDate :: Maybe Xsd.Date
, calculationPeriod_numberOfDays :: Maybe Xsd.PositiveInteger
, calcPeriod_choice5 :: (Maybe (OneOf2 Xsd.Decimal FxLinkedNotionalAmount))
, calcPeriod_choice6 :: (Maybe (OneOf2 FloatingRateDefinition Xsd.Decimal))
, calcPeriod_dayCountYearFraction :: Maybe Xsd.Decimal
, calcPeriod_forecastAmount :: Maybe Money
, calcPeriod_forecastRate :: Maybe Xsd.Decimal
}
deriving (Eq,Show)
instance SchemaType CalculationPeriod where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CalculationPeriod a0)
`apply` optional (parseSchemaType "unadjustedStartDate")
`apply` optional (parseSchemaType "unadjustedEndDate")
`apply` optional (parseSchemaType "adjustedStartDate")
`apply` optional (parseSchemaType "adjustedEndDate")
`apply` optional (parseSchemaType "calculationPeriodNumberOfDays")
`apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "notionalAmount"))
, ("FxLinkedNotionalAmount", fmap TwoOf2 (parseSchemaType "fxLinkedNotionalAmount"))
])
`apply` optional (oneOf' [ ("FloatingRateDefinition", fmap OneOf2 (parseSchemaType "floatingRateDefinition"))
, ("Xsd.Decimal", fmap TwoOf2 (parseSchemaType "fixedRate"))
])
`apply` optional (parseSchemaType "dayCountYearFraction")
`apply` optional (parseSchemaType "forecastAmount")
`apply` optional (parseSchemaType "forecastRate")
schemaTypeToXML s x@CalculationPeriod{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ calcPeriod_ID x
]
[ maybe [] (schemaTypeToXML "unadjustedStartDate") $ calcPeriod_unadjustedStartDate x
, maybe [] (schemaTypeToXML "unadjustedEndDate") $ calcPeriod_unadjustedEndDate x
, maybe [] (schemaTypeToXML "adjustedStartDate") $ calcPeriod_adjustedStartDate x
, maybe [] (schemaTypeToXML "adjustedEndDate") $ calcPeriod_adjustedEndDate x
, maybe [] (schemaTypeToXML "calculationPeriodNumberOfDays") $ calculationPeriod_numberOfDays x
, maybe [] (foldOneOf2 (schemaTypeToXML "notionalAmount")
(schemaTypeToXML "fxLinkedNotionalAmount")
) $ calcPeriod_choice5 x
, maybe [] (foldOneOf2 (schemaTypeToXML "floatingRateDefinition")
(schemaTypeToXML "fixedRate")
) $ calcPeriod_choice6 x
, maybe [] (schemaTypeToXML "dayCountYearFraction") $ calcPeriod_dayCountYearFraction x
, maybe [] (schemaTypeToXML "forecastAmount") $ calcPeriod_forecastAmount x
, maybe [] (schemaTypeToXML "forecastRate") $ calcPeriod_forecastRate x
]
data CalculationPeriodAmount = CalculationPeriodAmount
{ calcPeriodAmount_choice0 :: OneOf2 Calculation AmountSchedule
}
deriving (Eq,Show)
instance SchemaType CalculationPeriodAmount where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CalculationPeriodAmount
`apply` oneOf' [ ("Calculation", fmap OneOf2 (parseSchemaType "calculation"))
, ("AmountSchedule", fmap TwoOf2 (parseSchemaType "knownAmountSchedule"))
]
schemaTypeToXML s x@CalculationPeriodAmount{} =
toXMLElement s []
[ foldOneOf2 (schemaTypeToXML "calculation")
(schemaTypeToXML "knownAmountSchedule")
$ calcPeriodAmount_choice0 x
]
data CalculationPeriodDates = CalculationPeriodDates
{ calcPeriodDates_ID :: Maybe Xsd.ID
, calcPeriodDates_choice0 :: OneOf2 AdjustableDate AdjustedRelativeDateOffset
, calcPeriodDates_choice1 :: OneOf2 AdjustableDate RelativeDateOffset
, calculationPeriodDates_adjustments :: Maybe BusinessDayAdjustments
, calcPeriodDates_firstPeriodStartDate :: Maybe AdjustableDate
, calcPeriodDates_firstRegularPeriodStartDate :: Maybe Xsd.Date
, calcPeriodDates_firstCompoundingPeriodEndDate :: Maybe Xsd.Date
, calcPeriodDates_lastRegularPeriodEndDate :: Maybe Xsd.Date
, calcPeriodDates_stubPeriodType :: Maybe StubPeriodTypeEnum
, calcPeriodDates_calculationPeriodFrequency :: Maybe CalculationPeriodFrequency
}
deriving (Eq,Show)
instance SchemaType CalculationPeriodDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CalculationPeriodDates a0)
`apply` oneOf' [ ("AdjustableDate", fmap OneOf2 (parseSchemaType "effectiveDate"))
, ("AdjustedRelativeDateOffset", fmap TwoOf2 (parseSchemaType "relativeEffectiveDate"))
]
`apply` oneOf' [ ("AdjustableDate", fmap OneOf2 (parseSchemaType "terminationDate"))
, ("RelativeDateOffset", fmap TwoOf2 (parseSchemaType "relativeTerminationDate"))
]
`apply` optional (parseSchemaType "calculationPeriodDatesAdjustments")
`apply` optional (parseSchemaType "firstPeriodStartDate")
`apply` optional (parseSchemaType "firstRegularPeriodStartDate")
`apply` optional (parseSchemaType "firstCompoundingPeriodEndDate")
`apply` optional (parseSchemaType "lastRegularPeriodEndDate")
`apply` optional (parseSchemaType "stubPeriodType")
`apply` optional (parseSchemaType "calculationPeriodFrequency")
schemaTypeToXML s x@CalculationPeriodDates{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ calcPeriodDates_ID x
]
[ foldOneOf2 (schemaTypeToXML "effectiveDate")
(schemaTypeToXML "relativeEffectiveDate")
$ calcPeriodDates_choice0 x
, foldOneOf2 (schemaTypeToXML "terminationDate")
(schemaTypeToXML "relativeTerminationDate")
$ calcPeriodDates_choice1 x
, maybe [] (schemaTypeToXML "calculationPeriodDatesAdjustments") $ calculationPeriodDates_adjustments x
, maybe [] (schemaTypeToXML "firstPeriodStartDate") $ calcPeriodDates_firstPeriodStartDate x
, maybe [] (schemaTypeToXML "firstRegularPeriodStartDate") $ calcPeriodDates_firstRegularPeriodStartDate x
, maybe [] (schemaTypeToXML "firstCompoundingPeriodEndDate") $ calcPeriodDates_firstCompoundingPeriodEndDate x
, maybe [] (schemaTypeToXML "lastRegularPeriodEndDate") $ calcPeriodDates_lastRegularPeriodEndDate x
, maybe [] (schemaTypeToXML "stubPeriodType") $ calcPeriodDates_stubPeriodType x
, maybe [] (schemaTypeToXML "calculationPeriodFrequency") $ calcPeriodDates_calculationPeriodFrequency x
]
data CalculationPeriodDatesReference = CalculationPeriodDatesReference
{ calcPeriodDatesRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType CalculationPeriodDatesReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (CalculationPeriodDatesReference a0)
schemaTypeToXML s x@CalculationPeriodDatesReference{} =
toXMLElement s [ toXMLAttribute "href" $ calcPeriodDatesRef_href x
]
[]
instance Extension CalculationPeriodDatesReference Reference where
supertype v = Reference_CalculationPeriodDatesReference v
data CancelableProvision = CancelableProvision
{ cancelProvis_buyerPartyReference :: Maybe PartyReference
, cancelProvis_buyerAccountReference :: Maybe AccountReference
, cancelProvis_sellerPartyReference :: Maybe PartyReference
, cancelProvis_sellerAccountReference :: Maybe AccountReference
, cancelProvis_exercise :: Maybe Exercise
, cancelProvis_exerciseNotice :: Maybe ExerciseNotice
, cancelProvis_followUpConfirmation :: Maybe Xsd.Boolean
, cancelableProvision_adjustedDates :: Maybe CancelableProvisionAdjustedDates
, cancelProvis_finalCalculationPeriodDateAdjustment :: [FinalCalculationPeriodDateAdjustment]
, cancelProvis_initialFee :: Maybe SimplePayment
}
deriving (Eq,Show)
instance SchemaType CancelableProvision where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CancelableProvision
`apply` optional (parseSchemaType "buyerPartyReference")
`apply` optional (parseSchemaType "buyerAccountReference")
`apply` optional (parseSchemaType "sellerPartyReference")
`apply` optional (parseSchemaType "sellerAccountReference")
`apply` optional (elementExercise)
`apply` optional (parseSchemaType "exerciseNotice")
`apply` optional (parseSchemaType "followUpConfirmation")
`apply` optional (parseSchemaType "cancelableProvisionAdjustedDates")
`apply` many (parseSchemaType "finalCalculationPeriodDateAdjustment")
`apply` optional (parseSchemaType "initialFee")
schemaTypeToXML s x@CancelableProvision{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "buyerPartyReference") $ cancelProvis_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ cancelProvis_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ cancelProvis_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ cancelProvis_sellerAccountReference x
, maybe [] (elementToXMLExercise) $ cancelProvis_exercise x
, maybe [] (schemaTypeToXML "exerciseNotice") $ cancelProvis_exerciseNotice x
, maybe [] (schemaTypeToXML "followUpConfirmation") $ cancelProvis_followUpConfirmation x
, maybe [] (schemaTypeToXML "cancelableProvisionAdjustedDates") $ cancelableProvision_adjustedDates x
, concatMap (schemaTypeToXML "finalCalculationPeriodDateAdjustment") $ cancelProvis_finalCalculationPeriodDateAdjustment x
, maybe [] (schemaTypeToXML "initialFee") $ cancelProvis_initialFee x
]
data CancelableProvisionAdjustedDates = CancelableProvisionAdjustedDates
{ cancelProvisAdjustDates_cancellationEvent :: [CancellationEvent]
}
deriving (Eq,Show)
instance SchemaType CancelableProvisionAdjustedDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CancelableProvisionAdjustedDates
`apply` many (parseSchemaType "cancellationEvent")
schemaTypeToXML s x@CancelableProvisionAdjustedDates{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "cancellationEvent") $ cancelProvisAdjustDates_cancellationEvent x
]
data CancellationEvent = CancellationEvent
{ cancelEvent_ID :: Maybe Xsd.ID
, cancelEvent_adjustedExerciseDate :: Maybe Xsd.Date
, cancelEvent_adjustedEarlyTerminationDate :: Maybe Xsd.Date
}
deriving (Eq,Show)
instance SchemaType CancellationEvent where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CancellationEvent a0)
`apply` optional (parseSchemaType "adjustedExerciseDate")
`apply` optional (parseSchemaType "adjustedEarlyTerminationDate")
schemaTypeToXML s x@CancellationEvent{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ cancelEvent_ID x
]
[ maybe [] (schemaTypeToXML "adjustedExerciseDate") $ cancelEvent_adjustedExerciseDate x
, maybe [] (schemaTypeToXML "adjustedEarlyTerminationDate") $ cancelEvent_adjustedEarlyTerminationDate x
]
data CapFloor = CapFloor
{ capFloor_ID :: Maybe Xsd.ID
, capFloor_primaryAssetClass :: Maybe AssetClass
, capFloor_secondaryAssetClass :: [AssetClass]
, capFloor_productType :: [ProductType]
, capFloor_productId :: [ProductId]
, capFloor_stream :: Maybe InterestRateStream
, capFloor_premium :: [Payment]
, capFloor_additionalPayment :: [Payment]
, capFloor_earlyTerminationProvision :: Maybe EarlyTerminationProvision
}
deriving (Eq,Show)
instance SchemaType CapFloor where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CapFloor a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "capFloorStream")
`apply` many (parseSchemaType "premium")
`apply` many (parseSchemaType "additionalPayment")
`apply` optional (parseSchemaType "earlyTerminationProvision")
schemaTypeToXML s x@CapFloor{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ capFloor_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ capFloor_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ capFloor_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ capFloor_productType x
, concatMap (schemaTypeToXML "productId") $ capFloor_productId x
, maybe [] (schemaTypeToXML "capFloorStream") $ capFloor_stream x
, concatMap (schemaTypeToXML "premium") $ capFloor_premium x
, concatMap (schemaTypeToXML "additionalPayment") $ capFloor_additionalPayment x
, maybe [] (schemaTypeToXML "earlyTerminationProvision") $ capFloor_earlyTerminationProvision x
]
instance Extension CapFloor Product where
supertype v = Product_CapFloor v
data Cashflows = Cashflows
{ cashflows_matchParameters :: Maybe Xsd.Boolean
, cashflows_principalExchange :: [PrincipalExchange]
, cashflows_paymentCalculationPeriod :: [PaymentCalculationPeriod]
}
deriving (Eq,Show)
instance SchemaType Cashflows where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Cashflows
`apply` optional (parseSchemaType "cashflowsMatchParameters")
`apply` many (parseSchemaType "principalExchange")
`apply` many (parseSchemaType "paymentCalculationPeriod")
schemaTypeToXML s x@Cashflows{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "cashflowsMatchParameters") $ cashflows_matchParameters x
, concatMap (schemaTypeToXML "principalExchange") $ cashflows_principalExchange x
, concatMap (schemaTypeToXML "paymentCalculationPeriod") $ cashflows_paymentCalculationPeriod x
]
data CashPriceMethod = CashPriceMethod
{ cashPriceMethod_cashSettlementReferenceBanks :: Maybe CashSettlementReferenceBanks
, cashPriceMethod_cashSettlementCurrency :: Maybe Currency
, cashPriceMethod_quotationRateType :: Maybe QuotationRateTypeEnum
}
deriving (Eq,Show)
instance SchemaType CashPriceMethod where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CashPriceMethod
`apply` optional (parseSchemaType "cashSettlementReferenceBanks")
`apply` optional (parseSchemaType "cashSettlementCurrency")
`apply` optional (parseSchemaType "quotationRateType")
schemaTypeToXML s x@CashPriceMethod{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "cashSettlementReferenceBanks") $ cashPriceMethod_cashSettlementReferenceBanks x
, maybe [] (schemaTypeToXML "cashSettlementCurrency") $ cashPriceMethod_cashSettlementCurrency x
, maybe [] (schemaTypeToXML "quotationRateType") $ cashPriceMethod_quotationRateType x
]
data CashSettlement = CashSettlement
{ cashSettl_ID :: Maybe Xsd.ID
, cashSettlement_valuationTime :: Maybe BusinessCenterTime
, cashSettlement_valuationDate :: Maybe RelativeDateOffset
, cashSettlement_paymentDate :: Maybe CashSettlementPaymentDate
, cashSettl_choice3 :: (Maybe (OneOf7 CashPriceMethod CashPriceMethod YieldCurveMethod YieldCurveMethod YieldCurveMethod CrossCurrencyMethod YieldCurveMethod))
}
deriving (Eq,Show)
instance SchemaType CashSettlement where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CashSettlement a0)
`apply` optional (parseSchemaType "cashSettlementValuationTime")
`apply` optional (parseSchemaType "cashSettlementValuationDate")
`apply` optional (parseSchemaType "cashSettlementPaymentDate")
`apply` optional (oneOf' [ ("CashPriceMethod", fmap OneOf7 (parseSchemaType "cashPriceMethod"))
, ("CashPriceMethod", fmap TwoOf7 (parseSchemaType "cashPriceAlternateMethod"))
, ("YieldCurveMethod", fmap ThreeOf7 (parseSchemaType "parYieldCurveAdjustedMethod"))
, ("YieldCurveMethod", fmap FourOf7 (parseSchemaType "zeroCouponYieldAdjustedMethod"))
, ("YieldCurveMethod", fmap FiveOf7 (parseSchemaType "parYieldCurveUnadjustedMethod"))
, ("CrossCurrencyMethod", fmap SixOf7 (parseSchemaType "crossCurrencyMethod"))
, ("YieldCurveMethod", fmap SevenOf7 (parseSchemaType "collateralizedCashPriceMethod"))
])
schemaTypeToXML s x@CashSettlement{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ cashSettl_ID x
]
[ maybe [] (schemaTypeToXML "cashSettlementValuationTime") $ cashSettlement_valuationTime x
, maybe [] (schemaTypeToXML "cashSettlementValuationDate") $ cashSettlement_valuationDate x
, maybe [] (schemaTypeToXML "cashSettlementPaymentDate") $ cashSettlement_paymentDate x
, maybe [] (foldOneOf7 (schemaTypeToXML "cashPriceMethod")
(schemaTypeToXML "cashPriceAlternateMethod")
(schemaTypeToXML "parYieldCurveAdjustedMethod")
(schemaTypeToXML "zeroCouponYieldAdjustedMethod")
(schemaTypeToXML "parYieldCurveUnadjustedMethod")
(schemaTypeToXML "crossCurrencyMethod")
(schemaTypeToXML "collateralizedCashPriceMethod")
) $ cashSettl_choice3 x
]
data CashSettlementPaymentDate = CashSettlementPaymentDate
{ cashSettlPaymentDate_ID :: Maybe Xsd.ID
, cashSettlPaymentDate_choice0 :: (Maybe (OneOf3 AdjustableDates RelativeDateOffset BusinessDateRange))
}
deriving (Eq,Show)
instance SchemaType CashSettlementPaymentDate where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CashSettlementPaymentDate a0)
`apply` optional (oneOf' [ ("AdjustableDates", fmap OneOf3 (parseSchemaType "adjustableDates"))
, ("RelativeDateOffset", fmap TwoOf3 (parseSchemaType "relativeDate"))
, ("BusinessDateRange", fmap ThreeOf3 (parseSchemaType "businessDateRange"))
])
schemaTypeToXML s x@CashSettlementPaymentDate{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ cashSettlPaymentDate_ID x
]
[ maybe [] (foldOneOf3 (schemaTypeToXML "adjustableDates")
(schemaTypeToXML "relativeDate")
(schemaTypeToXML "businessDateRange")
) $ cashSettlPaymentDate_choice0 x
]
data CrossCurrencyMethod = CrossCurrencyMethod
{ crossCurrenMethod_cashSettlementReferenceBanks :: Maybe CashSettlementReferenceBanks
, crossCurrenMethod_cashSettlementCurrency :: [Currency]
, crossCurrenMethod_quotationRateType :: Maybe QuotationRateTypeEnum
}
deriving (Eq,Show)
instance SchemaType CrossCurrencyMethod where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CrossCurrencyMethod
`apply` optional (parseSchemaType "cashSettlementReferenceBanks")
`apply` between (Occurs (Just 0) (Just 2))
(parseSchemaType "cashSettlementCurrency")
`apply` optional (parseSchemaType "quotationRateType")
schemaTypeToXML s x@CrossCurrencyMethod{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "cashSettlementReferenceBanks") $ crossCurrenMethod_cashSettlementReferenceBanks x
, concatMap (schemaTypeToXML "cashSettlementCurrency") $ crossCurrenMethod_cashSettlementCurrency x
, maybe [] (schemaTypeToXML "quotationRateType") $ crossCurrenMethod_quotationRateType x
]
data DateRelativeToCalculationPeriodDates = DateRelativeToCalculationPeriodDates
{ drtcpd_calculationPeriodDatesReference :: [CalculationPeriodDatesReference]
}
deriving (Eq,Show)
instance SchemaType DateRelativeToCalculationPeriodDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return DateRelativeToCalculationPeriodDates
`apply` many (parseSchemaType "calculationPeriodDatesReference")
schemaTypeToXML s x@DateRelativeToCalculationPeriodDates{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "calculationPeriodDatesReference") $ drtcpd_calculationPeriodDatesReference x
]
data DateRelativeToPaymentDates = DateRelativeToPaymentDates
{ dateRelatToPaymentDates_paymentDatesReference :: [PaymentDatesReference]
}
deriving (Eq,Show)
instance SchemaType DateRelativeToPaymentDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return DateRelativeToPaymentDates
`apply` many (parseSchemaType "paymentDatesReference")
schemaTypeToXML s x@DateRelativeToPaymentDates{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "paymentDatesReference") $ dateRelatToPaymentDates_paymentDatesReference x
]
data Discounting = Discounting
{ discounting_type :: Maybe DiscountingTypeEnum
, discounting_discountRate :: Maybe Xsd.Decimal
, discounting_discountRateDayCountFraction :: Maybe DayCountFraction
}
deriving (Eq,Show)
instance SchemaType Discounting where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Discounting
`apply` optional (parseSchemaType "discountingType")
`apply` optional (parseSchemaType "discountRate")
`apply` optional (parseSchemaType "discountRateDayCountFraction")
schemaTypeToXML s x@Discounting{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "discountingType") $ discounting_type x
, maybe [] (schemaTypeToXML "discountRate") $ discounting_discountRate x
, maybe [] (schemaTypeToXML "discountRateDayCountFraction") $ discounting_discountRateDayCountFraction x
]
data EarlyTerminationEvent = EarlyTerminationEvent
{ earlyTerminEvent_ID :: Maybe Xsd.ID
, earlyTerminEvent_adjustedExerciseDate :: Maybe Xsd.Date
, earlyTerminEvent_adjustedEarlyTerminationDate :: Maybe Xsd.Date
, earlyTerminEvent_adjustedCashSettlementValuationDate :: Maybe Xsd.Date
, earlyTerminEvent_adjustedCashSettlementPaymentDate :: Maybe Xsd.Date
, earlyTerminEvent_adjustedExerciseFeePaymentDate :: Maybe Xsd.Date
}
deriving (Eq,Show)
instance SchemaType EarlyTerminationEvent where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (EarlyTerminationEvent a0)
`apply` optional (parseSchemaType "adjustedExerciseDate")
`apply` optional (parseSchemaType "adjustedEarlyTerminationDate")
`apply` optional (parseSchemaType "adjustedCashSettlementValuationDate")
`apply` optional (parseSchemaType "adjustedCashSettlementPaymentDate")
`apply` optional (parseSchemaType "adjustedExerciseFeePaymentDate")
schemaTypeToXML s x@EarlyTerminationEvent{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ earlyTerminEvent_ID x
]
[ maybe [] (schemaTypeToXML "adjustedExerciseDate") $ earlyTerminEvent_adjustedExerciseDate x
, maybe [] (schemaTypeToXML "adjustedEarlyTerminationDate") $ earlyTerminEvent_adjustedEarlyTerminationDate x
, maybe [] (schemaTypeToXML "adjustedCashSettlementValuationDate") $ earlyTerminEvent_adjustedCashSettlementValuationDate x
, maybe [] (schemaTypeToXML "adjustedCashSettlementPaymentDate") $ earlyTerminEvent_adjustedCashSettlementPaymentDate x
, maybe [] (schemaTypeToXML "adjustedExerciseFeePaymentDate") $ earlyTerminEvent_adjustedExerciseFeePaymentDate x
]
data EarlyTerminationProvision = EarlyTerminationProvision
{ earlyTerminProvis_ID :: Maybe Xsd.ID
, earlyTerminProvis_choice0 :: OneOf1 (((Maybe (OneOf1 ((Maybe (Period)),(Maybe (MandatoryEarlyTermination)))))),((Maybe (OneOf1 ((Maybe (ExercisePeriod)),(Maybe (OptionalEarlyTermination)))))))
}
deriving (Eq,Show)
instance SchemaType EarlyTerminationProvision where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (EarlyTerminationProvision a0)
`apply` oneOf' [ ("(Maybe (OneOf1 ((Maybe (Period)),(Maybe (MandatoryEarlyTermination))))) (Maybe (OneOf1 ((Maybe (ExercisePeriod)),(Maybe (OptionalEarlyTermination)))))", fmap OneOf1 (return (,) `apply` optional (oneOf' [ ("Maybe Period Maybe MandatoryEarlyTermination", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "mandatoryEarlyTerminationDateTenor")
`apply` optional (parseSchemaType "mandatoryEarlyTermination")))
])
`apply` optional (oneOf' [ ("Maybe ExercisePeriod Maybe OptionalEarlyTermination", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "optionalEarlyTerminationParameters")
`apply` optional (parseSchemaType "optionalEarlyTermination")))
])))
]
schemaTypeToXML s x@EarlyTerminationProvision{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ earlyTerminProvis_ID x
]
[ foldOneOf1 (\ (a,b) -> concat [ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "mandatoryEarlyTerminationDateTenor") a
, maybe [] (schemaTypeToXML "mandatoryEarlyTermination") b
])
) a
, maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "optionalEarlyTerminationParameters") a
, maybe [] (schemaTypeToXML "optionalEarlyTermination") b
])
) b
])
$ earlyTerminProvis_choice0 x
]
data ExerciseEvent = ExerciseEvent
{ exercEvent_ID :: Maybe Xsd.ID
, exercEvent_adjustedExerciseDate :: Maybe Xsd.Date
, exercEvent_adjustedRelevantSwapEffectiveDate :: Maybe Xsd.Date
, exercEvent_adjustedCashSettlementValuationDate :: Maybe Xsd.Date
, exercEvent_adjustedCashSettlementPaymentDate :: Maybe Xsd.Date
, exercEvent_adjustedExerciseFeePaymentDate :: Maybe Xsd.Date
}
deriving (Eq,Show)
instance SchemaType ExerciseEvent where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ExerciseEvent a0)
`apply` optional (parseSchemaType "adjustedExerciseDate")
`apply` optional (parseSchemaType "adjustedRelevantSwapEffectiveDate")
`apply` optional (parseSchemaType "adjustedCashSettlementValuationDate")
`apply` optional (parseSchemaType "adjustedCashSettlementPaymentDate")
`apply` optional (parseSchemaType "adjustedExerciseFeePaymentDate")
schemaTypeToXML s x@ExerciseEvent{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ exercEvent_ID x
]
[ maybe [] (schemaTypeToXML "adjustedExerciseDate") $ exercEvent_adjustedExerciseDate x
, maybe [] (schemaTypeToXML "adjustedRelevantSwapEffectiveDate") $ exercEvent_adjustedRelevantSwapEffectiveDate x
, maybe [] (schemaTypeToXML "adjustedCashSettlementValuationDate") $ exercEvent_adjustedCashSettlementValuationDate x
, maybe [] (schemaTypeToXML "adjustedCashSettlementPaymentDate") $ exercEvent_adjustedCashSettlementPaymentDate x
, maybe [] (schemaTypeToXML "adjustedExerciseFeePaymentDate") $ exercEvent_adjustedExerciseFeePaymentDate x
]
data ExercisePeriod = ExercisePeriod
{ exercPeriod_ID :: Maybe Xsd.ID
, exercPeriod_earliestExerciseDateTenor :: Maybe Period
, exercPeriod_exerciseFrequency :: Maybe Period
}
deriving (Eq,Show)
instance SchemaType ExercisePeriod where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ExercisePeriod a0)
`apply` optional (parseSchemaType "earliestExerciseDateTenor")
`apply` optional (parseSchemaType "exerciseFrequency")
schemaTypeToXML s x@ExercisePeriod{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ exercPeriod_ID x
]
[ maybe [] (schemaTypeToXML "earliestExerciseDateTenor") $ exercPeriod_earliestExerciseDateTenor x
, maybe [] (schemaTypeToXML "exerciseFrequency") $ exercPeriod_exerciseFrequency x
]
data ExtendibleProvision = ExtendibleProvision
{ extendProvis_buyerPartyReference :: Maybe PartyReference
, extendProvis_buyerAccountReference :: Maybe AccountReference
, extendProvis_sellerPartyReference :: Maybe PartyReference
, extendProvis_sellerAccountReference :: Maybe AccountReference
, extendProvis_exercise :: Maybe Exercise
, extendProvis_exerciseNotice :: Maybe ExerciseNotice
, extendProvis_followUpConfirmation :: Maybe Xsd.Boolean
, extendibleProvision_adjustedDates :: Maybe ExtendibleProvisionAdjustedDates
}
deriving (Eq,Show)
instance SchemaType ExtendibleProvision where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ExtendibleProvision
`apply` optional (parseSchemaType "buyerPartyReference")
`apply` optional (parseSchemaType "buyerAccountReference")
`apply` optional (parseSchemaType "sellerPartyReference")
`apply` optional (parseSchemaType "sellerAccountReference")
`apply` optional (elementExercise)
`apply` optional (parseSchemaType "exerciseNotice")
`apply` optional (parseSchemaType "followUpConfirmation")
`apply` optional (parseSchemaType "extendibleProvisionAdjustedDates")
schemaTypeToXML s x@ExtendibleProvision{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "buyerPartyReference") $ extendProvis_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ extendProvis_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ extendProvis_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ extendProvis_sellerAccountReference x
, maybe [] (elementToXMLExercise) $ extendProvis_exercise x
, maybe [] (schemaTypeToXML "exerciseNotice") $ extendProvis_exerciseNotice x
, maybe [] (schemaTypeToXML "followUpConfirmation") $ extendProvis_followUpConfirmation x
, maybe [] (schemaTypeToXML "extendibleProvisionAdjustedDates") $ extendibleProvision_adjustedDates x
]
data ExtendibleProvisionAdjustedDates = ExtendibleProvisionAdjustedDates
{ extendProvisAdjustDates_extensionEvent :: [ExtensionEvent]
}
deriving (Eq,Show)
instance SchemaType ExtendibleProvisionAdjustedDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ExtendibleProvisionAdjustedDates
`apply` many (parseSchemaType "extensionEvent")
schemaTypeToXML s x@ExtendibleProvisionAdjustedDates{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "extensionEvent") $ extendProvisAdjustDates_extensionEvent x
]
data ExtensionEvent = ExtensionEvent
{ extensEvent_ID :: Maybe Xsd.ID
, extensEvent_adjustedExerciseDate :: Maybe Xsd.Date
, extensEvent_adjustedExtendedTerminationDate :: Maybe Xsd.Date
}
deriving (Eq,Show)
instance SchemaType ExtensionEvent where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ExtensionEvent a0)
`apply` optional (parseSchemaType "adjustedExerciseDate")
`apply` optional (parseSchemaType "adjustedExtendedTerminationDate")
schemaTypeToXML s x@ExtensionEvent{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ extensEvent_ID x
]
[ maybe [] (schemaTypeToXML "adjustedExerciseDate") $ extensEvent_adjustedExerciseDate x
, maybe [] (schemaTypeToXML "adjustedExtendedTerminationDate") $ extensEvent_adjustedExtendedTerminationDate x
]
data FinalCalculationPeriodDateAdjustment = FinalCalculationPeriodDateAdjustment
{ fcpda_relevantUnderlyingDateReference :: Maybe RelevantUnderlyingDateReference
, fcpda_swapStreamReference :: InterestRateStreamReference
, fcpda_businessDayConvention :: Maybe BusinessDayConventionEnum
}
deriving (Eq,Show)
instance SchemaType FinalCalculationPeriodDateAdjustment where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FinalCalculationPeriodDateAdjustment
`apply` optional (parseSchemaType "relevantUnderlyingDateReference")
`apply` parseSchemaType "swapStreamReference"
`apply` optional (parseSchemaType "businessDayConvention")
schemaTypeToXML s x@FinalCalculationPeriodDateAdjustment{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "relevantUnderlyingDateReference") $ fcpda_relevantUnderlyingDateReference x
, schemaTypeToXML "swapStreamReference" $ fcpda_swapStreamReference x
, maybe [] (schemaTypeToXML "businessDayConvention") $ fcpda_businessDayConvention x
]
data FallbackReferencePrice = FallbackReferencePrice
{ fallbRefPrice_valuationPostponement :: Maybe ValuationPostponement
, fallbRefPrice_fallbackSettlementRateOption :: [SettlementRateOption]
, fallbRefPrice_fallbackSurveyValuationPostponenment :: Maybe Empty
, fallbRefPrice_calculationAgentDetermination :: Maybe CalculationAgent
}
deriving (Eq,Show)
instance SchemaType FallbackReferencePrice where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FallbackReferencePrice
`apply` optional (parseSchemaType "valuationPostponement")
`apply` many (parseSchemaType "fallbackSettlementRateOption")
`apply` optional (parseSchemaType "fallbackSurveyValuationPostponenment")
`apply` optional (parseSchemaType "calculationAgentDetermination")
schemaTypeToXML s x@FallbackReferencePrice{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "valuationPostponement") $ fallbRefPrice_valuationPostponement x
, concatMap (schemaTypeToXML "fallbackSettlementRateOption") $ fallbRefPrice_fallbackSettlementRateOption x
, maybe [] (schemaTypeToXML "fallbackSurveyValuationPostponenment") $ fallbRefPrice_fallbackSurveyValuationPostponenment x
, maybe [] (schemaTypeToXML "calculationAgentDetermination") $ fallbRefPrice_calculationAgentDetermination x
]
data FloatingRateDefinition = FloatingRateDefinition
{ floatRateDefin_calculatedRate :: Maybe Xsd.Decimal
, floatRateDefin_rateObservation :: [RateObservation]
, floatRateDefin_floatingRateMultiplier :: Maybe Xsd.Decimal
, floatRateDefin_spread :: Maybe Xsd.Decimal
, floatRateDefin_capRate :: [Strike]
, floatRateDefin_floorRate :: [Strike]
}
deriving (Eq,Show)
instance SchemaType FloatingRateDefinition where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FloatingRateDefinition
`apply` optional (parseSchemaType "calculatedRate")
`apply` many (parseSchemaType "rateObservation")
`apply` optional (parseSchemaType "floatingRateMultiplier")
`apply` optional (parseSchemaType "spread")
`apply` many (parseSchemaType "capRate")
`apply` many (parseSchemaType "floorRate")
schemaTypeToXML s x@FloatingRateDefinition{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "calculatedRate") $ floatRateDefin_calculatedRate x
, concatMap (schemaTypeToXML "rateObservation") $ floatRateDefin_rateObservation x
, maybe [] (schemaTypeToXML "floatingRateMultiplier") $ floatRateDefin_floatingRateMultiplier x
, maybe [] (schemaTypeToXML "spread") $ floatRateDefin_spread x
, concatMap (schemaTypeToXML "capRate") $ floatRateDefin_capRate x
, concatMap (schemaTypeToXML "floorRate") $ floatRateDefin_floorRate x
]
data Fra = Fra
{ fra_ID :: Maybe Xsd.ID
, fra_primaryAssetClass :: Maybe AssetClass
, fra_secondaryAssetClass :: [AssetClass]
, fra_productType :: [ProductType]
, fra_productId :: [ProductId]
, fra_buyerPartyReference :: Maybe PartyReference
, fra_buyerAccountReference :: Maybe AccountReference
, fra_sellerPartyReference :: Maybe PartyReference
, fra_sellerAccountReference :: Maybe AccountReference
, fra_adjustedEffectiveDate :: RequiredIdentifierDate
, fra_adjustedTerminationDate :: Xsd.Date
, fra_paymentDate :: Maybe AdjustableDate
, fra_fixingDateOffset :: Maybe RelativeDateOffset
, fra_dayCountFraction :: DayCountFraction
, fra_calculationPeriodNumberOfDays :: Maybe Xsd.PositiveInteger
, fra_notional :: Money
, fra_fixedRate :: Xsd.Decimal
, fra_floatingRateIndex :: FloatingRateIndex
, fra_indexTenor :: [Period]
, fra_discounting :: Maybe FraDiscountingEnum
}
deriving (Eq,Show)
instance SchemaType Fra where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Fra a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "buyerPartyReference")
`apply` optional (parseSchemaType "buyerAccountReference")
`apply` optional (parseSchemaType "sellerPartyReference")
`apply` optional (parseSchemaType "sellerAccountReference")
`apply` parseSchemaType "adjustedEffectiveDate"
`apply` parseSchemaType "adjustedTerminationDate"
`apply` optional (parseSchemaType "paymentDate")
`apply` optional (parseSchemaType "fixingDateOffset")
`apply` parseSchemaType "dayCountFraction"
`apply` optional (parseSchemaType "calculationPeriodNumberOfDays")
`apply` parseSchemaType "notional"
`apply` parseSchemaType "fixedRate"
`apply` parseSchemaType "floatingRateIndex"
`apply` many1 (parseSchemaType "indexTenor")
`apply` optional (parseSchemaType "fraDiscounting")
schemaTypeToXML s x@Fra{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fra_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ fra_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ fra_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ fra_productType x
, concatMap (schemaTypeToXML "productId") $ fra_productId x
, maybe [] (schemaTypeToXML "buyerPartyReference") $ fra_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ fra_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ fra_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ fra_sellerAccountReference x
, schemaTypeToXML "adjustedEffectiveDate" $ fra_adjustedEffectiveDate x
, schemaTypeToXML "adjustedTerminationDate" $ fra_adjustedTerminationDate x
, maybe [] (schemaTypeToXML "paymentDate") $ fra_paymentDate x
, maybe [] (schemaTypeToXML "fixingDateOffset") $ fra_fixingDateOffset x
, schemaTypeToXML "dayCountFraction" $ fra_dayCountFraction x
, maybe [] (schemaTypeToXML "calculationPeriodNumberOfDays") $ fra_calculationPeriodNumberOfDays x
, schemaTypeToXML "notional" $ fra_notional x
, schemaTypeToXML "fixedRate" $ fra_fixedRate x
, schemaTypeToXML "floatingRateIndex" $ fra_floatingRateIndex x
, concatMap (schemaTypeToXML "indexTenor") $ fra_indexTenor x
, maybe [] (schemaTypeToXML "fraDiscounting") $ fra_discounting x
]
instance Extension Fra Product where
supertype v = Product_Fra v
data FxFixingDate = FxFixingDate
{ fxFixingDate_ID :: Maybe Xsd.ID
, fxFixingDate_periodMultiplier :: Xsd.Integer
, fxFixingDate_period :: PeriodEnum
, fxFixingDate_dayType :: Maybe DayTypeEnum
, fxFixingDate_businessDayConvention :: Maybe BusinessDayConventionEnum
, fxFixingDate_choice4 :: (Maybe (OneOf2 BusinessCentersReference BusinessCenters))
, fxFixingDate_choice5 :: (Maybe (OneOf2 DateRelativeToPaymentDates DateRelativeToCalculationPeriodDates))
}
deriving (Eq,Show)
instance SchemaType FxFixingDate where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FxFixingDate a0)
`apply` parseSchemaType "periodMultiplier"
`apply` parseSchemaType "period"
`apply` optional (parseSchemaType "dayType")
`apply` optional (parseSchemaType "businessDayConvention")
`apply` optional (oneOf' [ ("BusinessCentersReference", fmap OneOf2 (parseSchemaType "businessCentersReference"))
, ("BusinessCenters", fmap TwoOf2 (parseSchemaType "businessCenters"))
])
`apply` optional (oneOf' [ ("DateRelativeToPaymentDates", fmap OneOf2 (parseSchemaType "dateRelativeToPaymentDates"))
, ("DateRelativeToCalculationPeriodDates", fmap TwoOf2 (parseSchemaType "dateRelativeToCalculationPeriodDates"))
])
schemaTypeToXML s x@FxFixingDate{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxFixingDate_ID x
]
[ schemaTypeToXML "periodMultiplier" $ fxFixingDate_periodMultiplier x
, schemaTypeToXML "period" $ fxFixingDate_period x
, maybe [] (schemaTypeToXML "dayType") $ fxFixingDate_dayType x
, maybe [] (schemaTypeToXML "businessDayConvention") $ fxFixingDate_businessDayConvention x
, maybe [] (foldOneOf2 (schemaTypeToXML "businessCentersReference")
(schemaTypeToXML "businessCenters")
) $ fxFixingDate_choice4 x
, maybe [] (foldOneOf2 (schemaTypeToXML "dateRelativeToPaymentDates")
(schemaTypeToXML "dateRelativeToCalculationPeriodDates")
) $ fxFixingDate_choice5 x
]
instance Extension FxFixingDate Offset where
supertype (FxFixingDate a0 e0 e1 e2 e3 e4 e5) =
Offset a0 e0 e1 e2
instance Extension FxFixingDate Period where
supertype = (supertype :: Offset -> Period)
. (supertype :: FxFixingDate -> Offset)
data FxLinkedNotionalAmount = FxLinkedNotionalAmount
{ fxLinkedNotionAmount_resetDate :: Maybe Xsd.Date
, fxLinkedNotionAmount_adjustedFxSpotFixingDate :: Maybe Xsd.Date
, fxLinkedNotionAmount_observedFxSpotRate :: Maybe Xsd.Decimal
, fxLinkedNotionAmount_notionalAmount :: Maybe Xsd.Decimal
}
deriving (Eq,Show)
instance SchemaType FxLinkedNotionalAmount where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxLinkedNotionalAmount
`apply` optional (parseSchemaType "resetDate")
`apply` optional (parseSchemaType "adjustedFxSpotFixingDate")
`apply` optional (parseSchemaType "observedFxSpotRate")
`apply` optional (parseSchemaType "notionalAmount")
schemaTypeToXML s x@FxLinkedNotionalAmount{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "resetDate") $ fxLinkedNotionAmount_resetDate x
, maybe [] (schemaTypeToXML "adjustedFxSpotFixingDate") $ fxLinkedNotionAmount_adjustedFxSpotFixingDate x
, maybe [] (schemaTypeToXML "observedFxSpotRate") $ fxLinkedNotionAmount_observedFxSpotRate x
, maybe [] (schemaTypeToXML "notionalAmount") $ fxLinkedNotionAmount_notionalAmount x
]
data FxLinkedNotionalSchedule = FxLinkedNotionalSchedule
{ fxLinkedNotionSched_constantNotionalScheduleReference :: Maybe NotionalReference
, fxLinkedNotionSched_initialValue :: Maybe Xsd.Decimal
, fxLinkedNotionSched_varyingNotionalCurrency :: Maybe Currency
, fxLinkedNotionSched_varyingNotionalFixingDates :: Maybe RelativeDateOffset
, fxLinkedNotionSched_fxSpotRateSource :: Maybe FxSpotRateSource
, fxLinkedNotionSched_varyingNotionalInterimExchangePaymentDates :: Maybe RelativeDateOffset
}
deriving (Eq,Show)
instance SchemaType FxLinkedNotionalSchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxLinkedNotionalSchedule
`apply` optional (parseSchemaType "constantNotionalScheduleReference")
`apply` optional (parseSchemaType "initialValue")
`apply` optional (parseSchemaType "varyingNotionalCurrency")
`apply` optional (parseSchemaType "varyingNotionalFixingDates")
`apply` optional (parseSchemaType "fxSpotRateSource")
`apply` optional (parseSchemaType "varyingNotionalInterimExchangePaymentDates")
schemaTypeToXML s x@FxLinkedNotionalSchedule{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "constantNotionalScheduleReference") $ fxLinkedNotionSched_constantNotionalScheduleReference x
, maybe [] (schemaTypeToXML "initialValue") $ fxLinkedNotionSched_initialValue x
, maybe [] (schemaTypeToXML "varyingNotionalCurrency") $ fxLinkedNotionSched_varyingNotionalCurrency x
, maybe [] (schemaTypeToXML "varyingNotionalFixingDates") $ fxLinkedNotionSched_varyingNotionalFixingDates x
, maybe [] (schemaTypeToXML "fxSpotRateSource") $ fxLinkedNotionSched_fxSpotRateSource x
, maybe [] (schemaTypeToXML "varyingNotionalInterimExchangePaymentDates") $ fxLinkedNotionSched_varyingNotionalInterimExchangePaymentDates x
]
data InflationRateCalculation = InflationRateCalculation
{ inflatRateCalc_ID :: Maybe Xsd.ID
, inflatRateCalc_floatingRateIndex :: FloatingRateIndex
, inflatRateCalc_indexTenor :: Maybe Period
, inflatRateCalc_floatingRateMultiplierSchedule :: Maybe Schedule
, inflatRateCalc_spreadSchedule :: [SpreadSchedule]
, inflatRateCalc_rateTreatment :: Maybe RateTreatmentEnum
, inflatRateCalc_capRateSchedule :: [StrikeSchedule]
, inflatRateCalc_floorRateSchedule :: [StrikeSchedule]
, inflatRateCalc_initialRate :: Maybe Xsd.Decimal
, inflatRateCalc_finalRateRounding :: Maybe Rounding
, inflatRateCalc_averagingMethod :: Maybe AveragingMethodEnum
, inflatRateCalc_negativeInterestRateTreatment :: Maybe NegativeInterestRateTreatmentEnum
, inflatRateCalc_inflationLag :: Maybe Offset
, inflatRateCalc_indexSource :: Maybe RateSourcePage
, inflatRateCalc_mainPublication :: Maybe MainPublication
, inflatRateCalc_interpolationMethod :: Maybe InterpolationMethod
, inflatRateCalc_initialIndexLevel :: Maybe Xsd.Decimal
, inflatRateCalc_fallbackBondApplicable :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType InflationRateCalculation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (InflationRateCalculation a0)
`apply` parseSchemaType "floatingRateIndex"
`apply` optional (parseSchemaType "indexTenor")
`apply` optional (parseSchemaType "floatingRateMultiplierSchedule")
`apply` many (parseSchemaType "spreadSchedule")
`apply` optional (parseSchemaType "rateTreatment")
`apply` many (parseSchemaType "capRateSchedule")
`apply` many (parseSchemaType "floorRateSchedule")
`apply` optional (parseSchemaType "initialRate")
`apply` optional (parseSchemaType "finalRateRounding")
`apply` optional (parseSchemaType "averagingMethod")
`apply` optional (parseSchemaType "negativeInterestRateTreatment")
`apply` optional (parseSchemaType "inflationLag")
`apply` optional (parseSchemaType "indexSource")
`apply` optional (parseSchemaType "mainPublication")
`apply` optional (parseSchemaType "interpolationMethod")
`apply` optional (parseSchemaType "initialIndexLevel")
`apply` optional (parseSchemaType "fallbackBondApplicable")
schemaTypeToXML s x@InflationRateCalculation{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ inflatRateCalc_ID x
]
[ schemaTypeToXML "floatingRateIndex" $ inflatRateCalc_floatingRateIndex x
, maybe [] (schemaTypeToXML "indexTenor") $ inflatRateCalc_indexTenor x
, maybe [] (schemaTypeToXML "floatingRateMultiplierSchedule") $ inflatRateCalc_floatingRateMultiplierSchedule x
, concatMap (schemaTypeToXML "spreadSchedule") $ inflatRateCalc_spreadSchedule x
, maybe [] (schemaTypeToXML "rateTreatment") $ inflatRateCalc_rateTreatment x
, concatMap (schemaTypeToXML "capRateSchedule") $ inflatRateCalc_capRateSchedule x
, concatMap (schemaTypeToXML "floorRateSchedule") $ inflatRateCalc_floorRateSchedule x
, maybe [] (schemaTypeToXML "initialRate") $ inflatRateCalc_initialRate x
, maybe [] (schemaTypeToXML "finalRateRounding") $ inflatRateCalc_finalRateRounding x
, maybe [] (schemaTypeToXML "averagingMethod") $ inflatRateCalc_averagingMethod x
, maybe [] (schemaTypeToXML "negativeInterestRateTreatment") $ inflatRateCalc_negativeInterestRateTreatment x
, maybe [] (schemaTypeToXML "inflationLag") $ inflatRateCalc_inflationLag x
, maybe [] (schemaTypeToXML "indexSource") $ inflatRateCalc_indexSource x
, maybe [] (schemaTypeToXML "mainPublication") $ inflatRateCalc_mainPublication x
, maybe [] (schemaTypeToXML "interpolationMethod") $ inflatRateCalc_interpolationMethod x
, maybe [] (schemaTypeToXML "initialIndexLevel") $ inflatRateCalc_initialIndexLevel x
, maybe [] (schemaTypeToXML "fallbackBondApplicable") $ inflatRateCalc_fallbackBondApplicable x
]
instance Extension InflationRateCalculation FloatingRateCalculation where
supertype (InflationRateCalculation a0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14 e15 e16) =
FloatingRateCalculation a0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10
instance Extension InflationRateCalculation FloatingRate where
supertype = (supertype :: FloatingRateCalculation -> FloatingRate)
. (supertype :: InflationRateCalculation -> FloatingRateCalculation)
instance Extension InflationRateCalculation Rate where
supertype = (supertype :: FloatingRate -> Rate)
. (supertype :: FloatingRateCalculation -> FloatingRate)
. (supertype :: InflationRateCalculation -> FloatingRateCalculation)
data InterestRateStream = InterestRateStream
{ interRateStream_ID :: Maybe Xsd.ID
, interRateStream_payerPartyReference :: Maybe PartyReference
, interRateStream_payerAccountReference :: Maybe AccountReference
, interRateStream_receiverPartyReference :: Maybe PartyReference
, interRateStream_receiverAccountReference :: Maybe AccountReference
, interRateStream_calculationPeriodDates :: CalculationPeriodDates
, interRateStream_paymentDates :: PaymentDates
, interRateStream_resetDates :: Maybe ResetDates
, interRateStream_calculationPeriodAmount :: CalculationPeriodAmount
, interRateStream_stubCalculationPeriodAmount :: Maybe StubCalculationPeriodAmount
, interRateStream_principalExchanges :: Maybe PrincipalExchanges
, interRateStream_cashflows :: Maybe Cashflows
, interRateStream_settlementProvision :: Maybe SettlementProvision
, interRateStream_formula :: Maybe Formula
}
deriving (Eq,Show)
instance SchemaType InterestRateStream where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (InterestRateStream a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` parseSchemaType "calculationPeriodDates"
`apply` parseSchemaType "paymentDates"
`apply` optional (parseSchemaType "resetDates")
`apply` parseSchemaType "calculationPeriodAmount"
`apply` optional (parseSchemaType "stubCalculationPeriodAmount")
`apply` optional (parseSchemaType "principalExchanges")
`apply` optional (parseSchemaType "cashflows")
`apply` optional (parseSchemaType "settlementProvision")
`apply` optional (parseSchemaType "formula")
schemaTypeToXML s x@InterestRateStream{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ interRateStream_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ interRateStream_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ interRateStream_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ interRateStream_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ interRateStream_receiverAccountReference x
, schemaTypeToXML "calculationPeriodDates" $ interRateStream_calculationPeriodDates x
, schemaTypeToXML "paymentDates" $ interRateStream_paymentDates x
, maybe [] (schemaTypeToXML "resetDates") $ interRateStream_resetDates x
, schemaTypeToXML "calculationPeriodAmount" $ interRateStream_calculationPeriodAmount x
, maybe [] (schemaTypeToXML "stubCalculationPeriodAmount") $ interRateStream_stubCalculationPeriodAmount x
, maybe [] (schemaTypeToXML "principalExchanges") $ interRateStream_principalExchanges x
, maybe [] (schemaTypeToXML "cashflows") $ interRateStream_cashflows x
, maybe [] (schemaTypeToXML "settlementProvision") $ interRateStream_settlementProvision x
, maybe [] (schemaTypeToXML "formula") $ interRateStream_formula x
]
instance Extension InterestRateStream Leg where
supertype v = Leg_InterestRateStream v
data InterestRateStreamReference = InterestRateStreamReference
{ interRateStreamRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType InterestRateStreamReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (InterestRateStreamReference a0)
schemaTypeToXML s x@InterestRateStreamReference{} =
toXMLElement s [ toXMLAttribute "href" $ interRateStreamRef_href x
]
[]
instance Extension InterestRateStreamReference Reference where
supertype v = Reference_InterestRateStreamReference v
data MandatoryEarlyTermination = MandatoryEarlyTermination
{ mandatEarlyTermin_ID :: Maybe Xsd.ID
, mandatoryEarlyTermination_date :: Maybe AdjustableDate
, mandatEarlyTermin_calculationAgent :: Maybe CalculationAgent
, mandatEarlyTermin_cashSettlement :: Maybe CashSettlement
, mandatoryEarlyTermination_adjustedDates :: Maybe MandatoryEarlyTerminationAdjustedDates
}
deriving (Eq,Show)
instance SchemaType MandatoryEarlyTermination where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (MandatoryEarlyTermination a0)
`apply` optional (parseSchemaType "mandatoryEarlyTerminationDate")
`apply` optional (parseSchemaType "calculationAgent")
`apply` optional (parseSchemaType "cashSettlement")
`apply` optional (parseSchemaType "mandatoryEarlyTerminationAdjustedDates")
schemaTypeToXML s x@MandatoryEarlyTermination{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ mandatEarlyTermin_ID x
]
[ maybe [] (schemaTypeToXML "mandatoryEarlyTerminationDate") $ mandatoryEarlyTermination_date x
, maybe [] (schemaTypeToXML "calculationAgent") $ mandatEarlyTermin_calculationAgent x
, maybe [] (schemaTypeToXML "cashSettlement") $ mandatEarlyTermin_cashSettlement x
, maybe [] (schemaTypeToXML "mandatoryEarlyTerminationAdjustedDates") $ mandatoryEarlyTermination_adjustedDates x
]
data MandatoryEarlyTerminationAdjustedDates = MandatoryEarlyTerminationAdjustedDates
{ metad_adjustedEarlyTerminationDate :: Maybe Xsd.Date
, metad_adjustedCashSettlementValuationDate :: Maybe Xsd.Date
, metad_adjustedCashSettlementPaymentDate :: Maybe Xsd.Date
}
deriving (Eq,Show)
instance SchemaType MandatoryEarlyTerminationAdjustedDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return MandatoryEarlyTerminationAdjustedDates
`apply` optional (parseSchemaType "adjustedEarlyTerminationDate")
`apply` optional (parseSchemaType "adjustedCashSettlementValuationDate")
`apply` optional (parseSchemaType "adjustedCashSettlementPaymentDate")
schemaTypeToXML s x@MandatoryEarlyTerminationAdjustedDates{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "adjustedEarlyTerminationDate") $ metad_adjustedEarlyTerminationDate x
, maybe [] (schemaTypeToXML "adjustedCashSettlementValuationDate") $ metad_adjustedCashSettlementValuationDate x
, maybe [] (schemaTypeToXML "adjustedCashSettlementPaymentDate") $ metad_adjustedCashSettlementPaymentDate x
]
data NonDeliverableSettlement = NonDeliverableSettlement
{ nonDelivSettl_referenceCurrency :: Maybe Currency
, nonDelivSettl_choice1 :: (Maybe (OneOf2 FxFixingDate AdjustableDates))
, nonDelivSettl_settlementRateOption :: Maybe SettlementRateOption
, nonDelivSettl_priceSourceDisruption :: Maybe PriceSourceDisruption
}
deriving (Eq,Show)
instance SchemaType NonDeliverableSettlement where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return NonDeliverableSettlement
`apply` optional (parseSchemaType "referenceCurrency")
`apply` optional (oneOf' [ ("FxFixingDate", fmap OneOf2 (parseSchemaType "fxFixingDate"))
, ("AdjustableDates", fmap TwoOf2 (parseSchemaType "fxFixingSchedule"))
])
`apply` optional (parseSchemaType "settlementRateOption")
`apply` optional (parseSchemaType "priceSourceDisruption")
schemaTypeToXML s x@NonDeliverableSettlement{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "referenceCurrency") $ nonDelivSettl_referenceCurrency x
, maybe [] (foldOneOf2 (schemaTypeToXML "fxFixingDate")
(schemaTypeToXML "fxFixingSchedule")
) $ nonDelivSettl_choice1 x
, maybe [] (schemaTypeToXML "settlementRateOption") $ nonDelivSettl_settlementRateOption x
, maybe [] (schemaTypeToXML "priceSourceDisruption") $ nonDelivSettl_priceSourceDisruption x
]
data Notional = Notional
{ notional_ID :: Maybe Xsd.ID
, notional_stepSchedule :: NonNegativeAmountSchedule
, notional_stepParameters :: Maybe NotionalStepRule
}
deriving (Eq,Show)
instance SchemaType Notional where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Notional a0)
`apply` parseSchemaType "notionalStepSchedule"
`apply` optional (parseSchemaType "notionalStepParameters")
schemaTypeToXML s x@Notional{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ notional_ID x
]
[ schemaTypeToXML "notionalStepSchedule" $ notional_stepSchedule x
, maybe [] (schemaTypeToXML "notionalStepParameters") $ notional_stepParameters x
]
data NotionalStepRule = NotionalStepRule
{ notionStepRule_calculationPeriodDatesReference :: Maybe CalculationPeriodDatesReference
, notionStepRule_stepFrequency :: Maybe Period
, notionStepRule_firstNotionalStepDate :: Maybe Xsd.Date
, notionStepRule_lastNotionalStepDate :: Maybe Xsd.Date
, notionStepRule_choice4 :: (Maybe (OneOf2 Xsd.Decimal ((Maybe (Xsd.Decimal)),(Maybe (StepRelativeToEnum)))))
}
deriving (Eq,Show)
instance SchemaType NotionalStepRule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return NotionalStepRule
`apply` optional (parseSchemaType "calculationPeriodDatesReference")
`apply` optional (parseSchemaType "stepFrequency")
`apply` optional (parseSchemaType "firstNotionalStepDate")
`apply` optional (parseSchemaType "lastNotionalStepDate")
`apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "notionalStepAmount"))
, ("Maybe Xsd.Decimal Maybe StepRelativeToEnum", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "notionalStepRate")
`apply` optional (parseSchemaType "stepRelativeTo")))
])
schemaTypeToXML s x@NotionalStepRule{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "calculationPeriodDatesReference") $ notionStepRule_calculationPeriodDatesReference x
, maybe [] (schemaTypeToXML "stepFrequency") $ notionStepRule_stepFrequency x
, maybe [] (schemaTypeToXML "firstNotionalStepDate") $ notionStepRule_firstNotionalStepDate x
, maybe [] (schemaTypeToXML "lastNotionalStepDate") $ notionStepRule_lastNotionalStepDate x
, maybe [] (foldOneOf2 (schemaTypeToXML "notionalStepAmount")
(\ (a,b) -> concat [ maybe [] (schemaTypeToXML "notionalStepRate") a
, maybe [] (schemaTypeToXML "stepRelativeTo") b
])
) $ notionStepRule_choice4 x
]
data OptionalEarlyTermination = OptionalEarlyTermination
{ optionEarlyTermin_singlePartyOption :: Maybe SinglePartyOption
, optionEarlyTermin_exercise :: Maybe Exercise
, optionEarlyTermin_exerciseNotice :: [ExerciseNotice]
, optionEarlyTermin_followUpConfirmation :: Maybe Xsd.Boolean
, optionEarlyTermin_calculationAgent :: Maybe CalculationAgent
, optionEarlyTermin_cashSettlement :: Maybe CashSettlement
, optionalEarlyTermination_adjustedDates :: Maybe OptionalEarlyTerminationAdjustedDates
}
deriving (Eq,Show)
instance SchemaType OptionalEarlyTermination where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return OptionalEarlyTermination
`apply` optional (parseSchemaType "singlePartyOption")
`apply` optional (elementExercise)
`apply` many (parseSchemaType "exerciseNotice")
`apply` optional (parseSchemaType "followUpConfirmation")
`apply` optional (parseSchemaType "calculationAgent")
`apply` optional (parseSchemaType "cashSettlement")
`apply` optional (parseSchemaType "optionalEarlyTerminationAdjustedDates")
schemaTypeToXML s x@OptionalEarlyTermination{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "singlePartyOption") $ optionEarlyTermin_singlePartyOption x
, maybe [] (elementToXMLExercise) $ optionEarlyTermin_exercise x
, concatMap (schemaTypeToXML "exerciseNotice") $ optionEarlyTermin_exerciseNotice x
, maybe [] (schemaTypeToXML "followUpConfirmation") $ optionEarlyTermin_followUpConfirmation x
, maybe [] (schemaTypeToXML "calculationAgent") $ optionEarlyTermin_calculationAgent x
, maybe [] (schemaTypeToXML "cashSettlement") $ optionEarlyTermin_cashSettlement x
, maybe [] (schemaTypeToXML "optionalEarlyTerminationAdjustedDates") $ optionalEarlyTermination_adjustedDates x
]
data OptionalEarlyTerminationAdjustedDates = OptionalEarlyTerminationAdjustedDates
{ oetad_earlyTerminationEvent :: [EarlyTerminationEvent]
}
deriving (Eq,Show)
instance SchemaType OptionalEarlyTerminationAdjustedDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return OptionalEarlyTerminationAdjustedDates
`apply` many (parseSchemaType "earlyTerminationEvent")
schemaTypeToXML s x@OptionalEarlyTerminationAdjustedDates{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "earlyTerminationEvent") $ oetad_earlyTerminationEvent x
]
data PaymentCalculationPeriod = PaymentCalculationPeriod
{ paymentCalcPeriod_ID :: Maybe Xsd.ID
, paymentCalcPeriod_href :: Maybe Xsd.IDREF
, paymentCalcPeriod_unadjustedPaymentDate :: Maybe Xsd.Date
, paymentCalcPeriod_adjustedPaymentDate :: Maybe Xsd.Date
, paymentCalcPeriod_choice2 :: (Maybe (OneOf2 [CalculationPeriod] Xsd.Decimal))
, paymentCalcPeriod_discountFactor :: Maybe Xsd.Decimal
, paymentCalcPeriod_forecastPaymentAmount :: Maybe Money
, paymentCalcPeriod_presentValueAmount :: Maybe Money
}
deriving (Eq,Show)
instance SchemaType PaymentCalculationPeriod where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
a1 <- optional $ getAttribute "href" e pos
commit $ interior e $ return (PaymentCalculationPeriod a0 a1)
`apply` optional (parseSchemaType "unadjustedPaymentDate")
`apply` optional (parseSchemaType "adjustedPaymentDate")
`apply` optional (oneOf' [ ("[CalculationPeriod]", fmap OneOf2 (many1 (parseSchemaType "calculationPeriod")))
, ("Xsd.Decimal", fmap TwoOf2 (parseSchemaType "fixedPaymentAmount"))
])
`apply` optional (parseSchemaType "discountFactor")
`apply` optional (parseSchemaType "forecastPaymentAmount")
`apply` optional (parseSchemaType "presentValueAmount")
schemaTypeToXML s x@PaymentCalculationPeriod{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ paymentCalcPeriod_ID x
, maybe [] (toXMLAttribute "href") $ paymentCalcPeriod_href x
]
[ maybe [] (schemaTypeToXML "unadjustedPaymentDate") $ paymentCalcPeriod_unadjustedPaymentDate x
, maybe [] (schemaTypeToXML "adjustedPaymentDate") $ paymentCalcPeriod_adjustedPaymentDate x
, maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "calculationPeriod"))
(schemaTypeToXML "fixedPaymentAmount")
) $ paymentCalcPeriod_choice2 x
, maybe [] (schemaTypeToXML "discountFactor") $ paymentCalcPeriod_discountFactor x
, maybe [] (schemaTypeToXML "forecastPaymentAmount") $ paymentCalcPeriod_forecastPaymentAmount x
, maybe [] (schemaTypeToXML "presentValueAmount") $ paymentCalcPeriod_presentValueAmount x
]
instance Extension PaymentCalculationPeriod PaymentBase where
supertype v = PaymentBase_PaymentCalculationPeriod v
data PaymentDates = PaymentDates
{ paymentDates_ID :: Maybe Xsd.ID
, paymentDates_choice0 :: (Maybe (OneOf3 CalculationPeriodDatesReference ResetDatesReference ValuationDatesReference))
, paymentDates_paymentFrequency :: Frequency
, paymentDates_firstPaymentDate :: Maybe Xsd.Date
, paymentDates_lastRegularPaymentDate :: Maybe Xsd.Date
, paymentDates_payRelativeTo :: Maybe PayRelativeToEnum
, paymentDates_paymentDaysOffset :: Maybe Offset
, paymentDates_adjustments :: Maybe BusinessDayAdjustments
}
deriving (Eq,Show)
instance SchemaType PaymentDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (PaymentDates a0)
`apply` optional (oneOf' [ ("CalculationPeriodDatesReference", fmap OneOf3 (parseSchemaType "calculationPeriodDatesReference"))
, ("ResetDatesReference", fmap TwoOf3 (parseSchemaType "resetDatesReference"))
, ("ValuationDatesReference", fmap ThreeOf3 (parseSchemaType "valuationDatesReference"))
])
`apply` parseSchemaType "paymentFrequency"
`apply` optional (parseSchemaType "firstPaymentDate")
`apply` optional (parseSchemaType "lastRegularPaymentDate")
`apply` optional (parseSchemaType "payRelativeTo")
`apply` optional (parseSchemaType "paymentDaysOffset")
`apply` optional (parseSchemaType "paymentDatesAdjustments")
schemaTypeToXML s x@PaymentDates{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ paymentDates_ID x
]
[ maybe [] (foldOneOf3 (schemaTypeToXML "calculationPeriodDatesReference")
(schemaTypeToXML "resetDatesReference")
(schemaTypeToXML "valuationDatesReference")
) $ paymentDates_choice0 x
, schemaTypeToXML "paymentFrequency" $ paymentDates_paymentFrequency x
, maybe [] (schemaTypeToXML "firstPaymentDate") $ paymentDates_firstPaymentDate x
, maybe [] (schemaTypeToXML "lastRegularPaymentDate") $ paymentDates_lastRegularPaymentDate x
, maybe [] (schemaTypeToXML "payRelativeTo") $ paymentDates_payRelativeTo x
, maybe [] (schemaTypeToXML "paymentDaysOffset") $ paymentDates_paymentDaysOffset x
, maybe [] (schemaTypeToXML "paymentDatesAdjustments") $ paymentDates_adjustments x
]
data PaymentDatesReference = PaymentDatesReference
{ paymentDatesRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType PaymentDatesReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (PaymentDatesReference a0)
schemaTypeToXML s x@PaymentDatesReference{} =
toXMLElement s [ toXMLAttribute "href" $ paymentDatesRef_href x
]
[]
instance Extension PaymentDatesReference Reference where
supertype v = Reference_PaymentDatesReference v
data PriceSourceDisruption = PriceSourceDisruption
{ priceSourceDisrup_fallbackReferencePrice :: Maybe FallbackReferencePrice
}
deriving (Eq,Show)
instance SchemaType PriceSourceDisruption where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return PriceSourceDisruption
`apply` optional (parseSchemaType "fallbackReferencePrice")
schemaTypeToXML s x@PriceSourceDisruption{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "fallbackReferencePrice") $ priceSourceDisrup_fallbackReferencePrice x
]
data PrincipalExchange = PrincipalExchange
{ princExch_ID :: Maybe Xsd.ID
, princExch_unadjustedPrincipalExchangeDate :: Maybe Xsd.Date
, princExch_adjustedPrincipalExchangeDate :: Maybe Xsd.Date
, principalExchange_amount :: Maybe Xsd.Decimal
, princExch_discountFactor :: Maybe Xsd.Decimal
, princExch_presentValuePrincipalExchangeAmount :: Maybe Money
}
deriving (Eq,Show)
instance SchemaType PrincipalExchange where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (PrincipalExchange a0)
`apply` optional (parseSchemaType "unadjustedPrincipalExchangeDate")
`apply` optional (parseSchemaType "adjustedPrincipalExchangeDate")
`apply` optional (parseSchemaType "principalExchangeAmount")
`apply` optional (parseSchemaType "discountFactor")
`apply` optional (parseSchemaType "presentValuePrincipalExchangeAmount")
schemaTypeToXML s x@PrincipalExchange{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ princExch_ID x
]
[ maybe [] (schemaTypeToXML "unadjustedPrincipalExchangeDate") $ princExch_unadjustedPrincipalExchangeDate x
, maybe [] (schemaTypeToXML "adjustedPrincipalExchangeDate") $ princExch_adjustedPrincipalExchangeDate x
, maybe [] (schemaTypeToXML "principalExchangeAmount") $ principalExchange_amount x
, maybe [] (schemaTypeToXML "discountFactor") $ princExch_discountFactor x
, maybe [] (schemaTypeToXML "presentValuePrincipalExchangeAmount") $ princExch_presentValuePrincipalExchangeAmount x
]
data RelevantUnderlyingDateReference = RelevantUnderlyingDateReference
{ relevUnderlyDateRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType RelevantUnderlyingDateReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (RelevantUnderlyingDateReference a0)
schemaTypeToXML s x@RelevantUnderlyingDateReference{} =
toXMLElement s [ toXMLAttribute "href" $ relevUnderlyDateRef_href x
]
[]
instance Extension RelevantUnderlyingDateReference Reference where
supertype v = Reference_RelevantUnderlyingDateReference v
data ResetDates = ResetDates
{ resetDates_ID :: Maybe Xsd.ID
, resetDates_calculationPeriodDatesReference :: Maybe CalculationPeriodDatesReference
, resetDates_resetRelativeTo :: Maybe ResetRelativeToEnum
, resetDates_initialFixingDate :: Maybe RelativeDateOffset
, resetDates_fixingDates :: Maybe RelativeDateOffset
, resetDates_rateCutOffDaysOffset :: Maybe Offset
, resetDates_resetFrequency :: ResetFrequency
, resetDates_adjustments :: Maybe BusinessDayAdjustments
}
deriving (Eq,Show)
instance SchemaType ResetDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ResetDates a0)
`apply` optional (parseSchemaType "calculationPeriodDatesReference")
`apply` optional (parseSchemaType "resetRelativeTo")
`apply` optional (parseSchemaType "initialFixingDate")
`apply` optional (parseSchemaType "fixingDates")
`apply` optional (parseSchemaType "rateCutOffDaysOffset")
`apply` parseSchemaType "resetFrequency"
`apply` optional (parseSchemaType "resetDatesAdjustments")
schemaTypeToXML s x@ResetDates{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ resetDates_ID x
]
[ maybe [] (schemaTypeToXML "calculationPeriodDatesReference") $ resetDates_calculationPeriodDatesReference x
, maybe [] (schemaTypeToXML "resetRelativeTo") $ resetDates_resetRelativeTo x
, maybe [] (schemaTypeToXML "initialFixingDate") $ resetDates_initialFixingDate x
, maybe [] (schemaTypeToXML "fixingDates") $ resetDates_fixingDates x
, maybe [] (schemaTypeToXML "rateCutOffDaysOffset") $ resetDates_rateCutOffDaysOffset x
, schemaTypeToXML "resetFrequency" $ resetDates_resetFrequency x
, maybe [] (schemaTypeToXML "resetDatesAdjustments") $ resetDates_adjustments x
]
data ResetDatesReference = ResetDatesReference
{ resetDatesRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType ResetDatesReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (ResetDatesReference a0)
schemaTypeToXML s x@ResetDatesReference{} =
toXMLElement s [ toXMLAttribute "href" $ resetDatesRef_href x
]
[]
instance Extension ResetDatesReference Reference where
supertype v = Reference_ResetDatesReference v
data SettlementProvision = SettlementProvision
{ settlProvis_settlementCurrency :: Maybe Currency
, settlProvis_nonDeliverableSettlement :: Maybe NonDeliverableSettlement
}
deriving (Eq,Show)
instance SchemaType SettlementProvision where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SettlementProvision
`apply` optional (parseSchemaType "settlementCurrency")
`apply` optional (parseSchemaType "nonDeliverableSettlement")
schemaTypeToXML s x@SettlementProvision{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "settlementCurrency") $ settlProvis_settlementCurrency x
, maybe [] (schemaTypeToXML "nonDeliverableSettlement") $ settlProvis_nonDeliverableSettlement x
]
data SettlementRateOption = SettlementRateOption Scheme SettlementRateOptionAttributes deriving (Eq,Show)
data SettlementRateOptionAttributes = SettlementRateOptionAttributes
{ settlRateOptionAttrib_settlementRateOptionScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType SettlementRateOption where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "settlementRateOptionScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ SettlementRateOption v (SettlementRateOptionAttributes a0)
schemaTypeToXML s (SettlementRateOption bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "settlementRateOptionScheme") $ settlRateOptionAttrib_settlementRateOptionScheme at
]
$ schemaTypeToXML s bt
instance Extension SettlementRateOption Scheme where
supertype (SettlementRateOption s _) = s
data SinglePartyOption = SinglePartyOption
{ singlePartyOption_buyerPartyReference :: Maybe PartyReference
, singlePartyOption_buyerAccountReference :: Maybe AccountReference
, singlePartyOption_sellerPartyReference :: Maybe PartyReference
, singlePartyOption_sellerAccountReference :: Maybe AccountReference
}
deriving (Eq,Show)
instance SchemaType SinglePartyOption where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SinglePartyOption
`apply` optional (parseSchemaType "buyerPartyReference")
`apply` optional (parseSchemaType "buyerAccountReference")
`apply` optional (parseSchemaType "sellerPartyReference")
`apply` optional (parseSchemaType "sellerAccountReference")
schemaTypeToXML s x@SinglePartyOption{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "buyerPartyReference") $ singlePartyOption_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ singlePartyOption_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ singlePartyOption_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ singlePartyOption_sellerAccountReference x
]
data StubCalculationPeriodAmount = StubCalculationPeriodAmount
{ stubCalcPeriodAmount_calculationPeriodDatesReference :: Maybe CalculationPeriodDatesReference
, stubCalcPeriodAmount_initialStub :: Maybe StubValue
, stubCalcPeriodAmount_finalStub :: Maybe StubValue
}
deriving (Eq,Show)
instance SchemaType StubCalculationPeriodAmount where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return StubCalculationPeriodAmount
`apply` optional (parseSchemaType "calculationPeriodDatesReference")
`apply` optional (parseSchemaType "initialStub")
`apply` optional (parseSchemaType "finalStub")
schemaTypeToXML s x@StubCalculationPeriodAmount{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "calculationPeriodDatesReference") $ stubCalcPeriodAmount_calculationPeriodDatesReference x
, maybe [] (schemaTypeToXML "initialStub") $ stubCalcPeriodAmount_initialStub x
, maybe [] (schemaTypeToXML "finalStub") $ stubCalcPeriodAmount_finalStub x
]
data Swap = Swap
{ swap_ID :: Maybe Xsd.ID
, swap_primaryAssetClass :: Maybe AssetClass
, swap_secondaryAssetClass :: [AssetClass]
, swap_productType :: [ProductType]
, swap_productId :: [ProductId]
, swap_stream :: [InterestRateStream]
, swap_earlyTerminationProvision :: Maybe EarlyTerminationProvision
, swap_cancelableProvision :: Maybe CancelableProvision
, swap_extendibleProvision :: Maybe ExtendibleProvision
, swap_additionalPayment :: [Payment]
, swap_additionalTerms :: Maybe SwapAdditionalTerms
}
deriving (Eq,Show)
instance SchemaType Swap where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Swap a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` many1 (parseSchemaType "swapStream")
`apply` optional (parseSchemaType "earlyTerminationProvision")
`apply` optional (parseSchemaType "cancelableProvision")
`apply` optional (parseSchemaType "extendibleProvision")
`apply` many (parseSchemaType "additionalPayment")
`apply` optional (parseSchemaType "additionalTerms")
schemaTypeToXML s x@Swap{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ swap_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ swap_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ swap_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ swap_productType x
, concatMap (schemaTypeToXML "productId") $ swap_productId x
, concatMap (schemaTypeToXML "swapStream") $ swap_stream x
, maybe [] (schemaTypeToXML "earlyTerminationProvision") $ swap_earlyTerminationProvision x
, maybe [] (schemaTypeToXML "cancelableProvision") $ swap_cancelableProvision x
, maybe [] (schemaTypeToXML "extendibleProvision") $ swap_extendibleProvision x
, concatMap (schemaTypeToXML "additionalPayment") $ swap_additionalPayment x
, maybe [] (schemaTypeToXML "additionalTerms") $ swap_additionalTerms x
]
instance Extension Swap Product where
supertype v = Product_Swap v
data SwapAdditionalTerms = SwapAdditionalTerms
{ swapAddTerms_bondReference :: Maybe BondReference
}
deriving (Eq,Show)
instance SchemaType SwapAdditionalTerms where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SwapAdditionalTerms
`apply` optional (parseSchemaType "bondReference")
schemaTypeToXML s x@SwapAdditionalTerms{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "bondReference") $ swapAddTerms_bondReference x
]
data Swaption = Swaption
{ swaption_ID :: Maybe Xsd.ID
, swaption_primaryAssetClass :: Maybe AssetClass
, swaption_secondaryAssetClass :: [AssetClass]
, swaption_productType :: [ProductType]
, swaption_productId :: [ProductId]
, swaption_buyerPartyReference :: Maybe PartyReference
, swaption_buyerAccountReference :: Maybe AccountReference
, swaption_sellerPartyReference :: Maybe PartyReference
, swaption_sellerAccountReference :: Maybe AccountReference
, swaption_premium :: [Payment]
, swaption_optionType :: Maybe OptionTypeEnum
, swaption_exercise :: Exercise
, swaption_exerciseProcedure :: Maybe ExerciseProcedure
, swaption_calculationAgent :: Maybe CalculationAgent
, swaption_choice13 :: (Maybe (OneOf2 CashSettlement SwaptionPhysicalSettlement))
, swaption_straddle :: Xsd.Boolean
, swaption_adjustedDates :: Maybe SwaptionAdjustedDates
, swaption_swap :: Swap
}
deriving (Eq,Show)
instance SchemaType Swaption where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Swaption a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "buyerPartyReference")
`apply` optional (parseSchemaType "buyerAccountReference")
`apply` optional (parseSchemaType "sellerPartyReference")
`apply` optional (parseSchemaType "sellerAccountReference")
`apply` many1 (parseSchemaType "premium")
`apply` optional (parseSchemaType "optionType")
`apply` elementExercise
`apply` optional (parseSchemaType "exerciseProcedure")
`apply` optional (parseSchemaType "calculationAgent")
`apply` optional (oneOf' [ ("CashSettlement", fmap OneOf2 (parseSchemaType "cashSettlement"))
, ("SwaptionPhysicalSettlement", fmap TwoOf2 (parseSchemaType "physicalSettlement"))
])
`apply` parseSchemaType "swaptionStraddle"
`apply` optional (parseSchemaType "swaptionAdjustedDates")
`apply` parseSchemaType "swap"
schemaTypeToXML s x@Swaption{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ swaption_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ swaption_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ swaption_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ swaption_productType x
, concatMap (schemaTypeToXML "productId") $ swaption_productId x
, maybe [] (schemaTypeToXML "buyerPartyReference") $ swaption_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ swaption_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ swaption_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ swaption_sellerAccountReference x
, concatMap (schemaTypeToXML "premium") $ swaption_premium x
, maybe [] (schemaTypeToXML "optionType") $ swaption_optionType x
, elementToXMLExercise $ swaption_exercise x
, maybe [] (schemaTypeToXML "exerciseProcedure") $ swaption_exerciseProcedure x
, maybe [] (schemaTypeToXML "calculationAgent") $ swaption_calculationAgent x
, maybe [] (foldOneOf2 (schemaTypeToXML "cashSettlement")
(schemaTypeToXML "physicalSettlement")
) $ swaption_choice13 x
, schemaTypeToXML "swaptionStraddle" $ swaption_straddle x
, maybe [] (schemaTypeToXML "swaptionAdjustedDates") $ swaption_adjustedDates x
, schemaTypeToXML "swap" $ swaption_swap x
]
instance Extension Swaption Product where
supertype v = Product_Swaption v
data SwaptionAdjustedDates = SwaptionAdjustedDates
{ swaptAdjustDates_exerciseEvent :: [ExerciseEvent]
}
deriving (Eq,Show)
instance SchemaType SwaptionAdjustedDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SwaptionAdjustedDates
`apply` many (parseSchemaType "exerciseEvent")
schemaTypeToXML s x@SwaptionAdjustedDates{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "exerciseEvent") $ swaptAdjustDates_exerciseEvent x
]
data SwaptionPhysicalSettlement = SwaptionPhysicalSettlement
{ swaptPhysicSettl_clearedPhysicalSettlement :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType SwaptionPhysicalSettlement where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SwaptionPhysicalSettlement
`apply` optional (parseSchemaType "clearedPhysicalSettlement")
schemaTypeToXML s x@SwaptionPhysicalSettlement{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "clearedPhysicalSettlement") $ swaptPhysicSettl_clearedPhysicalSettlement x
]
data ValuationDatesReference = ValuationDatesReference
{ valDatesRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType ValuationDatesReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (ValuationDatesReference a0)
schemaTypeToXML s x@ValuationDatesReference{} =
toXMLElement s [ toXMLAttribute "href" $ valDatesRef_href x
]
[]
instance Extension ValuationDatesReference Reference where
supertype v = Reference_ValuationDatesReference v
data ValuationPostponement = ValuationPostponement
{ valPostp_maximumDaysOfPostponement :: Maybe Xsd.PositiveInteger
}
deriving (Eq,Show)
instance SchemaType ValuationPostponement where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ValuationPostponement
`apply` optional (parseSchemaType "maximumDaysOfPostponement")
schemaTypeToXML s x@ValuationPostponement{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "maximumDaysOfPostponement") $ valPostp_maximumDaysOfPostponement x
]
data YieldCurveMethod = YieldCurveMethod
{ yieldCurveMethod_settlementRateSource :: Maybe SettlementRateSource
, yieldCurveMethod_quotationRateType :: Maybe QuotationRateTypeEnum
}
deriving (Eq,Show)
instance SchemaType YieldCurveMethod where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return YieldCurveMethod
`apply` optional (parseSchemaType "settlementRateSource")
`apply` optional (parseSchemaType "quotationRateType")
schemaTypeToXML s x@YieldCurveMethod{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "settlementRateSource") $ yieldCurveMethod_settlementRateSource x
, maybe [] (schemaTypeToXML "quotationRateType") $ yieldCurveMethod_quotationRateType x
]
elementBulletPayment :: XMLParser BulletPayment
elementBulletPayment = parseSchemaType "bulletPayment"
elementToXMLBulletPayment :: BulletPayment -> [Content ()]
elementToXMLBulletPayment = schemaTypeToXML "bulletPayment"
elementCapFloor :: XMLParser CapFloor
elementCapFloor = parseSchemaType "capFloor"
elementToXMLCapFloor :: CapFloor -> [Content ()]
elementToXMLCapFloor = schemaTypeToXML "capFloor"
elementFloatingRateCalculation :: XMLParser FloatingRateCalculation
elementFloatingRateCalculation = parseSchemaType "floatingRateCalculation"
elementToXMLFloatingRateCalculation :: FloatingRateCalculation -> [Content ()]
elementToXMLFloatingRateCalculation = schemaTypeToXML "floatingRateCalculation"
elementFra :: XMLParser Fra
elementFra = parseSchemaType "fra"
elementToXMLFra :: Fra -> [Content ()]
elementToXMLFra = schemaTypeToXML "fra"
elementInflationRateCalculation :: XMLParser InflationRateCalculation
elementInflationRateCalculation = parseSchemaType "inflationRateCalculation"
elementToXMLInflationRateCalculation :: InflationRateCalculation -> [Content ()]
elementToXMLInflationRateCalculation = schemaTypeToXML "inflationRateCalculation"
elementRateCalculation :: XMLParser Rate
elementRateCalculation = fmap supertype elementInflationRateCalculation
`onFail`
fmap supertype elementFloatingRateCalculation
`onFail` fail "Parse failed when expecting an element in the substitution group for\n\
\ <rateCalculation>,\n\
\ namely one of:\n\
\<inflationRateCalculation>, <floatingRateCalculation>"
elementToXMLRateCalculation :: Rate -> [Content ()]
elementToXMLRateCalculation = schemaTypeToXML "rateCalculation"
elementSwap :: XMLParser Swap
elementSwap = parseSchemaType "swap"
elementToXMLSwap :: Swap -> [Content ()]
elementToXMLSwap = schemaTypeToXML "swap"
elementSwaption :: XMLParser Swaption
elementSwaption = parseSchemaType "swaption"
elementToXMLSwaption :: Swaption -> [Content ()]
elementToXMLSwaption = schemaTypeToXML "swaption"