module Data.FpML.V53.Asset
( module Data.FpML.V53.Asset
, module Data.FpML.V53.Shared
) 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
data ActualPrice = ActualPrice
{ actualPrice_currency :: Maybe Currency
, actualPrice_amount :: Maybe Xsd.Decimal
, actualPrice_priceExpression :: Maybe PriceExpressionEnum
}
deriving (Eq,Show)
instance SchemaType ActualPrice where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ActualPrice
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "amount")
`apply` optional (parseSchemaType "priceExpression")
schemaTypeToXML s x@ActualPrice{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "currency") $ actualPrice_currency x
, maybe [] (schemaTypeToXML "amount") $ actualPrice_amount x
, maybe [] (schemaTypeToXML "priceExpression") $ actualPrice_priceExpression x
]
data AnyAssetReference = AnyAssetReference
{ anyAssetRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType AnyAssetReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (AnyAssetReference a0)
schemaTypeToXML s x@AnyAssetReference{} =
toXMLElement s [ toXMLAttribute "href" $ anyAssetRef_href x
]
[]
instance Extension AnyAssetReference Reference where
supertype v = Reference_AnyAssetReference v
data Asset
= Asset_IdentifiedAsset IdentifiedAsset
| Asset_Cash Cash
| Asset_Basket Basket
deriving (Eq,Show)
instance SchemaType Asset where
parseSchemaType s = do
(fmap Asset_IdentifiedAsset $ parseSchemaType s)
`onFail`
(fmap Asset_Cash $ parseSchemaType s)
`onFail`
(fmap Asset_Basket $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of Asset,\n\
\ namely one of:\n\
\IdentifiedAsset,Cash,Basket"
schemaTypeToXML _s (Asset_IdentifiedAsset x) = schemaTypeToXML "identifiedAsset" x
schemaTypeToXML _s (Asset_Cash x) = schemaTypeToXML "cash" x
schemaTypeToXML _s (Asset_Basket x) = schemaTypeToXML "basket" x
data AssetMeasureType = AssetMeasureType Scheme AssetMeasureTypeAttributes deriving (Eq,Show)
data AssetMeasureTypeAttributes = AssetMeasureTypeAttributes
{ assetMeasureTypeAttrib_assetMeasureScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType AssetMeasureType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "assetMeasureScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ AssetMeasureType v (AssetMeasureTypeAttributes a0)
schemaTypeToXML s (AssetMeasureType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "assetMeasureScheme") $ assetMeasureTypeAttrib_assetMeasureScheme at
]
$ schemaTypeToXML s bt
instance Extension AssetMeasureType Scheme where
supertype (AssetMeasureType s _) = s
data PricingModel = PricingModel Scheme PricingModelAttributes deriving (Eq,Show)
data PricingModelAttributes = PricingModelAttributes
{ pricingModelAttrib_pricingModelScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType PricingModel where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "pricingModelScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ PricingModel v (PricingModelAttributes a0)
schemaTypeToXML s (PricingModel bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "pricingModelScheme") $ pricingModelAttrib_pricingModelScheme at
]
$ schemaTypeToXML s bt
instance Extension PricingModel Scheme where
supertype (PricingModel s _) = s
data AssetPool = AssetPool
{ assetPool_version :: Maybe Xsd.NonNegativeInteger
, assetPool_effectiveDate :: Maybe IdentifiedDate
, assetPool_initialFactor :: Maybe Xsd.Decimal
, assetPool_currentFactor :: Maybe Xsd.Decimal
}
deriving (Eq,Show)
instance SchemaType AssetPool where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return AssetPool
`apply` optional (parseSchemaType "version")
`apply` optional (parseSchemaType "effectiveDate")
`apply` optional (parseSchemaType "initialFactor")
`apply` optional (parseSchemaType "currentFactor")
schemaTypeToXML s x@AssetPool{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "version") $ assetPool_version x
, maybe [] (schemaTypeToXML "effectiveDate") $ assetPool_effectiveDate x
, maybe [] (schemaTypeToXML "initialFactor") $ assetPool_initialFactor x
, maybe [] (schemaTypeToXML "currentFactor") $ assetPool_currentFactor x
]
data AssetReference = AssetReference
{ assetRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType AssetReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (AssetReference a0)
schemaTypeToXML s x@AssetReference{} =
toXMLElement s [ toXMLAttribute "href" $ assetRef_href x
]
[]
instance Extension AssetReference Reference where
supertype v = Reference_AssetReference v
data BasicQuotation = BasicQuotation
{ basicQuot_ID :: Maybe Xsd.ID
, basicQuot_value :: Maybe Xsd.Decimal
, basicQuot_measureType :: Maybe AssetMeasureType
, basicQuot_quoteUnits :: Maybe PriceQuoteUnits
, basicQuot_side :: Maybe QuotationSideEnum
, basicQuot_currency :: Maybe Currency
, basicQuot_currencyType :: Maybe ReportingCurrencyType
, basicQuot_timing :: Maybe QuoteTiming
, basicQuot_choice7 :: (Maybe (OneOf2 BusinessCenter ExchangeId))
, basicQuot_informationSource :: [InformationSource]
, basicQuot_pricingModel :: Maybe PricingModel
, basicQuot_time :: Maybe Xsd.DateTime
, basicQuot_valuationDate :: Maybe Xsd.Date
, basicQuot_expiryTime :: Maybe Xsd.DateTime
, basicQuot_cashflowType :: Maybe CashflowType
}
deriving (Eq,Show)
instance SchemaType BasicQuotation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (BasicQuotation a0)
`apply` optional (parseSchemaType "value")
`apply` optional (parseSchemaType "measureType")
`apply` optional (parseSchemaType "quoteUnits")
`apply` optional (parseSchemaType "side")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "currencyType")
`apply` optional (parseSchemaType "timing")
`apply` optional (oneOf' [ ("BusinessCenter", fmap OneOf2 (parseSchemaType "businessCenter"))
, ("ExchangeId", fmap TwoOf2 (parseSchemaType "exchangeId"))
])
`apply` many (parseSchemaType "informationSource")
`apply` optional (parseSchemaType "pricingModel")
`apply` optional (parseSchemaType "time")
`apply` optional (parseSchemaType "valuationDate")
`apply` optional (parseSchemaType "expiryTime")
`apply` optional (parseSchemaType "cashflowType")
schemaTypeToXML s x@BasicQuotation{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ basicQuot_ID x
]
[ maybe [] (schemaTypeToXML "value") $ basicQuot_value x
, maybe [] (schemaTypeToXML "measureType") $ basicQuot_measureType x
, maybe [] (schemaTypeToXML "quoteUnits") $ basicQuot_quoteUnits x
, maybe [] (schemaTypeToXML "side") $ basicQuot_side x
, maybe [] (schemaTypeToXML "currency") $ basicQuot_currency x
, maybe [] (schemaTypeToXML "currencyType") $ basicQuot_currencyType x
, maybe [] (schemaTypeToXML "timing") $ basicQuot_timing x
, maybe [] (foldOneOf2 (schemaTypeToXML "businessCenter")
(schemaTypeToXML "exchangeId")
) $ basicQuot_choice7 x
, concatMap (schemaTypeToXML "informationSource") $ basicQuot_informationSource x
, maybe [] (schemaTypeToXML "pricingModel") $ basicQuot_pricingModel x
, maybe [] (schemaTypeToXML "time") $ basicQuot_time x
, maybe [] (schemaTypeToXML "valuationDate") $ basicQuot_valuationDate x
, maybe [] (schemaTypeToXML "expiryTime") $ basicQuot_expiryTime x
, maybe [] (schemaTypeToXML "cashflowType") $ basicQuot_cashflowType x
]
data Basket = Basket
{ basket_ID :: Maybe Xsd.ID
, basket_openUnits :: Maybe Xsd.Decimal
, basket_constituent :: [BasketConstituent]
, basket_divisor :: Maybe Xsd.Decimal
, basket_choice3 :: (Maybe (OneOf1 ((Maybe (BasketName)),[BasketId])))
, basket_currency :: Maybe Currency
}
deriving (Eq,Show)
instance SchemaType Basket where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Basket a0)
`apply` optional (parseSchemaType "openUnits")
`apply` many (parseSchemaType "basketConstituent")
`apply` optional (parseSchemaType "basketDivisor")
`apply` optional (oneOf' [ ("Maybe BasketName [BasketId]", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "basketName")
`apply` many (parseSchemaType "basketId")))
])
`apply` optional (parseSchemaType "basketCurrency")
schemaTypeToXML s x@Basket{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ basket_ID x
]
[ maybe [] (schemaTypeToXML "openUnits") $ basket_openUnits x
, concatMap (schemaTypeToXML "basketConstituent") $ basket_constituent x
, maybe [] (schemaTypeToXML "basketDivisor") $ basket_divisor x
, maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "basketName") a
, concatMap (schemaTypeToXML "basketId") b
])
) $ basket_choice3 x
, maybe [] (schemaTypeToXML "basketCurrency") $ basket_currency x
]
instance Extension Basket Asset where
supertype v = Asset_Basket v
data BasketConstituent = BasketConstituent
{ basketConstit_ID :: Maybe Xsd.ID
, basketConstit_underlyingAsset :: Maybe Asset
, basketConstit_constituentWeight :: Maybe ConstituentWeight
, basketConstit_dividendPayout :: Maybe DividendPayout
, basketConstit_underlyerPrice :: Maybe Price
, basketConstit_underlyerNotional :: Maybe Money
, basketConstit_underlyerSpread :: Maybe SpreadScheduleReference
, basketConstit_couponPayment :: Maybe PendingPayment
}
deriving (Eq,Show)
instance SchemaType BasketConstituent where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (BasketConstituent a0)
`apply` optional (elementUnderlyingAsset)
`apply` optional (parseSchemaType "constituentWeight")
`apply` optional (parseSchemaType "dividendPayout")
`apply` optional (parseSchemaType "underlyerPrice")
`apply` optional (parseSchemaType "underlyerNotional")
`apply` optional (parseSchemaType "underlyerSpread")
`apply` optional (parseSchemaType "couponPayment")
schemaTypeToXML s x@BasketConstituent{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ basketConstit_ID x
]
[ maybe [] (elementToXMLUnderlyingAsset) $ basketConstit_underlyingAsset x
, maybe [] (schemaTypeToXML "constituentWeight") $ basketConstit_constituentWeight x
, maybe [] (schemaTypeToXML "dividendPayout") $ basketConstit_dividendPayout x
, maybe [] (schemaTypeToXML "underlyerPrice") $ basketConstit_underlyerPrice x
, maybe [] (schemaTypeToXML "underlyerNotional") $ basketConstit_underlyerNotional x
, maybe [] (schemaTypeToXML "underlyerSpread") $ basketConstit_underlyerSpread x
, maybe [] (schemaTypeToXML "couponPayment") $ basketConstit_couponPayment x
]
data BasketId = BasketId Scheme BasketIdAttributes deriving (Eq,Show)
data BasketIdAttributes = BasketIdAttributes
{ basketIdAttrib_basketIdScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType BasketId where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "basketIdScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ BasketId v (BasketIdAttributes a0)
schemaTypeToXML s (BasketId bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "basketIdScheme") $ basketIdAttrib_basketIdScheme at
]
$ schemaTypeToXML s bt
instance Extension BasketId Scheme where
supertype (BasketId s _) = s
data BasketName = BasketName Scheme BasketNameAttributes deriving (Eq,Show)
data BasketNameAttributes = BasketNameAttributes
{ basketNameAttrib_basketNameScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType BasketName where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "basketNameScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ BasketName v (BasketNameAttributes a0)
schemaTypeToXML s (BasketName bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "basketNameScheme") $ basketNameAttrib_basketNameScheme at
]
$ schemaTypeToXML s bt
instance Extension BasketName Scheme where
supertype (BasketName s _) = s
data Bond = Bond
{ bond_ID :: Maybe Xsd.ID
, bond_instrumentId :: [InstrumentId]
, bond_description :: Maybe Xsd.XsdString
, bond_currency :: Maybe IdentifiedCurrency
, bond_exchangeId :: Maybe ExchangeId
, bond_clearanceSystem :: Maybe ClearanceSystem
, bond_definition :: Maybe ProductReference
, bond_choice6 :: (Maybe (OneOf2 Xsd.XsdString PartyReference))
, bond_seniority :: Maybe CreditSeniority
, bond_couponType :: Maybe CouponType
, bond_couponRate :: Maybe Xsd.Decimal
, bond_maturity :: Maybe Xsd.Date
, bond_parValue :: Maybe Xsd.Decimal
, bond_faceAmount :: Maybe Xsd.Decimal
, bond_paymentFrequency :: Maybe Period
, bond_dayCountFraction :: Maybe DayCountFraction
}
deriving (Eq,Show)
instance SchemaType Bond where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Bond a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` optional (oneOf' [ ("Xsd.XsdString", fmap OneOf2 (parseSchemaType "issuerName"))
, ("PartyReference", fmap TwoOf2 (parseSchemaType "issuerPartyReference"))
])
`apply` optional (parseSchemaType "seniority")
`apply` optional (parseSchemaType "couponType")
`apply` optional (parseSchemaType "couponRate")
`apply` optional (parseSchemaType "maturity")
`apply` optional (parseSchemaType "parValue")
`apply` optional (parseSchemaType "faceAmount")
`apply` optional (parseSchemaType "paymentFrequency")
`apply` optional (parseSchemaType "dayCountFraction")
schemaTypeToXML s x@Bond{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ bond_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ bond_instrumentId x
, maybe [] (schemaTypeToXML "description") $ bond_description x
, maybe [] (schemaTypeToXML "currency") $ bond_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ bond_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ bond_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ bond_definition x
, maybe [] (foldOneOf2 (schemaTypeToXML "issuerName")
(schemaTypeToXML "issuerPartyReference")
) $ bond_choice6 x
, maybe [] (schemaTypeToXML "seniority") $ bond_seniority x
, maybe [] (schemaTypeToXML "couponType") $ bond_couponType x
, maybe [] (schemaTypeToXML "couponRate") $ bond_couponRate x
, maybe [] (schemaTypeToXML "maturity") $ bond_maturity x
, maybe [] (schemaTypeToXML "parValue") $ bond_parValue x
, maybe [] (schemaTypeToXML "faceAmount") $ bond_faceAmount x
, maybe [] (schemaTypeToXML "paymentFrequency") $ bond_paymentFrequency x
, maybe [] (schemaTypeToXML "dayCountFraction") $ bond_dayCountFraction x
]
instance Extension Bond UnderlyingAsset where
supertype v = UnderlyingAsset_Bond v
instance Extension Bond IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: Bond -> UnderlyingAsset)
instance Extension Bond Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: Bond -> UnderlyingAsset)
data Cash = Cash
{ cash_ID :: Maybe Xsd.ID
, cash_instrumentId :: [InstrumentId]
, cash_description :: Maybe Xsd.XsdString
, cash_currency :: Maybe Currency
}
deriving (Eq,Show)
instance SchemaType Cash where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Cash a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
schemaTypeToXML s x@Cash{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ cash_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ cash_instrumentId x
, maybe [] (schemaTypeToXML "description") $ cash_description x
, maybe [] (schemaTypeToXML "currency") $ cash_currency x
]
instance Extension Cash Asset where
supertype v = Asset_Cash v
data Commission = Commission
{ commission_denomination :: Maybe CommissionDenominationEnum
, commission_amount :: Maybe Xsd.Decimal
, commission_currency :: Maybe Currency
, commission_perTrade :: Maybe Xsd.Decimal
, commission_fxRate :: [FxRate]
}
deriving (Eq,Show)
instance SchemaType Commission where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Commission
`apply` optional (parseSchemaType "commissionDenomination")
`apply` optional (parseSchemaType "commissionAmount")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "commissionPerTrade")
`apply` many (parseSchemaType "fxRate")
schemaTypeToXML s x@Commission{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "commissionDenomination") $ commission_denomination x
, maybe [] (schemaTypeToXML "commissionAmount") $ commission_amount x
, maybe [] (schemaTypeToXML "currency") $ commission_currency x
, maybe [] (schemaTypeToXML "commissionPerTrade") $ commission_perTrade x
, concatMap (schemaTypeToXML "fxRate") $ commission_fxRate x
]
data Commodity = Commodity
{ commodity_ID :: Maybe Xsd.ID
, commodity_instrumentId :: [InstrumentId]
, commodity_description :: Maybe Xsd.XsdString
, commodity_base :: Maybe CommodityBase
, commodity_details :: Maybe CommodityDetails
, commodity_unit :: Maybe QuantityUnit
, commodity_currency :: Maybe Currency
, commodity_choice6 :: (Maybe (OneOf2 ExchangeId InformationSource))
, commodity_specifiedPrice :: Maybe SpecifiedPriceEnum
, commodity_choice8 :: (Maybe (OneOf3 DeliveryDatesEnum AdjustableDate Xsd.GYearMonth))
, commodity_deliveryDateRollConvention :: Maybe Offset
, commodity_multiplier :: Maybe PositiveDecimal
}
deriving (Eq,Show)
instance SchemaType Commodity where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Commodity a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "commodityBase")
`apply` optional (parseSchemaType "commodityDetails")
`apply` optional (parseSchemaType "unit")
`apply` optional (parseSchemaType "currency")
`apply` optional (oneOf' [ ("ExchangeId", fmap OneOf2 (parseSchemaType "exchangeId"))
, ("InformationSource", fmap TwoOf2 (parseSchemaType "publication"))
])
`apply` optional (parseSchemaType "specifiedPrice")
`apply` optional (oneOf' [ ("DeliveryDatesEnum", fmap OneOf3 (parseSchemaType "deliveryDates"))
, ("AdjustableDate", fmap TwoOf3 (parseSchemaType "deliveryDate"))
, ("Xsd.GYearMonth", fmap ThreeOf3 (parseSchemaType "deliveryDateYearMonth"))
])
`apply` optional (parseSchemaType "deliveryDateRollConvention")
`apply` optional (parseSchemaType "multiplier")
schemaTypeToXML s x@Commodity{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ commodity_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ commodity_instrumentId x
, maybe [] (schemaTypeToXML "description") $ commodity_description x
, maybe [] (schemaTypeToXML "commodityBase") $ commodity_base x
, maybe [] (schemaTypeToXML "commodityDetails") $ commodity_details x
, maybe [] (schemaTypeToXML "unit") $ commodity_unit x
, maybe [] (schemaTypeToXML "currency") $ commodity_currency x
, maybe [] (foldOneOf2 (schemaTypeToXML "exchangeId")
(schemaTypeToXML "publication")
) $ commodity_choice6 x
, maybe [] (schemaTypeToXML "specifiedPrice") $ commodity_specifiedPrice x
, maybe [] (foldOneOf3 (schemaTypeToXML "deliveryDates")
(schemaTypeToXML "deliveryDate")
(schemaTypeToXML "deliveryDateYearMonth")
) $ commodity_choice8 x
, maybe [] (schemaTypeToXML "deliveryDateRollConvention") $ commodity_deliveryDateRollConvention x
, maybe [] (schemaTypeToXML "multiplier") $ commodity_multiplier x
]
instance Extension Commodity IdentifiedAsset where
supertype v = IdentifiedAsset_Commodity v
instance Extension Commodity Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: Commodity -> IdentifiedAsset)
data CommodityBase = CommodityBase Scheme CommodityBaseAttributes deriving (Eq,Show)
data CommodityBaseAttributes = CommodityBaseAttributes
{ commodBaseAttrib_commodityBaseScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityBase where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityBaseScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityBase v (CommodityBaseAttributes a0)
schemaTypeToXML s (CommodityBase bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityBaseScheme") $ commodBaseAttrib_commodityBaseScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityBase Scheme where
supertype (CommodityBase s _) = s
data CommodityBusinessCalendar = CommodityBusinessCalendar Scheme CommodityBusinessCalendarAttributes deriving (Eq,Show)
data CommodityBusinessCalendarAttributes = CommodityBusinessCalendarAttributes
{ cbca_commodityBusinessCalendarScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityBusinessCalendar where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityBusinessCalendarScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityBusinessCalendar v (CommodityBusinessCalendarAttributes a0)
schemaTypeToXML s (CommodityBusinessCalendar bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityBusinessCalendarScheme") $ cbca_commodityBusinessCalendarScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityBusinessCalendar Scheme where
supertype (CommodityBusinessCalendar s _) = s
data CommodityBusinessCalendarTime = CommodityBusinessCalendarTime
{ commodBusCalTime_hourMinuteTime :: Maybe HourMinuteTime
, commodBusCalTime_timeZone :: Maybe TimeZone
, commodBusCalTime_businessCalendar :: Maybe CommodityBusinessCalendar
}
deriving (Eq,Show)
instance SchemaType CommodityBusinessCalendarTime where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CommodityBusinessCalendarTime
`apply` optional (parseSchemaType "hourMinuteTime")
`apply` optional (parseSchemaType "timeZone")
`apply` optional (parseSchemaType "businessCalendar")
schemaTypeToXML s x@CommodityBusinessCalendarTime{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "hourMinuteTime") $ commodBusCalTime_hourMinuteTime x
, maybe [] (schemaTypeToXML "timeZone") $ commodBusCalTime_timeZone x
, maybe [] (schemaTypeToXML "businessCalendar") $ commodBusCalTime_businessCalendar x
]
data CommodityDetails = CommodityDetails Scheme CommodityDetailsAttributes deriving (Eq,Show)
data CommodityDetailsAttributes = CommodityDetailsAttributes
{ commodDetailsAttrib_commodityDetailsScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CommodityDetails where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "commodityDetailsScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CommodityDetails v (CommodityDetailsAttributes a0)
schemaTypeToXML s (CommodityDetails bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "commodityDetailsScheme") $ commodDetailsAttrib_commodityDetailsScheme at
]
$ schemaTypeToXML s bt
instance Extension CommodityDetails Scheme where
supertype (CommodityDetails s _) = s
data ConstituentWeight = ConstituentWeight
{ constitWeight_choice0 :: (Maybe (OneOf3 Xsd.Decimal RestrictedPercentage Money))
}
deriving (Eq,Show)
instance SchemaType ConstituentWeight where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ConstituentWeight
`apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf3 (parseSchemaType "openUnits"))
, ("RestrictedPercentage", fmap TwoOf3 (parseSchemaType "basketPercentage"))
, ("Money", fmap ThreeOf3 (parseSchemaType "basketAmount"))
])
schemaTypeToXML s x@ConstituentWeight{} =
toXMLElement s []
[ maybe [] (foldOneOf3 (schemaTypeToXML "openUnits")
(schemaTypeToXML "basketPercentage")
(schemaTypeToXML "basketAmount")
) $ constitWeight_choice0 x
]
data ConvertibleBond = ConvertibleBond
{ convertBond_ID :: Maybe Xsd.ID
, convertBond_instrumentId :: [InstrumentId]
, convertBond_description :: Maybe Xsd.XsdString
, convertBond_currency :: Maybe IdentifiedCurrency
, convertBond_exchangeId :: Maybe ExchangeId
, convertBond_clearanceSystem :: Maybe ClearanceSystem
, convertBond_definition :: Maybe ProductReference
, convertBond_choice6 :: (Maybe (OneOf2 Xsd.XsdString PartyReference))
, convertBond_seniority :: Maybe CreditSeniority
, convertBond_couponType :: Maybe CouponType
, convertBond_couponRate :: Maybe Xsd.Decimal
, convertBond_maturity :: Maybe Xsd.Date
, convertBond_parValue :: Maybe Xsd.Decimal
, convertBond_faceAmount :: Maybe Xsd.Decimal
, convertBond_paymentFrequency :: Maybe Period
, convertBond_dayCountFraction :: Maybe DayCountFraction
, convertBond_underlyingEquity :: Maybe EquityAsset
, convertBond_redemptionDate :: Maybe Xsd.Date
}
deriving (Eq,Show)
instance SchemaType ConvertibleBond where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ConvertibleBond a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` optional (oneOf' [ ("Xsd.XsdString", fmap OneOf2 (parseSchemaType "issuerName"))
, ("PartyReference", fmap TwoOf2 (parseSchemaType "issuerPartyReference"))
])
`apply` optional (parseSchemaType "seniority")
`apply` optional (parseSchemaType "couponType")
`apply` optional (parseSchemaType "couponRate")
`apply` optional (parseSchemaType "maturity")
`apply` optional (parseSchemaType "parValue")
`apply` optional (parseSchemaType "faceAmount")
`apply` optional (parseSchemaType "paymentFrequency")
`apply` optional (parseSchemaType "dayCountFraction")
`apply` optional (parseSchemaType "underlyingEquity")
`apply` optional (parseSchemaType "redemptionDate")
schemaTypeToXML s x@ConvertibleBond{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ convertBond_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ convertBond_instrumentId x
, maybe [] (schemaTypeToXML "description") $ convertBond_description x
, maybe [] (schemaTypeToXML "currency") $ convertBond_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ convertBond_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ convertBond_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ convertBond_definition x
, maybe [] (foldOneOf2 (schemaTypeToXML "issuerName")
(schemaTypeToXML "issuerPartyReference")
) $ convertBond_choice6 x
, maybe [] (schemaTypeToXML "seniority") $ convertBond_seniority x
, maybe [] (schemaTypeToXML "couponType") $ convertBond_couponType x
, maybe [] (schemaTypeToXML "couponRate") $ convertBond_couponRate x
, maybe [] (schemaTypeToXML "maturity") $ convertBond_maturity x
, maybe [] (schemaTypeToXML "parValue") $ convertBond_parValue x
, maybe [] (schemaTypeToXML "faceAmount") $ convertBond_faceAmount x
, maybe [] (schemaTypeToXML "paymentFrequency") $ convertBond_paymentFrequency x
, maybe [] (schemaTypeToXML "dayCountFraction") $ convertBond_dayCountFraction x
, maybe [] (schemaTypeToXML "underlyingEquity") $ convertBond_underlyingEquity x
, maybe [] (schemaTypeToXML "redemptionDate") $ convertBond_redemptionDate x
]
instance Extension ConvertibleBond Bond where
supertype (ConvertibleBond a0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14 e15 e16) =
Bond a0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14
instance Extension ConvertibleBond UnderlyingAsset where
supertype = (supertype :: Bond -> UnderlyingAsset)
. (supertype :: ConvertibleBond -> Bond)
instance Extension ConvertibleBond IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: Bond -> UnderlyingAsset)
. (supertype :: ConvertibleBond -> Bond)
instance Extension ConvertibleBond Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: Bond -> UnderlyingAsset)
. (supertype :: ConvertibleBond -> Bond)
data CouponType = CouponType Scheme CouponTypeAttributes deriving (Eq,Show)
data CouponTypeAttributes = CouponTypeAttributes
{ couponTypeAttrib_couponTypeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CouponType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "couponTypeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CouponType v (CouponTypeAttributes a0)
schemaTypeToXML s (CouponType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "couponTypeScheme") $ couponTypeAttrib_couponTypeScheme at
]
$ schemaTypeToXML s bt
instance Extension CouponType Scheme where
supertype (CouponType s _) = s
data CurveInstrument = CurveInstrument deriving (Eq,Show)
instance SchemaType CurveInstrument where
parseSchemaType s = fail "Parse failed when expecting an extension type of CurveInstrument:\n No extension types are known."
schemaTypeToXML s _ = toXMLElement s [] []
instance Extension CurveInstrument IdentifiedAsset where
supertype v = IdentifiedAsset_CurveInstrument v
data Deposit = Deposit
{ deposit_ID :: Maybe Xsd.ID
, deposit_instrumentId :: [InstrumentId]
, deposit_description :: Maybe Xsd.XsdString
, deposit_currency :: Maybe IdentifiedCurrency
, deposit_exchangeId :: Maybe ExchangeId
, deposit_clearanceSystem :: Maybe ClearanceSystem
, deposit_definition :: Maybe ProductReference
, deposit_term :: Maybe Period
, deposit_paymentFrequency :: Maybe Period
, deposit_dayCountFraction :: Maybe DayCountFraction
}
deriving (Eq,Show)
instance SchemaType Deposit where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Deposit a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` optional (parseSchemaType "term")
`apply` optional (parseSchemaType "paymentFrequency")
`apply` optional (parseSchemaType "dayCountFraction")
schemaTypeToXML s x@Deposit{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ deposit_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ deposit_instrumentId x
, maybe [] (schemaTypeToXML "description") $ deposit_description x
, maybe [] (schemaTypeToXML "currency") $ deposit_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ deposit_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ deposit_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ deposit_definition x
, maybe [] (schemaTypeToXML "term") $ deposit_term x
, maybe [] (schemaTypeToXML "paymentFrequency") $ deposit_paymentFrequency x
, maybe [] (schemaTypeToXML "dayCountFraction") $ deposit_dayCountFraction x
]
instance Extension Deposit UnderlyingAsset where
supertype v = UnderlyingAsset_Deposit v
instance Extension Deposit IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: Deposit -> UnderlyingAsset)
instance Extension Deposit Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: Deposit -> UnderlyingAsset)
data DividendPayout = DividendPayout
{ dividPayout_choice0 :: (Maybe (OneOf2 Xsd.Decimal Xsd.XsdString))
, dividPayout_dividendPayment :: [PendingPayment]
}
deriving (Eq,Show)
instance SchemaType DividendPayout where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return DividendPayout
`apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "dividendPayoutRatio"))
, ("Xsd.XsdString", fmap TwoOf2 (parseSchemaType "dividendPayoutConditions"))
])
`apply` many (parseSchemaType "dividendPayment")
schemaTypeToXML s x@DividendPayout{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "dividendPayoutRatio")
(schemaTypeToXML "dividendPayoutConditions")
) $ dividPayout_choice0 x
, concatMap (schemaTypeToXML "dividendPayment") $ dividPayout_dividendPayment x
]
data EquityAsset = EquityAsset
{ equityAsset_ID :: Maybe Xsd.ID
, equityAsset_instrumentId :: [InstrumentId]
, equityAsset_description :: Maybe Xsd.XsdString
, equityAsset_currency :: Maybe IdentifiedCurrency
, equityAsset_exchangeId :: Maybe ExchangeId
, equityAsset_clearanceSystem :: Maybe ClearanceSystem
, equityAsset_definition :: Maybe ProductReference
, equityAsset_relatedExchangeId :: [ExchangeId]
, equityAsset_optionsExchangeId :: [ExchangeId]
, equityAsset_specifiedExchangeId :: [ExchangeId]
}
deriving (Eq,Show)
instance SchemaType EquityAsset where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (EquityAsset a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` many (parseSchemaType "relatedExchangeId")
`apply` many (parseSchemaType "optionsExchangeId")
`apply` many (parseSchemaType "specifiedExchangeId")
schemaTypeToXML s x@EquityAsset{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ equityAsset_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ equityAsset_instrumentId x
, maybe [] (schemaTypeToXML "description") $ equityAsset_description x
, maybe [] (schemaTypeToXML "currency") $ equityAsset_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ equityAsset_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ equityAsset_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ equityAsset_definition x
, concatMap (schemaTypeToXML "relatedExchangeId") $ equityAsset_relatedExchangeId x
, concatMap (schemaTypeToXML "optionsExchangeId") $ equityAsset_optionsExchangeId x
, concatMap (schemaTypeToXML "specifiedExchangeId") $ equityAsset_specifiedExchangeId x
]
instance Extension EquityAsset ExchangeTraded where
supertype v = ExchangeTraded_EquityAsset v
instance Extension EquityAsset UnderlyingAsset where
supertype = (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: EquityAsset -> ExchangeTraded)
instance Extension EquityAsset IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: EquityAsset -> ExchangeTraded)
instance Extension EquityAsset Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: EquityAsset -> ExchangeTraded)
data ExchangeTraded
= ExchangeTraded_Future Future
| ExchangeTraded_ExchangeTradedContract ExchangeTradedContract
| ExchangeTraded_ExchangeTradedCalculatedPrice ExchangeTradedCalculatedPrice
| ExchangeTraded_EquityAsset EquityAsset
deriving (Eq,Show)
instance SchemaType ExchangeTraded where
parseSchemaType s = do
(fmap ExchangeTraded_Future $ parseSchemaType s)
`onFail`
(fmap ExchangeTraded_ExchangeTradedContract $ parseSchemaType s)
`onFail`
(fmap ExchangeTraded_ExchangeTradedCalculatedPrice $ parseSchemaType s)
`onFail`
(fmap ExchangeTraded_EquityAsset $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of ExchangeTraded,\n\
\ namely one of:\n\
\Future,ExchangeTradedContract,ExchangeTradedCalculatedPrice,EquityAsset"
schemaTypeToXML _s (ExchangeTraded_Future x) = schemaTypeToXML "future" x
schemaTypeToXML _s (ExchangeTraded_ExchangeTradedContract x) = schemaTypeToXML "exchangeTradedContract" x
schemaTypeToXML _s (ExchangeTraded_ExchangeTradedCalculatedPrice x) = schemaTypeToXML "exchangeTradedCalculatedPrice" x
schemaTypeToXML _s (ExchangeTraded_EquityAsset x) = schemaTypeToXML "equityAsset" x
instance Extension ExchangeTraded UnderlyingAsset where
supertype v = UnderlyingAsset_ExchangeTraded v
data ExchangeTradedCalculatedPrice
= ExchangeTradedCalculatedPrice_Index Index
| ExchangeTradedCalculatedPrice_ExchangeTradedFund ExchangeTradedFund
deriving (Eq,Show)
instance SchemaType ExchangeTradedCalculatedPrice where
parseSchemaType s = do
(fmap ExchangeTradedCalculatedPrice_Index $ parseSchemaType s)
`onFail`
(fmap ExchangeTradedCalculatedPrice_ExchangeTradedFund $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of ExchangeTradedCalculatedPrice,\n\
\ namely one of:\n\
\Index,ExchangeTradedFund"
schemaTypeToXML _s (ExchangeTradedCalculatedPrice_Index x) = schemaTypeToXML "index" x
schemaTypeToXML _s (ExchangeTradedCalculatedPrice_ExchangeTradedFund x) = schemaTypeToXML "exchangeTradedFund" x
instance Extension ExchangeTradedCalculatedPrice ExchangeTraded where
supertype v = ExchangeTraded_ExchangeTradedCalculatedPrice v
data ExchangeTradedContract = ExchangeTradedContract
{ exchTradedContr_ID :: Maybe Xsd.ID
, exchTradedContr_instrumentId :: [InstrumentId]
, exchTradedContr_description :: Maybe Xsd.XsdString
, exchTradedContr_currency :: Maybe IdentifiedCurrency
, exchTradedContr_exchangeId :: Maybe ExchangeId
, exchTradedContr_clearanceSystem :: Maybe ClearanceSystem
, exchTradedContr_definition :: Maybe ProductReference
, exchTradedContr_relatedExchangeId :: [ExchangeId]
, exchTradedContr_optionsExchangeId :: [ExchangeId]
, exchTradedContr_specifiedExchangeId :: [ExchangeId]
, exchTradedContr_multiplier :: Maybe Xsd.PositiveInteger
, exchTradedContr_contractReference :: Maybe Xsd.XsdString
, exchTradedContr_expirationDate :: Maybe AdjustableOrRelativeDate
}
deriving (Eq,Show)
instance SchemaType ExchangeTradedContract where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ExchangeTradedContract a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` many (parseSchemaType "relatedExchangeId")
`apply` many (parseSchemaType "optionsExchangeId")
`apply` many (parseSchemaType "specifiedExchangeId")
`apply` optional (parseSchemaType "multiplier")
`apply` optional (parseSchemaType "contractReference")
`apply` optional (parseSchemaType "expirationDate")
schemaTypeToXML s x@ExchangeTradedContract{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ exchTradedContr_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ exchTradedContr_instrumentId x
, maybe [] (schemaTypeToXML "description") $ exchTradedContr_description x
, maybe [] (schemaTypeToXML "currency") $ exchTradedContr_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ exchTradedContr_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ exchTradedContr_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ exchTradedContr_definition x
, concatMap (schemaTypeToXML "relatedExchangeId") $ exchTradedContr_relatedExchangeId x
, concatMap (schemaTypeToXML "optionsExchangeId") $ exchTradedContr_optionsExchangeId x
, concatMap (schemaTypeToXML "specifiedExchangeId") $ exchTradedContr_specifiedExchangeId x
, maybe [] (schemaTypeToXML "multiplier") $ exchTradedContr_multiplier x
, maybe [] (schemaTypeToXML "contractReference") $ exchTradedContr_contractReference x
, maybe [] (schemaTypeToXML "expirationDate") $ exchTradedContr_expirationDate x
]
instance Extension ExchangeTradedContract ExchangeTraded where
supertype v = ExchangeTraded_ExchangeTradedContract v
instance Extension ExchangeTradedContract UnderlyingAsset where
supertype = (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: ExchangeTradedContract -> ExchangeTraded)
instance Extension ExchangeTradedContract IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: ExchangeTradedContract -> ExchangeTraded)
instance Extension ExchangeTradedContract Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: ExchangeTradedContract -> ExchangeTraded)
data ExchangeTradedFund = ExchangeTradedFund
{ exchTradedFund_ID :: Maybe Xsd.ID
, exchTradedFund_instrumentId :: [InstrumentId]
, exchTradedFund_description :: Maybe Xsd.XsdString
, exchTradedFund_currency :: Maybe IdentifiedCurrency
, exchTradedFund_exchangeId :: Maybe ExchangeId
, exchTradedFund_clearanceSystem :: Maybe ClearanceSystem
, exchTradedFund_definition :: Maybe ProductReference
, exchTradedFund_relatedExchangeId :: [ExchangeId]
, exchTradedFund_optionsExchangeId :: [ExchangeId]
, exchTradedFund_specifiedExchangeId :: [ExchangeId]
, exchTradedFund_constituentExchangeId :: [ExchangeId]
, exchTradedFund_fundManager :: Maybe Xsd.XsdString
}
deriving (Eq,Show)
instance SchemaType ExchangeTradedFund where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ExchangeTradedFund a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` many (parseSchemaType "relatedExchangeId")
`apply` many (parseSchemaType "optionsExchangeId")
`apply` many (parseSchemaType "specifiedExchangeId")
`apply` many (parseSchemaType "constituentExchangeId")
`apply` optional (parseSchemaType "fundManager")
schemaTypeToXML s x@ExchangeTradedFund{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ exchTradedFund_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ exchTradedFund_instrumentId x
, maybe [] (schemaTypeToXML "description") $ exchTradedFund_description x
, maybe [] (schemaTypeToXML "currency") $ exchTradedFund_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ exchTradedFund_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ exchTradedFund_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ exchTradedFund_definition x
, concatMap (schemaTypeToXML "relatedExchangeId") $ exchTradedFund_relatedExchangeId x
, concatMap (schemaTypeToXML "optionsExchangeId") $ exchTradedFund_optionsExchangeId x
, concatMap (schemaTypeToXML "specifiedExchangeId") $ exchTradedFund_specifiedExchangeId x
, concatMap (schemaTypeToXML "constituentExchangeId") $ exchTradedFund_constituentExchangeId x
, maybe [] (schemaTypeToXML "fundManager") $ exchTradedFund_fundManager x
]
instance Extension ExchangeTradedFund ExchangeTradedCalculatedPrice where
supertype v = ExchangeTradedCalculatedPrice_ExchangeTradedFund v
instance Extension ExchangeTradedFund ExchangeTraded where
supertype = (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)
. (supertype :: ExchangeTradedFund -> ExchangeTradedCalculatedPrice)
instance Extension ExchangeTradedFund UnderlyingAsset where
supertype = (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)
. (supertype :: ExchangeTradedFund -> ExchangeTradedCalculatedPrice)
instance Extension ExchangeTradedFund IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)
. (supertype :: ExchangeTradedFund -> ExchangeTradedCalculatedPrice)
instance Extension ExchangeTradedFund Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)
. (supertype :: ExchangeTradedFund -> ExchangeTradedCalculatedPrice)
data FacilityType = FacilityType Scheme FacilityTypeAttributes deriving (Eq,Show)
data FacilityTypeAttributes = FacilityTypeAttributes
{ facilTypeAttrib_facilityTypeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType FacilityType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "facilityTypeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ FacilityType v (FacilityTypeAttributes a0)
schemaTypeToXML s (FacilityType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "facilityTypeScheme") $ facilTypeAttrib_facilityTypeScheme at
]
$ schemaTypeToXML s bt
instance Extension FacilityType Scheme where
supertype (FacilityType s _) = s
data Future = Future
{ future_ID :: Maybe Xsd.ID
, future_instrumentId :: [InstrumentId]
, future_description :: Maybe Xsd.XsdString
, future_currency :: Maybe IdentifiedCurrency
, future_exchangeId :: Maybe ExchangeId
, future_clearanceSystem :: Maybe ClearanceSystem
, future_definition :: Maybe ProductReference
, future_relatedExchangeId :: [ExchangeId]
, future_optionsExchangeId :: [ExchangeId]
, future_specifiedExchangeId :: [ExchangeId]
, future_multiplier :: Maybe Xsd.PositiveInteger
, future_contractReference :: Maybe Xsd.XsdString
, future_maturity :: Maybe Xsd.Date
}
deriving (Eq,Show)
instance SchemaType Future where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Future a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` many (parseSchemaType "relatedExchangeId")
`apply` many (parseSchemaType "optionsExchangeId")
`apply` many (parseSchemaType "specifiedExchangeId")
`apply` optional (parseSchemaType "multiplier")
`apply` optional (parseSchemaType "futureContractReference")
`apply` optional (parseSchemaType "maturity")
schemaTypeToXML s x@Future{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ future_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ future_instrumentId x
, maybe [] (schemaTypeToXML "description") $ future_description x
, maybe [] (schemaTypeToXML "currency") $ future_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ future_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ future_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ future_definition x
, concatMap (schemaTypeToXML "relatedExchangeId") $ future_relatedExchangeId x
, concatMap (schemaTypeToXML "optionsExchangeId") $ future_optionsExchangeId x
, concatMap (schemaTypeToXML "specifiedExchangeId") $ future_specifiedExchangeId x
, maybe [] (schemaTypeToXML "multiplier") $ future_multiplier x
, maybe [] (schemaTypeToXML "futureContractReference") $ future_contractReference x
, maybe [] (schemaTypeToXML "maturity") $ future_maturity x
]
instance Extension Future ExchangeTraded where
supertype v = ExchangeTraded_Future v
instance Extension Future UnderlyingAsset where
supertype = (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: Future -> ExchangeTraded)
instance Extension Future IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: Future -> ExchangeTraded)
instance Extension Future Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: Future -> ExchangeTraded)
data FutureId = FutureId Scheme FutureIdAttributes deriving (Eq,Show)
data FutureIdAttributes = FutureIdAttributes
{ futureIdAttrib_futureIdScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType FutureId where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "futureIdScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ FutureId v (FutureIdAttributes a0)
schemaTypeToXML s (FutureId bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "futureIdScheme") $ futureIdAttrib_futureIdScheme at
]
$ schemaTypeToXML s bt
instance Extension FutureId Scheme where
supertype (FutureId s _) = s
data FxConversion = FxConversion
{ fxConversion_choice0 :: (Maybe (OneOf2 AmountReference [FxRate]))
}
deriving (Eq,Show)
instance SchemaType FxConversion where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxConversion
`apply` optional (oneOf' [ ("AmountReference", fmap OneOf2 (parseSchemaType "amountRelativeTo"))
, ("[FxRate]", fmap TwoOf2 (many1 (parseSchemaType "fxRate")))
])
schemaTypeToXML s x@FxConversion{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "amountRelativeTo")
(concatMap (schemaTypeToXML "fxRate"))
) $ fxConversion_choice0 x
]
data FxRateAsset = FxRateAsset
{ fxRateAsset_ID :: Maybe Xsd.ID
, fxRateAsset_instrumentId :: [InstrumentId]
, fxRateAsset_description :: Maybe Xsd.XsdString
, fxRateAsset_currency :: Maybe IdentifiedCurrency
, fxRateAsset_exchangeId :: Maybe ExchangeId
, fxRateAsset_clearanceSystem :: Maybe ClearanceSystem
, fxRateAsset_definition :: Maybe ProductReference
, fxRateAsset_quotedCurrencyPair :: Maybe QuotedCurrencyPair
, fxRateAsset_rateSource :: Maybe FxSpotRateSource
}
deriving (Eq,Show)
instance SchemaType FxRateAsset where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FxRateAsset a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` optional (parseSchemaType "quotedCurrencyPair")
`apply` optional (parseSchemaType "rateSource")
schemaTypeToXML s x@FxRateAsset{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxRateAsset_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ fxRateAsset_instrumentId x
, maybe [] (schemaTypeToXML "description") $ fxRateAsset_description x
, maybe [] (schemaTypeToXML "currency") $ fxRateAsset_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ fxRateAsset_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ fxRateAsset_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ fxRateAsset_definition x
, maybe [] (schemaTypeToXML "quotedCurrencyPair") $ fxRateAsset_quotedCurrencyPair x
, maybe [] (schemaTypeToXML "rateSource") $ fxRateAsset_rateSource x
]
instance Extension FxRateAsset UnderlyingAsset where
supertype v = UnderlyingAsset_FxRateAsset v
instance Extension FxRateAsset IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: FxRateAsset -> UnderlyingAsset)
instance Extension FxRateAsset Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: FxRateAsset -> UnderlyingAsset)
data IdentifiedAsset
= IdentifiedAsset_UnderlyingAsset UnderlyingAsset
| IdentifiedAsset_CurveInstrument CurveInstrument
| IdentifiedAsset_Commodity Commodity
deriving (Eq,Show)
instance SchemaType IdentifiedAsset where
parseSchemaType s = do
(fmap IdentifiedAsset_UnderlyingAsset $ parseSchemaType s)
`onFail`
(fmap IdentifiedAsset_CurveInstrument $ parseSchemaType s)
`onFail`
(fmap IdentifiedAsset_Commodity $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of IdentifiedAsset,\n\
\ namely one of:\n\
\UnderlyingAsset,CurveInstrument,Commodity"
schemaTypeToXML _s (IdentifiedAsset_UnderlyingAsset x) = schemaTypeToXML "underlyingAsset" x
schemaTypeToXML _s (IdentifiedAsset_CurveInstrument x) = schemaTypeToXML "curveInstrument" x
schemaTypeToXML _s (IdentifiedAsset_Commodity x) = schemaTypeToXML "commodity" x
instance Extension IdentifiedAsset Asset where
supertype v = Asset_IdentifiedAsset v
data Index = Index
{ index_ID :: Maybe Xsd.ID
, index_instrumentId :: [InstrumentId]
, index_description :: Maybe Xsd.XsdString
, index_currency :: Maybe IdentifiedCurrency
, index_exchangeId :: Maybe ExchangeId
, index_clearanceSystem :: Maybe ClearanceSystem
, index_definition :: Maybe ProductReference
, index_relatedExchangeId :: [ExchangeId]
, index_optionsExchangeId :: [ExchangeId]
, index_specifiedExchangeId :: [ExchangeId]
, index_constituentExchangeId :: [ExchangeId]
, index_futureId :: Maybe FutureId
}
deriving (Eq,Show)
instance SchemaType Index where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Index a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` many (parseSchemaType "relatedExchangeId")
`apply` many (parseSchemaType "optionsExchangeId")
`apply` many (parseSchemaType "specifiedExchangeId")
`apply` many (parseSchemaType "constituentExchangeId")
`apply` optional (parseSchemaType "futureId")
schemaTypeToXML s x@Index{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ index_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ index_instrumentId x
, maybe [] (schemaTypeToXML "description") $ index_description x
, maybe [] (schemaTypeToXML "currency") $ index_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ index_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ index_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ index_definition x
, concatMap (schemaTypeToXML "relatedExchangeId") $ index_relatedExchangeId x
, concatMap (schemaTypeToXML "optionsExchangeId") $ index_optionsExchangeId x
, concatMap (schemaTypeToXML "specifiedExchangeId") $ index_specifiedExchangeId x
, concatMap (schemaTypeToXML "constituentExchangeId") $ index_constituentExchangeId x
, maybe [] (schemaTypeToXML "futureId") $ index_futureId x
]
instance Extension Index ExchangeTradedCalculatedPrice where
supertype v = ExchangeTradedCalculatedPrice_Index v
instance Extension Index ExchangeTraded where
supertype = (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)
. (supertype :: Index -> ExchangeTradedCalculatedPrice)
instance Extension Index UnderlyingAsset where
supertype = (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)
. (supertype :: Index -> ExchangeTradedCalculatedPrice)
instance Extension Index IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)
. (supertype :: Index -> ExchangeTradedCalculatedPrice)
instance Extension Index Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: ExchangeTraded -> UnderlyingAsset)
. (supertype :: ExchangeTradedCalculatedPrice -> ExchangeTraded)
. (supertype :: Index -> ExchangeTradedCalculatedPrice)
data Lien = Lien Scheme LienAttributes deriving (Eq,Show)
data LienAttributes = LienAttributes
{ lienAttrib_lienScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType Lien where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "lienScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ Lien v (LienAttributes a0)
schemaTypeToXML s (Lien bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "lienScheme") $ lienAttrib_lienScheme at
]
$ schemaTypeToXML s bt
instance Extension Lien Scheme where
supertype (Lien s _) = s
data Loan = Loan
{ loan_ID :: Maybe Xsd.ID
, loan_instrumentId :: [InstrumentId]
, loan_description :: Maybe Xsd.XsdString
, loan_currency :: Maybe IdentifiedCurrency
, loan_exchangeId :: Maybe ExchangeId
, loan_clearanceSystem :: Maybe ClearanceSystem
, loan_definition :: Maybe ProductReference
, loan_choice6 :: [OneOf2 LegalEntity LegalEntityReference]
, loan_lien :: Maybe Lien
, loan_facilityType :: Maybe FacilityType
, loan_maturity :: Maybe Xsd.Date
, loan_creditAgreementDate :: Maybe Xsd.Date
, loan_tranche :: Maybe UnderlyingAssetTranche
}
deriving (Eq,Show)
instance SchemaType Loan where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Loan a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` many (oneOf' [ ("LegalEntity", fmap OneOf2 (parseSchemaType "borrower"))
, ("LegalEntityReference", fmap TwoOf2 (parseSchemaType "borrowerReference"))
])
`apply` optional (parseSchemaType "lien")
`apply` optional (parseSchemaType "facilityType")
`apply` optional (parseSchemaType "maturity")
`apply` optional (parseSchemaType "creditAgreementDate")
`apply` optional (parseSchemaType "tranche")
schemaTypeToXML s x@Loan{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ loan_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ loan_instrumentId x
, maybe [] (schemaTypeToXML "description") $ loan_description x
, maybe [] (schemaTypeToXML "currency") $ loan_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ loan_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ loan_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ loan_definition x
, concatMap (foldOneOf2 (schemaTypeToXML "borrower")
(schemaTypeToXML "borrowerReference")
) $ loan_choice6 x
, maybe [] (schemaTypeToXML "lien") $ loan_lien x
, maybe [] (schemaTypeToXML "facilityType") $ loan_facilityType x
, maybe [] (schemaTypeToXML "maturity") $ loan_maturity x
, maybe [] (schemaTypeToXML "creditAgreementDate") $ loan_creditAgreementDate x
, maybe [] (schemaTypeToXML "tranche") $ loan_tranche x
]
instance Extension Loan UnderlyingAsset where
supertype v = UnderlyingAsset_Loan v
instance Extension Loan IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: Loan -> UnderlyingAsset)
instance Extension Loan Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: Loan -> UnderlyingAsset)
data Mortgage = Mortgage
{ mortgage_ID :: Maybe Xsd.ID
, mortgage_instrumentId :: [InstrumentId]
, mortgage_description :: Maybe Xsd.XsdString
, mortgage_currency :: Maybe IdentifiedCurrency
, mortgage_exchangeId :: Maybe ExchangeId
, mortgage_clearanceSystem :: Maybe ClearanceSystem
, mortgage_definition :: Maybe ProductReference
, mortgage_choice6 :: (Maybe (OneOf2 LegalEntity LegalEntityReference))
, mortgage_choice7 :: (Maybe (OneOf2 Xsd.XsdString PartyReference))
, mortgage_seniority :: Maybe CreditSeniority
, mortgage_couponType :: Maybe CouponType
, mortgage_couponRate :: Maybe Xsd.Decimal
, mortgage_maturity :: Maybe Xsd.Date
, mortgage_paymentFrequency :: Maybe Period
, mortgage_dayCountFraction :: Maybe DayCountFraction
, mortgage_originalPrincipalAmount :: Maybe Xsd.Decimal
, mortgage_pool :: Maybe AssetPool
, mortgage_sector :: Maybe MortgageSector
, mortgage_tranche :: Maybe Xsd.Token
}
deriving (Eq,Show)
instance SchemaType Mortgage where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Mortgage a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` optional (oneOf' [ ("LegalEntity", fmap OneOf2 (parseSchemaType "insurer"))
, ("LegalEntityReference", fmap TwoOf2 (parseSchemaType "insurerReference"))
])
`apply` optional (oneOf' [ ("Xsd.XsdString", fmap OneOf2 (parseSchemaType "issuerName"))
, ("PartyReference", fmap TwoOf2 (parseSchemaType "issuerPartyReference"))
])
`apply` optional (parseSchemaType "seniority")
`apply` optional (parseSchemaType "couponType")
`apply` optional (parseSchemaType "couponRate")
`apply` optional (parseSchemaType "maturity")
`apply` optional (parseSchemaType "paymentFrequency")
`apply` optional (parseSchemaType "dayCountFraction")
`apply` optional (parseSchemaType "originalPrincipalAmount")
`apply` optional (parseSchemaType "pool")
`apply` optional (parseSchemaType "sector")
`apply` optional (parseSchemaType "tranche")
schemaTypeToXML s x@Mortgage{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ mortgage_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ mortgage_instrumentId x
, maybe [] (schemaTypeToXML "description") $ mortgage_description x
, maybe [] (schemaTypeToXML "currency") $ mortgage_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ mortgage_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ mortgage_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ mortgage_definition x
, maybe [] (foldOneOf2 (schemaTypeToXML "insurer")
(schemaTypeToXML "insurerReference")
) $ mortgage_choice6 x
, maybe [] (foldOneOf2 (schemaTypeToXML "issuerName")
(schemaTypeToXML "issuerPartyReference")
) $ mortgage_choice7 x
, maybe [] (schemaTypeToXML "seniority") $ mortgage_seniority x
, maybe [] (schemaTypeToXML "couponType") $ mortgage_couponType x
, maybe [] (schemaTypeToXML "couponRate") $ mortgage_couponRate x
, maybe [] (schemaTypeToXML "maturity") $ mortgage_maturity x
, maybe [] (schemaTypeToXML "paymentFrequency") $ mortgage_paymentFrequency x
, maybe [] (schemaTypeToXML "dayCountFraction") $ mortgage_dayCountFraction x
, maybe [] (schemaTypeToXML "originalPrincipalAmount") $ mortgage_originalPrincipalAmount x
, maybe [] (schemaTypeToXML "pool") $ mortgage_pool x
, maybe [] (schemaTypeToXML "sector") $ mortgage_sector x
, maybe [] (schemaTypeToXML "tranche") $ mortgage_tranche x
]
instance Extension Mortgage UnderlyingAsset where
supertype v = UnderlyingAsset_Mortgage v
instance Extension Mortgage IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: Mortgage -> UnderlyingAsset)
instance Extension Mortgage Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: Mortgage -> UnderlyingAsset)
data MortgageSector = MortgageSector Scheme MortgageSectorAttributes deriving (Eq,Show)
data MortgageSectorAttributes = MortgageSectorAttributes
{ mortgSectorAttrib_mortgageSectorScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType MortgageSector where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "mortgageSectorScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ MortgageSector v (MortgageSectorAttributes a0)
schemaTypeToXML s (MortgageSector bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "mortgageSectorScheme") $ mortgSectorAttrib_mortgageSectorScheme at
]
$ schemaTypeToXML s bt
instance Extension MortgageSector Scheme where
supertype (MortgageSector s _) = s
data MutualFund = MutualFund
{ mutualFund_ID :: Maybe Xsd.ID
, mutualFund_instrumentId :: [InstrumentId]
, mutualFund_description :: Maybe Xsd.XsdString
, mutualFund_currency :: Maybe IdentifiedCurrency
, mutualFund_exchangeId :: Maybe ExchangeId
, mutualFund_clearanceSystem :: Maybe ClearanceSystem
, mutualFund_definition :: Maybe ProductReference
, mutualFund_openEndedFund :: Maybe Xsd.Boolean
, mutualFund_fundManager :: Maybe Xsd.XsdString
}
deriving (Eq,Show)
instance SchemaType MutualFund where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (MutualFund a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` optional (parseSchemaType "openEndedFund")
`apply` optional (parseSchemaType "fundManager")
schemaTypeToXML s x@MutualFund{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ mutualFund_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ mutualFund_instrumentId x
, maybe [] (schemaTypeToXML "description") $ mutualFund_description x
, maybe [] (schemaTypeToXML "currency") $ mutualFund_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ mutualFund_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ mutualFund_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ mutualFund_definition x
, maybe [] (schemaTypeToXML "openEndedFund") $ mutualFund_openEndedFund x
, maybe [] (schemaTypeToXML "fundManager") $ mutualFund_fundManager x
]
instance Extension MutualFund UnderlyingAsset where
supertype v = UnderlyingAsset_MutualFund v
instance Extension MutualFund IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: MutualFund -> UnderlyingAsset)
instance Extension MutualFund Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: MutualFund -> UnderlyingAsset)
data PendingPayment = PendingPayment
{ pendingPayment_ID :: Maybe Xsd.ID
, pendingPayment_paymentDate :: Maybe Xsd.Date
, pendingPayment_amount :: Maybe Money
, pendingPayment_accruedInterest :: Maybe Money
}
deriving (Eq,Show)
instance SchemaType PendingPayment where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (PendingPayment a0)
`apply` optional (parseSchemaType "paymentDate")
`apply` optional (parseSchemaType "amount")
`apply` optional (parseSchemaType "accruedInterest")
schemaTypeToXML s x@PendingPayment{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ pendingPayment_ID x
]
[ maybe [] (schemaTypeToXML "paymentDate") $ pendingPayment_paymentDate x
, maybe [] (schemaTypeToXML "amount") $ pendingPayment_amount x
, maybe [] (schemaTypeToXML "accruedInterest") $ pendingPayment_accruedInterest x
]
instance Extension PendingPayment PaymentBase where
supertype v = PaymentBase_PendingPayment v
data Price = Price
{ price_commission :: Maybe Commission
, price_choice1 :: OneOf3 (DeterminationMethod,(Maybe (ActualPrice)),(Maybe (ActualPrice)),(Maybe (Xsd.Decimal)),(Maybe (FxConversion))) AmountReference ((Maybe (ActualPrice)),(Maybe (ActualPrice)),(Maybe (Xsd.Decimal)),(Maybe (FxConversion)))
, price_cleanNetPrice :: Maybe Xsd.Decimal
, price_quotationCharacteristics :: Maybe QuotationCharacteristics
}
deriving (Eq,Show)
instance SchemaType Price where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Price
`apply` optional (parseSchemaType "commission")
`apply` oneOf' [ ("DeterminationMethod Maybe ActualPrice Maybe ActualPrice Maybe Xsd.Decimal Maybe FxConversion", fmap OneOf3 (return (,,,,) `apply` parseSchemaType "determinationMethod"
`apply` optional (parseSchemaType "grossPrice")
`apply` optional (parseSchemaType "netPrice")
`apply` optional (parseSchemaType "accruedInterestPrice")
`apply` optional (parseSchemaType "fxConversion")))
, ("AmountReference", fmap TwoOf3 (parseSchemaType "amountRelativeTo"))
, ("Maybe ActualPrice Maybe ActualPrice Maybe Xsd.Decimal Maybe FxConversion", fmap ThreeOf3 (return (,,,) `apply` optional (parseSchemaType "grossPrice")
`apply` optional (parseSchemaType "netPrice")
`apply` optional (parseSchemaType "accruedInterestPrice")
`apply` optional (parseSchemaType "fxConversion")))
]
`apply` optional (parseSchemaType "cleanNetPrice")
`apply` optional (parseSchemaType "quotationCharacteristics")
schemaTypeToXML s x@Price{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "commission") $ price_commission x
, foldOneOf3 (\ (a,b,c,d,e) -> concat [ schemaTypeToXML "determinationMethod" a
, maybe [] (schemaTypeToXML "grossPrice") b
, maybe [] (schemaTypeToXML "netPrice") c
, maybe [] (schemaTypeToXML "accruedInterestPrice") d
, maybe [] (schemaTypeToXML "fxConversion") e
])
(schemaTypeToXML "amountRelativeTo")
(\ (a,b,c,d) -> concat [ maybe [] (schemaTypeToXML "grossPrice") a
, maybe [] (schemaTypeToXML "netPrice") b
, maybe [] (schemaTypeToXML "accruedInterestPrice") c
, maybe [] (schemaTypeToXML "fxConversion") d
])
$ price_choice1 x
, maybe [] (schemaTypeToXML "cleanNetPrice") $ price_cleanNetPrice x
, maybe [] (schemaTypeToXML "quotationCharacteristics") $ price_quotationCharacteristics x
]
data PriceQuoteUnits = PriceQuoteUnits Scheme PriceQuoteUnitsAttributes deriving (Eq,Show)
data PriceQuoteUnitsAttributes = PriceQuoteUnitsAttributes
{ priceQuoteUnitsAttrib_priceQuoteUnitsScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType PriceQuoteUnits where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "priceQuoteUnitsScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ PriceQuoteUnits v (PriceQuoteUnitsAttributes a0)
schemaTypeToXML s (PriceQuoteUnits bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "priceQuoteUnitsScheme") $ priceQuoteUnitsAttrib_priceQuoteUnitsScheme at
]
$ schemaTypeToXML s bt
instance Extension PriceQuoteUnits Scheme where
supertype (PriceQuoteUnits s _) = s
data QuantityUnit = QuantityUnit Scheme QuantityUnitAttributes deriving (Eq,Show)
data QuantityUnitAttributes = QuantityUnitAttributes
{ quantUnitAttrib_quantityUnitScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType QuantityUnit where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "quantityUnitScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ QuantityUnit v (QuantityUnitAttributes a0)
schemaTypeToXML s (QuantityUnit bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "quantityUnitScheme") $ quantUnitAttrib_quantityUnitScheme at
]
$ schemaTypeToXML s bt
instance Extension QuantityUnit Scheme where
supertype (QuantityUnit s _) = s
data QuotationCharacteristics = QuotationCharacteristics
{ quotChar_measureType :: Maybe AssetMeasureType
, quotChar_quoteUnits :: Maybe PriceQuoteUnits
, quotChar_side :: Maybe QuotationSideEnum
, quotChar_currency :: Maybe Currency
, quotChar_currencyType :: Maybe ReportingCurrencyType
, quotChar_timing :: Maybe QuoteTiming
, quotChar_choice6 :: (Maybe (OneOf2 BusinessCenter ExchangeId))
, quotChar_informationSource :: [InformationSource]
, quotChar_pricingModel :: Maybe PricingModel
, quotChar_time :: Maybe Xsd.DateTime
, quotChar_valuationDate :: Maybe Xsd.Date
, quotChar_expiryTime :: Maybe Xsd.DateTime
, quotChar_cashflowType :: Maybe CashflowType
}
deriving (Eq,Show)
instance SchemaType QuotationCharacteristics where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return QuotationCharacteristics
`apply` optional (parseSchemaType "measureType")
`apply` optional (parseSchemaType "quoteUnits")
`apply` optional (parseSchemaType "side")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "currencyType")
`apply` optional (parseSchemaType "timing")
`apply` optional (oneOf' [ ("BusinessCenter", fmap OneOf2 (parseSchemaType "businessCenter"))
, ("ExchangeId", fmap TwoOf2 (parseSchemaType "exchangeId"))
])
`apply` many (parseSchemaType "informationSource")
`apply` optional (parseSchemaType "pricingModel")
`apply` optional (parseSchemaType "time")
`apply` optional (parseSchemaType "valuationDate")
`apply` optional (parseSchemaType "expiryTime")
`apply` optional (parseSchemaType "cashflowType")
schemaTypeToXML s x@QuotationCharacteristics{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "measureType") $ quotChar_measureType x
, maybe [] (schemaTypeToXML "quoteUnits") $ quotChar_quoteUnits x
, maybe [] (schemaTypeToXML "side") $ quotChar_side x
, maybe [] (schemaTypeToXML "currency") $ quotChar_currency x
, maybe [] (schemaTypeToXML "currencyType") $ quotChar_currencyType x
, maybe [] (schemaTypeToXML "timing") $ quotChar_timing x
, maybe [] (foldOneOf2 (schemaTypeToXML "businessCenter")
(schemaTypeToXML "exchangeId")
) $ quotChar_choice6 x
, concatMap (schemaTypeToXML "informationSource") $ quotChar_informationSource x
, maybe [] (schemaTypeToXML "pricingModel") $ quotChar_pricingModel x
, maybe [] (schemaTypeToXML "time") $ quotChar_time x
, maybe [] (schemaTypeToXML "valuationDate") $ quotChar_valuationDate x
, maybe [] (schemaTypeToXML "expiryTime") $ quotChar_expiryTime x
, maybe [] (schemaTypeToXML "cashflowType") $ quotChar_cashflowType x
]
data QuoteTiming = QuoteTiming Scheme QuoteTimingAttributes deriving (Eq,Show)
data QuoteTimingAttributes = QuoteTimingAttributes
{ quoteTimingAttrib_quoteTimingScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType QuoteTiming where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "quoteTimingScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ QuoteTiming v (QuoteTimingAttributes a0)
schemaTypeToXML s (QuoteTiming bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "quoteTimingScheme") $ quoteTimingAttrib_quoteTimingScheme at
]
$ schemaTypeToXML s bt
instance Extension QuoteTiming Scheme where
supertype (QuoteTiming s _) = s
data RateIndex = RateIndex
{ rateIndex_ID :: Maybe Xsd.ID
, rateIndex_instrumentId :: [InstrumentId]
, rateIndex_description :: Maybe Xsd.XsdString
, rateIndex_currency :: Maybe IdentifiedCurrency
, rateIndex_exchangeId :: Maybe ExchangeId
, rateIndex_clearanceSystem :: Maybe ClearanceSystem
, rateIndex_definition :: Maybe ProductReference
, rateIndex_floatingRateIndex :: Maybe FloatingRateIndex
, rateIndex_term :: Maybe Period
, rateIndex_paymentFrequency :: Maybe Period
, rateIndex_dayCountFraction :: Maybe DayCountFraction
}
deriving (Eq,Show)
instance SchemaType RateIndex where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (RateIndex a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` optional (parseSchemaType "floatingRateIndex")
`apply` optional (parseSchemaType "term")
`apply` optional (parseSchemaType "paymentFrequency")
`apply` optional (parseSchemaType "dayCountFraction")
schemaTypeToXML s x@RateIndex{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ rateIndex_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ rateIndex_instrumentId x
, maybe [] (schemaTypeToXML "description") $ rateIndex_description x
, maybe [] (schemaTypeToXML "currency") $ rateIndex_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ rateIndex_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ rateIndex_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ rateIndex_definition x
, maybe [] (schemaTypeToXML "floatingRateIndex") $ rateIndex_floatingRateIndex x
, maybe [] (schemaTypeToXML "term") $ rateIndex_term x
, maybe [] (schemaTypeToXML "paymentFrequency") $ rateIndex_paymentFrequency x
, maybe [] (schemaTypeToXML "dayCountFraction") $ rateIndex_dayCountFraction x
]
instance Extension RateIndex UnderlyingAsset where
supertype v = UnderlyingAsset_RateIndex v
instance Extension RateIndex IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: RateIndex -> UnderlyingAsset)
instance Extension RateIndex Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: RateIndex -> UnderlyingAsset)
data ReportingCurrencyType = ReportingCurrencyType Scheme ReportingCurrencyTypeAttributes deriving (Eq,Show)
data ReportingCurrencyTypeAttributes = ReportingCurrencyTypeAttributes
{ reportCurrenTypeAttrib_reportingCurrencyTypeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType ReportingCurrencyType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "reportingCurrencyTypeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ ReportingCurrencyType v (ReportingCurrencyTypeAttributes a0)
schemaTypeToXML s (ReportingCurrencyType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "reportingCurrencyTypeScheme") $ reportCurrenTypeAttrib_reportingCurrencyTypeScheme at
]
$ schemaTypeToXML s bt
instance Extension ReportingCurrencyType Scheme where
supertype (ReportingCurrencyType s _) = s
data SimpleCreditDefaultSwap = SimpleCreditDefaultSwap
{ simpleCreditDefaultSwap_ID :: Maybe Xsd.ID
, simpleCreditDefaultSwap_instrumentId :: [InstrumentId]
, simpleCreditDefaultSwap_description :: Maybe Xsd.XsdString
, simpleCreditDefaultSwap_currency :: Maybe IdentifiedCurrency
, simpleCreditDefaultSwap_exchangeId :: Maybe ExchangeId
, simpleCreditDefaultSwap_clearanceSystem :: Maybe ClearanceSystem
, simpleCreditDefaultSwap_definition :: Maybe ProductReference
, simpleCreditDefaultSwap_choice6 :: (Maybe (OneOf2 LegalEntity LegalEntityReference))
, simpleCreditDefaultSwap_term :: Maybe Period
, simpleCreditDefaultSwap_paymentFrequency :: Maybe Period
}
deriving (Eq,Show)
instance SchemaType SimpleCreditDefaultSwap where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (SimpleCreditDefaultSwap a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` optional (oneOf' [ ("LegalEntity", fmap OneOf2 (parseSchemaType "referenceEntity"))
, ("LegalEntityReference", fmap TwoOf2 (parseSchemaType "creditEntityReference"))
])
`apply` optional (parseSchemaType "term")
`apply` optional (parseSchemaType "paymentFrequency")
schemaTypeToXML s x@SimpleCreditDefaultSwap{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ simpleCreditDefaultSwap_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ simpleCreditDefaultSwap_instrumentId x
, maybe [] (schemaTypeToXML "description") $ simpleCreditDefaultSwap_description x
, maybe [] (schemaTypeToXML "currency") $ simpleCreditDefaultSwap_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ simpleCreditDefaultSwap_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ simpleCreditDefaultSwap_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ simpleCreditDefaultSwap_definition x
, maybe [] (foldOneOf2 (schemaTypeToXML "referenceEntity")
(schemaTypeToXML "creditEntityReference")
) $ simpleCreditDefaultSwap_choice6 x
, maybe [] (schemaTypeToXML "term") $ simpleCreditDefaultSwap_term x
, maybe [] (schemaTypeToXML "paymentFrequency") $ simpleCreditDefaultSwap_paymentFrequency x
]
instance Extension SimpleCreditDefaultSwap UnderlyingAsset where
supertype v = UnderlyingAsset_SimpleCreditDefaultSwap v
instance Extension SimpleCreditDefaultSwap IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: SimpleCreditDefaultSwap -> UnderlyingAsset)
instance Extension SimpleCreditDefaultSwap Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: SimpleCreditDefaultSwap -> UnderlyingAsset)
data SimpleFra = SimpleFra
{ simpleFra_ID :: Maybe Xsd.ID
, simpleFra_instrumentId :: [InstrumentId]
, simpleFra_description :: Maybe Xsd.XsdString
, simpleFra_currency :: Maybe IdentifiedCurrency
, simpleFra_exchangeId :: Maybe ExchangeId
, simpleFra_clearanceSystem :: Maybe ClearanceSystem
, simpleFra_definition :: Maybe ProductReference
, simpleFra_startTerm :: Maybe Period
, simpleFra_endTerm :: Maybe Period
, simpleFra_dayCountFraction :: Maybe DayCountFraction
}
deriving (Eq,Show)
instance SchemaType SimpleFra where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (SimpleFra a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` optional (parseSchemaType "startTerm")
`apply` optional (parseSchemaType "endTerm")
`apply` optional (parseSchemaType "dayCountFraction")
schemaTypeToXML s x@SimpleFra{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ simpleFra_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ simpleFra_instrumentId x
, maybe [] (schemaTypeToXML "description") $ simpleFra_description x
, maybe [] (schemaTypeToXML "currency") $ simpleFra_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ simpleFra_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ simpleFra_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ simpleFra_definition x
, maybe [] (schemaTypeToXML "startTerm") $ simpleFra_startTerm x
, maybe [] (schemaTypeToXML "endTerm") $ simpleFra_endTerm x
, maybe [] (schemaTypeToXML "dayCountFraction") $ simpleFra_dayCountFraction x
]
instance Extension SimpleFra UnderlyingAsset where
supertype v = UnderlyingAsset_SimpleFra v
instance Extension SimpleFra IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: SimpleFra -> UnderlyingAsset)
instance Extension SimpleFra Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: SimpleFra -> UnderlyingAsset)
data SimpleIRSwap = SimpleIRSwap
{ simpleIRSwap_ID :: Maybe Xsd.ID
, simpleIRSwap_instrumentId :: [InstrumentId]
, simpleIRSwap_description :: Maybe Xsd.XsdString
, simpleIRSwap_currency :: Maybe IdentifiedCurrency
, simpleIRSwap_exchangeId :: Maybe ExchangeId
, simpleIRSwap_clearanceSystem :: Maybe ClearanceSystem
, simpleIRSwap_definition :: Maybe ProductReference
, simpleIRSwap_term :: Maybe Period
, simpleIRSwap_paymentFrequency :: Maybe Period
, simpleIRSwap_dayCountFraction :: Maybe DayCountFraction
}
deriving (Eq,Show)
instance SchemaType SimpleIRSwap where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (SimpleIRSwap a0)
`apply` many (parseSchemaType "instrumentId")
`apply` optional (parseSchemaType "description")
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "exchangeId")
`apply` optional (parseSchemaType "clearanceSystem")
`apply` optional (parseSchemaType "definition")
`apply` optional (parseSchemaType "term")
`apply` optional (parseSchemaType "paymentFrequency")
`apply` optional (parseSchemaType "dayCountFraction")
schemaTypeToXML s x@SimpleIRSwap{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ simpleIRSwap_ID x
]
[ concatMap (schemaTypeToXML "instrumentId") $ simpleIRSwap_instrumentId x
, maybe [] (schemaTypeToXML "description") $ simpleIRSwap_description x
, maybe [] (schemaTypeToXML "currency") $ simpleIRSwap_currency x
, maybe [] (schemaTypeToXML "exchangeId") $ simpleIRSwap_exchangeId x
, maybe [] (schemaTypeToXML "clearanceSystem") $ simpleIRSwap_clearanceSystem x
, maybe [] (schemaTypeToXML "definition") $ simpleIRSwap_definition x
, maybe [] (schemaTypeToXML "term") $ simpleIRSwap_term x
, maybe [] (schemaTypeToXML "paymentFrequency") $ simpleIRSwap_paymentFrequency x
, maybe [] (schemaTypeToXML "dayCountFraction") $ simpleIRSwap_dayCountFraction x
]
instance Extension SimpleIRSwap UnderlyingAsset where
supertype v = UnderlyingAsset_SimpleIRSwap v
instance Extension SimpleIRSwap IdentifiedAsset where
supertype = (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: SimpleIRSwap -> UnderlyingAsset)
instance Extension SimpleIRSwap Asset where
supertype = (supertype :: IdentifiedAsset -> Asset)
. (supertype :: UnderlyingAsset -> IdentifiedAsset)
. (supertype :: SimpleIRSwap -> UnderlyingAsset)
data SingleUnderlyer = SingleUnderlyer
{ singleUnderly_underlyingAsset :: Maybe Asset
, singleUnderly_openUnits :: Maybe Xsd.Decimal
, singleUnderly_dividendPayout :: Maybe DividendPayout
, singleUnderly_couponPayment :: Maybe PendingPayment
, singleUnderly_averageDailyTradingVolume :: Maybe AverageDailyTradingVolumeLimit
, singleUnderly_depositoryReceipt :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType SingleUnderlyer where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SingleUnderlyer
`apply` optional (elementUnderlyingAsset)
`apply` optional (parseSchemaType "openUnits")
`apply` optional (parseSchemaType "dividendPayout")
`apply` optional (parseSchemaType "couponPayment")
`apply` optional (parseSchemaType "averageDailyTradingVolume")
`apply` optional (parseSchemaType "depositoryReceipt")
schemaTypeToXML s x@SingleUnderlyer{} =
toXMLElement s []
[ maybe [] (elementToXMLUnderlyingAsset) $ singleUnderly_underlyingAsset x
, maybe [] (schemaTypeToXML "openUnits") $ singleUnderly_openUnits x
, maybe [] (schemaTypeToXML "dividendPayout") $ singleUnderly_dividendPayout x
, maybe [] (schemaTypeToXML "couponPayment") $ singleUnderly_couponPayment x
, maybe [] (schemaTypeToXML "averageDailyTradingVolume") $ singleUnderly_averageDailyTradingVolume x
, maybe [] (schemaTypeToXML "depositoryReceipt") $ singleUnderly_depositoryReceipt x
]
data TimeZone = TimeZone Scheme TimeZoneAttributes deriving (Eq,Show)
data TimeZoneAttributes = TimeZoneAttributes
{ timeZoneAttrib_timeZoneScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType TimeZone where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "timeZoneScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ TimeZone v (TimeZoneAttributes a0)
schemaTypeToXML s (TimeZone bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "timeZoneScheme") $ timeZoneAttrib_timeZoneScheme at
]
$ schemaTypeToXML s bt
instance Extension TimeZone Scheme where
supertype (TimeZone s _) = s
data Underlyer = Underlyer
{ underlyer_choice0 :: (Maybe (OneOf2 SingleUnderlyer Basket))
}
deriving (Eq,Show)
instance SchemaType Underlyer where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Underlyer
`apply` optional (oneOf' [ ("SingleUnderlyer", fmap OneOf2 (parseSchemaType "singleUnderlyer"))
, ("Basket", fmap TwoOf2 (parseSchemaType "basket"))
])
schemaTypeToXML s x@Underlyer{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "singleUnderlyer")
(schemaTypeToXML "basket")
) $ underlyer_choice0 x
]
data UnderlyingAsset
= UnderlyingAsset_SimpleIRSwap SimpleIRSwap
| UnderlyingAsset_SimpleFra SimpleFra
| UnderlyingAsset_SimpleCreditDefaultSwap SimpleCreditDefaultSwap
| UnderlyingAsset_RateIndex RateIndex
| UnderlyingAsset_MutualFund MutualFund
| UnderlyingAsset_Mortgage Mortgage
| UnderlyingAsset_Loan Loan
| UnderlyingAsset_FxRateAsset FxRateAsset
| UnderlyingAsset_ExchangeTraded ExchangeTraded
| UnderlyingAsset_Deposit Deposit
| UnderlyingAsset_Bond Bond
deriving (Eq,Show)
instance SchemaType UnderlyingAsset where
parseSchemaType s = do
(fmap UnderlyingAsset_SimpleIRSwap $ parseSchemaType s)
`onFail`
(fmap UnderlyingAsset_SimpleFra $ parseSchemaType s)
`onFail`
(fmap UnderlyingAsset_SimpleCreditDefaultSwap $ parseSchemaType s)
`onFail`
(fmap UnderlyingAsset_RateIndex $ parseSchemaType s)
`onFail`
(fmap UnderlyingAsset_MutualFund $ parseSchemaType s)
`onFail`
(fmap UnderlyingAsset_Mortgage $ parseSchemaType s)
`onFail`
(fmap UnderlyingAsset_Loan $ parseSchemaType s)
`onFail`
(fmap UnderlyingAsset_FxRateAsset $ parseSchemaType s)
`onFail`
(fmap UnderlyingAsset_ExchangeTraded $ parseSchemaType s)
`onFail`
(fmap UnderlyingAsset_Deposit $ parseSchemaType s)
`onFail`
(fmap UnderlyingAsset_Bond $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of UnderlyingAsset,\n\
\ namely one of:\n\
\SimpleIRSwap,SimpleFra,SimpleCreditDefaultSwap,RateIndex,MutualFund,Mortgage,Loan,FxRateAsset,ExchangeTraded,Deposit,Bond"
schemaTypeToXML _s (UnderlyingAsset_SimpleIRSwap x) = schemaTypeToXML "simpleIRSwap" x
schemaTypeToXML _s (UnderlyingAsset_SimpleFra x) = schemaTypeToXML "simpleFra" x
schemaTypeToXML _s (UnderlyingAsset_SimpleCreditDefaultSwap x) = schemaTypeToXML "simpleCreditDefaultSwap" x
schemaTypeToXML _s (UnderlyingAsset_RateIndex x) = schemaTypeToXML "rateIndex" x
schemaTypeToXML _s (UnderlyingAsset_MutualFund x) = schemaTypeToXML "mutualFund" x
schemaTypeToXML _s (UnderlyingAsset_Mortgage x) = schemaTypeToXML "mortgage" x
schemaTypeToXML _s (UnderlyingAsset_Loan x) = schemaTypeToXML "loan" x
schemaTypeToXML _s (UnderlyingAsset_FxRateAsset x) = schemaTypeToXML "fxRateAsset" x
schemaTypeToXML _s (UnderlyingAsset_ExchangeTraded x) = schemaTypeToXML "exchangeTraded" x
schemaTypeToXML _s (UnderlyingAsset_Deposit x) = schemaTypeToXML "deposit" x
schemaTypeToXML _s (UnderlyingAsset_Bond x) = schemaTypeToXML "bond" x
instance Extension UnderlyingAsset IdentifiedAsset where
supertype v = IdentifiedAsset_UnderlyingAsset v
data UnderlyingAssetTranche = UnderlyingAssetTranche Scheme UnderlyingAssetTrancheAttributes deriving (Eq,Show)
data UnderlyingAssetTrancheAttributes = UnderlyingAssetTrancheAttributes
{ underlyAssetTrancheAttrib_loanTrancheScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType UnderlyingAssetTranche where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "loanTrancheScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ UnderlyingAssetTranche v (UnderlyingAssetTrancheAttributes a0)
schemaTypeToXML s (UnderlyingAssetTranche bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "loanTrancheScheme") $ underlyAssetTrancheAttrib_loanTrancheScheme at
]
$ schemaTypeToXML s bt
instance Extension UnderlyingAssetTranche Scheme where
supertype (UnderlyingAssetTranche s _) = s
elementBasket :: XMLParser Basket
elementBasket = parseSchemaType "basket"
elementToXMLBasket :: Basket -> [Content ()]
elementToXMLBasket = schemaTypeToXML "basket"
elementBond :: XMLParser Bond
elementBond = parseSchemaType "bond"
elementToXMLBond :: Bond -> [Content ()]
elementToXMLBond = schemaTypeToXML "bond"
elementCash :: XMLParser Cash
elementCash = parseSchemaType "cash"
elementToXMLCash :: Cash -> [Content ()]
elementToXMLCash = schemaTypeToXML "cash"
elementCommodity :: XMLParser Commodity
elementCommodity = parseSchemaType "commodity"
elementToXMLCommodity :: Commodity -> [Content ()]
elementToXMLCommodity = schemaTypeToXML "commodity"
elementConvertibleBond :: XMLParser ConvertibleBond
elementConvertibleBond = parseSchemaType "convertibleBond"
elementToXMLConvertibleBond :: ConvertibleBond -> [Content ()]
elementToXMLConvertibleBond = schemaTypeToXML "convertibleBond"
elementCurveInstrument :: XMLParser Asset
elementCurveInstrument = fmap supertype elementSimpleIrSwap
`onFail`
fmap supertype elementSimpleFra
`onFail`
fmap supertype elementSimpleCreditDefaultSwap
`onFail`
fmap supertype elementRateIndex
`onFail`
fmap supertype elementFx
`onFail`
fmap supertype elementDeposit
`onFail` fail "Parse failed when expecting an element in the substitution group for\n\
\ <curveInstrument>,\n\
\ namely one of:\n\
\<simpleIrSwap>, <simpleFra>, <simpleCreditDefaultSwap>, <rateIndex>, <fx>, <deposit>"
elementToXMLCurveInstrument :: Asset -> [Content ()]
elementToXMLCurveInstrument = schemaTypeToXML "curveInstrument"
elementDeposit :: XMLParser Deposit
elementDeposit = parseSchemaType "deposit"
elementToXMLDeposit :: Deposit -> [Content ()]
elementToXMLDeposit = schemaTypeToXML "deposit"
elementEquity :: XMLParser EquityAsset
elementEquity = parseSchemaType "equity"
elementToXMLEquity :: EquityAsset -> [Content ()]
elementToXMLEquity = schemaTypeToXML "equity"
elementExchangeTradedFund :: XMLParser ExchangeTradedFund
elementExchangeTradedFund = parseSchemaType "exchangeTradedFund"
elementToXMLExchangeTradedFund :: ExchangeTradedFund -> [Content ()]
elementToXMLExchangeTradedFund = schemaTypeToXML "exchangeTradedFund"
elementFuture :: XMLParser Future
elementFuture = parseSchemaType "future"
elementToXMLFuture :: Future -> [Content ()]
elementToXMLFuture = schemaTypeToXML "future"
elementFx :: XMLParser FxRateAsset
elementFx = parseSchemaType "fx"
elementToXMLFx :: FxRateAsset -> [Content ()]
elementToXMLFx = schemaTypeToXML "fx"
elementIndex :: XMLParser Index
elementIndex = parseSchemaType "index"
elementToXMLIndex :: Index -> [Content ()]
elementToXMLIndex = schemaTypeToXML "index"
elementLoan :: XMLParser Loan
elementLoan = parseSchemaType "loan"
elementToXMLLoan :: Loan -> [Content ()]
elementToXMLLoan = schemaTypeToXML "loan"
elementMortgage :: XMLParser Mortgage
elementMortgage = parseSchemaType "mortgage"
elementToXMLMortgage :: Mortgage -> [Content ()]
elementToXMLMortgage = schemaTypeToXML "mortgage"
elementMutualFund :: XMLParser MutualFund
elementMutualFund = parseSchemaType "mutualFund"
elementToXMLMutualFund :: MutualFund -> [Content ()]
elementToXMLMutualFund = schemaTypeToXML "mutualFund"
elementRateIndex :: XMLParser RateIndex
elementRateIndex = parseSchemaType "rateIndex"
elementToXMLRateIndex :: RateIndex -> [Content ()]
elementToXMLRateIndex = schemaTypeToXML "rateIndex"
elementSimpleCreditDefaultSwap :: XMLParser SimpleCreditDefaultSwap
elementSimpleCreditDefaultSwap = parseSchemaType "simpleCreditDefaultSwap"
elementToXMLSimpleCreditDefaultSwap :: SimpleCreditDefaultSwap -> [Content ()]
elementToXMLSimpleCreditDefaultSwap = schemaTypeToXML "simpleCreditDefaultSwap"
elementSimpleFra :: XMLParser SimpleFra
elementSimpleFra = parseSchemaType "simpleFra"
elementToXMLSimpleFra :: SimpleFra -> [Content ()]
elementToXMLSimpleFra = schemaTypeToXML "simpleFra"
elementSimpleIrSwap :: XMLParser SimpleIRSwap
elementSimpleIrSwap = parseSchemaType "simpleIrSwap"
elementToXMLSimpleIrSwap :: SimpleIRSwap -> [Content ()]
elementToXMLSimpleIrSwap = schemaTypeToXML "simpleIrSwap"
elementUnderlyingAsset :: XMLParser Asset
elementUnderlyingAsset = fmap supertype elementMutualFund
`onFail`
fmap supertype elementMortgage
`onFail`
fmap supertype elementLoan
`onFail`
fmap supertype elementIndex
`onFail`
fmap supertype elementFuture
`onFail`
fmap supertype elementExchangeTradedFund
`onFail`
fmap supertype elementEquity
`onFail`
fmap supertype elementConvertibleBond
`onFail`
fmap supertype elementCommodity
`onFail`
fmap supertype elementCash
`onFail`
fmap supertype elementBond
`onFail`
fmap supertype elementBasket
`onFail` fail "Parse failed when expecting an element in the substitution group for\n\
\ <underlyingAsset>,\n\
\ namely one of:\n\
\<mutualFund>, <mortgage>, <loan>, <index>, <future>, <exchangeTradedFund>, <equity>, <convertibleBond>, <commodity>, <cash>, <bond>, <basket>"
elementToXMLUnderlyingAsset :: Asset -> [Content ()]
elementToXMLUnderlyingAsset = schemaTypeToXML "underlyingAsset"