module Data.FpML.V53.CD
( module Data.FpML.V53.CD
, module Data.FpML.V53.Shared.Option
) 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.Shared.Option
data AdditionalFixedPayments = AdditionalFixedPayments
{ addFixedPaymen_interestShortfallReimbursement :: Maybe Xsd.Boolean
, addFixedPaymen_principalShortfallReimbursement :: Maybe Xsd.Boolean
, addFixedPaymen_writedownReimbursement :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType AdditionalFixedPayments where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return AdditionalFixedPayments
`apply` optional (parseSchemaType "interestShortfallReimbursement")
`apply` optional (parseSchemaType "principalShortfallReimbursement")
`apply` optional (parseSchemaType "writedownReimbursement")
schemaTypeToXML s x@AdditionalFixedPayments{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "interestShortfallReimbursement") $ addFixedPaymen_interestShortfallReimbursement x
, maybe [] (schemaTypeToXML "principalShortfallReimbursement") $ addFixedPaymen_principalShortfallReimbursement x
, maybe [] (schemaTypeToXML "writedownReimbursement") $ addFixedPaymen_writedownReimbursement x
]
data AdditionalTerm = AdditionalTerm Scheme AdditionalTermAttributes deriving (Eq,Show)
data AdditionalTermAttributes = AdditionalTermAttributes
{ addTermAttrib_additionalTermScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType AdditionalTerm where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "additionalTermScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ AdditionalTerm v (AdditionalTermAttributes a0)
schemaTypeToXML s (AdditionalTerm bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "additionalTermScheme") $ addTermAttrib_additionalTermScheme at
]
$ schemaTypeToXML s bt
instance Extension AdditionalTerm Scheme where
supertype (AdditionalTerm s _) = s
data AdjustedPaymentDates = AdjustedPaymentDates
{ adjustPaymentDates_adjustedPaymentDate :: Maybe Xsd.Date
, adjustPaymentDates_paymentAmount :: Maybe Money
}
deriving (Eq,Show)
instance SchemaType AdjustedPaymentDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return AdjustedPaymentDates
`apply` optional (parseSchemaType "adjustedPaymentDate")
`apply` optional (parseSchemaType "paymentAmount")
schemaTypeToXML s x@AdjustedPaymentDates{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "adjustedPaymentDate") $ adjustPaymentDates_adjustedPaymentDate x
, maybe [] (schemaTypeToXML "paymentAmount") $ adjustPaymentDates_paymentAmount x
]
data BasketReferenceInformation = BasketReferenceInformation
{ basketRefInfo_choice0 :: (Maybe (OneOf1 ((Maybe (BasketName)),[BasketId])))
, basketRefInfo_referencePool :: Maybe ReferencePool
, basketRefInfo_choice2 :: (Maybe (OneOf2 ((Maybe (Xsd.PositiveInteger)),(Maybe (Xsd.PositiveInteger))) Tranche))
}
deriving (Eq,Show)
instance SchemaType BasketReferenceInformation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return BasketReferenceInformation
`apply` optional (oneOf' [ ("Maybe BasketName [BasketId]", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "basketName")
`apply` many (parseSchemaType "basketId")))
])
`apply` optional (parseSchemaType "referencePool")
`apply` optional (oneOf' [ ("Maybe Xsd.PositiveInteger Maybe Xsd.PositiveInteger", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "nthToDefault")
`apply` optional (parseSchemaType "mthToDefault")))
, ("Tranche", fmap TwoOf2 (parseSchemaType "tranche"))
])
schemaTypeToXML s x@BasketReferenceInformation{} =
toXMLElement s []
[ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "basketName") a
, concatMap (schemaTypeToXML "basketId") b
])
) $ basketRefInfo_choice0 x
, maybe [] (schemaTypeToXML "referencePool") $ basketRefInfo_referencePool x
, maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "nthToDefault") a
, maybe [] (schemaTypeToXML "mthToDefault") b
])
(schemaTypeToXML "tranche")
) $ basketRefInfo_choice2 x
]
data CalculationAmount = CalculationAmount
{ calcAmount_ID :: Maybe Xsd.ID
, calcAmount_currency :: Currency
, calcAmount_amount :: Xsd.Decimal
, calcAmount_step :: [Step]
}
deriving (Eq,Show)
instance SchemaType CalculationAmount where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CalculationAmount a0)
`apply` parseSchemaType "currency"
`apply` parseSchemaType "amount"
`apply` many (parseSchemaType "step")
schemaTypeToXML s x@CalculationAmount{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ calcAmount_ID x
]
[ schemaTypeToXML "currency" $ calcAmount_currency x
, schemaTypeToXML "amount" $ calcAmount_amount x
, concatMap (schemaTypeToXML "step") $ calcAmount_step x
]
instance Extension CalculationAmount Money where
supertype (CalculationAmount a0 e0 e1 e2) =
Money a0 e0 e1
instance Extension CalculationAmount MoneyBase where
supertype = (supertype :: Money -> MoneyBase)
. (supertype :: CalculationAmount -> Money)
data CashSettlementTerms = CashSettlementTerms
{ cashSettlTerms_ID :: Maybe Xsd.ID
, cashSettlTerms_settlementCurrency :: Maybe Currency
, cashSettlTerms_valuationDate :: Maybe ValuationDate
, cashSettlTerms_valuationTime :: Maybe BusinessCenterTime
, cashSettlTerms_quotationMethod :: Maybe QuotationRateTypeEnum
, cashSettlTerms_quotationAmount :: Maybe Money
, cashSettlTerms_minimumQuotationAmount :: Maybe Money
, cashSettlTerms_dealer :: [Xsd.XsdString]
, cashSettlTerms_cashSettlementBusinessDays :: Maybe Xsd.NonNegativeInteger
, cashSettlTerms_choice8 :: (Maybe (OneOf2 Money RestrictedPercentage))
, cashSettlTerms_fixedSettlement :: Maybe Xsd.Boolean
, cashSettlTerms_accruedInterest :: Maybe Xsd.Boolean
, cashSettlTerms_valuationMethod :: Maybe ValuationMethodEnum
}
deriving (Eq,Show)
instance SchemaType CashSettlementTerms where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CashSettlementTerms a0)
`apply` optional (parseSchemaType "settlementCurrency")
`apply` optional (parseSchemaType "valuationDate")
`apply` optional (parseSchemaType "valuationTime")
`apply` optional (parseSchemaType "quotationMethod")
`apply` optional (parseSchemaType "quotationAmount")
`apply` optional (parseSchemaType "minimumQuotationAmount")
`apply` many (parseSchemaType "dealer")
`apply` optional (parseSchemaType "cashSettlementBusinessDays")
`apply` optional (oneOf' [ ("Money", fmap OneOf2 (parseSchemaType "cashSettlementAmount"))
, ("RestrictedPercentage", fmap TwoOf2 (parseSchemaType "recoveryFactor"))
])
`apply` optional (parseSchemaType "fixedSettlement")
`apply` optional (parseSchemaType "accruedInterest")
`apply` optional (parseSchemaType "valuationMethod")
schemaTypeToXML s x@CashSettlementTerms{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ cashSettlTerms_ID x
]
[ maybe [] (schemaTypeToXML "settlementCurrency") $ cashSettlTerms_settlementCurrency x
, maybe [] (schemaTypeToXML "valuationDate") $ cashSettlTerms_valuationDate x
, maybe [] (schemaTypeToXML "valuationTime") $ cashSettlTerms_valuationTime x
, maybe [] (schemaTypeToXML "quotationMethod") $ cashSettlTerms_quotationMethod x
, maybe [] (schemaTypeToXML "quotationAmount") $ cashSettlTerms_quotationAmount x
, maybe [] (schemaTypeToXML "minimumQuotationAmount") $ cashSettlTerms_minimumQuotationAmount x
, concatMap (schemaTypeToXML "dealer") $ cashSettlTerms_dealer x
, maybe [] (schemaTypeToXML "cashSettlementBusinessDays") $ cashSettlTerms_cashSettlementBusinessDays x
, maybe [] (foldOneOf2 (schemaTypeToXML "cashSettlementAmount")
(schemaTypeToXML "recoveryFactor")
) $ cashSettlTerms_choice8 x
, maybe [] (schemaTypeToXML "fixedSettlement") $ cashSettlTerms_fixedSettlement x
, maybe [] (schemaTypeToXML "accruedInterest") $ cashSettlTerms_accruedInterest x
, maybe [] (schemaTypeToXML "valuationMethod") $ cashSettlTerms_valuationMethod x
]
instance Extension CashSettlementTerms SettlementTerms where
supertype (CashSettlementTerms a0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11) =
SettlementTerms a0 e0
data CreditDefaultSwap = CreditDefaultSwap
{ creditDefaultSwap_ID :: Maybe Xsd.ID
, creditDefaultSwap_primaryAssetClass :: Maybe AssetClass
, creditDefaultSwap_secondaryAssetClass :: [AssetClass]
, creditDefaultSwap_productType :: [ProductType]
, creditDefaultSwap_productId :: [ProductId]
, creditDefaultSwap_generalTerms :: GeneralTerms
, creditDefaultSwap_feeLeg :: FeeLeg
, creditDefaultSwap_protectionTerms :: [ProtectionTerms]
, creditDefaultSwap_choice7 :: [OneOf2 CashSettlementTerms PhysicalSettlementTerms]
}
deriving (Eq,Show)
instance SchemaType CreditDefaultSwap where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CreditDefaultSwap a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` parseSchemaType "generalTerms"
`apply` parseSchemaType "feeLeg"
`apply` many1 (parseSchemaType "protectionTerms")
`apply` many (oneOf' [ ("CashSettlementTerms", fmap OneOf2 (parseSchemaType "cashSettlementTerms"))
, ("PhysicalSettlementTerms", fmap TwoOf2 (parseSchemaType "physicalSettlementTerms"))
])
schemaTypeToXML s x@CreditDefaultSwap{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ creditDefaultSwap_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ creditDefaultSwap_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ creditDefaultSwap_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ creditDefaultSwap_productType x
, concatMap (schemaTypeToXML "productId") $ creditDefaultSwap_productId x
, schemaTypeToXML "generalTerms" $ creditDefaultSwap_generalTerms x
, schemaTypeToXML "feeLeg" $ creditDefaultSwap_feeLeg x
, concatMap (schemaTypeToXML "protectionTerms") $ creditDefaultSwap_protectionTerms x
, concatMap (foldOneOf2 (schemaTypeToXML "cashSettlementTerms")
(schemaTypeToXML "physicalSettlementTerms")
) $ creditDefaultSwap_choice7 x
]
instance Extension CreditDefaultSwap Product where
supertype v = Product_CreditDefaultSwap v
data CreditDefaultSwapOption = CreditDefaultSwapOption
{ creditDefaultSwapOption_ID :: Maybe Xsd.ID
, creditDefaultSwapOption_primaryAssetClass :: Maybe AssetClass
, creditDefaultSwapOption_secondaryAssetClass :: [AssetClass]
, creditDefaultSwapOption_productType :: [ProductType]
, creditDefaultSwapOption_productId :: [ProductId]
, creditDefaultSwapOption_buyerPartyReference :: Maybe PartyReference
, creditDefaultSwapOption_buyerAccountReference :: Maybe AccountReference
, creditDefaultSwapOption_sellerPartyReference :: Maybe PartyReference
, creditDefaultSwapOption_sellerAccountReference :: Maybe AccountReference
, creditDefaultSwapOption_optionType :: OptionTypeEnum
, creditDefaultSwapOption_premium :: Premium
, creditDefaultSwapOption_exercise :: Exercise
, creditDefaultSwapOption_exerciseProcedure :: Maybe ExerciseProcedure
, creditDefaultSwapOption_feature :: Maybe OptionFeature
, creditDefaultSwapOption_choice13 :: (Maybe (OneOf2 NotionalAmountReference Money))
, creditDefaultSwapOption_optionEntitlement :: Maybe PositiveDecimal
, creditDefaultSwapOption_entitlementCurrency :: Maybe Currency
, creditDefaultSwapOption_numberOfOptions :: Maybe PositiveDecimal
, creditDefaultSwapOption_settlementType :: Maybe SettlementTypeEnum
, creditDefaultSwapOption_settlementDate :: Maybe AdjustableOrRelativeDate
, creditDefaultSwapOption_choice19 :: (Maybe (OneOf2 Money Currency))
, creditDefaultSwapOption_strike :: CreditOptionStrike
, creditDefaultSwapOption_creditDefaultSwap :: CreditDefaultSwap
}
deriving (Eq,Show)
instance SchemaType CreditDefaultSwapOption where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (CreditDefaultSwapOption 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 "optionType"
`apply` parseSchemaType "premium"
`apply` elementExercise
`apply` optional (parseSchemaType "exerciseProcedure")
`apply` optional (parseSchemaType "feature")
`apply` optional (oneOf' [ ("NotionalAmountReference", fmap OneOf2 (parseSchemaType "notionalReference"))
, ("Money", fmap TwoOf2 (parseSchemaType "notionalAmount"))
])
`apply` optional (parseSchemaType "optionEntitlement")
`apply` optional (parseSchemaType "entitlementCurrency")
`apply` optional (parseSchemaType "numberOfOptions")
`apply` optional (parseSchemaType "settlementType")
`apply` optional (parseSchemaType "settlementDate")
`apply` optional (oneOf' [ ("Money", fmap OneOf2 (parseSchemaType "settlementAmount"))
, ("Currency", fmap TwoOf2 (parseSchemaType "settlementCurrency"))
])
`apply` parseSchemaType "strike"
`apply` parseSchemaType "creditDefaultSwap"
schemaTypeToXML s x@CreditDefaultSwapOption{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ creditDefaultSwapOption_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ creditDefaultSwapOption_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ creditDefaultSwapOption_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ creditDefaultSwapOption_productType x
, concatMap (schemaTypeToXML "productId") $ creditDefaultSwapOption_productId x
, maybe [] (schemaTypeToXML "buyerPartyReference") $ creditDefaultSwapOption_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ creditDefaultSwapOption_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ creditDefaultSwapOption_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ creditDefaultSwapOption_sellerAccountReference x
, schemaTypeToXML "optionType" $ creditDefaultSwapOption_optionType x
, schemaTypeToXML "premium" $ creditDefaultSwapOption_premium x
, elementToXMLExercise $ creditDefaultSwapOption_exercise x
, maybe [] (schemaTypeToXML "exerciseProcedure") $ creditDefaultSwapOption_exerciseProcedure x
, maybe [] (schemaTypeToXML "feature") $ creditDefaultSwapOption_feature x
, maybe [] (foldOneOf2 (schemaTypeToXML "notionalReference")
(schemaTypeToXML "notionalAmount")
) $ creditDefaultSwapOption_choice13 x
, maybe [] (schemaTypeToXML "optionEntitlement") $ creditDefaultSwapOption_optionEntitlement x
, maybe [] (schemaTypeToXML "entitlementCurrency") $ creditDefaultSwapOption_entitlementCurrency x
, maybe [] (schemaTypeToXML "numberOfOptions") $ creditDefaultSwapOption_numberOfOptions x
, maybe [] (schemaTypeToXML "settlementType") $ creditDefaultSwapOption_settlementType x
, maybe [] (schemaTypeToXML "settlementDate") $ creditDefaultSwapOption_settlementDate x
, maybe [] (foldOneOf2 (schemaTypeToXML "settlementAmount")
(schemaTypeToXML "settlementCurrency")
) $ creditDefaultSwapOption_choice19 x
, schemaTypeToXML "strike" $ creditDefaultSwapOption_strike x
, schemaTypeToXML "creditDefaultSwap" $ creditDefaultSwapOption_creditDefaultSwap x
]
instance Extension CreditDefaultSwapOption OptionBaseExtended where
supertype v = OptionBaseExtended_CreditDefaultSwapOption v
instance Extension CreditDefaultSwapOption OptionBase where
supertype = (supertype :: OptionBaseExtended -> OptionBase)
. (supertype :: CreditDefaultSwapOption -> OptionBaseExtended)
instance Extension CreditDefaultSwapOption Option where
supertype = (supertype :: OptionBase -> Option)
. (supertype :: OptionBaseExtended -> OptionBase)
. (supertype :: CreditDefaultSwapOption -> OptionBaseExtended)
instance Extension CreditDefaultSwapOption Product where
supertype = (supertype :: Option -> Product)
. (supertype :: OptionBase -> Option)
. (supertype :: OptionBaseExtended -> OptionBase)
. (supertype :: CreditDefaultSwapOption -> OptionBaseExtended)
data CreditOptionStrike = CreditOptionStrike
{ creditOptionStrike_choice0 :: (Maybe (OneOf3 Xsd.Decimal Xsd.Decimal FixedRateReference))
}
deriving (Eq,Show)
instance SchemaType CreditOptionStrike where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CreditOptionStrike
`apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf3 (parseSchemaType "spread"))
, ("Xsd.Decimal", fmap TwoOf3 (parseSchemaType "price"))
, ("FixedRateReference", fmap ThreeOf3 (parseSchemaType "strikeReference"))
])
schemaTypeToXML s x@CreditOptionStrike{} =
toXMLElement s []
[ maybe [] (foldOneOf3 (schemaTypeToXML "spread")
(schemaTypeToXML "price")
(schemaTypeToXML "strikeReference")
) $ creditOptionStrike_choice0 x
]
data DeliverableObligations = DeliverableObligations
{ delivOblig_accruedInterest :: Maybe Xsd.Boolean
, delivOblig_category :: Maybe ObligationCategoryEnum
, delivOblig_notSubordinated :: Maybe Xsd.Boolean
, delivOblig_specifiedCurrency :: Maybe SpecifiedCurrency
, delivOblig_notSovereignLender :: Maybe Xsd.Boolean
, delivOblig_notDomesticCurrency :: Maybe NotDomesticCurrency
, delivOblig_notDomesticLaw :: Maybe Xsd.Boolean
, delivOblig_listed :: Maybe Xsd.Boolean
, delivOblig_notContingent :: Maybe Xsd.Boolean
, delivOblig_notDomesticIssuance :: Maybe Xsd.Boolean
, delivOblig_assignableLoan :: Maybe PCDeliverableObligationCharac
, delivOblig_consentRequiredLoan :: Maybe PCDeliverableObligationCharac
, delivOblig_directLoanParticipation :: Maybe LoanParticipation
, delivOblig_transferable :: Maybe Xsd.Boolean
, delivOblig_maximumMaturity :: Maybe Period
, delivOblig_acceleratedOrMatured :: Maybe Xsd.Boolean
, delivOblig_notBearer :: Maybe Xsd.Boolean
, delivOblig_choice17 :: (Maybe (OneOf3 Xsd.Boolean Xsd.Boolean Xsd.Boolean))
, delivOblig_indirectLoanParticipation :: Maybe LoanParticipation
, delivOblig_excluded :: Maybe Xsd.XsdString
, delivOblig_othReferenceEntityObligations :: Maybe Xsd.XsdString
}
deriving (Eq,Show)
instance SchemaType DeliverableObligations where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return DeliverableObligations
`apply` optional (parseSchemaType "accruedInterest")
`apply` optional (parseSchemaType "category")
`apply` optional (parseSchemaType "notSubordinated")
`apply` optional (parseSchemaType "specifiedCurrency")
`apply` optional (parseSchemaType "notSovereignLender")
`apply` optional (parseSchemaType "notDomesticCurrency")
`apply` optional (parseSchemaType "notDomesticLaw")
`apply` optional (parseSchemaType "listed")
`apply` optional (parseSchemaType "notContingent")
`apply` optional (parseSchemaType "notDomesticIssuance")
`apply` optional (parseSchemaType "assignableLoan")
`apply` optional (parseSchemaType "consentRequiredLoan")
`apply` optional (parseSchemaType "directLoanParticipation")
`apply` optional (parseSchemaType "transferable")
`apply` optional (parseSchemaType "maximumMaturity")
`apply` optional (parseSchemaType "acceleratedOrMatured")
`apply` optional (parseSchemaType "notBearer")
`apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf3 (parseSchemaType "fullFaithAndCreditObLiability"))
, ("Xsd.Boolean", fmap TwoOf3 (parseSchemaType "generalFundObligationLiability"))
, ("Xsd.Boolean", fmap ThreeOf3 (parseSchemaType "revenueObligationLiability"))
])
`apply` optional (parseSchemaType "indirectLoanParticipation")
`apply` optional (parseSchemaType "excluded")
`apply` optional (parseSchemaType "othReferenceEntityObligations")
schemaTypeToXML s x@DeliverableObligations{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "accruedInterest") $ delivOblig_accruedInterest x
, maybe [] (schemaTypeToXML "category") $ delivOblig_category x
, maybe [] (schemaTypeToXML "notSubordinated") $ delivOblig_notSubordinated x
, maybe [] (schemaTypeToXML "specifiedCurrency") $ delivOblig_specifiedCurrency x
, maybe [] (schemaTypeToXML "notSovereignLender") $ delivOblig_notSovereignLender x
, maybe [] (schemaTypeToXML "notDomesticCurrency") $ delivOblig_notDomesticCurrency x
, maybe [] (schemaTypeToXML "notDomesticLaw") $ delivOblig_notDomesticLaw x
, maybe [] (schemaTypeToXML "listed") $ delivOblig_listed x
, maybe [] (schemaTypeToXML "notContingent") $ delivOblig_notContingent x
, maybe [] (schemaTypeToXML "notDomesticIssuance") $ delivOblig_notDomesticIssuance x
, maybe [] (schemaTypeToXML "assignableLoan") $ delivOblig_assignableLoan x
, maybe [] (schemaTypeToXML "consentRequiredLoan") $ delivOblig_consentRequiredLoan x
, maybe [] (schemaTypeToXML "directLoanParticipation") $ delivOblig_directLoanParticipation x
, maybe [] (schemaTypeToXML "transferable") $ delivOblig_transferable x
, maybe [] (schemaTypeToXML "maximumMaturity") $ delivOblig_maximumMaturity x
, maybe [] (schemaTypeToXML "acceleratedOrMatured") $ delivOblig_acceleratedOrMatured x
, maybe [] (schemaTypeToXML "notBearer") $ delivOblig_notBearer x
, maybe [] (foldOneOf3 (schemaTypeToXML "fullFaithAndCreditObLiability")
(schemaTypeToXML "generalFundObligationLiability")
(schemaTypeToXML "revenueObligationLiability")
) $ delivOblig_choice17 x
, maybe [] (schemaTypeToXML "indirectLoanParticipation") $ delivOblig_indirectLoanParticipation x
, maybe [] (schemaTypeToXML "excluded") $ delivOblig_excluded x
, maybe [] (schemaTypeToXML "othReferenceEntityObligations") $ delivOblig_othReferenceEntityObligations x
]
data EntityType = EntityType Scheme EntityTypeAttributes deriving (Eq,Show)
data EntityTypeAttributes = EntityTypeAttributes
{ entityTypeAttrib_entityTypeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType EntityType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "entityTypeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ EntityType v (EntityTypeAttributes a0)
schemaTypeToXML s (EntityType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "entityTypeScheme") $ entityTypeAttrib_entityTypeScheme at
]
$ schemaTypeToXML s bt
instance Extension EntityType Scheme where
supertype (EntityType s _) = s
data FeeLeg = FeeLeg
{ feeLeg_ID :: Maybe Xsd.ID
, feeLeg_initialPayment :: Maybe InitialPayment
, feeLeg_singlePayment :: [SinglePayment]
, feeLeg_periodicPayment :: Maybe PeriodicPayment
, feeLeg_marketFixedRate :: Maybe Xsd.Decimal
, feeLeg_paymentDelay :: Maybe Xsd.Boolean
, feeLeg_initialPoints :: Maybe Xsd.Decimal
, feeLeg_quotationStyle :: Maybe QuotationStyleEnum
}
deriving (Eq,Show)
instance SchemaType FeeLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FeeLeg a0)
`apply` optional (parseSchemaType "initialPayment")
`apply` many (parseSchemaType "singlePayment")
`apply` optional (parseSchemaType "periodicPayment")
`apply` optional (parseSchemaType "marketFixedRate")
`apply` optional (parseSchemaType "paymentDelay")
`apply` optional (parseSchemaType "initialPoints")
`apply` optional (parseSchemaType "quotationStyle")
schemaTypeToXML s x@FeeLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ feeLeg_ID x
]
[ maybe [] (schemaTypeToXML "initialPayment") $ feeLeg_initialPayment x
, concatMap (schemaTypeToXML "singlePayment") $ feeLeg_singlePayment x
, maybe [] (schemaTypeToXML "periodicPayment") $ feeLeg_periodicPayment x
, maybe [] (schemaTypeToXML "marketFixedRate") $ feeLeg_marketFixedRate x
, maybe [] (schemaTypeToXML "paymentDelay") $ feeLeg_paymentDelay x
, maybe [] (schemaTypeToXML "initialPoints") $ feeLeg_initialPoints x
, maybe [] (schemaTypeToXML "quotationStyle") $ feeLeg_quotationStyle x
]
instance Extension FeeLeg Leg where
supertype v = Leg_FeeLeg v
data FixedAmountCalculation = FixedAmountCalculation
{ fixedAmountCalc_calculationAmount :: Maybe CalculationAmount
, fixedAmountCalc_fixedRate :: FixedRate
, fixedAmountCalc_dayCountFraction :: Maybe DayCountFraction
}
deriving (Eq,Show)
instance SchemaType FixedAmountCalculation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FixedAmountCalculation
`apply` optional (parseSchemaType "calculationAmount")
`apply` parseSchemaType "fixedRate"
`apply` optional (parseSchemaType "dayCountFraction")
schemaTypeToXML s x@FixedAmountCalculation{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "calculationAmount") $ fixedAmountCalc_calculationAmount x
, schemaTypeToXML "fixedRate" $ fixedAmountCalc_fixedRate x
, maybe [] (schemaTypeToXML "dayCountFraction") $ fixedAmountCalc_dayCountFraction x
]
data FixedRate = FixedRate Xsd.Decimal FixedRateAttributes deriving (Eq,Show)
data FixedRateAttributes = FixedRateAttributes
{ fixedRateAttrib_ID :: Maybe Xsd.ID
}
deriving (Eq,Show)
instance SchemaType FixedRate where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "id" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ FixedRate v (FixedRateAttributes a0)
schemaTypeToXML s (FixedRate bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "id") $ fixedRateAttrib_ID at
]
$ schemaTypeToXML s bt
instance Extension FixedRate Xsd.Decimal where
supertype (FixedRate s _) = s
data FixedRateReference = FixedRateReference
{ fixedRateRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType FixedRateReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (FixedRateReference a0)
schemaTypeToXML s x@FixedRateReference{} =
toXMLElement s [ toXMLAttribute "href" $ fixedRateRef_href x
]
[]
instance Extension FixedRateReference Reference where
supertype v = Reference_FixedRateReference v
data FloatingAmountEvents = FloatingAmountEvents
{ floatAmountEvents_failureToPayPrincipal :: Maybe Xsd.Boolean
, floatAmountEvents_interestShortfall :: Maybe InterestShortFall
, floatAmountEvents_writedown :: Maybe Xsd.Boolean
, floatAmountEvents_impliedWritedown :: Maybe Xsd.Boolean
, floatAmountEvents_floatingAmountProvisions :: Maybe FloatingAmountProvisions
, floatAmountEvents_additionalFixedPayments :: Maybe AdditionalFixedPayments
}
deriving (Eq,Show)
instance SchemaType FloatingAmountEvents where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FloatingAmountEvents
`apply` optional (parseSchemaType "failureToPayPrincipal")
`apply` optional (parseSchemaType "interestShortfall")
`apply` optional (parseSchemaType "writedown")
`apply` optional (parseSchemaType "impliedWritedown")
`apply` optional (parseSchemaType "floatingAmountProvisions")
`apply` optional (parseSchemaType "additionalFixedPayments")
schemaTypeToXML s x@FloatingAmountEvents{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "failureToPayPrincipal") $ floatAmountEvents_failureToPayPrincipal x
, maybe [] (schemaTypeToXML "interestShortfall") $ floatAmountEvents_interestShortfall x
, maybe [] (schemaTypeToXML "writedown") $ floatAmountEvents_writedown x
, maybe [] (schemaTypeToXML "impliedWritedown") $ floatAmountEvents_impliedWritedown x
, maybe [] (schemaTypeToXML "floatingAmountProvisions") $ floatAmountEvents_floatingAmountProvisions x
, maybe [] (schemaTypeToXML "additionalFixedPayments") $ floatAmountEvents_additionalFixedPayments x
]
data FloatingAmountProvisions = FloatingAmountProvisions
{ floatAmountProvis_wACCapInterestProvision :: Maybe Xsd.Boolean
, floatAmountProvis_stepUpProvision :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType FloatingAmountProvisions where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FloatingAmountProvisions
`apply` optional (parseSchemaType "WACCapInterestProvision")
`apply` optional (parseSchemaType "stepUpProvision")
schemaTypeToXML s x@FloatingAmountProvisions{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "WACCapInterestProvision") $ floatAmountProvis_wACCapInterestProvision x
, maybe [] (schemaTypeToXML "stepUpProvision") $ floatAmountProvis_stepUpProvision x
]
data GeneralTerms = GeneralTerms
{ generalTerms_effectiveDate :: AdjustableDate2
, generalTerms_scheduledTerminationDate :: AdjustableDate2
, generalTerms_buyerPartyReference :: Maybe PartyReference
, generalTerms_buyerAccountReference :: Maybe AccountReference
, generalTerms_sellerPartyReference :: Maybe PartyReference
, generalTerms_sellerAccountReference :: Maybe AccountReference
, generalTerms_dateAdjustments :: Maybe BusinessDayAdjustments
, generalTerms_choice7 :: OneOf3 ReferenceInformation IndexReferenceInformation BasketReferenceInformation
, generalTerms_additionalTerm :: [AdditionalTerm]
, generalTerms_substitution :: Maybe Xsd.Boolean
, generalTerms_modifiedEquityDelivery :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType GeneralTerms where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return GeneralTerms
`apply` parseSchemaType "effectiveDate"
`apply` parseSchemaType "scheduledTerminationDate"
`apply` optional (parseSchemaType "buyerPartyReference")
`apply` optional (parseSchemaType "buyerAccountReference")
`apply` optional (parseSchemaType "sellerPartyReference")
`apply` optional (parseSchemaType "sellerAccountReference")
`apply` optional (parseSchemaType "dateAdjustments")
`apply` oneOf' [ ("ReferenceInformation", fmap OneOf3 (parseSchemaType "referenceInformation"))
, ("IndexReferenceInformation", fmap TwoOf3 (parseSchemaType "indexReferenceInformation"))
, ("BasketReferenceInformation", fmap ThreeOf3 (parseSchemaType "basketReferenceInformation"))
]
`apply` many (parseSchemaType "additionalTerm")
`apply` optional (parseSchemaType "substitution")
`apply` optional (parseSchemaType "modifiedEquityDelivery")
schemaTypeToXML s x@GeneralTerms{} =
toXMLElement s []
[ schemaTypeToXML "effectiveDate" $ generalTerms_effectiveDate x
, schemaTypeToXML "scheduledTerminationDate" $ generalTerms_scheduledTerminationDate x
, maybe [] (schemaTypeToXML "buyerPartyReference") $ generalTerms_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ generalTerms_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ generalTerms_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ generalTerms_sellerAccountReference x
, maybe [] (schemaTypeToXML "dateAdjustments") $ generalTerms_dateAdjustments x
, foldOneOf3 (schemaTypeToXML "referenceInformation")
(schemaTypeToXML "indexReferenceInformation")
(schemaTypeToXML "basketReferenceInformation")
$ generalTerms_choice7 x
, concatMap (schemaTypeToXML "additionalTerm") $ generalTerms_additionalTerm x
, maybe [] (schemaTypeToXML "substitution") $ generalTerms_substitution x
, maybe [] (schemaTypeToXML "modifiedEquityDelivery") $ generalTerms_modifiedEquityDelivery x
]
data IndexAnnexSource = IndexAnnexSource Scheme IndexAnnexSourceAttributes deriving (Eq,Show)
data IndexAnnexSourceAttributes = IndexAnnexSourceAttributes
{ indexAnnexSourceAttrib_indexAnnexSourceScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType IndexAnnexSource where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "indexAnnexSourceScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ IndexAnnexSource v (IndexAnnexSourceAttributes a0)
schemaTypeToXML s (IndexAnnexSource bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "indexAnnexSourceScheme") $ indexAnnexSourceAttrib_indexAnnexSourceScheme at
]
$ schemaTypeToXML s bt
instance Extension IndexAnnexSource Scheme where
supertype (IndexAnnexSource s _) = s
data IndexId = IndexId Scheme IndexIdAttributes deriving (Eq,Show)
data IndexIdAttributes = IndexIdAttributes
{ indexIdAttrib_indexIdScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType IndexId where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "indexIdScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ IndexId v (IndexIdAttributes a0)
schemaTypeToXML s (IndexId bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "indexIdScheme") $ indexIdAttrib_indexIdScheme at
]
$ schemaTypeToXML s bt
instance Extension IndexId Scheme where
supertype (IndexId s _) = s
data IndexName = IndexName Scheme IndexNameAttributes deriving (Eq,Show)
data IndexNameAttributes = IndexNameAttributes
{ indexNameAttrib_indexNameScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType IndexName where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "indexNameScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ IndexName v (IndexNameAttributes a0)
schemaTypeToXML s (IndexName bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "indexNameScheme") $ indexNameAttrib_indexNameScheme at
]
$ schemaTypeToXML s bt
instance Extension IndexName Scheme where
supertype (IndexName s _) = s
data IndexReferenceInformation = IndexReferenceInformation
{ indexRefInfo_ID :: Maybe Xsd.ID
, indexRefInfo_choice0 :: OneOf2 (IndexName,[IndexId]) [IndexId]
, indexRefInfo_indexSeries :: Maybe Xsd.PositiveInteger
, indexRefInfo_indexAnnexVersion :: Maybe Xsd.PositiveInteger
, indexRefInfo_indexAnnexDate :: Maybe Xsd.Date
, indexRefInfo_indexAnnexSource :: Maybe IndexAnnexSource
, indexRefInfo_excludedReferenceEntity :: [LegalEntity]
, indexRefInfo_tranche :: Maybe Tranche
, indexRefInfo_settledEntityMatrix :: Maybe SettledEntityMatrix
}
deriving (Eq,Show)
instance SchemaType IndexReferenceInformation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (IndexReferenceInformation a0)
`apply` oneOf' [ ("IndexName [IndexId]", fmap OneOf2 (return (,) `apply` parseSchemaType "indexName"
`apply` many (parseSchemaType "indexId")))
, ("[IndexId]", fmap TwoOf2 (many1 (parseSchemaType "indexId")))
]
`apply` optional (parseSchemaType "indexSeries")
`apply` optional (parseSchemaType "indexAnnexVersion")
`apply` optional (parseSchemaType "indexAnnexDate")
`apply` optional (parseSchemaType "indexAnnexSource")
`apply` many (parseSchemaType "excludedReferenceEntity")
`apply` optional (parseSchemaType "tranche")
`apply` optional (parseSchemaType "settledEntityMatrix")
schemaTypeToXML s x@IndexReferenceInformation{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ indexRefInfo_ID x
]
[ foldOneOf2 (\ (a,b) -> concat [ schemaTypeToXML "indexName" a
, concatMap (schemaTypeToXML "indexId") b
])
(concatMap (schemaTypeToXML "indexId"))
$ indexRefInfo_choice0 x
, maybe [] (schemaTypeToXML "indexSeries") $ indexRefInfo_indexSeries x
, maybe [] (schemaTypeToXML "indexAnnexVersion") $ indexRefInfo_indexAnnexVersion x
, maybe [] (schemaTypeToXML "indexAnnexDate") $ indexRefInfo_indexAnnexDate x
, maybe [] (schemaTypeToXML "indexAnnexSource") $ indexRefInfo_indexAnnexSource x
, concatMap (schemaTypeToXML "excludedReferenceEntity") $ indexRefInfo_excludedReferenceEntity x
, maybe [] (schemaTypeToXML "tranche") $ indexRefInfo_tranche x
, maybe [] (schemaTypeToXML "settledEntityMatrix") $ indexRefInfo_settledEntityMatrix x
]
data InitialPayment = InitialPayment
{ initialPayment_ID :: Maybe Xsd.ID
, initialPayment_payerPartyReference :: Maybe PartyReference
, initialPayment_payerAccountReference :: Maybe AccountReference
, initialPayment_receiverPartyReference :: Maybe PartyReference
, initialPayment_receiverAccountReference :: Maybe AccountReference
, initialPayment_adjustablePaymentDate :: Maybe Xsd.Date
, initialPayment_adjustedPaymentDate :: Maybe Xsd.Date
, initialPayment_paymentAmount :: Money
}
deriving (Eq,Show)
instance SchemaType InitialPayment where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (InitialPayment a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` optional (parseSchemaType "adjustablePaymentDate")
`apply` optional (parseSchemaType "adjustedPaymentDate")
`apply` parseSchemaType "paymentAmount"
schemaTypeToXML s x@InitialPayment{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ initialPayment_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ initialPayment_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ initialPayment_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ initialPayment_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ initialPayment_receiverAccountReference x
, maybe [] (schemaTypeToXML "adjustablePaymentDate") $ initialPayment_adjustablePaymentDate x
, maybe [] (schemaTypeToXML "adjustedPaymentDate") $ initialPayment_adjustedPaymentDate x
, schemaTypeToXML "paymentAmount" $ initialPayment_paymentAmount x
]
instance Extension InitialPayment PaymentBase where
supertype v = PaymentBase_InitialPayment v
data InterestShortFall = InterestShortFall
{ interShortFall_interestShortfallCap :: Maybe InterestShortfallCapEnum
, interShortFall_compounding :: Maybe Xsd.Boolean
, interShortFall_rateSource :: Maybe FloatingRateIndex
}
deriving (Eq,Show)
instance SchemaType InterestShortFall where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return InterestShortFall
`apply` optional (parseSchemaType "interestShortfallCap")
`apply` optional (parseSchemaType "compounding")
`apply` optional (parseSchemaType "rateSource")
schemaTypeToXML s x@InterestShortFall{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "interestShortfallCap") $ interShortFall_interestShortfallCap x
, maybe [] (schemaTypeToXML "compounding") $ interShortFall_compounding x
, maybe [] (schemaTypeToXML "rateSource") $ interShortFall_rateSource x
]
data LoanParticipation = LoanParticipation
{ loanPartic_applicable :: Maybe Xsd.Boolean
, loanPartic_partialCashSettlement :: Maybe Xsd.Boolean
, loanPartic_qualifyingParticipationSeller :: Maybe Xsd.XsdString
}
deriving (Eq,Show)
instance SchemaType LoanParticipation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return LoanParticipation
`apply` optional (parseSchemaType "applicable")
`apply` optional (parseSchemaType "partialCashSettlement")
`apply` optional (parseSchemaType "qualifyingParticipationSeller")
schemaTypeToXML s x@LoanParticipation{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "applicable") $ loanPartic_applicable x
, maybe [] (schemaTypeToXML "partialCashSettlement") $ loanPartic_partialCashSettlement x
, maybe [] (schemaTypeToXML "qualifyingParticipationSeller") $ loanPartic_qualifyingParticipationSeller x
]
instance Extension LoanParticipation PCDeliverableObligationCharac where
supertype (LoanParticipation e0 e1 e2) =
PCDeliverableObligationCharac e0 e1
data MatrixSource = MatrixSource Scheme MatrixSourceAttributes deriving (Eq,Show)
data MatrixSourceAttributes = MatrixSourceAttributes
{ matrixSourceAttrib_settledEntityMatrixSourceScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType MatrixSource where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "settledEntityMatrixSourceScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ MatrixSource v (MatrixSourceAttributes a0)
schemaTypeToXML s (MatrixSource bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "settledEntityMatrixSourceScheme") $ matrixSourceAttrib_settledEntityMatrixSourceScheme at
]
$ schemaTypeToXML s bt
instance Extension MatrixSource Scheme where
supertype (MatrixSource s _) = s
data MultipleValuationDates = MultipleValuationDates
{ multiValDates_businessDays :: Maybe Xsd.NonNegativeInteger
, multiValDates_businessDaysThereafter :: Maybe Xsd.PositiveInteger
, multiValDates_numberValuationDates :: Maybe Xsd.PositiveInteger
}
deriving (Eq,Show)
instance SchemaType MultipleValuationDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return MultipleValuationDates
`apply` optional (parseSchemaType "businessDays")
`apply` optional (parseSchemaType "businessDaysThereafter")
`apply` optional (parseSchemaType "numberValuationDates")
schemaTypeToXML s x@MultipleValuationDates{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "businessDays") $ multiValDates_businessDays x
, maybe [] (schemaTypeToXML "businessDaysThereafter") $ multiValDates_businessDaysThereafter x
, maybe [] (schemaTypeToXML "numberValuationDates") $ multiValDates_numberValuationDates x
]
instance Extension MultipleValuationDates SingleValuationDate where
supertype (MultipleValuationDates e0 e1 e2) =
SingleValuationDate e0
data NotDomesticCurrency = NotDomesticCurrency
{ notDomestCurren_applicable :: Maybe Xsd.Boolean
, notDomestCurren_currency :: Maybe Currency
}
deriving (Eq,Show)
instance SchemaType NotDomesticCurrency where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return NotDomesticCurrency
`apply` optional (parseSchemaType "applicable")
`apply` optional (parseSchemaType "currency")
schemaTypeToXML s x@NotDomesticCurrency{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "applicable") $ notDomestCurren_applicable x
, maybe [] (schemaTypeToXML "currency") $ notDomestCurren_currency x
]
data Obligations = Obligations
{ obligations_category :: Maybe ObligationCategoryEnum
, obligations_notSubordinated :: Maybe Xsd.Boolean
, obligations_specifiedCurrency :: Maybe SpecifiedCurrency
, obligations_notSovereignLender :: Maybe Xsd.Boolean
, obligations_notDomesticCurrency :: Maybe NotDomesticCurrency
, obligations_notDomesticLaw :: Maybe Xsd.Boolean
, obligations_listed :: Maybe Xsd.Boolean
, obligations_notDomesticIssuance :: Maybe Xsd.Boolean
, obligations_choice8 :: (Maybe (OneOf3 Xsd.Boolean Xsd.Boolean Xsd.Boolean))
, obligations_notContingent :: Maybe Xsd.Boolean
, obligations_excluded :: Maybe Xsd.XsdString
, obligations_othReferenceEntityObligations :: Maybe Xsd.XsdString
, obligations_designatedPriority :: Maybe Lien
, obligations_cashSettlementOnly :: Maybe Xsd.Boolean
, obligations_deliveryOfCommitments :: Maybe Xsd.Boolean
, obligations_continuity :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType Obligations where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Obligations
`apply` optional (parseSchemaType "category")
`apply` optional (parseSchemaType "notSubordinated")
`apply` optional (parseSchemaType "specifiedCurrency")
`apply` optional (parseSchemaType "notSovereignLender")
`apply` optional (parseSchemaType "notDomesticCurrency")
`apply` optional (parseSchemaType "notDomesticLaw")
`apply` optional (parseSchemaType "listed")
`apply` optional (parseSchemaType "notDomesticIssuance")
`apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf3 (parseSchemaType "fullFaithAndCreditObLiability"))
, ("Xsd.Boolean", fmap TwoOf3 (parseSchemaType "generalFundObligationLiability"))
, ("Xsd.Boolean", fmap ThreeOf3 (parseSchemaType "revenueObligationLiability"))
])
`apply` optional (parseSchemaType "notContingent")
`apply` optional (parseSchemaType "excluded")
`apply` optional (parseSchemaType "othReferenceEntityObligations")
`apply` optional (parseSchemaType "designatedPriority")
`apply` optional (parseSchemaType "cashSettlementOnly")
`apply` optional (parseSchemaType "deliveryOfCommitments")
`apply` optional (parseSchemaType "continuity")
schemaTypeToXML s x@Obligations{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "category") $ obligations_category x
, maybe [] (schemaTypeToXML "notSubordinated") $ obligations_notSubordinated x
, maybe [] (schemaTypeToXML "specifiedCurrency") $ obligations_specifiedCurrency x
, maybe [] (schemaTypeToXML "notSovereignLender") $ obligations_notSovereignLender x
, maybe [] (schemaTypeToXML "notDomesticCurrency") $ obligations_notDomesticCurrency x
, maybe [] (schemaTypeToXML "notDomesticLaw") $ obligations_notDomesticLaw x
, maybe [] (schemaTypeToXML "listed") $ obligations_listed x
, maybe [] (schemaTypeToXML "notDomesticIssuance") $ obligations_notDomesticIssuance x
, maybe [] (foldOneOf3 (schemaTypeToXML "fullFaithAndCreditObLiability")
(schemaTypeToXML "generalFundObligationLiability")
(schemaTypeToXML "revenueObligationLiability")
) $ obligations_choice8 x
, maybe [] (schemaTypeToXML "notContingent") $ obligations_notContingent x
, maybe [] (schemaTypeToXML "excluded") $ obligations_excluded x
, maybe [] (schemaTypeToXML "othReferenceEntityObligations") $ obligations_othReferenceEntityObligations x
, maybe [] (schemaTypeToXML "designatedPriority") $ obligations_designatedPriority x
, maybe [] (schemaTypeToXML "cashSettlementOnly") $ obligations_cashSettlementOnly x
, maybe [] (schemaTypeToXML "deliveryOfCommitments") $ obligations_deliveryOfCommitments x
, maybe [] (schemaTypeToXML "continuity") $ obligations_continuity x
]
data PCDeliverableObligationCharac = PCDeliverableObligationCharac
{ pCDelivObligCharac_applicable :: Maybe Xsd.Boolean
, pCDelivObligCharac_partialCashSettlement :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType PCDeliverableObligationCharac where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return PCDeliverableObligationCharac
`apply` optional (parseSchemaType "applicable")
`apply` optional (parseSchemaType "partialCashSettlement")
schemaTypeToXML s x@PCDeliverableObligationCharac{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "applicable") $ pCDelivObligCharac_applicable x
, maybe [] (schemaTypeToXML "partialCashSettlement") $ pCDelivObligCharac_partialCashSettlement x
]
data PeriodicPayment = PeriodicPayment
{ periodPayment_ID :: Maybe Xsd.ID
, periodPayment_paymentFrequency :: Maybe Period
, periodPayment_firstPeriodStartDate :: Maybe Xsd.Date
, periodPayment_firstPaymentDate :: Maybe Xsd.Date
, periodPayment_lastRegularPaymentDate :: Maybe Xsd.Date
, periodPayment_rollConvention :: Maybe RollConventionEnum
, periodPayment_choice5 :: OneOf2 Money FixedAmountCalculation
, periodPayment_adjustedPaymentDates :: [AdjustedPaymentDates]
}
deriving (Eq,Show)
instance SchemaType PeriodicPayment where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (PeriodicPayment a0)
`apply` optional (parseSchemaType "paymentFrequency")
`apply` optional (parseSchemaType "firstPeriodStartDate")
`apply` optional (parseSchemaType "firstPaymentDate")
`apply` optional (parseSchemaType "lastRegularPaymentDate")
`apply` optional (parseSchemaType "rollConvention")
`apply` oneOf' [ ("Money", fmap OneOf2 (parseSchemaType "fixedAmount"))
, ("FixedAmountCalculation", fmap TwoOf2 (parseSchemaType "fixedAmountCalculation"))
]
`apply` many (parseSchemaType "adjustedPaymentDates")
schemaTypeToXML s x@PeriodicPayment{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ periodPayment_ID x
]
[ maybe [] (schemaTypeToXML "paymentFrequency") $ periodPayment_paymentFrequency x
, maybe [] (schemaTypeToXML "firstPeriodStartDate") $ periodPayment_firstPeriodStartDate x
, maybe [] (schemaTypeToXML "firstPaymentDate") $ periodPayment_firstPaymentDate x
, maybe [] (schemaTypeToXML "lastRegularPaymentDate") $ periodPayment_lastRegularPaymentDate x
, maybe [] (schemaTypeToXML "rollConvention") $ periodPayment_rollConvention x
, foldOneOf2 (schemaTypeToXML "fixedAmount")
(schemaTypeToXML "fixedAmountCalculation")
$ periodPayment_choice5 x
, concatMap (schemaTypeToXML "adjustedPaymentDates") $ periodPayment_adjustedPaymentDates x
]
instance Extension PeriodicPayment PaymentBase where
supertype v = PaymentBase_PeriodicPayment v
data PhysicalSettlementPeriod = PhysicalSettlementPeriod
{ physicSettlPeriod_choice0 :: (Maybe (OneOf3 Xsd.Boolean Xsd.NonNegativeInteger Xsd.NonNegativeInteger))
}
deriving (Eq,Show)
instance SchemaType PhysicalSettlementPeriod where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return PhysicalSettlementPeriod
`apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf3 (parseSchemaType "businessDaysNotSpecified"))
, ("Xsd.NonNegativeInteger", fmap TwoOf3 (parseSchemaType "businessDays"))
, ("Xsd.NonNegativeInteger", fmap ThreeOf3 (parseSchemaType "maximumBusinessDays"))
])
schemaTypeToXML s x@PhysicalSettlementPeriod{} =
toXMLElement s []
[ maybe [] (foldOneOf3 (schemaTypeToXML "businessDaysNotSpecified")
(schemaTypeToXML "businessDays")
(schemaTypeToXML "maximumBusinessDays")
) $ physicSettlPeriod_choice0 x
]
data PhysicalSettlementTerms = PhysicalSettlementTerms
{ physicSettlTerms_ID :: Maybe Xsd.ID
, physicSettlTerms_settlementCurrency :: Maybe Currency
, physicSettlTerms_physicalSettlementPeriod :: Maybe PhysicalSettlementPeriod
, physicSettlTerms_deliverableObligations :: Maybe DeliverableObligations
, physicSettlTerms_escrow :: Maybe Xsd.Boolean
, physicSettlTerms_sixtyBusinessDaySettlementCap :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType PhysicalSettlementTerms where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (PhysicalSettlementTerms a0)
`apply` optional (parseSchemaType "settlementCurrency")
`apply` optional (parseSchemaType "physicalSettlementPeriod")
`apply` optional (parseSchemaType "deliverableObligations")
`apply` optional (parseSchemaType "escrow")
`apply` optional (parseSchemaType "sixtyBusinessDaySettlementCap")
schemaTypeToXML s x@PhysicalSettlementTerms{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ physicSettlTerms_ID x
]
[ maybe [] (schemaTypeToXML "settlementCurrency") $ physicSettlTerms_settlementCurrency x
, maybe [] (schemaTypeToXML "physicalSettlementPeriod") $ physicSettlTerms_physicalSettlementPeriod x
, maybe [] (schemaTypeToXML "deliverableObligations") $ physicSettlTerms_deliverableObligations x
, maybe [] (schemaTypeToXML "escrow") $ physicSettlTerms_escrow x
, maybe [] (schemaTypeToXML "sixtyBusinessDaySettlementCap") $ physicSettlTerms_sixtyBusinessDaySettlementCap x
]
instance Extension PhysicalSettlementTerms SettlementTerms where
supertype (PhysicalSettlementTerms a0 e0 e1 e2 e3 e4) =
SettlementTerms a0 e0
data ProtectionTerms = ProtectionTerms
{ protecTerms_ID :: Maybe Xsd.ID
, protecTerms_calculationAmount :: Money
, protecTerms_creditEvents :: Maybe CreditEvents
, protecTerms_obligations :: Maybe Obligations
, protecTerms_floatingAmountEvents :: Maybe FloatingAmountEvents
}
deriving (Eq,Show)
instance SchemaType ProtectionTerms where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ProtectionTerms a0)
`apply` parseSchemaType "calculationAmount"
`apply` optional (parseSchemaType "creditEvents")
`apply` optional (parseSchemaType "obligations")
`apply` optional (parseSchemaType "floatingAmountEvents")
schemaTypeToXML s x@ProtectionTerms{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ protecTerms_ID x
]
[ schemaTypeToXML "calculationAmount" $ protecTerms_calculationAmount x
, maybe [] (schemaTypeToXML "creditEvents") $ protecTerms_creditEvents x
, maybe [] (schemaTypeToXML "obligations") $ protecTerms_obligations x
, maybe [] (schemaTypeToXML "floatingAmountEvents") $ protecTerms_floatingAmountEvents x
]
data ProtectionTermsReference = ProtectionTermsReference
{ protecTermsRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType ProtectionTermsReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (ProtectionTermsReference a0)
schemaTypeToXML s x@ProtectionTermsReference{} =
toXMLElement s [ toXMLAttribute "href" $ protecTermsRef_href x
]
[]
instance Extension ProtectionTermsReference Reference where
supertype v = Reference_ProtectionTermsReference v
data ReferenceInformation = ReferenceInformation
{ refInfo_referenceEntity :: LegalEntity
, refInfo_choice1 :: (Maybe (OneOf3 [ReferenceObligation] Xsd.Boolean Xsd.Boolean))
, refInfo_allGuarantees :: Maybe Xsd.Boolean
, refInfo_referencePrice :: Maybe Xsd.Decimal
, refInfo_referencePolicy :: Maybe Xsd.Boolean
, refInfo_securedList :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType ReferenceInformation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ReferenceInformation
`apply` parseSchemaType "referenceEntity"
`apply` optional (oneOf' [ ("[ReferenceObligation]", fmap OneOf3 (many1 (parseSchemaType "referenceObligation")))
, ("Xsd.Boolean", fmap TwoOf3 (parseSchemaType "noReferenceObligation"))
, ("Xsd.Boolean", fmap ThreeOf3 (parseSchemaType "unknownReferenceObligation"))
])
`apply` optional (parseSchemaType "allGuarantees")
`apply` optional (parseSchemaType "referencePrice")
`apply` optional (parseSchemaType "referencePolicy")
`apply` optional (parseSchemaType "securedList")
schemaTypeToXML s x@ReferenceInformation{} =
toXMLElement s []
[ schemaTypeToXML "referenceEntity" $ refInfo_referenceEntity x
, maybe [] (foldOneOf3 (concatMap (schemaTypeToXML "referenceObligation"))
(schemaTypeToXML "noReferenceObligation")
(schemaTypeToXML "unknownReferenceObligation")
) $ refInfo_choice1 x
, maybe [] (schemaTypeToXML "allGuarantees") $ refInfo_allGuarantees x
, maybe [] (schemaTypeToXML "referencePrice") $ refInfo_referencePrice x
, maybe [] (schemaTypeToXML "referencePolicy") $ refInfo_referencePolicy x
, maybe [] (schemaTypeToXML "securedList") $ refInfo_securedList x
]
data ReferenceObligation = ReferenceObligation
{ refOblig_choice0 :: (Maybe (OneOf4 Bond ConvertibleBond Mortgage Loan))
, refOblig_choice1 :: (Maybe (OneOf2 LegalEntity LegalEntityReference))
, refOblig_choice2 :: [OneOf2 LegalEntity LegalEntityReference]
}
deriving (Eq,Show)
instance SchemaType ReferenceObligation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ReferenceObligation
`apply` optional (oneOf' [ ("Bond", fmap OneOf4 (elementBond))
, ("ConvertibleBond", fmap TwoOf4 (elementConvertibleBond))
, ("Mortgage", fmap ThreeOf4 (elementMortgage))
, ("Loan", fmap FourOf4 (elementLoan))
])
`apply` optional (oneOf' [ ("LegalEntity", fmap OneOf2 (parseSchemaType "primaryObligor"))
, ("LegalEntityReference", fmap TwoOf2 (parseSchemaType "primaryObligorReference"))
])
`apply` many (oneOf' [ ("LegalEntity", fmap OneOf2 (parseSchemaType "guarantor"))
, ("LegalEntityReference", fmap TwoOf2 (parseSchemaType "guarantorReference"))
])
schemaTypeToXML s x@ReferenceObligation{} =
toXMLElement s []
[ maybe [] (foldOneOf4 (elementToXMLBond)
(elementToXMLConvertibleBond)
(elementToXMLMortgage)
(elementToXMLLoan)
) $ refOblig_choice0 x
, maybe [] (foldOneOf2 (schemaTypeToXML "primaryObligor")
(schemaTypeToXML "primaryObligorReference")
) $ refOblig_choice1 x
, concatMap (foldOneOf2 (schemaTypeToXML "guarantor")
(schemaTypeToXML "guarantorReference")
) $ refOblig_choice2 x
]
data ReferencePair = ReferencePair
{ refPair_referenceEntity :: Maybe LegalEntity
, refPair_choice1 :: (Maybe (OneOf2 ReferenceObligation Xsd.Boolean))
, refPair_entityType :: Maybe EntityType
}
deriving (Eq,Show)
instance SchemaType ReferencePair where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ReferencePair
`apply` optional (parseSchemaType "referenceEntity")
`apply` optional (oneOf' [ ("ReferenceObligation", fmap OneOf2 (parseSchemaType "referenceObligation"))
, ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "noReferenceObligation"))
])
`apply` optional (parseSchemaType "entityType")
schemaTypeToXML s x@ReferencePair{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "referenceEntity") $ refPair_referenceEntity x
, maybe [] (foldOneOf2 (schemaTypeToXML "referenceObligation")
(schemaTypeToXML "noReferenceObligation")
) $ refPair_choice1 x
, maybe [] (schemaTypeToXML "entityType") $ refPair_entityType x
]
data ReferencePool = ReferencePool
{ referencePool_item :: [ReferencePoolItem]
}
deriving (Eq,Show)
instance SchemaType ReferencePool where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ReferencePool
`apply` many (parseSchemaType "referencePoolItem")
schemaTypeToXML s x@ReferencePool{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "referencePoolItem") $ referencePool_item x
]
data ReferencePoolItem = ReferencePoolItem
{ refPoolItem_constituentWeight :: Maybe ConstituentWeight
, refPoolItem_referencePair :: Maybe ReferencePair
, refPoolItem_protectionTermsReference :: Maybe ProtectionTermsReference
, refPoolItem_settlementTermsReference :: Maybe SettlementTermsReference
}
deriving (Eq,Show)
instance SchemaType ReferencePoolItem where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ReferencePoolItem
`apply` optional (parseSchemaType "constituentWeight")
`apply` optional (parseSchemaType "referencePair")
`apply` optional (parseSchemaType "protectionTermsReference")
`apply` optional (parseSchemaType "settlementTermsReference")
schemaTypeToXML s x@ReferencePoolItem{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "constituentWeight") $ refPoolItem_constituentWeight x
, maybe [] (schemaTypeToXML "referencePair") $ refPoolItem_referencePair x
, maybe [] (schemaTypeToXML "protectionTermsReference") $ refPoolItem_protectionTermsReference x
, maybe [] (schemaTypeToXML "settlementTermsReference") $ refPoolItem_settlementTermsReference x
]
data SettledEntityMatrix = SettledEntityMatrix
{ settledEntityMatrix_matrixSource :: Maybe MatrixSource
, settledEntityMatrix_publicationDate :: Maybe Xsd.Date
}
deriving (Eq,Show)
instance SchemaType SettledEntityMatrix where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SettledEntityMatrix
`apply` optional (parseSchemaType "matrixSource")
`apply` optional (parseSchemaType "publicationDate")
schemaTypeToXML s x@SettledEntityMatrix{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "matrixSource") $ settledEntityMatrix_matrixSource x
, maybe [] (schemaTypeToXML "publicationDate") $ settledEntityMatrix_publicationDate x
]
data SettlementTerms = SettlementTerms
{ settlTerms_ID :: Maybe Xsd.ID
, settlTerms_settlementCurrency :: Maybe Currency
}
deriving (Eq,Show)
instance SchemaType SettlementTerms where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (SettlementTerms a0)
`apply` optional (parseSchemaType "settlementCurrency")
schemaTypeToXML s x@SettlementTerms{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ settlTerms_ID x
]
[ maybe [] (schemaTypeToXML "settlementCurrency") $ settlTerms_settlementCurrency x
]
data SettlementTermsReference = SettlementTermsReference
{ settlTermsRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType SettlementTermsReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (SettlementTermsReference a0)
schemaTypeToXML s x@SettlementTermsReference{} =
toXMLElement s [ toXMLAttribute "href" $ settlTermsRef_href x
]
[]
instance Extension SettlementTermsReference Reference where
supertype v = Reference_SettlementTermsReference v
data SinglePayment = SinglePayment
{ singlePayment_ID :: Maybe Xsd.ID
, singlePayment_adjustablePaymentDate :: Maybe Xsd.Date
, singlePayment_adjustedPaymentDate :: Maybe Xsd.Date
, singlePayment_fixedAmount :: Money
}
deriving (Eq,Show)
instance SchemaType SinglePayment where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (SinglePayment a0)
`apply` optional (parseSchemaType "adjustablePaymentDate")
`apply` optional (parseSchemaType "adjustedPaymentDate")
`apply` parseSchemaType "fixedAmount"
schemaTypeToXML s x@SinglePayment{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ singlePayment_ID x
]
[ maybe [] (schemaTypeToXML "adjustablePaymentDate") $ singlePayment_adjustablePaymentDate x
, maybe [] (schemaTypeToXML "adjustedPaymentDate") $ singlePayment_adjustedPaymentDate x
, schemaTypeToXML "fixedAmount" $ singlePayment_fixedAmount x
]
instance Extension SinglePayment PaymentBase where
supertype v = PaymentBase_SinglePayment v
data SingleValuationDate = SingleValuationDate
{ singleValDate_businessDays :: Maybe Xsd.NonNegativeInteger
}
deriving (Eq,Show)
instance SchemaType SingleValuationDate where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SingleValuationDate
`apply` optional (parseSchemaType "businessDays")
schemaTypeToXML s x@SingleValuationDate{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "businessDays") $ singleValDate_businessDays x
]
data SpecifiedCurrency = SpecifiedCurrency
{ specifCurren_applicable :: Maybe Xsd.Boolean
, specifCurren_currency :: [Currency]
}
deriving (Eq,Show)
instance SchemaType SpecifiedCurrency where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SpecifiedCurrency
`apply` optional (parseSchemaType "applicable")
`apply` many (parseSchemaType "currency")
schemaTypeToXML s x@SpecifiedCurrency{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "applicable") $ specifCurren_applicable x
, concatMap (schemaTypeToXML "currency") $ specifCurren_currency x
]
data Tranche = Tranche
{ tranche_attachmentPoint :: Maybe Xsd.Decimal
, tranche_exhaustionPoint :: Maybe Xsd.Decimal
, tranche_incurredRecoveryApplicable :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType Tranche where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Tranche
`apply` optional (parseSchemaType "attachmentPoint")
`apply` optional (parseSchemaType "exhaustionPoint")
`apply` optional (parseSchemaType "incurredRecoveryApplicable")
schemaTypeToXML s x@Tranche{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "attachmentPoint") $ tranche_attachmentPoint x
, maybe [] (schemaTypeToXML "exhaustionPoint") $ tranche_exhaustionPoint x
, maybe [] (schemaTypeToXML "incurredRecoveryApplicable") $ tranche_incurredRecoveryApplicable x
]
data ValuationDate = ValuationDate
{ valDate_choice0 :: (Maybe (OneOf2 SingleValuationDate MultipleValuationDates))
}
deriving (Eq,Show)
instance SchemaType ValuationDate where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ValuationDate
`apply` optional (oneOf' [ ("SingleValuationDate", fmap OneOf2 (parseSchemaType "singleValuationDate"))
, ("MultipleValuationDates", fmap TwoOf2 (parseSchemaType "multipleValuationDates"))
])
schemaTypeToXML s x@ValuationDate{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "singleValuationDate")
(schemaTypeToXML "multipleValuationDates")
) $ valDate_choice0 x
]
data LimitedCreditDefaultSwap = LimitedCreditDefaultSwap
{ limitedCreditDefaultSwap_generalTerms :: GeneralTerms
, limitedCreditDefaultSwap_feeLeg :: FeeLeg
, limitedCreditDefaultSwap_protectionTerms :: [ProtectionTerms]
}
deriving (Eq,Show)
instance SchemaType LimitedCreditDefaultSwap where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return LimitedCreditDefaultSwap
`apply` parseSchemaType "generalTerms"
`apply` parseSchemaType "feeLeg"
`apply` many1 (parseSchemaType "protectionTerms")
schemaTypeToXML s x@LimitedCreditDefaultSwap{} =
toXMLElement s []
[ schemaTypeToXML "generalTerms" $ limitedCreditDefaultSwap_generalTerms x
, schemaTypeToXML "feeLeg" $ limitedCreditDefaultSwap_feeLeg x
, concatMap (schemaTypeToXML "protectionTerms") $ limitedCreditDefaultSwap_protectionTerms x
]
elementCreditDefaultSwap :: XMLParser CreditDefaultSwap
elementCreditDefaultSwap = parseSchemaType "creditDefaultSwap"
elementToXMLCreditDefaultSwap :: CreditDefaultSwap -> [Content ()]
elementToXMLCreditDefaultSwap = schemaTypeToXML "creditDefaultSwap"
elementCreditDefaultSwapOption :: XMLParser CreditDefaultSwapOption
elementCreditDefaultSwapOption = parseSchemaType "creditDefaultSwapOption"
elementToXMLCreditDefaultSwapOption :: CreditDefaultSwapOption -> [Content ()]
elementToXMLCreditDefaultSwapOption = schemaTypeToXML "creditDefaultSwapOption"