module Data.FpML.V53.Swaps.Dividend
( module Data.FpML.V53.Swaps.Dividend
, module Data.FpML.V53.Shared.EQ
, module Data.FpML.V53.Shared
) where
import Text.XML.HaXml.Schema.Schema (SchemaType(..),SimpleType(..),Extension(..),Restricts(..))
import Text.XML.HaXml.Schema.Schema as Schema
import Text.XML.HaXml.OneOfN
import qualified Text.XML.HaXml.Schema.PrimitiveTypes as Xsd
import Data.FpML.V53.Shared.EQ
import Data.FpML.V53.Shared
data DividendLeg = DividendLeg
{ dividendLeg_ID :: Maybe Xsd.ID
, dividendLeg_legIdentifier :: [LegIdentifier]
, dividendLeg_payerPartyReference :: Maybe PartyReference
, dividendLeg_payerAccountReference :: Maybe AccountReference
, dividendLeg_receiverPartyReference :: Maybe PartyReference
, dividendLeg_receiverAccountReference :: Maybe AccountReference
, dividendLeg_effectiveDate :: Maybe AdjustableOrRelativeDate
, dividendLeg_terminationDate :: Maybe AdjustableOrRelativeDate
, dividendLeg_underlyer :: Maybe Underlyer
, dividendLeg_settlementType :: Maybe SettlementTypeEnum
, dividendLeg_settlementDate :: Maybe AdjustableOrRelativeDate
, dividendLeg_choice10 :: (Maybe (OneOf2 Money Currency))
, dividendLeg_fxFeature :: Maybe FxFeature
, dividendLeg_declaredCashDividendPercentage :: Maybe NonNegativeDecimal
, dividendLeg_declaredCashEquivalentDividendPercentage :: Maybe NonNegativeDecimal
, dividendLeg_dividendPeriod :: [DividendPeriodPayment]
, dividendLeg_specialDividends :: Maybe Xsd.Boolean
, dividendLeg_materialDividend :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType DividendLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (DividendLeg 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 "declaredCashDividendPercentage")
`apply` optional (parseSchemaType "declaredCashEquivalentDividendPercentage")
`apply` many (parseSchemaType "dividendPeriod")
`apply` optional (parseSchemaType "specialDividends")
`apply` optional (parseSchemaType "materialDividend")
schemaTypeToXML s x@DividendLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ dividendLeg_ID x
]
[ concatMap (schemaTypeToXML "legIdentifier") $ dividendLeg_legIdentifier x
, maybe [] (schemaTypeToXML "payerPartyReference") $ dividendLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ dividendLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ dividendLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ dividendLeg_receiverAccountReference x
, maybe [] (schemaTypeToXML "effectiveDate") $ dividendLeg_effectiveDate x
, maybe [] (schemaTypeToXML "terminationDate") $ dividendLeg_terminationDate x
, maybe [] (schemaTypeToXML "underlyer") $ dividendLeg_underlyer x
, maybe [] (schemaTypeToXML "settlementType") $ dividendLeg_settlementType x
, maybe [] (schemaTypeToXML "settlementDate") $ dividendLeg_settlementDate x
, maybe [] (foldOneOf2 (schemaTypeToXML "settlementAmount")
(schemaTypeToXML "settlementCurrency")
) $ dividendLeg_choice10 x
, maybe [] (schemaTypeToXML "fxFeature") $ dividendLeg_fxFeature x
, maybe [] (schemaTypeToXML "declaredCashDividendPercentage") $ dividendLeg_declaredCashDividendPercentage x
, maybe [] (schemaTypeToXML "declaredCashEquivalentDividendPercentage") $ dividendLeg_declaredCashEquivalentDividendPercentage x
, concatMap (schemaTypeToXML "dividendPeriod") $ dividendLeg_dividendPeriod x
, maybe [] (schemaTypeToXML "specialDividends") $ dividendLeg_specialDividends x
, maybe [] (schemaTypeToXML "materialDividend") $ dividendLeg_materialDividend x
]
instance Extension DividendLeg DirectionalLegUnderlyer where
supertype v = DirectionalLegUnderlyer_DividendLeg v
instance Extension DividendLeg DirectionalLeg where
supertype = (supertype :: DirectionalLegUnderlyer -> DirectionalLeg)
. (supertype :: DividendLeg -> DirectionalLegUnderlyer)
instance Extension DividendLeg Leg where
supertype = (supertype :: DirectionalLeg -> Leg)
. (supertype :: DirectionalLegUnderlyer -> DirectionalLeg)
. (supertype :: DividendLeg -> DirectionalLegUnderlyer)
data DividendPeriodPayment = DividendPeriodPayment
{ dividPeriodPayment_ID :: Maybe Xsd.ID
, dividPeriodPayment_unadjustedStartDate :: Maybe IdentifiedDate
, dividPeriodPayment_unadjustedEndDate :: Maybe IdentifiedDate
, dividPeriodPayment_dateAdjustments :: Maybe BusinessDayAdjustments
, dividPeriodPayment_underlyerReference :: Maybe AssetReference
, dividPeriodPayment_fixedStrike :: Maybe PositiveDecimal
, dividPeriodPayment_paymentDate :: Maybe AdjustableOrRelativeDate
, dividPeriodPayment_valuationDate :: Maybe AdjustableOrRelativeDate
}
deriving (Eq,Show)
instance SchemaType DividendPeriodPayment where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (DividendPeriodPayment a0)
`apply` optional (parseSchemaType "unadjustedStartDate")
`apply` optional (parseSchemaType "unadjustedEndDate")
`apply` optional (parseSchemaType "dateAdjustments")
`apply` optional (parseSchemaType "underlyerReference")
`apply` optional (parseSchemaType "fixedStrike")
`apply` optional (parseSchemaType "paymentDate")
`apply` optional (parseSchemaType "valuationDate")
schemaTypeToXML s x@DividendPeriodPayment{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ dividPeriodPayment_ID x
]
[ maybe [] (schemaTypeToXML "unadjustedStartDate") $ dividPeriodPayment_unadjustedStartDate x
, maybe [] (schemaTypeToXML "unadjustedEndDate") $ dividPeriodPayment_unadjustedEndDate x
, maybe [] (schemaTypeToXML "dateAdjustments") $ dividPeriodPayment_dateAdjustments x
, maybe [] (schemaTypeToXML "underlyerReference") $ dividPeriodPayment_underlyerReference x
, maybe [] (schemaTypeToXML "fixedStrike") $ dividPeriodPayment_fixedStrike x
, maybe [] (schemaTypeToXML "paymentDate") $ dividPeriodPayment_paymentDate x
, maybe [] (schemaTypeToXML "valuationDate") $ dividPeriodPayment_valuationDate x
]
instance Extension DividendPeriodPayment DividendPeriod where
supertype v = DividendPeriod_DividendPeriodPayment v
data DividendSwapTransactionSupplement = DividendSwapTransactionSupplement
{ dividSwapTransSuppl_ID :: Maybe Xsd.ID
, dividSwapTransSuppl_primaryAssetClass :: Maybe AssetClass
, dividSwapTransSuppl_secondaryAssetClass :: [AssetClass]
, dividSwapTransSuppl_productType :: [ProductType]
, dividSwapTransSuppl_productId :: [ProductId]
, dividSwapTransSuppl_dividendLeg :: Maybe DividendLeg
, dividSwapTransSuppl_fixedLeg :: Maybe FixedPaymentLeg
, dividSwapTransSuppl_choice6 :: (Maybe (OneOf2 Xsd.Boolean Xsd.Boolean))
, dividSwapTransSuppl_localJurisdiction :: Maybe CountryCode
, dividSwapTransSuppl_relevantJurisdiction :: Maybe CountryCode
}
deriving (Eq,Show)
instance SchemaType DividendSwapTransactionSupplement where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (DividendSwapTransactionSupplement a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "dividendLeg")
`apply` optional (parseSchemaType "fixedLeg")
`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@DividendSwapTransactionSupplement{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ dividSwapTransSuppl_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ dividSwapTransSuppl_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ dividSwapTransSuppl_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ dividSwapTransSuppl_productType x
, concatMap (schemaTypeToXML "productId") $ dividSwapTransSuppl_productId x
, maybe [] (schemaTypeToXML "dividendLeg") $ dividSwapTransSuppl_dividendLeg x
, maybe [] (schemaTypeToXML "fixedLeg") $ dividSwapTransSuppl_fixedLeg x
, maybe [] (foldOneOf2 (schemaTypeToXML "multipleExchangeIndexAnnexFallback")
(schemaTypeToXML "componentSecurityIndexAnnexFallback")
) $ dividSwapTransSuppl_choice6 x
, maybe [] (schemaTypeToXML "localJurisdiction") $ dividSwapTransSuppl_localJurisdiction x
, maybe [] (schemaTypeToXML "relevantJurisdiction") $ dividSwapTransSuppl_relevantJurisdiction x
]
instance Extension DividendSwapTransactionSupplement Product where
supertype v = Product_DividendSwapTransactionSupplement v
data FixedPaymentAmount = FixedPaymentAmount
{ fixedPaymentAmount_ID :: Maybe Xsd.ID
, fixedPaymentAmount_paymentAmount :: Maybe NonNegativeMoney
, fixedPaymentAmount_paymentDate :: Maybe RelativeDateOffset
}
deriving (Eq,Show)
instance SchemaType FixedPaymentAmount where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FixedPaymentAmount a0)
`apply` optional (parseSchemaType "paymentAmount")
`apply` optional (parseSchemaType "paymentDate")
schemaTypeToXML s x@FixedPaymentAmount{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fixedPaymentAmount_ID x
]
[ maybe [] (schemaTypeToXML "paymentAmount") $ fixedPaymentAmount_paymentAmount x
, maybe [] (schemaTypeToXML "paymentDate") $ fixedPaymentAmount_paymentDate x
]
instance Extension FixedPaymentAmount PaymentBase where
supertype v = PaymentBase_FixedPaymentAmount v
data FixedPaymentLeg = FixedPaymentLeg
{ fixedPaymentLeg_ID :: Maybe Xsd.ID
, fixedPaymentLeg_legIdentifier :: [LegIdentifier]
, fixedPaymentLeg_payerPartyReference :: Maybe PartyReference
, fixedPaymentLeg_payerAccountReference :: Maybe AccountReference
, fixedPaymentLeg_receiverPartyReference :: Maybe PartyReference
, fixedPaymentLeg_receiverAccountReference :: Maybe AccountReference
, fixedPaymentLeg_effectiveDate :: Maybe AdjustableOrRelativeDate
, fixedPaymentLeg_terminationDate :: Maybe AdjustableOrRelativeDate
, fixedPaymentLeg_fixedPayment :: [FixedPaymentAmount]
}
deriving (Eq,Show)
instance SchemaType FixedPaymentLeg where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (FixedPaymentLeg 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` many (parseSchemaType "fixedPayment")
schemaTypeToXML s x@FixedPaymentLeg{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ fixedPaymentLeg_ID x
]
[ concatMap (schemaTypeToXML "legIdentifier") $ fixedPaymentLeg_legIdentifier x
, maybe [] (schemaTypeToXML "payerPartyReference") $ fixedPaymentLeg_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ fixedPaymentLeg_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ fixedPaymentLeg_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ fixedPaymentLeg_receiverAccountReference x
, maybe [] (schemaTypeToXML "effectiveDate") $ fixedPaymentLeg_effectiveDate x
, maybe [] (schemaTypeToXML "terminationDate") $ fixedPaymentLeg_terminationDate x
, concatMap (schemaTypeToXML "fixedPayment") $ fixedPaymentLeg_fixedPayment x
]
instance Extension FixedPaymentLeg DirectionalLeg where
supertype v = DirectionalLeg_FixedPaymentLeg v
instance Extension FixedPaymentLeg Leg where
supertype = (supertype :: DirectionalLeg -> Leg)
. (supertype :: FixedPaymentLeg -> DirectionalLeg)
elementDividendSwapTransactionSupplement :: XMLParser DividendSwapTransactionSupplement
elementDividendSwapTransactionSupplement = parseSchemaType "dividendSwapTransactionSupplement"
elementToXMLDividendSwapTransactionSupplement :: DividendSwapTransactionSupplement -> [Content ()]
elementToXMLDividendSwapTransactionSupplement = schemaTypeToXML "dividendSwapTransactionSupplement"