module Data.FpML.V53.Swaps.Variance
( module Data.FpML.V53.Swaps.Variance
, module Data.FpML.V53.Eqd
) 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.Eqd
data VarianceAmount = VarianceAmount
{ varianAmount_calculationDates :: Maybe AdjustableRelativeOrPeriodicDates
, varianAmount_observationStartDate :: Maybe AdjustableOrRelativeDate
, varianAmount_optionsExchangeDividends :: Maybe Xsd.Boolean
, varianAmount_additionalDividends :: Maybe Xsd.Boolean
, varianAmount_allDividends :: Maybe Xsd.Boolean
, varianAmount_variance :: Maybe Variance
}
deriving (Eq,Show)
instance SchemaType VarianceAmount where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return VarianceAmount
`apply` optional (parseSchemaType "calculationDates")
`apply` optional (parseSchemaType "observationStartDate")
`apply` optional (parseSchemaType "optionsExchangeDividends")
`apply` optional (parseSchemaType "additionalDividends")
`apply` optional (parseSchemaType "allDividends")
`apply` optional (parseSchemaType "variance")
schemaTypeToXML s x@VarianceAmount{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "calculationDates") $ varianAmount_calculationDates x
, maybe [] (schemaTypeToXML "observationStartDate") $ varianAmount_observationStartDate x
, maybe [] (schemaTypeToXML "optionsExchangeDividends") $ varianAmount_optionsExchangeDividends x
, maybe [] (schemaTypeToXML "additionalDividends") $ varianAmount_additionalDividends x
, maybe [] (schemaTypeToXML "allDividends") $ varianAmount_allDividends x
, maybe [] (schemaTypeToXML "variance") $ varianAmount_variance x
]
instance Extension VarianceAmount CalculatedAmount where
supertype v = CalculatedAmount_VarianceAmount v
data VarianceLeg = VarianceLeg
{ varianceLeg_ID :: Maybe Xsd.ID
, varianceLeg_legIdentifier :: [LegIdentifier]
, varianceLeg_payerPartyReference :: Maybe PartyReference
, varianceLeg_payerAccountReference :: Maybe AccountReference
, varianceLeg_receiverPartyReference :: Maybe PartyReference
, varianceLeg_receiverAccountReference :: Maybe AccountReference
, varianceLeg_effectiveDate :: Maybe AdjustableOrRelativeDate
, varianceLeg_terminationDate :: Maybe AdjustableOrRelativeDate
, varianceLeg_underlyer :: Maybe Underlyer
, varianceLeg_settlementType :: Maybe SettlementTypeEnum
, varianceLeg_settlementDate :: Maybe AdjustableOrRelativeDate
, varianceLeg_choice10 :: (Maybe (OneOf2 Money Currency))
, varianceLeg_fxFeature :: Maybe FxFeature
, varianceLeg_valuation :: Maybe EquityValuation
, varianceLeg_amount :: Maybe VarianceAmount
}
deriving (Eq,Show)
instance SchemaType VarianceLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (VarianceLeg a0)
`apply` many (parseSchemaType "legIdentifier")
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` optional (parseSchemaType "effectiveDate")
`apply` optional (parseSchemaType "terminationDate")
`apply` optional (parseSchemaType "underlyer")
`apply` optional (parseSchemaType "settlementType")
`apply` optional (parseSchemaType "settlementDate")
`apply` optional (oneOf' [ ("Money", fmap OneOf2 (parseSchemaType "settlementAmount"))
, ("Currency", fmap TwoOf2 (parseSchemaType "settlementCurrency"))
])
`apply` optional (parseSchemaType "fxFeature")
`apply` optional (parseSchemaType "valuation")
`apply` optional (parseSchemaType "amount")
schemaTypeToXML s x@VarianceLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ varianceLeg_ID x
]
[ concatMap (schemaTypeToXML "legIdentifier") $ varianceLeg_legIdentifier x
, maybe [] (schemaTypeToXML "payerPartyReference") $ varianceLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ varianceLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ varianceLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ varianceLeg_receiverAccountReference x
, maybe [] (schemaTypeToXML "effectiveDate") $ varianceLeg_effectiveDate x
, maybe [] (schemaTypeToXML "terminationDate") $ varianceLeg_terminationDate x
, maybe [] (schemaTypeToXML "underlyer") $ varianceLeg_underlyer x
, maybe [] (schemaTypeToXML "settlementType") $ varianceLeg_settlementType x
, maybe [] (schemaTypeToXML "settlementDate") $ varianceLeg_settlementDate x
, maybe [] (foldOneOf2 (schemaTypeToXML "settlementAmount")
(schemaTypeToXML "settlementCurrency")
) $ varianceLeg_choice10 x
, maybe [] (schemaTypeToXML "fxFeature") $ varianceLeg_fxFeature x
, maybe [] (schemaTypeToXML "valuation") $ varianceLeg_valuation x
, maybe [] (schemaTypeToXML "amount") $ varianceLeg_amount x
]
instance Extension VarianceLeg DirectionalLegUnderlyerValuation where
supertype v = DirectionalLegUnderlyerValuation_VarianceLeg v
instance Extension VarianceLeg DirectionalLegUnderlyer where
supertype = (supertype :: DirectionalLegUnderlyerValuation -> DirectionalLegUnderlyer)
. (supertype :: VarianceLeg -> DirectionalLegUnderlyerValuation)
instance Extension VarianceLeg DirectionalLeg where
supertype = (supertype :: DirectionalLegUnderlyer -> DirectionalLeg)
. (supertype :: DirectionalLegUnderlyerValuation -> DirectionalLegUnderlyer)
. (supertype :: VarianceLeg -> DirectionalLegUnderlyerValuation)
instance Extension VarianceLeg Leg where
supertype = (supertype :: DirectionalLeg -> Leg)
. (supertype :: DirectionalLegUnderlyer -> DirectionalLeg)
. (supertype :: DirectionalLegUnderlyerValuation -> DirectionalLegUnderlyer)
. (supertype :: VarianceLeg -> DirectionalLegUnderlyerValuation)
data VarianceOptionTransactionSupplement = VarianceOptionTransactionSupplement
{ vots_ID :: Maybe Xsd.ID
, vots_primaryAssetClass :: Maybe AssetClass
, vots_secondaryAssetClass :: [AssetClass]
, vots_productType :: [ProductType]
, vots_productId :: [ProductId]
, vots_buyerPartyReference :: Maybe PartyReference
, vots_buyerAccountReference :: Maybe AccountReference
, vots_sellerPartyReference :: Maybe PartyReference
, vots_sellerAccountReference :: Maybe AccountReference
, vots_optionType :: OptionTypeEnum
, vots_equityPremium :: Maybe EquityPremium
, vots_equityExercise :: Maybe EquityExerciseValuationSettlement
, vots_exchangeLookAlike :: Maybe Xsd.Boolean
, vots_methodOfAdjustment :: Maybe MethodOfAdjustmentEnum
, vots_choice13 :: (Maybe (OneOf2 PositiveDecimal PositiveDecimal))
, vots_varianceSwapTransactionSupplement :: VarianceSwapTransactionSupplement
}
deriving (Eq,Show)
instance SchemaType VarianceOptionTransactionSupplement where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (VarianceOptionTransactionSupplement a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "buyerPartyReference")
`apply` optional (parseSchemaType "buyerAccountReference")
`apply` optional (parseSchemaType "sellerPartyReference")
`apply` optional (parseSchemaType "sellerAccountReference")
`apply` parseSchemaType "optionType"
`apply` optional (parseSchemaType "equityPremium")
`apply` optional (parseSchemaType "equityExercise")
`apply` optional (parseSchemaType "exchangeLookAlike")
`apply` optional (parseSchemaType "methodOfAdjustment")
`apply` optional (oneOf' [ ("PositiveDecimal", fmap OneOf2 (parseSchemaType "optionEntitlement"))
, ("PositiveDecimal", fmap TwoOf2 (parseSchemaType "multiplier"))
])
`apply` parseSchemaType "varianceSwapTransactionSupplement"
schemaTypeToXML s x@VarianceOptionTransactionSupplement{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ vots_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ vots_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ vots_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ vots_productType x
, concatMap (schemaTypeToXML "productId") $ vots_productId x
, maybe [] (schemaTypeToXML "buyerPartyReference") $ vots_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ vots_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ vots_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ vots_sellerAccountReference x
, schemaTypeToXML "optionType" $ vots_optionType x
, maybe [] (schemaTypeToXML "equityPremium") $ vots_equityPremium x
, maybe [] (schemaTypeToXML "equityExercise") $ vots_equityExercise x
, maybe [] (schemaTypeToXML "exchangeLookAlike") $ vots_exchangeLookAlike x
, maybe [] (schemaTypeToXML "methodOfAdjustment") $ vots_methodOfAdjustment x
, maybe [] (foldOneOf2 (schemaTypeToXML "optionEntitlement")
(schemaTypeToXML "multiplier")
) $ vots_choice13 x
, schemaTypeToXML "varianceSwapTransactionSupplement" $ vots_varianceSwapTransactionSupplement x
]
instance Extension VarianceOptionTransactionSupplement OptionBase where
supertype v = OptionBase_VarianceOptionTransactionSupplement v
instance Extension VarianceOptionTransactionSupplement Option where
supertype = (supertype :: OptionBase -> Option)
. (supertype :: VarianceOptionTransactionSupplement -> OptionBase)
instance Extension VarianceOptionTransactionSupplement Product where
supertype = (supertype :: Option -> Product)
. (supertype :: OptionBase -> Option)
. (supertype :: VarianceOptionTransactionSupplement -> OptionBase)
data VarianceSwap = VarianceSwap
{ varianceSwap_ID :: Maybe Xsd.ID
, varianceSwap_primaryAssetClass :: Maybe AssetClass
, varianceSwap_secondaryAssetClass :: [AssetClass]
, varianceSwap_productType :: [ProductType]
, varianceSwap_productId :: [ProductId]
, varianceSwap_additionalPayment :: [ClassifiedPayment]
, varianceSwap_extraordinaryEvents :: Maybe ExtraordinaryEvents
, varianceSwap_varianceLeg :: [VarianceLeg]
}
deriving (Eq,Show)
instance SchemaType VarianceSwap where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (VarianceSwap a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` many (parseSchemaType "additionalPayment")
`apply` optional (parseSchemaType "extraordinaryEvents")
`apply` many (parseSchemaType "varianceLeg")
schemaTypeToXML s x@VarianceSwap{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ varianceSwap_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ varianceSwap_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ varianceSwap_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ varianceSwap_productType x
, concatMap (schemaTypeToXML "productId") $ varianceSwap_productId x
, concatMap (schemaTypeToXML "additionalPayment") $ varianceSwap_additionalPayment x
, maybe [] (schemaTypeToXML "extraordinaryEvents") $ varianceSwap_extraordinaryEvents x
, concatMap (schemaTypeToXML "varianceLeg") $ varianceSwap_varianceLeg x
]
instance Extension VarianceSwap NettedSwapBase where
supertype v = NettedSwapBase_VarianceSwap v
instance Extension VarianceSwap Product where
supertype = (supertype :: NettedSwapBase -> Product)
. (supertype :: VarianceSwap -> NettedSwapBase)
data VarianceSwapTransactionSupplement = VarianceSwapTransactionSupplement
{ varianSwapTransSuppl_ID :: Maybe Xsd.ID
, varianSwapTransSuppl_primaryAssetClass :: Maybe AssetClass
, varianSwapTransSuppl_secondaryAssetClass :: [AssetClass]
, varianSwapTransSuppl_productType :: [ProductType]
, varianSwapTransSuppl_productId :: [ProductId]
, varianSwapTransSuppl_varianceLeg :: [VarianceLeg]
, varianSwapTransSuppl_choice5 :: (Maybe (OneOf2 Xsd.Boolean Xsd.Boolean))
, varianSwapTransSuppl_localJurisdiction :: Maybe CountryCode
, varianSwapTransSuppl_relevantJurisdiction :: Maybe CountryCode
}
deriving (Eq,Show)
instance SchemaType VarianceSwapTransactionSupplement where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (VarianceSwapTransactionSupplement a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` many (parseSchemaType "varianceLeg")
`apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf2 (parseSchemaType "multipleExchangeIndexAnnexFallback"))
, ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "componentSecurityIndexAnnexFallback"))
])
`apply` optional (parseSchemaType "localJurisdiction")
`apply` optional (parseSchemaType "relevantJurisdiction")
schemaTypeToXML s x@VarianceSwapTransactionSupplement{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ varianSwapTransSuppl_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ varianSwapTransSuppl_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ varianSwapTransSuppl_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ varianSwapTransSuppl_productType x
, concatMap (schemaTypeToXML "productId") $ varianSwapTransSuppl_productId x
, concatMap (schemaTypeToXML "varianceLeg") $ varianSwapTransSuppl_varianceLeg x
, maybe [] (foldOneOf2 (schemaTypeToXML "multipleExchangeIndexAnnexFallback")
(schemaTypeToXML "componentSecurityIndexAnnexFallback")
) $ varianSwapTransSuppl_choice5 x
, maybe [] (schemaTypeToXML "localJurisdiction") $ varianSwapTransSuppl_localJurisdiction x
, maybe [] (schemaTypeToXML "relevantJurisdiction") $ varianSwapTransSuppl_relevantJurisdiction x
]
instance Extension VarianceSwapTransactionSupplement Product where
supertype v = Product_VarianceSwapTransactionSupplement v
elementVarianceOptionTransactionSupplement :: XMLParser VarianceOptionTransactionSupplement
elementVarianceOptionTransactionSupplement = parseSchemaType "varianceOptionTransactionSupplement"
elementToXMLVarianceOptionTransactionSupplement :: VarianceOptionTransactionSupplement -> [Content ()]
elementToXMLVarianceOptionTransactionSupplement = schemaTypeToXML "varianceOptionTransactionSupplement"
elementVarianceSwap :: XMLParser VarianceSwap
elementVarianceSwap = parseSchemaType "varianceSwap"
elementToXMLVarianceSwap :: VarianceSwap -> [Content ()]
elementToXMLVarianceSwap = schemaTypeToXML "varianceSwap"
elementVarianceSwapTransactionSupplement :: XMLParser VarianceSwapTransactionSupplement
elementVarianceSwapTransactionSupplement = parseSchemaType "varianceSwapTransactionSupplement"
elementToXMLVarianceSwapTransactionSupplement :: VarianceSwapTransactionSupplement -> [Content ()]
elementToXMLVarianceSwapTransactionSupplement = schemaTypeToXML "varianceSwapTransactionSupplement"