module Data.FpML.V53.Processes.Recordkeeping
( module Data.FpML.V53.Processes.Recordkeeping
, module Data.FpML.V53.Events.Business
) 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.Events.Business
data NonpublicExecutionReport = NonpublicExecutionReport
{ nonpubExecutReport_fpmlVersion :: Xsd.XsdString
, nonpubExecutReport_expectedBuild :: Maybe Xsd.PositiveInteger
, nonpubExecutReport_actualBuild :: Maybe Xsd.PositiveInteger
, nonpubExecutReport_header :: Maybe RequestMessageHeader
, nonpubExecutReport_validation :: [Validation]
, nonpubExecutReport_isCorrection :: Maybe Xsd.Boolean
, nonpubExecutReport_parentCorrelationId :: Maybe CorrelationId
, nonpubExecutReport_correlationId :: [CorrelationId]
, nonpubExecutReport_sequenceNumber :: Maybe Xsd.PositiveInteger
, nonpubExecutReport_onBehalfOf :: [OnBehalfOf]
, nonpubExecutReport_asOfDate :: Maybe IdentifiedDate
, nonpubExecutReport_asOfTime :: Maybe Xsd.Time
, nonpubExecutReport_portfolioReference :: Maybe PortfolioReferenceBase
, nonpubExecutReport_choice10 :: (Maybe (OneOf10 ((Maybe (OriginatingEvent)),(Maybe (Trade))) TradeAmendmentContent TradeNotionalChange ((Maybe (TerminatingEvent)),(Maybe (TradeNotionalChange))) TradeNovationContent OptionExercise [OptionExpiry] DeClear Withdrawal AdditionalEvent))
, nonpubExecutReport_quote :: [BasicQuotation]
, nonpubExecutReport_party :: [Party]
, nonpubExecutReport_account :: [Account]
}
deriving (Eq,Show)
instance SchemaType NonpublicExecutionReport where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "fpmlVersion" e pos
a1 <- optional $ getAttribute "expectedBuild" e pos
a2 <- optional $ getAttribute "actualBuild" e pos
commit $ interior e $ return (NonpublicExecutionReport a0 a1 a2)
`apply` optional (parseSchemaType "header")
`apply` many (parseSchemaType "validation")
`apply` optional (parseSchemaType "isCorrection")
`apply` optional (parseSchemaType "parentCorrelationId")
`apply` between (Occurs (Just 0) (Just 2))
(parseSchemaType "correlationId")
`apply` optional (parseSchemaType "sequenceNumber")
`apply` between (Occurs (Just 0) (Just 4))
(parseSchemaType "onBehalfOf")
`apply` optional (parseSchemaType "asOfDate")
`apply` optional (parseSchemaType "asOfTime")
`apply` optional (parseSchemaType "portfolioReference")
`apply` optional (oneOf' [ ("Maybe OriginatingEvent Maybe Trade", fmap OneOf10 (return (,) `apply` optional (parseSchemaType "originatingEvent")
`apply` optional (parseSchemaType "trade")))
, ("TradeAmendmentContent", fmap TwoOf10 (parseSchemaType "amendment"))
, ("TradeNotionalChange", fmap ThreeOf10 (parseSchemaType "increase"))
, ("Maybe TerminatingEvent Maybe TradeNotionalChange", fmap FourOf10 (return (,) `apply` optional (parseSchemaType "terminatingEvent")
`apply` optional (parseSchemaType "termination")))
, ("TradeNovationContent", fmap FiveOf10 (parseSchemaType "novation"))
, ("OptionExercise", fmap SixOf10 (parseSchemaType "optionExercise"))
, ("[OptionExpiry]", fmap SevenOf10 (many1 (parseSchemaType "optionExpiry")))
, ("DeClear", fmap EightOf10 (parseSchemaType "deClear"))
, ("Withdrawal", fmap NineOf10 (parseSchemaType "withdrawal"))
, ("AdditionalEvent", fmap TenOf10 (elementAdditionalEvent))
])
`apply` many (parseSchemaType "quote")
`apply` many (parseSchemaType "party")
`apply` many (parseSchemaType "account")
schemaTypeToXML s x@NonpublicExecutionReport{} =
toXMLElement s [ toXMLAttribute "fpmlVersion" $ nonpubExecutReport_fpmlVersion x
, maybe [] (toXMLAttribute "expectedBuild") $ nonpubExecutReport_expectedBuild x
, maybe [] (toXMLAttribute "actualBuild") $ nonpubExecutReport_actualBuild x
]
[ maybe [] (schemaTypeToXML "header") $ nonpubExecutReport_header x
, concatMap (schemaTypeToXML "validation") $ nonpubExecutReport_validation x
, maybe [] (schemaTypeToXML "isCorrection") $ nonpubExecutReport_isCorrection x
, maybe [] (schemaTypeToXML "parentCorrelationId") $ nonpubExecutReport_parentCorrelationId x
, concatMap (schemaTypeToXML "correlationId") $ nonpubExecutReport_correlationId x
, maybe [] (schemaTypeToXML "sequenceNumber") $ nonpubExecutReport_sequenceNumber x
, concatMap (schemaTypeToXML "onBehalfOf") $ nonpubExecutReport_onBehalfOf x
, maybe [] (schemaTypeToXML "asOfDate") $ nonpubExecutReport_asOfDate x
, maybe [] (schemaTypeToXML "asOfTime") $ nonpubExecutReport_asOfTime x
, maybe [] (schemaTypeToXML "portfolioReference") $ nonpubExecutReport_portfolioReference x
, maybe [] (foldOneOf10 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "originatingEvent") a
, maybe [] (schemaTypeToXML "trade") b
])
(schemaTypeToXML "amendment")
(schemaTypeToXML "increase")
(\ (a,b) -> concat [ maybe [] (schemaTypeToXML "terminatingEvent") a
, maybe [] (schemaTypeToXML "termination") b
])
(schemaTypeToXML "novation")
(schemaTypeToXML "optionExercise")
(concatMap (schemaTypeToXML "optionExpiry"))
(schemaTypeToXML "deClear")
(schemaTypeToXML "withdrawal")
(elementToXMLAdditionalEvent)
) $ nonpubExecutReport_choice10 x
, concatMap (schemaTypeToXML "quote") $ nonpubExecutReport_quote x
, concatMap (schemaTypeToXML "party") $ nonpubExecutReport_party x
, concatMap (schemaTypeToXML "account") $ nonpubExecutReport_account x
]
instance Extension NonpublicExecutionReport CorrectableRequestMessage where
supertype v = CorrectableRequestMessage_NonpublicExecutionReport v
instance Extension NonpublicExecutionReport RequestMessage where
supertype = (supertype :: CorrectableRequestMessage -> RequestMessage)
. (supertype :: NonpublicExecutionReport -> CorrectableRequestMessage)
instance Extension NonpublicExecutionReport Message where
supertype = (supertype :: RequestMessage -> Message)
. (supertype :: CorrectableRequestMessage -> RequestMessage)
. (supertype :: NonpublicExecutionReport -> CorrectableRequestMessage)
instance Extension NonpublicExecutionReport Document where
supertype = (supertype :: Message -> Document)
. (supertype :: RequestMessage -> Message)
. (supertype :: CorrectableRequestMessage -> RequestMessage)
. (supertype :: NonpublicExecutionReport -> CorrectableRequestMessage)
data NonpublicExecutionReportRetracted = NonpublicExecutionReportRetracted
{ nonpubExecutReportRetrac_fpmlVersion :: Xsd.XsdString
, nonpubExecutReportRetrac_expectedBuild :: Maybe Xsd.PositiveInteger
, nonpubExecutReportRetrac_actualBuild :: Maybe Xsd.PositiveInteger
, nonpubExecutReportRetrac_header :: Maybe RequestMessageHeader
, nonpubExecutReportRetrac_validation :: [Validation]
, nonpubExecutReportRetrac_parentCorrelationId :: Maybe CorrelationId
, nonpubExecutReportRetrac_correlationId :: [CorrelationId]
, nonpubExecutReportRetrac_sequenceNumber :: Maybe Xsd.PositiveInteger
, nonpubExecutReportRetrac_onBehalfOf :: [OnBehalfOf]
, nonpubExecutReportRetrac_choice6 :: OneOf2 ((Maybe (OneOf10 ((Maybe (OriginatingEvent)),(Maybe (Trade))) TradeAmendmentContent TradeNotionalChange ((Maybe (TerminatingEvent)),(Maybe (TradeNotionalChange))) TradeNovationContent OptionExercise [OptionExpiry] DeClear Withdrawal AdditionalEvent))) PartyTradeIdentifier
, nonpubExecutReportRetrac_party :: [Party]
, nonpubExecutReportRetrac_account :: [Account]
}
deriving (Eq,Show)
instance SchemaType NonpublicExecutionReportRetracted where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- getAttribute "fpmlVersion" e pos
a1 <- optional $ getAttribute "expectedBuild" e pos
a2 <- optional $ getAttribute "actualBuild" e pos
commit $ interior e $ return (NonpublicExecutionReportRetracted a0 a1 a2)
`apply` optional (parseSchemaType "header")
`apply` many (parseSchemaType "validation")
`apply` optional (parseSchemaType "parentCorrelationId")
`apply` between (Occurs (Just 0) (Just 2))
(parseSchemaType "correlationId")
`apply` optional (parseSchemaType "sequenceNumber")
`apply` between (Occurs (Just 0) (Just 4))
(parseSchemaType "onBehalfOf")
`apply` oneOf' [ ("(Maybe (OneOf10 ((Maybe (OriginatingEvent)),(Maybe (Trade))) TradeAmendmentContent TradeNotionalChange ((Maybe (TerminatingEvent)),(Maybe (TradeNotionalChange))) TradeNovationContent OptionExercise [OptionExpiry] DeClear Withdrawal AdditionalEvent))", fmap OneOf2 (optional (oneOf' [ ("Maybe OriginatingEvent Maybe Trade", fmap OneOf10 (return (,) `apply` optional (parseSchemaType "originatingEvent")
`apply` optional (parseSchemaType "trade")))
, ("TradeAmendmentContent", fmap TwoOf10 (parseSchemaType "amendment"))
, ("TradeNotionalChange", fmap ThreeOf10 (parseSchemaType "increase"))
, ("Maybe TerminatingEvent Maybe TradeNotionalChange", fmap FourOf10 (return (,) `apply` optional (parseSchemaType "terminatingEvent")
`apply` optional (parseSchemaType "termination")))
, ("TradeNovationContent", fmap FiveOf10 (parseSchemaType "novation"))
, ("OptionExercise", fmap SixOf10 (parseSchemaType "optionExercise"))
, ("[OptionExpiry]", fmap SevenOf10 (many1 (parseSchemaType "optionExpiry")))
, ("DeClear", fmap EightOf10 (parseSchemaType "deClear"))
, ("Withdrawal", fmap NineOf10 (parseSchemaType "withdrawal"))
, ("AdditionalEvent", fmap TenOf10 (elementAdditionalEvent))
])))
, ("PartyTradeIdentifier", fmap TwoOf2 (parseSchemaType "tradeIdentifier"))
]
`apply` many (parseSchemaType "party")
`apply` many (parseSchemaType "account")
schemaTypeToXML s x@NonpublicExecutionReportRetracted{} =
toXMLElement s [ toXMLAttribute "fpmlVersion" $ nonpubExecutReportRetrac_fpmlVersion x
, maybe [] (toXMLAttribute "expectedBuild") $ nonpubExecutReportRetrac_expectedBuild x
, maybe [] (toXMLAttribute "actualBuild") $ nonpubExecutReportRetrac_actualBuild x
]
[ maybe [] (schemaTypeToXML "header") $ nonpubExecutReportRetrac_header x
, concatMap (schemaTypeToXML "validation") $ nonpubExecutReportRetrac_validation x
, maybe [] (schemaTypeToXML "parentCorrelationId") $ nonpubExecutReportRetrac_parentCorrelationId x
, concatMap (schemaTypeToXML "correlationId") $ nonpubExecutReportRetrac_correlationId x
, maybe [] (schemaTypeToXML "sequenceNumber") $ nonpubExecutReportRetrac_sequenceNumber x
, concatMap (schemaTypeToXML "onBehalfOf") $ nonpubExecutReportRetrac_onBehalfOf x
, foldOneOf2 (maybe [] (foldOneOf10 (\ (a,b) -> concat [ maybe [] (schemaTypeToXML "originatingEvent") a
, maybe [] (schemaTypeToXML "trade") b
])
(schemaTypeToXML "amendment")
(schemaTypeToXML "increase")
(\ (a,b) -> concat [ maybe [] (schemaTypeToXML "terminatingEvent") a
, maybe [] (schemaTypeToXML "termination") b
])
(schemaTypeToXML "novation")
(schemaTypeToXML "optionExercise")
(concatMap (schemaTypeToXML "optionExpiry"))
(schemaTypeToXML "deClear")
(schemaTypeToXML "withdrawal")
(elementToXMLAdditionalEvent)
))
(schemaTypeToXML "tradeIdentifier")
$ nonpubExecutReportRetrac_choice6 x
, concatMap (schemaTypeToXML "party") $ nonpubExecutReportRetrac_party x
, concatMap (schemaTypeToXML "account") $ nonpubExecutReportRetrac_account x
]
instance Extension NonpublicExecutionReportRetracted NonCorrectableRequestMessage where
supertype v = NonCorrectableRequestMessage_NonpublicExecutionReportRetracted v
instance Extension NonpublicExecutionReportRetracted RequestMessage where
supertype = (supertype :: NonCorrectableRequestMessage -> RequestMessage)
. (supertype :: NonpublicExecutionReportRetracted -> NonCorrectableRequestMessage)
instance Extension NonpublicExecutionReportRetracted Message where
supertype = (supertype :: RequestMessage -> Message)
. (supertype :: NonCorrectableRequestMessage -> RequestMessage)
. (supertype :: NonpublicExecutionReportRetracted -> NonCorrectableRequestMessage)
instance Extension NonpublicExecutionReportRetracted Document where
supertype = (supertype :: Message -> Document)
. (supertype :: RequestMessage -> Message)
. (supertype :: NonCorrectableRequestMessage -> RequestMessage)
. (supertype :: NonpublicExecutionReportRetracted -> NonCorrectableRequestMessage)
elementNonpublicExecutionReport :: XMLParser NonpublicExecutionReport
elementNonpublicExecutionReport = parseSchemaType "nonpublicExecutionReport"
elementToXMLNonpublicExecutionReport :: NonpublicExecutionReport -> [Content ()]
elementToXMLNonpublicExecutionReport = schemaTypeToXML "nonpublicExecutionReport"
elementNonpublicExecutionReportRetracted :: XMLParser NonpublicExecutionReportRetracted
elementNonpublicExecutionReportRetracted = parseSchemaType "nonpublicExecutionReportRetracted"
elementToXMLNonpublicExecutionReportRetracted :: NonpublicExecutionReportRetracted -> [Content ()]
elementToXMLNonpublicExecutionReportRetracted = schemaTypeToXML "nonpublicExecutionReportRetracted"
elementNonpublicExecutionReportAcknowledgement :: XMLParser Acknowledgement
elementNonpublicExecutionReportAcknowledgement = parseSchemaType "nonpublicExecutionReportAcknowledgement"
elementToXMLNonpublicExecutionReportAcknowledgement :: Acknowledgement -> [Content ()]
elementToXMLNonpublicExecutionReportAcknowledgement = schemaTypeToXML "nonpublicExecutionReportAcknowledgement"
elementNonpublicExecutionReportException :: XMLParser Exception
elementNonpublicExecutionReportException = parseSchemaType "nonpublicExecutionReportException"
elementToXMLNonpublicExecutionReportException :: Exception -> [Content ()]
elementToXMLNonpublicExecutionReportException = schemaTypeToXML "nonpublicExecutionReportException"