module Data.FpML.V53.FX
( module Data.FpML.V53.FX
, module Data.FpML.V53.Shared.Option
) where
import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))
import Text.XML.HaXml.Schema.Schema as Schema
import Text.XML.HaXml.OneOfN
import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd
import Data.FpML.V53.Shared.Option
newtype PointValue = PointValue Xsd.Decimal deriving (Eq,Show)
instance Restricts PointValue Xsd.Decimal where
restricts (PointValue x) = x
instance SchemaType PointValue where
parseSchemaType s = do
e <- element [s]
commit $ interior e $ parseSimpleType
schemaTypeToXML s (PointValue x) =
toXMLElement s [] [toXMLText (simpleTypeText x)]
instance SimpleType PointValue where
acceptingParser = fmap PointValue acceptingParser
simpleTypeText (PointValue x) = simpleTypeText x
data CrossRate = CrossRate
{ crossRate_currency1 :: Maybe Currency
, crossRate_currency2 :: Maybe Currency
, crossRate_quoteBasis :: Maybe QuoteBasisEnum
, crossRate_rate :: Maybe PositiveDecimal
, crossRate_spotRate :: Maybe PositiveDecimal
, crossRate_forwardPoints :: Maybe Xsd.Decimal
}
deriving (Eq,Show)
instance SchemaType CrossRate where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CrossRate
`apply` optional (parseSchemaType "currency1")
`apply` optional (parseSchemaType "currency2")
`apply` optional (parseSchemaType "quoteBasis")
`apply` optional (parseSchemaType "rate")
`apply` optional (parseSchemaType "spotRate")
`apply` optional (parseSchemaType "forwardPoints")
schemaTypeToXML s x@CrossRate{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "currency1") $ crossRate_currency1 x
, maybe [] (schemaTypeToXML "currency2") $ crossRate_currency2 x
, maybe [] (schemaTypeToXML "quoteBasis") $ crossRate_quoteBasis x
, maybe [] (schemaTypeToXML "rate") $ crossRate_rate x
, maybe [] (schemaTypeToXML "spotRate") $ crossRate_spotRate x
, maybe [] (schemaTypeToXML "forwardPoints") $ crossRate_forwardPoints x
]
instance Extension CrossRate QuotedCurrencyPair where
supertype (CrossRate e0 e1 e2 e3 e4 e5) =
QuotedCurrencyPair e0 e1 e2
data CutName = CutName Scheme CutNameAttributes deriving (Eq,Show)
data CutNameAttributes = CutNameAttributes
{ cutNameAttrib_cutNameScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CutName where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "cutNameScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CutName v (CutNameAttributes a0)
schemaTypeToXML s (CutName bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "cutNameScheme") $ cutNameAttrib_cutNameScheme at
]
$ schemaTypeToXML s bt
instance Extension CutName Scheme where
supertype (CutName s _) = s
data DualCurrencyFeature = DualCurrencyFeature
{ dualCurrenFeature_currency :: Maybe Currency
, dualCurrenFeature_fixingDate :: Maybe Xsd.Date
, dualCurrenFeature_fixingTime :: Maybe BusinessCenterTime
, dualCurrenFeature_strike :: Maybe DualCurrencyStrikePrice
, dualCurrenFeature_spotRate :: Maybe Xsd.Decimal
, dualCurrenFeature_interestAtRisk :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType DualCurrencyFeature where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return DualCurrencyFeature
`apply` optional (parseSchemaType "currency")
`apply` optional (parseSchemaType "fixingDate")
`apply` optional (parseSchemaType "fixingTime")
`apply` optional (parseSchemaType "strike")
`apply` optional (parseSchemaType "spotRate")
`apply` optional (parseSchemaType "interestAtRisk")
schemaTypeToXML s x@DualCurrencyFeature{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "currency") $ dualCurrenFeature_currency x
, maybe [] (schemaTypeToXML "fixingDate") $ dualCurrenFeature_fixingDate x
, maybe [] (schemaTypeToXML "fixingTime") $ dualCurrenFeature_fixingTime x
, maybe [] (schemaTypeToXML "strike") $ dualCurrenFeature_strike x
, maybe [] (schemaTypeToXML "spotRate") $ dualCurrenFeature_spotRate x
, maybe [] (schemaTypeToXML "interestAtRisk") $ dualCurrenFeature_interestAtRisk x
]
data DualCurrencyStrikePrice = DualCurrencyStrikePrice
{ dualCurrenStrikePrice_rate :: Maybe PositiveDecimal
, dualCurrenStrikePrice_strikeQuoteBasis :: Maybe DualCurrencyStrikeQuoteBasisEnum
}
deriving (Eq,Show)
instance SchemaType DualCurrencyStrikePrice where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return DualCurrencyStrikePrice
`apply` optional (parseSchemaType "rate")
`apply` optional (parseSchemaType "strikeQuoteBasis")
schemaTypeToXML s x@DualCurrencyStrikePrice{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "rate") $ dualCurrenStrikePrice_rate x
, maybe [] (schemaTypeToXML "strikeQuoteBasis") $ dualCurrenStrikePrice_strikeQuoteBasis x
]
data ExchangeRate = ExchangeRate
{ exchangeRate_quotedCurrencyPair :: Maybe QuotedCurrencyPair
, exchangeRate_rate :: Maybe PositiveDecimal
, exchangeRate_spotRate :: Maybe PositiveDecimal
, exchangeRate_forwardPoints :: Maybe Xsd.Decimal
, exchangeRate_pointValue :: Maybe PointValue
, exchangeRate_crossRate :: [CrossRate]
}
deriving (Eq,Show)
instance SchemaType ExchangeRate where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ExchangeRate
`apply` optional (parseSchemaType "quotedCurrencyPair")
`apply` optional (parseSchemaType "rate")
`apply` optional (parseSchemaType "spotRate")
`apply` optional (parseSchemaType "forwardPoints")
`apply` optional (parseSchemaType "pointValue")
`apply` many (parseSchemaType "crossRate")
schemaTypeToXML s x@ExchangeRate{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "quotedCurrencyPair") $ exchangeRate_quotedCurrencyPair x
, maybe [] (schemaTypeToXML "rate") $ exchangeRate_rate x
, maybe [] (schemaTypeToXML "spotRate") $ exchangeRate_spotRate x
, maybe [] (schemaTypeToXML "forwardPoints") $ exchangeRate_forwardPoints x
, maybe [] (schemaTypeToXML "pointValue") $ exchangeRate_pointValue x
, concatMap (schemaTypeToXML "crossRate") $ exchangeRate_crossRate x
]
data FxAmericanExercise = FxAmericanExercise
{ fxAmericExerc_ID :: Maybe Xsd.ID
, fxAmericExerc_commencementDate :: Maybe AdjustableOrRelativeDate
, fxAmericExerc_expiryDate :: Maybe Xsd.Date
, fxAmericExerc_expiryTime :: Maybe BusinessCenterTime
, fxAmericExerc_cutName :: Maybe CutName
, fxAmericExerc_latestValueDate :: Maybe Xsd.Date
, fxAmericExerc_multipleExercise :: Maybe FxMultipleExercise
}
deriving (Eq,Show)
instance SchemaType FxAmericanExercise where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FxAmericanExercise a0)
`apply` optional (parseSchemaType "commencementDate")
`apply` optional (parseSchemaType "expiryDate")
`apply` optional (parseSchemaType "expiryTime")
`apply` optional (parseSchemaType "cutName")
`apply` optional (parseSchemaType "latestValueDate")
`apply` optional (parseSchemaType "multipleExercise")
schemaTypeToXML s x@FxAmericanExercise{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxAmericExerc_ID x
]
[ maybe [] (schemaTypeToXML "commencementDate") $ fxAmericExerc_commencementDate x
, maybe [] (schemaTypeToXML "expiryDate") $ fxAmericExerc_expiryDate x
, maybe [] (schemaTypeToXML "expiryTime") $ fxAmericExerc_expiryTime x
, maybe [] (schemaTypeToXML "cutName") $ fxAmericExerc_cutName x
, maybe [] (schemaTypeToXML "latestValueDate") $ fxAmericExerc_latestValueDate x
, maybe [] (schemaTypeToXML "multipleExercise") $ fxAmericExerc_multipleExercise x
]
instance Extension FxAmericanExercise FxDigitalAmericanExercise where
supertype (FxAmericanExercise a0 e0 e1 e2 e3 e4 e5) =
FxDigitalAmericanExercise a0 e0 e1 e2 e3 e4
instance Extension FxAmericanExercise Exercise where
supertype = (supertype :: FxDigitalAmericanExercise -> Exercise)
. (supertype :: FxAmericanExercise -> FxDigitalAmericanExercise)
data FxAsianFeature = FxAsianFeature
{ fxAsianFeature_primaryRateSource :: Maybe InformationSource
, fxAsianFeature_secondaryRateSource :: Maybe InformationSource
, fxAsianFeature_fixingTime :: Maybe BusinessCenterTime
, fxAsianFeature_observationSchedule :: Maybe FxAverageRateObservationSchedule
, fxAsianFeature_rateObservation :: [FxAverageRateObservation]
, fxAsianFeature_rateObservationQuoteBasis :: Maybe StrikeQuoteBasisEnum
, fxAsianFeature_payoutFormula :: Maybe Xsd.XsdString
, fxAsianFeature_precision :: Maybe Xsd.NonNegativeInteger
}
deriving (Eq,Show)
instance SchemaType FxAsianFeature where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxAsianFeature
`apply` optional (parseSchemaType "primaryRateSource")
`apply` optional (parseSchemaType "secondaryRateSource")
`apply` optional (parseSchemaType "fixingTime")
`apply` optional (parseSchemaType "observationSchedule")
`apply` many (parseSchemaType "rateObservation")
`apply` optional (parseSchemaType "rateObservationQuoteBasis")
`apply` optional (parseSchemaType "payoutFormula")
`apply` optional (parseSchemaType "precision")
schemaTypeToXML s x@FxAsianFeature{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "primaryRateSource") $ fxAsianFeature_primaryRateSource x
, maybe [] (schemaTypeToXML "secondaryRateSource") $ fxAsianFeature_secondaryRateSource x
, maybe [] (schemaTypeToXML "fixingTime") $ fxAsianFeature_fixingTime x
, maybe [] (schemaTypeToXML "observationSchedule") $ fxAsianFeature_observationSchedule x
, concatMap (schemaTypeToXML "rateObservation") $ fxAsianFeature_rateObservation x
, maybe [] (schemaTypeToXML "rateObservationQuoteBasis") $ fxAsianFeature_rateObservationQuoteBasis x
, maybe [] (schemaTypeToXML "payoutFormula") $ fxAsianFeature_payoutFormula x
, maybe [] (schemaTypeToXML "precision") $ fxAsianFeature_precision x
]
data FxAverageRateObservation = FxAverageRateObservation
{ fxAverageRateObserv_date :: Maybe Xsd.Date
, fxAverageRateObserv_averageRateWeightingFactor :: Maybe Xsd.Decimal
, fxAverageRateObserv_rate :: Maybe NonNegativeDecimal
}
deriving (Eq,Show)
instance SchemaType FxAverageRateObservation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxAverageRateObservation
`apply` optional (parseSchemaType "date")
`apply` optional (parseSchemaType "averageRateWeightingFactor")
`apply` optional (parseSchemaType "rate")
schemaTypeToXML s x@FxAverageRateObservation{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "date") $ fxAverageRateObserv_date x
, maybe [] (schemaTypeToXML "averageRateWeightingFactor") $ fxAverageRateObserv_averageRateWeightingFactor x
, maybe [] (schemaTypeToXML "rate") $ fxAverageRateObserv_rate x
]
data FxAverageRateObservationSchedule = FxAverageRateObservationSchedule
{ fxAverageRateObservSched_startDate :: Maybe Xsd.Date
, fxAverageRateObservSched_endDate :: Maybe Xsd.Date
, fxAverageRateObservSched_calculationPeriodFrequency :: Maybe CalculationPeriodFrequency
}
deriving (Eq,Show)
instance SchemaType FxAverageRateObservationSchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxAverageRateObservationSchedule
`apply` optional (parseSchemaType "startDate")
`apply` optional (parseSchemaType "endDate")
`apply` optional (parseSchemaType "calculationPeriodFrequency")
schemaTypeToXML s x@FxAverageRateObservationSchedule{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "startDate") $ fxAverageRateObservSched_startDate x
, maybe [] (schemaTypeToXML "endDate") $ fxAverageRateObservSched_endDate x
, maybe [] (schemaTypeToXML "calculationPeriodFrequency") $ fxAverageRateObservSched_calculationPeriodFrequency x
]
data FxBarrierFeature = FxBarrierFeature
{ fxBarrierFeature_barrierType :: Maybe FxBarrierTypeEnum
, fxBarrierFeature_quotedCurrencyPair :: Maybe QuotedCurrencyPair
, fxBarrierFeature_triggerRate :: Maybe PositiveDecimal
, fxBarrierFeature_informationSource :: [InformationSource]
, fxBarrierFeature_observationStartDate :: Maybe Xsd.Date
, fxBarrierFeature_observationEndDate :: Maybe Xsd.Date
}
deriving (Eq,Show)
instance SchemaType FxBarrierFeature where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxBarrierFeature
`apply` optional (parseSchemaType "barrierType")
`apply` optional (parseSchemaType "quotedCurrencyPair")
`apply` optional (parseSchemaType "triggerRate")
`apply` many (parseSchemaType "informationSource")
`apply` optional (parseSchemaType "observationStartDate")
`apply` optional (parseSchemaType "observationEndDate")
schemaTypeToXML s x@FxBarrierFeature{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "barrierType") $ fxBarrierFeature_barrierType x
, maybe [] (schemaTypeToXML "quotedCurrencyPair") $ fxBarrierFeature_quotedCurrencyPair x
, maybe [] (schemaTypeToXML "triggerRate") $ fxBarrierFeature_triggerRate x
, concatMap (schemaTypeToXML "informationSource") $ fxBarrierFeature_informationSource x
, maybe [] (schemaTypeToXML "observationStartDate") $ fxBarrierFeature_observationStartDate x
, maybe [] (schemaTypeToXML "observationEndDate") $ fxBarrierFeature_observationEndDate x
]
data FxBoundary = FxBoundary
{ fxBoundary_choice0 :: (Maybe (OneOf2 Inclusive Exclusive))
}
deriving (Eq,Show)
instance SchemaType FxBoundary where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxBoundary
`apply` optional (oneOf' [ ("Inclusive", fmap OneOf2 elementInclusive)
, ("Exclusive", fmap TwoOf2 elementExclusive)
])
schemaTypeToXML s x@FxBoundary{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (elementToXMLInclusive)
(elementToXMLExclusive)
) $ fxBoundary_choice0 x
]
data Inclusive = Inclusive deriving (Eq,Show)
data Exclusive = Exclusive deriving (Eq,Show)
elementInclusive = do element ["inclusive"]; return Inclusive
elementExclusive = do element ["exclusive"]; return Exclusive
elementToXMLInclusive Inclusive = toXMLElement "inclusive" [] []
elementToXMLExclusive Exclusive = toXMLElement "exclusive" [] []
data FxDigitalAmericanExercise = FxDigitalAmericanExercise
{ fxDigitalAmericExerc_ID :: Maybe Xsd.ID
, fxDigitalAmericExerc_commencementDate :: Maybe AdjustableOrRelativeDate
, fxDigitalAmericExerc_expiryDate :: Maybe Xsd.Date
, fxDigitalAmericExerc_expiryTime :: Maybe BusinessCenterTime
, fxDigitalAmericExerc_cutName :: Maybe CutName
, fxDigitalAmericExerc_latestValueDate :: Maybe Xsd.Date
}
deriving (Eq,Show)
instance SchemaType FxDigitalAmericanExercise where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FxDigitalAmericanExercise a0)
`apply` optional (parseSchemaType "commencementDate")
`apply` optional (parseSchemaType "expiryDate")
`apply` optional (parseSchemaType "expiryTime")
`apply` optional (parseSchemaType "cutName")
`apply` optional (parseSchemaType "latestValueDate")
schemaTypeToXML s x@FxDigitalAmericanExercise{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxDigitalAmericExerc_ID x
]
[ maybe [] (schemaTypeToXML "commencementDate") $ fxDigitalAmericExerc_commencementDate x
, maybe [] (schemaTypeToXML "expiryDate") $ fxDigitalAmericExerc_expiryDate x
, maybe [] (schemaTypeToXML "expiryTime") $ fxDigitalAmericExerc_expiryTime x
, maybe [] (schemaTypeToXML "cutName") $ fxDigitalAmericExerc_cutName x
, maybe [] (schemaTypeToXML "latestValueDate") $ fxDigitalAmericExerc_latestValueDate x
]
instance Extension FxDigitalAmericanExercise Exercise where
supertype v = Exercise_FxDigitalAmericanExercise v
data FxDigitalOption = FxDigitalOption
{ fxDigitalOption_ID :: Maybe Xsd.ID
, fxDigitalOption_primaryAssetClass :: Maybe AssetClass
, fxDigitalOption_secondaryAssetClass :: [AssetClass]
, fxDigitalOption_productType :: [ProductType]
, fxDigitalOption_productId :: [ProductId]
, fxDigitalOption_buyerPartyReference :: Maybe PartyReference
, fxDigitalOption_buyerAccountReference :: Maybe AccountReference
, fxDigitalOption_sellerPartyReference :: Maybe PartyReference
, fxDigitalOption_sellerAccountReference :: Maybe AccountReference
, fxDigitalOption_effectiveDate :: Maybe AdjustableOrRelativeDate
, fxDigitalOption_tenorPeriod :: Maybe Period
, fxDigitalOption_choice10 :: (Maybe (OneOf2 ((Maybe (FxDigitalAmericanExercise)),[FxTouch]) ((Maybe (FxEuropeanExercise)),[FxTrigger])))
, fxDigitalOption_exerciseProcedure :: Maybe ExerciseProcedure
, fxDigitalOption_payout :: Maybe FxOptionPayout
, fxDigitalOption_premium :: [FxOptionPremium]
}
deriving (Eq,Show)
instance SchemaType FxDigitalOption where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FxDigitalOption a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "buyerPartyReference")
`apply` optional (parseSchemaType "buyerAccountReference")
`apply` optional (parseSchemaType "sellerPartyReference")
`apply` optional (parseSchemaType "sellerAccountReference")
`apply` optional (parseSchemaType "effectiveDate")
`apply` optional (parseSchemaType "tenorPeriod")
`apply` optional (oneOf' [ ("Maybe FxDigitalAmericanExercise [FxTouch]", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "americanExercise")
`apply` many (parseSchemaType "touch")))
, ("Maybe FxEuropeanExercise [FxTrigger]", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "europeanExercise")
`apply` many (parseSchemaType "trigger")))
])
`apply` optional (parseSchemaType "exerciseProcedure")
`apply` optional (parseSchemaType "payout")
`apply` many (parseSchemaType "premium")
schemaTypeToXML s x@FxDigitalOption{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxDigitalOption_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ fxDigitalOption_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ fxDigitalOption_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ fxDigitalOption_productType x
, concatMap (schemaTypeToXML "productId") $ fxDigitalOption_productId x
, maybe [] (schemaTypeToXML "buyerPartyReference") $ fxDigitalOption_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ fxDigitalOption_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ fxDigitalOption_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ fxDigitalOption_sellerAccountReference x
, maybe [] (schemaTypeToXML "effectiveDate") $ fxDigitalOption_effectiveDate x
, maybe [] (schemaTypeToXML "tenorPeriod") $ fxDigitalOption_tenorPeriod x
, maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "americanExercise") a
, concatMap (schemaTypeToXML "touch") b
])
(\ (a,b) -> concat [ maybe [] (schemaTypeToXML "europeanExercise") a
, concatMap (schemaTypeToXML "trigger") b
])
) $ fxDigitalOption_choice10 x
, maybe [] (schemaTypeToXML "exerciseProcedure") $ fxDigitalOption_exerciseProcedure x
, maybe [] (schemaTypeToXML "payout") $ fxDigitalOption_payout x
, concatMap (schemaTypeToXML "premium") $ fxDigitalOption_premium x
]
instance Extension FxDigitalOption Option where
supertype v = Option_FxDigitalOption v
instance Extension FxDigitalOption Product where
supertype = (supertype :: Option -> Product)
. (supertype :: FxDigitalOption -> Option)
data FxEuropeanExercise = FxEuropeanExercise
{ fxEuropExerc_ID :: Maybe Xsd.ID
, fxEuropExerc_expiryDate :: Maybe Xsd.Date
, fxEuropExerc_expiryTime :: Maybe BusinessCenterTime
, fxEuropExerc_cutName :: Maybe CutName
, fxEuropExerc_valueDate :: Maybe Xsd.Date
}
deriving (Eq,Show)
instance SchemaType FxEuropeanExercise where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FxEuropeanExercise a0)
`apply` optional (parseSchemaType "expiryDate")
`apply` optional (parseSchemaType "expiryTime")
`apply` optional (parseSchemaType "cutName")
`apply` optional (parseSchemaType "valueDate")
schemaTypeToXML s x@FxEuropeanExercise{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxEuropExerc_ID x
]
[ maybe [] (schemaTypeToXML "expiryDate") $ fxEuropExerc_expiryDate x
, maybe [] (schemaTypeToXML "expiryTime") $ fxEuropExerc_expiryTime x
, maybe [] (schemaTypeToXML "cutName") $ fxEuropExerc_cutName x
, maybe [] (schemaTypeToXML "valueDate") $ fxEuropExerc_valueDate x
]
instance Extension FxEuropeanExercise Exercise where
supertype v = Exercise_FxEuropeanExercise v
data FxMultipleExercise = FxMultipleExercise
{ fxMultiExerc_minimumNotionalAmount :: Maybe NonNegativeMoney
, fxMultiExerc_maximumNotionalAmount :: Maybe NonNegativeMoney
}
deriving (Eq,Show)
instance SchemaType FxMultipleExercise where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxMultipleExercise
`apply` optional (parseSchemaType "minimumNotionalAmount")
`apply` optional (parseSchemaType "maximumNotionalAmount")
schemaTypeToXML s x@FxMultipleExercise{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "minimumNotionalAmount") $ fxMultiExerc_minimumNotionalAmount x
, maybe [] (schemaTypeToXML "maximumNotionalAmount") $ fxMultiExerc_maximumNotionalAmount x
]
data FxOption = FxOption
{ fxOption_ID :: Maybe Xsd.ID
, fxOption_primaryAssetClass :: Maybe AssetClass
, fxOption_secondaryAssetClass :: [AssetClass]
, fxOption_productType :: [ProductType]
, fxOption_productId :: [ProductId]
, fxOption_buyerPartyReference :: Maybe PartyReference
, fxOption_buyerAccountReference :: Maybe AccountReference
, fxOption_sellerPartyReference :: Maybe PartyReference
, fxOption_sellerAccountReference :: Maybe AccountReference
, fxOption_effectiveDate :: Maybe AdjustableOrRelativeDate
, fxOption_tenorPeriod :: Maybe Period
, fxOption_choice10 :: OneOf2 FxAmericanExercise FxEuropeanExercise
, fxOption_exerciseProcedure :: Maybe ExerciseProcedure
, fxOption_putCurrencyAmount :: NonNegativeMoney
, fxOption_callCurrencyAmount :: NonNegativeMoney
, fxOption_soldAs :: Maybe PutCallEnum
, fxOption_strike :: FxStrikePrice
, fxOption_spotRate :: Maybe PositiveDecimal
, fxOption_features :: Maybe FxOptionFeatures
, fxOption_premium :: FxOptionPremium
, fxOption_cashSettlement :: Maybe FxCashSettlement
}
deriving (Eq,Show)
instance SchemaType FxOption where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FxOption a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "buyerPartyReference")
`apply` optional (parseSchemaType "buyerAccountReference")
`apply` optional (parseSchemaType "sellerPartyReference")
`apply` optional (parseSchemaType "sellerAccountReference")
`apply` optional (parseSchemaType "effectiveDate")
`apply` optional (parseSchemaType "tenorPeriod")
`apply` oneOf' [ ("FxAmericanExercise", fmap OneOf2 (parseSchemaType "americanExercise"))
, ("FxEuropeanExercise", fmap TwoOf2 (parseSchemaType "europeanExercise"))
]
`apply` optional (parseSchemaType "exerciseProcedure")
`apply` parseSchemaType "putCurrencyAmount"
`apply` parseSchemaType "callCurrencyAmount"
`apply` optional (parseSchemaType "soldAs")
`apply` parseSchemaType "strike"
`apply` optional (parseSchemaType "spotRate")
`apply` optional (parseSchemaType "features")
`apply` parseSchemaType "premium"
`apply` optional (parseSchemaType "cashSettlement")
schemaTypeToXML s x@FxOption{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxOption_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ fxOption_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ fxOption_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ fxOption_productType x
, concatMap (schemaTypeToXML "productId") $ fxOption_productId x
, maybe [] (schemaTypeToXML "buyerPartyReference") $ fxOption_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ fxOption_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ fxOption_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ fxOption_sellerAccountReference x
, maybe [] (schemaTypeToXML "effectiveDate") $ fxOption_effectiveDate x
, maybe [] (schemaTypeToXML "tenorPeriod") $ fxOption_tenorPeriod x
, foldOneOf2 (schemaTypeToXML "americanExercise")
(schemaTypeToXML "europeanExercise")
$ fxOption_choice10 x
, maybe [] (schemaTypeToXML "exerciseProcedure") $ fxOption_exerciseProcedure x
, schemaTypeToXML "putCurrencyAmount" $ fxOption_putCurrencyAmount x
, schemaTypeToXML "callCurrencyAmount" $ fxOption_callCurrencyAmount x
, maybe [] (schemaTypeToXML "soldAs") $ fxOption_soldAs x
, schemaTypeToXML "strike" $ fxOption_strike x
, maybe [] (schemaTypeToXML "spotRate") $ fxOption_spotRate x
, maybe [] (schemaTypeToXML "features") $ fxOption_features x
, schemaTypeToXML "premium" $ fxOption_premium x
, maybe [] (schemaTypeToXML "cashSettlement") $ fxOption_cashSettlement x
]
instance Extension FxOption Option where
supertype v = Option_FxOption v
instance Extension FxOption Product where
supertype = (supertype :: Option -> Product)
. (supertype :: FxOption -> Option)
data FxOptionFeatures = FxOptionFeatures
{ fxOptionFeatur_choice0 :: OneOf2 (FxAsianFeature,[FxBarrierFeature]) [FxBarrierFeature]
}
deriving (Eq,Show)
instance SchemaType FxOptionFeatures where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxOptionFeatures
`apply` oneOf' [ ("FxAsianFeature [FxBarrierFeature]", fmap OneOf2 (return (,) `apply` parseSchemaType "asian"
`apply` many (parseSchemaType "barrier")))
, ("[FxBarrierFeature]", fmap TwoOf2 (many1 (parseSchemaType "barrier")))
]
schemaTypeToXML s x@FxOptionFeatures{} =
toXMLElement s []
[ foldOneOf2 (\ (a,b) -> concat [ schemaTypeToXML "asian" a
, concatMap (schemaTypeToXML "barrier") b
])
(concatMap (schemaTypeToXML "barrier"))
$ fxOptionFeatur_choice0 x
]
data FxOptionPayout = FxOptionPayout
{ fxOptionPayout_ID :: Maybe Xsd.ID
, fxOptionPayout_currency :: Currency
, fxOptionPayout_amount :: NonNegativeDecimal
, fxOptionPayout_payoutStyle :: Maybe PayoutEnum
, fxOptionPayout_settlementInformation :: Maybe SettlementInformation
}
deriving (Eq,Show)
instance SchemaType FxOptionPayout where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FxOptionPayout a0)
`apply` parseSchemaType "currency"
`apply` parseSchemaType "amount"
`apply` optional (parseSchemaType "payoutStyle")
`apply` optional (parseSchemaType "settlementInformation")
schemaTypeToXML s x@FxOptionPayout{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxOptionPayout_ID x
]
[ schemaTypeToXML "currency" $ fxOptionPayout_currency x
, schemaTypeToXML "amount" $ fxOptionPayout_amount x
, maybe [] (schemaTypeToXML "payoutStyle") $ fxOptionPayout_payoutStyle x
, maybe [] (schemaTypeToXML "settlementInformation") $ fxOptionPayout_settlementInformation x
]
instance Extension FxOptionPayout NonNegativeMoney where
supertype (FxOptionPayout a0 e0 e1 e2 e3) =
NonNegativeMoney a0 e0 e1
instance Extension FxOptionPayout MoneyBase where
supertype = (supertype :: NonNegativeMoney -> MoneyBase)
. (supertype :: FxOptionPayout -> NonNegativeMoney)
data FxOptionPremium = FxOptionPremium
{ fxOptionPremium_ID :: Maybe Xsd.ID
, fxOptionPremium_payerPartyReference :: Maybe PartyReference
, fxOptionPremium_payerAccountReference :: Maybe AccountReference
, fxOptionPremium_receiverPartyReference :: Maybe PartyReference
, fxOptionPremium_receiverAccountReference :: Maybe AccountReference
, fxOptionPremium_paymentDate :: Maybe AdjustableOrRelativeDate
, fxOptionPremium_paymentAmount :: Maybe NonNegativeMoney
, fxOptionPremium_settlementInformation :: Maybe SettlementInformation
, fxOptionPremium_quote :: Maybe PremiumQuote
}
deriving (Eq,Show)
instance SchemaType FxOptionPremium where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FxOptionPremium a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` optional (parseSchemaType "paymentDate")
`apply` optional (parseSchemaType "paymentAmount")
`apply` optional (parseSchemaType "settlementInformation")
`apply` optional (parseSchemaType "quote")
schemaTypeToXML s x@FxOptionPremium{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxOptionPremium_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ fxOptionPremium_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ fxOptionPremium_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ fxOptionPremium_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ fxOptionPremium_receiverAccountReference x
, maybe [] (schemaTypeToXML "paymentDate") $ fxOptionPremium_paymentDate x
, maybe [] (schemaTypeToXML "paymentAmount") $ fxOptionPremium_paymentAmount x
, maybe [] (schemaTypeToXML "settlementInformation") $ fxOptionPremium_settlementInformation x
, maybe [] (schemaTypeToXML "quote") $ fxOptionPremium_quote x
]
instance Extension FxOptionPremium NonNegativePayment where
supertype (FxOptionPremium a0 e0 e1 e2 e3 e4 e5 e6 e7) =
NonNegativePayment a0 e0 e1 e2 e3 e4 e5
instance Extension FxOptionPremium PaymentBaseExtended where
supertype = (supertype :: NonNegativePayment -> PaymentBaseExtended)
. (supertype :: FxOptionPremium -> NonNegativePayment)
instance Extension FxOptionPremium PaymentBase where
supertype = (supertype :: PaymentBaseExtended -> PaymentBase)
. (supertype :: NonNegativePayment -> PaymentBaseExtended)
. (supertype :: FxOptionPremium -> NonNegativePayment)
data FxSingleLeg = FxSingleLeg
{ fxSingleLeg_ID :: Maybe Xsd.ID
, fxSingleLeg_primaryAssetClass :: Maybe AssetClass
, fxSingleLeg_secondaryAssetClass :: [AssetClass]
, fxSingleLeg_productType :: [ProductType]
, fxSingleLeg_productId :: [ProductId]
, fxSingleLeg_exchangedCurrency1 :: Payment
, fxSingleLeg_exchangedCurrency2 :: Payment
, fxSingleLeg_dealtCurrency :: Maybe DealtCurrencyEnum
, fxSingleLeg_choice7 :: (Maybe (OneOf2 FxTenorPeriodEnum Period))
, fxSingleLeg_choice8 :: OneOf2 Xsd.Date (Xsd.Date,Xsd.Date)
, fxSingleLeg_exchangeRate :: ExchangeRate
, fxSingleLeg_nonDeliverableSettlement :: Maybe FxCashSettlement
}
deriving (Eq,Show)
instance SchemaType FxSingleLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FxSingleLeg a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` parseSchemaType "exchangedCurrency1"
`apply` parseSchemaType "exchangedCurrency2"
`apply` optional (parseSchemaType "dealtCurrency")
`apply` optional (oneOf' [ ("FxTenorPeriodEnum", fmap OneOf2 (parseSchemaType "tenorName"))
, ("Period", fmap TwoOf2 (parseSchemaType "tenorPeriod"))
])
`apply` oneOf' [ ("Xsd.Date", fmap OneOf2 (parseSchemaType "valueDate"))
, ("Xsd.Date Xsd.Date", fmap TwoOf2 (return (,) `apply` parseSchemaType "currency1ValueDate"
`apply` parseSchemaType "currency2ValueDate"))
]
`apply` parseSchemaType "exchangeRate"
`apply` optional (parseSchemaType "nonDeliverableSettlement")
schemaTypeToXML s x@FxSingleLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxSingleLeg_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ fxSingleLeg_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ fxSingleLeg_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ fxSingleLeg_productType x
, concatMap (schemaTypeToXML "productId") $ fxSingleLeg_productId x
, schemaTypeToXML "exchangedCurrency1" $ fxSingleLeg_exchangedCurrency1 x
, schemaTypeToXML "exchangedCurrency2" $ fxSingleLeg_exchangedCurrency2 x
, maybe [] (schemaTypeToXML "dealtCurrency") $ fxSingleLeg_dealtCurrency x
, maybe [] (foldOneOf2 (schemaTypeToXML "tenorName")
(schemaTypeToXML "tenorPeriod")
) $ fxSingleLeg_choice7 x
, foldOneOf2 (schemaTypeToXML "valueDate")
(\ (a,b) -> concat [ schemaTypeToXML "currency1ValueDate" a
, schemaTypeToXML "currency2ValueDate" b
])
$ fxSingleLeg_choice8 x
, schemaTypeToXML "exchangeRate" $ fxSingleLeg_exchangeRate x
, maybe [] (schemaTypeToXML "nonDeliverableSettlement") $ fxSingleLeg_nonDeliverableSettlement x
]
instance Extension FxSingleLeg Product where
supertype v = Product_FxSingleLeg v
data FxStrikePrice = FxStrikePrice
{ fxStrikePrice_rate :: Maybe PositiveDecimal
, fxStrikePrice_strikeQuoteBasis :: Maybe StrikeQuoteBasisEnum
}
deriving (Eq,Show)
instance SchemaType FxStrikePrice where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxStrikePrice
`apply` optional (parseSchemaType "rate")
`apply` optional (parseSchemaType "strikeQuoteBasis")
schemaTypeToXML s x@FxStrikePrice{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "rate") $ fxStrikePrice_rate x
, maybe [] (schemaTypeToXML "strikeQuoteBasis") $ fxStrikePrice_strikeQuoteBasis x
]
data FxSwap = FxSwap
{ fxSwap_ID :: Maybe Xsd.ID
, fxSwap_primaryAssetClass :: Maybe AssetClass
, fxSwap_secondaryAssetClass :: [AssetClass]
, fxSwap_productType :: [ProductType]
, fxSwap_productId :: [ProductId]
, fxSwap_nearLeg :: FxSwapLeg
, fxSwap_farLeg :: FxSwapLeg
}
deriving (Eq,Show)
instance SchemaType FxSwap where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FxSwap a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` parseSchemaType "nearLeg"
`apply` parseSchemaType "farLeg"
schemaTypeToXML s x@FxSwap{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxSwap_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ fxSwap_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ fxSwap_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ fxSwap_productType x
, concatMap (schemaTypeToXML "productId") $ fxSwap_productId x
, schemaTypeToXML "nearLeg" $ fxSwap_nearLeg x
, schemaTypeToXML "farLeg" $ fxSwap_farLeg x
]
instance Extension FxSwap Product where
supertype v = Product_FxSwap v
data FxSwapLeg = FxSwapLeg
{ fxSwapLeg_ID :: Maybe Xsd.ID
, fxSwapLeg_exchangedCurrency1 :: Payment
, fxSwapLeg_exchangedCurrency2 :: Payment
, fxSwapLeg_dealtCurrency :: Maybe DealtCurrencyEnum
, fxSwapLeg_choice3 :: (Maybe (OneOf2 FxTenorPeriodEnum Period))
, fxSwapLeg_choice4 :: OneOf2 Xsd.Date (Xsd.Date,Xsd.Date)
, fxSwapLeg_exchangeRate :: ExchangeRate
, fxSwapLeg_nonDeliverableSettlement :: Maybe FxCashSettlement
}
deriving (Eq,Show)
instance SchemaType FxSwapLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FxSwapLeg a0)
`apply` parseSchemaType "exchangedCurrency1"
`apply` parseSchemaType "exchangedCurrency2"
`apply` optional (parseSchemaType "dealtCurrency")
`apply` optional (oneOf' [ ("FxTenorPeriodEnum", fmap OneOf2 (parseSchemaType "tenorName"))
, ("Period", fmap TwoOf2 (parseSchemaType "tenorPeriod"))
])
`apply` oneOf' [ ("Xsd.Date", fmap OneOf2 (parseSchemaType "valueDate"))
, ("Xsd.Date Xsd.Date", fmap TwoOf2 (return (,) `apply` parseSchemaType "currency1ValueDate"
`apply` parseSchemaType "currency2ValueDate"))
]
`apply` parseSchemaType "exchangeRate"
`apply` optional (parseSchemaType "nonDeliverableSettlement")
schemaTypeToXML s x@FxSwapLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fxSwapLeg_ID x
]
[ schemaTypeToXML "exchangedCurrency1" $ fxSwapLeg_exchangedCurrency1 x
, schemaTypeToXML "exchangedCurrency2" $ fxSwapLeg_exchangedCurrency2 x
, maybe [] (schemaTypeToXML "dealtCurrency") $ fxSwapLeg_dealtCurrency x
, maybe [] (foldOneOf2 (schemaTypeToXML "tenorName")
(schemaTypeToXML "tenorPeriod")
) $ fxSwapLeg_choice3 x
, foldOneOf2 (schemaTypeToXML "valueDate")
(\ (a,b) -> concat [ schemaTypeToXML "currency1ValueDate" a
, schemaTypeToXML "currency2ValueDate" b
])
$ fxSwapLeg_choice4 x
, schemaTypeToXML "exchangeRate" $ fxSwapLeg_exchangeRate x
, maybe [] (schemaTypeToXML "nonDeliverableSettlement") $ fxSwapLeg_nonDeliverableSettlement x
]
instance Extension FxSwapLeg Leg where
supertype v = Leg_FxSwapLeg v
data FxTouch = FxTouch
{ fxTouch_touchCondition :: Maybe TouchConditionEnum
, fxTouch_quotedCurrencyPair :: Maybe QuotedCurrencyPair
, fxTouch_triggerRate :: Maybe PositiveDecimal
, fxTouch_spotRate :: Maybe PositiveDecimal
, fxTouch_informationSource :: [InformationSource]
, fxTouch_observationStartDate :: Maybe Xsd.Date
, fxTouch_observationEndDate :: Maybe Xsd.Date
}
deriving (Eq,Show)
instance SchemaType FxTouch where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxTouch
`apply` optional (parseSchemaType "touchCondition")
`apply` optional (parseSchemaType "quotedCurrencyPair")
`apply` optional (parseSchemaType "triggerRate")
`apply` optional (parseSchemaType "spotRate")
`apply` many (parseSchemaType "informationSource")
`apply` optional (parseSchemaType "observationStartDate")
`apply` optional (parseSchemaType "observationEndDate")
schemaTypeToXML s x@FxTouch{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "touchCondition") $ fxTouch_touchCondition x
, maybe [] (schemaTypeToXML "quotedCurrencyPair") $ fxTouch_quotedCurrencyPair x
, maybe [] (schemaTypeToXML "triggerRate") $ fxTouch_triggerRate x
, maybe [] (schemaTypeToXML "spotRate") $ fxTouch_spotRate x
, concatMap (schemaTypeToXML "informationSource") $ fxTouch_informationSource x
, maybe [] (schemaTypeToXML "observationStartDate") $ fxTouch_observationStartDate x
, maybe [] (schemaTypeToXML "observationEndDate") $ fxTouch_observationEndDate x
]
data FxTrigger = FxTrigger
{ fxTrigger_triggerCondition :: Maybe TriggerConditionEnum
, fxTrigger_quotedCurrencyPair :: Maybe QuotedCurrencyPair
, fxTrigger_triggerRate :: Maybe PositiveDecimal
, fxTrigger_spotRate :: Maybe PositiveDecimal
, fxTrigger_informationSource :: [InformationSource]
}
deriving (Eq,Show)
instance SchemaType FxTrigger where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return FxTrigger
`apply` optional (parseSchemaType "triggerCondition")
`apply` optional (parseSchemaType "quotedCurrencyPair")
`apply` optional (parseSchemaType "triggerRate")
`apply` optional (parseSchemaType "spotRate")
`apply` many (parseSchemaType "informationSource")
schemaTypeToXML s x@FxTrigger{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "triggerCondition") $ fxTrigger_triggerCondition x
, maybe [] (schemaTypeToXML "quotedCurrencyPair") $ fxTrigger_quotedCurrencyPair x
, maybe [] (schemaTypeToXML "triggerRate") $ fxTrigger_triggerRate x
, maybe [] (schemaTypeToXML "spotRate") $ fxTrigger_spotRate x
, concatMap (schemaTypeToXML "informationSource") $ fxTrigger_informationSource x
]
data LowerBound = LowerBound
{ lowerBound_choice0 :: (Maybe (OneOf2 PositiveDecimal PositiveDecimal))
}
deriving (Eq,Show)
instance SchemaType LowerBound where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return LowerBound
`apply` optional (oneOf' [ ("PositiveDecimal", fmap OneOf2 (parseSchemaType "minimumInclusive"))
, ("PositiveDecimal", fmap TwoOf2 (parseSchemaType "minimumExclusive"))
])
schemaTypeToXML s x@LowerBound{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "minimumInclusive")
(schemaTypeToXML "minimumExclusive")
) $ lowerBound_choice0 x
]
data MoneyReference = MoneyReference
{ moneyRef_href :: Maybe Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType MoneyReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "href" e pos
commit $ interior e $ return (MoneyReference a0)
schemaTypeToXML s x@MoneyReference{} =
toXMLElement s [ maybe [] (toXMLAttribute "href") $ moneyRef_href x
]
[]
instance Extension MoneyReference Reference where
supertype v = Reference_MoneyReference v
data ObservationSchedule = ObservationSchedule
{ observSched_startDate :: Maybe Xsd.Date
, observSched_endDate :: Maybe Xsd.Date
, observSched_observationPeriodFrequency :: Maybe Frequency
}
deriving (Eq,Show)
instance SchemaType ObservationSchedule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ObservationSchedule
`apply` optional (parseSchemaType "startDate")
`apply` optional (parseSchemaType "endDate")
`apply` optional (parseSchemaType "observationPeriodFrequency")
schemaTypeToXML s x@ObservationSchedule{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "startDate") $ observSched_startDate x
, maybe [] (schemaTypeToXML "endDate") $ observSched_endDate x
, maybe [] (schemaTypeToXML "observationPeriodFrequency") $ observSched_observationPeriodFrequency x
]
data PremiumQuote = PremiumQuote
{ premiumQuote_value :: Maybe Xsd.Decimal
, premiumQuote_quoteBasis :: Maybe PremiumQuoteBasisEnum
}
deriving (Eq,Show)
instance SchemaType PremiumQuote where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return PremiumQuote
`apply` optional (parseSchemaType "value")
`apply` optional (parseSchemaType "quoteBasis")
schemaTypeToXML s x@PremiumQuote{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "value") $ premiumQuote_value x
, maybe [] (schemaTypeToXML "quoteBasis") $ premiumQuote_quoteBasis x
]
data TermDeposit = TermDeposit
{ termDeposit_ID :: Maybe Xsd.ID
, termDeposit_primaryAssetClass :: Maybe AssetClass
, termDeposit_secondaryAssetClass :: [AssetClass]
, termDeposit_productType :: [ProductType]
, termDeposit_productId :: [ProductId]
, termDeposit_payerPartyReference :: Maybe PartyReference
, termDeposit_payerAccountReference :: Maybe AccountReference
, termDeposit_receiverPartyReference :: Maybe PartyReference
, termDeposit_receiverAccountReference :: Maybe AccountReference
, termDeposit_startDate :: Maybe Xsd.Date
, termDeposit_maturityDate :: Maybe Xsd.Date
, termDeposit_choice10 :: (Maybe (OneOf2 FxTenorPeriodEnum Period))
, termDeposit_principal :: Maybe PositiveMoney
, termDeposit_fixedRate :: Maybe PositiveDecimal
, termDeposit_dayCountFraction :: Maybe DayCountFraction
, termDeposit_features :: Maybe TermDepositFeatures
, termDeposit_interest :: Maybe Money
, termDeposit_payment :: [Payment]
}
deriving (Eq,Show)
instance SchemaType TermDeposit where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (TermDeposit a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` optional (parseSchemaType "startDate")
`apply` optional (parseSchemaType "maturityDate")
`apply` optional (oneOf' [ ("FxTenorPeriodEnum", fmap OneOf2 (parseSchemaType "tenorName"))
, ("Period", fmap TwoOf2 (parseSchemaType "tenorPeriod"))
])
`apply` optional (parseSchemaType "principal")
`apply` optional (parseSchemaType "fixedRate")
`apply` optional (parseSchemaType "dayCountFraction")
`apply` optional (parseSchemaType "features")
`apply` optional (parseSchemaType "interest")
`apply` many (parseSchemaType "payment")
schemaTypeToXML s x@TermDeposit{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ termDeposit_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ termDeposit_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ termDeposit_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ termDeposit_productType x
, concatMap (schemaTypeToXML "productId") $ termDeposit_productId x
, maybe [] (schemaTypeToXML "payerPartyReference") $ termDeposit_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ termDeposit_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ termDeposit_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ termDeposit_receiverAccountReference x
, maybe [] (schemaTypeToXML "startDate") $ termDeposit_startDate x
, maybe [] (schemaTypeToXML "maturityDate") $ termDeposit_maturityDate x
, maybe [] (foldOneOf2 (schemaTypeToXML "tenorName")
(schemaTypeToXML "tenorPeriod")
) $ termDeposit_choice10 x
, maybe [] (schemaTypeToXML "principal") $ termDeposit_principal x
, maybe [] (schemaTypeToXML "fixedRate") $ termDeposit_fixedRate x
, maybe [] (schemaTypeToXML "dayCountFraction") $ termDeposit_dayCountFraction x
, maybe [] (schemaTypeToXML "features") $ termDeposit_features x
, maybe [] (schemaTypeToXML "interest") $ termDeposit_interest x
, concatMap (schemaTypeToXML "payment") $ termDeposit_payment x
]
instance Extension TermDeposit Product where
supertype v = Product_TermDeposit v
data TermDepositFeatures = TermDepositFeatures
{ termDepositFeatur_dualCurrency :: Maybe DualCurrencyFeature
}
deriving (Eq,Show)
instance SchemaType TermDepositFeatures where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return TermDepositFeatures
`apply` optional (parseSchemaType "dualCurrency")
schemaTypeToXML s x@TermDepositFeatures{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "dualCurrency") $ termDepositFeatur_dualCurrency x
]
data UpperBound = UpperBound
{ upperBound_choice0 :: (Maybe (OneOf2 PositiveDecimal PositiveDecimal))
}
deriving (Eq,Show)
instance SchemaType UpperBound where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return UpperBound
`apply` optional (oneOf' [ ("PositiveDecimal", fmap OneOf2 (parseSchemaType "maximumInclusive"))
, ("PositiveDecimal", fmap TwoOf2 (parseSchemaType "maximumExclusive"))
])
schemaTypeToXML s x@UpperBound{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "maximumInclusive")
(schemaTypeToXML "maximumExclusive")
) $ upperBound_choice0 x
]
elementFxSingleLeg :: XMLParser FxSingleLeg
elementFxSingleLeg = parseSchemaType "fxSingleLeg"
elementToXMLFxSingleLeg :: FxSingleLeg -> [Content ()]
elementToXMLFxSingleLeg = schemaTypeToXML "fxSingleLeg"
elementFxSwap :: XMLParser FxSwap
elementFxSwap = parseSchemaType "fxSwap"
elementToXMLFxSwap :: FxSwap -> [Content ()]
elementToXMLFxSwap = schemaTypeToXML "fxSwap"
elementFxOption :: XMLParser FxOption
elementFxOption = parseSchemaType "fxOption"
elementToXMLFxOption :: FxOption -> [Content ()]
elementToXMLFxOption = schemaTypeToXML "fxOption"
elementFxDigitalOption :: XMLParser FxDigitalOption
elementFxDigitalOption = parseSchemaType "fxDigitalOption"
elementToXMLFxDigitalOption :: FxDigitalOption -> [Content ()]
elementToXMLFxDigitalOption = schemaTypeToXML "fxDigitalOption"
elementTermDeposit :: XMLParser TermDeposit
elementTermDeposit = parseSchemaType "termDeposit"
elementToXMLTermDeposit :: TermDeposit -> [Content ()]
elementToXMLTermDeposit = schemaTypeToXML "termDeposit"