module Data.FpML.V53.Doc
( module Data.FpML.V53.Doc
, module Data.FpML.V53.Asset
) 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.Asset
import Data.FpML.V53.Msg ( Message )
newtype QueryParameterValue = QueryParameterValue Xsd.XsdString deriving (Eq,Show)
instance Restricts QueryParameterValue Xsd.XsdString where
restricts (QueryParameterValue x) = x
instance SchemaType QueryParameterValue where
parseSchemaType s = do
e <- element [s]
commit $ interior e $ parseSimpleType
schemaTypeToXML s (QueryParameterValue x) =
toXMLElement s [] [toXMLText (simpleTypeText x)]
instance SimpleType QueryParameterValue where
acceptingParser = fmap QueryParameterValue acceptingParser
simpleTypeText (QueryParameterValue x) = simpleTypeText x
data Allocation = Allocation
{ allocation_tradeId :: Maybe TradeIdentifier
, allocation_partyReference :: PartyReference
, allocation_accountReference :: Maybe AccountReference
, allocation_choice3 :: (Maybe (OneOf2 Xsd.Decimal [Money]))
, allocation_collateral :: Maybe Collateral
, allocation_creditChargeAmount :: Maybe Money
, allocation_approvals :: Maybe Approvals
, allocation_masterConfirmationDate :: Maybe Xsd.Date
, allocation_relatedParty :: [RelatedParty]
}
deriving (Eq,Show)
instance SchemaType Allocation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Allocation
`apply` optional (parseSchemaType "allocationTradeId")
`apply` parseSchemaType "partyReference"
`apply` optional (parseSchemaType "accountReference")
`apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "allocatedFraction"))
, ("[Money]", fmap TwoOf2 (between (Occurs (Just 1) (Just 2))
(parseSchemaType "allocatedNotional")))
])
`apply` optional (parseSchemaType "collateral")
`apply` optional (parseSchemaType "creditChargeAmount")
`apply` optional (parseSchemaType "approvals")
`apply` optional (parseSchemaType "masterConfirmationDate")
`apply` many (parseSchemaType "relatedParty")
schemaTypeToXML s x@Allocation{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "allocationTradeId") $ allocation_tradeId x
, schemaTypeToXML "partyReference" $ allocation_partyReference x
, maybe [] (schemaTypeToXML "accountReference") $ allocation_accountReference x
, maybe [] (foldOneOf2 (schemaTypeToXML "allocatedFraction")
(concatMap (schemaTypeToXML "allocatedNotional"))
) $ allocation_choice3 x
, maybe [] (schemaTypeToXML "collateral") $ allocation_collateral x
, maybe [] (schemaTypeToXML "creditChargeAmount") $ allocation_creditChargeAmount x
, maybe [] (schemaTypeToXML "approvals") $ allocation_approvals x
, maybe [] (schemaTypeToXML "masterConfirmationDate") $ allocation_masterConfirmationDate x
, concatMap (schemaTypeToXML "relatedParty") $ allocation_relatedParty x
]
data Allocations = Allocations
{ allocations_allocation :: [Allocation]
}
deriving (Eq,Show)
instance SchemaType Allocations where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Allocations
`apply` many (parseSchemaType "allocation")
schemaTypeToXML s x@Allocations{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "allocation") $ allocations_allocation x
]
data Approval = Approval
{ approval_type :: Maybe Xsd.NormalizedString
, approval_status :: Maybe Xsd.NormalizedString
, approval_approver :: Maybe Xsd.NormalizedString
}
deriving (Eq,Show)
instance SchemaType Approval where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Approval
`apply` optional (parseSchemaType "type")
`apply` optional (parseSchemaType "status")
`apply` optional (parseSchemaType "approver")
schemaTypeToXML s x@Approval{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "type") $ approval_type x
, maybe [] (schemaTypeToXML "status") $ approval_status x
, maybe [] (schemaTypeToXML "approver") $ approval_approver x
]
data Approvals = Approvals
{ approvals_approval :: [Approval]
}
deriving (Eq,Show)
instance SchemaType Approvals where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Approvals
`apply` many (parseSchemaType "approval")
schemaTypeToXML s x@Approvals{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "approval") $ approvals_approval x
]
data BestFitTrade = BestFitTrade
{ bestFitTrade_tradeIdentifier :: Maybe TradeIdentifier
, bestFitTrade_differences :: [TradeDifference]
}
deriving (Eq,Show)
instance SchemaType BestFitTrade where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return BestFitTrade
`apply` optional (parseSchemaType "tradeIdentifier")
`apply` many (parseSchemaType "differences")
schemaTypeToXML s x@BestFitTrade{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "tradeIdentifier") $ bestFitTrade_tradeIdentifier x
, concatMap (schemaTypeToXML "differences") $ bestFitTrade_differences x
]
data Collateral = Collateral
{ collateral_independentAmount :: Maybe IndependentAmount
}
deriving (Eq,Show)
instance SchemaType Collateral where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return Collateral
`apply` optional (parseSchemaType "independentAmount")
schemaTypeToXML s x@Collateral{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "independentAmount") $ collateral_independentAmount x
]
data ContractId = ContractId Scheme ContractIdAttributes deriving (Eq,Show)
data ContractIdAttributes = ContractIdAttributes
{ contrIdAttrib_contractIdScheme :: Xsd.AnyURI
, contrIdAttrib_ID :: Maybe Xsd.ID
}
deriving (Eq,Show)
instance SchemaType ContractId where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- getAttribute "contractIdScheme" e pos
a1 <- optional $ getAttribute "id" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ ContractId v (ContractIdAttributes a0 a1)
schemaTypeToXML s (ContractId bt at) =
addXMLAttributes [ toXMLAttribute "contractIdScheme" $ contrIdAttrib_contractIdScheme at
, maybe [] (toXMLAttribute "id") $ contrIdAttrib_ID at
]
$ schemaTypeToXML s bt
instance Extension ContractId Scheme where
supertype (ContractId s _) = s
data ContractIdentifier = ContractIdentifier
{ contrIdent_ID :: Maybe Xsd.ID
, contrIdent_partyReference :: Maybe PartyReference
, contrIdent_choice1 :: (Maybe (OneOf2 [ContractId] [VersionedContractId]))
}
deriving (Eq,Show)
instance SchemaType ContractIdentifier where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (ContractIdentifier a0)
`apply` optional (parseSchemaType "partyReference")
`apply` optional (oneOf' [ ("[ContractId]", fmap OneOf2 (many1 (parseSchemaType "contractId")))
, ("[VersionedContractId]", fmap TwoOf2 (many1 (parseSchemaType "versionedContractId")))
])
schemaTypeToXML s x@ContractIdentifier{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ contrIdent_ID x
]
[ maybe [] (schemaTypeToXML "partyReference") $ contrIdent_partyReference x
, maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "contractId"))
(concatMap (schemaTypeToXML "versionedContractId"))
) $ contrIdent_choice1 x
]
data CreditDerivativesNotices = CreditDerivativesNotices
{ creditDerivNotices_creditEvent :: Maybe Xsd.Boolean
, creditDerivNotices_publiclyAvailableInformation :: Maybe Xsd.Boolean
, creditDerivNotices_physicalSettlement :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType CreditDerivativesNotices where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return CreditDerivativesNotices
`apply` optional (parseSchemaType "creditEvent")
`apply` optional (parseSchemaType "publiclyAvailableInformation")
`apply` optional (parseSchemaType "physicalSettlement")
schemaTypeToXML s x@CreditDerivativesNotices{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "creditEvent") $ creditDerivNotices_creditEvent x
, maybe [] (schemaTypeToXML "publiclyAvailableInformation") $ creditDerivNotices_publiclyAvailableInformation x
, maybe [] (schemaTypeToXML "physicalSettlement") $ creditDerivNotices_physicalSettlement x
]
data DataDocument = DataDocument
{ dataDocument_fpmlVersion :: Xsd.XsdString
, dataDocument_expectedBuild :: Maybe Xsd.PositiveInteger
, dataDocument_actualBuild :: Maybe Xsd.PositiveInteger
, dataDocument_validation :: [Validation]
, dataDocument_choice1 :: (Maybe (OneOf2 Xsd.Boolean Xsd.Boolean))
, dataDocument_onBehalfOf :: Maybe OnBehalfOf
, dataDocument_originatingEvent :: Maybe OriginatingEvent
, dataDocument_trade :: [Trade]
, dataDocument_party :: [Party]
, dataDocument_account :: [Account]
}
deriving (Eq,Show)
instance SchemaType DataDocument 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 (DataDocument a0 a1 a2)
`apply` many (parseSchemaType "validation")
`apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf2 (parseSchemaType "isCorrection"))
, ("Xsd.Boolean", fmap TwoOf2 (parseSchemaType "isCancellation"))
])
`apply` optional (parseSchemaType "onBehalfOf")
`apply` optional (parseSchemaType "originatingEvent")
`apply` many1 (parseSchemaType "trade")
`apply` many (parseSchemaType "party")
`apply` many (parseSchemaType "account")
schemaTypeToXML s x@DataDocument{} =
toXMLElement s [ toXMLAttribute "fpmlVersion" $ dataDocument_fpmlVersion x
, maybe [] (toXMLAttribute "expectedBuild") $ dataDocument_expectedBuild x
, maybe [] (toXMLAttribute "actualBuild") $ dataDocument_actualBuild x
]
[ concatMap (schemaTypeToXML "validation") $ dataDocument_validation x
, maybe [] (foldOneOf2 (schemaTypeToXML "isCorrection")
(schemaTypeToXML "isCancellation")
) $ dataDocument_choice1 x
, maybe [] (schemaTypeToXML "onBehalfOf") $ dataDocument_onBehalfOf x
, maybe [] (schemaTypeToXML "originatingEvent") $ dataDocument_originatingEvent x
, concatMap (schemaTypeToXML "trade") $ dataDocument_trade x
, concatMap (schemaTypeToXML "party") $ dataDocument_party x
, concatMap (schemaTypeToXML "account") $ dataDocument_account x
]
instance Extension DataDocument Document where
supertype v = Document_DataDocument v
data Document
= Document_DataDocument DataDocument
| Document_Message Message
deriving (Eq,Show)
instance SchemaType Document where
parseSchemaType s = do
(fmap Document_DataDocument $ parseSchemaType s)
`onFail`
(fmap Document_Message $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of Document,\n\
\ namely one of:\n\
\DataDocument,Message"
schemaTypeToXML _s (Document_DataDocument x) = schemaTypeToXML "dataDocument" x
schemaTypeToXML _s (Document_Message x) = schemaTypeToXML "message" x
data ExecutionDateTime = ExecutionDateTime Xsd.DateTime ExecutionDateTimeAttributes deriving (Eq,Show)
data ExecutionDateTimeAttributes = ExecutionDateTimeAttributes
{ executDateTimeAttrib_executionDateTimeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType ExecutionDateTime where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "executionDateTimeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ ExecutionDateTime v (ExecutionDateTimeAttributes a0)
schemaTypeToXML s (ExecutionDateTime bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "executionDateTimeScheme") $ executDateTimeAttrib_executionDateTimeScheme at
]
$ schemaTypeToXML s bt
instance Extension ExecutionDateTime Xsd.DateTime where
supertype (ExecutionDateTime s _) = s
data FirstPeriodStartDate = FirstPeriodStartDate Xsd.Date FirstPeriodStartDateAttributes deriving (Eq,Show)
data FirstPeriodStartDateAttributes = FirstPeriodStartDateAttributes
{ firstPeriodStartDateAttrib_href :: Xsd.IDREF
}
deriving (Eq,Show)
instance SchemaType FirstPeriodStartDate where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- getAttribute "href" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ FirstPeriodStartDate v (FirstPeriodStartDateAttributes a0)
schemaTypeToXML s (FirstPeriodStartDate bt at) =
addXMLAttributes [ toXMLAttribute "href" $ firstPeriodStartDateAttrib_href at
]
$ schemaTypeToXML s bt
instance Extension FirstPeriodStartDate Xsd.Date where
supertype (FirstPeriodStartDate s _) = s
data IndependentAmount = IndependentAmount
{ indepAmount_payerPartyReference :: Maybe PartyReference
, indepAmount_payerAccountReference :: Maybe AccountReference
, indepAmount_receiverPartyReference :: Maybe PartyReference
, indepAmount_receiverAccountReference :: Maybe AccountReference
, indepAmount_paymentDetail :: [PaymentDetail]
}
deriving (Eq,Show)
instance SchemaType IndependentAmount where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return IndependentAmount
`apply` optional (parseSchemaType "payerPartyReference")
`apply` optional (parseSchemaType "payerAccountReference")
`apply` optional (parseSchemaType "receiverPartyReference")
`apply` optional (parseSchemaType "receiverAccountReference")
`apply` many (parseSchemaType "paymentDetail")
schemaTypeToXML s x@IndependentAmount{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "payerPartyReference") $ indepAmount_payerPartyReference x
, maybe [] (schemaTypeToXML "payerAccountReference") $ indepAmount_payerAccountReference x
, maybe [] (schemaTypeToXML "receiverPartyReference") $ indepAmount_receiverPartyReference x
, maybe [] (schemaTypeToXML "receiverAccountReference") $ indepAmount_receiverAccountReference x
, concatMap (schemaTypeToXML "paymentDetail") $ indepAmount_paymentDetail x
]
data InstrumentTradeDetails = InstrumentTradeDetails
{ instrTradeDetails_ID :: Maybe Xsd.ID
, instrTradeDetails_primaryAssetClass :: Maybe AssetClass
, instrTradeDetails_secondaryAssetClass :: [AssetClass]
, instrTradeDetails_productType :: [ProductType]
, instrTradeDetails_productId :: [ProductId]
, instrTradeDetails_buyerPartyReference :: Maybe PartyReference
, instrTradeDetails_buyerAccountReference :: Maybe AccountReference
, instrTradeDetails_sellerPartyReference :: Maybe PartyReference
, instrTradeDetails_sellerAccountReference :: Maybe AccountReference
, instrTradeDetails_underlyingAsset :: Maybe Asset
, instrTradeDetails_quantity :: Maybe InstrumentTradeQuantity
, instrTradeDetails_pricing :: Maybe InstrumentTradePricing
, instrTradeDetails_principal :: Maybe InstrumentTradePrincipal
}
deriving (Eq,Show)
instance SchemaType InstrumentTradeDetails where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (InstrumentTradeDetails a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "buyerPartyReference")
`apply` optional (parseSchemaType "buyerAccountReference")
`apply` optional (parseSchemaType "sellerPartyReference")
`apply` optional (parseSchemaType "sellerAccountReference")
`apply` optional (elementUnderlyingAsset)
`apply` optional (parseSchemaType "quantity")
`apply` optional (parseSchemaType "pricing")
`apply` optional (parseSchemaType "principal")
schemaTypeToXML s x@InstrumentTradeDetails{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ instrTradeDetails_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ instrTradeDetails_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ instrTradeDetails_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ instrTradeDetails_productType x
, concatMap (schemaTypeToXML "productId") $ instrTradeDetails_productId x
, maybe [] (schemaTypeToXML "buyerPartyReference") $ instrTradeDetails_buyerPartyReference x
, maybe [] (schemaTypeToXML "buyerAccountReference") $ instrTradeDetails_buyerAccountReference x
, maybe [] (schemaTypeToXML "sellerPartyReference") $ instrTradeDetails_sellerPartyReference x
, maybe [] (schemaTypeToXML "sellerAccountReference") $ instrTradeDetails_sellerAccountReference x
, maybe [] (elementToXMLUnderlyingAsset) $ instrTradeDetails_underlyingAsset x
, maybe [] (schemaTypeToXML "quantity") $ instrTradeDetails_quantity x
, maybe [] (schemaTypeToXML "pricing") $ instrTradeDetails_pricing x
, maybe [] (schemaTypeToXML "principal") $ instrTradeDetails_principal x
]
instance Extension InstrumentTradeDetails Product where
supertype v = Product_InstrumentTradeDetails v
data InstrumentTradeQuantity = InstrumentTradeQuantity
{ instrTradeQuant_choice0 :: (Maybe (OneOf2 Xsd.Decimal Money))
}
deriving (Eq,Show)
instance SchemaType InstrumentTradeQuantity where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return InstrumentTradeQuantity
`apply` optional (oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "number"))
, ("Money", fmap TwoOf2 (parseSchemaType "nominal"))
])
schemaTypeToXML s x@InstrumentTradeQuantity{} =
toXMLElement s []
[ maybe [] (foldOneOf2 (schemaTypeToXML "number")
(schemaTypeToXML "nominal")
) $ instrTradeQuant_choice0 x
]
data InstrumentTradePricing = InstrumentTradePricing
{ instrTradePricing_quote :: [BasicQuotation]
}
deriving (Eq,Show)
instance SchemaType InstrumentTradePricing where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return InstrumentTradePricing
`apply` many (parseSchemaType "quote")
schemaTypeToXML s x@InstrumentTradePricing{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "quote") $ instrTradePricing_quote x
]
data InstrumentTradePrincipal = InstrumentTradePrincipal
{ instrTradePrinc_principalAmount :: Maybe NetAndGross
}
deriving (Eq,Show)
instance SchemaType InstrumentTradePrincipal where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return InstrumentTradePrincipal
`apply` optional (parseSchemaType "principalAmount")
schemaTypeToXML s x@InstrumentTradePrincipal{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "principalAmount") $ instrTradePrinc_principalAmount x
]
data LinkId = LinkId Scheme LinkIdAttributes deriving (Eq,Show)
data LinkIdAttributes = LinkIdAttributes
{ linkIdAttrib_ID :: Maybe Xsd.ID
, linkIdAttrib_linkIdScheme :: Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType LinkId where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "id" e pos
a1 <- getAttribute "linkIdScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ LinkId v (LinkIdAttributes a0 a1)
schemaTypeToXML s (LinkId bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "id") $ linkIdAttrib_ID at
, toXMLAttribute "linkIdScheme" $ linkIdAttrib_linkIdScheme at
]
$ schemaTypeToXML s bt
instance Extension LinkId Scheme where
supertype (LinkId s _) = s
data NetAndGross = NetAndGross
{ netAndGross_choice0 :: OneOf2 Xsd.Decimal (Xsd.Decimal,(Maybe (Xsd.Decimal)))
}
deriving (Eq,Show)
instance SchemaType NetAndGross where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return NetAndGross
`apply` oneOf' [ ("Xsd.Decimal", fmap OneOf2 (parseSchemaType "net"))
, ("Xsd.Decimal Maybe Xsd.Decimal", fmap TwoOf2 (return (,) `apply` parseSchemaType "gross"
`apply` optional (parseSchemaType "net")))
]
schemaTypeToXML s x@NetAndGross{} =
toXMLElement s []
[ foldOneOf2 (schemaTypeToXML "net")
(\ (a,b) -> concat [ schemaTypeToXML "gross" a
, maybe [] (schemaTypeToXML "net") b
])
$ netAndGross_choice0 x
]
data PartyPortfolioName = PartyPortfolioName
{ partyPortfName_ID :: Maybe Xsd.ID
, partyPortfName_partyReference :: Maybe PartyReference
, partyPortfName_portfolioName :: [PortfolioName]
}
deriving (Eq,Show)
instance SchemaType PartyPortfolioName where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (PartyPortfolioName a0)
`apply` optional (parseSchemaType "partyReference")
`apply` many (parseSchemaType "portfolioName")
schemaTypeToXML s x@PartyPortfolioName{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ partyPortfName_ID x
]
[ maybe [] (schemaTypeToXML "partyReference") $ partyPortfName_partyReference x
, concatMap (schemaTypeToXML "portfolioName") $ partyPortfName_portfolioName x
]
data PartyTradeIdentifier = PartyTradeIdentifier
{ partyTradeIdent_ID :: Maybe Xsd.ID
, partyTradeIdent_choice0 :: OneOf2 (IssuerId,TradeId) (PartyReference,(Maybe (AccountReference)),([OneOf2 TradeId VersionedTradeId]))
, partyTradeIdent_linkId :: [LinkId]
, partyTradeIdent_allocationTradeId :: [TradeIdentifier]
, partyTradeIdent_blockTradeId :: Maybe TradeIdentifier
, partyTradeIdent_originatingTradeId :: Maybe TradeIdentifier
}
deriving (Eq,Show)
instance SchemaType PartyTradeIdentifier where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (PartyTradeIdentifier a0)
`apply` oneOf' [ ("IssuerId TradeId", fmap OneOf2 (return (,) `apply` parseSchemaType "issuer"
`apply` parseSchemaType "tradeId"))
, ("PartyReference Maybe AccountReference [OneOf2 TradeId VersionedTradeId]", fmap TwoOf2 (return (,,) `apply` parseSchemaType "partyReference"
`apply` optional (parseSchemaType "accountReference")
`apply` many1 (oneOf' [ ("TradeId", fmap OneOf2 (parseSchemaType "tradeId"))
, ("VersionedTradeId", fmap TwoOf2 (parseSchemaType "versionedTradeId"))
])))
]
`apply` many (parseSchemaType "linkId")
`apply` many (parseSchemaType "allocationTradeId")
`apply` optional (parseSchemaType "blockTradeId")
`apply` optional (parseSchemaType "originatingTradeId")
schemaTypeToXML s x@PartyTradeIdentifier{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ partyTradeIdent_ID x
]
[ foldOneOf2 (\ (a,b) -> concat [ schemaTypeToXML "issuer" a
, schemaTypeToXML "tradeId" b
])
(\ (a,b,c) -> concat [ schemaTypeToXML "partyReference" a
, maybe [] (schemaTypeToXML "accountReference") b
, concatMap (foldOneOf2 (schemaTypeToXML "tradeId")
(schemaTypeToXML "versionedTradeId")
) c
])
$ partyTradeIdent_choice0 x
, concatMap (schemaTypeToXML "linkId") $ partyTradeIdent_linkId x
, concatMap (schemaTypeToXML "allocationTradeId") $ partyTradeIdent_allocationTradeId x
, maybe [] (schemaTypeToXML "blockTradeId") $ partyTradeIdent_blockTradeId x
, maybe [] (schemaTypeToXML "originatingTradeId") $ partyTradeIdent_originatingTradeId x
]
instance Extension PartyTradeIdentifier TradeIdentifier where
supertype (PartyTradeIdentifier a0 e0 e1 e2 e3 e4) =
TradeIdentifier a0 e0
data PartyTradeIdentifiers = PartyTradeIdentifiers
{ partyTradeIdent_partyTradeIdentifier :: [PartyTradeIdentifier]
}
deriving (Eq,Show)
instance SchemaType PartyTradeIdentifiers where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return PartyTradeIdentifiers
`apply` many (parseSchemaType "partyTradeIdentifier")
schemaTypeToXML s x@PartyTradeIdentifiers{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "partyTradeIdentifier") $ partyTradeIdent_partyTradeIdentifier x
]
data PartyTradeInformation = PartyTradeInformation
{ partyTradeInfo_partyReference :: PartyReference
, partyTradeInfo_accountReference :: Maybe AccountReference
, partyTradeInfo_relatedParty :: [RelatedParty]
, partyTradeInfo_reportingRole :: Maybe ReportingRole
, partyTradeInfo_relatedBusinessUnit :: [RelatedBusinessUnit]
, partyTradeInfo_relatedPerson :: [RelatedPerson]
, partyTradeInfo_isAccountingHedge :: Maybe Xsd.Boolean
, partyTradeInfo_category :: [TradeCategory]
, partyTradeInfo_executionDateTime :: Maybe ExecutionDateTime
, partyTradeInfo_timestamps :: Maybe TradeProcessingTimestamps
, partyTradeInfo_intentToAllocate :: Maybe Xsd.Boolean
, partyTradeInfo_allocationStatus :: Maybe AllocationReportingStatus
, partyTradeInfo_intentToClear :: Maybe Xsd.Boolean
, partyTradeInfo_clearingStatus :: Maybe ClearingStatusValue
, partyTradeInfo_collateralizationType :: Maybe CollateralizationType
, partyTradeInfo_reportingRegime :: [ReportingRegime]
, partyTradeInfo_choice16 :: (Maybe (OneOf2 Xsd.Boolean EndUserExceptionDeclaration))
, partyTradeInfo_nonStandardTerms :: Maybe Xsd.Boolean
, partyTradeInfo_offMarketPrice :: Maybe Xsd.Boolean
, partyTradeInfo_largeSizeTrade :: Maybe Xsd.Boolean
, partyTradeInfo_executionType :: Maybe ExecutionType
, partyTradeInfo_executionVenueType :: Maybe ExecutionVenueType
, partyTradeInfo_verificationMethod :: Maybe ConfirmationMethod
, partyTradeInfo_confirmationMethod :: Maybe ConfirmationMethod
}
deriving (Eq,Show)
instance SchemaType PartyTradeInformation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return PartyTradeInformation
`apply` parseSchemaType "partyReference"
`apply` optional (parseSchemaType "accountReference")
`apply` many (parseSchemaType "relatedParty")
`apply` optional (parseSchemaType "reportingRole")
`apply` many (parseSchemaType "relatedBusinessUnit")
`apply` many (parseSchemaType "relatedPerson")
`apply` optional (parseSchemaType "isAccountingHedge")
`apply` many (parseSchemaType "category")
`apply` optional (parseSchemaType "executionDateTime")
`apply` optional (parseSchemaType "timestamps")
`apply` optional (parseSchemaType "intentToAllocate")
`apply` optional (parseSchemaType "allocationStatus")
`apply` optional (parseSchemaType "intentToClear")
`apply` optional (parseSchemaType "clearingStatus")
`apply` optional (parseSchemaType "collateralizationType")
`apply` many (parseSchemaType "reportingRegime")
`apply` optional (oneOf' [ ("Xsd.Boolean", fmap OneOf2 (parseSchemaType "endUserException"))
, ("EndUserExceptionDeclaration", fmap TwoOf2 (parseSchemaType "endUserExceptionDeclaration"))
])
`apply` optional (parseSchemaType "nonStandardTerms")
`apply` optional (parseSchemaType "offMarketPrice")
`apply` optional (parseSchemaType "largeSizeTrade")
`apply` optional (parseSchemaType "executionType")
`apply` optional (parseSchemaType "executionVenueType")
`apply` optional (parseSchemaType "verificationMethod")
`apply` optional (parseSchemaType "confirmationMethod")
schemaTypeToXML s x@PartyTradeInformation{} =
toXMLElement s []
[ schemaTypeToXML "partyReference" $ partyTradeInfo_partyReference x
, maybe [] (schemaTypeToXML "accountReference") $ partyTradeInfo_accountReference x
, concatMap (schemaTypeToXML "relatedParty") $ partyTradeInfo_relatedParty x
, maybe [] (schemaTypeToXML "reportingRole") $ partyTradeInfo_reportingRole x
, concatMap (schemaTypeToXML "relatedBusinessUnit") $ partyTradeInfo_relatedBusinessUnit x
, concatMap (schemaTypeToXML "relatedPerson") $ partyTradeInfo_relatedPerson x
, maybe [] (schemaTypeToXML "isAccountingHedge") $ partyTradeInfo_isAccountingHedge x
, concatMap (schemaTypeToXML "category") $ partyTradeInfo_category x
, maybe [] (schemaTypeToXML "executionDateTime") $ partyTradeInfo_executionDateTime x
, maybe [] (schemaTypeToXML "timestamps") $ partyTradeInfo_timestamps x
, maybe [] (schemaTypeToXML "intentToAllocate") $ partyTradeInfo_intentToAllocate x
, maybe [] (schemaTypeToXML "allocationStatus") $ partyTradeInfo_allocationStatus x
, maybe [] (schemaTypeToXML "intentToClear") $ partyTradeInfo_intentToClear x
, maybe [] (schemaTypeToXML "clearingStatus") $ partyTradeInfo_clearingStatus x
, maybe [] (schemaTypeToXML "collateralizationType") $ partyTradeInfo_collateralizationType x
, concatMap (schemaTypeToXML "reportingRegime") $ partyTradeInfo_reportingRegime x
, maybe [] (foldOneOf2 (schemaTypeToXML "endUserException")
(schemaTypeToXML "endUserExceptionDeclaration")
) $ partyTradeInfo_choice16 x
, maybe [] (schemaTypeToXML "nonStandardTerms") $ partyTradeInfo_nonStandardTerms x
, maybe [] (schemaTypeToXML "offMarketPrice") $ partyTradeInfo_offMarketPrice x
, maybe [] (schemaTypeToXML "largeSizeTrade") $ partyTradeInfo_largeSizeTrade x
, maybe [] (schemaTypeToXML "executionType") $ partyTradeInfo_executionType x
, maybe [] (schemaTypeToXML "executionVenueType") $ partyTradeInfo_executionVenueType x
, maybe [] (schemaTypeToXML "verificationMethod") $ partyTradeInfo_verificationMethod x
, maybe [] (schemaTypeToXML "confirmationMethod") $ partyTradeInfo_confirmationMethod x
]
data AllocationReportingStatus = AllocationReportingStatus Scheme AllocationReportingStatusAttributes deriving (Eq,Show)
data AllocationReportingStatusAttributes = AllocationReportingStatusAttributes
{ arsa_allocationReportingStatusScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType AllocationReportingStatus where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "allocationReportingStatusScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ AllocationReportingStatus v (AllocationReportingStatusAttributes a0)
schemaTypeToXML s (AllocationReportingStatus bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "allocationReportingStatusScheme") $ arsa_allocationReportingStatusScheme at
]
$ schemaTypeToXML s bt
instance Extension AllocationReportingStatus Scheme where
supertype (AllocationReportingStatus s _) = s
data ClearingStatusValue = ClearingStatusValue Scheme ClearingStatusValueAttributes deriving (Eq,Show)
data ClearingStatusValueAttributes = ClearingStatusValueAttributes
{ clearStatusValueAttrib_clearingStatusScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType ClearingStatusValue where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "clearingStatusScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ ClearingStatusValue v (ClearingStatusValueAttributes a0)
schemaTypeToXML s (ClearingStatusValue bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "clearingStatusScheme") $ clearStatusValueAttrib_clearingStatusScheme at
]
$ schemaTypeToXML s bt
instance Extension ClearingStatusValue Scheme where
supertype (ClearingStatusValue s _) = s
data CollateralizationType = CollateralizationType Scheme CollateralizationTypeAttributes deriving (Eq,Show)
data CollateralizationTypeAttributes = CollateralizationTypeAttributes
{ collatTypeAttrib_collateralTypeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CollateralizationType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "collateralTypeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CollateralizationType v (CollateralizationTypeAttributes a0)
schemaTypeToXML s (CollateralizationType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "collateralTypeScheme") $ collatTypeAttrib_collateralTypeScheme at
]
$ schemaTypeToXML s bt
instance Extension CollateralizationType Scheme where
supertype (CollateralizationType s _) = s
data EndUserExceptionDeclaration = EndUserExceptionDeclaration
{ endUserExceptDeclar_creditDocument :: [CreditDocument]
, endUserExceptDeclar_organizationCharacteristic :: [OrganizationCharacteristic]
, endUserExceptDeclar_transactionCharacteristic :: [TransactionCharacteristic]
, endUserExceptDeclar_supervisorRegistration :: [SupervisorRegistration]
}
deriving (Eq,Show)
instance SchemaType EndUserExceptionDeclaration where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return EndUserExceptionDeclaration
`apply` many (parseSchemaType "creditDocument")
`apply` many (parseSchemaType "organizationCharacteristic")
`apply` many (parseSchemaType "transactionCharacteristic")
`apply` many (parseSchemaType "supervisorRegistration")
schemaTypeToXML s x@EndUserExceptionDeclaration{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "creditDocument") $ endUserExceptDeclar_creditDocument x
, concatMap (schemaTypeToXML "organizationCharacteristic") $ endUserExceptDeclar_organizationCharacteristic x
, concatMap (schemaTypeToXML "transactionCharacteristic") $ endUserExceptDeclar_transactionCharacteristic x
, concatMap (schemaTypeToXML "supervisorRegistration") $ endUserExceptDeclar_supervisorRegistration x
]
data CreditDocument = CreditDocument Scheme CreditDocumentAttributes deriving (Eq,Show)
data CreditDocumentAttributes = CreditDocumentAttributes
{ creditDocumAttrib_creditDocumentScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType CreditDocument where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "creditDocumentScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ CreditDocument v (CreditDocumentAttributes a0)
schemaTypeToXML s (CreditDocument bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "creditDocumentScheme") $ creditDocumAttrib_creditDocumentScheme at
]
$ schemaTypeToXML s bt
instance Extension CreditDocument Scheme where
supertype (CreditDocument s _) = s
data OrganizationCharacteristic = OrganizationCharacteristic Scheme OrganizationCharacteristicAttributes deriving (Eq,Show)
data OrganizationCharacteristicAttributes = OrganizationCharacteristicAttributes
{ oca_organizationCharacteristicScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType OrganizationCharacteristic where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "organizationCharacteristicScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ OrganizationCharacteristic v (OrganizationCharacteristicAttributes a0)
schemaTypeToXML s (OrganizationCharacteristic bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "organizationCharacteristicScheme") $ oca_organizationCharacteristicScheme at
]
$ schemaTypeToXML s bt
instance Extension OrganizationCharacteristic Scheme where
supertype (OrganizationCharacteristic s _) = s
data TransactionCharacteristic = TransactionCharacteristic Scheme TransactionCharacteristicAttributes deriving (Eq,Show)
data TransactionCharacteristicAttributes = TransactionCharacteristicAttributes
{ tca_transactionCharacteristicScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType TransactionCharacteristic where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "transactionCharacteristicScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ TransactionCharacteristic v (TransactionCharacteristicAttributes a0)
schemaTypeToXML s (TransactionCharacteristic bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "transactionCharacteristicScheme") $ tca_transactionCharacteristicScheme at
]
$ schemaTypeToXML s bt
instance Extension TransactionCharacteristic Scheme where
supertype (TransactionCharacteristic s _) = s
data ReportingPurpose = ReportingPurpose Scheme ReportingPurposeAttributes deriving (Eq,Show)
data ReportingPurposeAttributes = ReportingPurposeAttributes
{ reportPurposeAttrib_reportingPurposeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType ReportingPurpose where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "reportingPurposeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ ReportingPurpose v (ReportingPurposeAttributes a0)
schemaTypeToXML s (ReportingPurpose bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "reportingPurposeScheme") $ reportPurposeAttrib_reportingPurposeScheme at
]
$ schemaTypeToXML s bt
instance Extension ReportingPurpose Scheme where
supertype (ReportingPurpose s _) = s
data SupervisorRegistration = SupervisorRegistration
{ supervRegist_supervisoryBody :: SupervisoryBody
, supervRegist_registrationNumber :: Maybe RegulatorId
}
deriving (Eq,Show)
instance SchemaType SupervisorRegistration where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return SupervisorRegistration
`apply` parseSchemaType "supervisoryBody"
`apply` optional (parseSchemaType "registrationNumber")
schemaTypeToXML s x@SupervisorRegistration{} =
toXMLElement s []
[ schemaTypeToXML "supervisoryBody" $ supervRegist_supervisoryBody x
, maybe [] (schemaTypeToXML "registrationNumber") $ supervRegist_registrationNumber x
]
data ReportingRegime = ReportingRegime
{ reportRegime_choice0 :: OneOf2 (ReportingRegimeName,[SupervisorRegistration]) [SupervisorRegistration]
, reportRegime_reportingRole :: Maybe ReportingRole
, reportRegime_reportingPurpose :: [ReportingPurpose]
, reportRegime_mandatorilyClearable :: Maybe Xsd.Boolean
}
deriving (Eq,Show)
instance SchemaType ReportingRegime where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return ReportingRegime
`apply` oneOf' [ ("ReportingRegimeName [SupervisorRegistration]", fmap OneOf2 (return (,) `apply` parseSchemaType "name"
`apply` many (parseSchemaType "supervisorRegistration")))
, ("[SupervisorRegistration]", fmap TwoOf2 (many1 (parseSchemaType "supervisorRegistration")))
]
`apply` optional (parseSchemaType "reportingRole")
`apply` many (parseSchemaType "reportingPurpose")
`apply` optional (parseSchemaType "mandatorilyClearable")
schemaTypeToXML s x@ReportingRegime{} =
toXMLElement s []
[ foldOneOf2 (\ (a,b) -> concat [ schemaTypeToXML "name" a
, concatMap (schemaTypeToXML "supervisorRegistration") b
])
(concatMap (schemaTypeToXML "supervisorRegistration"))
$ reportRegime_choice0 x
, maybe [] (schemaTypeToXML "reportingRole") $ reportRegime_reportingRole x
, concatMap (schemaTypeToXML "reportingPurpose") $ reportRegime_reportingPurpose x
, maybe [] (schemaTypeToXML "mandatorilyClearable") $ reportRegime_mandatorilyClearable x
]
data RegulatorId = RegulatorId Scheme RegulatorIdAttributes deriving (Eq,Show)
data RegulatorIdAttributes = RegulatorIdAttributes
{ regulIdAttrib_regulatorIdScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType RegulatorId where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "regulatorIdScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ RegulatorId v (RegulatorIdAttributes a0)
schemaTypeToXML s (RegulatorId bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "regulatorIdScheme") $ regulIdAttrib_regulatorIdScheme at
]
$ schemaTypeToXML s bt
instance Extension RegulatorId Scheme where
supertype (RegulatorId s _) = s
data TradeProcessingTimestamps = TradeProcessingTimestamps
{ tradeProcesTimest_orderEntered :: Maybe Xsd.DateTime
, tradeProcesTimest_orderSubmitted :: Maybe Xsd.DateTime
, tradeProcesTimest_publiclyReported :: Maybe Xsd.DateTime
, tradeProcesTimest_publicReportUpdated :: Maybe Xsd.DateTime
, tradeProcesTimest_nonpubliclyReported :: Maybe Xsd.DateTime
, tradeProcesTimest_nonpublicReportUpdated :: Maybe Xsd.DateTime
, tradeProcesTimest_submittedForConfirmation :: Maybe Xsd.DateTime
, tradeProcesTimest_updatedForConfirmation :: Maybe Xsd.DateTime
, tradeProcesTimest_confirmed :: Maybe Xsd.DateTime
, tradeProcesTimest_submittedForClearing :: Maybe Xsd.DateTime
, tradeProcesTimest_updatedForClearing :: Maybe Xsd.DateTime
, tradeProcesTimest_cleared :: Maybe Xsd.DateTime
, tradeProcesTimest_allocationsSubmitted :: Maybe Xsd.DateTime
, tradeProcesTimest_allocationsUpdated :: Maybe Xsd.DateTime
, tradeProcesTimest_allocationsCompleted :: Maybe Xsd.DateTime
, tradeProcesTimest_timestamp :: [TradeTimestamp]
}
deriving (Eq,Show)
instance SchemaType TradeProcessingTimestamps where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return TradeProcessingTimestamps
`apply` optional (parseSchemaType "orderEntered")
`apply` optional (parseSchemaType "orderSubmitted")
`apply` optional (parseSchemaType "publiclyReported")
`apply` optional (parseSchemaType "publicReportUpdated")
`apply` optional (parseSchemaType "nonpubliclyReported")
`apply` optional (parseSchemaType "nonpublicReportUpdated")
`apply` optional (parseSchemaType "submittedForConfirmation")
`apply` optional (parseSchemaType "updatedForConfirmation")
`apply` optional (parseSchemaType "confirmed")
`apply` optional (parseSchemaType "submittedForClearing")
`apply` optional (parseSchemaType "updatedForClearing")
`apply` optional (parseSchemaType "cleared")
`apply` optional (parseSchemaType "allocationsSubmitted")
`apply` optional (parseSchemaType "allocationsUpdated")
`apply` optional (parseSchemaType "allocationsCompleted")
`apply` many (parseSchemaType "timestamp")
schemaTypeToXML s x@TradeProcessingTimestamps{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "orderEntered") $ tradeProcesTimest_orderEntered x
, maybe [] (schemaTypeToXML "orderSubmitted") $ tradeProcesTimest_orderSubmitted x
, maybe [] (schemaTypeToXML "publiclyReported") $ tradeProcesTimest_publiclyReported x
, maybe [] (schemaTypeToXML "publicReportUpdated") $ tradeProcesTimest_publicReportUpdated x
, maybe [] (schemaTypeToXML "nonpubliclyReported") $ tradeProcesTimest_nonpubliclyReported x
, maybe [] (schemaTypeToXML "nonpublicReportUpdated") $ tradeProcesTimest_nonpublicReportUpdated x
, maybe [] (schemaTypeToXML "submittedForConfirmation") $ tradeProcesTimest_submittedForConfirmation x
, maybe [] (schemaTypeToXML "updatedForConfirmation") $ tradeProcesTimest_updatedForConfirmation x
, maybe [] (schemaTypeToXML "confirmed") $ tradeProcesTimest_confirmed x
, maybe [] (schemaTypeToXML "submittedForClearing") $ tradeProcesTimest_submittedForClearing x
, maybe [] (schemaTypeToXML "updatedForClearing") $ tradeProcesTimest_updatedForClearing x
, maybe [] (schemaTypeToXML "cleared") $ tradeProcesTimest_cleared x
, maybe [] (schemaTypeToXML "allocationsSubmitted") $ tradeProcesTimest_allocationsSubmitted x
, maybe [] (schemaTypeToXML "allocationsUpdated") $ tradeProcesTimest_allocationsUpdated x
, maybe [] (schemaTypeToXML "allocationsCompleted") $ tradeProcesTimest_allocationsCompleted x
, concatMap (schemaTypeToXML "timestamp") $ tradeProcesTimest_timestamp x
]
data TradeTimestamp = TradeTimestamp
{ tradeTimest_type :: Maybe TimestampTypeScheme
, tradeTimest_value :: Maybe Xsd.DateTime
}
deriving (Eq,Show)
instance SchemaType TradeTimestamp where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return TradeTimestamp
`apply` optional (parseSchemaType "type")
`apply` optional (parseSchemaType "value")
schemaTypeToXML s x@TradeTimestamp{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "type") $ tradeTimest_type x
, maybe [] (schemaTypeToXML "value") $ tradeTimest_value x
]
data TimestampTypeScheme = TimestampTypeScheme Scheme TimestampTypeSchemeAttributes deriving (Eq,Show)
data TimestampTypeSchemeAttributes = TimestampTypeSchemeAttributes
{ timestTypeSchemeAttrib_timestampScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType TimestampTypeScheme where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "timestampScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ TimestampTypeScheme v (TimestampTypeSchemeAttributes a0)
schemaTypeToXML s (TimestampTypeScheme bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "timestampScheme") $ timestTypeSchemeAttrib_timestampScheme at
]
$ schemaTypeToXML s bt
instance Extension TimestampTypeScheme Scheme where
supertype (TimestampTypeScheme s _) = s
data ReportingRegimeName = ReportingRegimeName Scheme ReportingRegimeNameAttributes deriving (Eq,Show)
data ReportingRegimeNameAttributes = ReportingRegimeNameAttributes
{ reportRegimeNameAttrib_reportingRegimeNameScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType ReportingRegimeName where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "reportingRegimeNameScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ ReportingRegimeName v (ReportingRegimeNameAttributes a0)
schemaTypeToXML s (ReportingRegimeName bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "reportingRegimeNameScheme") $ reportRegimeNameAttrib_reportingRegimeNameScheme at
]
$ schemaTypeToXML s bt
instance Extension ReportingRegimeName Scheme where
supertype (ReportingRegimeName s _) = s
data SupervisoryBody = SupervisoryBody Scheme SupervisoryBodyAttributes deriving (Eq,Show)
data SupervisoryBodyAttributes = SupervisoryBodyAttributes
{ supervBodyAttrib_supervisoryBodyScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType SupervisoryBody where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "supervisoryBodyScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ SupervisoryBody v (SupervisoryBodyAttributes a0)
schemaTypeToXML s (SupervisoryBody bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "supervisoryBodyScheme") $ supervBodyAttrib_supervisoryBodyScheme at
]
$ schemaTypeToXML s bt
instance Extension SupervisoryBody Scheme where
supertype (SupervisoryBody s _) = s
data ExecutionVenueType = ExecutionVenueType Scheme ExecutionVenueTypeAttributes deriving (Eq,Show)
data ExecutionVenueTypeAttributes = ExecutionVenueTypeAttributes
{ executVenueTypeAttrib_executionVenueTypeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType ExecutionVenueType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "executionVenueTypeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ ExecutionVenueType v (ExecutionVenueTypeAttributes a0)
schemaTypeToXML s (ExecutionVenueType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "executionVenueTypeScheme") $ executVenueTypeAttrib_executionVenueTypeScheme at
]
$ schemaTypeToXML s bt
instance Extension ExecutionVenueType Scheme where
supertype (ExecutionVenueType s _) = s
data ExecutionType = ExecutionType Scheme ExecutionTypeAttributes deriving (Eq,Show)
data ExecutionTypeAttributes = ExecutionTypeAttributes
{ executTypeAttrib_executionTypeScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType ExecutionType where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "executionTypeScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ ExecutionType v (ExecutionTypeAttributes a0)
schemaTypeToXML s (ExecutionType bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "executionTypeScheme") $ executTypeAttrib_executionTypeScheme at
]
$ schemaTypeToXML s bt
instance Extension ExecutionType Scheme where
supertype (ExecutionType s _) = s
data ConfirmationMethod = ConfirmationMethod Scheme ConfirmationMethodAttributes deriving (Eq,Show)
data ConfirmationMethodAttributes = ConfirmationMethodAttributes
{ confirMethodAttrib_confirmationMethodScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType ConfirmationMethod where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "confirmationMethodScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ ConfirmationMethod v (ConfirmationMethodAttributes a0)
schemaTypeToXML s (ConfirmationMethod bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "confirmationMethodScheme") $ confirMethodAttrib_confirmationMethodScheme at
]
$ schemaTypeToXML s bt
instance Extension ConfirmationMethod Scheme where
supertype (ConfirmationMethod s _) = s
data PaymentDetail = PaymentDetail
{ paymentDetail_ID :: Maybe Xsd.ID
, paymentDetail_paymentDate :: Maybe AdjustableOrRelativeDate
, paymentDetail_paymentRule :: Maybe PaymentRule
, paymentDetail_paymentAmount :: Maybe Money
}
deriving (Eq,Show)
instance SchemaType PaymentDetail where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (PaymentDetail a0)
`apply` optional (parseSchemaType "paymentDate")
`apply` optional (parseSchemaType "paymentRule")
`apply` optional (parseSchemaType "paymentAmount")
schemaTypeToXML s x@PaymentDetail{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ paymentDetail_ID x
]
[ maybe [] (schemaTypeToXML "paymentDate") $ paymentDetail_paymentDate x
, maybe [] (schemaTypeToXML "paymentRule") $ paymentDetail_paymentRule x
, maybe [] (schemaTypeToXML "paymentAmount") $ paymentDetail_paymentAmount x
]
instance Extension PaymentDetail PaymentBase where
supertype v = PaymentBase_PaymentDetail v
data PaymentRule
= PaymentRule_PercentageRule PercentageRule
deriving (Eq,Show)
instance SchemaType PaymentRule where
parseSchemaType s = do
(fmap PaymentRule_PercentageRule $ parseSchemaType s)
`onFail` fail "Parse failed when expecting an extension type of PaymentRule,\n\
\ namely one of:\n\
\PercentageRule"
schemaTypeToXML _s (PaymentRule_PercentageRule x) = schemaTypeToXML "percentageRule" x
data PercentageRule = PercentageRule
{ percenRule_paymentPercent :: Maybe Xsd.Decimal
, percenRule_notionalAmountReference :: Maybe NotionalAmountReference
}
deriving (Eq,Show)
instance SchemaType PercentageRule where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return PercentageRule
`apply` optional (parseSchemaType "paymentPercent")
`apply` optional (parseSchemaType "notionalAmountReference")
schemaTypeToXML s x@PercentageRule{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "paymentPercent") $ percenRule_paymentPercent x
, maybe [] (schemaTypeToXML "notionalAmountReference") $ percenRule_notionalAmountReference x
]
instance Extension PercentageRule PaymentRule where
supertype v = PaymentRule_PercentageRule v
data Portfolio = Portfolio
{ portfolio_ID :: Maybe Xsd.ID
, portfolio_partyPortfolioName :: Maybe PartyPortfolioName
, portfolio_choice1 :: (Maybe (OneOf2 [TradeId] [PartyTradeIdentifier]))
, portfolio :: [Portfolio]
}
deriving (Eq,Show)
instance SchemaType Portfolio where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Portfolio a0)
`apply` optional (parseSchemaType "partyPortfolioName")
`apply` optional (oneOf' [ ("[TradeId]", fmap OneOf2 (many1 (parseSchemaType "tradeId")))
, ("[PartyTradeIdentifier]", fmap TwoOf2 (many1 (parseSchemaType "partyTradeIdentifier")))
])
`apply` many (parseSchemaType "portfolio")
schemaTypeToXML s x@Portfolio{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ portfolio_ID x
]
[ maybe [] (schemaTypeToXML "partyPortfolioName") $ portfolio_partyPortfolioName x
, maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "tradeId"))
(concatMap (schemaTypeToXML "partyTradeIdentifier"))
) $ portfolio_choice1 x
, concatMap (schemaTypeToXML "portfolio") $ portfolio x
]
data PortfolioName = PortfolioName Scheme PortfolioNameAttributes deriving (Eq,Show)
data PortfolioNameAttributes = PortfolioNameAttributes
{ portfNameAttrib_ID :: Maybe Xsd.ID
, portfNameAttrib_portfolioNameScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType PortfolioName where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "id" e pos
a1 <- optional $ getAttribute "portfolioNameScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ PortfolioName v (PortfolioNameAttributes a0 a1)
schemaTypeToXML s (PortfolioName bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "id") $ portfNameAttrib_ID at
, maybe [] (toXMLAttribute "portfolioNameScheme") $ portfNameAttrib_portfolioNameScheme at
]
$ schemaTypeToXML s bt
instance Extension PortfolioName Scheme where
supertype (PortfolioName s _) = s
data QueryParameter = QueryParameter
{ queryParameter_id :: Maybe QueryParameterId
, queryParameter_value :: Maybe Xsd.NormalizedString
, queryParameter_operator :: Maybe QueryParameterOperator
}
deriving (Eq,Show)
instance SchemaType QueryParameter where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return QueryParameter
`apply` optional (parseSchemaType "queryParameterId")
`apply` optional (parseSchemaType "queryParameterValue")
`apply` optional (parseSchemaType "queryParameterOperator")
schemaTypeToXML s x@QueryParameter{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "queryParameterId") $ queryParameter_id x
, maybe [] (schemaTypeToXML "queryParameterValue") $ queryParameter_value x
, maybe [] (schemaTypeToXML "queryParameterOperator") $ queryParameter_operator x
]
data QueryParameterId = QueryParameterId Scheme QueryParameterIdAttributes deriving (Eq,Show)
data QueryParameterIdAttributes = QueryParameterIdAttributes
{ queryParamIdAttrib_queryParameterIdScheme :: Xsd.AnyURI
, queryParamIdAttrib_ID :: Maybe Xsd.ID
}
deriving (Eq,Show)
instance SchemaType QueryParameterId where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- getAttribute "queryParameterIdScheme" e pos
a1 <- optional $ getAttribute "id" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ QueryParameterId v (QueryParameterIdAttributes a0 a1)
schemaTypeToXML s (QueryParameterId bt at) =
addXMLAttributes [ toXMLAttribute "queryParameterIdScheme" $ queryParamIdAttrib_queryParameterIdScheme at
, maybe [] (toXMLAttribute "id") $ queryParamIdAttrib_ID at
]
$ schemaTypeToXML s bt
instance Extension QueryParameterId Scheme where
supertype (QueryParameterId s _) = s
data QueryParameterOperator = QueryParameterOperator Scheme QueryParameterOperatorAttributes deriving (Eq,Show)
data QueryParameterOperatorAttributes = QueryParameterOperatorAttributes
{ queryParamOperatAttrib_queryParameterOperatorScheme :: Maybe Xsd.AnyURI
, queryParamOperatAttrib_ID :: Maybe Xsd.ID
}
deriving (Eq,Show)
instance SchemaType QueryParameterOperator where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "queryParameterOperatorScheme" e pos
a1 <- optional $ getAttribute "id" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ QueryParameterOperator v (QueryParameterOperatorAttributes a0 a1)
schemaTypeToXML s (QueryParameterOperator bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "queryParameterOperatorScheme") $ queryParamOperatAttrib_queryParameterOperatorScheme at
, maybe [] (toXMLAttribute "id") $ queryParamOperatAttrib_ID at
]
$ schemaTypeToXML s bt
instance Extension QueryParameterOperator Scheme where
supertype (QueryParameterOperator s _) = s
data QueryPortfolio = QueryPortfolio
{ queryPortf_ID :: Maybe Xsd.ID
, queryPortf_partyPortfolioName :: Maybe PartyPortfolioName
, queryPortf_choice1 :: (Maybe (OneOf2 [TradeId] [PartyTradeIdentifier]))
, queryPortf_portfolio :: [Portfolio]
, queryPortf_queryParameter :: [QueryParameter]
}
deriving (Eq,Show)
instance SchemaType QueryPortfolio where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (QueryPortfolio a0)
`apply` optional (parseSchemaType "partyPortfolioName")
`apply` optional (oneOf' [ ("[TradeId]", fmap OneOf2 (many1 (parseSchemaType "tradeId")))
, ("[PartyTradeIdentifier]", fmap TwoOf2 (many1 (parseSchemaType "partyTradeIdentifier")))
])
`apply` many (parseSchemaType "portfolio")
`apply` many (parseSchemaType "queryParameter")
schemaTypeToXML s x@QueryPortfolio{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ queryPortf_ID x
]
[ maybe [] (schemaTypeToXML "partyPortfolioName") $ queryPortf_partyPortfolioName x
, maybe [] (foldOneOf2 (concatMap (schemaTypeToXML "tradeId"))
(concatMap (schemaTypeToXML "partyTradeIdentifier"))
) $ queryPortf_choice1 x
, concatMap (schemaTypeToXML "portfolio") $ queryPortf_portfolio x
, concatMap (schemaTypeToXML "queryParameter") $ queryPortf_queryParameter x
]
instance Extension QueryPortfolio Portfolio where
supertype (QueryPortfolio a0 e0 e1 e2 e3) =
Portfolio a0 e0 e1 e2
data ReportingRole = ReportingRole Scheme ReportingRoleAttributes deriving (Eq,Show)
data ReportingRoleAttributes = ReportingRoleAttributes
{ reportRoleAttrib_reportingRoleScheme :: Maybe Xsd.AnyURI
, reportRoleAttrib_ID :: Maybe Xsd.ID
}
deriving (Eq,Show)
instance SchemaType ReportingRole where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "reportingRoleScheme" e pos
a1 <- optional $ getAttribute "id" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ ReportingRole v (ReportingRoleAttributes a0 a1)
schemaTypeToXML s (ReportingRole bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "reportingRoleScheme") $ reportRoleAttrib_reportingRoleScheme at
, maybe [] (toXMLAttribute "id") $ reportRoleAttrib_ID at
]
$ schemaTypeToXML s bt
instance Extension ReportingRole Scheme where
supertype (ReportingRole s _) = s
data Strategy = Strategy
{ strategy_ID :: Maybe Xsd.ID
, strategy_primaryAssetClass :: Maybe AssetClass
, strategy_secondaryAssetClass :: [AssetClass]
, strategy_productType :: [ProductType]
, strategy_productId :: [ProductId]
, strategy_premiumProductReference :: Maybe ProductReference
, strategy_product :: [Product]
}
deriving (Eq,Show)
instance SchemaType Strategy where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Strategy a0)
`apply` optional (parseSchemaType "primaryAssetClass")
`apply` many (parseSchemaType "secondaryAssetClass")
`apply` many (parseSchemaType "productType")
`apply` many (parseSchemaType "productId")
`apply` optional (parseSchemaType "premiumProductReference")
`apply` many (elementProduct)
schemaTypeToXML s x@Strategy{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ strategy_ID x
]
[ maybe [] (schemaTypeToXML "primaryAssetClass") $ strategy_primaryAssetClass x
, concatMap (schemaTypeToXML "secondaryAssetClass") $ strategy_secondaryAssetClass x
, concatMap (schemaTypeToXML "productType") $ strategy_productType x
, concatMap (schemaTypeToXML "productId") $ strategy_productId x
, maybe [] (schemaTypeToXML "premiumProductReference") $ strategy_premiumProductReference x
, concatMap (elementToXMLProduct) $ strategy_product x
]
instance Extension Strategy Product where
supertype v = Product_Strategy v
data Trade = Trade
{ trade_ID :: Maybe Xsd.ID
, trade_header :: Maybe TradeHeader
, trade_product :: Maybe Product
, trade_otherPartyPayment :: [Payment]
, trade_brokerPartyReference :: [PartyReference]
, trade_calculationAgent :: Maybe CalculationAgent
, trade_calculationAgentBusinessCenter :: Maybe BusinessCenter
, trade_determiningParty :: [PartyReference]
, trade_hedgingParty :: [PartyReference]
, trade_collateral :: Maybe Collateral
, trade_documentation :: Maybe Documentation
, trade_governingLaw :: Maybe GoverningLaw
, trade_allocations :: Maybe Allocations
}
deriving (Eq,Show)
instance SchemaType Trade where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (Trade a0)
`apply` optional (parseSchemaType "tradeHeader")
`apply` optional (elementProduct)
`apply` many (parseSchemaType "otherPartyPayment")
`apply` many (parseSchemaType "brokerPartyReference")
`apply` optional (parseSchemaType "calculationAgent")
`apply` optional (parseSchemaType "calculationAgentBusinessCenter")
`apply` between (Occurs (Just 0) (Just 2))
(parseSchemaType "determiningParty")
`apply` between (Occurs (Just 0) (Just 2))
(parseSchemaType "hedgingParty")
`apply` optional (parseSchemaType "collateral")
`apply` optional (parseSchemaType "documentation")
`apply` optional (parseSchemaType "governingLaw")
`apply` optional (parseSchemaType "allocations")
schemaTypeToXML s x@Trade{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ trade_ID x
]
[ maybe [] (schemaTypeToXML "tradeHeader") $ trade_header x
, maybe [] (elementToXMLProduct) $ trade_product x
, concatMap (schemaTypeToXML "otherPartyPayment") $ trade_otherPartyPayment x
, concatMap (schemaTypeToXML "brokerPartyReference") $ trade_brokerPartyReference x
, maybe [] (schemaTypeToXML "calculationAgent") $ trade_calculationAgent x
, maybe [] (schemaTypeToXML "calculationAgentBusinessCenter") $ trade_calculationAgentBusinessCenter x
, concatMap (schemaTypeToXML "determiningParty") $ trade_determiningParty x
, concatMap (schemaTypeToXML "hedgingParty") $ trade_hedgingParty x
, maybe [] (schemaTypeToXML "collateral") $ trade_collateral x
, maybe [] (schemaTypeToXML "documentation") $ trade_documentation x
, maybe [] (schemaTypeToXML "governingLaw") $ trade_governingLaw x
, maybe [] (schemaTypeToXML "allocations") $ trade_allocations x
]
data TradeCategory = TradeCategory Scheme TradeCategoryAttributes deriving (Eq,Show)
data TradeCategoryAttributes = TradeCategoryAttributes
{ tradeCategAttrib_categoryScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType TradeCategory where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "categoryScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ TradeCategory v (TradeCategoryAttributes a0)
schemaTypeToXML s (TradeCategory bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "categoryScheme") $ tradeCategAttrib_categoryScheme at
]
$ schemaTypeToXML s bt
instance Extension TradeCategory Scheme where
supertype (TradeCategory s _) = s
data TradeDifference = TradeDifference
{ tradeDiffer_differenceType :: Maybe DifferenceTypeEnum
, tradeDiffer_differenceSeverity :: Maybe DifferenceSeverityEnum
, tradeDiffer_element :: Maybe Xsd.XsdString
, tradeDiffer_basePath :: Maybe Xsd.XsdString
, tradeDiffer_baseValue :: Maybe Xsd.XsdString
, tradeDiffer_otherPath :: Maybe Xsd.XsdString
, tradeDiffer_otherValue :: Maybe Xsd.XsdString
, tradeDiffer_missingElement :: [Xsd.XsdString]
, tradeDiffer_extraElement :: [Xsd.XsdString]
, tradeDiffer_message :: Maybe Xsd.XsdString
}
deriving (Eq,Show)
instance SchemaType TradeDifference where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return TradeDifference
`apply` optional (parseSchemaType "differenceType")
`apply` optional (parseSchemaType "differenceSeverity")
`apply` optional (parseSchemaType "element")
`apply` optional (parseSchemaType "basePath")
`apply` optional (parseSchemaType "baseValue")
`apply` optional (parseSchemaType "otherPath")
`apply` optional (parseSchemaType "otherValue")
`apply` many (parseSchemaType "missingElement")
`apply` many (parseSchemaType "extraElement")
`apply` optional (parseSchemaType "message")
schemaTypeToXML s x@TradeDifference{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "differenceType") $ tradeDiffer_differenceType x
, maybe [] (schemaTypeToXML "differenceSeverity") $ tradeDiffer_differenceSeverity x
, maybe [] (schemaTypeToXML "element") $ tradeDiffer_element x
, maybe [] (schemaTypeToXML "basePath") $ tradeDiffer_basePath x
, maybe [] (schemaTypeToXML "baseValue") $ tradeDiffer_baseValue x
, maybe [] (schemaTypeToXML "otherPath") $ tradeDiffer_otherPath x
, maybe [] (schemaTypeToXML "otherValue") $ tradeDiffer_otherValue x
, concatMap (schemaTypeToXML "missingElement") $ tradeDiffer_missingElement x
, concatMap (schemaTypeToXML "extraElement") $ tradeDiffer_extraElement x
, maybe [] (schemaTypeToXML "message") $ tradeDiffer_message x
]
data TradeHeader = TradeHeader
{ tradeHeader_partyTradeIdentifier :: [PartyTradeIdentifier]
, tradeHeader_partyTradeInformation :: [PartyTradeInformation]
, tradeHeader_tradeDate :: Maybe IdentifiedDate
, tradeHeader_clearedDate :: Maybe IdentifiedDate
}
deriving (Eq,Show)
instance SchemaType TradeHeader where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return TradeHeader
`apply` many1 (parseSchemaType "partyTradeIdentifier")
`apply` many1 (parseSchemaType "partyTradeInformation")
`apply` optional (parseSchemaType "tradeDate")
`apply` optional (parseSchemaType "clearedDate")
schemaTypeToXML s x@TradeHeader{} =
toXMLElement s []
[ concatMap (schemaTypeToXML "partyTradeIdentifier") $ tradeHeader_partyTradeIdentifier x
, concatMap (schemaTypeToXML "partyTradeInformation") $ tradeHeader_partyTradeInformation x
, maybe [] (schemaTypeToXML "tradeDate") $ tradeHeader_tradeDate x
, maybe [] (schemaTypeToXML "clearedDate") $ tradeHeader_clearedDate x
]
data TradeId = TradeId Scheme TradeIdAttributes deriving (Eq,Show)
data TradeIdAttributes = TradeIdAttributes
{ tradeIdAttrib_tradeIdScheme :: Maybe Xsd.AnyURI
, tradeIdAttrib_ID :: Maybe Xsd.ID
}
deriving (Eq,Show)
instance SchemaType TradeId where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "tradeIdScheme" e pos
a1 <- optional $ getAttribute "id" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ TradeId v (TradeIdAttributes a0 a1)
schemaTypeToXML s (TradeId bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "tradeIdScheme") $ tradeIdAttrib_tradeIdScheme at
, maybe [] (toXMLAttribute "id") $ tradeIdAttrib_ID at
]
$ schemaTypeToXML s bt
instance Extension TradeId Scheme where
supertype (TradeId s _) = s
data TradeIdentifier = TradeIdentifier
{ tradeIdent_ID :: Maybe Xsd.ID
, tradeIdent_choice0 :: OneOf2 (IssuerId,TradeId) (PartyReference,(Maybe (AccountReference)),([OneOf2 TradeId VersionedTradeId]))
}
deriving (Eq,Show)
instance SchemaType TradeIdentifier where
parseSchemaType s = do
(pos,e) <- posnElement [s]
a0 <- optional $ getAttribute "id" e pos
commit $ interior e $ return (TradeIdentifier a0)
`apply` oneOf' [ ("IssuerId TradeId", fmap OneOf2 (return (,) `apply` parseSchemaType "issuer"
`apply` parseSchemaType "tradeId"))
, ("PartyReference Maybe AccountReference [OneOf2 TradeId VersionedTradeId]", fmap TwoOf2 (return (,,) `apply` parseSchemaType "partyReference"
`apply` optional (parseSchemaType "accountReference")
`apply` many1 (oneOf' [ ("TradeId", fmap OneOf2 (parseSchemaType "tradeId"))
, ("VersionedTradeId", fmap TwoOf2 (parseSchemaType "versionedTradeId"))
])))
]
schemaTypeToXML s x@TradeIdentifier{} =
toXMLElement s [ maybe [] (toXMLAttribute "id") $ tradeIdent_ID x
]
[ foldOneOf2 (\ (a,b) -> concat [ schemaTypeToXML "issuer" a
, schemaTypeToXML "tradeId" b
])
(\ (a,b,c) -> concat [ schemaTypeToXML "partyReference" a
, maybe [] (schemaTypeToXML "accountReference") b
, concatMap (foldOneOf2 (schemaTypeToXML "tradeId")
(schemaTypeToXML "versionedTradeId")
) c
])
$ tradeIdent_choice0 x
]
data IssuerId = IssuerId Scheme IssuerIdAttributes deriving (Eq,Show)
data IssuerIdAttributes = IssuerIdAttributes
{ issuerIdAttrib_issuerIdScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType IssuerId where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "issuerIdScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ IssuerId v (IssuerIdAttributes a0)
schemaTypeToXML s (IssuerId bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "issuerIdScheme") $ issuerIdAttrib_issuerIdScheme at
]
$ schemaTypeToXML s bt
instance Extension IssuerId Scheme where
supertype (IssuerId s _) = s
data Trader = Trader Scheme TraderAttributes deriving (Eq,Show)
data TraderAttributes = TraderAttributes
{ traderAttrib_traderScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType Trader where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "traderScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ Trader v (TraderAttributes a0)
schemaTypeToXML s (Trader bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "traderScheme") $ traderAttrib_traderScheme at
]
$ schemaTypeToXML s bt
instance Extension Trader Scheme where
supertype (Trader s _) = s
data Validation = Validation Scheme ValidationAttributes deriving (Eq,Show)
data ValidationAttributes = ValidationAttributes
{ validAttrib_validationScheme :: Maybe Xsd.AnyURI
}
deriving (Eq,Show)
instance SchemaType Validation where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ do
a0 <- optional $ getAttribute "validationScheme" e pos
reparse [CElem e pos]
v <- parseSchemaType s
return $ Validation v (ValidationAttributes a0)
schemaTypeToXML s (Validation bt at) =
addXMLAttributes [ maybe [] (toXMLAttribute "validationScheme") $ validAttrib_validationScheme at
]
$ schemaTypeToXML s bt
instance Extension Validation Scheme where
supertype (Validation s _) = s
data VersionedContractId = VersionedContractId
{ versiContrId_contractId :: Maybe ContractId
, versiContrId_version :: Maybe Xsd.NonNegativeInteger
, versiContrId_effectiveDate :: Maybe IdentifiedDate
}
deriving (Eq,Show)
instance SchemaType VersionedContractId where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return VersionedContractId
`apply` optional (parseSchemaType "contractId")
`apply` optional (parseSchemaType "version")
`apply` optional (parseSchemaType "effectiveDate")
schemaTypeToXML s x@VersionedContractId{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "contractId") $ versiContrId_contractId x
, maybe [] (schemaTypeToXML "version") $ versiContrId_version x
, maybe [] (schemaTypeToXML "effectiveDate") $ versiContrId_effectiveDate x
]
data VersionedTradeId = VersionedTradeId
{ versiTradeId_tradeId :: Maybe TradeId
, versiTradeId_version :: Maybe Xsd.NonNegativeInteger
, versiTradeId_effectiveDate :: Maybe IdentifiedDate
}
deriving (Eq,Show)
instance SchemaType VersionedTradeId where
parseSchemaType s = do
(pos,e) <- posnElement [s]
commit $ interior e $ return VersionedTradeId
`apply` optional (parseSchemaType "tradeId")
`apply` optional (parseSchemaType "version")
`apply` optional (parseSchemaType "effectiveDate")
schemaTypeToXML s x@VersionedTradeId{} =
toXMLElement s []
[ maybe [] (schemaTypeToXML "tradeId") $ versiTradeId_tradeId x
, maybe [] (schemaTypeToXML "version") $ versiTradeId_version x
, maybe [] (schemaTypeToXML "effectiveDate") $ versiTradeId_effectiveDate x
]
elementInstrumentTradeDetails :: XMLParser InstrumentTradeDetails
elementInstrumentTradeDetails = parseSchemaType "instrumentTradeDetails"
elementToXMLInstrumentTradeDetails :: InstrumentTradeDetails -> [Content ()]
elementToXMLInstrumentTradeDetails = schemaTypeToXML "instrumentTradeDetails"
elementStrategy :: XMLParser Strategy
elementStrategy = parseSchemaType "strategy"
elementToXMLStrategy :: Strategy -> [Content ()]
elementToXMLStrategy = schemaTypeToXML "strategy"