module Data.FpML.V53.Shared.EQ
( module Data.FpML.V53.Shared.EQ
, 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
import Data.FpML.V53.Swaps.Correlation ( CorrelationAmount )
import Data.FpML.V53.Swaps.Variance ( VarianceAmount )
import Data.FpML.V53.Swaps.Dividend ( FixedPaymentLeg )
import Data.FpML.V53.Swaps.Dividend ( DividendLeg )
import Data.FpML.V53.Swaps.Correlation ( CorrelationLeg )
import Data.FpML.V53.Swaps.Variance ( VarianceLeg )
import Data.FpML.V53.Swaps.Dividend ( DividendPeriodPayment )
import Data.FpML.V53.Swaps.Correlation ( CorrelationSwap )
import Data.FpML.V53.Swaps.Variance ( VarianceSwap )
import Data.FpML.V53.Swaps.Return ( EquitySwapTransactionSupplement )
data AdditionalDisruptionEvents = AdditionalDisruptionEvents
{ addDisrupEvents_changeInLaw :: Maybe Xsd.Boolean
, addDisrupEvents_failureToDeliver :: Maybe Xsd.Boolean
, addDisrupEvents_insolvencyFiling :: Maybe Xsd.Boolean
, addDisrupEvents_hedgingDisruption :: Maybe Xsd.Boolean
, addDisrupEvents_lossOfStockBorrow :: Maybe Xsd.Boolean
, addDisrupEvents_maximumStockLoanRate :: Maybe RestrictedPercentage
, addDisrupEvents_increasedCostOfStockBorrow :: Maybe Xsd.Boolean
, addDisrupEvents_initialStockLoanRate :: Maybe RestrictedPercentage
, addDisrupEvents_increasedCostOfHedging :: Maybe Xsd.Boolean
, addDisrupEvents_determiningPartyReference :: Maybe PartyReference
, addDisrupEvents_foreignOwnershipEvent :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType AdditionalDisruptionEvents where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return AdditionalDisruptionEvents
`apply` optional (parseSchemaType "changeInLaw")
`apply` optional (parseSchemaType "failureToDeliver")
`apply` optional (parseSchemaType "insolvencyFiling")
`apply` optional (parseSchemaType "hedgingDisruption")
`apply` optional (parseSchemaType "lossOfStockBorrow")
`apply` optional (parseSchemaType "maximumStockLoanRate")
`apply` optional (parseSchemaType "increasedCostOfStockBorrow")
`apply` optional (parseSchemaType "initialStockLoanRate")
`apply` optional (parseSchemaType "increasedCostOfHedging")
`apply` optional (parseSchemaType "determiningPartyReference")
`apply` optional (parseSchemaType "foreignOwnershipEvent")
schemaTypeToXML s x@AdditionalDisruptionEvents{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "changeInLaw") $ addDisrupEvents_changeInLaw x
, maybe [] (schemaTypeToXML "failureToDeliver") $ addDisrupEvents_failureToDeliver x
, maybe [] (schemaTypeToXML "insolvencyFiling") $ addDisrupEvents_insolvencyFiling x
, maybe [] (schemaTypeToXML "hedgingDisruption") $ addDisrupEvents_hedgingDisruption x
, maybe [] (schemaTypeToXML "lossOfStockBorrow") $ addDisrupEvents_lossOfStockBorrow x
, maybe [] (schemaTypeToXML "maximumStockLoanRate") $ addDisrupEvents_maximumStockLoanRate x
, maybe [] (schemaTypeToXML "increasedCostOfStockBorrow") $ addDisrupEvents_increasedCostOfStockBorrow x
, maybe [] (schemaTypeToXML "initialStockLoanRate") $ addDisrupEvents_initialStockLoanRate x
, maybe [] (schemaTypeToXML "increasedCostOfHedging") $ addDisrupEvents_increasedCostOfHedging x
, maybe [] (schemaTypeToXML "determiningPartyReference") $ addDisrupEvents_determiningPartyReference x
, maybe [] (schemaTypeToXML "foreignOwnershipEvent") $ addDisrupEvents_foreignOwnershipEvent x
]
data AdditionalPaymentAmount = AdditionalPaymentAmount
{ addPaymentAmount_paymentAmount :: Maybe NonNegativeMoney
, addPaymentAmount_formula :: Maybe Formula
}
deriving (Eq,Show)
instance SchemaType AdditionalPaymentAmount where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return AdditionalPaymentAmount
`apply` optional (parseSchemaType "paymentAmount")
`apply` optional (parseSchemaType "formula")
schemaTypeToXML s x@AdditionalPaymentAmount{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "paymentAmount") $ addPaymentAmount_paymentAmount x
, maybe [] (schemaTypeToXML "formula") $ addPaymentAmount_formula x
]
data AdjustableDateOrRelativeDateSequence = AdjustableDateOrRelativeDateSequence
{ adords_ID :: Maybe Xsd.ID
, adords_choice0 :: (Maybe (OneOf2 AdjustableDate RelativeDateSequence))
}
deriving (Eq,Show)
instance SchemaType AdjustableDateOrRelativeDateSequence where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (AdjustableDateOrRelativeDateSequence a0)
`apply` optional (oneOf' [ ("AdjustableDate", fmap OneOf2 (parseSchemaType "adjustableDate"))
, ("RelativeDateSequence", fmap TwoOf2 (parseSchemaType "relativeDateSequence"))
])
schemaTypeToXML s x@AdjustableDateOrRelativeDateSequence{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ adords_ID x
]
[ maybe [] (foldOneOf2 (schemaTypeToXML "adjustableDate")
(schemaTypeToXML "relativeDateSequence")
) $ adords_choice0 x
]
data BoundedCorrelation = BoundedCorrelation
{ boundedCorrel_minimumBoundaryPercent :: Maybe Xsd.Decimal
, boundedCorrel_maximumBoundaryPercent :: Maybe Xsd.Decimal
}
deriving (Eq,Show)
instance SchemaType BoundedCorrelation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return BoundedCorrelation
`apply` optional (parseSchemaType "minimumBoundaryPercent")
`apply` optional (parseSchemaType "maximumBoundaryPercent")
schemaTypeToXML s x@BoundedCorrelation{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "minimumBoundaryPercent") $ boundedCorrel_minimumBoundaryPercent x
, maybe [] (schemaTypeToXML "maximumBoundaryPercent") $ boundedCorrel_maximumBoundaryPercent x
]
data BoundedVariance = BoundedVariance
{ boundedVarian_realisedVarianceMethod :: Maybe RealisedVarianceMethodEnum
, boundedVarian_daysInRangeAdjustment :: Maybe Xsd.Boolean
, boundedVarian_upperBarrier :: Maybe NonNegativeDecimal
, boundedVarian_lowerBarrier :: Maybe NonNegativeDecimal
}
deriving (Eq,Show)
instance SchemaType BoundedVariance where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return BoundedVariance
`apply` optional (parseSchemaType "realisedVarianceMethod")
`apply` optional (parseSchemaType "daysInRangeAdjustment")
`apply` optional (parseSchemaType "upperBarrier")
`apply` optional (parseSchemaType "lowerBarrier")
schemaTypeToXML s x@BoundedVariance{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "realisedVarianceMethod") $ boundedVarian_realisedVarianceMethod x
, maybe [] (schemaTypeToXML "daysInRangeAdjustment") $ boundedVarian_daysInRangeAdjustment x
, maybe [] (schemaTypeToXML "upperBarrier") $ boundedVarian_upperBarrier x
, maybe [] (schemaTypeToXML "lowerBarrier") $ boundedVarian_lowerBarrier x
]
data CalculatedAmount
= CalculatedAmount_CorrelationAmount CorrelationAmount
| CalculatedAmount_VarianceAmount VarianceAmount
deriving (Eq,Show)
instance SchemaType CalculatedAmount where
parseSchemaType s = do
(fmap CalculatedAmount_CorrelationAmount $ parseSchemaType s)
`onFail`
(fmap CalculatedAmount_VarianceAmount $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of CalculatedAmount,\n\
\ namely one of:\n\
\CorrelationAmount,VarianceAmount"
schemaTypeToXML _s (CalculatedAmount_CorrelationAmount x) = schemaTypeToXML "correlationAmount" x
schemaTypeToXML _s (CalculatedAmount_VarianceAmount x) = schemaTypeToXML "varianceAmount" x
data CalculationFromObservation
= CalculationFromObservation_Variance Variance
| CalculationFromObservation_Correlation Correlation
deriving (Eq,Show)
instance SchemaType CalculationFromObservation where
parseSchemaType s = do
(fmap CalculationFromObservation_Variance $ parseSchemaType s)
`onFail`
(fmap CalculationFromObservation_Correlation $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of CalculationFromObservation,\n\
\ namely one of:\n\
\Variance,Correlation"
schemaTypeToXML _s (CalculationFromObservation_Variance x) = schemaTypeToXML "variance" x
schemaTypeToXML _s (CalculationFromObservation_Correlation x) = schemaTypeToXML "correlation" x
data Compounding = Compounding
{ compounding_method :: Maybe CompoundingMethodEnum
, compounding_rate :: Maybe CompoundingRate
, compounding_spread :: Maybe Xsd.Decimal
, compounding_dates :: Maybe AdjustableRelativeOrPeriodicDates2
}
deriving (Eq,Show)
instance SchemaType Compounding where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Compounding
`apply` optional (parseSchemaType "compoundingMethod")
`apply` optional (parseSchemaType "compoundingRate")
`apply` optional (parseSchemaType "compoundingSpread")
`apply` optional (parseSchemaType "compoundingDates")
schemaTypeToXML s x@Compounding{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "compoundingMethod") $ compounding_method x
, maybe [] (schemaTypeToXML "compoundingRate") $ compounding_rate x
, maybe [] (schemaTypeToXML "compoundingSpread") $ compounding_spread x
, maybe [] (schemaTypeToXML "compoundingDates") $ compounding_dates x
]
data CompoundingRate = CompoundingRate
{ compoRate_choice0 :: (Maybe (OneOf2 FloatingRateCalculationReference InterestAccrualsMethod))
}
deriving (Eq,Show)
instance SchemaType CompoundingRate where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CompoundingRate
`apply` optional (oneOf' [ ("FloatingRateCalculationReference", fmap OneOf2 (parseSchemaType "interestLegRate"))
, ("InterestAccrualsMethod", fmap TwoOf2 (parseSchemaType "specificRate"))
])
schemaTypeToXML s x@CompoundingRate{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "interestLegRate")
(schemaTypeToXML "specificRate")
) $ compoRate_choice0 x
]
data Correlation = Correlation
{ correlation_choice0 :: (Maybe (OneOf3 Xsd.Decimal Xsd.Boolean Xsd.Boolean))
, correlation_expectedN :: Maybe Xsd.PositiveInteger
, correlation_notionalAmount :: Maybe NonNegativeMoney
, correlation_strikePrice :: Maybe CorrelationValue
, correlation_boundedCorrelation :: Maybe BoundedCorrelation
, correlation_numberOfDataSeries :: Maybe Xsd.PositiveInteger
}
deriving (Eq,Show)
instance SchemaType Correlation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Correlation
`apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf3 (parseSchemaType "initialLevel"))
, ("Xsd.Boolean", fmap TwoOf3 (parseSchemaType "closingLevel"))
, ("Xsd.Boolean", fmap ThreeOf3 (parseSchemaType "expiringLevel"))
])
`apply` optional (parseSchemaType "expectedN")
`apply` optional (parseSchemaType "notionalAmount")
`apply` optional (parseSchemaType "correlationStrikePrice")
`apply` optional (parseSchemaType "boundedCorrelation")
`apply` optional (parseSchemaType "numberOfDataSeries")
schemaTypeToXML s x@Correlation{} =
toXMLElement s []
[ maybe [] (foldOneOf3 (schemaTypeToXML "initialLevel")
(schemaTypeToXML "closingLevel")
(schemaTypeToXML "expiringLevel")
) $ correlation_choice0 x
, maybe [] (schemaTypeToXML "expectedN") $ correlation_expectedN x
, maybe [] (schemaTypeToXML "notionalAmount") $ correlation_notionalAmount x
, maybe [] (schemaTypeToXML "correlationStrikePrice") $ correlation_strikePrice x
, maybe [] (schemaTypeToXML "boundedCorrelation") $ correlation_boundedCorrelation x
, maybe [] (schemaTypeToXML "numberOfDataSeries") $ correlation_numberOfDataSeries x
]
instance Extension Correlation CalculationFromObservation where
supertype v = CalculationFromObservation_Correlation v
data DirectionalLeg
= DirectionalLeg_ReturnSwapLegUnderlyer ReturnSwapLegUnderlyer
| DirectionalLeg_InterestLeg InterestLeg
| DirectionalLeg_DirectionalLegUnderlyer DirectionalLegUnderlyer
| DirectionalLeg_FixedPaymentLeg FixedPaymentLeg
deriving (Eq,Show)
instance SchemaType DirectionalLeg where
parseSchemaType s = do
(fmap DirectionalLeg_ReturnSwapLegUnderlyer $ parseSchemaType s)
`onFail`
(fmap DirectionalLeg_InterestLeg $ parseSchemaType s)
`onFail`
(fmap DirectionalLeg_DirectionalLegUnderlyer $ parseSchemaType s)
`onFail`
(fmap DirectionalLeg_FixedPaymentLeg $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of DirectionalLeg,\n\
\ namely one of:\n\
\ReturnSwapLegUnderlyer,InterestLeg,DirectionalLegUnderlyer,FixedPaymentLeg"
schemaTypeToXML _s (DirectionalLeg_ReturnSwapLegUnderlyer x) = schemaTypeToXML "returnSwapLegUnderlyer" x
schemaTypeToXML _s (DirectionalLeg_InterestLeg x) = schemaTypeToXML "interestLeg" x
schemaTypeToXML _s (DirectionalLeg_DirectionalLegUnderlyer x) = schemaTypeToXML "directionalLegUnderlyer" x
schemaTypeToXML _s (DirectionalLeg_FixedPaymentLeg x) = schemaTypeToXML "fixedPaymentLeg" x
instance Extension DirectionalLeg Leg where
supertype v = Leg_DirectionalLeg v
data DirectionalLegUnderlyer
= DirectionalLegUnderlyer_DirectionalLegUnderlyerValuation DirectionalLegUnderlyerValuation
| DirectionalLegUnderlyer_DividendLeg DividendLeg
deriving (Eq,Show)
instance SchemaType DirectionalLegUnderlyer where
parseSchemaType s = do
(fmap DirectionalLegUnderlyer_DirectionalLegUnderlyerValuation $ parseSchemaType s)
`onFail`
(fmap DirectionalLegUnderlyer_DividendLeg $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of DirectionalLegUnderlyer,\n\
\ namely one of:\n\
\DirectionalLegUnderlyerValuation,DividendLeg"
schemaTypeToXML _s (DirectionalLegUnderlyer_DirectionalLegUnderlyerValuation x) = schemaTypeToXML "directionalLegUnderlyerValuation" x
schemaTypeToXML _s (DirectionalLegUnderlyer_DividendLeg x) = schemaTypeToXML "dividendLeg" x
instance Extension DirectionalLegUnderlyer DirectionalLeg where
supertype v = DirectionalLeg_DirectionalLegUnderlyer v
data DirectionalLegUnderlyerValuation
= DirectionalLegUnderlyerValuation_CorrelationLeg CorrelationLeg
| DirectionalLegUnderlyerValuation_VarianceLeg VarianceLeg
deriving (Eq,Show)
instance SchemaType DirectionalLegUnderlyerValuation where
parseSchemaType s = do
(fmap DirectionalLegUnderlyerValuation_CorrelationLeg $ parseSchemaType s)
`onFail`
(fmap DirectionalLegUnderlyerValuation_VarianceLeg $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of DirectionalLegUnderlyerValuation,\n\
\ namely one of:\n\
\CorrelationLeg,VarianceLeg"
schemaTypeToXML _s (DirectionalLegUnderlyerValuation_CorrelationLeg x) = schemaTypeToXML "correlationLeg" x
schemaTypeToXML _s (DirectionalLegUnderlyerValuation_VarianceLeg x) = schemaTypeToXML "varianceLeg" x
instance Extension DirectionalLegUnderlyerValuation DirectionalLegUnderlyer where
supertype v = DirectionalLegUnderlyer_DirectionalLegUnderlyerValuation v
data DividendAdjustment = DividendAdjustment
{ dividAdjust_dividendPeriod :: [DividendPeriodDividend]
}
deriving (Eq,Show)
instance SchemaType DividendAdjustment where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return DividendAdjustment
`apply` many (parseSchemaType "dividendPeriod")
schemaTypeToXML s x@DividendAdjustment{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "dividendPeriod") $ dividAdjust_dividendPeriod x
]
data DividendConditions = DividendConditions
{ dividCondit_dividendReinvestment :: Maybe Xsd.Boolean
, dividCondit_dividendEntitlement :: Maybe DividendEntitlementEnum
, dividCondit_dividendAmount :: Maybe DividendAmountTypeEnum
, dividCondit_dividendPaymentDate :: Maybe DividendPaymentDate
, dividCondit_choice4 :: (Maybe (OneOf2 ((Maybe (DateReference)),(Maybe (DateReference))) DividendPeriodEnum))
, dividCondit_extraOrdinaryDividends :: Maybe PartyReference
, dividCondit_excessDividendAmount :: Maybe DividendAmountTypeEnum
, dividCondit_choice7 :: (Maybe (OneOf3 IdentifiedCurrency DeterminationMethod IdentifiedCurrencyReference))
, dividCondit_dividendFxTriggerDate :: Maybe DividendPaymentDate
, dividCondit_interestAccrualsMethod :: Maybe InterestAccrualsCompoundingMethod
, dividCondit_numberOfIndexUnits :: Maybe NonNegativeDecimal
, dividCondit_declaredCashDividendPercentage :: Maybe NonNegativeDecimal
, dividCondit_declaredCashEquivalentDividendPercentage :: Maybe NonNegativeDecimal
, dividCondit_nonCashDividendTreatment :: Maybe NonCashDividendTreatmentEnum
, dividCondit_dividendComposition :: Maybe DividendCompositionEnum
, dividCondit_specialDividends :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType DividendConditions where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return DividendConditions
`apply` optional (parseSchemaType "dividendReinvestment")
`apply` optional (parseSchemaType "dividendEntitlement")
`apply` optional (parseSchemaType "dividendAmount")
`apply` optional (parseSchemaType "dividendPaymentDate")
`apply` optional (oneOf' [ ("Maybe DateReference Maybe DateReference", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "dividendPeriodEffectiveDate")
`apply` optional (parseSchemaType "dividendPeriodEndDate")))
, ("DividendPeriodEnum", fmap TwoOf2 (parseSchemaType "dividendPeriod"))
])
`apply` optional (parseSchemaType "extraOrdinaryDividends")
`apply` optional (parseSchemaType "excessDividendAmount")
`apply` optional (oneOf' [ ("IdentifiedCurrency", fmap OneOf3 (parseSchemaType "currency"))
, ("DeterminationMethod", fmap TwoOf3 (parseSchemaType "determinationMethod"))
, ("IdentifiedCurrencyReference", fmap ThreeOf3 (parseSchemaType "currencyReference"))
])
`apply` optional (parseSchemaType "dividendFxTriggerDate")
`apply` optional (parseSchemaType "interestAccrualsMethod")
`apply` optional (parseSchemaType "numberOfIndexUnits")
`apply` optional (parseSchemaType "declaredCashDividendPercentage")
`apply` optional (parseSchemaType "declaredCashEquivalentDividendPercentage")
`apply` optional (parseSchemaType "nonCashDividendTreatment")
`apply` optional (parseSchemaType "dividendComposition")
`apply` optional (parseSchemaType "specialDividends")
schemaTypeToXML s x@DividendConditions{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "dividendReinvestment") $ dividCondit_dividendReinvestment x
, maybe [] (schemaTypeToXML "dividendEntitlement") $ dividCondit_dividendEntitlement x
, maybe [] (schemaTypeToXML "dividendAmount") $ dividCondit_dividendAmount x
, maybe [] (schemaTypeToXML "dividendPaymentDate") $ dividCondit_dividendPaymentDate x
, maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "dividendPeriodEffectiveDate") a
, maybe [] (schemaTypeToXML "dividendPeriodEndDate") b
])
(schemaTypeToXML "dividendPeriod")
) $ dividCondit_choice4 x
, maybe [] (schemaTypeToXML "extraOrdinaryDividends") $ dividCondit_extraOrdinaryDividends x
, maybe [] (schemaTypeToXML "excessDividendAmount") $ dividCondit_excessDividendAmount x
, maybe [] (foldOneOf3 (schemaTypeToXML "currency")
(schemaTypeToXML "determinationMethod")
(schemaTypeToXML "currencyReference")
) $ dividCondit_choice7 x
, maybe [] (schemaTypeToXML "dividendFxTriggerDate") $ dividCondit_dividendFxTriggerDate x
, maybe [] (schemaTypeToXML "interestAccrualsMethod") $ dividCondit_interestAccrualsMethod x
, maybe [] (schemaTypeToXML "numberOfIndexUnits") $ dividCondit_numberOfIndexUnits x
, maybe [] (schemaTypeToXML "declaredCashDividendPercentage") $ dividCondit_declaredCashDividendPercentage x
, maybe [] (schemaTypeToXML "declaredCashEquivalentDividendPercentage") $ dividCondit_declaredCashEquivalentDividendPercentage x
, maybe [] (schemaTypeToXML "nonCashDividendTreatment") $ dividCondit_nonCashDividendTreatment x
, maybe [] (schemaTypeToXML "dividendComposition") $ dividCondit_dividendComposition x
, maybe [] (schemaTypeToXML "specialDividends") $ dividCondit_specialDividends x
]
data DividendPaymentDate = DividendPaymentDate
{ dividPaymentDate_choice0 :: (Maybe (OneOf2 ((Maybe (DividendDateReferenceEnum)),(Maybe (Offset))) AdjustableDate))
}
deriving (Eq,Show)
instance SchemaType DividendPaymentDate where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return DividendPaymentDate
`apply` optional (oneOf' [ ("Maybe DividendDateReferenceEnum Maybe Offset", fmap OneOf2 (return (,) `apply` optional (parseSchemaType "dividendDateReference")
`apply` optional (parseSchemaType "paymentDateOffset")))
, ("AdjustableDate", fmap TwoOf2 (parseSchemaType "adjustableDate"))
])
schemaTypeToXML s x@DividendPaymentDate{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "dividendDateReference") a
, maybe [] (schemaTypeToXML "paymentDateOffset") b
])
(schemaTypeToXML "adjustableDate")
) $ dividPaymentDate_choice0 x
]
data DividendPeriod
= DividendPeriod_DividendPeriodDividend DividendPeriodDividend
| DividendPeriod_DividendPeriodPayment DividendPeriodPayment
deriving (Eq,Show)
instance SchemaType DividendPeriod where
parseSchemaType s = do
(fmap DividendPeriod_DividendPeriodDividend $ parseSchemaType s)
`onFail`
(fmap DividendPeriod_DividendPeriodPayment $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of DividendPeriod,\n\
\ namely one of:\n\
\DividendPeriodDividend,DividendPeriodPayment"
schemaTypeToXML _s (DividendPeriod_DividendPeriodDividend x) = schemaTypeToXML "dividendPeriodDividend" x
schemaTypeToXML _s (DividendPeriod_DividendPeriodPayment x) = schemaTypeToXML "dividendPeriodPayment" x
data DividendPeriodDividend = DividendPeriodDividend
{ dividPeriodDivid_ID :: Maybe Xsd.ID
, dividPeriodDivid_unadjustedStartDate :: Maybe IdentifiedDate
, dividPeriodDivid_unadjustedEndDate :: Maybe IdentifiedDate
, dividPeriodDivid_dateAdjustments :: Maybe BusinessDayAdjustments
, dividPeriodDivid_underlyerReference :: Maybe AssetReference
, dividPeriodDivid_dividend :: Maybe NonNegativeMoney
, dividPeriodDivid_multiplier :: Maybe PositiveDecimal
}
deriving (Eq,Show)
instance SchemaType DividendPeriodDividend where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (DividendPeriodDividend a0)
`apply` optional (parseSchemaType "unadjustedStartDate")
`apply` optional (parseSchemaType "unadjustedEndDate")
`apply` optional (parseSchemaType "dateAdjustments")
`apply` optional (parseSchemaType "underlyerReference")
`apply` optional (parseSchemaType "dividend")
`apply` optional (parseSchemaType "multiplier")
schemaTypeToXML s x@DividendPeriodDividend{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ dividPeriodDivid_ID x
]
[ maybe [] (schemaTypeToXML "unadjustedStartDate") $ dividPeriodDivid_unadjustedStartDate x
, maybe [] (schemaTypeToXML "unadjustedEndDate") $ dividPeriodDivid_unadjustedEndDate x
, maybe [] (schemaTypeToXML "dateAdjustments") $ dividPeriodDivid_dateAdjustments x
, maybe [] (schemaTypeToXML "underlyerReference") $ dividPeriodDivid_underlyerReference x
, maybe [] (schemaTypeToXML "dividend") $ dividPeriodDivid_dividend x
, maybe [] (schemaTypeToXML "multiplier") $ dividPeriodDivid_multiplier x
]
instance Extension DividendPeriodDividend DividendPeriod where
supertype v = DividendPeriod_DividendPeriodDividend v
data EquityCorporateEvents = EquityCorporateEvents
{ equityCorporEvents_shareForShare :: Maybe ShareExtraordinaryEventEnum
, equityCorporEvents_shareForOther :: Maybe ShareExtraordinaryEventEnum
, equityCorporEvents_shareForCombined :: Maybe ShareExtraordinaryEventEnum
}
deriving (Eq,Show)
instance SchemaType EquityCorporateEvents where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return EquityCorporateEvents
`apply` optional (parseSchemaType "shareForShare")
`apply` optional (parseSchemaType "shareForOther")
`apply` optional (parseSchemaType "shareForCombined")
schemaTypeToXML s x@EquityCorporateEvents{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "shareForShare") $ equityCorporEvents_shareForShare x
, maybe [] (schemaTypeToXML "shareForOther") $ equityCorporEvents_shareForOther x
, maybe [] (schemaTypeToXML "shareForCombined") $ equityCorporEvents_shareForCombined x
]
data EquityPremium = EquityPremium
{ equityPremium_ID :: Maybe Xsd.ID
, equityPremium_payerPartyReference :: Maybe PartyReference
, equityPremium_payerAccountReference :: Maybe AccountReference
, equityPremium_receiverPartyReference :: Maybe PartyReference
, equityPremium_receiverAccountReference :: Maybe AccountReference
, equityPremium_premiumType :: Maybe PremiumTypeEnum
, equityPremium_paymentAmount :: Maybe NonNegativeMoney
, equityPremium_paymentDate :: Maybe AdjustableDate
, equityPremium_swapPremium :: Maybe Xsd.Boolean
, equityPremium_pricePerOption :: Maybe NonNegativeMoney
, equityPremium_percentageOfNotional :: Maybe NonNegativeDecimal
}
deriving (Eq,Show)
instance SchemaType EquityPremium where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (EquityPremium a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` optional (parseSchemaType "premiumType")
`apply` optional (parseSchemaType "paymentAmount")
`apply` optional (parseSchemaType "paymentDate")
`apply` optional (parseSchemaType "swapPremium")
`apply` optional (parseSchemaType "pricePerOption")
`apply` optional (parseSchemaType "percentageOfNotional")
schemaTypeToXML s x@EquityPremium{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ equityPremium_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ equityPremium_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ equityPremium_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ equityPremium_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ equityPremium_receiverAccountReference x
, maybe [] (schemaTypeToXML "premiumType") $ equityPremium_premiumType x
, maybe [] (schemaTypeToXML "paymentAmount") $ equityPremium_paymentAmount x
, maybe [] (schemaTypeToXML "paymentDate") $ equityPremium_paymentDate x
, maybe [] (schemaTypeToXML "swapPremium") $ equityPremium_swapPremium x
, maybe [] (schemaTypeToXML "pricePerOption") $ equityPremium_pricePerOption x
, maybe [] (schemaTypeToXML "percentageOfNotional") $ equityPremium_percentageOfNotional x
]
instance Extension EquityPremium PaymentBase where
supertype v = PaymentBase_EquityPremium v
data EquityStrike = EquityStrike
{ equityStrike_choice0 :: (Maybe (OneOf2 Xsd.Decimal ((Maybe (Xsd.Decimal)),(Maybe (AdjustableOrRelativeDate)))))
, equityStrike_currency :: Maybe Currency
}
deriving (Eq,Show)
instance SchemaType EquityStrike where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return EquityStrike
`apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "strikePrice"))
, ("Maybe Xsd.Decimal Maybe AdjustableOrRelativeDate", fmap TwoOf2 (return (,) `apply` optional (parseSchemaType "strikePercentage")
`apply` optional (parseSchemaType "strikeDeterminationDate")))
])
`apply` optional (parseSchemaType "currency")
schemaTypeToXML s x@EquityStrike{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "strikePrice")
(\ (a,b) -> concat [ maybe [] (schemaTypeToXML "strikePercentage") a
, maybe [] (schemaTypeToXML "strikeDeterminationDate") b
])
) $ equityStrike_choice0 x
, maybe [] (schemaTypeToXML "currency") $ equityStrike_currency x
]
data EquityValuation = EquityValuation
{ equityVal_ID :: Maybe Xsd.ID
, equityVal_choice0 :: (Maybe (OneOf2 AdjustableDateOrRelativeDateSequence AdjustableRelativeOrPeriodicDates))
, equityVal_valuationTimeType :: Maybe TimeTypeEnum
, equityVal_valuationTime :: Maybe BusinessCenterTime
, equityVal_futuresPriceValuation :: Maybe Xsd.Boolean
, equityVal_optionsPriceValuation :: Maybe Xsd.Boolean
, equityVal_numberOfValuationDates :: Maybe Xsd.NonNegativeInteger
, equityVal_dividendValuationDates :: Maybe AdjustableRelativeOrPeriodicDates
, equityVal_fPVFinalPriceElectionFallback :: Maybe FPVFinalPriceElectionFallbackEnum
}
deriving (Eq,Show)
instance SchemaType EquityValuation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (EquityValuation a0)
`apply` optional (oneOf' [ ("AdjustableDateOrRelativeDateSequence", fmap OneOf2 (parseSchemaType "valuationDate"))
, ("AdjustableRelativeOrPeriodicDates", fmap TwoOf2 (parseSchemaType "valuationDates"))
])
`apply` optional (parseSchemaType "valuationTimeType")
`apply` optional (parseSchemaType "valuationTime")
`apply` optional (parseSchemaType "futuresPriceValuation")
`apply` optional (parseSchemaType "optionsPriceValuation")
`apply` optional (parseSchemaType "numberOfValuationDates")
`apply` optional (parseSchemaType "dividendValuationDates")
`apply` optional (parseSchemaType "fPVFinalPriceElectionFallback")
schemaTypeToXML s x@EquityValuation{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ equityVal_ID x
]
[ maybe [] (foldOneOf2 (schemaTypeToXML "valuationDate")
(schemaTypeToXML "valuationDates")
) $ equityVal_choice0 x
, maybe [] (schemaTypeToXML "valuationTimeType") $ equityVal_valuationTimeType x
, maybe [] (schemaTypeToXML "valuationTime") $ equityVal_valuationTime x
, maybe [] (schemaTypeToXML "futuresPriceValuation") $ equityVal_futuresPriceValuation x
, maybe [] (schemaTypeToXML "optionsPriceValuation") $ equityVal_optionsPriceValuation x
, maybe [] (schemaTypeToXML "numberOfValuationDates") $ equityVal_numberOfValuationDates x
, maybe [] (schemaTypeToXML "dividendValuationDates") $ equityVal_dividendValuationDates x
, maybe [] (schemaTypeToXML "fPVFinalPriceElectionFallback") $ equityVal_fPVFinalPriceElectionFallback x
]
data ExtraordinaryEvents = ExtraordinaryEvents
{ extraEvents_mergerEvents :: Maybe EquityCorporateEvents
, extraEvents_tenderOffer :: Maybe Xsd.Boolean
, extraEvents_tenderOfferEvents :: Maybe EquityCorporateEvents
, extraEvents_compositionOfCombinedConsideration :: Maybe Xsd.Boolean
, extraEvents_indexAdjustmentEvents :: Maybe IndexAdjustmentEvents
, extraEvents_choice5 :: (Maybe (OneOf2 AdditionalDisruptionEvents Xsd.Boolean))
, extraEvents_representations :: Maybe Representations
, extraEvents_nationalisationOrInsolvency :: Maybe NationalisationOrInsolvencyOrDelistingEventEnum
, extraEvents_delisting :: Maybe NationalisationOrInsolvencyOrDelistingEventEnum
, extraEvents_relatedExchangeId :: [ExchangeId]
, extraEvents_optionsExchangeId :: [ExchangeId]
, extraEvents_specifiedExchangeId :: [ExchangeId]
}
deriving (Eq,Show)
instance SchemaType ExtraordinaryEvents where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ExtraordinaryEvents
`apply` optional (parseSchemaType "mergerEvents")
`apply` optional (parseSchemaType "tenderOffer")
`apply` optional (parseSchemaType "tenderOfferEvents")
`apply` optional (parseSchemaType "compositionOfCombinedConsideration")
`apply` optional (parseSchemaType "indexAdjustmentEvents")
`apply` optional (oneOf' [ ("AdditionalDisruptionEvents", fmap OneOf2 (parseSchemaType "additionalDisruptionEvents"))
, ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "failureToDeliver"))
])
`apply` optional (parseSchemaType "representations")
`apply` optional (parseSchemaType "nationalisationOrInsolvency")
`apply` optional (parseSchemaType "delisting")
`apply` many (parseSchemaType "relatedExchangeId")
`apply` many (parseSchemaType "optionsExchangeId")
`apply` many (parseSchemaType "specifiedExchangeId")
schemaTypeToXML s x@ExtraordinaryEvents{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "mergerEvents") $ extraEvents_mergerEvents x
, maybe [] (schemaTypeToXML "tenderOffer") $ extraEvents_tenderOffer x
, maybe [] (schemaTypeToXML "tenderOfferEvents") $ extraEvents_tenderOfferEvents x
, maybe [] (schemaTypeToXML "compositionOfCombinedConsideration") $ extraEvents_compositionOfCombinedConsideration x
, maybe [] (schemaTypeToXML "indexAdjustmentEvents") $ extraEvents_indexAdjustmentEvents x
, maybe [] (foldOneOf2 (schemaTypeToXML "additionalDisruptionEvents")
(schemaTypeToXML "failureToDeliver")
) $ extraEvents_choice5 x
, maybe [] (schemaTypeToXML "representations") $ extraEvents_representations x
, maybe [] (schemaTypeToXML "nationalisationOrInsolvency") $ extraEvents_nationalisationOrInsolvency x
, maybe [] (schemaTypeToXML "delisting") $ extraEvents_delisting x
, concatMap (schemaTypeToXML "relatedExchangeId") $ extraEvents_relatedExchangeId x
, concatMap (schemaTypeToXML "optionsExchangeId") $ extraEvents_optionsExchangeId x
, concatMap (schemaTypeToXML "specifiedExchangeId") $ extraEvents_specifiedExchangeId x
]
data FloatingRateCalculationReference = FloatingRateCalculationReference
{ floatRateCalcRef_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType FloatingRateCalculationReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (FloatingRateCalculationReference a0)
schemaTypeToXML s x@FloatingRateCalculationReference{} =
toXMLElement s [ toXMLAttribute "href" $ floatRateCalcRef_href x
]
[]
instance Extension FloatingRateCalculationReference Reference where
supertype v = Reference_FloatingRateCalculationReference v
data IndexAdjustmentEvents = IndexAdjustmentEvents
{ indexAdjustEvents_indexModification :: Maybe IndexEventConsequenceEnum
, indexAdjustEvents_indexCancellation :: Maybe IndexEventConsequenceEnum
, indexAdjustEvents_indexDisruption :: Maybe IndexEventConsequenceEnum
}
deriving (Eq,Show)
instance SchemaType IndexAdjustmentEvents where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return IndexAdjustmentEvents
`apply` optional (parseSchemaType "indexModification")
`apply` optional (parseSchemaType "indexCancellation")
`apply` optional (parseSchemaType "indexDisruption")
schemaTypeToXML s x@IndexAdjustmentEvents{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "indexModification") $ indexAdjustEvents_indexModification x
, maybe [] (schemaTypeToXML "indexCancellation") $ indexAdjustEvents_indexCancellation x
, maybe [] (schemaTypeToXML "indexDisruption") $ indexAdjustEvents_indexDisruption x
]
data InterestCalculation = InterestCalculation
{ interCalc_ID :: Maybe Xsd.ID
, interCalc_choice0 :: OneOf2 FloatingRateCalculation Xsd.Decimal
, interCalc_dayCountFraction :: Maybe DayCountFraction
, interCalc_compounding :: Maybe Compounding
, interCalc_interpolationMethod :: Maybe InterpolationMethod
, interCalc_interpolationPeriod :: Maybe InterpolationPeriodEnum
}
deriving (Eq,Show)
instance SchemaType InterestCalculation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (InterestCalculation a0)
`apply` oneOf' [ ("FloatingRateCalculation", fmap OneOf2 (parseSchemaType "floatingRateCalculation"))
, ("Xsd.Decimal", fmap TwoOf2 (parseSchemaType "fixedRate"))
]
`apply` optional (parseSchemaType "dayCountFraction")
`apply` optional (parseSchemaType "compounding")
`apply` optional (parseSchemaType "interpolationMethod")
`apply` optional (parseSchemaType "interpolationPeriod")
schemaTypeToXML s x@InterestCalculation{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ interCalc_ID x
]
[ foldOneOf2 (schemaTypeToXML "floatingRateCalculation")
(schemaTypeToXML "fixedRate")
$ interCalc_choice0 x
, maybe [] (schemaTypeToXML "dayCountFraction") $ interCalc_dayCountFraction x
, maybe [] (schemaTypeToXML "compounding") $ interCalc_compounding x
, maybe [] (schemaTypeToXML "interpolationMethod") $ interCalc_interpolationMethod x
, maybe [] (schemaTypeToXML "interpolationPeriod") $ interCalc_interpolationPeriod x
]
instance Extension InterestCalculation InterestAccrualsMethod where
supertype (InterestCalculation a0 e0 e1 e2 e3 e4) =
InterestAccrualsMethod e0
data InterestLeg = InterestLeg
{ interestLeg_ID :: Maybe Xsd.ID
, interestLeg_legIdentifier :: [LegIdentifier]
, interestLeg_payerPartyReference :: Maybe PartyReference
, interestLeg_payerAccountReference :: Maybe AccountReference
, interestLeg_receiverPartyReference :: Maybe PartyReference
, interestLeg_receiverAccountReference :: Maybe AccountReference
, interestLeg_effectiveDate :: Maybe AdjustableOrRelativeDate
, interestLeg_terminationDate :: Maybe AdjustableOrRelativeDate
, interestLeg_calculationPeriodDates :: Maybe InterestLegCalculationPeriodDates
, interestLeg_notional :: Maybe ReturnSwapNotional
, interestLeg_interestAmount :: Maybe LegAmount
, interestLeg_interestCalculation :: InterestCalculation
, interestLeg_stubCalculationPeriod :: Maybe StubCalculationPeriod
}
deriving (Eq,Show)
instance SchemaType InterestLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (InterestLeg 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 "interestLegCalculationPeriodDates")
`apply` optional (parseSchemaType "notional")
`apply` optional (parseSchemaType "interestAmount")
`apply` parseSchemaType "interestCalculation"
`apply` optional (parseSchemaType "stubCalculationPeriod")
schemaTypeToXML s x@InterestLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ interestLeg_ID x
]
[ concatMap (schemaTypeToXML "legIdentifier") $ interestLeg_legIdentifier x
, maybe [] (schemaTypeToXML "payerPartyReference") $ interestLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ interestLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ interestLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ interestLeg_receiverAccountReference x
, maybe [] (schemaTypeToXML "effectiveDate") $ interestLeg_effectiveDate x
, maybe [] (schemaTypeToXML "terminationDate") $ interestLeg_terminationDate x
, maybe [] (schemaTypeToXML "interestLegCalculationPeriodDates") $ interestLeg_calculationPeriodDates x
, maybe [] (schemaTypeToXML "notional") $ interestLeg_notional x
, maybe [] (schemaTypeToXML "interestAmount") $ interestLeg_interestAmount x
, schemaTypeToXML "interestCalculation" $ interestLeg_interestCalculation x
, maybe [] (schemaTypeToXML "stubCalculationPeriod") $ interestLeg_stubCalculationPeriod x
]
instance Extension InterestLeg DirectionalLeg where
supertype v = DirectionalLeg_InterestLeg v
instance Extension InterestLeg Leg where
supertype = (supertype :: DirectionalLeg -> Leg)
. (supertype :: InterestLeg -> DirectionalLeg)
data InterestLegCalculationPeriodDates = InterestLegCalculationPeriodDates
{ interLegCalcPeriodDates_ID :: Xsd.ID
, interLegCalcPeriodDates_effectiveDate :: Maybe AdjustableOrRelativeDate
, interLegCalcPeriodDates_terminationDate :: Maybe AdjustableOrRelativeDate
, interLegCalcPeriodDates_interestLegResetDates :: Maybe InterestLegResetDates
, interLegCalcPeriodDates_interestLegPaymentDates :: Maybe AdjustableRelativeOrPeriodicDates2
}
deriving (Eq,Show)
instance SchemaType InterestLegCalculationPeriodDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "id" e pos
commit $ interior e $ return (InterestLegCalculationPeriodDates a0)
`apply` optional (parseSchemaType "effectiveDate")
`apply` optional (parseSchemaType "terminationDate")
`apply` optional (parseSchemaType "interestLegResetDates")
`apply` optional (parseSchemaType "interestLegPaymentDates")
schemaTypeToXML s x@InterestLegCalculationPeriodDates{} =
toXMLElement s [ toXMLAttribute "id" $ interLegCalcPeriodDates_ID x
]
[ maybe [] (schemaTypeToXML "effectiveDate") $ interLegCalcPeriodDates_effectiveDate x
, maybe [] (schemaTypeToXML "terminationDate") $ interLegCalcPeriodDates_terminationDate x
, maybe [] (schemaTypeToXML "interestLegResetDates") $ interLegCalcPeriodDates_interestLegResetDates x
, maybe [] (schemaTypeToXML "interestLegPaymentDates") $ interLegCalcPeriodDates_interestLegPaymentDates x
]
data InterestLegCalculationPeriodDatesReference = InterestLegCalculationPeriodDatesReference
{ ilcpdr_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType InterestLegCalculationPeriodDatesReference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "href" e pos
commit $ interior e $ return (InterestLegCalculationPeriodDatesReference a0)
schemaTypeToXML s x@InterestLegCalculationPeriodDatesReference{} =
toXMLElement s [ toXMLAttribute "href" $ ilcpdr_href x
]
[]
instance Extension InterestLegCalculationPeriodDatesReference Reference where
supertype v = Reference_InterestLegCalculationPeriodDatesReference v
data InterestLegResetDates = InterestLegResetDates
{ interLegResetDates_calculationPeriodDatesReference :: Maybe InterestLegCalculationPeriodDatesReference
, interLegResetDates_choice1 :: (Maybe (OneOf2 ResetRelativeToEnum ResetFrequency))
, interLegResetDates_initialFixingDate :: Maybe RelativeDateOffset
, interLegResetDates_fixingDates :: Maybe AdjustableDatesOrRelativeDateOffset
}
deriving (Eq,Show)
instance SchemaType InterestLegResetDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return InterestLegResetDates
`apply` optional (parseSchemaType "calculationPeriodDatesReference")
`apply` optional (oneOf' [ ("ResetRelativeToEnum", fmap OneOf2 (parseSchemaType "resetRelativeTo"))
, ("ResetFrequency", fmap TwoOf2 (parseSchemaType "resetFrequency"))
])
`apply` optional (parseSchemaType "initialFixingDate")
`apply` optional (parseSchemaType "fixingDates")
schemaTypeToXML s x@InterestLegResetDates{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "calculationPeriodDatesReference") $ interLegResetDates_calculationPeriodDatesReference x
, maybe [] (foldOneOf2 (schemaTypeToXML "resetRelativeTo")
(schemaTypeToXML "resetFrequency")
) $ interLegResetDates_choice1 x
, maybe [] (schemaTypeToXML "initialFixingDate") $ interLegResetDates_initialFixingDate x
, maybe [] (schemaTypeToXML "fixingDates") $ interLegResetDates_fixingDates x
]
data LegAmount = LegAmount
{ legAmount_choice0 :: (Maybe (OneOf3 IdentifiedCurrency DeterminationMethod IdentifiedCurrencyReference))
, legAmount_choice1 :: (Maybe (OneOf3 ReferenceAmount Formula Xsd.Base64Binary))
, legAmount_calculationDates :: Maybe AdjustableRelativeOrPeriodicDates
}
deriving (Eq,Show)
instance SchemaType LegAmount where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return LegAmount
`apply` optional (oneOf' [ ("IdentifiedCurrency", fmap OneOf3 (parseSchemaType "currency"))
, ("DeterminationMethod", fmap TwoOf3 (parseSchemaType "determinationMethod"))
, ("IdentifiedCurrencyReference", fmap ThreeOf3 (parseSchemaType "currencyReference"))
])
`apply` optional (oneOf' [ ("ReferenceAmount", fmap OneOf3 (parseSchemaType "referenceAmount"))
, ("Formula", fmap TwoOf3 (parseSchemaType "formula"))
, ("Xsd.Base64Binary", fmap ThreeOf3 (parseSchemaType "encodedDescription"))
])
`apply` optional (parseSchemaType "calculationDates")
schemaTypeToXML s x@LegAmount{} =
toXMLElement s []
[ maybe [] (foldOneOf3 (schemaTypeToXML "currency")
(schemaTypeToXML "determinationMethod")
(schemaTypeToXML "currencyReference")
) $ legAmount_choice0 x
, maybe [] (foldOneOf3 (schemaTypeToXML "referenceAmount")
(schemaTypeToXML "formula")
(schemaTypeToXML "encodedDescription")
) $ legAmount_choice1 x
, maybe [] (schemaTypeToXML "calculationDates") $ legAmount_calculationDates x
]
data LegId = LegId Token60 LegIdAttributes deriving (Eq,Show)
data LegIdAttributes = LegIdAttributes
{ legIdAttrib_legIdScheme :: Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType LegId where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- getAttribute "legIdScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ LegId v (LegIdAttributes a0)
schemaTypeToXML s (LegId bt at) =
addXMLAttributes [ toXMLAttribute "legIdScheme" $ legIdAttrib_legIdScheme at
]
$ schemaTypeToXML s bt
instance Extension LegId Token60 where
supertype (LegId s _) = s
data LegIdentifier = LegIdentifier
{ legIdent_legId :: Maybe LegId
, legIdent_version :: Maybe Xsd.NonNegativeInteger
, legIdent_effectiveDate :: Maybe IdentifiedDate
}
deriving (Eq,Show)
instance SchemaType LegIdentifier where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return LegIdentifier
`apply` optional (parseSchemaType "legId")
`apply` optional (parseSchemaType "version")
`apply` optional (parseSchemaType "effectiveDate")
schemaTypeToXML s x@LegIdentifier{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "legId") $ legIdent_legId x
, maybe [] (schemaTypeToXML "version") $ legIdent_version x
, maybe [] (schemaTypeToXML "effectiveDate") $ legIdent_effectiveDate x
]
data MakeWholeProvisions = MakeWholeProvisions
{ makeWholeProvis_makeWholeDate :: Maybe Xsd.Date
, makeWholeProvis_recallSpread :: Maybe Xsd.Decimal
}
deriving (Eq,Show)
instance SchemaType MakeWholeProvisions where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return MakeWholeProvisions
`apply` optional (parseSchemaType "makeWholeDate")
`apply` optional (parseSchemaType "recallSpread")
schemaTypeToXML s x@MakeWholeProvisions{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "makeWholeDate") $ makeWholeProvis_makeWholeDate x
, maybe [] (schemaTypeToXML "recallSpread") $ makeWholeProvis_recallSpread x
]
data NettedSwapBase
= NettedSwapBase_CorrelationSwap CorrelationSwap
| NettedSwapBase_VarianceSwap VarianceSwap
deriving (Eq,Show)
instance SchemaType NettedSwapBase where
parseSchemaType s = do
(fmap NettedSwapBase_CorrelationSwap $ parseSchemaType s)
`onFail`
(fmap NettedSwapBase_VarianceSwap $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of NettedSwapBase,\n\
\ namely one of:\n\
\CorrelationSwap,VarianceSwap"
schemaTypeToXML _s (NettedSwapBase_CorrelationSwap x) = schemaTypeToXML "correlationSwap" x
schemaTypeToXML _s (NettedSwapBase_VarianceSwap x) = schemaTypeToXML "varianceSwap" x
instance Extension NettedSwapBase Product where
supertype v = Product_NettedSwapBase v
data OptionFeatures = OptionFeatures
{ optionFeatur_asian :: Maybe Asian
, optionFeatur_barrier :: Maybe Barrier
, optionFeatur_knock :: Maybe Knock
, optionFeatur_passThrough :: Maybe PassThrough
, optionFeatur_dividendAdjustment :: Maybe DividendAdjustment
}
deriving (Eq,Show)
instance SchemaType OptionFeatures where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return OptionFeatures
`apply` optional (parseSchemaType "asian")
`apply` optional (parseSchemaType "barrier")
`apply` optional (parseSchemaType "knock")
`apply` optional (parseSchemaType "passThrough")
`apply` optional (parseSchemaType "dividendAdjustment")
schemaTypeToXML s x@OptionFeatures{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "asian") $ optionFeatur_asian x
, maybe [] (schemaTypeToXML "barrier") $ optionFeatur_barrier x
, maybe [] (schemaTypeToXML "knock") $ optionFeatur_knock x
, maybe [] (schemaTypeToXML "passThrough") $ optionFeatur_passThrough x
, maybe [] (schemaTypeToXML "dividendAdjustment") $ optionFeatur_dividendAdjustment x
]
data PrincipalExchangeAmount = PrincipalExchangeAmount
{ princExchAmount_choice0 :: (Maybe (OneOf3 AmountReference DeterminationMethod NonNegativeMoney))
}
deriving (Eq,Show)
instance SchemaType PrincipalExchangeAmount where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return PrincipalExchangeAmount
`apply` optional (oneOf' [ ("AmountReference", fmap OneOf3 (parseSchemaType "amountRelativeTo"))
, ("DeterminationMethod", fmap TwoOf3 (parseSchemaType "determinationMethod"))
, ("NonNegativeMoney", fmap ThreeOf3 (parseSchemaType "principalAmount"))
])
schemaTypeToXML s x@PrincipalExchangeAmount{} =
toXMLElement s []
[ maybe [] (foldOneOf3 (schemaTypeToXML "amountRelativeTo")
(schemaTypeToXML "determinationMethod")
(schemaTypeToXML "principalAmount")
) $ princExchAmount_choice0 x
]
data PrincipalExchangeDescriptions = PrincipalExchangeDescriptions
{ princExchDescr_payerPartyReference :: Maybe PartyReference
, princExchDescr_payerAccountReference :: Maybe AccountReference
, princExchDescr_receiverPartyReference :: Maybe PartyReference
, princExchDescr_receiverAccountReference :: Maybe AccountReference
, princExchDescr_principalExchangeAmount :: Maybe PrincipalExchangeAmount
, princExchDescr_principalExchangeDate :: Maybe AdjustableOrRelativeDate
}
deriving (Eq,Show)
instance SchemaType PrincipalExchangeDescriptions where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return PrincipalExchangeDescriptions
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` optional (parseSchemaType "principalExchangeAmount")
`apply` optional (parseSchemaType "principalExchangeDate")
schemaTypeToXML s x@PrincipalExchangeDescriptions{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "payerPartyReference") $ princExchDescr_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ princExchDescr_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ princExchDescr_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ princExchDescr_receiverAccountReference x
, maybe [] (schemaTypeToXML "principalExchangeAmount") $ princExchDescr_principalExchangeAmount x
, maybe [] (schemaTypeToXML "principalExchangeDate") $ princExchDescr_principalExchangeDate x
]
data PrincipalExchangeFeatures = PrincipalExchangeFeatures
{ princExchFeatur_principalExchanges :: Maybe PrincipalExchanges
, princExchFeatur_principalExchangeDescriptions :: [PrincipalExchangeDescriptions]
}
deriving (Eq,Show)
instance SchemaType PrincipalExchangeFeatures where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return PrincipalExchangeFeatures
`apply` optional (parseSchemaType "principalExchanges")
`apply` many (parseSchemaType "principalExchangeDescriptions")
schemaTypeToXML s x@PrincipalExchangeFeatures{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "principalExchanges") $ princExchFeatur_principalExchanges x
, concatMap (schemaTypeToXML "principalExchangeDescriptions") $ princExchFeatur_principalExchangeDescriptions x
]
data Representations = Representations
{ repres_nonReliance :: Maybe Xsd.Boolean
, repres_agreementsRegardingHedging :: Maybe Xsd.Boolean
, repres_indexDisclaimer :: Maybe Xsd.Boolean
, repres_additionalAcknowledgements :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType Representations where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Representations
`apply` optional (parseSchemaType "nonReliance")
`apply` optional (parseSchemaType "agreementsRegardingHedging")
`apply` optional (parseSchemaType "indexDisclaimer")
`apply` optional (parseSchemaType "additionalAcknowledgements")
schemaTypeToXML s x@Representations{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "nonReliance") $ repres_nonReliance x
, maybe [] (schemaTypeToXML "agreementsRegardingHedging") $ repres_agreementsRegardingHedging x
, maybe [] (schemaTypeToXML "indexDisclaimer") $ repres_indexDisclaimer x
, maybe [] (schemaTypeToXML "additionalAcknowledgements") $ repres_additionalAcknowledgements x
]
data Return = Return
{ return_type :: ReturnTypeEnum
, return_dividendConditions :: Maybe DividendConditions
}
deriving (Eq,Show)
instance SchemaType Return where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Return
`apply` parseSchemaType "returnType"
`apply` optional (parseSchemaType "dividendConditions")
schemaTypeToXML s x@Return{} =
toXMLElement s []
[ schemaTypeToXML "returnType" $ return_type x
, maybe [] (schemaTypeToXML "dividendConditions") $ return_dividendConditions x
]
data ReturnLeg = ReturnLeg
{ returnLeg_ID :: Maybe Xsd.ID
, returnLeg_legIdentifier :: [LegIdentifier]
, returnLeg_payerPartyReference :: Maybe PartyReference
, returnLeg_payerAccountReference :: Maybe AccountReference
, returnLeg_receiverPartyReference :: Maybe PartyReference
, returnLeg_receiverAccountReference :: Maybe AccountReference
, returnLeg_effectiveDate :: Maybe AdjustableOrRelativeDate
, returnLeg_terminationDate :: Maybe AdjustableOrRelativeDate
, returnLeg_strikeDate :: Maybe AdjustableOrRelativeDate
, returnLeg_underlyer :: Underlyer
, returnLeg_rateOfReturn :: ReturnLegValuation
, returnLeg_notional :: Maybe ReturnSwapNotional
, returnLeg_amount :: ReturnSwapAmount
, returnLeg_return :: Maybe Return
, returnLeg_notionalAdjustments :: Maybe NotionalAdjustmentEnum
, returnLeg_fxFeature :: Maybe FxFeature
, returnLeg_averagingDates :: Maybe AveragingPeriod
}
deriving (Eq,Show)
instance SchemaType ReturnLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ReturnLeg 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 "strikeDate")
`apply` parseSchemaType "underlyer"
`apply` parseSchemaType "rateOfReturn"
`apply` optional (parseSchemaType "notional")
`apply` parseSchemaType "amount"
`apply` optional (parseSchemaType "return")
`apply` optional (parseSchemaType "notionalAdjustments")
`apply` optional (parseSchemaType "fxFeature")
`apply` optional (parseSchemaType "averagingDates")
schemaTypeToXML s x@ReturnLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ returnLeg_ID x
]
[ concatMap (schemaTypeToXML "legIdentifier") $ returnLeg_legIdentifier x
, maybe [] (schemaTypeToXML "payerPartyReference") $ returnLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ returnLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ returnLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ returnLeg_receiverAccountReference x
, maybe [] (schemaTypeToXML "effectiveDate") $ returnLeg_effectiveDate x
, maybe [] (schemaTypeToXML "terminationDate") $ returnLeg_terminationDate x
, maybe [] (schemaTypeToXML "strikeDate") $ returnLeg_strikeDate x
, schemaTypeToXML "underlyer" $ returnLeg_underlyer x
, schemaTypeToXML "rateOfReturn" $ returnLeg_rateOfReturn x
, maybe [] (schemaTypeToXML "notional") $ returnLeg_notional x
, schemaTypeToXML "amount" $ returnLeg_amount x
, maybe [] (schemaTypeToXML "return") $ returnLeg_return x
, maybe [] (schemaTypeToXML "notionalAdjustments") $ returnLeg_notionalAdjustments x
, maybe [] (schemaTypeToXML "fxFeature") $ returnLeg_fxFeature x
, maybe [] (schemaTypeToXML "averagingDates") $ returnLeg_averagingDates x
]
instance Extension ReturnLeg ReturnSwapLegUnderlyer where
supertype v = ReturnSwapLegUnderlyer_ReturnLeg v
instance Extension ReturnLeg DirectionalLeg where
supertype = (supertype :: ReturnSwapLegUnderlyer -> DirectionalLeg)
. (supertype :: ReturnLeg -> ReturnSwapLegUnderlyer)
instance Extension ReturnLeg Leg where
supertype = (supertype :: DirectionalLeg -> Leg)
. (supertype :: ReturnSwapLegUnderlyer -> DirectionalLeg)
. (supertype :: ReturnLeg -> ReturnSwapLegUnderlyer)
data ReturnLegValuation = ReturnLegValuation
{ returnLegVal_initialPrice :: Maybe ReturnLegValuationPrice
, returnLegVal_notionalReset :: Maybe Xsd.Boolean
, returnLegVal_valuationPriceInterim :: Maybe ReturnLegValuationPrice
, returnLegVal_valuationPriceFinal :: Maybe ReturnLegValuationPrice
, returnLegVal_paymentDates :: Maybe ReturnSwapPaymentDates
, returnLegVal_exchangeTradedContractNearest :: Maybe ExchangeTradedContract
}
deriving (Eq,Show)
instance SchemaType ReturnLegValuation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ReturnLegValuation
`apply` optional (parseSchemaType "initialPrice")
`apply` optional (parseSchemaType "notionalReset")
`apply` optional (parseSchemaType "valuationPriceInterim")
`apply` optional (parseSchemaType "valuationPriceFinal")
`apply` optional (parseSchemaType "paymentDates")
`apply` optional (parseSchemaType "exchangeTradedContractNearest")
schemaTypeToXML s x@ReturnLegValuation{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "initialPrice") $ returnLegVal_initialPrice x
, maybe [] (schemaTypeToXML "notionalReset") $ returnLegVal_notionalReset x
, maybe [] (schemaTypeToXML "valuationPriceInterim") $ returnLegVal_valuationPriceInterim x
, maybe [] (schemaTypeToXML "valuationPriceFinal") $ returnLegVal_valuationPriceFinal x
, maybe [] (schemaTypeToXML "paymentDates") $ returnLegVal_paymentDates x
, maybe [] (schemaTypeToXML "exchangeTradedContractNearest") $ returnLegVal_exchangeTradedContractNearest x
]
data ReturnLegValuationPrice = ReturnLegValuationPrice
{ returnLegValPrice_commission :: Maybe Commission
, returnLegValPrice_choice1 :: OneOf3 (DeterminationMethod,(Maybe (ActualPrice)),(Maybe (ActualPrice)),(Maybe (Xsd.Decimal)),(Maybe (FxConversion))) AmountReference ((Maybe (ActualPrice)),(Maybe (ActualPrice)),(Maybe (Xsd.Decimal)),(Maybe (FxConversion)))
, returnLegValPrice_cleanNetPrice :: Maybe Xsd.Decimal
, returnLegValPrice_quotationCharacteristics :: Maybe QuotationCharacteristics
, returnLegValPrice_valuationRules :: Maybe EquityValuation
}
deriving (Eq,Show)
instance SchemaType ReturnLegValuationPrice where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ReturnLegValuationPrice
`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")
`apply` optional (parseSchemaType "valuationRules")
schemaTypeToXML s x@ReturnLegValuationPrice{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "commission") $ returnLegValPrice_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
])
$ returnLegValPrice_choice1 x
, maybe [] (schemaTypeToXML "cleanNetPrice") $ returnLegValPrice_cleanNetPrice x
, maybe [] (schemaTypeToXML "quotationCharacteristics") $ returnLegValPrice_quotationCharacteristics x
, maybe [] (schemaTypeToXML "valuationRules") $ returnLegValPrice_valuationRules x
]
instance Extension ReturnLegValuationPrice Price where
supertype (ReturnLegValuationPrice e0 e1 e2 e3 e4) =
Price e0 e1 e2 e3
data ReturnSwap = ReturnSwap
{ returnSwap_ID :: Maybe Xsd.ID
, returnSwap_primaryAssetClass :: Maybe AssetClass
, returnSwap_secondaryAssetClass :: [AssetClass]
, returnSwap_productType :: [ProductType]
, returnSwap_productId :: [ProductId]
, returnSwap_buyerPartyReference :: Maybe PartyReference
, returnSwap_buyerAccountReference :: Maybe AccountReference
, returnSwap_sellerPartyReference :: Maybe PartyReference
, returnSwap_sellerAccountReference :: Maybe AccountReference
, returnSwap_leg :: [DirectionalLeg]
, returnSwap_principalExchangeFeatures :: Maybe PrincipalExchangeFeatures
, returnSwap_additionalPayment :: [ReturnSwapAdditionalPayment]
, returnSwap_earlyTermination :: [ReturnSwapEarlyTermination]
, returnSwap_extraordinaryEvents :: Maybe ExtraordinaryEvents
}
deriving (Eq,Show)
instance SchemaType ReturnSwap where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ReturnSwap 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` between (Occurs (Just 0) (Just 2))
(elementReturnSwapLeg)
`apply` optional (parseSchemaType "principalExchangeFeatures")
`apply` many (parseSchemaType "additionalPayment")
`apply` many (parseSchemaType "earlyTermination")
`apply` optional (parseSchemaType "extraordinaryEvents")
schemaTypeToXML s x@ReturnSwap{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ returnSwap_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ returnSwap_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ returnSwap_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ returnSwap_productType x
, concatMap (schemaTypeToXML "productId") $ returnSwap_productId x
, maybe [] (schemaTypeToXML "buyerPartyReference") $ returnSwap_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ returnSwap_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ returnSwap_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ returnSwap_sellerAccountReference x
, concatMap (elementToXMLReturnSwapLeg) $ returnSwap_leg x
, maybe [] (schemaTypeToXML "principalExchangeFeatures") $ returnSwap_principalExchangeFeatures x
, concatMap (schemaTypeToXML "additionalPayment") $ returnSwap_additionalPayment x
, concatMap (schemaTypeToXML "earlyTermination") $ returnSwap_earlyTermination x
, maybe [] (schemaTypeToXML "extraordinaryEvents") $ returnSwap_extraordinaryEvents x
]
instance Extension ReturnSwap ReturnSwapBase where
supertype v = ReturnSwapBase_ReturnSwap v
instance Extension ReturnSwap Product where
supertype = (supertype :: ReturnSwapBase -> Product)
. (supertype :: ReturnSwap -> ReturnSwapBase)
data ReturnSwapAdditionalPayment = ReturnSwapAdditionalPayment
{ returnSwapAddPayment_ID :: Maybe Xsd.ID
, returnSwapAddPayment_payerPartyReference :: Maybe PartyReference
, returnSwapAddPayment_payerAccountReference :: Maybe AccountReference
, returnSwapAddPayment_receiverPartyReference :: Maybe PartyReference
, returnSwapAddPayment_receiverAccountReference :: Maybe AccountReference
, returnSwapAddPayment_additionalPaymentAmount :: Maybe AdditionalPaymentAmount
, returnSwapAddPayment_additionalPaymentDate :: Maybe AdjustableOrRelativeDate
, returnSwapAddPayment_paymentType :: Maybe PaymentType
}
deriving (Eq,Show)
instance SchemaType ReturnSwapAdditionalPayment where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ReturnSwapAdditionalPayment a0)
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` optional (parseSchemaType "additionalPaymentAmount")
`apply` optional (parseSchemaType "additionalPaymentDate")
`apply` optional (parseSchemaType "paymentType")
schemaTypeToXML s x@ReturnSwapAdditionalPayment{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ returnSwapAddPayment_ID x
]
[ maybe [] (schemaTypeToXML "payerPartyReference") $ returnSwapAddPayment_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ returnSwapAddPayment_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ returnSwapAddPayment_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ returnSwapAddPayment_receiverAccountReference x
, maybe [] (schemaTypeToXML "additionalPaymentAmount") $ returnSwapAddPayment_additionalPaymentAmount x
, maybe [] (schemaTypeToXML "additionalPaymentDate") $ returnSwapAddPayment_additionalPaymentDate x
, maybe [] (schemaTypeToXML "paymentType") $ returnSwapAddPayment_paymentType x
]
instance Extension ReturnSwapAdditionalPayment PaymentBase where
supertype v = PaymentBase_ReturnSwapAdditionalPayment v
data ReturnSwapAmount = ReturnSwapAmount
{ returnSwapAmount_choice0 :: (Maybe (OneOf3 IdentifiedCurrency DeterminationMethod IdentifiedCurrencyReference))
, returnSwapAmount_choice1 :: (Maybe (OneOf3 ReferenceAmount Formula Xsd.Base64Binary))
, returnSwapAmount_calculationDates :: Maybe AdjustableRelativeOrPeriodicDates
, returnSwapAmount_cashSettlement :: Maybe Xsd.Boolean
, returnSwapAmount_optionsExchangeDividends :: Maybe Xsd.Boolean
, returnSwapAmount_additionalDividends :: Maybe Xsd.Boolean
, returnSwapAmount_allDividends :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType ReturnSwapAmount where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ReturnSwapAmount
`apply` optional (oneOf' [ ("IdentifiedCurrency", fmap OneOf3 (parseSchemaType "currency"))
, ("DeterminationMethod", fmap TwoOf3 (parseSchemaType "determinationMethod"))
, ("IdentifiedCurrencyReference", fmap ThreeOf3 (parseSchemaType "currencyReference"))
])
`apply` optional (oneOf' [ ("ReferenceAmount", fmap OneOf3 (parseSchemaType "referenceAmount"))
, ("Formula", fmap TwoOf3 (parseSchemaType "formula"))
, ("Xsd.Base64Binary", fmap ThreeOf3 (parseSchemaType "encodedDescription"))
])
`apply` optional (parseSchemaType "calculationDates")
`apply` optional (parseSchemaType "cashSettlement")
`apply` optional (parseSchemaType "optionsExchangeDividends")
`apply` optional (parseSchemaType "additionalDividends")
`apply` optional (parseSchemaType "allDividends")
schemaTypeToXML s x@ReturnSwapAmount{} =
toXMLElement s []
[ maybe [] (foldOneOf3 (schemaTypeToXML "currency")
(schemaTypeToXML "determinationMethod")
(schemaTypeToXML "currencyReference")
) $ returnSwapAmount_choice0 x
, maybe [] (foldOneOf3 (schemaTypeToXML "referenceAmount")
(schemaTypeToXML "formula")
(schemaTypeToXML "encodedDescription")
) $ returnSwapAmount_choice1 x
, maybe [] (schemaTypeToXML "calculationDates") $ returnSwapAmount_calculationDates x
, maybe [] (schemaTypeToXML "cashSettlement") $ returnSwapAmount_cashSettlement x
, maybe [] (schemaTypeToXML "optionsExchangeDividends") $ returnSwapAmount_optionsExchangeDividends x
, maybe [] (schemaTypeToXML "additionalDividends") $ returnSwapAmount_additionalDividends x
, maybe [] (schemaTypeToXML "allDividends") $ returnSwapAmount_allDividends x
]
instance Extension ReturnSwapAmount LegAmount where
supertype (ReturnSwapAmount e0 e1 e2 e3 e4 e5 e6) =
LegAmount e0 e1 e2
data ReturnSwapBase
= ReturnSwapBase_ReturnSwap ReturnSwap
| ReturnSwapBase_EquitySwapTransactionSupplement EquitySwapTransactionSupplement
deriving (Eq,Show)
instance SchemaType ReturnSwapBase where
parseSchemaType s = do
(fmap ReturnSwapBase_ReturnSwap $ parseSchemaType s)
`onFail`
(fmap ReturnSwapBase_EquitySwapTransactionSupplement $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of ReturnSwapBase,\n\
\ namely one of:\n\
\ReturnSwap,EquitySwapTransactionSupplement"
schemaTypeToXML _s (ReturnSwapBase_ReturnSwap x) = schemaTypeToXML "returnSwap" x
schemaTypeToXML _s (ReturnSwapBase_EquitySwapTransactionSupplement x) = schemaTypeToXML "equitySwapTransactionSupplement" x
instance Extension ReturnSwapBase Product where
supertype v = Product_ReturnSwapBase v
data ReturnSwapEarlyTermination = ReturnSwapEarlyTermination
{ returnSwapEarlyTermin_partyReference :: Maybe PartyReference
, returnSwapEarlyTermin_startingDate :: Maybe StartingDate
}
deriving (Eq,Show)
instance SchemaType ReturnSwapEarlyTermination where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ReturnSwapEarlyTermination
`apply` optional (parseSchemaType "partyReference")
`apply` optional (parseSchemaType "startingDate")
schemaTypeToXML s x@ReturnSwapEarlyTermination{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "partyReference") $ returnSwapEarlyTermin_partyReference x
, maybe [] (schemaTypeToXML "startingDate") $ returnSwapEarlyTermin_startingDate x
]
data ReturnSwapLegUnderlyer
= ReturnSwapLegUnderlyer_ReturnLeg ReturnLeg
deriving (Eq,Show)
instance SchemaType ReturnSwapLegUnderlyer where
parseSchemaType s = do
(fmap ReturnSwapLegUnderlyer_ReturnLeg $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of ReturnSwapLegUnderlyer,\n\
\ namely one of:\n\
\ReturnLeg"
schemaTypeToXML _s (ReturnSwapLegUnderlyer_ReturnLeg x) = schemaTypeToXML "returnLeg" x
instance Extension ReturnSwapLegUnderlyer DirectionalLeg where
supertype v = DirectionalLeg_ReturnSwapLegUnderlyer v
data ReturnSwapNotional = ReturnSwapNotional
{ returnSwapNotion_ID :: Maybe Xsd.ID
, returnSwapNotion_choice0 :: (Maybe (OneOf4 ReturnSwapNotionalAmountReference DeterminationMethodReference DeterminationMethod NotionalAmount))
}
deriving (Eq,Show)
instance SchemaType ReturnSwapNotional where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ReturnSwapNotional a0)
`apply` optional (oneOf' [ ("ReturnSwapNotionalAmountReference", fmap OneOf4 (parseSchemaType "relativeNotionalAmount"))
, ("DeterminationMethodReference", fmap TwoOf4 (parseSchemaType "relativeDeterminationMethod"))
, ("DeterminationMethod", fmap ThreeOf4 (parseSchemaType "determinationMethod"))
, ("NotionalAmount", fmap FourOf4 (parseSchemaType "notionalAmount"))
])
schemaTypeToXML s x@ReturnSwapNotional{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ returnSwapNotion_ID x
]
[ maybe [] (foldOneOf4 (schemaTypeToXML "relativeNotionalAmount")
(schemaTypeToXML "relativeDeterminationMethod")
(schemaTypeToXML "determinationMethod")
(schemaTypeToXML "notionalAmount")
) $ returnSwapNotion_choice0 x
]
data ReturnSwapPaymentDates = ReturnSwapPaymentDates
{ returnSwapPaymentDates_ID :: Maybe Xsd.ID
, returnSwapPaymentDates_paymentDatesInterim :: Maybe AdjustableOrRelativeDates
, returnSwapPaymentDates_paymentDateFinal :: Maybe AdjustableOrRelativeDate
}
deriving (Eq,Show)
instance SchemaType ReturnSwapPaymentDates where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ReturnSwapPaymentDates a0)
`apply` optional (parseSchemaType "paymentDatesInterim")
`apply` optional (parseSchemaType "paymentDateFinal")
schemaTypeToXML s x@ReturnSwapPaymentDates{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ returnSwapPaymentDates_ID x
]
[ maybe [] (schemaTypeToXML "paymentDatesInterim") $ returnSwapPaymentDates_paymentDatesInterim x
, maybe [] (schemaTypeToXML "paymentDateFinal") $ returnSwapPaymentDates_paymentDateFinal x
]
data StartingDate = StartingDate
{ startingDate_choice0 :: (Maybe (OneOf2 DateReference AdjustableDate))
}
deriving (Eq,Show)
instance SchemaType StartingDate where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return StartingDate
`apply` optional (oneOf' [ ("DateReference", fmap OneOf2 (parseSchemaType "dateRelativeTo"))
, ("AdjustableDate", fmap TwoOf2 (parseSchemaType "adjustableDate"))
])
schemaTypeToXML s x@StartingDate{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "dateRelativeTo")
(schemaTypeToXML "adjustableDate")
) $ startingDate_choice0 x
]
data StubCalculationPeriod = StubCalculationPeriod
{ stubCalcPeriod_choice0 :: (Maybe (OneOf1 ((Maybe (Stub)),(Maybe (Stub)))))
}
deriving (Eq,Show)
instance SchemaType StubCalculationPeriod where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return StubCalculationPeriod
`apply` optional (oneOf' [ ("Maybe Stub Maybe Stub", fmap OneOf1 (return (,) `apply` optional (parseSchemaType "initialStub")
`apply` optional (parseSchemaType "finalStub")))
])
schemaTypeToXML s x@StubCalculationPeriod{} =
toXMLElement s []
[ maybe [] (foldOneOf1 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "initialStub") a
, maybe [] (schemaTypeToXML "finalStub") b
])
) $ stubCalcPeriod_choice0 x
]
data Variance = Variance
{ variance_choice0 :: (Maybe (OneOf3 Xsd.Decimal Xsd.Boolean Xsd.Boolean))
, variance_expectedN :: Maybe Xsd.PositiveInteger
, variance_amount :: Maybe NonNegativeMoney
, variance_choice3 :: (Maybe (OneOf2 NonNegativeDecimal NonNegativeDecimal))
, variance_cap :: Maybe Xsd.Boolean
, variance_unadjustedVarianceCap :: Maybe PositiveDecimal
, variance_boundedVariance :: Maybe BoundedVariance
, variance_exchangeTradedContractNearest :: Maybe ExchangeTradedContract
, variance_vegaNotionalAmount :: Maybe Xsd.Decimal
}
deriving (Eq,Show)
instance SchemaType Variance where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Variance
`apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf3 (parseSchemaType "initialLevel"))
, ("Xsd.Boolean", fmap TwoOf3 (parseSchemaType "closingLevel"))
, ("Xsd.Boolean", fmap ThreeOf3 (parseSchemaType "expiringLevel"))
])
`apply` optional (parseSchemaType "expectedN")
`apply` optional (parseSchemaType "varianceAmount")
`apply` optional (oneOf' [ ("NonNegativeDecimal", fmap OneOf2 (parseSchemaType "volatilityStrikePrice"))
, ("NonNegativeDecimal", fmap TwoOf2 (parseSchemaType "varianceStrikePrice"))
])
`apply` optional (parseSchemaType "varianceCap")
`apply` optional (parseSchemaType "unadjustedVarianceCap")
`apply` optional (parseSchemaType "boundedVariance")
`apply` optional (parseSchemaType "exchangeTradedContractNearest")
`apply` optional (parseSchemaType "vegaNotionalAmount")
schemaTypeToXML s x@Variance{} =
toXMLElement s []
[ maybe [] (foldOneOf3 (schemaTypeToXML "initialLevel")
(schemaTypeToXML "closingLevel")
(schemaTypeToXML "expiringLevel")
) $ variance_choice0 x
, maybe [] (schemaTypeToXML "expectedN") $ variance_expectedN x
, maybe [] (schemaTypeToXML "varianceAmount") $ variance_amount x
, maybe [] (foldOneOf2 (schemaTypeToXML "volatilityStrikePrice")
(schemaTypeToXML "varianceStrikePrice")
) $ variance_choice3 x
, maybe [] (schemaTypeToXML "varianceCap") $ variance_cap x
, maybe [] (schemaTypeToXML "unadjustedVarianceCap") $ variance_unadjustedVarianceCap x
, maybe [] (schemaTypeToXML "boundedVariance") $ variance_boundedVariance x
, maybe [] (schemaTypeToXML "exchangeTradedContractNearest") $ variance_exchangeTradedContractNearest x
, maybe [] (schemaTypeToXML "vegaNotionalAmount") $ variance_vegaNotionalAmount x
]
instance Extension Variance CalculationFromObservation where
supertype v = CalculationFromObservation_Variance v
elementInterestLeg :: XMLParser InterestLeg
elementInterestLeg = parseSchemaType "interestLeg"
elementToXMLInterestLeg :: InterestLeg -> [Content ()]
elementToXMLInterestLeg = schemaTypeToXML "interestLeg"
elementReturnLeg :: XMLParser ReturnLeg
elementReturnLeg = parseSchemaType "returnLeg"
elementToXMLReturnLeg :: ReturnLeg -> [Content ()]
elementToXMLReturnLeg = schemaTypeToXML "returnLeg"
elementReturnSwap :: XMLParser ReturnSwap
elementReturnSwap = parseSchemaType "returnSwap"
elementToXMLReturnSwap :: ReturnSwap -> [Content ()]
elementToXMLReturnSwap = schemaTypeToXML "returnSwap"
elementReturnSwapLeg :: XMLParser DirectionalLeg
elementReturnSwapLeg = fmap supertype elementReturnLeg
`onFail`
fmap supertype elementInterestLeg
`onFail` fail "Parse failed when expecting an element in the substitution group for\n\
\ <returnSwapLeg>,\n\
\ namely one of:\n\
\<returnLeg>, <interestLeg>"
elementToXMLReturnSwapLeg :: DirectionalLeg -> [Content ()]
elementToXMLReturnSwapLeg = schemaTypeToXML "returnSwapLeg"